检查方法、检查部位后端接口、实体、数据库表基本完成。

This commit is contained in:
qk123
2025-11-26 10:31:30 +08:00
parent 0b98763c05
commit 10ec9f4c1b
12 changed files with 380 additions and 15 deletions

View File

@@ -0,0 +1,25 @@
package com.openhis.web.check.appservice;
import com.baomidou.mybatisplus.extension.service.IService;
import com.core.common.core.domain.R;
import com.openhis.check.domain.CheckMethod;
import com.openhis.web.check.dto.CheckMethodDto;
/**
* 检查方法Service接口
*
* @author system
* @date 2025-07-22
*/
public interface ICheckMethodAppService{
R<?> getCheckMethodList();
R<?> addCheckMethod(CheckMethodDto checkMethodDto);
R<?> updateCheckMethod(CheckMethodDto checkPartDto);
R<?> removeCheckMethod(Long code);
}

View File

@@ -0,0 +1,15 @@
package com.openhis.web.check.appservice;
import com.core.common.core.domain.R;
import com.openhis.check.service.ICheckPartService;
import com.openhis.web.check.dto.CheckPartDto;
public interface ICheckPartAppService {
R<?> getCheckPartList();
R<?> addCheckPart(CheckPartDto checkPartDto);
R<?> removeCheckPart(Long code);
R<?> updateCheckPart(CheckPartDto checkMethodDto);
}

View File

@@ -0,0 +1,84 @@
package com.openhis.web.check.appservice.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.core.common.core.domain.R;
import com.openhis.check.domain.CheckMethod;
import com.openhis.check.service.ICheckMethodService;
import com.openhis.web.check.appservice.ICheckMethodAppService;
import com.openhis.web.check.dto.CheckMethodDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
@Slf4j
public class CheckMethodAppServiceImpl implements ICheckMethodAppService {
@Resource
private ICheckMethodService checkMethodService;
@Override
public R<?> getCheckMethodList() {
List<CheckMethod> list = checkMethodService.list();
return R.ok(list);
}
@Override
public R<?> addCheckMethod(CheckMethodDto checkMethodDto) {
//1.参数校验
if(ObjectUtil.isEmpty(checkMethodDto.getName())){
return R.fail("检查方法名称不能为空");
}
if(ObjectUtil.isEmpty(checkMethodDto.getCheckType())){
return R.fail("检查类型不能为空");
}
if(ObjectUtil.isEmpty(checkMethodDto.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("检查方法已存在");
}
//3.封装实体检查方法
CheckMethod checkMethod = new CheckMethod();
checkMethod.setName(checkMethodDto.getName());
//4.保存添加
boolean save = checkMethodService.save(checkMethod);
return R.ok();
}
@Override
public R<?> updateCheckMethod(CheckMethodDto checkMethodDto) {
//1.参数校验
if(ObjectUtil.isEmpty(checkMethodDto.getName())){
return R.fail("检查方法名称不能为空");
}
if(ObjectUtil.isEmpty(checkMethodDto.getCheckType())){
return R.fail("检查类型不能为空");
}
if(ObjectUtil.isEmpty(checkMethodDto.getCode())){
return R.fail("代码不能为空");
}
//2.
return R.ok();
}
@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);
return R.ok(remove);
}
}

View File

@@ -0,0 +1,38 @@
package com.openhis.web.check.appservice.impl;
import com.core.common.core.domain.R;
import com.openhis.check.domain.CheckPart;
import com.openhis.check.service.ICheckPartService;
import com.openhis.web.check.appservice.ICheckPartAppService;
import com.openhis.web.check.dto.CheckPartDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
@Slf4j
public class CheckPartAppServiceImpl implements ICheckPartAppService {
@Resource
private ICheckPartService checkPartService;
@Override
public R<?> getCheckPartList() {
List<CheckPart> list = checkPartService.list();
return R.ok(list);
}
@Override
public R<?> addCheckPart(CheckPartDto checkPartDto) {
return R.ok();
}
@Override
public R<?> removeCheckPart(Long code) {
return R.ok();
}
@Override
public R<?> updateCheckPart(CheckPartDto checkPartDto) {
return R.ok();
}
}

View File

@@ -0,0 +1,55 @@
package com.openhis.web.check.controller;
import com.core.common.core.domain.R;
import com.openhis.web.check.appservice.ICheckMethodAppService;
import com.openhis.web.check.dto.CheckMethodDto;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@Slf4j
@RequestMapping("/check/method")
public class CheckMethodController {
@Resource
private ICheckMethodAppService checkMethodAppService;
/*
* 获取检查方法
* @Param检查方法 此处参数注释有问题,完全是按照需求给的图来注释的
*/
@GetMapping("/list")
public R<?> getCheckMethodList(){
return R.ok(checkMethodAppService.getCheckMethodList());
}
/*
* 新增检查方法
* @Param
*/
@PostMapping("/add")
public R<?> addCheckMethod(@RequestBody CheckMethodDto checkMethodDto){
return R.ok(checkMethodAppService.addCheckMethod(checkMethodDto));
}
/*
* 删除检查方法
* @Param code代码
*/
@DeleteMapping("/delete/{code}")
public R<?> deleteCheckMethod(@PathVariable Long code){
return R.ok(checkMethodAppService.removeCheckMethod(code));
}
/*
* 更新检查方法
* @Param
*/
@PutMapping("/update")
public R<?> updateCheckMethod(@RequestBody CheckMethodDto checkMethodDto){
return R.ok(checkMethodAppService.updateCheckMethod(checkMethodDto));
}
}

View File

@@ -0,0 +1,55 @@
package com.openhis.web.check.controller;
import com.core.common.core.domain.R;
import com.openhis.check.service.ICheckPartService;
import com.openhis.web.check.appservice.ICheckPartAppService;
import com.openhis.web.check.dto.CheckMethodDto;
import com.openhis.web.check.dto.CheckPartDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@Slf4j
@RequestMapping("/check/part")
public class CheckPartController {
@Resource
private ICheckPartAppService checkPartAppService;
/*
* 获取检查部位
* @Param检查方法 此处参数注释有问题,完全是按照需求给的图来注释的
*/
@GetMapping("/list")
public R<?> getCheckMethodList(){
return R.ok(checkPartAppService.getCheckPartList());
}
/*
* 新增检查部位
* @Param
*/
@PostMapping("/add")
public R<?> addCheckMethod(@RequestBody CheckPartDto checkPartDto){
return R.ok(checkPartAppService.addCheckPart(checkPartDto));
}
/*
* 删除检查部位
* @Param code代码
*/
@DeleteMapping("/delete/{code}")
public R<?> deleteCheckMethod(@PathVariable Long code){
return R.ok(checkPartAppService.removeCheckPart(code));
}
/*
* 更新检查部位
* @Param
*/
@PutMapping("/update")
public R<?> updateCheckMethod(@RequestBody CheckPartDto checkMethodDto){
return R.ok(checkPartAppService.updateCheckPart(checkMethodDto));
}
}

View File

@@ -0,0 +1,49 @@
package com.openhis.web.check.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
@Data
@Accessors(chain = true)
public class CheckMethodDto {
/**
* 检查方法ID
*/
@TableId(type = IdType.AUTO)
private Long id;
/* 检查类型 */
private String checkType;
/* 方法代码 */
private String code;
/* 方法名称 */
private String name;
/* 套餐名称 */
private String packageName;
/* 曝光次数 */
private Integer exposureNum;
/* 序号 */
private Integer orderNum;
/* 备注 */
private String remark;
/** 创建时间 */
private LocalDateTime createTime;
/** 更新时间 */
private LocalDateTime updateTime;
}

View File

@@ -0,0 +1,10 @@
package com.openhis.web.check.dto;
import lombok.Data;
import lombok.experimental.Accessors;
@Data
@Accessors(chain = true)
public class CheckPartDto {
}

View File

@@ -0,0 +1,10 @@
package com.openhis.web.check.mapper;
import org.springframework.stereotype.Repository;
@Repository
public interface CheckMethodAppMapper{
}

View File

@@ -0,0 +1,7 @@
package com.openhis.web.check.mapper;
import org.springframework.stereotype.Repository;
@Repository
public interface CheckPartAppMapper {
}

View File

@@ -22,26 +22,31 @@ import java.time.LocalDateTime;
public class CheckMethod { public class CheckMethod {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 检查方法ID */ /**
* 检查方法ID
*/
@TableId(type = IdType.AUTO) @TableId(type = IdType.AUTO)
private Long id; private Long id;
/** 检查方法名称 */ /* 检查类型 */
private String name; private String checkType;
/** 检查方法码 */ /* 方法码 */
private String code; private String code;
/** 检查方法类型 */ /* 方法名称 */
private String methodType; private String name;
/** 检查类型ID */ /* 套餐名称 */
private Long checkTypeId; private String packageName;
/** 序号 */ /* 曝光次数 */
private Integer number; private Integer exposureNum;
/** 备注 */ /* 序号 */
private Integer orderNum;
/* 备注 */
private String remark; private String remark;
/** 创建时间 */ /** 创建时间 */

View File

@@ -32,15 +32,27 @@ public class CheckPart {
/** 检查部位编码 */ /** 检查部位编码 */
private String code; private String code;
/** 部位分类 */ /** 检查部位检查类型 */
private String partCategory; private String checkType;
/** 父部位ID */ /** 曝光次数 */
private Long parentId; private Integer exposureNum;
/** 费用套餐 */
private String packageName;
/** 金额 */
private Double price;
/** 序号 */ /** 序号 */
private Integer number; private Integer number;
/** 服务范围 */
private String serviceScope;
/** 下级医技类型 */
private String subType;
/** 备注 */ /** 备注 */
private String remark; private String remark;