From 6583cb87edd598bdd93864d52accc7ee9e1e3d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=85=81=E6=9E=9E?= <3422692813@qq.com> Date: Wed, 30 Oct 2024 18:06:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=B5=8B=E9=A1=B9=E7=9B=AE=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=97=B6=E5=A2=9E=E5=8A=A0=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DlInspectionProjectServiceImpl.java | 6 ++++++ .../mapper/inspection/DlInspectionProjectMapper.xml | 1 + 2 files changed, 7 insertions(+) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/DlInspectionProjectServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/DlInspectionProjectServiceImpl.java index 9e460e00..51919d1c 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/DlInspectionProjectServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/DlInspectionProjectServiceImpl.java @@ -31,6 +31,12 @@ public class DlInspectionProjectServiceImpl extends ServiceImpl() + .eq(DlInspectionProject::getProjectName, createReqVO.getProjectName())); + if (ObjectUtil.isNotNull(dlInspectionProject1)) { + throw new RuntimeException("检测项目已存在"); + } // 插入 DlInspectionProject dlInspectionProject = BeanUtils.toBean(createReqVO, DlInspectionProject.class); dlInspectionProject.setDeleted(false); diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/DlInspectionProjectMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/DlInspectionProjectMapper.xml index 93c01800..5e3a7fc3 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/DlInspectionProjectMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/DlInspectionProjectMapper.xml @@ -23,5 +23,6 @@ AND role_id = #{entity.roleId} + ORDER BY create_time DESC \ No newline at end of file