Browse Source

Merge branch 'online1'

yonge 3 years ago
parent
commit
70924205b3

+ 8 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/DegreeRegistrationServiceImpl.java

@@ -13,6 +13,7 @@ import com.ym.mec.biz.service.SysUserCashAccountService;
 import com.ym.mec.common.constant.CommonConstants;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.date.DateUtil;
 
 import org.apache.commons.lang3.StringUtils;
@@ -306,7 +307,7 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
                 deductBalance = userCashAccount.getBalance();
             }
             amount = amount.subtract(deductBalance);
-            sysUserCashAccountService.updateBalance(userId, deductBalance.negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐团续费");
+            sysUserCashAccountService.updateBalance(userId, deductBalance.negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "考级报名");
         }else{
             studentPaymentOrder.setActualAmount(amount);
             studentPaymentOrder.setBalancePaymentAmount(BigDecimal.ZERO);
@@ -591,6 +592,12 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
             }
         }
 
+        if (studentPaymentOrder.getStatus() == DealStatusEnum.CLOSE || studentPaymentOrder.getStatus() == DealStatusEnum.FAILED) {
+            if (studentPaymentOrder.getBalancePaymentAmount() != null && studentPaymentOrder.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
+                sysUserCashAccountService.updateBalance(studentPaymentOrder.getUserId(), studentPaymentOrder.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS, "支付失败-退回");
+            }
+        }
+
         if(Objects.isNull(studentPaymentOrder.getClassGroupId())){
             return true;
         }