jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java
@@ -77,7 +77,7 @@ @PostMapping("/updateStatus") @Operation(summary = "更新申请状态") @PreAuthorize("@ss.hasPermission('ecg:appointment:update')") public CommonResult<Boolean> updateAppointmentStatus(@Valid @RequestBody AppointmentSaveReqVO updateReqVO) { public CommonResult<Boolean> updateAppointmentStatus(@RequestBody AppointmentSaveReqVO updateReqVO) { appointmentService.updateAppointmentStatus(updateReqVO); return success(true); } @@ -132,6 +132,7 @@ @Operation(summary = "获得预约分页") @PreAuthorize("@ss.hasPermission('ecg:appointment:query')") public CommonResult<PageResult<AppointmentRespVO>> getAppointmentPage(@Valid AppointmentPageReqVO pageReqVO) { pageReqVO.setOrderCreateTime("1"); PageResult<AppointmentDO> pageResult = appointmentService.getAppointmentPage(pageReqVO); return success(BeanUtils.toBean(pageResult, AppointmentRespVO.class)); } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentPageReqVO.java
@@ -3,11 +3,14 @@ import com.alibaba.excel.annotation.ExcelProperty; import lombok.*; import java.sql.Date; import java.time.LocalDate; import java.util.*; import io.swagger.v3.oas.annotations.media.Schema; import cn.lihu.jh.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import static cn.lihu.jh.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -77,13 +80,28 @@ private Integer bookCheckType; @Schema(description = "预约来源:X系统、护士手动预约") private String bookSrc; private Integer bookSrc; @Schema(description = "申请单状态") private String[] status; @Schema(description = "已付款") private Integer paid; /** * 登记时间 */ private Date registerDate; /** * 创建时间 */ private LocalDateTime createTime; /** * 登记时间(查询条件) */ private String registerTime; private String tolerance; @@ -102,4 +120,9 @@ */ private String outpatientNo; /** * 根据创建时间倒序 */ private String orderCreateTime; } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentRespVO.java
@@ -3,10 +3,14 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.sql.Date; import java.time.LocalDate; import java.util.*; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import com.alibaba.excel.annotation.*; import cn.lihu.jh.framework.excel.core.annotations.DictFormat; import cn.lihu.jh.framework.excel.core.convert.DictConvert; @@ -96,6 +100,7 @@ private LocalDateTime bookTime; @Schema(description = "预约检查类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @DictFormat("ecg_check_type") @ExcelProperty(value = "预约检查类型", converter = DictConvert.class) private Integer bookCheckType; @@ -104,15 +109,27 @@ private Integer bookSeqNum; @Schema(description = "预约来源:X系统、护士手动预约", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("预约来源:X系统、护士手动预约") // @ExcelProperty("预约来源:X系统、护士手动预约") private Integer bookSrc; @Schema(description = "已付款") @ExcelProperty("已付款") @Schema(description = "已付款 0-未交费 1-已缴费") @DictFormat("ecg_pay_type") @ExcelProperty(value = "付款状态", converter = DictConvert.class) private Integer paid; // @TableField(exist = false) @Schema(description = "状态") @DictFormat("ecg_status_type") @ExcelProperty(value = "状态", converter = DictConvert.class) private String status; /** * 登记时间 */ @Schema(description = "登记时间", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("登记时间") private Date registerDate; /** * 耐药性: 是否多耐1代表是,0代表不是 @@ -133,4 +150,7 @@ * 门诊号 */ private String outpatientNo; private LocalDateTime createTime; } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentSaveReqVO.java
@@ -7,6 +7,7 @@ import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.sql.Date; import java.time.LocalDate; import java.time.LocalDateTime; @@ -111,4 +112,9 @@ * 门诊号 */ private String outpatientNo; /** * 登记时间 */ private Date registerDate; } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/appointment/AppointmentDO.java
@@ -58,8 +58,6 @@ private String patName; /** * 患者性别 * <p> * 枚举 {@link TODO system_user_sex 对应的类} */ private Byte patGender; /** @@ -138,6 +136,10 @@ private Integer bookSeqNum; private String status; /** * 登记时间 */ private Date registerDate; /** * 耐药性: 是否多耐1代表是,0代表不是 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/appointment/AppointmentMapper.java
@@ -11,6 +11,7 @@ import org.apache.ibatis.annotations.Update; import java.time.LocalDate; import java.util.Date; import java.util.List; /** @@ -22,9 +23,9 @@ public interface AppointmentMapper extends BaseMapperX<AppointmentDO> { default PageResult<AppointmentDO> selectPage(AppointmentPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX<AppointmentDO>() LambdaQueryWrapperX<AppointmentDO> wrapper = (LambdaQueryWrapperX<AppointmentDO>) new LambdaQueryWrapperX<AppointmentDO>() .eqIfPresent(AppointmentDO::getPatId, reqVO.getPatId()) .eqIfPresent(AppointmentDO::getPatName, reqVO.getPatName()) .likeIfPresent(AppointmentDO::getPatName, reqVO.getPatName()) .eqIfPresent(AppointmentDO::getPatGender, reqVO.getPatGender()) .eqIfPresent(AppointmentDO::getPatBirthday, reqVO.getPatBirthday()) .eqIfPresent(AppointmentDO::getPatMobile, reqVO.getPatMobile()) @@ -40,8 +41,27 @@ .eqIfPresent(AppointmentDO::getBookCheckType, reqVO.getBookCheckType()) .eqIfPresent(AppointmentDO::getBookSrc, reqVO.getBookSrc()) .eqIfPresent(AppointmentDO::getPaid, reqVO.getPaid()) .eqIfPresent(AppointmentDO::getApplyNo, reqVO.getApplyNo()) .eqIfPresent(AppointmentDO::getEpisodeId, reqVO.getEpisodeId()) .inIfPresent(AppointmentDO::getStatus, reqVO.getStatus()) .orderByDesc(AppointmentDO::getId)); // 时间范围查询,注意这里强制指定类型为 LambdaQueryWrapperX .and(reqVO.getRegisterTime() != null, w -> { LocalDate today = LocalDate.now(); if ("上午".equals(reqVO.getRegisterTime())) { w.between(AppointmentDO::getRegisterDate, today.atTime(5, 0, 0), today.atTime(13, 0, 0)); } else if ("下午".equals(reqVO.getRegisterTime())) { w.between(AppointmentDO::getRegisterDate, today.atTime(13, 0, 1), today.atTime(22, 0, 0)); } }); // 动态排序 if (reqVO.getOrderCreateTime() != null) { wrapper.orderByDesc(AppointmentDO::getCreateTime); } else { wrapper.orderByAsc(AppointmentDO::getRegisterDate) .orderByAsc(AppointmentDO::getPatWardDesc); } return selectPage(reqVO, wrapper); } @@ -54,8 +74,8 @@ @Select("select * from lihu.appointment where pat_id = #{patId} and book_check_type = #{checkType} and to_days(book_date) = to_days(Now()) limit 1") AppointmentDO getByPatAndCheckTypeAndBookDate(@Param("patId") String patId, @Param("checkType") Integer checkType); @Update("update lihu.appointment set status = #{status} where apply_no = #{applyNo};") Integer updateStatusByApplyNo(@Param("applyNo") String applyNo, @Param("status") String status); @Update("update lihu.appointment set status = #{status} " + "<if test='registerDate != null'>" + ", register_date = #{registerDate} " + "</if>" + "where apply_no = #{applyNo};") Integer updateStatusByApplyNo(@Param("applyNo") String applyNo, @Param("status") String status, @Param("registerDate") Date registerDate); @Select("select * from lihu.appointment where episode_id = #{episodeId} and apply_no = #{applyNo} limit 1") AppointmentDO getByEpisodeIdAndApplyNo(@Param("episodeId") String episodeId, @Param("applyNo") String applyNo); jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java
@@ -20,6 +20,7 @@ import cn.lihu.jh.module.ecg.service.queuesequence.QueueSequenceService; import cn.lihu.jh.module.ecg.webservice.WebServiceClient; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DuplicateKeyException; @@ -32,6 +33,7 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.Date; import java.util.List; import java.util.Map; import java.util.Optional; @@ -199,6 +201,29 @@ @Override public PageResult<AppointmentDO> getAppointmentPage(AppointmentPageReqVO pageReqVO) { //1. 先根据patId去查 PageResult<AppointmentDO> result = appointmentMapper.selectPage(pageReqVO); log.info("--------------PATID result的值为:{}", result); if (!result.getList().isEmpty()) { return result; } if (StringUtils.isNotEmpty(pageReqVO.getPatId())) { // 2. 用 applyNo 查询 pageReqVO.setApplyNo(pageReqVO.getPatId()); pageReqVO.setPatId(null); log.info("------------------ApplyNo pageReqVO的值为:{}", pageReqVO); result = appointmentMapper.selectPage(pageReqVO); if (!result.getList().isEmpty()) { return result; } // 3. 用 episodeId 查询 pageReqVO.setEpisodeId(pageReqVO.getApplyNo()); pageReqVO.setPatId(null); pageReqVO.setApplyNo(null); log.info("-----------EpisodeId pageReqVO的值为:{}", pageReqVO); } return appointmentMapper.selectPage(pageReqVO); } @@ -564,6 +589,9 @@ String status = Optional.ofNullable(dataMap.get("controlActProcess")).map(controlActProcess -> (Map<String, Object>) controlActProcess).map(controlActProcess -> (Map<String, Object>) controlActProcess.get("subject")).map(subject -> (Map<String, Object>) subject.get("placerGroup")).map(placerGroup -> (Map<String, Object>) placerGroup.get("component2")).map(component2 -> (Map<String, Object>) component2.get("observationRequest")).map(observationRequest -> (Map<String, Object>) observationRequest.get("component1")).map(component1 -> (Map<String, Object>) component1.get("processStep")).map(processStep -> (Map<String, Object>) processStep.get("code")).map(code -> (String) code.get("code")).orElseThrow(() -> exception(APPOINTMENT_CREATE_FAIL)); existingAppointment.setStatus(status); if ("3".equals(status)) { existingAppointment.setRegisterDate(new Date()); } // 将AppointmentDO转换为AppointmentSaveReqVO并更新 AppointmentSaveReqVO updateReqVO = BeanUtils.toBean(existingAppointment, AppointmentSaveReqVO.class); updateAppointment(updateReqVO); jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
@@ -36,6 +36,7 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Date; import java.util.List; import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception; @@ -172,20 +173,20 @@ log.info("routineFinishWebServiceClient的返回值为:{}", s); if (s.contains("更新成功")) { //需要根据applyNo,将appiontment表里的status改成3 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3"); appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3", new Date()); } } else { //检查类型是床边的或常规的,需要根据applyNo,将appiontment表里的status改成7 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7"); appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7", null); } } else { if (createReqVO.getCheckType() != 100 && createReqVO.getCheckType() != 1000 && createReqVO.getCheckType() != 1100 && createReqVO.getCheckType() != 1400 && createReqVO.getCheckType() != 1500) { //需要根据applyNo,将appiontment表里的status改成3 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4"); appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null); } else { //检查类型是床边的或常规的,需要根据applyNo,将appiontment表里的status改成7 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7"); appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7", null); } } @@ -223,10 +224,10 @@ log.info("webservice的返回值为:{}", s); if (s.contains("更新成功")) { //需要根据applyNo,将appiontment表里的status改成3 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3"); appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3", new Date()); } } else { appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3"); appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3", new Date()); } List<Integer> jobTypeList = new ArrayList<Integer>(); @@ -497,20 +498,20 @@ log.info("routineFinishWebServiceClient的返回值为:{}", s); if (s.contains("更新成功")) { //需要根据applyNo,将appiontment表里的status改成3 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4"); appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null); } } else { //检查类型是床边的或常规的,需要根据applyNo,将appiontment表里的status改成7 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7"); appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7", null); } } else { if (cancelReqVO.getCheckType() != 100 && cancelReqVO.getCheckType() != 1000 && cancelReqVO.getCheckType() != 1100 && cancelReqVO.getCheckType() != 1400 && cancelReqVO.getCheckType() != 1500) { //需要根据applyNo,将appiontment表里的status改成3 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4"); appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null); } else { //检查类型是床边的或常规的,需要根据applyNo,将appiontment表里的status改成7 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7"); appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7", null); } } @@ -588,16 +589,16 @@ log.info("routineFinishWebServiceClient的返回值为:{}", s); if (s.contains("更新成功")) { //需要根据applyNo,将appiontment表里的status改成3 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4"); appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null); } } else { if (cancelReqVO.getCheckType() != 100 && cancelReqVO.getCheckType() != 1000 && cancelReqVO.getCheckType() != 1100 && cancelReqVO.getCheckType() != 1400 && cancelReqVO.getCheckType() != 1500) { //需要根据applyNo,将appiontment表里的status改成3 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4"); appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null); } else { //检查类型是床边的或常规的,需要根据applyNo,将appiontment表里的status改成7 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7"); appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7", null); } } @@ -671,16 +672,15 @@ log.info("routineFinishWebServiceClient的返回值为:{}", s); if (s.contains("更新成功")) { //需要根据applyNo,将appiontment表里的status改成3 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4"); appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null); } } else { //这里是测试本地修改 if (cancelReqVO.getCheckType() != 100 && cancelReqVO.getCheckType() != 1000 && cancelReqVO.getCheckType() != 1100 && cancelReqVO.getCheckType() != 1400 && cancelReqVO.getCheckType() != 1500) { //需要根据applyNo,将appiontment表里的status改成3 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4"); appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null); } else { //检查类型是床边的或常规的,需要根据applyNo,将appiontment表里的status改成7 appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7"); appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7", null); } }