Browse Source

no message

FengChaoYu 7 months ago
parent
commit
a9598bc957

+ 4 - 1
mall-server-api/src/main/java/com/gree/mall/manager/bean/material/stock/WebsitStockDTO.java

@@ -134,7 +134,10 @@ public class WebsitStockDTO {
         }
         BigDecimal direct = this.directFlag.equals(DirectFlagEnum.ADD.getKey()) ? BigDecimal.ONE : new BigDecimal("-1");
         BigDecimal closeQty = qty.add(this.changeQty.multiply(direct));
-        if (closeQty.compareTo(BigDecimal.ZERO) < 0 && direct.compareTo(BigDecimal.ZERO) < 0 && !this.getRefType().equals("销售订单")) {
+//        if (closeQty.compareTo(BigDecimal.ZERO) < 0 && direct.compareTo(BigDecimal.ZERO) < 0 && !this.getRefType().equals("销售订单")) {
+//            throw new RemoteServiceException("\""+ websitStock.getGoodsName() + "\"商品库存不允许为负");
+//        }
+        if (closeQty.compareTo(BigDecimal.ZERO) < 0 && direct.compareTo(BigDecimal.ZERO) < 0) {
             throw new RemoteServiceException("\""+ websitStock.getGoodsName() + "\"商品库存不允许为负");
         }
         // 注入三级帐

+ 7 - 10
mall-server-api/src/main/java/com/gree/mall/manager/logic/material/manage/WebsitSalesLogic.java

@@ -729,8 +729,12 @@ public class WebsitSalesLogic {
         String batchId = StrUtil.uuid();
         AdminUserCom adminUser = commonLogic.getAdminUser();
 
-        String companyWechatId = Objects.nonNull(adminUser.getAdminCompanyWechat()) ? adminUser.getAdminCompanyWechat().getCompanyWechatId() : null;
-        String companyName = Objects.nonNull(adminUser.getAdminCompanyWechat()) ? adminUser.getAdminCompanyWechat().getCompanyName() : null;
+        if (adminUser.getType() == 2) {
+            throw new RemoteServiceException("平台账号禁止操作");
+        }
+
+        String companyWechatId = adminUser.getAdminCompanyWechat().getCompanyWechatId();
+        String companyName = adminUser.getAdminCompanyWechat().getCompanyName();
 
         List<WebsitGoods> websitGoods = websitGoodsService.lambdaQuery()
                 .eq(WebsitGoods::getCompanyWechatId, companyWechatId)
@@ -799,14 +803,7 @@ public class WebsitSalesLogic {
 
         for (int i = 0; i < objects.size(); i++) {
             List<Object> row = (List<Object>) objects.get(i);
-            if (row.size() < 6) {
-                row.add("");
-            }
-
-            if (row.size() < 7) {
-                row.add("");
-                row.add("");
-            }
+            row = CommonUtils.initList2(row, 10);
 
             if (Objects.isNull(row.get(0))) {
                 throw new RemoteServiceException("第" + (i + 1) + "行, 网点名称不能为空");