From 88ca2e40cdd8b209b7c13f97de9e98564e0e75ba Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期二, 22 七月 2025 16:20:22 +0800 Subject: [PATCH] 代码提交 --- jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java | 3 + jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java | 4 +- jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentService.java | 7 +++ jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentPageReqVO.java | 4 ++ jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/appointment/AppointmentMapper.java | 38 ++----------------- jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/enums/ActionTypeEnum.java | 1 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java | 29 ++++++++++++++ jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/external/ExternalController.java | 1 jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/appointment/AppointmentMapper.xml | 11 +++++ 9 files changed, 59 insertions(+), 39 deletions(-) diff --git a/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java b/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java index fc083ce..6aa50e3 100644 --- a/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java +++ b/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java @@ -19,7 +19,8 @@ ErrorCode APPOINTMENT_NOT_BILLING = new ErrorCode(1_010_001_040, "鏌ヨ涓嶅埌寮�鍗曚俊鎭�"); ErrorCode APPOINTMENT_CREATE_FAIL = new ErrorCode(1_010_001_050, "鐢宠鍗曞垱寤哄け璐�"); ErrorCode APPOINTMENT_UPDATE_FAIL = new ErrorCode(1_010_001_060, "鐢宠鍗曟洿鏂板け璐�"); - ErrorCode APPOINTMENT_STATUS_UPDATE_FAIL = new ErrorCode(1_010_001_070, "鐢宠鍗曠姸鎬佹洿鏂�"); + ErrorCode APPOINTMENT_STATUS_UPDATE_FAIL = new ErrorCode(1_010_001_070, "鐢宠鍗曠姸鎬佹洿鏂板け璐�"); + ErrorCode APPOINTMENT_STATUS_REGISTER_UPDATE_FAIL = new ErrorCode(1_010_001_080, "鐢宠鍗曠櫥璁扮姸鎬佹洿鏂板け璐�"); ErrorCode ROOM_NOT_EXISTS = new ErrorCode(1_010_002_000, "璇婂鍜岃瘖鐤楀簥涓嶅瓨鍦�"); ErrorCode ROOM_NOT_SIT = new ErrorCode(1_010_002_001, "璇烽噸鏂板氨搴�"); diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java index 7393113..9bd1455 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java @@ -128,10 +128,10 @@ return success(BeanUtils.toBean(appointmentList.get(0), AppointmentRespVO.class)); } - @GetMapping("/page") + @PostMapping("/page") @Operation(summary = "鑾峰緱棰勭害鍒嗛〉") @PreAuthorize("@ss.hasPermission('ecg:appointment:query')") - public CommonResult<PageResult<AppointmentRespVO>> getAppointmentPage(@Valid AppointmentPageReqVO pageReqVO) { + public CommonResult<PageResult<AppointmentRespVO>> getAppointmentPage(@RequestBody AppointmentPageReqVO pageReqVO) { pageReqVO.setOrderCreateTime("1"); PageResult<AppointmentDO> pageResult = appointmentService.getAppointmentPage(pageReqVO); return success(BeanUtils.toBean(pageResult, AppointmentRespVO.class)); diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentPageReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentPageReqVO.java index b34626f..018f0de 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentPageReqVO.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/vo/AppointmentPageReqVO.java @@ -92,11 +92,15 @@ * 鐧昏鏃堕棿 */ private Date registerDate; + private Date registerDateStart; + private Date registerDateEnd; /** * 鍒涘缓鏃堕棿 */ private LocalDateTime createTime; + private Date createTimeStart; + private Date createTimeEnd; /** * 鐧昏鏃堕棿锛堟煡璇㈡潯浠讹級 diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/external/ExternalController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/external/ExternalController.java index 19c49b6..82a4bb2 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/external/ExternalController.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/external/ExternalController.java @@ -63,6 +63,7 @@ ActionTypeEnum.S0202ECG, appointmentService::handleAppointmentUpdate, ActionTypeEnum.S040501HIS, appointmentService::handleAppointmentStateUpdate, ActionTypeEnum.S050401, appointmentService::handleCheckAppointmentUpdate, + ActionTypeEnum.S0405, appointmentService::handleAppointmentStatusUpdate, ActionTypeEnum.S050501, appointmentService::handleCheckAppointmentUpdate ); diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/appointment/AppointmentMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/appointment/AppointmentMapper.java index 8eb5159..8d9d205 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/appointment/AppointmentMapper.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/appointment/AppointmentMapper.java @@ -23,43 +23,14 @@ public interface AppointmentMapper extends BaseMapperX<AppointmentDO> { default PageResult<AppointmentDO> selectPage(AppointmentPageReqVO reqVO) { - LambdaQueryWrapperX<AppointmentDO> wrapper = (LambdaQueryWrapperX<AppointmentDO>) new LambdaQueryWrapperX<AppointmentDO>() - .eqIfPresent(AppointmentDO::getPatId, reqVO.getPatId()) - .likeIfPresent(AppointmentDO::getPatName, reqVO.getPatName()) - .eqIfPresent(AppointmentDO::getPatGender, reqVO.getPatGender()) - .eqIfPresent(AppointmentDO::getPatBirthday, reqVO.getPatBirthday()) - .eqIfPresent(AppointmentDO::getPatMobile, reqVO.getPatMobile()) - .eqIfPresent(AppointmentDO::getPatPhone, reqVO.getPatPhone()) - .eqIfPresent(AppointmentDO::getPatIdentityId, reqVO.getPatIdentityId()) - .eqIfPresent(AppointmentDO::getPatAddr, reqVO.getPatAddr()) - .eqIfPresent(AppointmentDO::getPatDeptCode, reqVO.getPatDeptCode()) - .eqIfPresent(AppointmentDO::getPatDeptDesc, reqVO.getPatDeptDesc()) - .eqIfPresent(AppointmentDO::getPatWardCode, reqVO.getPatWardCode()) - .eqIfPresent(AppointmentDO::getPatWardDesc, reqVO.getPatWardDesc()) - .eqIfPresent(AppointmentDO::getBookDate, reqVO.getBookDate()) - .eqIfPresent(AppointmentDO::getBookTimeslot, reqVO.getBookTimeslot()) - .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()) - // 鏃堕棿鑼冨洿鏌ヨ锛屾敞鎰忚繖閲屽己鍒舵寚瀹氱被鍨嬩负 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)); - } - }); - + LambdaQueryWrapperX<AppointmentDO> wrapper = (LambdaQueryWrapperX<AppointmentDO>) new LambdaQueryWrapperX<AppointmentDO>().eqIfPresent(AppointmentDO::getPatId, reqVO.getPatId()).likeIfPresent(AppointmentDO::getPatName, reqVO.getPatName()).eqIfPresent(AppointmentDO::getPatGender, reqVO.getPatGender()).eqIfPresent(AppointmentDO::getPatBirthday, reqVO.getPatBirthday()).eqIfPresent(AppointmentDO::getPatMobile, reqVO.getPatMobile()).eqIfPresent(AppointmentDO::getPatPhone, reqVO.getPatPhone()).eqIfPresent(AppointmentDO::getPatIdentityId, reqVO.getPatIdentityId()).eqIfPresent(AppointmentDO::getPatAddr, reqVO.getPatAddr()).eqIfPresent(AppointmentDO::getPatDeptCode, reqVO.getPatDeptCode()).eqIfPresent(AppointmentDO::getPatDeptDesc, reqVO.getPatDeptDesc()).eqIfPresent(AppointmentDO::getPatWardCode, reqVO.getPatWardCode()).eqIfPresent(AppointmentDO::getPatWardDesc, reqVO.getPatWardDesc()).eqIfPresent(AppointmentDO::getBookDate, reqVO.getBookDate()).eqIfPresent(AppointmentDO::getBookTimeslot, reqVO.getBookTimeslot()).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()) + // 鉁� 鏂板锛歝reateTime 鍖洪棿鏌ヨ + .betweenIfPresent(AppointmentDO::getCreateTime, reqVO.getCreateTimeStart(), reqVO.getCreateTimeEnd()).betweenIfPresent(AppointmentDO::getRegisterDate, reqVO.getRegisterDateStart(), reqVO.getRegisterDateEnd()); // 鍔ㄦ�佹帓搴� if (reqVO.getOrderCreateTime() != null) { wrapper.orderByDesc(AppointmentDO::getCreateTime); } else { - wrapper.orderByAsc(AppointmentDO::getRegisterDate) - .orderByAsc(AppointmentDO::getPatWardDesc); + wrapper.orderByAsc(AppointmentDO::getRegisterDate).orderByAsc(AppointmentDO::getPatWardDesc); } return selectPage(reqVO, wrapper); } @@ -74,7 +45,6 @@ @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} " + "<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") diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/enums/ActionTypeEnum.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/enums/ActionTypeEnum.java index 2d9f849..ea4424c 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/enums/ActionTypeEnum.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/enums/ActionTypeEnum.java @@ -14,6 +14,7 @@ S0202ECG("S0202ECG", "鐢宠鍗曟洿鏂�"), S040501HIS("S040501HIS", "棰勭害鏇存柊"), S050401("S050401", "妫�鏌ラ绾︾姸鎬佹柊澧�"), + S0405("S0405", "鐢宠鍗曠櫥璁扮姸鎬佹洿鏂�"), S050501("S050501", "妫�鏌ラ绾︾姸鎬佷慨鏀�"); diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentService.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentService.java index b8bf763..d1964d6 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentService.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentService.java @@ -92,6 +92,13 @@ void handleCheckAppointmentUpdate(Map<String, Object> dataMap); /** + * 鐧昏鐘舵�佹洿鏂� + * + * @param dataMap + */ + void handleAppointmentStatusUpdate(Map<String, Object> dataMap); + + /** * 鑾峰緱褰撳ぉ鐨勯绾� 鏍规嵁PatID and CheckType * * @param patId 缂栧彿 diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java index 00230cd..fb98ade 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java +++ b/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.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; @@ -378,7 +379,7 @@ // 鍖荤敓寮�鍗曟椂闂� 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("observationRequest")).map(observationRequest -> (Map<String, Object>) observationRequest.get("author")).map(author -> (Map<String, Object>) author.get("time")).map(time -> (String) time.get("value")).map(str -> { try { - return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(str); + return new SimpleDateFormat("yyyyMMddHHmmss").parse(str); } catch (Exception e) { e.printStackTrace(); return null; @@ -686,6 +687,32 @@ appointmentMapper.updateById(appointment); } + @Override + public void handleAppointmentStatusUpdate(Map<String, Object> dataMap) { + if (dataMap == null) { + throw exception(APPOINTMENT_STATUS_REGISTER_UPDATE_FAIL); + } + //鑾峰彇applyNo + Map<String, Object> controlActProcess = (Map<String, Object>) dataMap.get("controlActProcess"); + Map<String, Object> subject = (Map<String, Object>) controlActProcess.get("subject"); + Map<String, Object> placerGroup = (Map<String, Object>) subject.get("placerGroup"); + Map<String, Object> component2 = (Map<String, Object>) placerGroup.get("component2"); + Map<String, Object> observationRequest = (Map<String, Object>) component2.get("observationRequest"); + Map<String, Object> id = (Map<String, Object>) observationRequest.get("id"); + String applyNo = String.valueOf(id.get("extension")); + + //鑾峰彇status + Map<String, Object> component1 = (Map<String, Object>) observationRequest.get("component1"); + Map<String, Object> processStep = (Map<String, Object>) component1.get("processStep"); + Map<String, Object> codeMap = (Map<String, Object>) processStep.get("code"); + String status = String.valueOf(codeMap.get("code")); + + //鐘舵�佹洿鏂� + Integer i = appointmentMapper.updateStatusByApplyNo(applyNo, status, null); + log.info("鐢宠鍗曠櫥璁癮pplyNo:{},鐘舵�乻tatus:{},鏇存柊缁撴灉锛歿}", applyNo, status, i); + + } + public AppointmentDO getByApplyNo(String applyNo) { return appointmentMapper.getByApplyNo(applyNo); } diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/appointment/AppointmentMapper.xml b/jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/appointment/AppointmentMapper.xml index 29a842c..2c8f90d 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/appointment/AppointmentMapper.xml +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/appointment/AppointmentMapper.xml @@ -9,4 +9,13 @@ 鏂囨。鍙锛歨ttps://www.iocoder.cn/MyBatis/x-plugins/ --> -</mapper> \ No newline at end of file + <update id="updateStatusByApplyNo"> + update lihu.appointment + set status = #{status} + <if test="registerDate != null"> + , register_date = #{registerDate} + </if> + where apply_no = #{applyNo} + </update> + +</mapper> -- Gitblit v1.9.3