fix: 年度计划导入BUG
This commit is contained in:
+4
-6
@@ -667,7 +667,7 @@ public class ProcessEsAnnualInitServiceImpl extends ServiceImpl<ProcessEsAnnualI
|
||||
String enNameCode = plan.getEnNameCode();
|
||||
String standardCategoryCode = plan.getStandardCategoryCode();
|
||||
// 检查企标编号是否有效
|
||||
if (StrUtil.isBlank(originEnStandardNo)) {
|
||||
if (StrUtil.isBlank(enStandardCode)) {
|
||||
errMsg.append("'企业标准代号'不能为空。");
|
||||
} else {
|
||||
// 检查企业标准代号
|
||||
@@ -675,7 +675,7 @@ public class ProcessEsAnnualInitServiceImpl extends ServiceImpl<ProcessEsAnnualI
|
||||
errMsg.append("'企业标准代号'无效。");
|
||||
}
|
||||
}
|
||||
if (StrUtil.isBlank(originEnStandardNo)) {
|
||||
if (StrUtil.isBlank(enNameCode)) {
|
||||
errMsg.append("'企业名称代号'不能为空。");
|
||||
} else {
|
||||
// 检查企业标准代号
|
||||
@@ -683,7 +683,7 @@ public class ProcessEsAnnualInitServiceImpl extends ServiceImpl<ProcessEsAnnualI
|
||||
errMsg.append("'企业名称代号'无效。");
|
||||
}
|
||||
}
|
||||
if (StrUtil.isBlank(originEnStandardNo)) {
|
||||
if (StrUtil.isBlank(standardCategoryCode)) {
|
||||
errMsg.append("'标准类别代号'不能为空。");
|
||||
} else {
|
||||
// 检查企业标准代号
|
||||
@@ -692,9 +692,7 @@ public class ProcessEsAnnualInitServiceImpl extends ServiceImpl<ProcessEsAnnualI
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newEnStandardName.length() > 50) {
|
||||
errMsg.append("'新企标名称'过长(最多50字)。");
|
||||
}
|
||||
errMsg.append(excelUtils.validStandardName(newEnStandardName));
|
||||
return errMsg.toString();
|
||||
}
|
||||
}
|
||||
|
||||
+4
-6
@@ -503,7 +503,7 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
|
||||
String enNameCode = plan.getEnNameCode();
|
||||
String standardCategoryCode = plan.getStandardCategoryCode();
|
||||
// 检查企标编号是否有效
|
||||
if (StrUtil.isBlank(originEnStandardNo)) {
|
||||
if (StrUtil.isBlank(enStandardCode)) {
|
||||
errMsg.append("'企业标准代号'不能为空。");
|
||||
} else {
|
||||
// 检查企业标准代号
|
||||
@@ -511,7 +511,7 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
|
||||
errMsg.append("'企业标准代号'无效。");
|
||||
}
|
||||
}
|
||||
if (StrUtil.isBlank(originEnStandardNo)) {
|
||||
if (StrUtil.isBlank(enNameCode)) {
|
||||
errMsg.append("'企业名称代号'不能为空。");
|
||||
} else {
|
||||
// 检查企业标准代号
|
||||
@@ -519,7 +519,7 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
|
||||
errMsg.append("'企业名称代号'无效。");
|
||||
}
|
||||
}
|
||||
if (StrUtil.isBlank(originEnStandardNo)) {
|
||||
if (StrUtil.isBlank(standardCategoryCode)) {
|
||||
errMsg.append("'标准类别代号'不能为空。");
|
||||
} else {
|
||||
// 检查企业标准代号
|
||||
@@ -528,9 +528,7 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newEnStandardName.length() > 50) {
|
||||
errMsg.append("'新企标名称'过长(最多50字)。");
|
||||
}
|
||||
errMsg.append(excelUtils.validStandardName(newEnStandardName));
|
||||
return errMsg.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.jero.modules.laws.common.util.ImportUtil;
|
||||
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
||||
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
@@ -77,7 +78,7 @@ public class ExcelUtils {
|
||||
public static List<String> getHeaderFromExcel(InputStream is, Integer index) throws Exception {
|
||||
List<String> headers = new ArrayList<>();
|
||||
|
||||
Workbook workbook = new XSSFWorkbook(is);
|
||||
Workbook workbook = new HSSFWorkbook(is);
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
|
||||
// HeadRow在index 1
|
||||
@@ -403,4 +404,14 @@ public class ExcelUtils {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String validStandardName(String value) {
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return "新企标名称不能为空";
|
||||
}
|
||||
if (value.length() > 50) {
|
||||
return "'新企标名称'过长(最多50字)。";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user