From 41079dee1e355c1d660c887138f7bb04939b8497 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Thu, 23 Nov 2023 16:00:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E9=A2=86=E5=8D=95=E5=88=A0=E9=99=A4BU?= =?UTF-8?q?G=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../op/device/service/impl/EquSpareApplyServiceImpl.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java index 68faf2eb..c695898a 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquSpareApplyServiceImpl.java @@ -154,6 +154,7 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService { // 校验 for (String id : applyIds) { EquSpareApply apply = equSpareApplyMapper.selectEquSpareApplyByApplyId(id); + int checkNull = 0; if (apply.getWorkCode() != null) { if (!apply.getWorkCode().isEmpty()) { EquRepairWorkOrder workOrder = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkCode(apply.getWorkCode()); @@ -162,7 +163,7 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService { check = false; } }else { - return error(500,"未查询到对应维修工单信息!删除失败!"); + checkNull++; } EquOrder order = equOrderMapper.selectEquOrderByOrderCode(apply.getWorkCode()); if (order != null) { @@ -170,11 +171,15 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService { check = false; } }else { - return error(500,"未查询到对应保养工单信息!删除失败!"); + checkNull++; } } } + if (checkNull == 2) { + return error(500,"关联单号信息为空!删除失败!"); + } + if (check) { // 回填数据 sparePartsLedgerMapper.updateSpareNumAdd(apply);