|
@@ -359,30 +359,17 @@ public class YqPayController extends BaseController {
|
|
|
msg.setMsg("fail");
|
|
|
Order order = null;
|
|
|
NotifyMsg notifyMsg = null;
|
|
|
+ Map<String, String> notifyMap = new HashMap<>();
|
|
|
if (rs) {
|
|
|
- Map<String, String> notifyMap = JSON.parseObject(msg.getResponseParameters(), Map.class);
|
|
|
- String merMerOrderNo = notifyMsg.getMerMerOrderNo(); //自己系统订单号
|
|
|
- order = orderService.getOrderByOrderNo(merMerOrderNo);
|
|
|
+ notifyMap = JSON.parseObject(msg.getResponseParameters(), Map.class);
|
|
|
}
|
|
|
//支付中订单存在,更新状态
|
|
|
- if (order != null && msg.getResponseType().equals("1")) {
|
|
|
- //更新订单状态
|
|
|
- HashMap<String, Object> upMap = new HashMap<>();
|
|
|
- upMap.put("oldStatus", order.getStatus());
|
|
|
- int status = msg.getCode().equals("88") ? 2 : 0;
|
|
|
- upMap.put("status", status);
|
|
|
- upMap.put("bank", notifyMsg.getChannelType());//支付通道
|
|
|
- if (order.getOrderNo().isEmpty()) {
|
|
|
- upMap.put("payId", notifyMsg.getOrderNo());//更新易乾付订单号
|
|
|
- }
|
|
|
- if (status == 2) {
|
|
|
- upMap.put("pay", notifyMsg.getPayAmount());
|
|
|
- upMap.put("payTime", new Date());//付款时间
|
|
|
- }
|
|
|
- // orderService.updateByIdAndStatus(upMap);
|
|
|
- //ApplyInfo applyInfo = applyInfoService.get(order.getUserId());
|
|
|
- //applyInfoService.userRegister(applyInfo.getPatriarchPhone(), order.getId()); //推送mec
|
|
|
-
|
|
|
+ if (msg.getResponseType().equals("1") && notifyMap.size() > 0) {
|
|
|
+ String tradeState = msg.getCode().equals("88") ? "1" : "0";
|
|
|
+ notifyMap.put("tradeState", tradeState);
|
|
|
+ notifyMap.put("totalMoney", notifyMap.get("payAmount"));
|
|
|
+ notifyMap.put("merOrderNo", notifyMap.get("merMerOrderNo"));
|
|
|
+ this.updateOrder(notifyMap);
|
|
|
msg.setCode("000000");
|
|
|
msg.setMsg("success");
|
|
|
}
|