From c17781eed0b4100990a594896eb123e4e8040ca6 Mon Sep 17 00:00:00 2001 From: lichuanyang <1176537920@qq.com> Date: Mon, 23 Dec 2024 11:37:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=94=E4=BF=AE=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/process/ProcessController.java | 44 ++++++++ .../admin/process/vo/ProcessPageReqVO.java | 50 +++++++++ .../dal/dataobject/process/ProcessDO.java | 101 ++++++++++++++++++ .../dal/mysql/process/ProcessMapper.java | 33 ++++++ .../service/process/ProcessService.java | 33 ++++++ .../service/process/ProcessServiceImpl.java | 59 ++++++++++ 6 files changed, 320 insertions(+) create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/process/ProcessController.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/process/vo/ProcessPageReqVO.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/process/ProcessDO.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/process/ProcessMapper.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/process/ProcessService.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/process/ProcessServiceImpl.java diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/process/ProcessController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/process/ProcessController.java new file mode 100644 index 000000000..bdfcf2881 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/process/ProcessController.java @@ -0,0 +1,44 @@ +package cn.iocoder.yudao.module.system.controller.admin.process; + +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.*; + +import cn.iocoder.yudao.module.system.controller.admin.process.vo.*; +import cn.iocoder.yudao.framework.common.pojo.*; +import cn.iocoder.yudao.module.system.dal.dataobject.process.ProcessDO; +import cn.iocoder.yudao.module.system.service.process.ProcessService; + +import java.util.*; +import java.io.IOException; +import javax.annotation.*; +import javax.validation.*; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +@Tag(name = "管理后台 - 危急值记录") +@RestController +@RequestMapping("/system/process") +@Validated +public class ProcessController { + + @Resource + private ProcessService processService; + + @GetMapping("/get") + @Operation(summary = "获得危急值记录") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + public CommonResult getProcess(@RequestParam("id") String id) { + ProcessDO process = processService.getProcess(id); + return success(process); + } + + @GetMapping("/page") + @Operation(summary = "获得危急值记录分页") + public CommonResult> getProcessPage(@Valid ProcessPageReqVO pageReqVO) { + PageResult pageResult = processService.getProcessPage(pageReqVO); + return success(pageResult); + } + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/process/vo/ProcessPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/process/vo/ProcessPageReqVO.java new file mode 100644 index 000000000..b437ffd95 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/process/vo/ProcessPageReqVO.java @@ -0,0 +1,50 @@ +package cn.iocoder.yudao.module.system.controller.admin.process.vo; + +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; +import org.springframework.format.annotation.DateTimeFormat; +import cn.iocoder.yudao.framework.common.pojo.*; + +import java.util.*; +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 ProcessPageReqVO extends PageParam { + + @Schema(description = "审核开始时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime processDate_ge; + + @Schema(description = "审核结束时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime processDate_le; + + @Schema(description = "申请开始时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime applyDateTime_ge; + + @Schema(description = "申请结束时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime applyDateTime_le; + + @Schema(description = "审核状态 0申请 1 审核2 拒绝") + private Integer processstats; + + @Schema(description = "登记ID :patientid ", example = "23025") + private String regId; + + @Schema(description = "姓名", example = "芋艿") + private String pname; + + @Schema(description = "机构ID", example = "5547") + private String orgId; + + @Schema(description = "检查ID,一人多个检查的检查id", example = "17411") + private String examId; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/process/ProcessDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/process/ProcessDO.java new file mode 100644 index 000000000..666695237 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/process/ProcessDO.java @@ -0,0 +1,101 @@ +package cn.iocoder.yudao.module.system.dal.dataobject.process; + +import lombok.*; + +import java.util.*; +import java.time.*; + +import com.baomidou.mybatisplus.annotation.*; + + +/** + * 危急值记录 DO + * + * @author 李传洋 + */ +@TableName("tb_process") +@KeySequence("tb_process_seq") +@Data +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ProcessDO { + + /** + * 主键 + */ + @TableId(value = "ID", 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("processOrgId") + private String processOrgId; + /** + * 审核机构名称 + */ + @TableField("processorgName") + private String processorgName; + /** + * 审核医生 + */ + @TableField("processDoctor") + private String processDoctor; + /** + * 审核时间 + */ + @TableField("processDate") + private LocalDateTime processDate; + /** + * 申请原因 + */ + @TableField("processContent") + private String processContent; + /** + * 申请医生 + */ + @TableField("applyDoctor") + private String applyDoctor; + /** + * 申请时间 + */ + @TableField("applyDateTime") + private LocalDateTime applyDateTime; + /** + * 备注 + */ + @TableField("remark") + private String remark; + /** + * 审核状态 0申请 1 审核2 拒绝 + */ + @TableField("processstats") + private Integer processstats; + /** + * 拒绝原因 + */ + @TableField("refuseremark") + private String refuseremark; + /** + * 姓名 + */ + @TableField("pname") + private String pname; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/process/ProcessMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/process/ProcessMapper.java new file mode 100644 index 000000000..35158da64 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/process/ProcessMapper.java @@ -0,0 +1,33 @@ +package cn.iocoder.yudao.module.system.dal.mysql.process; + +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.controller.admin.process.vo.*; +import cn.iocoder.yudao.module.system.dal.dataobject.process.ProcessDO; +import com.baomidou.mybatisplus.annotation.*; +import org.apache.ibatis.annotations.*; + +/** + * 危急值记录 Mapper + * + * @author 李传洋 + */ +@InterceptorIgnore(tenantLine = "true") +@Mapper +public interface ProcessMapper extends BaseMapperX { + //分页查询 + default PageResult selectPage(ProcessPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .geIfPresent(ProcessDO::getProcessDate, reqVO.getProcessDate_ge()) + .leIfPresent(ProcessDO::getProcessDate, reqVO.getProcessDate_le()) + .geIfPresent(ProcessDO::getApplyDateTime, reqVO.getApplyDateTime_ge()) + .leIfPresent(ProcessDO::getApplyDateTime, reqVO.getApplyDateTime_le()) + .eqIfPresent(ProcessDO::getProcessstats, reqVO.getProcessstats()) + .likeIfPresent(ProcessDO::getRegId, reqVO.getRegId()) + .likeIfPresent(ProcessDO::getPname, reqVO.getPname()) + .orderByDesc(ProcessDO::getApplyDateTime)); + } +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/process/ProcessService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/process/ProcessService.java new file mode 100644 index 000000000..59506abab --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/process/ProcessService.java @@ -0,0 +1,33 @@ +package cn.iocoder.yudao.module.system.service.process; + +import java.util.*; +import javax.validation.*; + +import cn.iocoder.yudao.module.system.controller.admin.process.vo.*; +import cn.iocoder.yudao.module.system.dal.dataobject.process.ProcessDO; +import cn.iocoder.yudao.framework.common.pojo.*; + +/** + * 危急值记录 Service 接口 + * + * @author 李传洋 + */ +public interface ProcessService { + + /** + * 获得危急值记录 + * + * @param id 编号 + * @return 危急值记录 + */ + ProcessDO getProcess(String id); + + /** + * 获得危急值记录分页 + * + * @param pageReqVO 分页查询 + * @return 危急值记录分页 + */ + PageResult getProcessPage(ProcessPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/process/ProcessServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/process/ProcessServiceImpl.java new file mode 100644 index 000000000..bb07aee0f --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/process/ProcessServiceImpl.java @@ -0,0 +1,59 @@ +package cn.iocoder.yudao.module.system.service.process; + +import cn.iocoder.yudao.framework.common.exception.ErrorCode; +import cn.iocoder.yudao.module.system.service.user.AdminUserService; +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.process.vo.*; +import cn.iocoder.yudao.module.system.dal.dataobject.process.ProcessDO; +import cn.iocoder.yudao.framework.common.pojo.*; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; + +import cn.iocoder.yudao.module.system.dal.mysql.process.ProcessMapper; + +import javax.annotation.*; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; + +/** + * 危急值记录 Service 实现类 + * + * @author 李传洋 + */ +@Service +@Validated +public class ProcessServiceImpl implements ProcessService { + + @Resource + private ProcessMapper processMapper; + + @Resource + private AdminUserService userService; + + private void validateProcessExists(String id) { + if (processMapper.selectById(id) == null) { + throw exception(new ErrorCode(1, "ID为空")); + } + } + + @Override + public ProcessDO getProcess(String id) { + return processMapper.selectById(id); + } + + @Override + public PageResult getProcessPage(ProcessPageReqVO pageReqVO) { + if (pageReqVO != null) { + if (pageReqVO.getProcessDate_le() != null) + pageReqVO.setProcessDate_le(pageReqVO.getProcessDate_le().plusDays(1)); + if (pageReqVO.getApplyDateTime_le() != null) + pageReqVO.setApplyDateTime_le(pageReqVO.getApplyDateTime_le().plusDays(1)); + } + return processMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file