fix: 企标导入解析标准号bug

This commit is contained in:
2023-09-27 17:25:34 +08:00
parent 7026489508
commit f63b6df1ab
@@ -83,30 +83,31 @@ public class ImportUtil {
if (!cellValue.matches("^[A-Z]{1,2}/[A-Z]{2} [1-9A-HJ-Z]\\d{4}-\\d{4}$")) {
log.error("" + (i + 1) + "行第" + (j + 1) + "列输入的标准编号格式不正确");
errMsgList.add("" + (i + 1) + "行第" + (j + 1) + "列输入的标准编号格式不正确");
} else {
// 拆分成两部分,前半部分和后半部分
String[] mainParts = cellValue.split(" ");
String firstPart = mainParts[0];
String secondPart = mainParts[1];
// 拆分前半部分获取企业标准代号和企业名称代号
String[] firstPartElements = firstPart.split("/");
String enterpriseStandardCode = firstPartElements[0];
String enterpriseNameCode = firstPartElements[1];
// 拆分后半部分获取标准类别代号,顺序号和年代号
String[] secondPartElements = secondPart.split("-");
String categoryAndSequence = secondPartElements[0];
String yearCode = secondPartElements[1];
// 从标准类别代号和顺序号字符串中分离出标准类别代号和顺序号
String categoryCode = categoryAndSequence.substring(0, 1);
// 转成字典值并存入
parameterMap.put(FieldCommon.ENTERPRISE_STANDARD_CODE, this.convertDictValue("enterprise_standard_code", enterpriseStandardCode));
parameterMap.put(FieldCommon.ENTERPRISE_NAME_CODE, this.convertDictValue("enterprise_name_code", enterpriseNameCode));
parameterMap.put(FieldCommon.STANDARD_CATEGORY_CODE, this.convertDictValue("standard_category_code", categoryCode));
parameterMap.put(FieldCommon.YEAR_NUMBER, yearCode);
}
// 拆分成两部分,前半部分和后半部分
String[] mainParts = cellValue.split(" ");
String firstPart = mainParts[0];
String secondPart = mainParts[1];
// 拆分前半部分获取企业标准代号和企业名称代号
String[] firstPartElements = firstPart.split("/");
String enterpriseStandardCode = firstPartElements[0];
String enterpriseNameCode = firstPartElements[1];
// 拆分后半部分获取标准类别代号,顺序号和年代号
String[] secondPartElements = secondPart.split("-");
String categoryAndSequence = secondPartElements[0];
String yearCode = secondPartElements[1];
// 从标准类别代号和顺序号字符串中分离出标准类别代号和顺序号
String categoryCode = categoryAndSequence.substring(0, 1);
// 转成字典值并存入
parameterMap.put(FieldCommon.ENTERPRISE_STANDARD_CODE, this.convertDictValue("enterprise_standard_code", enterpriseStandardCode));
parameterMap.put(FieldCommon.ENTERPRISE_NAME_CODE, this.convertDictValue("enterprise_name_code", enterpriseNameCode));
parameterMap.put(FieldCommon.STANDARD_CATEGORY_CODE, this.convertDictValue("standard_category_code", categoryCode));
parameterMap.put(FieldCommon.YEAR_NUMBER, yearCode);
}
}
if (FieldShowTypeEnum.SINGLE_DATE_PICKER.getValue().equals(tag.getFieldShowType())) {