|
@@ -107,6 +107,9 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
|
|
|
TJoinpayMchService joinpayMchService;
|
|
|
|
|
|
@Autowired
|
|
|
+ WechatPayInfoService wechatPayInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private TOrderDetailsService orderDetailsService;
|
|
|
|
|
|
@Override
|
|
@@ -1392,10 +1395,27 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
|
|
|
wrapper.eq(TOrder::getStatus, 0);
|
|
|
TOrder order = orderService.getOne(wrapper);
|
|
|
JSONObject reslut = new JSONObject();
|
|
|
- try {
|
|
|
- reslut = huifuMchService.payWechat(order, openid);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ if (order != null) {
|
|
|
+ // 先查是否已下单
|
|
|
+ WechatPayInfo wechatPayInfo = wechatPayInfoService.getById(sn);
|
|
|
+ if (wechatPayInfo != null) {
|
|
|
+ JSONObject payInfoJson = new JSONObject();
|
|
|
+ payInfoJson.put("appId", wechatPayInfo.getAppId());
|
|
|
+ payInfoJson.put("timeStamp", wechatPayInfo.getTimeStamp());
|
|
|
+ payInfoJson.put("nonceStr", wechatPayInfo.getNonceStr());
|
|
|
+ payInfoJson.put("package", wechatPayInfo.getPackageValue());
|
|
|
+ payInfoJson.put("signType", "RSA");
|
|
|
+ payInfoJson.put("paySign", wechatPayInfo.getPaySign());
|
|
|
+ reslut.put("pay_info", payInfoJson.toString());
|
|
|
+ reslut.put("hf_seq_id", wechatPayInfo.getHfSeqId());
|
|
|
+ reslut.put("resp_code", "00000100");
|
|
|
+ return reslut;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ reslut = huifuMchService.payWechat(order, openid);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
return reslut;
|
|
|
}
|