Merge branch 'master' of http://114.55.171.231:3000/Euni4U/shanghai_backend
This commit is contained in:
commit
30be413a14
@ -0,0 +1,123 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.arterialdata;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.arterialdata.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.arterialdata.arterialdataDO;
|
||||||
|
import cn.iocoder.yudao.module.system.service.arterialdata.arterialdataService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 动脉硬化检测数据")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/arterialdata")
|
||||||
|
@Validated
|
||||||
|
public class arterialdataController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private arterialdataService arterialdataService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建动脉硬化检测数据")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:arterialdata:create')")
|
||||||
|
public CommonResult<Long> createarterialdata(@Valid @RequestBody arterialdataSaveReqVO createReqVO) {
|
||||||
|
return success(arterialdataService.createarterialdata(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新动脉硬化检测数据")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:arterialdata:update')")
|
||||||
|
public CommonResult<Boolean> updatearterialdata(@Valid @RequestBody arterialdataSaveReqVO updateReqVO) {
|
||||||
|
arterialdataService.updatearterialdata(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除动脉硬化检测数据")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:arterialdata:delete')")
|
||||||
|
public CommonResult<Boolean> deletearterialdata(@RequestParam("id") Long id) {
|
||||||
|
arterialdataService.deletearterialdata(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除动脉硬化检测数据")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:arterialdata:delete')")
|
||||||
|
public CommonResult<Boolean> deletearterialdataList(@RequestParam("ids") List<Long> ids) {
|
||||||
|
arterialdataService.deletearterialdataListByIds(ids);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得动脉硬化检测数据")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:arterialdata:query')")
|
||||||
|
public CommonResult<arterialdataRespVO> getarterialdata(@RequestParam("id") Long id) {
|
||||||
|
arterialdataDO arterialdata = arterialdataService.getarterialdata(id);
|
||||||
|
return success(BeanUtils.toBean(arterialdata, arterialdataRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得动脉硬化检测数据分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:arterialdata:query')")
|
||||||
|
public CommonResult<PageResult<arterialdataRespVO>> getarterialdataPage(@Valid arterialdataPageReqVO pageReqVO) {
|
||||||
|
PageResult<arterialdataDO> pageResult = arterialdataService.getarterialdataPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, arterialdataRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出动脉硬化检测数据 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:arterialdata:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportarterialdataExcel(@Valid arterialdataPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<arterialdataDO> list = arterialdataService.getarterialdataPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "动脉硬化检测数据.xls", "数据", arterialdataRespVO.class,
|
||||||
|
BeanUtils.toBean(list, arterialdataRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getByExamidAndRegid")
|
||||||
|
@Operation(summary = "根据检查ID和患者ID获取动脉硬化检测数据")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:arterialdata:query')")
|
||||||
|
public CommonResult<arterialdataRespVO> getarterialdataByExamidAndRegid(@RequestParam("examid") String examid, @RequestParam("regid") String regid) {
|
||||||
|
arterialdataDO arterialdata = arterialdataService.getarterialdataByExamidAndRegid(examid, regid);
|
||||||
|
return success(BeanUtils.toBean(arterialdata, arterialdataRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/saveDiagnosisByExamidAndRegid")
|
||||||
|
@Operation(summary = "根据examid和regid保存诊断结论")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:arterialdata:update')")
|
||||||
|
public CommonResult<Boolean> savearterialdataDiagnosis(@RequestBody Map<String, String> req) {
|
||||||
|
String examid = req.get("examid");
|
||||||
|
String regid = req.get("regid");
|
||||||
|
String diagnosis = req.get("diagnosis");
|
||||||
|
arterialdataService.savearterialdataDiagnosis(examid, regid, diagnosis);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.arterialdata.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 动脉硬化检测数据分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class arterialdataPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "注册ID", example = "32353")
|
||||||
|
private String regid;
|
||||||
|
|
||||||
|
@Schema(description = "检查ID", example = "17100")
|
||||||
|
private String examid;
|
||||||
|
|
||||||
|
@Schema(description = "佩戴时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] weartime;
|
||||||
|
|
||||||
|
@Schema(description = "测量时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] measuretime;
|
||||||
|
|
||||||
|
@Schema(description = "设备ID", example = "6791")
|
||||||
|
private String deviceid;
|
||||||
|
|
||||||
|
@Schema(description = "设备名称", example = "芋艿")
|
||||||
|
private String devicename;
|
||||||
|
|
||||||
|
@Schema(description = "检测数据")
|
||||||
|
private String data;
|
||||||
|
|
||||||
|
@Schema(description = "诊断结果")
|
||||||
|
private String diagnosis;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createtime;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] updatetime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.arterialdata.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 动脉硬化检测数据 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class arterialdataRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13424")
|
||||||
|
@ExcelProperty("主键ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "注册ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32353")
|
||||||
|
@ExcelProperty("注册ID")
|
||||||
|
private String regid;
|
||||||
|
|
||||||
|
@Schema(description = "检查ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17100")
|
||||||
|
@ExcelProperty("检查ID")
|
||||||
|
private String examid;
|
||||||
|
|
||||||
|
@Schema(description = "佩戴时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("佩戴时间")
|
||||||
|
private LocalDateTime weartime;
|
||||||
|
|
||||||
|
@Schema(description = "测量时间")
|
||||||
|
@ExcelProperty("测量时间")
|
||||||
|
private LocalDateTime measuretime;
|
||||||
|
|
||||||
|
@Schema(description = "设备ID", example = "6791")
|
||||||
|
@ExcelProperty("设备ID")
|
||||||
|
private String deviceid;
|
||||||
|
|
||||||
|
@Schema(description = "设备名称", example = "芋艿")
|
||||||
|
@ExcelProperty("设备名称")
|
||||||
|
private String devicename;
|
||||||
|
|
||||||
|
@Schema(description = "检测数据")
|
||||||
|
@ExcelProperty("检测数据")
|
||||||
|
private String data;
|
||||||
|
|
||||||
|
@Schema(description = "诊断结果")
|
||||||
|
@ExcelProperty("诊断结果")
|
||||||
|
private String diagnosis;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createtime;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@ExcelProperty("更新时间")
|
||||||
|
private LocalDateTime updatetime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.arterialdata.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 动脉硬化检测数据新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class arterialdataSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13424")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "注册ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32353")
|
||||||
|
@NotEmpty(message = "注册ID不能为空")
|
||||||
|
private String regid;
|
||||||
|
|
||||||
|
@Schema(description = "检查ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17100")
|
||||||
|
@NotEmpty(message = "检查ID不能为空")
|
||||||
|
private String examid;
|
||||||
|
|
||||||
|
@Schema(description = "佩戴时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "佩戴时间不能为空")
|
||||||
|
private LocalDateTime weartime;
|
||||||
|
|
||||||
|
@Schema(description = "测量时间")
|
||||||
|
private LocalDateTime measuretime;
|
||||||
|
|
||||||
|
@Schema(description = "设备ID", example = "6791")
|
||||||
|
private String deviceid;
|
||||||
|
|
||||||
|
@Schema(description = "设备名称", example = "芋艿")
|
||||||
|
private String devicename;
|
||||||
|
|
||||||
|
@Schema(description = "检测数据")
|
||||||
|
private String data;
|
||||||
|
|
||||||
|
@Schema(description = "诊断结果")
|
||||||
|
private String diagnosis;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private LocalDateTime createtime;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
private LocalDateTime updatetime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,83 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.dal.dataobject.arterialdata;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动脉硬化检测数据 DO
|
||||||
|
*
|
||||||
|
* @author 艾康菲
|
||||||
|
*/
|
||||||
|
@TableName("tb_arterialdata")
|
||||||
|
@KeySequence("tb_arterialdata_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class arterialdataDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 注册ID
|
||||||
|
*/
|
||||||
|
@TableField("regid")
|
||||||
|
private String regid;
|
||||||
|
/**
|
||||||
|
* 检查ID
|
||||||
|
*/
|
||||||
|
@TableField("examid")
|
||||||
|
private String examid;
|
||||||
|
/**
|
||||||
|
* 佩戴时间
|
||||||
|
*/
|
||||||
|
@TableField("weartime")
|
||||||
|
private LocalDateTime weartime;
|
||||||
|
/**
|
||||||
|
* 测量时间
|
||||||
|
*/
|
||||||
|
@TableField("measuretime")
|
||||||
|
private LocalDateTime measuretime;
|
||||||
|
/**
|
||||||
|
* 设备ID
|
||||||
|
*/
|
||||||
|
@TableField("deviceid")
|
||||||
|
private String deviceid;
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
@TableField("devicename")
|
||||||
|
private String devicename;
|
||||||
|
/**
|
||||||
|
* 检测数据
|
||||||
|
*/
|
||||||
|
@TableField("data")
|
||||||
|
private String data;
|
||||||
|
/**
|
||||||
|
* 诊断结论
|
||||||
|
*/
|
||||||
|
@TableField("diagnosis")
|
||||||
|
private String diagnosis;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField("createtime")
|
||||||
|
private LocalDateTime createtime;
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField("updatetime")
|
||||||
|
private LocalDateTime updatetime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.dal.mysql.arterialdata;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.arterialdata.arterialdataDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.arterialdata.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动脉硬化检测数据 Mapper
|
||||||
|
*
|
||||||
|
* @author 艾康菲
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface arterialdataMapper extends BaseMapperX<arterialdataDO> {
|
||||||
|
|
||||||
|
default PageResult<arterialdataDO> selectPage(arterialdataPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<arterialdataDO>()
|
||||||
|
.eqIfPresent(arterialdataDO::getRegid, reqVO.getRegid())
|
||||||
|
.eqIfPresent(arterialdataDO::getExamid, reqVO.getExamid())
|
||||||
|
.betweenIfPresent(arterialdataDO::getWeartime, reqVO.getWeartime())
|
||||||
|
.betweenIfPresent(arterialdataDO::getMeasuretime, reqVO.getMeasuretime())
|
||||||
|
.eqIfPresent(arterialdataDO::getDeviceid, reqVO.getDeviceid())
|
||||||
|
.likeIfPresent(arterialdataDO::getDevicename, reqVO.getDevicename())
|
||||||
|
.eqIfPresent(arterialdataDO::getData, reqVO.getData())
|
||||||
|
.eqIfPresent(arterialdataDO::getDiagnosis, reqVO.getDiagnosis())
|
||||||
|
.betweenIfPresent(arterialdataDO::getCreatetime, reqVO.getCreatetime())
|
||||||
|
.betweenIfPresent(arterialdataDO::getUpdatetime, reqVO.getUpdatetime())
|
||||||
|
.orderByDesc(arterialdataDO::getId));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.service.arterialdata;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.arterialdata.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.arterialdata.arterialdataDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动脉硬化检测数据 Service 接口
|
||||||
|
*
|
||||||
|
* @author 艾康菲
|
||||||
|
*/
|
||||||
|
public interface arterialdataService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建动脉硬化检测数据
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createarterialdata(@Valid arterialdataSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新动脉硬化检测数据
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updatearterialdata(@Valid arterialdataSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除动脉硬化检测数据
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deletearterialdata(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除动脉硬化检测数据
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deletearterialdataListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得动脉硬化检测数据
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 动脉硬化检测数据
|
||||||
|
*/
|
||||||
|
arterialdataDO getarterialdata(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得动脉硬化检测数据分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 动脉硬化检测数据分页
|
||||||
|
*/
|
||||||
|
PageResult<arterialdataDO> getarterialdataPage(arterialdataPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据检查ID和患者ID获取动脉硬化检测数据
|
||||||
|
*/
|
||||||
|
arterialdataDO getarterialdataByExamidAndRegid(String examid, String regid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据examid和regid保存诊断结论
|
||||||
|
*/
|
||||||
|
void savearterialdataDiagnosis(String examid, String regid, String diagnosis);
|
||||||
|
}
|
||||||
@ -0,0 +1,113 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.service.arterialdata;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.arterialdata.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.arterialdata.arterialdataDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.system.dal.mysql.arterialdata.arterialdataMapper;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||||
|
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动脉硬化检测数据 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 艾康菲
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class arterialdataServiceImpl implements arterialdataService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private arterialdataMapper arterialdataMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createarterialdata(arterialdataSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
arterialdataDO arterialdata = BeanUtils.toBean(createReqVO, arterialdataDO.class);
|
||||||
|
arterialdataMapper.insert(arterialdata);
|
||||||
|
// 返回
|
||||||
|
return arterialdata.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatearterialdata(arterialdataSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validatearterialdataExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
arterialdataDO updateObj = BeanUtils.toBean(updateReqVO, arterialdataDO.class);
|
||||||
|
arterialdataMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deletearterialdata(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validatearterialdataExists(id);
|
||||||
|
// 删除
|
||||||
|
arterialdataMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deletearterialdataListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validatearterialdataExists(ids);
|
||||||
|
// 删除
|
||||||
|
arterialdataMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validatearterialdataExists(List<Long> ids) {
|
||||||
|
List<arterialdataDO> list = arterialdataMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validatearterialdataExists(Long id) {
|
||||||
|
if (arterialdataMapper.selectById(id) == null) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public arterialdataDO getarterialdata(Long id) {
|
||||||
|
return arterialdataMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<arterialdataDO> getarterialdataPage(arterialdataPageReqVO pageReqVO) {
|
||||||
|
return arterialdataMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public arterialdataDO getarterialdataByExamidAndRegid(String examid, String regid) {
|
||||||
|
return arterialdataMapper.selectOne(
|
||||||
|
new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<arterialdataDO>()
|
||||||
|
.eq(arterialdataDO::getExamid, examid)
|
||||||
|
.eq(arterialdataDO::getRegid, regid)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void savearterialdataDiagnosis(String examid, String regid, String diagnosis) {
|
||||||
|
int updated = arterialdataMapper.update(
|
||||||
|
null,
|
||||||
|
new com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper<arterialdataDO>()
|
||||||
|
.eq(arterialdataDO::getExamid, examid)
|
||||||
|
.eq(arterialdataDO::getRegid, regid)
|
||||||
|
.set(arterialdataDO::getDiagnosis, diagnosis)
|
||||||
|
);
|
||||||
|
if (updated == 0) {
|
||||||
|
throw new RuntimeException("未找到对应的动脉硬化检测数据记录,无法保存诊断结论");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.iocoder.yudao.module.system.dal.mysql.arterialdata.arterialdataMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue
Block a user