From b63358eeefeb4c7d0078cffe5dbba0380a740afc Mon Sep 17 00:00:00 2001 From: eight <641137800@qq.com> Date: 星期二, 01 四月 2025 11:45:03 +0800 Subject: [PATCH] update 亲和功能 --- jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java | 41 +++++++++++++++++++++++++++++++---------- 1 files changed, 31 insertions(+), 10 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 c7bacba..efc9b51 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 @@ -10,6 +10,7 @@ import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails; import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO; import cn.lihu.jh.module.ecg.dal.mysql.appointment.AppointmentMapper; +import cn.lihu.jh.module.ecg.dal.mysql.checktype.CheckTypeMapper; import cn.lihu.jh.module.ecg.dal.mysql.devmanage.DeviceMapper; import cn.lihu.jh.module.ecg.dal.mysql.jobrecord.JobRecordMapper; import cn.lihu.jh.module.ecg.dal.mysql.queue.QueueMapper; @@ -21,6 +22,7 @@ import cn.lihu.jh.module.ecg.service.queue.QueueServiceTxFunctions; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import org.springframework.transaction.annotation.Transactional; @@ -53,13 +55,14 @@ */ @Service @Validated +@Slf4j public class DevRentServiceImpl implements DevRentService { @Resource QueueServiceTxFunctions queueServiceTxFunctions; @Resource - private RemoteDataService remoteDataService; + private FeeConfirmFeignService feeConfirmFeignService; @Resource private DevRentMapper devRentMapper; @@ -72,6 +75,9 @@ @Resource QueueMapper queueMapper; + + @Resource + CheckTypeMapper checkTypeMapper; @Override public CommonResult<Long> registerOperation(DevRentSaveReqVO createReqVO) { @@ -250,10 +256,11 @@ String userNickname = SecurityFrameworkUtils.getLoginUserNickname(); Long rent_id = createReqVO.getId(); - // 瀵逛簬宸叉湁棰嗙敤锛屼絾鏄鏈烘椂浣跨敤鐨勪笉鏄凡棰嗙敤璁惧锛岄渶閲婃斁 婧愰鐢� 璁惧 DevRentDO devRentDO = getDevRent(rent_id); + + // 瀵逛簬宸叉湁棰嗙敤锛屼絾鏄鏈烘椂浣跨敤鐨勪笉鏄凡棰嗙敤璁惧锛屾姤閿� if ( null != devRentDO.getDevId() && !createReqVO.getDevId().equals(devRentDO.getDevId()) ) { - markDevFree( devRentDO.getDevId(), rent_id); + throw exception(DEVICE_NOT_PAT_RECEIVED); } // 璁剧疆璁惧 浣跨敤涓� @@ -723,11 +730,18 @@ } // 纭垂澶勭悊 + // 杩斿洖鍊�: 0 鎴愬姛 1 澶辫触 2 涓嶇敤纭垂 @Override public Integer feeConfirm(Long rentId, String hisId, String userNickname, Boolean isFeeConfirmOrCancel) { DevRentDO devRentDO = devRentMapper.selectById(rentId); - PatDetails patDetails = devRentDO.getPatDetails(); + // 鏌ヨ妫�鏌ョ被鍨嬶紝纭畾鏄惁闇�瑕佺‘璐� + CheckTypeDO checkTypeDO = checkTypeMapper.getCheckTypeByValue(devRentDO.getCheckType()); + if (0 == checkTypeDO.getExpenseRecognition()) { + return 2; + } + + PatDetails patDetails = devRentDO.getPatDetails(); HisFeeConfirmReqBody hisFeeConfirmReqBody = new HisFeeConfirmReqBody(); MsgHeader msgHeader = new MsgHeader(); msgHeader.setMsgType("ODS_2212"); @@ -745,16 +759,17 @@ item.setExeDateTime( getCurTimeString() ); // ExmRequest exmRequest = new ExmRequest(); exmRequest.setAuthorOrganization("47162057-2"); - exmRequest.setRequestId( patDetails.getApplyNo() ); // + exmRequest.setRequestId( devRentDO.getApplyNo() ); // exmRequest.setPatientType( getPatientType(patDetails.getSource()) ); // exmRequest.setItem(item); hisFeeConfirmReqBody.setExmRequest(exmRequest); - HisFeeConfirmRespResult result = remoteDataService.httpFeeApi("UpdateExmRequestStatus", "ECG", "ECG", hisFeeConfirmReqBody); + HisFeeConfirmRespResult result = feeConfirmFeignService.httpFeeApi("UpdateExmRequestStatus", "ECG", "ECG", hisFeeConfirmReqBody); + log.info( result.getMsgHeader().getStatus() ); Integer returnValue = result.getMsgHeader().getStatus().equals("true") ? 0 : 1; if (0 == returnValue) { devRentMapper.setPaid(rentId, isFeeConfirmOrCancel ? 1 : 0); } - return returnValue; + return returnValue; // 0 鎴愬姛 1 澶辫触 2 涓嶇敤纭垂 } // 鏍囪 璁惧宸茶棰嗗彇 @@ -831,10 +846,15 @@ } } + /** + * 棰嗙敤瀹屾垚锛屼富鍔ㄥ姹備緷闄� + */ private void procAffinityWhenReadyFinish(/*IN,OUT*/QueueDO bedOnStageQueueItem, Integer[] affinityCheckTypes) { - // 濡傛灉瀛樺湪 [瀹夎涓璢 浜插拰椤癸紝鍒欒窡闅忓叾涓竴涓翰鍜岄」 - List<QueueDO> affinityInstallingItems = queueMapper.getCurPatGivenCheckTypesAndStatus( - bedOnStageQueueItem.getPatId(), affinityCheckTypes, QueueStatusEnum.INSTALLING.getStatus()); + // 濡傛灉瀛樺湪 [瀹夎涓璢 [瀹夎杩囧彿] [瀹夎鍙洖] 鑳借渚濋檮鐨勬鏌ラ」锛屽垯渚濋檮鍒板叾涓竴涓鏌ラ」 + List<QueueDO> affinityInstallingItems = queueMapper.getCurPatGivenCheckTypesAndStatusList( + bedOnStageQueueItem.getPatId(), affinityCheckTypes, + List.of(QueueStatusEnum.INSTALLING.getStatus(), QueueStatusEnum.PASSED_INSTALL.getStatus(), + QueueStatusEnum.RECALLED_INSTALL.getStatus())); if (!affinityInstallingItems.isEmpty()) { QueueDO affinityInstallingItem = affinityInstallingItems.get(0); bedOnStageQueueItem.setStatus(QueueStatusEnum.AFFINITY_RECEIVED.getStatus()); // 浜插拰-棰嗙敤 @@ -852,6 +872,7 @@ } } + // 濡傛灉瀛樺湪 [浜插拰-棰嗙敤] 浜插拰椤癸紝鍒欓�夋嫨 鍏朵腑涓�涓翰鍜岄」 鎺ユ浛鍏� 澶勪簬 [瀹夎涓璢 private void procAffinityWhenInstallFinish(QueueDO bedInstallingQueueItem, Integer[] affinityCheckTypes) { List<QueueDO> affinityAffinityReceivedItems = queueMapper.getCurPatGivenCheckTypesAndStatus( bedInstallingQueueItem.getPatId(), affinityCheckTypes, QueueStatusEnum.AFFINITY_RECEIVED.getStatus()); -- Gitblit v1.9.3