From 6381043a77013df18f055affae338b118371822b Mon Sep 17 00:00:00 2001 From: lxd <1004405501@qq.com> Date: Wed, 24 Jul 2024 19:20:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=A3=80=E6=9F=A5=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/doctor/DoctorController.java | 1 - .../admin/examitems/examitemsController.java | 17 ++++++++++++++--- .../dal/mysql/examitems/examitemsMapper.java | 5 ++--- .../service/examitems/examitemsService.java | 1 + .../service/examitems/examitemsServiceImpl.java | 16 ++++++++++++++++ .../{ => mapper}/examitems/examitemsMapper.xml | 5 +++++ 6 files changed, 38 insertions(+), 7 deletions(-) rename yudao-module-system/yudao-module-system-biz/src/main/resources/{ => mapper}/examitems/examitemsMapper.xml (79%) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/DoctorController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/DoctorController.java index 1acfe1ff7..6d5bf9956 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/DoctorController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/DoctorController.java @@ -27,7 +27,6 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; import cn.iocoder.yudao.module.system.controller.admin.doctor.vo.*; import cn.iocoder.yudao.module.system.dal.dataobject.doctor.DoctorDO; import cn.iocoder.yudao.module.system.service.doctor.DoctorService; -import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/examitems/examitemsController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/examitems/examitemsController.java index 7d0f12dde..e4073172b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/examitems/examitemsController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/examitems/examitemsController.java @@ -46,9 +46,20 @@ public class examitemsController { @Operation(summary = "创建检查部位") @PreAuthorize("@ss.hasPermission('examitems:examitems:create')") public CommonResult createexamitems(@Valid @RequestBody examitemsSaveReqVO createReqVO) { - UUID guid = UUID.randomUUID(); - createReqVO.setId(guid.toString()); - return success(examitemsService.createexamitems(createReqVO)); + + String msg=""; + if(!examitemsService.getexamItemcodexist(createReqVO.getExamItemCode())) + { + UUID guid = UUID.randomUUID(); + createReqVO.setId(guid.toString()); + msg= examitemsService.createexamitems(createReqVO); + } + else + { + msg="项目ID已经存在"; + } + + return success(msg); } @PutMapping("/update") diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/examitems/examitemsMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/examitems/examitemsMapper.java index 8d3838772..ba2cd389c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/examitems/examitemsMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/examitems/examitemsMapper.java @@ -1,15 +1,13 @@ package cn.iocoder.yudao.module.system.dal.mysql.examitems; -import java.util.*; - import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; -import cn.iocoder.yudao.module.system.dal.dataobject.doctor.DoctorDO; import cn.iocoder.yudao.module.system.dal.dataobject.examitems.examitemsDO; import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import org.apache.ibatis.annotations.Mapper; import cn.iocoder.yudao.module.system.controller.admin.examitems.vo.*; +import org.apache.ibatis.annotations.Param; /** * 检查部位 Mapper @@ -30,4 +28,5 @@ public interface examitemsMapper extends BaseMapperX { .orderByDesc(examitemsDO::getId)); } + int selectItemCount(@Param("examItemCode") String examItemCode); } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/examitems/examitemsService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/examitems/examitemsService.java index ef0bc9c3c..296cb523b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/examitems/examitemsService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/examitems/examitemsService.java @@ -53,4 +53,5 @@ public interface examitemsService { */ PageResult getexamitemsPage(examitemsPageReqVO pageReqVO); + boolean getexamItemcodexist(String code); } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/examitems/examitemsServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/examitems/examitemsServiceImpl.java index 84ca90a9f..c01ff902b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/examitems/examitemsServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/examitems/examitemsServiceImpl.java @@ -74,4 +74,20 @@ public class examitemsServiceImpl implements examitemsService { return examitemsMapper.selectPage(pageReqVO); } + @Override + public boolean getexamItemcodexist(String examItemCode) { + boolean bol=false; + int count = examitemsMapper.selectItemCount(examItemCode); + if(count>0) + { + bol=true; + } + else + { + bol=false; + } + + return bol; + } + } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/examitems/examitemsMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/examitems/examitemsMapper.xml similarity index 79% rename from yudao-module-system/yudao-module-system-biz/src/main/resources/examitems/examitemsMapper.xml rename to yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/examitems/examitemsMapper.xml index 2cef3df23..0cc5d9cba 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/resources/examitems/examitemsMapper.xml +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/examitems/examitemsMapper.xml @@ -9,4 +9,9 @@ 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ --> + + + \ No newline at end of file