Parcourir la source

物料、供应商bug

tanzhongran il y a 3 ans
Parent
commit
0ec2a06a85

+ 3 - 3
abi-cloud-qr-platform-common/src/main/java/com/abi/task/common/excel/preperties/FactoryProperty.java

@@ -36,13 +36,13 @@ public class FactoryProperty implements AbstractExcelProperty {
     @ExcelHeadAlias(value = "详细地址")
     private String address;
 
-    @ExcelHeadAlias(value = "联系人姓名")
+    @ExcelHeadAlias(value = "联系人姓名(包材厂必填)")
     private String keymanName;
 
-    @ExcelHeadAlias(value = "联系人手机号")
+    @ExcelHeadAlias(value = "联系人手机号(包材厂必填)")
     private String keymanMobile;
 
-    @ExcelHeadAlias(value = "邮箱")
+    @ExcelHeadAlias(value = "邮箱(包材厂必填)")
     private String email;
 
     @ExcelHeadAlias(value = "文件最大数")

+ 1 - 1
abi-cloud-qr-platform-common/src/main/java/com/abi/task/common/excel/preperties/MaterialProperty.java

@@ -16,7 +16,7 @@ public class MaterialProperty implements AbstractExcelProperty {
     @ExcelHeadAlias(value = "物料号(必填)")
     private String materialCode;
 
-    @ExcelHeadAlias(value = "物料类型(必填)(枚举:瓶盖、纸板箱、塑箱)")
+    @ExcelHeadAlias(value = "物料类型(必填)(枚举:罐子、瓶盖、纸板箱)")
     private String materialType;
 
     @ExcelHeadAlias(value = "二维码(必填)(枚举:是、否)")

+ 11 - 3
abi-cloud-qr-platform-common/src/main/java/com/abi/task/common/utils/IMathUtils.java

@@ -1,5 +1,9 @@
 package com.abi.task.common.utils;
 
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+@Slf4j
 public class IMathUtils {
 
     /**
@@ -20,11 +24,15 @@ public class IMathUtils {
      * @return
      */
     public static Long toLong(String str){
-        if(str==null){
+        if(StringUtils.isBlank(str)){
+            return null;
+        }
+        try{
+            return Long.valueOf(str);
+        }catch(Exception e){
+            log.error("toLong error",e);
             return null;
         }
-
-        return Long.valueOf(str);
     }
 
 }

+ 2 - 1
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/FactoryServiceImpl.java

@@ -25,6 +25,7 @@ import com.abi.qms.platform.service.FactoryService;
 import com.abi.task.common.api.exception.BusinessException;
 import com.abi.task.common.api.exception.ErrorCodeEnum;
 import com.abi.task.common.excel.preperties.FactoryProperty;
+import com.abi.task.common.utils.IMathUtils;
 import com.abi.task.common.utils.PojoConverterUtils;
 import com.baomidou.mybatisplus.core.conditions.query.Query;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -266,7 +267,7 @@ public class FactoryServiceImpl implements FactoryService {
                     req.setKeymanMobile(factoryProperty.getKeymanMobile());
                     req.setEmail(factoryProperty.getEmail());
                 }
-                req.setMaxFileCount(Long.valueOf(factoryProperty.getMaxFileCount()));
+                req.setMaxFileCount(IMathUtils.toLong(factoryProperty.getMaxFileCount()));
                 req.setDescription(factoryProperty.getDescription());
 
                 saveFactory(req);