Преглед изворни кода

设备子系统———保修商导入报错提示出现重复问题优化

zhoudazhuang пре 1 година
родитељ
комит
cdb6aff15c

+ 5 - 5
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquWarrantyProviderServiceImpl.java

@@ -50,7 +50,6 @@ public class EquWarrantyProviderServiceImpl extends ServiceImpl<EquWarrantyProvi
         try {
             StringBuilder allStrBuilder = new StringBuilder();
             Sheet sheet = new XSSFWorkbook(file.getInputStream()).getSheetAt(0);
-            StringBuilder stringBuilder = new StringBuilder();
             int lastRowNum = sheet.getLastRowNum();
             List<EquWarrantyProviderDo> equWarrantyProviderDos = new ArrayList<>();
             List<String> factorys = new ArrayList<>();
@@ -59,6 +58,7 @@ public class EquWarrantyProviderServiceImpl extends ServiceImpl<EquWarrantyProvi
             String factoryId = "";
             String deptId = "";
             for (int i = 1; i <= lastRowNum; i++) {
+                StringBuilder stringBuilder = new StringBuilder();
                 EquWarrantyProviderDo equWarrantyProviderDo = new EquWarrantyProviderDo();
                 Row row = sheet.getRow(i);
                 if (ExcelUtils.isRowEmpty(row)){
@@ -76,10 +76,10 @@ public class EquWarrantyProviderServiceImpl extends ServiceImpl<EquWarrantyProvi
                 if (StringUtils.isNotBlank(code)){
                     code = StringUtil.formatDecimal(code);
                 }else {
-                    stringBuilder.append("保修商编号不能为空");
+                    stringBuilder.append("保修商编号必填");
                 }
                 if (StringUtils.isBlank(name)){
-                    stringBuilder.append("保修商名称不能为空");
+                    stringBuilder.append("保修商名称必填");
                 }
                 if (StringUtils.isNotBlank(zuscc)){
                     if (StringUtil.isScience(zuscc)){
@@ -87,7 +87,7 @@ public class EquWarrantyProviderServiceImpl extends ServiceImpl<EquWarrantyProvi
                         zuscc = formatAccount.setScale(0,BigDecimal.ROUND_HALF_UP).toPlainString();
                     }
                 }else {
-                    stringBuilder.append("统一社会信用代码不能为空");
+                    stringBuilder.append("统一社会信用代码必填");
                 }
                 boolean containFactory = factorys.contains(factory);
                 boolean containName = names.contains(name);
@@ -141,7 +141,7 @@ public class EquWarrantyProviderServiceImpl extends ServiceImpl<EquWarrantyProvi
                         }
                     }
                 }else {
-                    stringBuilder.append("所属工厂不能为空");
+                    stringBuilder.append("所属工厂必填");
                 }
                 if (StringUtils.isNotBlank(dept)){
                     deptId = commonDao.getIdByFactoryIdAndDept(factoryId,dept);