检查方法、检查部位后端接口、实体、数据库表基本完成。
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.openhis.web.check.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CheckPartDto {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.openhis.web.check.mapper;
|
||||
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
@Repository
|
||||
public interface CheckMethodAppMapper{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.openhis.web.check.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface CheckPartAppMapper {
|
||||
}
|
||||
Reference in New Issue
Block a user