Commit f36f42a3 authored by suhuiguang's avatar suhuiguang

reafact(jg): 业务作废

1.增加程序健壮性,为空时进行判断
parent 4c664ad3
......@@ -23,6 +23,9 @@ public class InstallNoticeDiscardOrderCheck implements SupportableDiscardOrderCh
@Override
public Boolean check(List<String> records) {
if (records.isEmpty()) {
throw new RuntimeException("单据下不存在设备,不能进行作废,请联系管理员!");
}
List<JgUseRegistrationEq> useRegistrationEqs = useRegistrationMapper.selectListForInstallNoticeDiscard(records);
if (!useRegistrationEqs.isEmpty()) {
String msg = String.format("存在设备正在办理或已办理业务:%s,不能进行作废!", String.join(",", useRegistrationEqs.stream().map(u -> GenericDiscardOrderCheck.buildErrorMsg(u.getRecUserName())).collect(Collectors.toSet())));
......
......@@ -23,6 +23,9 @@ public class UseRegisterDiscardOrderCheck implements SupportableDiscardOrderChec
@Override
public Boolean check(List<String> records) {
if (records.isEmpty()) {
throw new RuntimeException("单据下不存在设备,不能进行作废,请联系管理员!");
}
List<JgUseRegistrationEq> useRegistrationEqs = useRegistrationMapper.selectListForSelfDiscard(records);
if (!useRegistrationEqs.isEmpty()) {
String msg = String.format("存在设备正在办理或已办理后续业务:%s,不能进行作废!", String.join(",", useRegistrationEqs.stream().map(u -> GenericDiscardOrderCheck.buildErrorMsg(u.getRecUserName())).collect(Collectors.toSet())));
......
......@@ -24,6 +24,9 @@ public class VehicleInformationDiscardOrderCheck implements SupportableDiscardOr
@Override
public Boolean check(List<String> records) {
if (records.isEmpty()) {
throw new RuntimeException("单据下不存在气瓶,不能进行作废,请联系管理员!");
}
List<JgVehicleInformationEq> eqs = jgVehicleInformationMapper.selectListForSelfDiscard(records);
if (!eqs.isEmpty()) {
String msg = String.format("存在设备正在办理或已办理后续业务:%s,不能进行作废!", String.join(",", eqs.stream().map(u -> GenericDiscardOrderCheck.buildErrorMsg(u.getRecUserName())).collect(Collectors.toSet())));
......
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