From b3c27ec789d4e50b31df51b1f9d3dbc8b739aa32 Mon Sep 17 00:00:00 2001 From: qk123 <18211963828.@163.cpm> Date: Wed, 3 Dec 2025 16:00:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E7=B3=BB=E7=BB=9F->=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E6=96=B9=E6=B3=95=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=81=E6=8E=A5=E5=8F=A3=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=AE=8C=E5=96=84=EF=BC=88=E6=90=9C=E7=B4=A2=E6=A0=8F=E5=92=8C?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E8=A1=A8=E6=A0=BC=E6=9C=AA=E5=A4=84=E7=90=86?= =?UTF-8?q?=EF=BC=89=EF=BC=8C=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appservice/ICheckMethodAppService.java | 9 +- .../impl/CheckMethodAppServiceImpl.java | 69 ++--- .../controller/CheckMethodController.java | 16 +- .../com/openhis/check/domain/CheckMethod.java | 2 +- openhis-ui-vue3/src/api/system/checkType.js | 28 +- .../checkprojectSettings/index.vue | 263 ++++++++++++------ 6 files changed, 242 insertions(+), 145 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/appservice/ICheckMethodAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/appservice/ICheckMethodAppService.java index c1c076ec..4ecab9a9 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/appservice/ICheckMethodAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/appservice/ICheckMethodAppService.java @@ -2,7 +2,8 @@ package com.openhis.web.check.appservice; import com.core.common.core.domain.R; -import com.openhis.web.check.dto.CheckMethodDto; +import com.openhis.check.domain.CheckMethod; + /** * 检查方法Service接口 @@ -14,11 +15,11 @@ public interface ICheckMethodAppService{ R getCheckMethodList(); - R addCheckMethod(CheckMethodDto checkMethodDto); + R addCheckMethod(CheckMethod checkMethod); - R updateCheckMethod(CheckMethodDto checkPartDto); + R updateCheckMethod(CheckMethod checkPart); - R removeCheckMethod(Long code); + R removeCheckMethod(Integer checkMethodId); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/appservice/impl/CheckMethodAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/appservice/impl/CheckMethodAppServiceImpl.java index de97ffbf..340277b4 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/appservice/impl/CheckMethodAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/appservice/impl/CheckMethodAppServiceImpl.java @@ -28,63 +28,48 @@ public class CheckMethodAppServiceImpl implements ICheckMethodAppService { } @Override - public R addCheckMethod(CheckMethodDto checkMethodDto) { - //1.参数校验 - if(ObjectUtil.isEmpty(checkMethodDto.getName())){ - return R.fail("检查方法名称不能为空"); + public R addCheckMethod(CheckMethod checkMethod) { + //1.数据校验 + if (ObjectUtil.isEmpty(checkMethod.getId())) { + return R.fail("检查方法id不能为空!"); } - if(ObjectUtil.isEmpty(checkMethodDto.getCheckType())){ - return R.fail("检查类型不能为空"); + if (ObjectUtil.isEmpty(checkMethod.getName())) { + return R.fail("检查方法名称不能为空!"); } - if(ObjectUtil.isEmpty(checkMethodDto.getCode())){ - return R.fail("代码不能为空"); + if (ObjectUtil.isEmpty(checkMethod.getCode())) { + return R.fail("检查方法代码不能为空!"); } - //2.判断是否有重复 - LambdaQueryWrapper wrapper = new LambdaQueryWrapper() - .eq(CheckMethod::getName, checkMethodDto.getName()) - .eq(CheckMethod::getCheckType, checkMethodDto.getCheckType()) - .eq(CheckMethod::getCode, checkMethodDto.getCode()); - if (checkMethodService.getOne(wrapper) != null){ - return R.fail("检查方法已存在"); + if (ObjectUtil.isEmpty(checkMethod.getCheckType())) { + return R.fail("检查方法的检查类型不能为空!"); } - - //3.封装实体检查方法 - CheckMethod checkMethod = new CheckMethod(); - checkMethod.setName(checkMethodDto.getName()); - checkMethod.setCheckType(checkMethodDto.getCheckType()); - checkMethod.setCode(checkMethodDto.getCode()); - checkMethod.setPackageName(checkMethodDto.getPackageName()); - checkMethod.setExposureNum(checkMethodDto.getExposureNum()); - checkMethod.setOrderNum(checkMethodDto.getOrderNum()); - checkMethod.setRemark(checkMethodDto.getRemark()); - //4.保存添加 + //2.保存 boolean save = checkMethodService.save(checkMethod); return R.ok(); } @Override - public R updateCheckMethod(CheckMethodDto checkMethodDto) { - //1.参数校验 - if(ObjectUtil.isEmpty(checkMethodDto.getName())){ - return R.fail("检查方法名称不能为空"); + public R updateCheckMethod(CheckMethod checkMethod) { + //1.数据校验 + if (ObjectUtil.isEmpty(checkMethod.getId())) { + return R.fail("检查方法id不能为空!"); } - if(ObjectUtil.isEmpty(checkMethodDto.getCheckType())){ - return R.fail("检查类型不能为空"); + if (ObjectUtil.isEmpty(checkMethod.getName())) { + return R.fail("检查方法名称不能为空!"); } - if(ObjectUtil.isEmpty(checkMethodDto.getCode())){ - return R.fail("代码不能为空"); + if (ObjectUtil.isEmpty(checkMethod.getCode())) { + return R.fail("检查方法代码不能为空!"); } - //2. - return R.ok(); + if (ObjectUtil.isEmpty(checkMethod.getCheckType())) { + return R.fail("检查方法的检查类型不能为空!"); + } + //2.更新 + boolean b = checkMethodService.updateById(checkMethod); + return R.ok(b); } @Override - public R removeCheckMethod(Long code) { - if (ObjectUtil.isEmpty(code)){ - return R.fail("检查方法代码不能为空"); - } - LambdaQueryWrapper wrapper = new LambdaQueryWrapper().eq(CheckMethod::getCode, code); - boolean remove = checkMethodService.remove(wrapper); + public R removeCheckMethod(Integer checkMethodId) { + boolean remove = checkMethodService.removeById(checkMethodId); return R.ok(remove); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/controller/CheckMethodController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/controller/CheckMethodController.java index d9ca6013..08fe4519 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/controller/CheckMethodController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/controller/CheckMethodController.java @@ -1,8 +1,8 @@ package com.openhis.web.check.controller; import com.core.common.core.domain.R; +import com.openhis.check.domain.CheckMethod; import com.openhis.web.check.appservice.ICheckMethodAppService; -import com.openhis.web.check.dto.CheckMethodDto; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; @@ -30,17 +30,17 @@ public class CheckMethodController { * @Param */ @PostMapping("/add") - public R addCheckMethod(@RequestBody CheckMethodDto checkMethodDto){ - return R.ok(checkMethodAppService.addCheckMethod(checkMethodDto)); + public R addCheckMethod(@RequestBody CheckMethod checkMethod){ + return R.ok(checkMethodAppService.addCheckMethod(checkMethod)); } /* * 删除检查方法 * @Param code代码 */ - @DeleteMapping("/delete/{code}") - public R deleteCheckMethod(@PathVariable Long code){ - return R.ok(checkMethodAppService.removeCheckMethod(code)); + @DeleteMapping("/delete/{checkMethodId}") + public R deleteCheckMethod(@PathVariable Integer checkMethodId){ + return R.ok(checkMethodAppService.removeCheckMethod(checkMethodId)); } /* @@ -48,7 +48,7 @@ public class CheckMethodController { * @Param */ @PutMapping("/update") - public R updateCheckMethod(@RequestBody CheckMethodDto checkMethodDto){ - return R.ok(checkMethodAppService.updateCheckMethod(checkMethodDto)); + public R updateCheckMethod(@RequestBody CheckMethod checkMethod){ + return R.ok(checkMethodAppService.updateCheckMethod(checkMethod)); } } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/check/domain/CheckMethod.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/check/domain/CheckMethod.java index 56f549cc..90878be2 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/check/domain/CheckMethod.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/check/domain/CheckMethod.java @@ -26,7 +26,7 @@ public class CheckMethod { * 检查方法ID */ @TableId(type = IdType.AUTO) - private Long id; + private Integer id; /* 检查类型 */ private String checkType; diff --git a/openhis-ui-vue3/src/api/system/checkType.js b/openhis-ui-vue3/src/api/system/checkType.js index 4e57e63c..4930a15d 100644 --- a/openhis-ui-vue3/src/api/system/checkType.js +++ b/openhis-ui-vue3/src/api/system/checkType.js @@ -46,12 +46,38 @@ export function delCheckType(checkTypeId) { // 查询检查方法列表 export function listCheckMethod(query) { return request({ - url: '/system/check-method/list', + url: '/check/method/list', method: 'get', params: query }) } +// 新增检查方法 +export function addCheckMethod(data) { + return request({ + url: '/check/method/add', + method: 'post', + data: data + }) +} + +// 修改检查方法 +export function updateCheckMethod(data) { + return request({ + url: '/check/method/update', + method: 'put', + data: data + }) +} + +// 删除检查方法 +export function delCheckMethod(checkMethodId) { + return request({ + url: '/check/method/delete/' + checkMethodId, + method: 'delete' + }) +} + // 查询检查部位列表 export function listCheckPart(query) { return request({ diff --git a/openhis-ui-vue3/src/views/maintainSystem/checkprojectSettings/index.vue b/openhis-ui-vue3/src/views/maintainSystem/checkprojectSettings/index.vue index 4fb8cfb9..0cc15e40 100644 --- a/openhis-ui-vue3/src/views/maintainSystem/checkprojectSettings/index.vue +++ b/openhis-ui-vue3/src/views/maintainSystem/checkprojectSettings/index.vue @@ -83,7 +83,7 @@ v-for="(item, index) in tableData" :key="index" :class="{ 'editing-row': item.editing, 'child-row': item.row.includes('.') }" - @click="handleRowClick(item)" + @click="handleEdit(index)" > {{ item.row }} @@ -198,39 +198,37 @@ + @@ -338,12 +339,8 @@ + @@ -504,9 +504,9 @@