认证-参数模板-英文统一
This commit is contained in:
+10
-10
@@ -11,16 +11,16 @@ import java.util.Map;
|
||||
* @Date: Created in 15:51 2022/4/22
|
||||
*/
|
||||
public enum ControlTypeEnum {
|
||||
TEXT("文本", "text","1"),
|
||||
PULL_SINGLE("下拉单选","pull single","2"),
|
||||
PULL_MORE("下拉多选","pull more","3"),
|
||||
FILE("附件","file","4"),
|
||||
TEXT_PULL_SINGLE("文本+下拉单选","text+pull single","5"),
|
||||
TEXT_PULL_MORE("文本+下拉多选","text+pull more","6"),
|
||||
TEXT_FILE("文本+附件","text+file","7"),
|
||||
PULL_SINGLE_FILE("下拉单选+附件","pull single+file","8"),
|
||||
PULL_MORE_FILE("下拉多选+附件","pull more+file","9"),
|
||||
TEXT_PULL_SINGLE_FILE("文本+下拉单选+附件","text+pull single file","10");
|
||||
TEXT("文本", "Text","1"),
|
||||
PULL_SINGLE("下拉单选","Pull single","2"),
|
||||
PULL_MORE("下拉多选","Pull more","3"),
|
||||
FILE("附件","File","4"),
|
||||
TEXT_PULL_SINGLE("文本+下拉单选","Text+Pull single","5"),
|
||||
TEXT_PULL_MORE("文本+下拉多选","Text+Pull more","6"),
|
||||
TEXT_FILE("文本+附件","Text+File","7"),
|
||||
PULL_SINGLE_FILE("下拉单选+附件","Pull single+File","8"),
|
||||
PULL_MORE_FILE("下拉多选+附件","Pull more+File","9"),
|
||||
TEXT_PULL_SINGLE_FILE("文本+下拉单选+附件","Text+Pull single+File","10");
|
||||
|
||||
String name;
|
||||
String enName;
|
||||
|
||||
+9
-9
@@ -11,15 +11,15 @@ import java.util.Map;
|
||||
* @Date: Created in 15:58 2022/4/22
|
||||
*/
|
||||
public enum ControlVerifyEnum {
|
||||
NULL("无","null","1"),
|
||||
CHINESE("中文","chinese","2"),
|
||||
POSITIVE_INTEGER("正整数","positive integer","3"),
|
||||
POSITIVE_FLOAT("正浮点数","positive float","4"),
|
||||
INTEGER_DECIMAL("整数或小数","integer decimal","5"),
|
||||
DECIMAL_ONE("一位小数","decimal one","6"),
|
||||
DECIMAL_TWO("两位小数","decimal two","7"),
|
||||
DECIMAL_THREE("三位小数","decimal three","8"),
|
||||
DECIMAL_FOUR("四位小数","decimal four","9");
|
||||
NULL("无","Null","1"),
|
||||
CHINESE("中文","Chinese","2"),
|
||||
POSITIVE_INTEGER("正整数","Positive integer","3"),
|
||||
POSITIVE_FLOAT("正浮点数","Positive float","4"),
|
||||
INTEGER_DECIMAL("整数或小数","Integer decimal","5"),
|
||||
DECIMAL_ONE("一位小数","Decimal one","6"),
|
||||
DECIMAL_TWO("两位小数","Decimal two","7"),
|
||||
DECIMAL_THREE("三位小数","Decimal three","8"),
|
||||
DECIMAL_FOUR("四位小数","Decimal four","9");
|
||||
|
||||
String name;
|
||||
String enName;
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@ import java.util.Map;
|
||||
* @Date: Created in 11:20 2022/4/14
|
||||
*/
|
||||
public enum ParamsIsMustEnum {
|
||||
YES("是","yes","1"),
|
||||
NO("否","no","0");
|
||||
YES("是","Yes","1"),
|
||||
NO("否","No","0");
|
||||
|
||||
String name;
|
||||
String enName;
|
||||
|
||||
+38
-26
@@ -1072,24 +1072,28 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
// nio编号
|
||||
String nioNumber = dto.getNioNumber();
|
||||
resultMap = validateMustAndLength(nioNumber, "nio编号", "nio number", IsMustEnum.YES.getValue(),"15", false, cut);
|
||||
resultMap = validateMustAndLength(nioNumber, "NIO编号", "NIO Number", IsMustEnum.YES.getValue(),"15", false, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
if (StringUtils.isNotEmpty(dto.getNioNumber())) {
|
||||
// 校验nio编号 格式:字母数字横杠(-)
|
||||
String nioNumberRegex = "^[A-Za-z0-9-]+$";
|
||||
if (!nioNumber.matches(nioNumberRegex)) {
|
||||
errorMsg += "nio编号格式错误,仅能为字母,数字,横杠(-)";
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += "nio编号格式错误,仅能为字母,数字,横杠(-);";
|
||||
} else {
|
||||
errorMsg += "NIO number formatting errors, can only letters, numbers, dash (-);";
|
||||
}
|
||||
countError++;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否必填
|
||||
String isMust = dto.getIsMust();
|
||||
resultMap = validateMustAndLength(isMust, "是否必填", "is must", IsMustEnum.YES.getValue(), "50", false, cut);
|
||||
resultMap = validateMustAndLength(isMust, "是否必填", "Is Must", IsMustEnum.YES.getValue(), "50", false, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
resultMap = getCodeByName(isMust,"是否必填","is must","enum",paramsIsMustEnumMap,null,null,cut);
|
||||
resultMap = getCodeByName(isMust,"是否必填","Is Must","enum",paramsIsMustEnumMap,null,null,cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
isMust = (String)resultMap.get("value");
|
||||
@@ -1097,16 +1101,16 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|
||||
// 参数名称
|
||||
String paramsName = dto.getParamsName();
|
||||
resultMap = validateMustAndLength(paramsName, "参数名称", "params name", IsMustEnum.YES.getValue(), "30", false, cut);
|
||||
resultMap = validateMustAndLength(paramsName, "参数名称", "Params Name", IsMustEnum.YES.getValue(), "30", false, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
|
||||
// 技术领域
|
||||
String technologyTerritory = dto.getTechnologyTerritory();
|
||||
resultMap = validateMustAndLength(technologyTerritory, "技术领域", "technology territory", IsMustEnum.YES.getValue(), "1000", false, cut);
|
||||
resultMap = validateMustAndLength(technologyTerritory, "技术领域", "Technical Field", IsMustEnum.YES.getValue(), "1000", false, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
resultMap = getCodeByName(technologyTerritory,"技术领域", "technology territory","treeDicCode",null,treeNameList,categoryList,cut);
|
||||
resultMap = getCodeByName(technologyTerritory,"技术领域", "Technical Field","treeDicCode",null,treeNameList,categoryList,cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
technologyTerritory = (String)resultMap.get("value");
|
||||
@@ -1114,10 +1118,10 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|
||||
// 参数批次
|
||||
String paramsBatch = dto.getParamsBatch();
|
||||
resultMap = validateMustAndLength(paramsBatch, "参数批次", "params batch", IsMustEnum.YES.getValue(), "50", true, cut);
|
||||
resultMap = validateMustAndLength(paramsBatch, "参数批次", "Params Batch", IsMustEnum.YES.getValue(), "50", true, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
resultMap = getCodeByName(paramsBatch,"参数批次", "params batch", "dicCode",null,itemNameList,dictItemList,cut);
|
||||
resultMap = getCodeByName(paramsBatch,"参数批次", "Params Batch", "dicCode",null,itemNameList,dictItemList,cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
paramsBatch = (String)resultMap.get("value");
|
||||
@@ -1125,10 +1129,10 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|
||||
// 责任领域
|
||||
String dutyTerritory = dto.getDutyTerritory();
|
||||
resultMap = validateMustAndLength(dutyTerritory, "责任领域", "duty territory", IsMustEnum.YES.getValue(), "50",true, cut);
|
||||
resultMap = validateMustAndLength(dutyTerritory, "责任领域", "Duty Territory", IsMustEnum.YES.getValue(), "50",true, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
resultMap = getCodeByName(dutyTerritory,"责任领域", "duty territory", "dicCode",null,itemNameList,dictItemList,cut);
|
||||
resultMap = getCodeByName(dutyTerritory,"责任领域", "Duty Territory", "dicCode",null,itemNameList,dictItemList,cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
dutyTerritory = (String)resultMap.get("value");
|
||||
@@ -1136,13 +1140,13 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|
||||
// 参数说明
|
||||
String description = dto.getDescription();
|
||||
resultMap = validateMustAndLength(description,"参数说明", "description", IsMustEnum.NO.getValue(),"200",false,cut);
|
||||
resultMap = validateMustAndLength(description,"参数说明", "Description", IsMustEnum.NO.getValue(),"200",false,cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
|
||||
// 认证类别
|
||||
// 来源:认证类别sheet页
|
||||
resultMap = validateMustAndLength(nioCertCategoryMap.get(nioNumber), "认证类别", "cert category", IsMustEnum.YES.getValue(), "1000", false, cut);
|
||||
resultMap = validateMustAndLength(nioCertCategoryMap.get(nioNumber), "认证类别", "Cert Category", IsMustEnum.YES.getValue(), "1000", false, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
dto.setCertCategory(nioCertCategoryMap.get(nioNumber));
|
||||
@@ -1159,10 +1163,10 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|
||||
// 控件类型
|
||||
String controlType = dto.getControlType();
|
||||
resultMap = validateMustAndLength(controlType, "控件类型", "control type", IsMustEnum.YES.getValue(), "50", false, cut);
|
||||
resultMap = validateMustAndLength(controlType, "控件类型", "Control Type", IsMustEnum.YES.getValue(), "50", false, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
resultMap = getCodeByName(controlType,"控件类型", "control type", "enum",controlTypeEnumMap,null,null,cut);
|
||||
resultMap = getCodeByName(controlType,"控件类型", "Control Type", "enum",controlTypeEnumMap,null,null,cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
controlType = (String)resultMap.get("value");
|
||||
@@ -1177,9 +1181,9 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|| ControlTypeEnum.TEXT_PULL_MORE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_PULL_SINGLE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue().equals(controlType)) {
|
||||
resultMap = validateMustAndLength(controlValues, "控件备选值", "control values", IsMustEnum.YES.getValue(), "500", false, cut);
|
||||
resultMap = validateMustAndLength(controlValues, "控件备选值", "Control Values", IsMustEnum.YES.getValue(), "500", false, cut);
|
||||
} else {
|
||||
resultMap = validateMustAndLength(controlValues, "控件备选值", "control values", IsMustEnum.NO.getValue(), "500", false, cut);
|
||||
resultMap = validateMustAndLength(controlValues, "控件备选值", "Control Values", IsMustEnum.NO.getValue(), "500", false, cut);
|
||||
}
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
@@ -1191,13 +1195,13 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|| ControlTypeEnum.TEXT_PULL_MORE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_FILE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue().equals(controlType)) {
|
||||
resultMap = validateMustAndLength(controlVerify, "控件校验", "control verify", IsMustEnum.YES.getValue(), "50", false, cut);
|
||||
resultMap = validateMustAndLength(controlVerify, "控件校验", "Control Verify", IsMustEnum.YES.getValue(), "50", false, cut);
|
||||
} else {
|
||||
resultMap = validateMustAndLength(controlVerify, "控件校验", "control verify", IsMustEnum.NO.getValue(), "50", false, cut);
|
||||
resultMap = validateMustAndLength(controlVerify, "控件校验", "Control Verify", IsMustEnum.NO.getValue(), "50", false, cut);
|
||||
}
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
resultMap = getCodeByName(controlVerify,"控件校验", "control verify", "enum",controlVerifyEnumMap,null,null,cut);
|
||||
resultMap = getCodeByName(controlVerify,"控件校验", "Control Verify", "enum",controlVerifyEnumMap,null,null,cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
controlVerify = (String)resultMap.get("value");
|
||||
@@ -1267,7 +1271,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg = certCategory + " 第" + j + "行:";
|
||||
} else {
|
||||
errorMsg = j + " line:";
|
||||
errorMsg = certCategory + " " + j + " line:";
|
||||
}
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
|
||||
@@ -1280,23 +1284,27 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
// 校验nio编号 格式:字母数字横杠(-)
|
||||
String nioNumberRegex = "^[A-Za-z0-9-]+$";
|
||||
if (!nioNumber.matches(nioNumberRegex)) {
|
||||
errorMsg += "nio编号格式错误,仅能为字母,数字,横杠(-)";
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += "nio编号格式错误,仅能为字母,数字,横杠(-);";
|
||||
} else {
|
||||
errorMsg += "NIO number formatting errors, can only letters, numbers, dash (-);";
|
||||
}
|
||||
countError++;
|
||||
}
|
||||
}
|
||||
// 编号
|
||||
String paramsNumber = ccDto.getParamsNumber();
|
||||
resultMap = validateMustAndLength(paramsNumber, "编号", "number", IsMustEnum.YES.getValue(),"15", false, cut);
|
||||
resultMap = validateMustAndLength(paramsNumber, "编号", "Number", IsMustEnum.YES.getValue(),"15", false, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
// 参数名称
|
||||
String paramsName = ccDto.getParamsName();
|
||||
resultMap = validateMustAndLength(paramsName, "参数名称", "params name", IsMustEnum.YES.getValue(),"30", false, cut);
|
||||
resultMap = validateMustAndLength(paramsName, "参数名称", "Params Name", IsMustEnum.YES.getValue(),"30", false, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
// 参数说明
|
||||
String description = ccDto.getDescription();
|
||||
resultMap = validateMustAndLength(description, "参数说明", "description", IsMustEnum.NO.getValue(),"200", false, cut);
|
||||
resultMap = validateMustAndLength(description, "参数说明", "Description", IsMustEnum.NO.getValue(),"200", false, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
|
||||
@@ -1311,7 +1319,11 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
.collect(Collectors.collectingAndThen(Collectors.toCollection(() ->
|
||||
new TreeSet<>(Comparator.comparing(o -> o.getNioNumber() + ";" + o.getCertCategory()))), ArrayList::new));
|
||||
if (ccDtoAfterDistinct.size() < certCategoryParamsInfoEOList.size()) {
|
||||
stringMessage.add("导入数据中存在重复认证编号;");
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
stringMessage.add("导入数据中存在重复认证编号;");
|
||||
} else {
|
||||
stringMessage.add("Repeat number exist in the Import Data;");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -89,12 +89,12 @@ public class ParamsInfoEnExport {
|
||||
private String certCategory;
|
||||
|
||||
/**控件类型*/
|
||||
@Excel(name = "*Control Type", width = 15, replace = {"text_1","pull single_2","pull more_3","file_4","text+pull single_5","text+pull more_6","text+file_7","pull single+file_8","pull more+file_9","text+pull single+file_10"})
|
||||
@Excel(name = "*Control Type", width = 15, replace = {"Text_1","Pull single_2","Pull more_3","File_4","Text+Pull single_5","Text+Pull more_6","Text+File_7","Pull single+File_8","Pull more+File_9","Text+Pull single+File_10"})
|
||||
@ApiModelProperty(value = "控件类型")
|
||||
private String controlType;
|
||||
|
||||
/**控件校验*/
|
||||
@Excel(name = "Control Verify", width = 15, replace = {"null_1","chinese_2","positive integer_3","positive float_4","integer decimaL_5","decimal one_6","decimal two_7","decimal three_8","decimal four_9"})
|
||||
@Excel(name = "Control Verify", width = 15, replace = {"Null_1","Chinese_2","Positive integer_3","Positive float_4","Integer decimal_5","Decimal one_6","Decimal two_7","Decimal three_8","Decimal four_9"})
|
||||
@ApiModelProperty(value = "控件校验")
|
||||
private String controlVerify;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user