瀏覽代碼

no message

FengChaoYu 10 月之前
父節點
當前提交
e2114b492b

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

@@ -558,6 +558,7 @@ public class WebsitGoodsLogic {
 
         for (int i = 0; i < objects.size(); i++) {
             List<Object> row = (List<Object>) objects.get(i);
+            CommonUtils.initList2(row, 11);
             if (row.size() < 8) {
                 row.add(null);
                 row.add(null);
@@ -597,9 +598,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(7);
-            String remark = (String) row.get(8);
+            String partType = (String) row.get(7);
+            String goodsCodeStr = (String) row.get(8);
+            String remark = (String) row.get(9);
 
 //            Integer count = websitGoodsService.lambdaQuery()
 //                    .eq(WebsitGoods::getCompanyWechatId, companyWechatId)
@@ -646,9 +647,9 @@ public class WebsitGoodsLogic {
                 throw new RemoteServiceException("第" + (i + 1) + "行, 自有库存师傅分账金额不能大于收费标准");
             }
 
-//            if (outAmount.compareTo(normAmount) > 0) {
-//                throw new RemoteServiceException("第" + (i + 1) + "行, 外购配件师傅分账金额不能大于收费标准");
-//            }
+            if ("空调-冰箱-生活电器".contains(partType)) {
+                throw new RemoteServiceException("第" + (i + 1) + "行, 配件类型错误");
+            }
 
 
             WebsitGoods goods = new WebsitGoods();
@@ -674,6 +675,7 @@ public class WebsitGoodsLogic {
             goods.setGoodsSalesUnit(unitStr);
             goods.setManageWorkerStock(JudgeEnum.YES.getKey());
             goods.setNormType(NormTypeEnum.M.getKey());
+            goods.setPartType(partType);
 
             goodsList.add(goods);
         }

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