认证-参数项-导入bug修改

This commit is contained in:
liyawei
2022-06-27 14:37:23 +08:00
parent 0493a60ac7
commit 15f5a1d6bd
2 changed files with 27 additions and 1 deletions
@@ -811,10 +811,18 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
// 第几个sheet页
if (numSheet == 0) { // 企业参数表
if (CutEnum.EN.getValue().equals(cut)) {
String fields[] ={ "*NIO Number", "*Is Must", "*Params Name","*Technical Field","*Params Batch","*Duty Territory",
"Description", "*Control Type", "Control Verify", "Control Values", "File Template"};
params.setImportFields(fields);
ExcelImportResult<ParamsInfoEnImport> resultEn = ExcelImportUtil.importExcelMore(excelfile,ParamsInfoEnImport.class, params);
List<ParamsInfoEnImport> paramsInfoEOListEn = resultEn.getList();
copyParamsInfoList(paramsInfoEOListEn, paramsInfoEOList);
} else {
String fields[] ={ "*NIO编号", "*是否必填", "*参数名称","*技术领域","*参数批次","*责任领域",
"参数说明", "*控件类型", "控件校验", "控件备选值", "附件模板"};
params.setImportFields(fields);
ExcelImportResult<ParamsInfoCnImport> result = ExcelImportUtil.importExcelMore(excelfile, ParamsInfoCnImport.class, params);
paramsInfoEOList = result.getList();
}
@@ -822,10 +830,16 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
if (certCategoryMap.containsKey(sheetName)) {
List<CertCategoryParamsInfoCnImport> list = new ArrayList<>();
if (CutEnum.EN.getValue().equals(cut)) {
String fields[] ={ "*NIO Number", "*Number", "*Params Name","Description"};
params.setImportFields(fields);
ExcelImportResult<CertCategoryParamsInfoEnImport> resultEn = ExcelImportUtil.importExcelMore(excelfile, CertCategoryParamsInfoEnImport.class, params);
List<CertCategoryParamsInfoEnImport> listEn = resultEn.getList();
copycertCategoryParamsInfoList(listEn, list);
} else {
String fields[] ={ "*NIO编号", "*编号", "*参数名称","参数说明"};
params.setImportFields(fields);
ExcelImportResult<CertCategoryParamsInfoCnImport> result = ExcelImportUtil.importExcelMore(excelfile, CertCategoryParamsInfoCnImport.class, params);
list = result.getList();
}
@@ -1326,6 +1340,18 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
resultMap = validateMustAndLength(paramsNumber, "编号", "Number", IsMustEnum.YES.getValue(),"15", false, cut);
errorMsg += (String)resultMap.get("errorMsg");
countError += (int)resultMap.get("countError");
if (StringUtils.isNotEmpty(ccDto.getParamsNumber())) {
// 校验编号 格式:字母数字横杠(-)
String numberRegex = "^[A-Za-z0-9-]+$";
if (!paramsNumber.matches(numberRegex)) {
if(CutEnum.CN.getValue().equals(cut)) {
errorMsg += "编号格式错误,仅能为字母,数字,横杠(-);";
} else {
errorMsg += "Number formatting errors, can only letters, numbers, dash (-);";
}
countError++;
}
}
// 参数名称
String paramsName = ccDto.getParamsName();
resultMap = validateMustAndLength(paramsName, "参数名称", "Params Name", IsMustEnum.YES.getValue(),"30", false, cut);
@@ -52,7 +52,7 @@ public class CertCategoryParamsInfoEnImport {
private String paramsName;
/**参数说明*/
@Excel(name = "参数说明", width = 36, orderNum = "4")
@Excel(name = "Description", width = 36, orderNum = "4")
@ApiModelProperty(value = "参数说明")
private String description;