新增 危急值模块
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
yudao-ui-admin CI / build (14.x) (push) Has been cancelled
yudao-ui-admin CI / build (16.x) (push) Has been cancelled

This commit is contained in:
lxd 2024-12-03 15:40:59 +08:00
parent 29e4687ba1
commit c8184c3b94
9 changed files with 558 additions and 0 deletions

View File

@ -0,0 +1,96 @@
package cn.iocoder.yudao.module.system.controller.admin.warning;
import org.springframework.web.bind.annotation.*;
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 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.warning.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.warning.WarningDO;
import cn.iocoder.yudao.module.system.service.warning.WarningService;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
@Tag(name = "管理后台 - 危急值记录")
@RestController
@RequestMapping("/system/warning")
@Validated
public class WarningController {
@Resource
private WarningService warningService;
@PostMapping("/create")
@Operation(summary = "创建危急值记录")
@PreAuthorize("@ss.hasPermission('system:warning:create')")
public CommonResult<String> createWarning(@Valid @RequestBody WarningSaveReqVO createReqVO) {
return success(warningService.createWarning(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新危急值记录")
@PreAuthorize("@ss.hasPermission('system:warning:update')")
public CommonResult<Boolean> updateWarning(@Valid @RequestBody WarningSaveReqVO updateReqVO) {
warningService.updateWarning(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除危急值记录")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('system:warning:delete')")
public CommonResult<Boolean> deleteWarning(@RequestParam("id") String id) {
warningService.deleteWarning(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得危急值记录")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:warning:query')")
public CommonResult<WarningRespVO> getWarning(@RequestParam("id") String id) {
WarningDO warning = warningService.getWarning(id);
return success(BeanUtils.toBean(warning, WarningRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得危急值记录分页")
@PreAuthorize("@ss.hasPermission('system:warning:query')")
public CommonResult<PageResult<WarningRespVO>> getWarningPage(@Valid WarningPageReqVO pageReqVO) {
PageResult<WarningDO> pageResult = warningService.getWarningPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, WarningRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出危急值记录 Excel")
@PreAuthorize("@ss.hasPermission('system:warning:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportWarningExcel(@Valid WarningPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<WarningDO> list = warningService.getWarningPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "危急值记录.xls", "数据", WarningRespVO.class,
BeanUtils.toBean(list, WarningRespVO.class));
}
}

View File

@ -0,0 +1,57 @@
package cn.iocoder.yudao.module.system.controller.admin.warning.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
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WarningPageReqVO extends PageParam {
@Schema(description = "机构ID", example = "13253")
private String orgId;
@Schema(description = "检查ID,一人多个检查的检查id", example = "18705")
private String examId;
@Schema(description = "登记ID :patientid ", example = "8680")
private String regId;
@Schema(description = "上报机构id", example = "15352")
private String reportOrgId;
@Schema(description = "上报机构名称", example = "芋艿")
private String reportorgName;
@Schema(description = "上报医生")
private String reportDoctor;
@Schema(description = "上报时间")
private LocalDateTime reportDate;
@Schema(description = "危急值内容")
private String warningContent;
@Schema(description = "危急值接收医生")
private String receiveDoctor;
@Schema(description = "处理医生")
private String dealDoctor;
@Schema(description = "确认时间")
private LocalDateTime checkDateTime;
@Schema(description = "备注", example = "你说的对")
private String remark;
@Schema(description = "危急值报告进程Json格式")
private String warningProcess;
}

View File

@ -0,0 +1,72 @@
package cn.iocoder.yudao.module.system.controller.admin.warning.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
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 WarningRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26575")
@ExcelProperty("主键")
private String id;
@Schema(description = "机构ID", example = "13253")
@ExcelProperty("机构ID")
private String orgId;
@Schema(description = "检查ID,一人多个检查的检查id", example = "18705")
@ExcelProperty("检查ID,一人多个检查的检查id")
private String examId;
@Schema(description = "登记ID :patientid ", example = "8680")
@ExcelProperty("登记ID :patientid ")
private String regId;
@Schema(description = "上报机构id", example = "15352")
@ExcelProperty("上报机构id")
private String reportOrgId;
@Schema(description = "上报机构名称", example = "芋艿")
@ExcelProperty("上报机构名称")
private String reportorgName;
@Schema(description = "上报医生")
@ExcelProperty("上报医生")
private String reportDoctor;
@Schema(description = "上报时间")
@ExcelProperty("上报时间")
private LocalDateTime reportDate;
@Schema(description = "危急值内容")
@ExcelProperty("危急值内容")
private String warningContent;
@Schema(description = "危急值接收医生")
@ExcelProperty("危急值接收医生")
private String receiveDoctor;
@Schema(description = "处理医生")
@ExcelProperty("处理医生")
private String dealDoctor;
@Schema(description = "确认时间")
@ExcelProperty("确认时间")
private LocalDateTime checkDateTime;
@Schema(description = "备注", example = "你说的对")
@ExcelProperty("备注")
private String remark;
@Schema(description = "危急值报告进程Json格式")
@ExcelProperty("危急值报告进程Json格式")
private String warningProcess;
}

View File

@ -0,0 +1,55 @@
package cn.iocoder.yudao.module.system.controller.admin.warning.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 危急值记录新增/修改 Request VO")
@Data
public class WarningSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26575")
private String id;
@Schema(description = "机构ID", example = "13253")
private String orgId;
@Schema(description = "检查ID,一人多个检查的检查id", example = "18705")
private String examId;
@Schema(description = "登记ID :patientid ", example = "8680")
private String regId;
@Schema(description = "上报机构id", example = "15352")
private String reportOrgId;
@Schema(description = "上报机构名称", example = "芋艿")
private String reportorgName;
@Schema(description = "上报医生")
private String reportDoctor;
@Schema(description = "上报时间")
private LocalDateTime reportDate;
@Schema(description = "危急值内容")
private String warningContent;
@Schema(description = "危急值接收医生")
private String receiveDoctor;
@Schema(description = "处理医生")
private String dealDoctor;
@Schema(description = "确认时间")
private LocalDateTime checkDateTime;
@Schema(description = "备注", example = "你说的对")
private String remark;
@Schema(description = "危急值报告进程Json格式")
private String warningProcess;
}

View File

@ -0,0 +1,96 @@
package cn.iocoder.yudao.module.system.dal.dataobject.warning;
import lombok.*;
import java.util.*;
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_warning")
@KeySequence("tb_warning_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class WarningDO extends BaseDO {
/**
* 主键
*/
@TableId(type = IdType.INPUT)
private String id;
/**
* 机构ID
*/
@TableField("orgId")
private String orgId;
/**
* 检查ID,一人多个检查的检查id
*/
@TableField("examId")
private String examId;
/**
* 登记ID :patientid
*/
@TableField("regId")
private String regId;
/**
* 上报机构id
*/
@TableField("reportOrgId")
private String reportOrgId;
/**
* 上报机构名称
*/
@TableField("reportorgName")
private String reportorgName;
/**
* 上报医生
*/
@TableField("reportDoctor")
private String reportDoctor;
/**
* 上报时间
*/
@TableField("reportDate")
private LocalDateTime reportDate;
/**
* 危急值内容
*/
@TableField("warningContent")
private String warningContent;
/**
* 危急值接收医生
*/
@TableField("receiveDoctor")
private String receiveDoctor;
/**
* 处理医生
*/
@TableField("dealDoctor")
private String dealDoctor;
/**
* 确认时间
*/
@TableField("checkDateTime")
private LocalDateTime checkDateTime;
/**
* 备注
*/
@TableField("remark")
private String remark;
/**
* 危急值报告进程Json格式
*/
@TableField("warningProcess")
private String warningProcess;
}

View File

@ -0,0 +1,38 @@
package cn.iocoder.yudao.module.system.dal.mysql.warning;
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.warning.WarningDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.warning.vo.*;
/**
* 危急值记录 Mapper
*
* @author 李晓东
*/
@Mapper
public interface WarningMapper extends BaseMapperX<WarningDO> {
default PageResult<WarningDO> selectPage(WarningPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<WarningDO>()
.eqIfPresent(WarningDO::getOrgId, reqVO.getOrgId())
.eqIfPresent(WarningDO::getExamId, reqVO.getExamId())
.eqIfPresent(WarningDO::getRegId, reqVO.getRegId())
.eqIfPresent(WarningDO::getReportOrgId, reqVO.getReportOrgId())
.eqIfPresent(WarningDO::getReportorgName, reqVO.getReportorgName())
.eqIfPresent(WarningDO::getReportDoctor, reqVO.getReportDoctor())
.eqIfPresent(WarningDO::getReportDate, reqVO.getReportDate())
.eqIfPresent(WarningDO::getWarningContent, reqVO.getWarningContent())
.eqIfPresent(WarningDO::getReceiveDoctor, reqVO.getReceiveDoctor())
.eqIfPresent(WarningDO::getDealDoctor, reqVO.getDealDoctor())
.eqIfPresent(WarningDO::getCheckDateTime, reqVO.getCheckDateTime())
.eqIfPresent(WarningDO::getRemark, reqVO.getRemark())
.eqIfPresent(WarningDO::getWarningProcess, reqVO.getWarningProcess())
.orderByDesc(WarningDO::getId));
}
}

View File

@ -0,0 +1,56 @@
package cn.iocoder.yudao.module.system.service.warning;
import java.util.*;
import cn.iocoder.yudao.module.system.controller.admin.warning.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.warning.WarningDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import javax.validation.Valid;
/**
* 危急值记录 Service 接口
*
* @author 李晓东
*/
public interface WarningService {
/**
* 创建危急值记录
*
* @param createReqVO 创建信息
* @return 编号
*/
String createWarning(@Valid WarningSaveReqVO createReqVO);
/**
* 更新危急值记录
*
* @param updateReqVO 更新信息
*/
void updateWarning(@Valid WarningSaveReqVO updateReqVO);
/**
* 删除危急值记录
*
* @param id 编号
*/
void deleteWarning(String id);
/**
* 获得危急值记录
*
* @param id 编号
* @return 危急值记录
*/
WarningDO getWarning(String id);
/**
* 获得危急值记录分页
*
* @param pageReqVO 分页查询
* @return 危急值记录分页
*/
PageResult<WarningDO> getWarningPage(WarningPageReqVO pageReqVO);
}

View File

@ -0,0 +1,76 @@
package cn.iocoder.yudao.module.system.service.warning;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.module.system.controller.admin.warning.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.warning.WarningDO;
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.warning.WarningMapper;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
/**
* 危急值记录 Service 实现类
*
* @author 李晓东
*/
@Service
@Validated
public class WarningServiceImpl implements WarningService {
@Resource
private WarningMapper warningMapper;
@Override
public String createWarning(WarningSaveReqVO createReqVO) {
// 插入
WarningDO warning = BeanUtils.toBean(createReqVO, WarningDO.class);
warningMapper.insert(warning);
// 返回
return warning.getId();
}
@Override
public void updateWarning(WarningSaveReqVO updateReqVO) {
// 校验存在
validateWarningExists(updateReqVO.getId());
// 更新
WarningDO updateObj = BeanUtils.toBean(updateReqVO, WarningDO.class);
warningMapper.updateById(updateObj);
}
@Override
public void deleteWarning(String id) {
// 校验存在
validateWarningExists(id);
// 删除
warningMapper.deleteById(id);
}
private void validateWarningExists(String id) {
if (warningMapper.selectById(id) == null) {
throw exception(new ErrorCode(999,"ID为空"));
}
}
@Override
public WarningDO getWarning(String id) {
return warningMapper.selectById(id);
}
@Override
public PageResult<WarningDO> getWarningPage(WarningPageReqVO pageReqVO) {
return warningMapper.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.warning.WarningMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>