动脉硬化
This commit is contained in:
parent
9fcdbe06c9
commit
3fbc66af2c
@ -0,0 +1,120 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.arterial;
|
||||
|
||||
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.arterial.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.arterial.arterialDO;
|
||||
import cn.iocoder.yudao.module.system.service.arterial.arterialService;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.patientinfo.vo.patientinfoRespVO;
|
||||
|
||||
@Tag(name = "管理后台 - 动脉硬化检测患者")
|
||||
@RestController
|
||||
@RequestMapping("/system/arterial")
|
||||
@Validated
|
||||
public class arterialController {
|
||||
|
||||
@Resource
|
||||
private arterialService arterialService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建动脉硬化检测患者")
|
||||
public CommonResult<Long> createarterial(@Valid @RequestBody arterialSaveReqVO createReqVO) {
|
||||
return success(arterialService.createarterial(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新动脉硬化检测患者")
|
||||
public CommonResult<Boolean> updatearterial(@Valid @RequestBody arterialSaveReqVO updateReqVO) {
|
||||
arterialService.updatearterial(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除动脉硬化检测患者")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> deletearterial(@RequestParam("id") Long id) {
|
||||
arterialService.deletearterial(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除动脉硬化检测患者")
|
||||
public CommonResult<Boolean> deletearterialList(@RequestParam("ids") List<Long> ids) {
|
||||
arterialService.deletearterialListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得动脉硬化检测患者")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<arterialRespVO> getarterial(@RequestParam("id") Long id) {
|
||||
arterialDO arterial = arterialService.getarterial(id);
|
||||
return success(BeanUtils.toBean(arterial, arterialRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得动脉硬化检测患者分页")
|
||||
public CommonResult<PageResult<arterialRespVO>> getarterialPage(@Valid arterialPageReqVO pageReqVO) {
|
||||
PageResult<arterialDO> pageResult = arterialService.getarterialPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, arterialRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出动脉硬化检测患者 Excel")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportarterialExcel(@Valid arterialPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<arterialDO> list = arterialService.getarterialPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "动脉硬化检测患者.xls", "数据", arterialRespVO.class,
|
||||
BeanUtils.toBean(list, arterialRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/insertArterialPatientData")
|
||||
@Operation(summary = "批量插入动脉硬化患者基础信息")
|
||||
public CommonResult<Boolean> insertArterialPatientData(@RequestBody List<patientinfoRespVO> patientInfoList) {
|
||||
arterialService.insertArterialPatientData(patientInfoList);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/getArterialAnalysis")
|
||||
@Operation(summary = "根据examid查询动脉硬化分析结果")
|
||||
public CommonResult<arterialRespVO> getArterialAnalysis(@RequestParam("examid") String examid) {
|
||||
arterialDO arterial = arterialService.getArterialAnalysisByExamid(examid);
|
||||
return success(BeanUtils.toBean(arterial, arterialRespVO.class));
|
||||
}
|
||||
|
||||
@PutMapping("/updateArterialAnalysis")
|
||||
@Operation(summary = "根据examid更新动脉硬化分析结果")
|
||||
public CommonResult<Boolean> updateArterialAnalysis(@RequestParam("examid") String examid,
|
||||
@RequestParam("analysisResult") String analysisResult) {
|
||||
boolean result = arterialService.updateArterialAnalysisByExamid(examid, analysisResult);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.arterial.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 arterialPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "检查ID", example = "14721")
|
||||
private String examid;
|
||||
|
||||
@Schema(description = "患者注册ID", example = "11577")
|
||||
private String regid;
|
||||
|
||||
@Schema(description = "患者姓名", example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
private String age;
|
||||
|
||||
@Schema(description = "机构ID", example = "9984")
|
||||
private String orgid;
|
||||
|
||||
@Schema(description = "机构名称", example = "李四")
|
||||
private String orgname;
|
||||
|
||||
@Schema(description = "管理机构")
|
||||
private String managerorg;
|
||||
|
||||
@Schema(description = "设备ID", example = "11884")
|
||||
private String deviceid;
|
||||
|
||||
@Schema(description = "设备名称", example = "张三")
|
||||
private String devicename;
|
||||
|
||||
@Schema(description = "状态: 0=申请中, 1=已申请", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "佩戴时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] weartime;
|
||||
|
||||
@Schema(description = "分析结果")
|
||||
private String analysisresult;
|
||||
|
||||
@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,79 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.arterial.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 arterialRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "23623")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "检查ID", example = "14721")
|
||||
@ExcelProperty("检查ID")
|
||||
private String examid;
|
||||
|
||||
@Schema(description = "患者注册ID", example = "11577")
|
||||
@ExcelProperty("患者注册ID")
|
||||
private String regid;
|
||||
|
||||
@Schema(description = "患者姓名", example = "王五")
|
||||
@ExcelProperty("患者姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别")
|
||||
@ExcelProperty("性别")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
@ExcelProperty("年龄")
|
||||
private String age;
|
||||
|
||||
@Schema(description = "机构ID", example = "9984")
|
||||
@ExcelProperty("机构ID")
|
||||
private String orgid;
|
||||
|
||||
@Schema(description = "机构名称", example = "李四")
|
||||
@ExcelProperty("机构名称")
|
||||
private String orgname;
|
||||
|
||||
@Schema(description = "管理机构")
|
||||
@ExcelProperty("管理机构")
|
||||
private String managerorg;
|
||||
|
||||
@Schema(description = "设备ID", example = "11884")
|
||||
@ExcelProperty("设备ID")
|
||||
private String deviceid;
|
||||
|
||||
@Schema(description = "设备名称", example = "张三")
|
||||
@ExcelProperty("设备名称")
|
||||
private String devicename;
|
||||
|
||||
@Schema(description = "状态: 0=申请中, 1=已申请", example = "1")
|
||||
@ExcelProperty("状态: 0=申请中, 1=已申请")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "佩戴时间")
|
||||
@ExcelProperty("佩戴时间")
|
||||
private LocalDateTime weartime;
|
||||
|
||||
@Schema(description = "分析结果")
|
||||
@ExcelProperty("分析结果")
|
||||
private String analysisresult;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createtime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatetime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.arterial.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 arterialSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "23623")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "检查ID", example = "14721")
|
||||
private String examid;
|
||||
|
||||
@Schema(description = "患者注册ID", example = "11577")
|
||||
private String regid;
|
||||
|
||||
@Schema(description = "患者姓名", example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
private String age;
|
||||
|
||||
@Schema(description = "机构ID", example = "9984")
|
||||
private String orgid;
|
||||
|
||||
@Schema(description = "机构名称", example = "李四")
|
||||
private String orgname;
|
||||
|
||||
@Schema(description = "管理机构")
|
||||
private String managerorg;
|
||||
|
||||
@Schema(description = "设备ID", example = "11884")
|
||||
private String deviceid;
|
||||
|
||||
@Schema(description = "设备名称", example = "张三")
|
||||
private String devicename;
|
||||
|
||||
@Schema(description = "状态: 0=申请中, 1=已申请", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "佩戴时间")
|
||||
private LocalDateTime weartime;
|
||||
|
||||
@Schema(description = "分析结果")
|
||||
private String analysisresult;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createtime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatetime;
|
||||
|
||||
}
|
||||
@ -106,7 +106,6 @@ public class CgmController {
|
||||
@Operation(summary = "根据examid更新CGM动态血糖监测分析结果")
|
||||
public CommonResult<Boolean> updateCgmAnalysis(@RequestParam("examid") String examid,
|
||||
@RequestParam("analysisResult") String analysisResult) {
|
||||
// TODO: 调用service层方法实现更新逻辑
|
||||
return success(cgmService.updateCgmAnalysis(examid, analysisResult));
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,107 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.arterial;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
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_arterial")
|
||||
@KeySequence("tb_arterial_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class arterialDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 检查ID
|
||||
*/
|
||||
@TableField("examid")
|
||||
private String examid;
|
||||
/**
|
||||
* 患者注册ID
|
||||
*/
|
||||
@TableField("regid")
|
||||
private String regid;
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
@TableField("name")
|
||||
private String name;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
@TableField("gender")
|
||||
private String gender;
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
@TableField("age")
|
||||
private String age;
|
||||
/**
|
||||
* 机构ID
|
||||
*/
|
||||
@TableField("orgid")
|
||||
private String orgid;
|
||||
/**
|
||||
* 机构名称
|
||||
*/
|
||||
@TableField("orgname")
|
||||
private String orgname;
|
||||
/**
|
||||
* 管理机构
|
||||
*/
|
||||
@TableField("managerorg")
|
||||
private String managerorg;
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
@TableField("deviceid")
|
||||
private String deviceid;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@TableField("devicename")
|
||||
private String devicename;
|
||||
/**
|
||||
* 状态: 0=申请中, 1=已申请
|
||||
*/
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
/**
|
||||
* 佩戴时间
|
||||
*/
|
||||
@TableField("weartime")
|
||||
private LocalDateTime weartime;
|
||||
/**
|
||||
* 分析结果
|
||||
*/
|
||||
@TableField("analysisresult")
|
||||
private String analysisresult;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("createtime")
|
||||
private LocalDateTime createtime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("updatetime")
|
||||
private LocalDateTime updatetime;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.arterial;
|
||||
|
||||
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.arterial.arterialDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.arterial.vo.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
|
||||
/**
|
||||
* 动脉硬化检测患者 Mapper
|
||||
*
|
||||
* @author 艾康菲
|
||||
*/
|
||||
@Mapper
|
||||
public interface arterialMapper extends BaseMapperX<arterialDO> {
|
||||
|
||||
default PageResult<arterialDO> selectPage(arterialPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<arterialDO>()
|
||||
.eqIfPresent(arterialDO::getExamid, reqVO.getExamid())
|
||||
.eqIfPresent(arterialDO::getRegid, reqVO.getRegid())
|
||||
.likeIfPresent(arterialDO::getName, reqVO.getName())
|
||||
.eqIfPresent(arterialDO::getGender, reqVO.getGender())
|
||||
.eqIfPresent(arterialDO::getAge, reqVO.getAge())
|
||||
.eqIfPresent(arterialDO::getOrgid, reqVO.getOrgid())
|
||||
.likeIfPresent(arterialDO::getOrgname, reqVO.getOrgname())
|
||||
.eqIfPresent(arterialDO::getManagerorg, reqVO.getManagerorg())
|
||||
.eqIfPresent(arterialDO::getDeviceid, reqVO.getDeviceid())
|
||||
.likeIfPresent(arterialDO::getDevicename, reqVO.getDevicename())
|
||||
.eqIfPresent(arterialDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(arterialDO::getWeartime, reqVO.getWeartime())
|
||||
.eqIfPresent(arterialDO::getAnalysisresult, reqVO.getAnalysisresult())
|
||||
.betweenIfPresent(arterialDO::getCreatetime, reqVO.getCreatetime())
|
||||
.betweenIfPresent(arterialDO::getUpdatetime, reqVO.getUpdatetime())
|
||||
.orderByDesc(arterialDO::getId));
|
||||
}
|
||||
|
||||
// 根据 examid 查询动脉硬化分析结果
|
||||
arterialDO selectByExamid(@Param("examid") String examid);
|
||||
|
||||
// 根据 examid 更新动脉硬化分析结果
|
||||
int updateAnalysisResultByExamid(@Param("examid") String examid, @Param("analysisresult") String analysisresult);
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
package cn.iocoder.yudao.module.system.service.arterial;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.arterial.vo.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.patientinfo.vo.patientinfoRespVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.arterial.arterialDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 动脉硬化检测患者 Service 接口
|
||||
*
|
||||
* @author 艾康菲
|
||||
*/
|
||||
public interface arterialService {
|
||||
|
||||
/**
|
||||
* 创建动脉硬化检测患者
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createarterial(@Valid arterialSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新动脉硬化检测患者
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatearterial(@Valid arterialSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除动脉硬化检测患者
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletearterial(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除动脉硬化检测患者
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deletearterialListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 批量插入动脉硬化患者基础信息
|
||||
*
|
||||
* @param patientInfoList 患者信息列表
|
||||
*/
|
||||
void insertArterialPatientData(List<patientinfoRespVO> patientInfoList);
|
||||
|
||||
/**
|
||||
* 获得动脉硬化检测患者
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 动脉硬化检测患者
|
||||
*/
|
||||
arterialDO getarterial(Long id);
|
||||
|
||||
/**
|
||||
* 获得动脉硬化检测患者分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 动脉硬化检测患者分页
|
||||
*/
|
||||
PageResult<arterialDO> getarterialPage(arterialPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 根据 examid 查询动脉硬化分析结果
|
||||
* @param examid 检查ID
|
||||
* @return 动脉硬化检测患者
|
||||
*/
|
||||
arterialDO getArterialAnalysisByExamid(String examid);
|
||||
|
||||
/**
|
||||
* 根据 examid 更新动脉硬化分析结果
|
||||
* @param examid 检查ID
|
||||
* @param analysisresult 分析结果
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean updateArterialAnalysisByExamid(String examid, String analysisresult);
|
||||
}
|
||||
@ -0,0 +1,121 @@
|
||||
package cn.iocoder.yudao.module.system.service.arterial;
|
||||
|
||||
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.arterial.vo.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.patientinfo.vo.patientinfoRespVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.arterial.arterialDO;
|
||||
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.arterial.arterialMapper;
|
||||
|
||||
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 arterialServiceImpl implements arterialService {
|
||||
|
||||
@Resource
|
||||
private arterialMapper arterialMapper;
|
||||
|
||||
@Override
|
||||
public Long createarterial(arterialSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
arterialDO arterial = BeanUtils.toBean(createReqVO, arterialDO.class);
|
||||
arterialMapper.insert(arterial);
|
||||
// 返回
|
||||
return arterial.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatearterial(arterialSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatearterialExists(updateReqVO.getId());
|
||||
// 更新
|
||||
arterialDO updateObj = BeanUtils.toBean(updateReqVO, arterialDO.class);
|
||||
arterialMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletearterial(Long id) {
|
||||
// 校验存在
|
||||
validatearterialExists(id);
|
||||
// 删除
|
||||
arterialMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletearterialListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validatearterialExists(ids);
|
||||
// 删除
|
||||
arterialMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validatearterialExists(List<Long> ids) {
|
||||
List<arterialDO> list = arterialMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
}
|
||||
}
|
||||
|
||||
private void validatearterialExists(Long id) {
|
||||
if (arterialMapper.selectById(id) == null) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public arterialDO getarterial(Long id) {
|
||||
return arterialMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<arterialDO> getarterialPage(arterialPageReqVO pageReqVO) {
|
||||
return arterialMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertArterialPatientData(List<patientinfoRespVO> patientInfoList) {
|
||||
if (CollUtil.isNotEmpty(patientInfoList)) {
|
||||
List<arterialDO> arterialDataList = new ArrayList<>();
|
||||
for (patientinfoRespVO patientInfo : patientInfoList) {
|
||||
arterialDO arterial = new arterialDO();
|
||||
arterial.setRegid(patientInfo.getRegid());
|
||||
String examId = UUID.randomUUID().toString().replaceAll("-", ""); // 去除横线保持简洁
|
||||
arterial.setExamid(examId);
|
||||
arterial.setName(patientInfo.getName());
|
||||
arterial.setGender(patientInfo.getGender());
|
||||
arterial.setOrgid(patientInfo.getOrgid());
|
||||
arterial.setOrgname(patientInfo.getOrgname());
|
||||
arterial.setStatus(0); // 默认状态:0申请中
|
||||
arterialDataList.add(arterial);
|
||||
}
|
||||
// 批量插入动脉硬化数据
|
||||
arterialMapper.insertBatch(arterialDataList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public arterialDO getArterialAnalysisByExamid(String examid) {
|
||||
return arterialMapper.selectByExamid(examid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateArterialAnalysisByExamid(String examid, String analysisresult) {
|
||||
return arterialMapper.updateAnalysisResultByExamid(examid, analysisresult) > 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
<?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.arterial.arterialMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="selectByExamid" resultType="cn.iocoder.yudao.module.system.dal.dataobject.arterial.arterialDO">
|
||||
SELECT * FROM tb_arterial WHERE examid = #{examid}
|
||||
</select>
|
||||
|
||||
<update id="updateAnalysisResultByExamid">
|
||||
UPDATE tb_arterial SET analysisresult = #{analysisresult}, updatetime = NOW() WHERE examid = #{examid}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@ -289,6 +289,8 @@ yudao:
|
||||
- tb_staticecg #忽略静态心电图数据表
|
||||
- tb_cgm #忽略动态血压人员信息表
|
||||
- tb_cgmdata #忽略动态血压数据表
|
||||
- tb_arterial #忽略动态血压人员信息表
|
||||
- tb_arterialdata #忽略动态血压数据表
|
||||
ignore-caches:
|
||||
- user_role_ids
|
||||
- permission_menu_ids
|
||||
|
||||
Loading…
Reference in New Issue
Block a user