维护系统->检查部位后端接口优化。
This commit is contained in:
@@ -1,14 +1,14 @@
|
|||||||
package com.openhis.web.check.appservice;
|
package com.openhis.web.check.appservice;
|
||||||
|
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
import com.openhis.web.check.dto.CheckPartDto;
|
import com.openhis.check.domain.CheckPart;
|
||||||
|
|
||||||
public interface ICheckPartAppService {
|
public interface ICheckPartAppService {
|
||||||
R<?> getCheckPartList();
|
R<?> getCheckPartList();
|
||||||
|
|
||||||
R<?> addCheckPart(CheckPartDto checkPartDto);
|
R<?> addCheckPart(CheckPart checkPart);
|
||||||
|
|
||||||
R<?> removeCheckPart(Long code);
|
R<?> removeCheckPart(Integer checkPartId);
|
||||||
|
|
||||||
R<?> updateCheckPart(CheckPartDto checkMethodDto);
|
R<?> updateCheckPart(CheckPart checkPart);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class CheckMethodAppServiceImpl implements ICheckMethodAppService {
|
|||||||
}
|
}
|
||||||
//2.保存
|
//2.保存
|
||||||
boolean save = checkMethodService.save(checkMethod);
|
boolean save = checkMethodService.save(checkMethod);
|
||||||
return R.ok();
|
return R.ok(save);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -24,54 +24,23 @@ public class CheckPartAppServiceImpl implements ICheckPartAppService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R<?> addCheckPart(CheckPartDto checkPartDto) {
|
public R<?> addCheckPart(CheckPart checkPart) {
|
||||||
//数据检验
|
//数据检验
|
||||||
if(ObjectUtil.isEmpty(checkPartDto.getName())){
|
|
||||||
return R.fail("检查项目名称不能为空");
|
|
||||||
}
|
|
||||||
if(ObjectUtil.isEmpty(checkPartDto.getCode())){
|
|
||||||
return R.fail("检查项目代码不能为空");
|
|
||||||
}
|
|
||||||
if(ObjectUtil.isEmpty(checkPartDto.getCheckType())){
|
|
||||||
return R.fail("检查项目类型不能为空");
|
|
||||||
}
|
|
||||||
//唯一性检验
|
|
||||||
LambdaQueryWrapper<CheckPart> wrapper = new LambdaQueryWrapper<CheckPart>()
|
|
||||||
.eq(CheckPart::getName, checkPartDto.getName())
|
|
||||||
.eq(CheckPart::getCode, checkPartDto.getCode())
|
|
||||||
.eq(CheckPart::getCheckType, checkPartDto.getCheckType());
|
|
||||||
if (checkPartService.getOne(wrapper) != null){
|
|
||||||
return R.fail("检查部位已存在");
|
|
||||||
}
|
|
||||||
//封装数据
|
|
||||||
CheckPart checkPart = new CheckPart();
|
|
||||||
checkPart.setName(checkPartDto.getName());
|
|
||||||
checkPart.setCode(checkPartDto.getCode());
|
|
||||||
checkPart.setCheckType(checkPartDto.getCheckType());
|
|
||||||
checkPart.setExposureNum(checkPartDto.getExposureNum());
|
|
||||||
checkPart.setPackageName(checkPartDto.getPackageName());
|
|
||||||
checkPart.setPrice(checkPartDto.getPrice());
|
|
||||||
checkPart.setNumber(checkPartDto.getNumber());
|
|
||||||
checkPart.setServiceScope(checkPartDto.getServiceScope());
|
|
||||||
checkPart.setSubType(checkPartDto.getSubType());
|
|
||||||
checkPart.setRemark(checkPartDto.getRemark());
|
|
||||||
//保存
|
//保存
|
||||||
checkPartService.save(checkPart);
|
boolean save = checkPartService.save(checkPart);
|
||||||
return R.ok();
|
return R.ok(save);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R<?> removeCheckPart(Long code) {
|
public R<?> removeCheckPart(Integer checkPartId) {
|
||||||
if (ObjectUtil.isEmpty(code)){
|
boolean remove = checkPartService.removeById(checkPartId);
|
||||||
return R.fail("检查项目代码不能为空");
|
|
||||||
}
|
|
||||||
LambdaQueryWrapper<CheckPart> wrapper = new LambdaQueryWrapper<CheckPart>().eq(CheckPart::getCode, code);
|
|
||||||
boolean remove = checkPartService.remove(wrapper);
|
|
||||||
return R.ok(remove);
|
return R.ok(remove);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R<?> updateCheckPart(CheckPartDto checkPartDto) {
|
public R<?> updateCheckPart(CheckPart checkPart) {
|
||||||
return R.ok();
|
boolean b = checkPartService.updateById(checkPart);
|
||||||
|
return R.ok(b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.openhis.web.check.controller;
|
package com.openhis.web.check.controller;
|
||||||
|
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.check.domain.CheckPart;
|
||||||
import com.openhis.web.check.appservice.ICheckPartAppService;
|
import com.openhis.web.check.appservice.ICheckPartAppService;
|
||||||
import com.openhis.web.check.dto.CheckPartDto;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@@ -29,17 +29,17 @@ public class CheckPartController {
|
|||||||
* @Param
|
* @Param
|
||||||
*/
|
*/
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public R<?> addCheckPart(@RequestBody CheckPartDto checkPartDto){
|
public R<?> addCheckPart(@RequestBody CheckPart checkPart){
|
||||||
return R.ok(checkPartAppService.addCheckPart(checkPartDto));
|
return R.ok(checkPartAppService.addCheckPart(checkPart));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 删除检查部位
|
* 删除检查部位
|
||||||
* @Param code代码
|
* @Param code代码
|
||||||
*/
|
*/
|
||||||
@DeleteMapping("/delete/{code}")
|
@DeleteMapping("/delete/{checkPartId}")
|
||||||
public R<?> deleteCheckPart(@PathVariable Long code){
|
public R<?> deleteCheckPart(@PathVariable Integer checkPartId){
|
||||||
return R.ok(checkPartAppService.removeCheckPart(code));
|
return R.ok(checkPartAppService.removeCheckPart(checkPartId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -47,7 +47,7 @@ public class CheckPartController {
|
|||||||
* @Param
|
* @Param
|
||||||
*/
|
*/
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
public R<?> updateCheckPart(@RequestBody CheckPartDto checkPartDto){
|
public R<?> updateCheckPart(@RequestBody CheckPart checkPart){
|
||||||
return R.ok(checkPartAppService.updateCheckPart(checkPartDto));
|
return R.ok(checkPartAppService.updateCheckPart(checkPart));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.openhis.check.domain;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
@@ -24,7 +23,7 @@ public class CheckPart {
|
|||||||
|
|
||||||
/** 检查部位ID */
|
/** 检查部位ID */
|
||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
private Long id;
|
private Integer id;
|
||||||
|
|
||||||
/** 检查部位名称 */
|
/** 检查部位名称 */
|
||||||
private String name;
|
private String name;
|
||||||
|
|||||||
@@ -81,12 +81,39 @@ export function delCheckMethod(checkMethodId) {
|
|||||||
// 查询检查部位列表
|
// 查询检查部位列表
|
||||||
export function listCheckPart(query) {
|
export function listCheckPart(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/check-part/list',
|
url: '/check/part/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 新增检查部位
|
||||||
|
export function addCheckPart(data) {
|
||||||
|
return request({
|
||||||
|
url: '/check/part/add',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除检查部位
|
||||||
|
export function delCheckPart(checkPartId) {
|
||||||
|
return request({
|
||||||
|
url: '/check/part/delete/' + checkPartId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新检查部位
|
||||||
|
export function updateCheckPart(data) {
|
||||||
|
return request({
|
||||||
|
url: '/check/part/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询检查套餐列表
|
// 查询检查套餐列表
|
||||||
export function listCheckPackage(query) {
|
export function listCheckPackage(query) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
Reference in New Issue
Block a user