|
@@ -118,6 +118,8 @@ public class YqPayController extends BaseController {
|
|
|
|
|
|
ApplyInfo applyInfo = applyInfoService.get(order.getUserId());
|
|
ApplyInfo applyInfo = applyInfoService.get(order.getUserId());
|
|
|
|
|
|
|
|
+ order.setPoName(school.getName());
|
|
|
|
+ order.setVoicyPart(courseGroupInfo.getSubName());
|
|
order.setGroupId(courseGroupInfo.getId());
|
|
order.setGroupId(courseGroupInfo.getId());
|
|
order.setAmount(amount);
|
|
order.setAmount(amount);
|
|
order.setRemark(instrumentName);
|
|
order.setRemark(instrumentName);
|
|
@@ -208,7 +210,7 @@ public class YqPayController extends BaseController {
|
|
}
|
|
}
|
|
if (pickCourses.size() == 0) {
|
|
if (pickCourses.size() == 0) {
|
|
return failed("请选择续费课程");
|
|
return failed("请选择续费课程");
|
|
- };
|
|
|
|
|
|
+ }
|
|
|
|
|
|
String orderNo = GenerateNum.getInstance().GenerateOrderNo(); //自己系统订单号
|
|
String orderNo = GenerateNum.getInstance().GenerateOrderNo(); //自己系统订单号
|
|
//获取分佣账户
|
|
//获取分佣账户
|
|
@@ -359,23 +361,26 @@ public class YqPayController extends BaseController {
|
|
Order order = null;
|
|
Order order = null;
|
|
NotifyMsg notifyMsg = null;
|
|
NotifyMsg notifyMsg = null;
|
|
if (rs) {
|
|
if (rs) {
|
|
- notifyMsg = JSON.parseObject(msg.getResponseParameters(), NotifyMsg.class);
|
|
|
|
|
|
+ Map<String, String> notifyMap = JSON.parseObject(msg.getResponseParameters(), Map.class);
|
|
String merMerOrderNo = notifyMsg.getMerMerOrderNo(); //自己系统订单号
|
|
String merMerOrderNo = notifyMsg.getMerMerOrderNo(); //自己系统订单号
|
|
order = orderService.getOrderByOrderNo(merMerOrderNo);
|
|
order = orderService.getOrderByOrderNo(merMerOrderNo);
|
|
}
|
|
}
|
|
//支付中订单存在,更新状态
|
|
//支付中订单存在,更新状态
|
|
if (order != null && msg.getResponseType().equals("1")) {
|
|
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;
|
|
int status = msg.getCode().equals("88") ? 2 : 0;
|
|
- order.setStatus(status);
|
|
|
|
|
|
+ upMap.put("status", status);
|
|
|
|
+ upMap.put("bank", notifyMsg.getChannelType());//支付通道
|
|
if (order.getOrderNo().isEmpty()) {
|
|
if (order.getOrderNo().isEmpty()) {
|
|
- order.setPayId(notifyMsg.getOrderNo()); //更新易乾付订单号
|
|
|
|
|
|
+ upMap.put("payId", notifyMsg.getOrderNo());//更新易乾付订单号
|
|
}
|
|
}
|
|
if (status == 2) {
|
|
if (status == 2) {
|
|
- order.setPay(notifyMsg.getPayAmount());
|
|
|
|
- order.setPayTime(new Date());
|
|
|
|
|
|
+ upMap.put("pay", notifyMsg.getPayAmount());
|
|
|
|
+ upMap.put("payTime", new Date());//付款时间
|
|
}
|
|
}
|
|
- //orderService.update(order);
|
|
|
|
|
|
+ // orderService.updateByIdAndStatus(upMap);
|
|
//ApplyInfo applyInfo = applyInfoService.get(order.getUserId());
|
|
//ApplyInfo applyInfo = applyInfoService.get(order.getUserId());
|
|
//applyInfoService.userRegister(applyInfo.getPatriarchPhone(), order.getId()); //推送mec
|
|
//applyInfoService.userRegister(applyInfo.getPatriarchPhone(), order.getId()); //推送mec
|
|
|
|
|
|
@@ -431,18 +436,20 @@ public class YqPayController extends BaseController {
|
|
if (order == null) {
|
|
if (order == null) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- order.setStatus(status);
|
|
|
|
- order.setBank(rpMap.get("channelType"));
|
|
|
|
|
|
+ HashMap<String, Object> upMap = new HashMap<>();
|
|
|
|
+ upMap.put("oldStatus", 1);
|
|
|
|
+ upMap.put("status", status);
|
|
|
|
+ upMap.put("bank", rpMap.get("channelType"));
|
|
|
|
|
|
if (order.getPayId() == null) {
|
|
if (order.getPayId() == null) {
|
|
- order.setPayId(rpMap.get("orderNo")); //更新易乾付订单号
|
|
|
|
|
|
+ upMap.put("payId", rpMap.get("orderNo"));
|
|
}
|
|
}
|
|
if (status == 2) {
|
|
if (status == 2) {
|
|
- order.setPay(order.getAmount());
|
|
|
|
- order.setPayTime(new Date());
|
|
|
|
|
|
+ upMap.put("pay", rpMap.get("totalMoney"));
|
|
|
|
+ upMap.put("payTime", new Date());
|
|
//推送mec
|
|
//推送mec
|
|
- ApplyInfo applyInfo = applyInfoService.get(order.getUserId());
|
|
|
|
if (order.getTuiFee() != null) { //乐团报名
|
|
if (order.getTuiFee() != null) { //乐团报名
|
|
|
|
+ ApplyInfo applyInfo = applyInfoService.get(order.getUserId());
|
|
applyInfo.setStatus(1);
|
|
applyInfo.setStatus(1);
|
|
applyInfoService.update(applyInfo);
|
|
applyInfoService.update(applyInfo);
|
|
applyInfoService.userRegister(applyInfo.getPatriarchPhone(), order.getId()); //推送mec
|
|
applyInfoService.userRegister(applyInfo.getPatriarchPhone(), order.getId()); //推送mec
|
|
@@ -474,7 +481,7 @@ public class YqPayController extends BaseController {
|
|
CourseGroupInfoService.upByIdAndVersion(courseGroupInfo);
|
|
CourseGroupInfoService.upByIdAndVersion(courseGroupInfo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- orderService.update(order);
|
|
|
|
|
|
+ orderService.updateByIdAndStatus(upMap);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|