动态心电

This commit is contained in:
Flow 2025-07-14 11:21:52 +08:00
parent 2757eb41f6
commit a0d3da1b9e
10 changed files with 655 additions and 0 deletions

View File

@ -0,0 +1,97 @@
package cn.iocoder.yudao.module.system.controller.admin.ecgdata;
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.ecgdata.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.ecgdata.ecgdataDO;
import cn.iocoder.yudao.module.system.service.ecgdata.ecgdataService;
@Tag(name = "管理后台 - 心电图动态数据")
@RestController
@RequestMapping("/system/ecgdata")
@Validated
public class ecgdataController {
@Resource
private ecgdataService ecgdataService;
@PostMapping("/create")
@Operation(summary = "创建心电图动态数据")
public CommonResult<Integer> createecgdata(@Valid @RequestBody ecgdataSaveReqVO createReqVO) {
return success(ecgdataService.createecgdata(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新心电图动态数据")
public CommonResult<Boolean> updateecgdata(@Valid @RequestBody ecgdataSaveReqVO updateReqVO) {
ecgdataService.updateecgdata(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除心电图动态数据")
@Parameter(name = "id", description = "编号", required = true)
public CommonResult<Boolean> deleteecgdata(@RequestParam("id") Integer id) {
ecgdataService.deleteecgdata(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除心电图动态数据")
public CommonResult<Boolean> deleteecgdataList(@RequestParam("ids") List<Integer> ids) {
ecgdataService.deleteecgdataListByIds(ids);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得心电图动态数据")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
public CommonResult<ecgdataRespVO> getecgdata(@RequestParam("id") Integer id) {
ecgdataDO ecgdata = ecgdataService.getecgdata(id);
return success(BeanUtils.toBean(ecgdata, ecgdataRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得心电图动态数据分页")
public CommonResult<PageResult<ecgdataRespVO>> getecgdataPage(@Valid ecgdataPageReqVO pageReqVO) {
PageResult<ecgdataDO> pageResult = ecgdataService.getecgdataPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ecgdataRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出心电图动态数据 Excel")
@ApiAccessLog(operateType = EXPORT)
public void exportecgdataExcel(@Valid ecgdataPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ecgdataDO> list = ecgdataService.getecgdataPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "心电图动态数据.xls", "数据", ecgdataRespVO.class,
BeanUtils.toBean(list, ecgdataRespVO.class));
}
}

View File

@ -0,0 +1,73 @@
package cn.iocoder.yudao.module.system.controller.admin.ecgdata.vo;
import lombok.*;
import java.time.LocalTime;
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 ecgdataPageReqVO extends PageParam {
@Schema(description = "患者ID", example = "30222")
private String regid;
@Schema(description = "检查ID", example = "6066")
private String examid;
@Schema(description = "患者姓名", example = "芋艿")
private String name;
@Schema(description = "性别0-未知1-男2-女")
private String gender;
@Schema(description = "年龄")
private Integer 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 LocalTime duration;
@Schema(description = "佩戴时长(秒数)")
private Integer durationseconds;
@Schema(description = "是否生成报告0-未生成1-已生成")
private Integer reportgenerated;
@Schema(description = "是否上级申请0-否1-是")
private Integer superiorrequest;
@Schema(description = "机构ID", example = "8423")
private String orgid;
@Schema(description = "机构名称", example = "芋艿")
private String orgname;
@Schema(description = "管理机构")
private String managerorg;
@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;
}

View File

@ -0,0 +1,89 @@
package cn.iocoder.yudao.module.system.controller.admin.ecgdata.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalTime;
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 ecgdataRespVO {
@Schema(description = "主键ID自增", requiredMode = Schema.RequiredMode.REQUIRED, example = "18914")
@ExcelProperty("主键ID自增")
private Integer id;
@Schema(description = "患者ID", example = "30222")
@ExcelProperty("患者ID")
private String regid;
@Schema(description = "检查ID", example = "6066")
@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 Integer age;
@Schema(description = "佩戴开始时间")
@ExcelProperty("佩戴开始时间")
private LocalDateTime wearstarttime;
@Schema(description = "佩戴结束时间")
@ExcelProperty("佩戴结束时间")
private LocalDateTime wearendtime;
@Schema(description = "佩戴时长(时分秒格式)")
@ExcelProperty("佩戴时长(时分秒格式)")
private LocalTime 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 = "8423")
@ExcelProperty("机构ID")
private String orgid;
@Schema(description = "机构名称", example = "芋艿")
@ExcelProperty("机构名称")
private String orgname;
@Schema(description = "管理机构")
@ExcelProperty("管理机构")
private String managerorg;
@Schema(description = "状态0-禁用1-启用", example = "2")
@ExcelProperty("状态0-禁用1-启用")
private Integer status;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createtime;
@Schema(description = "更新时间")
@ExcelProperty("更新时间")
private LocalDateTime updatetime;
}

View File

@ -0,0 +1,70 @@
package cn.iocoder.yudao.module.system.controller.admin.ecgdata.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalTime;
import java.util.*;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 心电图动态数据新增/修改 Request VO")
@Data
public class ecgdataSaveReqVO {
@Schema(description = "主键ID自增", requiredMode = Schema.RequiredMode.REQUIRED, example = "18914")
private Integer id;
@Schema(description = "患者ID", example = "30222")
private String regid;
@Schema(description = "检查ID", example = "6066")
private String examid;
@Schema(description = "患者姓名", example = "芋艿")
private String name;
@Schema(description = "性别0-未知1-男2-女")
private String gender;
@Schema(description = "年龄")
private Integer age;
@Schema(description = "佩戴开始时间")
private LocalDateTime wearstarttime;
@Schema(description = "佩戴结束时间")
private LocalDateTime wearendtime;
@Schema(description = "佩戴时长(时分秒格式)")
private LocalTime duration;
@Schema(description = "佩戴时长(秒数)")
private Integer durationseconds;
@Schema(description = "是否生成报告0-未生成1-已生成")
private Integer reportgenerated;
@Schema(description = "是否上级申请0-否1-是")
private Integer superiorrequest;
@Schema(description = "机构ID", example = "8423")
private String orgid;
@Schema(description = "机构名称", example = "芋艿")
private String orgname;
@Schema(description = "管理机构")
private String managerorg;
@Schema(description = "状态0-禁用1-启用", example = "2")
private Integer status;
@Schema(description = "创建时间")
private LocalDateTime createtime;
@Schema(description = "更新时间")
private LocalDateTime updatetime;
}

View File

@ -0,0 +1,119 @@
package cn.iocoder.yudao.module.system.dal.dataobject.ecgdata;
import lombok.*;
import java.time.*;
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("ecgdyndata")
@KeySequence("ecgdyndata_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ecgdataDO{
/**
* 主键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 Integer age;
/**
* 佩戴开始时间
*/
@TableField("wearstarttime")
private LocalDateTime wearstarttime;
/**
* 佩戴结束时间
*/
@TableField("wearendtime")
private LocalDateTime wearendtime;
/**
* 佩戴时长时分秒格式
*/
@TableField("duration")
private LocalTime 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("managerorg")
private String managerorg;
/**
* 状态0-禁用1-启用
*/
@TableField("status")
private Integer status;
/**
* 创建时间
*/
@TableField("createtime")
private LocalDateTime createtime;
/**
* 更新时间
*/
@TableField("updatetime")
private LocalDateTime updatetime;
}

View File

@ -0,0 +1,42 @@
package cn.iocoder.yudao.module.system.dal.mysql.ecgdata;
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.ecgdata.ecgdataDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.ecgdata.vo.*;
/**
* 心电图动态数据 Mapper
*
* @author 艾康菲
*/
@Mapper
public interface ecgdataMapper extends BaseMapperX<ecgdataDO> {
default PageResult<ecgdataDO> selectPage(ecgdataPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ecgdataDO>()
.eqIfPresent(ecgdataDO::getRegid, reqVO.getRegid())
.eqIfPresent(ecgdataDO::getExamid, reqVO.getExamid())
.likeIfPresent(ecgdataDO::getName, reqVO.getName())
.eqIfPresent(ecgdataDO::getGender, reqVO.getGender())
.eqIfPresent(ecgdataDO::getAge, reqVO.getAge())
.betweenIfPresent(ecgdataDO::getWearstarttime, reqVO.getWearstarttime())
.betweenIfPresent(ecgdataDO::getWearendtime, reqVO.getWearendtime())
.eqIfPresent(ecgdataDO::getDuration, reqVO.getDuration())
.eqIfPresent(ecgdataDO::getDurationseconds, reqVO.getDurationseconds())
.eqIfPresent(ecgdataDO::getReportgenerated, reqVO.getReportgenerated())
.eqIfPresent(ecgdataDO::getSuperiorrequest, reqVO.getSuperiorrequest())
.eqIfPresent(ecgdataDO::getOrgid, reqVO.getOrgid())
.likeIfPresent(ecgdataDO::getOrgname, reqVO.getOrgname())
.eqIfPresent(ecgdataDO::getManagerorg, reqVO.getManagerorg())
.eqIfPresent(ecgdataDO::getStatus, reqVO.getStatus())
.betweenIfPresent(ecgdataDO::getCreatetime, reqVO.getCreatetime())
.betweenIfPresent(ecgdataDO::getUpdatetime, reqVO.getUpdatetime())
.orderByDesc(ecgdataDO::getId));
}
}

View File

@ -0,0 +1,62 @@
package cn.iocoder.yudao.module.system.service.ecgdata;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.system.controller.admin.ecgdata.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.ecgdata.ecgdataDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
/**
* 心电图动态数据 Service 接口
*
* @author 艾康菲
*/
public interface ecgdataService {
/**
* 创建心电图动态数据
*
* @param createReqVO 创建信息
* @return 编号
*/
Integer createecgdata(@Valid ecgdataSaveReqVO createReqVO);
/**
* 更新心电图动态数据
*
* @param updateReqVO 更新信息
*/
void updateecgdata(@Valid ecgdataSaveReqVO updateReqVO);
/**
* 删除心电图动态数据
*
* @param id 编号
*/
void deleteecgdata(Integer id);
/**
* 批量删除心电图动态数据
*
* @param ids 编号
*/
void deleteecgdataListByIds(List<Integer> ids);
/**
* 获得心电图动态数据
*
* @param id 编号
* @return 心电图动态数据
*/
ecgdataDO getecgdata(Integer id);
/**
* 获得心电图动态数据分页
*
* @param pageReqVO 分页查询
* @return 心电图动态数据分页
*/
PageResult<ecgdataDO> getecgdataPage(ecgdataPageReqVO pageReqVO);
}

View File

@ -0,0 +1,90 @@
package cn.iocoder.yudao.module.system.service.ecgdata;
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.ecgdata.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.ecgdata.ecgdataDO;
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.ecgdata.ecgdataMapper;
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 ecgdataServiceImpl implements ecgdataService {
@Resource
private ecgdataMapper ecgdataMapper;
@Override
public Integer createecgdata(ecgdataSaveReqVO createReqVO) {
// 插入
ecgdataDO ecgdata = BeanUtils.toBean(createReqVO, ecgdataDO.class);
ecgdataMapper.insert(ecgdata);
// 返回
return ecgdata.getId();
}
@Override
public void updateecgdata(ecgdataSaveReqVO updateReqVO) {
// 校验存在
validateecgdataExists(updateReqVO.getId());
// 更新
ecgdataDO updateObj = BeanUtils.toBean(updateReqVO, ecgdataDO.class);
ecgdataMapper.updateById(updateObj);
}
@Override
public void deleteecgdata(Integer id) {
// 校验存在
validateecgdataExists(id);
// 删除
ecgdataMapper.deleteById(id);
}
@Override
public void deleteecgdataListByIds(List<Integer> ids) {
// 校验存在
validateecgdataExists(ids);
// 删除
ecgdataMapper.deleteByIds(ids);
}
private void validateecgdataExists(List<Integer> ids) {
List<ecgdataDO> list = ecgdataMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
}
}
private void validateecgdataExists(Integer id) {
if (ecgdataMapper.selectById(id) == null) {
}
}
@Override
public ecgdataDO getecgdata(Integer id) {
return ecgdataMapper.selectById(id);
}
@Override
public PageResult<ecgdataDO> getecgdataPage(ecgdataPageReqVO pageReqVO) {
return ecgdataMapper.selectPage(pageReqVO);
}
}

View File

@ -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.ecgdata.ecgdataMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

View File

@ -282,6 +282,7 @@ yudao:
ignore-tables:
- tb_org #忽略机构表
- patientinfo #忽略人员基础信息表
- ecgdyndata #忽略动态心电数据表
ignore-caches:
- user_role_ids
- permission_menu_ids