FengChaoYu 8 ماه پیش
والد
کامیت
93cc64c8aa

+ 4 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/material/manage/WebsitMPurchaseLogic.java

@@ -215,10 +215,12 @@ public class WebsitMPurchaseLogic {
             if (bean.getFlag().equals(MaterialFlagEnum.SAVE.getKey())) {
                 // 检查进价范围值
                 if (Objects.nonNull(relaGoods.getCostRangeMini())
+                        && relaGoods.getCostRangeMini().compareTo(BigDecimal.ZERO) > 0
                         && itemBean.getApplyCost().compareTo(relaGoods.getCostRangeMini()) < 0) {
                     throw new RemoteServiceException(preStr + "不能低于辅材资料最小进价范围值");
                 }
                 if (Objects.nonNull(relaGoods.getCostRangeMax())
+                        && relaGoods.getCostRangeMax().compareTo(BigDecimal.ZERO) > 0
                         && itemBean.getApplyCost().compareTo(relaGoods.getCostRangeMax()) > 0) {
                     throw new RemoteServiceException(preStr + "不能高于辅材资料最大进价范围值");
                 }
@@ -236,10 +238,12 @@ public class WebsitMPurchaseLogic {
             } else if (bean.getFlag().equals(MaterialFlagEnum.SUBMIT.getKey())) {
                 // 检查进价范围值
                 if (Objects.nonNull(relaGoods.getCostRangeMini())
+                        && relaGoods.getCostRangeMini().compareTo(BigDecimal.ZERO) > 0
                         && itemBean.getCost().compareTo(relaGoods.getCostRangeMini()) < 0) {
                     throw new RemoteServiceException(preStr + "不能低于辅材资料最小进价范围值");
                 }
                 if (Objects.nonNull(relaGoods.getCostRangeMax())
+                        && relaGoods.getCostRangeMax().compareTo(BigDecimal.ZERO) > 0
                         && itemBean.getCost().compareTo(relaGoods.getCostRangeMax()) > 0) {
                     throw new RemoteServiceException(preStr + "不能高于辅材资料最大进价范围值");
                 }

+ 2 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/material/manage/WebsitPurchaseAdjustmentLogic.java

@@ -220,10 +220,12 @@ public class WebsitPurchaseAdjustmentLogic {
             WebsitGoods goods = goodsMap.get(item.getGoodsId());
             String preStr = "第" + (i+1) + "行, ";
             if (Objects.nonNull(goods.getCostRangeMini())
+                    && goods.getCostRangeMini().compareTo(BigDecimal.ZERO) > 0
                     && item.getAdjustCost().compareTo(goods.getCostRangeMini()) < 0) {
                 throw new RemoteServiceException(preStr + "不能低于辅材资料最小进价范围值");
             }
             if (Objects.nonNull(goods.getCostRangeMax())
+                    && goods.getCostRangeMax().compareTo(BigDecimal.ZERO) > 0
                     && item.getAdjustCost().compareTo(goods.getCostRangeMax()) > 0) {
                 throw new RemoteServiceException(preStr + "不能高于辅材资料最大进价范围值");
             }