Browse Source

修复订单支付失败后还会继续关闭退还余额的BUG

zouxuan 4 years ago
parent
commit
023d79c876

+ 7 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -1,7 +1,6 @@
 package com.ym.mec.biz.service.impl;
 package com.ym.mec.biz.service.impl;
 
 
-import static com.ym.mec.biz.dal.enums.DealStatusEnum.CLOSE;
-import static com.ym.mec.biz.dal.enums.DealStatusEnum.SUCCESS;
+import static com.ym.mec.biz.dal.enums.DealStatusEnum.*;
 import static com.ym.mec.biz.dal.enums.PaymentStatusEnum.YES;
 import static com.ym.mec.biz.dal.enums.PaymentStatusEnum.YES;
 
 
 import java.io.IOException;
 import java.io.IOException;
@@ -2145,11 +2144,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             if (oldStudentPaymentOrder != null) {
             if (oldStudentPaymentOrder != null) {
                 if (oldStudentPaymentOrder.getStatus() == SUCCESS) {
                 if (oldStudentPaymentOrder.getStatus() == SUCCESS) {
                     throw new BizException("您已支付请勿重复提交");
                     throw new BizException("您已支付请勿重复提交");
-                }
-                oldStudentPaymentOrder.setStatus(CLOSE);
-                studentPaymentOrderService.update(oldStudentPaymentOrder);
-                if (oldStudentPaymentOrder.getBalancePaymentAmount() != null && oldStudentPaymentOrder.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
-                    sysUserCashAccountService.updateBalance(oldStudentPaymentOrder.getUserId(), oldStudentPaymentOrder.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS, "关闭订单");
+                }else if(oldStudentPaymentOrder.getStatus() == ING){
+                    oldStudentPaymentOrder.setStatus(CLOSE);
+                    studentPaymentOrderService.update(oldStudentPaymentOrder);
+                    if (oldStudentPaymentOrder.getBalancePaymentAmount() != null && oldStudentPaymentOrder.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
+                        sysUserCashAccountService.updateBalance(oldStudentPaymentOrder.getUserId(), oldStudentPaymentOrder.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS, "关闭订单");
+                    }
                 }
                 }
             }
             }
         }
         }