From 64bdba9fa2bc01b722c4ec6f5369c1dcd3db436a Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Tue, 8 Apr 2025 16:10:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../njcn/gather/device/service/impl/PqDevServiceImpl.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/detection/src/main/java/com/njcn/gather/device/service/impl/PqDevServiceImpl.java b/detection/src/main/java/com/njcn/gather/device/service/impl/PqDevServiceImpl.java index 86addad5..d42c7290 100644 --- a/detection/src/main/java/com/njcn/gather/device/service/impl/PqDevServiceImpl.java +++ b/detection/src/main/java/com/njcn/gather/device/service/impl/PqDevServiceImpl.java @@ -487,12 +487,10 @@ public class PqDevServiceImpl extends ServiceImpl implements // 只有检测完成的设备才可以进行归档 PqDev pqDev = this.getById(id); if (ObjectUtil.isNotNull(pqDev)) { - if (!pqDev.getCheckState().equals(CheckStateEnum.CHECKED.getValue())) { + // 只有检测完成、且已生成报告的设备才可以进行归档 + if (!pqDev.getCheckState().equals(CheckStateEnum.CHECKED.getValue()) || !pqDev.getReportState().equals(DevReportStateEnum.GENERATED.getValue())) { throw new BusinessException(DetectionResponseEnum.DEV_UN_CHECKED); } - if (!pqDev.getReportState().equals(DevReportStateEnum.GENERATED.getValue())) { - throw new BusinessException(DetectionResponseEnum.DEV_UN_REPORT); - } boolean update = this.lambdaUpdate() .set(PqDev::getCheckState, CheckStateEnum.DOCUMENTED.getValue()) .eq(PqDev::getId, id) @@ -510,8 +508,6 @@ public class PqDevServiceImpl extends ServiceImpl implements this.baseMapper.finishPlan(pqDev.getPlanId()); } } - } else { - throw new BusinessException(DetectionResponseEnum.DEV_UN_CHECKED); } } }