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 @@