From 46fab8daeed497e8529e7070712ceca9b04ee0f7 Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期五, 11 七月 2025 19:38:39 +0800 Subject: [PATCH] 代码提交 --- jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java | 109 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 98 insertions(+), 11 deletions(-) diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java index 263b9a5..81ea577 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java @@ -24,8 +24,13 @@ import cn.lihu.jh.module.ecg.enums.QueueStatusEnum; import cn.lihu.jh.module.ecg.feign.FeeConfirmFeignService; import cn.lihu.jh.module.ecg.service.queue.QueueServiceTxFunctions; -import cn.lihu.jh.module.ecg.webservice.client.JHFWWebServiceClient; +import cn.lihu.jh.module.ecg.webservice.WebServiceClient; +import cn.lihu.jh.module.infra.dal.dataobject.config.ConfigDO; +import cn.lihu.jh.module.infra.dal.mysql.config.ConfigMapper; +import cn.lihu.jh.module.infra.service.config.ConfigService; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; @@ -34,6 +39,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; @@ -74,7 +80,10 @@ CheckTypeMapper checkTypeMapper; @Resource - private JHFWWebServiceClient jhfwWebServiceClient; + private ConfigService configService; + + @Autowired + private WebServiceClient webServiceClient; @Override @@ -156,6 +165,26 @@ procAffinityWhenRoutineFinish(firstOnStageQueueItem.getPatId(), checkTypeDO.getAffinityCheckTypes()); } + //妫�鏌ュ畬鎴愬悗锛屾鏃舵鏌ョ櫥璁板啓鎴愪簡锛岄渶瑕佸皢杩欎釜鍥炲啓缁欓泦鎴愬钩鍙�(绾夸笂鐜鎵嶅洖鍐�) + ConfigDO configDO = configService.getConfigByKey("ecg.back.data"); + if (configDO.getValue().equals("1")) { + if (createReqVO.getCheckType() != 100 && createReqVO.getCheckType() != 1000 && createReqVO.getCheckType() != 1100 && createReqVO.getCheckType() != 1400 && createReqVO.getCheckType() != 1500) { + AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo()); + ApplicationTemplate app = new ApplicationTemplate(); + String action = "S0405"; + String message = app.getXML(createReqVO.getApplyNo(), "3", "妫�鏌ョ櫥璁�", createReqVO.getOperater(), appointmentDO.getPatDeptCode(), appointmentDO.getPatDeptDesc(), appointmentDO.getPatWardCode(), appointmentDO.getPatWardDesc(), appointmentDO.getPatBedNo(), appointmentDO.getEpisodeId(), "" + appointmentDO.getBookSrc(), appointmentDO.getPatId(), appointmentDO.getPatName()); + String s = webServiceClient.callJHFWTYRK(action, "", message); + log.info("routineFinishWebServiceClient鐨勮繑鍥炲�间负锛歿}", s); + if (s.contains("鏇存柊鎴愬姛")) { + //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3 + appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3", new Date()); + } + } else { + //妫�鏌ョ被鍨嬫槸搴婅竟鐨勬垨甯歌鐨勶紝闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚7 + appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7", null); + } + } + return CommonResult.success(rent_id); } @@ -180,14 +209,20 @@ throw exception(DEVICE_NOT_FREE); } -// //璁惧棰嗗彇瀹屾垚鍚庯紝姝ゆ椂妫�鏌ョ櫥璁板啓鎴愪簡锛岄渶瑕佸皢杩欎釜鍥炲啓缁欓泦鎴愬钩鍙� -// String action = "S0405"; -// String message = ""; - - -// jhfwWebServiceClient.callJHFWTYRK(action, message); - - + //璁惧棰嗗彇瀹屾垚鍚庯紝姝ゆ椂妫�鏌ョ櫥璁板啓鎴愪簡锛岄渶瑕佸皢杩欎釜鍥炲啓缁欓泦鎴愬钩鍙�(绾夸笂鐜鎵嶅洖鍐�) + ConfigDO configDO = configService.getConfigByKey("ecg.back.data"); + if (configDO.getValue().equals("1")) { + AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo()); + ApplicationTemplate app = new ApplicationTemplate(); + String action = "S0405"; + String message = app.getXML(createReqVO.getApplyNo(), "3", "妫�鏌ョ櫥璁�", createReqVO.getOperater(), appointmentDO.getPatDeptCode(), appointmentDO.getPatDeptDesc(), appointmentDO.getPatWardCode(), appointmentDO.getPatWardDesc(), appointmentDO.getPatBedNo(), appointmentDO.getEpisodeId(), "" + appointmentDO.getBookSrc(), appointmentDO.getPatId(), appointmentDO.getPatName()); + String s = webServiceClient.callJHFWTYRK(action, "", message); + log.info("webservice鐨勮繑鍥炲�间负锛歿}", s); + if (s.contains("鏇存柊鎴愬姛")) { + //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3 + appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3", new Date()); + } + } List<Integer> jobTypeList = new ArrayList<Integer>(); jobTypeList.add(DevRentStateEnum.RECEIVED.getState()); jobTypeList.add(DevRentStateEnum.RECEIVED_CANCELLED.getState()); @@ -446,6 +481,25 @@ createReqVO.setState(DevRentStateEnum.ROUTINE_CANCELLED.getState()); updateDevRent(createReqVO); + ConfigDO configDO = configService.getConfigByKey("ecg.back.data"); + if (configDO.getValue().equals("1")) { + if (cancelReqVO.getCheckType() != 100 && cancelReqVO.getCheckType() != 1000 && cancelReqVO.getCheckType() != 1100 && cancelReqVO.getCheckType() != 1400 && cancelReqVO.getCheckType() != 1500) { + AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo()); + ApplicationTemplate app = new ApplicationTemplate(); + String action = "S0405"; + String message = app.getXML(createReqVO.getApplyNo(), "4", "鍙栨秷妫�鏌�", createReqVO.getOperater(), appointmentDO.getPatDeptCode(), appointmentDO.getPatDeptDesc(), appointmentDO.getPatWardCode(), appointmentDO.getPatWardDesc(), appointmentDO.getPatBedNo(), appointmentDO.getEpisodeId(), "" + appointmentDO.getBookSrc(), appointmentDO.getPatId(), appointmentDO.getPatName()); + String s = webServiceClient.callJHFWTYRK(action, "", message); + log.info("routineFinishWebServiceClient鐨勮繑鍥炲�间负锛歿}", s); + if (s.contains("鏇存柊鎴愬姛")) { + //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3 + appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null); + } + } else { + //妫�鏌ョ被鍨嬫槸搴婅竟鐨勬垨甯歌鐨勶紝闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚7 + appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7", null); + } + } + JobRecordSaveReqVO jobRecordSaveReqVO = new JobRecordSaveReqVO(); jobRecordSaveReqVO.setRentId(rent_id); jobRecordSaveReqVO.setDevId(null); @@ -472,6 +526,11 @@ jobRecordDO.setUpdateTime(LocalDateTime.now()); jobRecordMapper.updateById(jobRecordDO); } + QueueDO firstOnStageQueueItem = queueMapper.getBedFirstQueueItemByApplyNo(createReqVO.getApplyNo(), QueueStatusEnum.ONSTAGE.getStatus()); + // QueueStatusEnum.ONSTAGE => QueueStatusEnum.FINISH + firstOnStageQueueItem.setStatus(QueueStatusEnum.FINISH.getStatus()); // 榛樿鐘舵�� 璁剧疆 + firstOnStageQueueItem.setUpdateTime(LocalDateTime.now()); + queueMapper.updateById(firstOnStageQueueItem); return CommonResult.success(rent_id); } @@ -505,6 +564,21 @@ createReqVO.setId(rent_id); createReqVO.setState(DevRentStateEnum.RECEIVED_CANCELLED.getState()); updateDevRent(createReqVO); + + ConfigDO configDO = configService.getConfigByKey("ecg.back.data"); + if (configDO.getValue().equals("1")) { + AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo()); + ApplicationTemplate app = new ApplicationTemplate(); + String action = "S0405"; + String message = app.getXML(createReqVO.getApplyNo(), "4", "鍙栨秷妫�鏌�", createReqVO.getOperater(), appointmentDO.getPatDeptCode(), appointmentDO.getPatDeptDesc(), appointmentDO.getPatWardCode(), appointmentDO.getPatWardDesc(), appointmentDO.getPatBedNo(), appointmentDO.getEpisodeId(), "" + appointmentDO.getBookSrc(), appointmentDO.getPatId(), appointmentDO.getPatName()); + String s = webServiceClient.callJHFWTYRK(action, "", message); + log.info("routineFinishWebServiceClient鐨勮繑鍥炲�间负锛歿}", s); + if (s.contains("鏇存柊鎴愬姛")) { + //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3 + appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null); + } + } + JobRecordSaveReqVO jobRecordSaveReqVO = new JobRecordSaveReqVO(); jobRecordSaveReqVO.setRentId(rent_id); @@ -565,6 +639,20 @@ createReqVO.setId(rent_id); createReqVO.setState(DevRentStateEnum.INSTALL_CANCELLED.getState()); updateDevRent(createReqVO); + + ConfigDO configDO = configService.getConfigByKey("ecg.back.data"); + if (configDO.getValue().equals("1")) { + AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo()); + ApplicationTemplate app = new ApplicationTemplate(); + String action = "S0405"; + String message = app.getXML(createReqVO.getApplyNo(), "4", "鍙栨秷妫�鏌�", createReqVO.getOperater(), appointmentDO.getPatDeptCode(), appointmentDO.getPatDeptDesc(), appointmentDO.getPatWardCode(), appointmentDO.getPatWardDesc(), appointmentDO.getPatBedNo(), appointmentDO.getEpisodeId(), "" + appointmentDO.getBookSrc(), appointmentDO.getPatId(), appointmentDO.getPatName()); + String s = webServiceClient.callJHFWTYRK(action, "", message); + log.info("routineFinishWebServiceClient鐨勮繑鍥炲�间负锛歿}", s); + if (s.contains("鏇存柊鎴愬姛")) { + //闇�瑕佹牴鎹產pplyNo,灏哸ppiontment琛ㄩ噷鐨剆tatus鏀规垚3 + appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null); + } + } JobRecordSaveReqVO jobRecordSaveReqVO = new JobRecordSaveReqVO(); jobRecordSaveReqVO.setRentId(rent_id); @@ -886,6 +974,5 @@ return "01"; } - } -- Gitblit v1.9.3