Forráskód Böngészése

配件资料去掉外购检查与逻辑

FengChaoYu 11 hónapja
szülő
commit
ce57eb3bdb

+ 32 - 31
mall-server-api/src/main/java/com/gree/mall/manager/logic/material/base/WebsitGoodsLogic.java

@@ -276,15 +276,15 @@ public class WebsitGoodsLogic {
                 }
             }
 
-            if (goods.getNormType().equals(NormTypeEnum.M.getKey()) && Objects.isNull(goods.getOutWorkerAmount())) {
-                throw new RemoteServiceException("外购配件师傅分账金额不能为空");
-            }
+//            if (goods.getNormType().equals(NormTypeEnum.M.getKey()) && Objects.isNull(goods.getOutWorkerAmount())) {
+//                throw new RemoteServiceException("外购配件师傅分账金额不能为空");
+//            }
 
             // 检查收费标准和分账金额
             BigDecimal selWorkerAmount = BigDecimal.ZERO;
             BigDecimal selWebsitAmount = BigDecimal.ZERO;
-            BigDecimal outWorkerAmount = BigDecimal.ZERO;
-            BigDecimal outWebsitAmount = BigDecimal.ZERO;
+//            BigDecimal outWorkerAmount = BigDecimal.ZERO;
+//            BigDecimal outWebsitAmount = BigDecimal.ZERO;
             if (goods.getNormType().equals(NormTypeEnum.M.getKey())) {
                 if (goods.getSelfWorkerAmount().compareTo(BigDecimal.ZERO) > 0) {
 
@@ -306,21 +306,22 @@ public class WebsitGoodsLogic {
                 selWebsitAmount = goods.getSelfWebsitAmount();
             }
 
-            if (Objects.nonNull(goods.getOutWorkerAmount())
-                    && goods.getOutWorkerAmount().compareTo(BigDecimal.ZERO) > 0) {
-                if (goods.getOutWorkerAmount().compareTo(goods.getNormAmount()) > 0) {
-                    throw new RemoteServiceException("外购库存师傅分账金额不能大于收费标准");
-                }
-                outWorkerAmount = goods.getOutWorkerAmount();
-                outWebsitAmount = goods.getNormAmount().subtract(outWorkerAmount);
-            } else {
-                outWebsitAmount = goods.getNormAmount();
-            }
+//            if (Objects.nonNull(goods.getOutWorkerAmount())
+//                    && goods.getOutWorkerAmount().compareTo(BigDecimal.ZERO) > 0) {
+//                if (goods.getOutWorkerAmount().compareTo(goods.getNormAmount()) > 0) {
+//                    throw new RemoteServiceException("外购库存师傅分账金额不能大于收费标准");
+//                }
+//                outWorkerAmount = goods.getOutWorkerAmount();
+//                outWebsitAmount = goods.getNormAmount().subtract(outWorkerAmount);
+//            } else {
+//                outWebsitAmount = goods.getNormAmount();
+//            }
 
             goods.setSelfWorkerAmount(selWorkerAmount)
                     .setSelfWebsitAmount(selWebsitAmount)
-                    .setOutWorkerAmount(outWorkerAmount)
-                    .setOutWebsitAmount(outWebsitAmount);
+//                    .setOutWorkerAmount(outWorkerAmount)
+//                    .setOutWebsitAmount(outWebsitAmount)
+            ;
 
         }
     }
@@ -544,11 +545,11 @@ public class WebsitGoodsLogic {
 
         for (int i = 0; i < objects.size(); i++) {
             List<Object> row = (List<Object>) objects.get(i);
-            if (row.size() < 9) {
+            if (row.size() < 8) {
                 row.add(null);
                 row.add(null);
             }
-            if (row.size() < 10) {
+            if (row.size() < 9) {
                 row.add(null);
             }
             if (Objects.isNull(row.get(0))) {
@@ -572,9 +573,9 @@ public class WebsitGoodsLogic {
             if (Objects.isNull(row.get(6))) {
                 throw new RemoteServiceException("第" + (i+1) + "行, 自有库存师傅分账金额不能为空");
             }
-            if (Objects.isNull(row.get(7))) {
-                throw new RemoteServiceException("第" + (i+1) + "行, 外购库存师傅分账金额不能为空");
-            }
+//            if (Objects.isNull(row.get(7))) {
+//                throw new RemoteServiceException("第" + (i+1) + "行, 外购库存师傅分账金额不能为空");
+//            }
 
             String goodsNameStr = (String) row.get(0);
             String unitStr = (String) row.get(1);
@@ -583,9 +584,9 @@ public class WebsitGoodsLogic {
             String brandStr = (String) row.get(4);
             String categoryStr = (String) row.get(5);
             String selfAmountStr = (String) row.get(6);
-            String outAmountStr = (String) row.get(7);
-            String goodsCodeStr = (String) row.get(8);
-            String remark = (String) row.get(9);
+//            String outAmountStr = (String) row.get(7);
+            String goodsCodeStr = (String) row.get(7);
+            String remark = (String) row.get(8);
 
 //            Integer count = websitGoodsService.lambdaQuery()
 //                    .eq(WebsitGoods::getCompanyWechatId, companyWechatId)
@@ -626,15 +627,15 @@ public class WebsitGoodsLogic {
 
             BigDecimal normAmount = new BigDecimal(normAmountStr);
             BigDecimal selfAmount = new BigDecimal(selfAmountStr);
-            BigDecimal outAmount = new BigDecimal(outAmountStr);
+//            BigDecimal outAmount = new BigDecimal(outAmountStr);
 
             if (selfAmount.compareTo(normAmount) > 0) {
                 throw new RemoteServiceException("第" + (i + 1) + "行, 自有库存师傅分账金额不能大于收费标准");
             }
 
-            if (outAmount.compareTo(normAmount) > 0) {
-                throw new RemoteServiceException("第" + (i + 1) + "行, 外购配件师傅分账金额不能大于收费标准");
-            }
+//            if (outAmount.compareTo(normAmount) > 0) {
+//                throw new RemoteServiceException("第" + (i + 1) + "行, 外购配件师傅分账金额不能大于收费标准");
+//            }
 
 
             WebsitGoods goods = new WebsitGoods();
@@ -649,8 +650,8 @@ public class WebsitGoodsLogic {
             goods.setNormAmount(normAmount);
             goods.setSelfWorkerAmount(selfAmount);
             goods.setSelfWebsitAmount(normAmount.subtract(selfAmount));
-            goods.setOutWorkerAmount(outAmount);
-            goods.setOutWebsitAmount(normAmount.subtract(outAmount));
+//            goods.setOutWorkerAmount(outAmount);
+//            goods.setOutWebsitAmount(normAmount.subtract(outAmount));
             goods.setBrandRelaName(brandStr);
             goods.setProductRelaName(categoryStr);
 

BIN
mall-server-api/src/main/resources/template/配件模板(配件物料).xlsx