心电工作站
This commit is contained in:
parent
f685389455
commit
d56e1c6d77
@ -0,0 +1,103 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.ecgworkstation;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
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.*;
|
||||
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.ecgworkstation.vo.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.patientinfo.vo.patientinfoRespVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.ecgworkstation.EcgworkstationDO;
|
||||
import cn.iocoder.yudao.module.system.service.ecgworkstation.EcgworkstationService;
|
||||
|
||||
@Tag(name = "管理后台 - 心电工作站患者信息")
|
||||
@RestController
|
||||
@RequestMapping("/system/ecgworkstation")
|
||||
@Validated
|
||||
public class EcgworkstationController {
|
||||
|
||||
@Resource
|
||||
private EcgworkstationService ecgworkstationService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建心电工作站患者信息")
|
||||
public CommonResult<Integer> createEcgworkstation(@Valid @RequestBody EcgworkstationSaveReqVO createReqVO) {
|
||||
return success(ecgworkstationService.createEcgworkstation(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新心电工作站患者信息")
|
||||
public CommonResult<Boolean> updateEcgworkstation(@Valid @RequestBody EcgworkstationSaveReqVO updateReqVO) {
|
||||
ecgworkstationService.updateEcgworkstation(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除心电工作站患者信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> deleteEcgworkstation(@RequestParam("id") Integer id) {
|
||||
ecgworkstationService.deleteEcgworkstation(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除心电工作站患者信息")
|
||||
public CommonResult<Boolean> deleteEcgworkstationList(@RequestParam("ids") List<Integer> ids) {
|
||||
ecgworkstationService.deleteEcgworkstationListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得心电工作站患者信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<EcgworkstationRespVO> getEcgworkstation(@RequestParam("id") Integer id) {
|
||||
EcgworkstationDO ecgworkstation = ecgworkstationService.getEcgworkstation(id);
|
||||
return success(BeanUtils.toBean(ecgworkstation, EcgworkstationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得心电工作站患者信息分页")
|
||||
public CommonResult<PageResult<EcgworkstationRespVO>> getEcgworkstationPage(@Valid EcgworkstationPageReqVO pageReqVO) {
|
||||
PageResult<EcgworkstationDO> pageResult = ecgworkstationService.getEcgworkstationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, EcgworkstationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出心电工作站患者信息 Excel")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportEcgworkstationExcel(@Valid EcgworkstationPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<EcgworkstationDO> list = ecgworkstationService.getEcgworkstationPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "心电工作站患者信息.xls", "数据", EcgworkstationRespVO.class,
|
||||
BeanUtils.toBean(list, EcgworkstationRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/insertEcgworkstationPatientData")
|
||||
@Operation(summary = "批量插入心电工作站患者信息")
|
||||
public CommonResult<Boolean> insertEcgworkstationPatientData(@RequestBody List<patientinfoRespVO> patientInfoList) {
|
||||
ecgworkstationService.insertEcgworkstationPatientData(patientInfoList);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.ecgworkstation.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 EcgworkstationPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "患者ID", example = "30279")
|
||||
private String regid;
|
||||
|
||||
@Schema(description = "检查ID", example = "29841")
|
||||
private String examid;
|
||||
|
||||
@Schema(description = "患者姓名", example = "赵六")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别: 0-未知, 1-男, 2-女")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
private String age;
|
||||
|
||||
@Schema(description = "佩戴开始时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] wearstarttime;
|
||||
|
||||
@Schema(description = "佩戴结束时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] wearendtime;
|
||||
|
||||
@Schema(description = "佩戴时长 (时分秒格式)")
|
||||
private String duration;
|
||||
|
||||
@Schema(description = "佩戴时长 (秒数)")
|
||||
private Integer durationseconds;
|
||||
|
||||
@Schema(description = "是否生成报告: 0-未生成, 1-已生成")
|
||||
private Integer reportgenerated;
|
||||
|
||||
@Schema(description = "是否上级申请: 0-否, 1-是")
|
||||
private Integer superiorrequest;
|
||||
|
||||
@Schema(description = "机构ID", example = "23027")
|
||||
private String orgid;
|
||||
|
||||
@Schema(description = "机构名称", example = "张三")
|
||||
private String orgname;
|
||||
|
||||
@Schema(description = "管理机构")
|
||||
private String managementorg;
|
||||
|
||||
@Schema(description = "状态: 0-禁用, 1-启用", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@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;
|
||||
|
||||
@Schema(description = "文件名称", example = "张三")
|
||||
private String filename;
|
||||
|
||||
@Schema(description = "压缩文件名称", example = "张三")
|
||||
private String zipname;
|
||||
|
||||
@Schema(description = "是否回放: 0-否, 1-是")
|
||||
private Integer isreplay;
|
||||
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.ecgworkstation.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 EcgworkstationRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22960")
|
||||
@ExcelProperty("主键ID")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "患者ID", example = "30279")
|
||||
@ExcelProperty("患者ID")
|
||||
private String regid;
|
||||
|
||||
@Schema(description = "检查ID", example = "29841")
|
||||
@ExcelProperty("检查ID")
|
||||
private String examid;
|
||||
|
||||
@Schema(description = "患者姓名", example = "赵六")
|
||||
@ExcelProperty("患者姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别: 0-未知, 1-男, 2-女")
|
||||
@ExcelProperty("性别: 0-未知, 1-男, 2-女")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
@ExcelProperty("年龄")
|
||||
private String age;
|
||||
|
||||
@Schema(description = "佩戴开始时间")
|
||||
@ExcelProperty("佩戴开始时间")
|
||||
private LocalDateTime wearstarttime;
|
||||
|
||||
@Schema(description = "佩戴结束时间")
|
||||
@ExcelProperty("佩戴结束时间")
|
||||
private LocalDateTime wearendtime;
|
||||
|
||||
@Schema(description = "佩戴时长 (时分秒格式)")
|
||||
@ExcelProperty("佩戴时长 (时分秒格式)")
|
||||
private String duration;
|
||||
|
||||
@Schema(description = "佩戴时长 (秒数)")
|
||||
@ExcelProperty("佩戴时长 (秒数)")
|
||||
private Integer durationseconds;
|
||||
|
||||
@Schema(description = "是否生成报告: 0-未生成, 1-已生成")
|
||||
@ExcelProperty("是否生成报告: 0-未生成, 1-已生成")
|
||||
private Integer reportgenerated;
|
||||
|
||||
@Schema(description = "是否上级申请: 0-否, 1-是")
|
||||
@ExcelProperty("是否上级申请: 0-否, 1-是")
|
||||
private Integer superiorrequest;
|
||||
|
||||
@Schema(description = "机构ID", example = "23027")
|
||||
@ExcelProperty("机构ID")
|
||||
private String orgid;
|
||||
|
||||
@Schema(description = "机构名称", example = "张三")
|
||||
@ExcelProperty("机构名称")
|
||||
private String orgname;
|
||||
|
||||
@Schema(description = "管理机构")
|
||||
@ExcelProperty("管理机构")
|
||||
private String managementorg;
|
||||
|
||||
@Schema(description = "状态: 0-禁用, 1-启用", example = "2")
|
||||
@ExcelProperty("状态: 0-禁用, 1-启用")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createtime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatetime;
|
||||
|
||||
@Schema(description = "文件名称", example = "张三")
|
||||
@ExcelProperty("文件名称")
|
||||
private String filename;
|
||||
|
||||
@Schema(description = "压缩文件名称", example = "张三")
|
||||
@ExcelProperty("压缩文件名称")
|
||||
private String zipname;
|
||||
|
||||
@Schema(description = "是否回放: 0-否, 1-是")
|
||||
@ExcelProperty("是否回放: 0-否, 1-是")
|
||||
private Integer isreplay;
|
||||
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.ecgworkstation.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 EcgworkstationSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22960")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "患者ID", example = "30279")
|
||||
private String regid;
|
||||
|
||||
@Schema(description = "检查ID", example = "29841")
|
||||
private String examid;
|
||||
|
||||
@Schema(description = "患者姓名", example = "赵六")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别: 0-未知, 1-男, 2-女")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
private String age;
|
||||
|
||||
@Schema(description = "佩戴开始时间")
|
||||
private LocalDateTime wearstarttime;
|
||||
|
||||
@Schema(description = "佩戴结束时间")
|
||||
private LocalDateTime wearendtime;
|
||||
|
||||
@Schema(description = "佩戴时长 (时分秒格式)")
|
||||
private String duration;
|
||||
|
||||
@Schema(description = "佩戴时长 (秒数)")
|
||||
private Integer durationseconds;
|
||||
|
||||
@Schema(description = "是否生成报告: 0-未生成, 1-已生成")
|
||||
private Integer reportgenerated;
|
||||
|
||||
@Schema(description = "是否上级申请: 0-否, 1-是")
|
||||
private Integer superiorrequest;
|
||||
|
||||
@Schema(description = "机构ID", example = "23027")
|
||||
private String orgid;
|
||||
|
||||
@Schema(description = "机构名称", example = "张三")
|
||||
private String orgname;
|
||||
|
||||
@Schema(description = "管理机构")
|
||||
private String managementorg;
|
||||
|
||||
@Schema(description = "状态: 0-禁用, 1-启用", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createtime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatetime;
|
||||
|
||||
@Schema(description = "文件名称", example = "张三")
|
||||
private String filename;
|
||||
|
||||
@Schema(description = "压缩文件名称", example = "张三")
|
||||
private String zipname;
|
||||
|
||||
@Schema(description = "是否回放: 0-否, 1-是")
|
||||
private Integer isreplay;
|
||||
|
||||
}
|
||||
@ -0,0 +1,133 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.ecgworkstation;
|
||||
|
||||
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_ecgworkstation")
|
||||
@KeySequence("tb_ecgworkstation_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EcgworkstationDO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 患者ID
|
||||
*/
|
||||
@TableField("regid")
|
||||
private String regid;
|
||||
/**
|
||||
* 检查ID
|
||||
*/
|
||||
@TableField("examid")
|
||||
private String examid;
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
@TableField("name")
|
||||
private String name;
|
||||
/**
|
||||
* 性别: 0-未知, 1-男, 2-女
|
||||
*/
|
||||
@TableField("gender")
|
||||
private String gender;
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
@TableField("age")
|
||||
private String age;
|
||||
/**
|
||||
* 佩戴开始时间
|
||||
*/
|
||||
@TableField("wearstarttime")
|
||||
private LocalDateTime wearstarttime;
|
||||
/**
|
||||
* 佩戴结束时间
|
||||
*/
|
||||
@TableField("wearendtime")
|
||||
private LocalDateTime wearendtime;
|
||||
/**
|
||||
* 佩戴时长 (时分秒格式)
|
||||
*/
|
||||
@TableField("duration")
|
||||
private String duration;
|
||||
/**
|
||||
* 佩戴时长 (秒数)
|
||||
*/
|
||||
@TableField("durationseconds")
|
||||
private Integer durationseconds;
|
||||
/**
|
||||
* 是否生成报告: 0-未生成, 1-已生成
|
||||
*/
|
||||
@TableField("reportgenerated")
|
||||
private Integer reportgenerated;
|
||||
/**
|
||||
* 是否上级申请: 0-否, 1-是
|
||||
*/
|
||||
@TableField("superiorrequest")
|
||||
private Integer superiorrequest;
|
||||
/**
|
||||
* 机构ID
|
||||
*/
|
||||
@TableField("orgid")
|
||||
private String orgid;
|
||||
/**
|
||||
* 机构名称
|
||||
*/
|
||||
@TableField("orgname")
|
||||
private String orgname;
|
||||
/**
|
||||
* 管理机构
|
||||
*/
|
||||
@TableField("managementorg")
|
||||
private String managementorg;
|
||||
/**
|
||||
* 状态: 0-禁用, 1-启用
|
||||
*/
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("createtime")
|
||||
private LocalDateTime createtime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("updatetime")
|
||||
private LocalDateTime updatetime;
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
@TableField("filename")
|
||||
private String filename;
|
||||
/**
|
||||
* 压缩文件名称
|
||||
*/
|
||||
@TableField("zipname")
|
||||
private String zipname;
|
||||
/**
|
||||
* 是否回放: 0-否, 1-是
|
||||
*/
|
||||
@TableField("isreplay")
|
||||
private Integer isreplay;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.ecgworkstation;
|
||||
|
||||
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.ecgworkstation.EcgworkstationDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.ecgworkstation.vo.*;
|
||||
|
||||
/**
|
||||
* 心电工作站患者信息 Mapper
|
||||
*
|
||||
* @author 艾康菲
|
||||
*/
|
||||
@Mapper
|
||||
public interface EcgworkstationMapper extends BaseMapperX<EcgworkstationDO> {
|
||||
|
||||
default PageResult<EcgworkstationDO> selectPage(EcgworkstationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<EcgworkstationDO>()
|
||||
.eqIfPresent(EcgworkstationDO::getRegid, reqVO.getRegid())
|
||||
.eqIfPresent(EcgworkstationDO::getExamid, reqVO.getExamid())
|
||||
.likeIfPresent(EcgworkstationDO::getName, reqVO.getName())
|
||||
.eqIfPresent(EcgworkstationDO::getGender, reqVO.getGender())
|
||||
.eqIfPresent(EcgworkstationDO::getAge, reqVO.getAge())
|
||||
.betweenIfPresent(EcgworkstationDO::getWearstarttime, reqVO.getWearstarttime())
|
||||
.betweenIfPresent(EcgworkstationDO::getWearendtime, reqVO.getWearendtime())
|
||||
.eqIfPresent(EcgworkstationDO::getDuration, reqVO.getDuration())
|
||||
.eqIfPresent(EcgworkstationDO::getDurationseconds, reqVO.getDurationseconds())
|
||||
.eqIfPresent(EcgworkstationDO::getReportgenerated, reqVO.getReportgenerated())
|
||||
.eqIfPresent(EcgworkstationDO::getSuperiorrequest, reqVO.getSuperiorrequest())
|
||||
.eqIfPresent(EcgworkstationDO::getOrgid, reqVO.getOrgid())
|
||||
.likeIfPresent(EcgworkstationDO::getOrgname, reqVO.getOrgname())
|
||||
.eqIfPresent(EcgworkstationDO::getManagementorg, reqVO.getManagementorg())
|
||||
.eqIfPresent(EcgworkstationDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(EcgworkstationDO::getCreatetime, reqVO.getCreatetime())
|
||||
.betweenIfPresent(EcgworkstationDO::getUpdatetime, reqVO.getUpdatetime())
|
||||
.likeIfPresent(EcgworkstationDO::getFilename, reqVO.getFilename())
|
||||
.likeIfPresent(EcgworkstationDO::getZipname, reqVO.getZipname())
|
||||
.eqIfPresent(EcgworkstationDO::getIsreplay, reqVO.getIsreplay())
|
||||
.orderByDesc(EcgworkstationDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.system.service.ecgworkstation;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.patientinfo.vo.patientinfoRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.ecgworkstation.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.ecgworkstation.EcgworkstationDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 心电工作站患者信息 Service 接口
|
||||
*
|
||||
* @author 艾康菲
|
||||
*/
|
||||
public interface EcgworkstationService {
|
||||
|
||||
/**
|
||||
* 创建心电工作站患者信息
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createEcgworkstation(@Valid EcgworkstationSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新心电工作站患者信息
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateEcgworkstation(@Valid EcgworkstationSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除心电工作站患者信息
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteEcgworkstation(Integer id);
|
||||
|
||||
/**
|
||||
* 批量删除心电工作站患者信息
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteEcgworkstationListByIds(List<Integer> ids);
|
||||
|
||||
/**
|
||||
* 获得心电工作站患者信息
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 心电工作站患者信息
|
||||
*/
|
||||
EcgworkstationDO getEcgworkstation(Integer id);
|
||||
|
||||
/**
|
||||
* 获得心电工作站患者信息分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 心电工作站患者信息分页
|
||||
*/
|
||||
PageResult<EcgworkstationDO> getEcgworkstationPage(EcgworkstationPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 批量插入心电工作站患者信息
|
||||
*
|
||||
* @param patientInfoList 患者基础信息列表
|
||||
*/
|
||||
void insertEcgworkstationPatientData(List<patientinfoRespVO> patientInfoList);
|
||||
|
||||
}
|
||||
@ -0,0 +1,114 @@
|
||||
package cn.iocoder.yudao.module.system.service.ecgworkstation;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
|
||||
import com.alibaba.excel.util.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.ecgworkstation.vo.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.patientinfo.vo.patientinfoRespVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.ecgworkstation.EcgworkstationDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.ecgworkstation.EcgworkstationMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 心电工作站患者信息 Service 实现类
|
||||
*
|
||||
* @author 艾康菲
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class EcgworkstationServiceImpl implements EcgworkstationService {
|
||||
|
||||
@Resource
|
||||
private EcgworkstationMapper ecgworkstationMapper;
|
||||
|
||||
@Override
|
||||
public Integer createEcgworkstation(EcgworkstationSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
EcgworkstationDO ecgworkstation = BeanUtils.toBean(createReqVO, EcgworkstationDO.class);
|
||||
ecgworkstationMapper.insert(ecgworkstation);
|
||||
// 返回
|
||||
return ecgworkstation.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEcgworkstation(EcgworkstationSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateEcgworkstationExists(updateReqVO.getId());
|
||||
// 更新
|
||||
EcgworkstationDO updateObj = BeanUtils.toBean(updateReqVO, EcgworkstationDO.class);
|
||||
ecgworkstationMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteEcgworkstation(Integer id) {
|
||||
// 校验存在
|
||||
validateEcgworkstationExists(id);
|
||||
// 删除
|
||||
ecgworkstationMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteEcgworkstationListByIds(List<Integer> ids) {
|
||||
// 校验存在
|
||||
validateEcgworkstationExists(ids);
|
||||
// 删除
|
||||
ecgworkstationMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateEcgworkstationExists(List<Integer> ids) {
|
||||
List<EcgworkstationDO> list = ecgworkstationMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
}
|
||||
}
|
||||
|
||||
private void validateEcgworkstationExists(Integer id) {
|
||||
if (ecgworkstationMapper.selectById(id) == null) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EcgworkstationDO getEcgworkstation(Integer id) {
|
||||
return ecgworkstationMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<EcgworkstationDO> getEcgworkstationPage(EcgworkstationPageReqVO pageReqVO) {
|
||||
return ecgworkstationMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertEcgworkstationPatientData(List<patientinfoRespVO> patientInfoList) {
|
||||
if (CollUtil.isNotEmpty(patientInfoList)) {
|
||||
List<EcgworkstationDO> ecgList = new ArrayList<>();
|
||||
for (patientinfoRespVO patientInfo : patientInfoList) {
|
||||
EcgworkstationDO ecg = new EcgworkstationDO();
|
||||
ecg.setRegid(patientInfo.getRegid());
|
||||
String examId = UUID.randomUUID().toString().replaceAll("-", "");
|
||||
ecg.setExamid(examId);
|
||||
ecg.setName(patientInfo.getName());
|
||||
ecg.setGender(patientInfo.getGender());
|
||||
String idCard = patientInfo.getIdcard();
|
||||
if (StringUtils.isNotBlank(idCard)) {
|
||||
String age = NumberUtils.calculateAgeFromIdCard(idCard);
|
||||
ecg.setAge(age);
|
||||
}
|
||||
ecg.setOrgid(patientInfo.getOrgid());
|
||||
ecg.setOrgname(patientInfo.getOrgname());
|
||||
ecg.setStatus(0);
|
||||
ecg.setIsreplay(0);
|
||||
ecgList.add(ecg);
|
||||
}
|
||||
// 批量插入心电工作站基础数据
|
||||
ecgworkstationMapper.insertBatch(ecgList);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -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.ecgworkstation.EcgworkstationMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@ -299,6 +299,7 @@ yudao:
|
||||
- tb_era_data #忽略电测听数据表
|
||||
- health_thresholds #忽略健康阈值表
|
||||
- tb_device #忽略设备表
|
||||
- tb_ecgworkstation #忽略心电工作站患者信息表
|
||||
ignore-caches:
|
||||
- user_role_ids
|
||||
- permission_menu_ids
|
||||
|
||||
Loading…
Reference in New Issue
Block a user