申领单删除BUG解决

highway
wws 1 year ago
parent 31d87a16e4
commit 41079dee1e

@ -154,6 +154,7 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService {
// 校验 // 校验
for (String id : applyIds) { for (String id : applyIds) {
EquSpareApply apply = equSpareApplyMapper.selectEquSpareApplyByApplyId(id); EquSpareApply apply = equSpareApplyMapper.selectEquSpareApplyByApplyId(id);
int checkNull = 0;
if (apply.getWorkCode() != null) { if (apply.getWorkCode() != null) {
if (!apply.getWorkCode().isEmpty()) { if (!apply.getWorkCode().isEmpty()) {
EquRepairWorkOrder workOrder = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkCode(apply.getWorkCode()); EquRepairWorkOrder workOrder = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkCode(apply.getWorkCode());
@ -162,7 +163,7 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService {
check = false; check = false;
} }
}else { }else {
return error(500,"未查询到对应维修工单信息!删除失败!"); checkNull++;
} }
EquOrder order = equOrderMapper.selectEquOrderByOrderCode(apply.getWorkCode()); EquOrder order = equOrderMapper.selectEquOrderByOrderCode(apply.getWorkCode());
if (order != null) { if (order != null) {
@ -170,11 +171,15 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService {
check = false; check = false;
} }
}else { }else {
return error(500,"未查询到对应保养工单信息!删除失败!"); checkNull++;
} }
} }
} }
if (checkNull == 2) {
return error(500,"关联单号信息为空!删除失败!");
}
if (check) { if (check) {
// 回填数据 // 回填数据
sparePartsLedgerMapper.updateSpareNumAdd(apply); sparePartsLedgerMapper.updateSpareNumAdd(apply);

Loading…
Cancel
Save