| | |
| | | */ |
| | | @ApiOperation("订单支付") |
| | | @PostMapping("orderPay") |
| | | public R<Map<String, Object>> orderPay(@RequestParam(value = "inspectionId") String inspectionId) { |
| | | public R<Map<String, Object>> orderPay(@RequestParam(value = "inspectionId") String inspectionId,@RequestParam(value = "orderType") Integer orderType) { |
| | | |
| | | TSysOtherConfig sysOtherConfig = sysOtherConfigService.getById(1); |
| | | if (Objects.isNull(sysOtherConfig.getAiPrice())) { |
| | | return R.fail("系统未配置AI支付价格"); |
| | | } |
| | | |
| | | String userId = tokenService.getLoginUserApplet().getUserId(); |
| | | TSysAppUser sysAppUser = sysAppUserService.getById(userId); |
| | | // 价格 |
| | |
| | | // 查询用户信息 用户openid |
| | | String openId = sysAppUser.getOpenId(); |
| | | // 存储支付记录 |
| | | sysPayRecordService.saveData(orderNo, userId, sysOtherConfig.getAiPrice(), 1); |
| | | sysPayRecordService.saveData(orderNo, userId, sysOtherConfig.getAiPrice(), 1, orderType); |
| | | // 调用支付方法 |
| | | Map<String, Object> result = wxV3Pay.jsApi(orderNo, totalPrice, openId,"AI检测报告支付",""); |
| | | log.info("支付参数:{}", result); |
| | |
| | | @TableField("last_reminder_time") |
| | | private LocalDateTime lastReminderTime; |
| | | |
| | | @ApiModelProperty(value = "会员到期时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("vip_end_time") |
| | | private LocalDateTime vipEndTime; |
| | | |
| | | @ApiModelProperty(value = "诊所id") |
| | | @TableField("clinic_id") |
| | | private String clinicId; |
| | |
| | | @TableField("pay_time") |
| | | private LocalDateTime payTime; |
| | | |
| | | |
| | | @ApiModelProperty(value = "购买类型 1单次 2包月") |
| | | @TableField("order_type") |
| | | private Integer orderType; |
| | | } |
| | |
| | | * @param aiPrice ai价格 |
| | | * @param state 支付状态 1=待支付 2=已支付 |
| | | */ |
| | | void saveData(String orderNo, String userId, BigDecimal aiPrice, Integer state); |
| | | void saveData(String orderNo, String userId, BigDecimal aiPrice, Integer state, Integer orderType); |
| | | |
| | | /** |
| | | * 检测支付报表 |
| | |
| | | public class TSysPayRecordServiceImpl extends ServiceImpl<TSysPayRecordMapper, TSysPayRecord> implements TSysPayRecordService { |
| | | |
| | | @Override |
| | | public void saveData(String orderNo, String userId, BigDecimal aiPrice, Integer state) { |
| | | public void saveData(String orderNo, String userId, BigDecimal aiPrice, Integer state, Integer orderType) { |
| | | TSysPayRecord sysPayRecord = new TSysPayRecord(); |
| | | sysPayRecord.setOrderNo(orderNo); |
| | | sysPayRecord.setAppUserId(userId); |
| | | sysPayRecord.setPayAmount(aiPrice); |
| | | sysPayRecord.setPayState(state); |
| | | sysPayRecord.setOrderType(orderType); |
| | | this.save(sysPayRecord); |
| | | } |
| | | |