维护系统->检查方法前端页面优化、接口功能完善(搜索栏和导出表格未处理),后端接口优化。

This commit is contained in:
qk123
2025-12-03 16:00:24 +08:00
parent 601ae40666
commit b3c27ec789
6 changed files with 242 additions and 145 deletions

View File

@@ -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);
}

View File

@@ -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<CheckMethod> wrapper = new LambdaQueryWrapper<CheckMethod>()
.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<CheckMethod> wrapper = new LambdaQueryWrapper<CheckMethod>().eq(CheckMethod::getCode, code);
boolean remove = checkMethodService.remove(wrapper);
public R<?> removeCheckMethod(Integer checkMethodId) {
boolean remove = checkMethodService.removeById(checkMethodId);
return R.ok(remove);
}

View File

@@ -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));
}
}