‘linchangsheng’ 9 달 전
부모
커밋
eb1263bb7c
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      mall-server-api/src/main/java/com/gree/mall/manager/logic/websit/WebsitPartsRetLogic.java

+ 6 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/websit/WebsitPartsRetLogic.java

@@ -145,6 +145,9 @@ public class WebsitPartsRetLogic {
             websitSales.setRetAmount(websitSales.getRetAmount()
                     .add(websitPartsRetItem.getRefundAmount()));
 
+            if (websitSales.getRetAmount().doubleValue() > websitSales.getTotalAmount().doubleValue())
+                throw new RemoteServiceException(websitPartsRetItem.getGoodsName() + "超过了销售金额");
+
             websitSales.updateById();
             if (websitPartsRetItem.getRefundAmount() != null)
                 totalRefundAmount = totalRefundAmount.add(websitPartsRetItem.getRefundAmount());
@@ -240,6 +243,9 @@ public class WebsitPartsRetLogic {
             websitSales.setRetAmount(websitSales.getRetAmount()
                     .subtract(websitPartsRetItem.getRefundAmount()));
 
+            if (websitSales.getRetAmount().doubleValue() > websitSales.getTotalAmount().doubleValue())
+                throw new RemoteServiceException(websitPartsRetItem.getGoodsName() + "超过了销售金额");
+
 
             websitSales.updateById();