| | |
| | | package com.stylefeng.guns.modular.call.server.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.account.controller.AppOrderController; |
| | |
| | | import com.stylefeng.guns.modular.system.model.SysIntegral; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.CbyzxOrderPayHelper; |
| | | import com.stylefeng.guns.modular.system.util.PayMoneyUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.UUIDUtil; |
| | |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | @Autowired |
| | | private CbyzxOrderPayHelper cbyzxOrderPayHelper; |
| | | |
| | | @Autowired |
| | | private IPaymentRecordService paymentRecordService; |
| | |
| | | OrderCall orderCall = this.selectById(orderId); |
| | | ResultUtil resultUtil = ResultUtil.success(); |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | resultUtil = payMoneyUtil.weixinpay("感谢费", "", orderId + "_7_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/wxPayThankYouFee", app, userInfo.getAppletsOpenId()); |
| | | paymentRecordService.saveData(3, uid, 1, orderId, 7, 1, money, "", 1);//添加预支付数据 |
| | | String outTradeNo = "THANK_" + orderId + "_7_" + UUIDUtil.getRandomCode(5); |
| | | JSONObject response = cbyzxOrderPayHelper.createOrder(orderCall.getUserId(), userInfo.getAppletsOpenId(), outTradeNo, money); |
| | | if (!cbyzxOrderPayHelper.isCreateSuccess(response)) { |
| | | return ResultUtil.error(cbyzxOrderPayHelper.extractMessage(response), response); |
| | | } |
| | | String paymentCode = cbyzxOrderPayHelper.extractRecordCode(response); |
| | | paymentRecordService.saveData(3, uid, 1, orderId, 7, 1, money, paymentCode != null ? paymentCode : outTradeNo, 1);//添加预支付数据 |
| | | resultUtil = ResultUtil.success(response); |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | | resultUtil = payMoneyUtil.alipay("感谢费", "感谢费", "", orderId + "_7_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/aliPayThankYouFee"); |