Pārlūkot izejas kodu

订单中放进,乐团跟声部

周箭河 5 gadi atpakaļ
vecāks
revīzija
01b2652ce6

+ 21 - 16
src/main/java/com/ym/mec/collectfee/controller/YqPayController.java

@@ -424,6 +424,7 @@ public class YqPayController extends BaseController {
             return;
         }
         HashMap<String, Object> upMap = new HashMap<>();
+        upMap.put("id", order.getId());
         upMap.put("oldStatus", 1);
         upMap.put("status", status);
         upMap.put("bank", rpMap.get("channelType"));
@@ -431,27 +432,13 @@ public class YqPayController extends BaseController {
         if (order.getPayId() == null) {
             upMap.put("payId", rpMap.get("orderNo"));
         }
+        ApplyInfo applyInfo = applyInfoService.get(order.getUserId());
         if (status == 2) {
             upMap.put("pay", rpMap.get("totalMoney"));
             upMap.put("payTime", new Date());
-            //推送mec
             if (order.getTuiFee() != null) { //乐团报名
-                ApplyInfo applyInfo = applyInfoService.get(order.getUserId());
                 applyInfo.setStatus(1);
                 applyInfoService.update(applyInfo);
-                applyInfoService.userRegister(applyInfo.getPatriarchPhone(), order.getId()); //推送mec
-                schoolService.sendPayMsg(applyInfo.getPatriarchPhone(), order.getAmount().toString());
-            } else {
-                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) {
@@ -469,6 +456,24 @@ public class YqPayController extends BaseController {
             }
         }
         orderService.updateByIdAndStatus(upMap);
-    }
 
+        //推送mec
+        if (status == 2) {
+            if (order.getTuiFee() != null) { //乐团报名
+                applyInfoService.userRegister(applyInfo.getPatriarchPhone(), order.getId()); //推送mec
+                schoolService.sendPayMsg(applyInfo.getPatriarchPhone(), order.getAmount().toString());
+            } else {
+                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);
+            }
+        }
+    }
 }