| | |
| | | import com.stylefeng.guns.modular.system.dao.TaxiCardMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.CbyzxOrderPayHelper; |
| | | import com.stylefeng.guns.modular.system.util.GDMapGeocodingUtil; |
| | | import com.stylefeng.guns.modular.system.util.PayMoneyUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | @Autowired |
| | | private CbyzxOrderPayHelper cbyzxOrderPayHelper; |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | |
| | | |
| | | ResultUtil resultUtil = ResultUtil.success(); |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | resultUtil = payMoneyUtil.weixinpay("购买出行卡", "", ToolUtil.getRandomString(10), taxiCard.getSellingPrice().toString(), "/base/wxPayTaxiCardPaymentSpread", app, userInfo.getAppletsOpenId()); |
| | | paymentRecordService.saveData(4, taxiCardPayment.getUserId(), 1, taxiCardPayment.getId(), null, 1, taxiCard.getSellingPrice(), "", 1);//添加预支付数据 |
| | | String outTradeNo = "CARD_" + taxiCardPayment.getId() + "_" + ToolUtil.getRandomString(10); |
| | | JSONObject response = cbyzxOrderPayHelper.createOrder(taxiCardPayment.getUserId(), userInfo.getAppletsOpenId(), outTradeNo, taxiCard.getSellingPrice()); |
| | | if (!cbyzxOrderPayHelper.isCreateSuccess(response)) { |
| | | return ResultUtil.error(cbyzxOrderPayHelper.extractMessage(response), response); |
| | | } |
| | | String paymentCode = cbyzxOrderPayHelper.extractRecordCode(response); |
| | | paymentRecordService.saveData(4, taxiCardPayment.getUserId(), 1, taxiCardPayment.getId(), null, 1, taxiCard.getSellingPrice(), paymentCode != null ? paymentCode : outTradeNo, 1);//添加预支付数据 |
| | | resultUtil = ResultUtil.success(response); |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | | resultUtil = payMoneyUtil.alipay("购买出行卡", "购买出行卡", "", ToolUtil.getRandomString(10), taxiCard.getSellingPrice().toString(), "/base/aliPayTaxiCardPaymentSpread"); |