浏览代码

Merge remote-tracking branch 'origin/master'

Joburgess 4 年之前
父节点
当前提交
c32d3b6209
共有 1 个文件被更改,包括 11 次插入4 次删除
  1. 11 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

+ 11 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -34,6 +34,8 @@ import java.math.BigDecimal;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import static com.ym.mec.biz.dal.enums.DealStatusEnum.*;
+
 @Service
 public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRepair> implements StudentRepairService {
     private static final Logger log = LoggerFactory.getLogger(StudentRepairServiceImpl.class);
@@ -117,10 +119,15 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
             } else {
                 studentGoodsSell.setIsUseBalancePayment(false);
             }
-            orderByOrderNo.setStatus(DealStatusEnum.CLOSE);
-            studentPaymentOrderService.update(orderByOrderNo);
-            if (orderByOrderNo.getBalancePaymentAmount() != null && orderByOrderNo.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
-                sysUserCashAccountService.updateBalance(orderByOrderNo.getUserId(), orderByOrderNo.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS, "关闭订单");
+
+            if (orderByOrderNo.getStatus() == SUCCESS) {
+                throw new BizException("您已支付请勿重复提交");
+            }else if(orderByOrderNo.getStatus() == ING){
+                orderByOrderNo.setStatus(CLOSE);
+                studentPaymentOrderService.update(orderByOrderNo);
+                if (orderByOrderNo.getBalancePaymentAmount() != null && orderByOrderNo.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
+                    sysUserCashAccountService.updateBalance(orderByOrderNo.getUserId(), orderByOrderNo.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS, "关闭订单");
+                }
             }
             StudentGoodsSell byOrderNo = studentGoodsSellDao.findByOrderNo(studentGoodsSell.getOrderNo());
             if (byOrderNo != null) {