|
@@ -111,6 +111,7 @@ public class YqPayController extends BaseController {
|
|
|
}
|
|
|
|
|
|
amount = amount.add(adjunctPrice);
|
|
|
+ order.setGroupId(courseGroupInfo.getId());
|
|
|
order.setAmount(amount);
|
|
|
order.setRemark(instrumentName);
|
|
|
order.setTuiFee(courseFee);
|
|
@@ -437,7 +438,7 @@ public class YqPayController extends BaseController {
|
|
|
}
|
|
|
orderService.update(order);
|
|
|
ApplyInfo applyInfo = applyInfoService.get(order.getUserId());
|
|
|
- applyInfoService.userRegister(applyInfo.getPatriarchPhone(),order.getId()); //推送mec
|
|
|
+ applyInfoService.userRegister(applyInfo.getPatriarchPhone(), order.getId()); //推送mec
|
|
|
|
|
|
msg.setCode("000000");
|
|
|
msg.setMsg("success");
|
|
@@ -498,20 +499,29 @@ public class YqPayController extends BaseController {
|
|
|
order.setPay(order.getAmount());
|
|
|
order.setPayTime(new Date());
|
|
|
//推送mec
|
|
|
- if (order.getTuiFee() != null) {
|
|
|
+ if (order.getTuiFee() != null) { //乐团报名
|
|
|
ApplyInfo applyInfo = applyInfoService.get(order.getUserId());
|
|
|
applyInfo.setStatus(1);
|
|
|
applyInfoService.update(applyInfo);
|
|
|
- applyInfoService.userRegister(applyInfo.getPatriarchPhone(),order.getId()); //推送mec
|
|
|
+ applyInfoService.userRegister(applyInfo.getPatriarchPhone(), order.getId()); //推送mec
|
|
|
} else {
|
|
|
- //RenewBean renewals = renewalsService.getRenewalsByOrderId(order.getId());
|
|
|
- //applyInfoService.pushRenew(renewals);
|
|
|
+ Renewals renewals = renewalsService.getRenewalsByOrderId(order.getId());
|
|
|
+ RenewBean renewBean = new RenewBean();
|
|
|
+ renewBean.setUserId(renewals.getUserId());
|
|
|
+ renewBean.setClassId(renewals.getClassId());
|
|
|
+ renewBean.setWay(renewals.getWay());
|
|
|
+ renewBean.setPay(renewals.getPay());
|
|
|
+ renewBean.setChargeMode(renewals.getChangeMode());
|
|
|
+ renewBean.setBuy(new BigDecimal(renewals.getBuy()));
|
|
|
+ renewBean.setPrice(renewals.getPrice());
|
|
|
+ applyInfoService.pushRenew(renewBean);
|
|
|
}
|
|
|
}
|
|
|
//失败减去已收款金额,减去报名人数
|
|
|
if (status == 0 && order.getTuiFee() != null) {
|
|
|
-// CourseGroupInfoService.get()
|
|
|
-// courseGroupInfo.setRegNum(courseGroupInfo.getRegNum() + 1);
|
|
|
+ CourseGroupInfo courseGroupInfo = CourseGroupInfoService.get(order.getGroupId());
|
|
|
+ courseGroupInfo.setRegNum(courseGroupInfo.getRegNum() - 1);
|
|
|
+ CourseGroupInfoService.upByIdAndVersion(courseGroupInfo);
|
|
|
}
|
|
|
orderService.update(order);
|
|
|
}
|