Commit dc4d4ec4 authored by 刘林's avatar 刘林

Merge remote-tracking branch 'origin/develop_tzs_bugfix' into develop_tzs_bugfix

parents 3f45ecb4 68932a1c
......@@ -103,16 +103,17 @@ public class PressureVesselListener extends AnalysisEventListener<EquipInfoCylin
if ("1".equals(data.getEquCodeType())) {
checkNotBlank(data.getEquCode(), "设备代码不能为空");
String equCode = data.getEquCode();
if (equCode.matches("[a-zA-Z0-9]+")) {
if (equCode.length() <= 17) {
result.append("设备代码不能小于17位");
}
if (equCode.length() >= 20) {
result.append("设备代码不能大于20位");
}
} else {
result.append("设备代码不能包含特殊字符");
if (equCode.length() <= 16) {
result.append("设备代码不能小于16位");
}
if (equCode.length() >= 22) {
result.append("设备代码不能大于22位");
}
// 去掉设备代码不能有特殊字符校验
// if (equCode.matches("[a-zA-Z0-9]+")) {
// } else {
// result.append("设备代码不能包含特殊字符");
// }
if (equCodeList.contains(data.getEquCode())) {
result.append("设备代码不能重复;");
}
......
......@@ -5017,20 +5017,21 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
checkNotBlank(data.getEquCode(), "设备代码不能为空;", result);
Optional.ofNullable(data.getEquCode())
.ifPresent(equCode -> {
if (!equCode.matches("[a-zA-Z0-9]+")) {
result.append("设备代码不能包含特殊字符;");
} else {
String code = equCode.trim();
Stream.of(code.length() < 17 ? "设备代码不能小于17位;" : "",
code.length() > 20 ? "设备代码不能大于20位;" : ""
).filter(msg -> !msg.isEmpty())
.forEach(result::append);
if (equCodeList.contains(code)) {
result.append("设备代码不能重复").append(code);
}
equCodeList.add(data.getEquCode());
//this.checkEquCodeUniqueness(equCode, result);
// 设备代码去掉特殊字符校验
// if (!equCode.matches("[a-zA-Z0-9]+")) {
// result.append("设备代码不能包含特殊字符;");
// } else {
// //this.checkEquCodeUniqueness(equCode, result);
// }
String code = equCode.trim();
Stream.of(code.length() < 16 ? "设备代码不能小于16位;" : "",
code.length() > 22 ? "设备代码不能大于22位;" : ""
).filter(msg -> !msg.isEmpty())
.forEach(result::append);
if (equCodeList.contains(code)) {
result.append("设备代码不能重复").append(code);
}
equCodeList.add(data.getEquCode());
});
} else {
data.setEquCode("");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment