Commit 5e856ef1 authored by 刘林's avatar 刘林

fix(jg):气瓶导入解决出厂编号重复问题,解决设备代码为空报错问题

parent 58231f32
...@@ -3358,21 +3358,19 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3358,21 +3358,19 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
checkNotBlank(data.getEquCodeType(), "是否有设备代码不能为空;", result); checkNotBlank(data.getEquCodeType(), "是否有设备代码不能为空;", result);
if ("1".equals(data.getEquCodeType())) { if ("1".equals(data.getEquCodeType())) {
checkNotBlank(data.getEquCode(), "设备代码不能为空;", result); checkNotBlank(data.getEquCode(), "设备代码不能为空;", result);
String equCode = data.getEquCode(); Optional.ofNullable(data.getEquCode())
if (equCode.matches("[a-zA-Z0-9]+")) { .ifPresent(equCode -> {
if (equCode.length() <= 17) { if (!equCode.matches("[a-zA-Z0-9]+")) {
result.append("设备代码不能小于17位;");
}
if (equCode.length() >= 20) {
result.append("设备代码不能大于20位;");
}
} else {
result.append("设备代码不能包含特殊字符;"); result.append("设备代码不能包含特殊字符;");
} else {
Stream.of(equCode.length() <= 17 ? "设备代码不能小于17位;" : "",
equCode.length() >= 20 ? "设备代码不能大于20位;" : "",
equCodeList.contains(equCode) ? "设备代码不能重复;" : ""
).filter(msg -> !msg.isEmpty())
.forEach(result::append);
this.checkEquCodeUniqueness(equCode, result);
} }
if (equCodeList.contains(data.getEquCode())) { });
result.append("设备代码不能重复;");
}
this.checkEquCodeUniqueness(data.getEquCode(), result);
} else { } else {
data.setEquCode(""); data.setEquCode("");
} }
...@@ -3385,9 +3383,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3385,9 +3383,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
checkNotBlank(data.getProduceLicenseNum(), "制造许可编号不能为空;", result); checkNotBlank(data.getProduceLicenseNum(), "制造许可编号不能为空;", result);
checkNotBlank(data.getFactoryNum(), "出厂编号/产品编码不能为空;", result); checkNotBlank(data.getFactoryNum(), "出厂编号/产品编码不能为空;", result);
if ("0".equals(data.getWhetherVehicleCylinder())) { if ("0".equals(data.getWhetherVehicleCylinder())) {
if (factoryNumList.contains(data.getFactoryNum())) {
result.append("出厂编号/产品编码不能重复;");
}
checkNotBlank(data.getCylinderCategory(), "气瓶分类不能为空;", result); checkNotBlank(data.getCylinderCategory(), "气瓶分类不能为空;", result);
checkFactoryNumUnique(data.getFactoryNum(), data.getProduceUnitCreditCode(), result); checkFactoryNumUnique(data.getFactoryNum(), data.getProduceUnitCreditCode(), result);
} else { } else {
......
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