瀏覽代碼

4/6 新增产品类别时许可费率为非必传,对许可费率进行判断需要先判断是否为Null

chendayu 2 年之前
父節點
當前提交
017d50e940
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      PAS/src/main/java/cn/cslg/pas/service/impl/ProductCategoryServiceImpl.java

+ 1 - 1
PAS/src/main/java/cn/cslg/pas/service/impl/ProductCategoryServiceImpl.java

@@ -65,7 +65,7 @@ public class ProductCategoryServiceImpl implements IProductCategoryService {
 
         //检查许可费率数值是否合法
         Double licenseRate = productCategoryAddNewDTO.getLicenseRate();
-        if (licenseRate < 0 || licenseRate > 1) {
+        if (licenseRate != null && (licenseRate < 0 || licenseRate > 1)) {
             String message = "新增产品失败,许可费率不合法,请填写正确数值";
             log.info("{}", message);
             throw new XiaoShiException(message);