检查方法、检查部位前端页面、完善后端接口逻辑
This commit is contained in:
@@ -2,6 +2,7 @@ package com.openhis.web.check.appservice.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.check.domain.CheckMethod;
|
||||
import com.openhis.check.service.ICheckMethodService;
|
||||
@@ -46,9 +47,16 @@ public class CheckMethodAppServiceImpl implements ICheckMethodAppService {
|
||||
if (checkMethodService.getOne(wrapper) != null){
|
||||
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.保存添加
|
||||
boolean save = checkMethodService.save(checkMethod);
|
||||
return R.ok();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
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.CheckPart;
|
||||
import com.openhis.check.service.ICheckPartService;
|
||||
@@ -23,12 +25,49 @@ public class CheckPartAppServiceImpl implements ICheckPartAppService {
|
||||
|
||||
@Override
|
||||
public R<?> addCheckPart(CheckPartDto checkPartDto) {
|
||||
//数据检验
|
||||
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);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> removeCheckPart(Long code) {
|
||||
return R.ok();
|
||||
if (ObjectUtil.isEmpty(code)){
|
||||
return R.fail("检查项目代码不能为空");
|
||||
}
|
||||
LambdaQueryWrapper<CheckPart> wrapper = new LambdaQueryWrapper<CheckPart>().eq(CheckPart::getCode, code);
|
||||
boolean remove = checkPartService.remove(wrapper);
|
||||
return R.ok(remove);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,10 +2,7 @@ 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;
|
||||
|
||||
@@ -6,5 +6,36 @@ import lombok.experimental.Accessors;
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CheckPartDto {
|
||||
/** 检查部位id */
|
||||
private Long id;
|
||||
|
||||
/** 检查部位名称 */
|
||||
private String name;
|
||||
|
||||
/** 检查部位编码 */
|
||||
private String code;
|
||||
|
||||
/** 检查部位检查类型 */
|
||||
private String checkType;
|
||||
|
||||
/** 曝光次数 */
|
||||
private Integer exposureNum;
|
||||
|
||||
/** 费用套餐 */
|
||||
private String packageName;
|
||||
|
||||
/** 金额 */
|
||||
private Double price;
|
||||
|
||||
/** 序号 */
|
||||
private Integer number;
|
||||
|
||||
/** 服务范围 */
|
||||
private String serviceScope;
|
||||
|
||||
/** 下级医技类型 */
|
||||
private String subType;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user