From 28314081239ddbdb0bec61ab7fc87bcab05202d8 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期四, 14 十一月 2024 13:01:41 +0800
Subject: [PATCH] refactor 亲和性
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java | 2
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java | 55 +++++++------
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueService.java | 2
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java | 94 ++++++++++++++---------
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java | 80 +++++++++++---------
5 files changed, 135 insertions(+), 98 deletions(-)
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java
index 6f80f2a..a687d57 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java
@@ -414,7 +414,7 @@
if (roomId != roomId_operator)
return error(QUEUE_RECALL_INSTALL_NOT_CUR_ROOM);
- Integer result = queueService.recallInstallPatient(roomId, bedNo, patId, checkType, bedNo_operator);
+ Integer result = queueService.recallInstallPatient(roomId, bedNo, patId, checkType, roomId_operator, bedNo_operator);
if (null == result || 0 == result)
return error(PATIENT_NOT_EXISTS);
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 40d53a8..fc52a46 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
@@ -136,12 +136,7 @@
// 妫�鏌ラ」鐩�.浜插拰鎬� 澶勭悊閫昏緫
CheckTypeDO checkTypeDO = queueServiceTxFunctions.getCheckTypeItem( firstOnStageQueueItem.getBookCheckType() );
if (checkTypeDO.getAffinityCheckTypes().length > 0) {
- List<QueueDO> affinityAffinityWaitingItems = queueMapper.getCurPatGivenCheckTypesAndStatus(firstOnStageQueueItem.getPatId(), checkTypeDO.getAffinityCheckTypes(), QueueStatusEnum.AFFINITY_WAITING.getStatus());
- if (!affinityAffinityWaitingItems.isEmpty()) {
- QueueDO tmpQueueDO = affinityAffinityWaitingItems.get(0);
- tmpQueueDO.setStatus(QueueStatusEnum.ONSTAGE.getStatus());
- queueMapper.updateById(tmpQueueDO);
- }
+ procAffinityWhenRoutineFinish( firstOnStageQueueItem.getPatId(), checkTypeDO.getAffinityCheckTypes() );
}
return CommonResult.success(rent_id);
@@ -216,30 +211,18 @@
//queueMapper.updateBedQueueStatus(createReqVO.getRoomId(), createReqVO.getBedNo(),
// QueueStatusEnum.ONSTAGE.getStatus(), QueueStatusEnum.RECEIVED.getStatus());
- QueueDO firstOnStageQueueItem = queueMapper.getFirstItemByBedAndStatus(createReqVO.getRoomId(), createReqVO.getBedNo(), QueueStatusEnum.ONSTAGE.getStatus());
- CheckTypeDO checkTypeDO = queueServiceTxFunctions.getCheckTypeItem( firstOnStageQueueItem.getBookCheckType() );
-
// QueueStatusEnum.ONSTAGE => QueueStatusEnum.RECEIVED
- firstOnStageQueueItem.setStatus(QueueStatusEnum.RECEIVED.getStatus()); // 榛樿鐘舵�� 璁剧疆
- // 妫�鏌ラ」鐩�.浜插拰鎬� 澶勭悊閫昏緫
- if (checkTypeDO.getAffinityCheckTypes().length > 0) {
- List<QueueDO> affinityInstallingItems = queueMapper.getCurPatGivenCheckTypesAndStatus(firstOnStageQueueItem.getPatId(), checkTypeDO.getAffinityCheckTypes(), QueueStatusEnum.INSTALLING.getStatus());
- if (!affinityInstallingItems.isEmpty()) {
- firstOnStageQueueItem.setStatus(QueueStatusEnum.AFFINITY_RECEIVED.getStatus());
- }
- }
- queueMapper.updateById( firstOnStageQueueItem );
+ QueueDO bedOnStageQueueItem = queueMapper.getFirstItemByBedAndStatus(
+ createReqVO.getRoomId(), createReqVO.getBedNo(), QueueStatusEnum.ONSTAGE.getStatus() );
+ CheckTypeDO checkTypeDO = queueServiceTxFunctions.getCheckTypeItem( bedOnStageQueueItem.getBookCheckType() );
+ bedOnStageQueueItem.setStatus(QueueStatusEnum.RECEIVED.getStatus()); // [宸查鐢╙ 鐘舵��
- // 妫�鏌ラ」鐩�.浜插拰鎬� 澶勭悊閫昏緫
+ // 妫�鏌ラ」鐩�.浜插拰鎬� 澶勭悊閫昏緫 , 鏇存柊 bedOnStageQueueItem
if (checkTypeDO.getAffinityCheckTypes().length > 0) {
- List<QueueDO> affinityAffinityWaitingItems = queueMapper.getCurPatGivenCheckTypesAndStatus(firstOnStageQueueItem.getPatId(), checkTypeDO.getAffinityCheckTypes(), QueueStatusEnum.AFFINITY_WAITING.getStatus());
- if (!affinityAffinityWaitingItems.isEmpty()) {
- QueueDO tmpQueueDO = affinityAffinityWaitingItems.get(0);
- tmpQueueDO.setStatus(QueueStatusEnum.ONSTAGE.getStatus());
- queueMapper.updateById(tmpQueueDO);
- }
+ procAffinityWhenReadyFinish(/*IN, OUT*/bedOnStageQueueItem, checkTypeDO.getAffinityCheckTypes());
}
+ queueMapper.updateById( bedOnStageQueueItem );
return CommonResult.success(rent_id);
}
@@ -315,21 +298,16 @@
//queueMapper.updateBedQueueStatus(createReqVO.getRoomId(), createReqVO.getBedNo(),
// QueueStatusEnum.INSTALLING.getStatus(), QueueStatusEnum.FINISH.getStatus());
- QueueDO firstInstallingQueueItem = queueMapper.getFirstItemByBedAndStatus(createReqVO.getRoomId(),
- createReqVO.getBedNo(), QueueStatusEnum.INSTALLING.getStatus());
// QueueStatusEnum.INSTALLING => QueueStatusEnum.FINISH
- firstInstallingQueueItem.setStatus(QueueStatusEnum.FINISH.getStatus()); // 榛樿鐘舵�� 璁剧疆
- queueMapper.updateById( firstInstallingQueueItem );
+ QueueDO bedInstallingQueueItem = queueMapper.getFirstItemByBedAndStatus(
+ createReqVO.getRoomId(), createReqVO.getBedNo(), QueueStatusEnum.INSTALLING.getStatus());
+ bedInstallingQueueItem.setStatus(QueueStatusEnum.FINISH.getStatus()); // 榛樿鐘舵�� 璁剧疆
+ queueMapper.updateById( bedInstallingQueueItem );
// 妫�鏌ラ」鐩�.浜插拰鎬� 澶勭悊閫昏緫
- CheckTypeDO checkTypeDO = queueServiceTxFunctions.getCheckTypeItem( firstInstallingQueueItem.getBookCheckType() );
+ CheckTypeDO checkTypeDO = queueServiceTxFunctions.getCheckTypeItem( bedInstallingQueueItem.getBookCheckType() );
if (checkTypeDO.getAffinityCheckTypes().length > 0) {
- List<QueueDO> affinityAffinityReceivedItems = queueMapper.getCurPatGivenCheckTypesAndStatus(firstInstallingQueueItem.getPatId(), checkTypeDO.getAffinityCheckTypes(), QueueStatusEnum.AFFINITY_RECEIVED.getStatus());
- if (!affinityAffinityReceivedItems.isEmpty()) {
- QueueDO tmpQueueDO = affinityAffinityReceivedItems.get(0);
- tmpQueueDO.setStatus(QueueStatusEnum.INSTALLING.getStatus());
- queueMapper.updateById(tmpQueueDO);
- }
+ procAffinityWhenInstallFinish(bedInstallingQueueItem, checkTypeDO.getAffinityCheckTypes());
}
return CommonResult.success(rent_id);
@@ -788,5 +766,49 @@
return 0;
}
+ private void procAffinityWhenRoutineFinish(String patId, Integer[] affinityCheckTypes) {
+ // 濡傛灉瀛樺湪 [浜插拰-鎺掗槦] 浜插拰椤癸紝鍒欓�夋嫨 鍏朵腑涓�涓翰鍜岄」 鎺ユ浛鍏� 澶勪簬 [灏辫瘖涓璢
+ List<QueueDO> affinityAffinityWaitingItems = queueMapper.getCurPatGivenCheckTypesAndStatus(
+ patId, affinityCheckTypes, QueueStatusEnum.AFFINITY_WAITING.getStatus());
+ if (!affinityAffinityWaitingItems.isEmpty()) {
+ QueueDO tmpQueueDO = affinityAffinityWaitingItems.get(0);
+ tmpQueueDO.setStatus(QueueStatusEnum.ONSTAGE.getStatus());
+ queueMapper.updateById(tmpQueueDO);
+ }
+ }
+
+ private void procAffinityWhenReadyFinish(QueueDO bedOnStageQueueItem, Integer[] affinityCheckTypes) {
+ // 濡傛灉瀛樺湪 [瀹夎涓璢 浜插拰椤癸紝鍒欒窡闅忓叾涓竴涓翰鍜岄」
+ List<QueueDO> affinityInstallingItems = queueMapper.getCurPatGivenCheckTypesAndStatus(
+ bedOnStageQueueItem.getPatId(), affinityCheckTypes, QueueStatusEnum.INSTALLING.getStatus());
+ if (!affinityInstallingItems.isEmpty()) {
+ QueueDO affinityInstallingItem = affinityInstallingItems.get(0);
+ bedOnStageQueueItem.setStatus(QueueStatusEnum.AFFINITY_RECEIVED.getStatus()); // 浜插拰-棰嗙敤
+ bedOnStageQueueItem.setRoomId( affinityInstallingItem.getRoomId() );
+ bedOnStageQueueItem.setBedNo( affinityInstallingItem.getBedNo() ); // 棰嗙敤 鍒� 瀹夎 鍙兘浼氬湪涓嶅悓宸ヤ綅
+ }
+
+ // 濡傛灉瀛樺湪 [浜插拰-鎺掗槦] 浜插拰椤癸紝鍒欓�夋嫨 鍏朵腑涓�涓翰鍜岄」 鎺ユ浛鍏� 澶勪簬 [灏辫瘖涓璢
+ List<QueueDO> affinityAffinityWaitingItems = queueMapper.getCurPatGivenCheckTypesAndStatus(
+ bedOnStageQueueItem.getPatId(), affinityCheckTypes, QueueStatusEnum.AFFINITY_WAITING.getStatus());
+ if (!affinityAffinityWaitingItems.isEmpty()) {
+ QueueDO tmpQueueDO = affinityAffinityWaitingItems.get(0);
+ tmpQueueDO.setStatus(QueueStatusEnum.ONSTAGE.getStatus());
+ queueMapper.updateById( tmpQueueDO );
+ }
+ }
+
+ private void procAffinityWhenInstallFinish(QueueDO bedInstallingQueueItem, Integer[] affinityCheckTypes) {
+ List<QueueDO> affinityAffinityReceivedItems = queueMapper.getCurPatGivenCheckTypesAndStatus(
+ bedInstallingQueueItem.getPatId(), affinityCheckTypes, QueueStatusEnum.AFFINITY_RECEIVED.getStatus());
+ if (!affinityAffinityReceivedItems.isEmpty()) {
+ QueueDO tmpQueueDO = affinityAffinityReceivedItems.get(0);
+ tmpQueueDO.setStatus(QueueStatusEnum.INSTALLING.getStatus());
+ tmpQueueDO.setRoomId( bedInstallingQueueItem.getRoomId() );
+ tmpQueueDO.setBedNo( bedInstallingQueueItem.getBedNo() ); // 浠� [棰嗙敤] 鍒� [瀹夎]锛� 鍙灔鍦ㄤ笉鍚屽伐浣嶄笂鎿嶄綔
+ queueMapper.updateById(tmpQueueDO);
+ }
+ }
+
}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueService.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueService.java
index fc8277f..4fe42ef 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueService.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueService.java
@@ -126,7 +126,7 @@
Integer recallPatient(Long roomId, String bedNo, String patId, Integer checkType);
- Integer recallInstallPatient(Long roomId, String bedNo, String patId, Integer checkType, String bedNo_operator);
+ Integer recallInstallPatient(Long roomId, String bedNo, String patId, Integer checkType, Long roomId_operator, String bedNo_operator);
Integer patientJump(String patId, Byte jumped );
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java
index 19825ba..fa7b920 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java
@@ -322,19 +322,9 @@
queueSaveReqVO.setStatus(QueueStatusEnum.WAITING.getStatus());
// 澶勭悊 妫�鏌ラ」鐩�.浜插拰鎬� 閫昏緫
- // 濡傛灉瀛樺湪 澶勪簬 [灏辫瘖鍑嗗涓璢 | [灏辫瘖涓璢 鐨勪翰鍜岄」锛屽垯璺熼殢鍏朵腑涓�涓翰鍜岄」
CheckTypeDO checkTypeDO = queueServiceTxFunctions.getCheckTypeItem( queueSaveReqVO.getBookCheckType() );
if ( checkTypeDO.getAffinityCheckTypes().length > 0) {
- List<QueueDO> affinityItems = queueMapper.getCurPatGivenCheckTypesAndStatusList( queueSaveReqVO.getPatId(), checkTypeDO.getAffinityCheckTypes(),
- List.of(QueueStatusEnum.READY.getStatus(), QueueStatusEnum.ONSTAGE.getStatus()));
- if (!affinityItems.isEmpty()) {
- QueueDO queueItem = affinityItems.get(0);
- queueSaveReqVO.setStatus(QueueStatusEnum.AFFINITY_WAITING.getStatus()); // [浜插拰-鎺掗槦] 鐘舵��
- queueSaveReqVO.setRoomId(queueItem.getRoomId());
- queueSaveReqVO.setRoomName(queueItem.getRoomName());
- queueSaveReqVO.setBedNo(queueItem.getBedNo());
- queueSaveReqVO.setSeqNum(queueItem.getSeqNum());
- }
+ procAffinityWhenQueue(queueSaveReqVO, checkTypeDO.getAffinityCheckTypes());
}
QueueDO queue = BeanUtils.toBean(queueSaveReqVO, QueueDO.class);
@@ -533,13 +523,16 @@
}
@Override
- public Integer recallInstallPatient(Long roomId, String bedNo, String patId, Integer checkType, String bedNo_operator) {
+ public Integer recallInstallPatient(Long roomId, String bedNo, String patId, Integer checkType, Long roomId_operator, String bedNo_operator) {
Integer updateNum = queueMapper.recallPassedInstallPatient(roomId, bedNo_operator, patId, checkType,
QueueStatusEnum.PASSED_INSTALL.getStatus(), QueueStatusEnum.RECALLED_INSTALL.getStatus());
// 妫�鏌ラ」鐩�.浜插拰鎬� 澶勭悊
if (null != updateNum && 1 == updateNum) {
- updateAffinityItemsWhenInstallRecall(patId, checkType, bedNo_operator);
+ CheckTypeDO checkTypeDO = queueServiceTxFunctions.getCheckTypeItem( checkType );
+ if ( checkTypeDO.getAffinityCheckTypes().length > 0) {
+ procAffinityWhenInstallRecall(patId, checkTypeDO.getAffinityCheckTypes(), roomId_operator, bedNo_operator);
+ }
}
// 瀹夎宸ヤ綅 涓嶆秹鍙� 浼樺厛闃熷垪
@@ -642,17 +635,31 @@
return roomDO;
}
- private void updateAffinityItemsWhenInstallRecall(String patId, Integer checkType, String bedNo_operator) {
- CheckTypeDO checkTypeDO = queueServiceTxFunctions.getCheckTypeItem( checkType );
- if ( checkTypeDO.getAffinityCheckTypes().length > 0) {
- List<QueueDO> affinityItems = queueMapper.getCurPatGivenCheckTypesAndStatus(patId,
- checkTypeDO.getAffinityCheckTypes(), QueueStatusEnum.AFFINITY_RECEIVED.getStatus());
- for (int i = 0; i < affinityItems.size(); i++) {
- QueueDO queueItem = affinityItems.get(i);
- queueItem.setBedNo( bedNo_operator );
- //queueItem.setSeqNum( preemptQueueItem.getSeqNum() ); // 瑁呮満鏃� 鍐呴儴搴忓彿涓嶅彉
- queueMapper.updateById(queueItem);
- }
+ private void procAffinityWhenInstallRecall(String patId, Integer[] affinityCheckTypes, Long roomId_operator, String bedNo_operator) {
+ List<QueueDO> affinityItems = queueMapper.getCurPatGivenCheckTypesAndStatus(
+ patId, affinityCheckTypes, QueueStatusEnum.AFFINITY_RECEIVED.getStatus());
+ for (int i = 0; i < affinityItems.size(); i++) {
+ QueueDO queueItem = affinityItems.get(i);
+ queueItem.setRoomId( roomId_operator );
+ queueItem.setBedNo( bedNo_operator );
+ //queueItem.setSeqNum( preemptQueueItem.getSeqNum() ); // 瑁呮満鏃� 鍐呴儴搴忓彿涓嶅彉 鏁呬笉闇�鏇存柊
+ queueMapper.updateById(queueItem);
}
}
+
+ private void procAffinityWhenQueue(/*IN, OUT*/QueueSaveReqVO queueSaveReqVO, Integer[] affinityCheckTypes) {
+ // 濡傛灉瀛樺湪 澶勪簬 [灏辫瘖鍑嗗涓璢 | [灏辫瘖涓璢 鐨勪翰鍜岄」锛屽垯璺熼殢鍏朵腑涓�涓翰鍜岄」
+ List<QueueDO> affinityItems = queueMapper.getCurPatGivenCheckTypesAndStatusList(
+ queueSaveReqVO.getPatId(), affinityCheckTypes,
+ List.of(QueueStatusEnum.READY.getStatus(), QueueStatusEnum.ONSTAGE.getStatus()));
+ if (!affinityItems.isEmpty()) {
+ QueueDO queueItem = affinityItems.get(0);
+ queueSaveReqVO.setStatus(QueueStatusEnum.AFFINITY_WAITING.getStatus()); // [浜插拰-鎺掗槦] 鐘舵��
+ queueSaveReqVO.setRoomId(queueItem.getRoomId());
+ queueSaveReqVO.setRoomName(queueItem.getRoomName());
+ queueSaveReqVO.setBedNo(queueItem.getBedNo());
+ queueSaveReqVO.setSeqNum(queueItem.getSeqNum());
+ }
+ }
+
}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java
index 4139321..387bc26 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java
@@ -286,7 +286,7 @@
public ErrorCode nextInstallPatient(Long roomId, String bedNo) {
// 浠� DB 鎶� 搴忓彿鏈�灏忕殑 [宸查鐢╙ [宸插彫鍥�-瀹夎] 鐨勪汉 璁剧疆涓� [瀹夎涓璢
QueueDO firstItem = queueMapper.getFirstItemByRoomAndStatus(roomId, List.of(QueueStatusEnum.RECEIVED.getStatus(), QueueStatusEnum.RECALLED_INSTALL.getStatus()));
- // 璇ュ伐浣� 娌℃湁 [宸查鐢╙ [宸插彫鍥�-瀹夎] 浜哄憳
+ // 璇ュ伐浣� 娌℃湁 [宸查鐢╙ | [宸插彫鍥�-瀹夎] 浜哄憳
if (null == firstItem) {
return QUEUE_NOT_READY_PATIENT;
}
@@ -298,14 +298,7 @@
// 妫�鏌ラ」鐩�.浜插拰鎬� 澶勭悊閫昏緫
CheckTypeDO checkTypeDO = getCheckTypeItem( firstItem.getBookCheckType() );
if (checkTypeDO.getAffinityCheckTypes().length > 0) {
- List<QueueDO> affinityItems = queueMapper.getCurPatGivenCheckTypesAndStatus(firstItem.getPatId(),
- checkTypeDO.getAffinityCheckTypes(), QueueStatusEnum.RECEIVED.getStatus());
- for (int i = 0; i < affinityItems.size(); i++) {
- QueueDO queueItem = affinityItems.get(i);
- queueItem.setStatus(QueueStatusEnum.AFFINITY_RECEIVED.getStatus()); //鏀瑰彉 鎺掗槦鐘舵��
- queueItem.setBedNo( bedNo ); // 璺熼殢鍒� 瑁呮満 宸ヤ綅
- queueMapper.updateById(queueItem);
- }
+ procAffinityWhenSomeOneEntryInstalling(firstItem.getPatId(), roomId, bedNo, checkTypeDO.getAffinityCheckTypes() );
}
// 瑁呮満宸ヤ綅 鏃犱紭鍏堥槦鍒�
@@ -409,7 +402,11 @@
// 鍙洖 [杩囧彿] 鎮h�呭悗锛屽鐞� 妫�鏌ラ」鐩�.浜插拰鎬� 閫昏緫
QueueDO recalledQueueItem = queueMapper.getQueueItemBySeqNum(curSeqNum.get() + 1);
- updateAffinityItemsWhenRecalled( recalledQueueItem );
+
+ CheckTypeDO checkTypeDO = getCheckTypeItem( recalledQueueItem.getBookCheckType() );
+ if ( checkTypeDO.getAffinityCheckTypes().length > 0) {
+ procAffinityWhenRecalled(recalledQueueItem, checkTypeDO.getAffinityCheckTypes());
+ }
curSeqNum.getAndIncrement();
@@ -458,9 +455,13 @@
return;
}
- // 鎶㈠埌鎺掗槦鎮h�呭悗锛屽鐞� 妫�鏌ラ」鐩�.浜插拰鎬� 閫昏緫
QueueDO preemptQueueItem = queueMapper.getQueueItemBySeqNum(curSeqNum.get() + 1);
- updateAffinityItemsWhenPreempt( preemptQueueItem );
+ CheckTypeDO checkTypeDO = getCheckTypeItem( preemptQueueItem.getBookCheckType() );
+
+ // 鎶㈠埌鎺掗槦鎮h�呭悗锛屽鐞� 妫�鏌ラ」鐩�.浜插拰鎬� 閫昏緫
+ if ( checkTypeDO.getAffinityCheckTypes().length > 0) {
+ procAffinityWhenPreempt(preemptQueueItem, checkTypeDO.getAffinityCheckTypes());
+ }
curSeqNum.getAndIncrement();
@@ -507,33 +508,27 @@
log.info(" opening " + openingFlag.get() + " " + monitorInfoVO.getQueueNum() + " " + monitorInfoVO.getActiveQueueNum() + " " + monitorInfoVO.getCheckTypeBedInfo().toString() );
}
- private void updateAffinityItemsWhenPreempt(QueueDO preemptQueueItem) {
- CheckTypeDO checkTypeDO = getCheckTypeItem( preemptQueueItem.getBookCheckType() );
- if ( checkTypeDO.getAffinityCheckTypes().length > 0) {
- List<QueueDO> affinityItems = queueMapper.getCurPatGivenCheckTypesAndStatus(preemptQueueItem.getPatId(),
- checkTypeDO.getAffinityCheckTypes(), QueueStatusEnum.WAITING.getStatus());
- for (int i = 0; i < affinityItems.size(); i++) {
- QueueDO queueItem = affinityItems.get(i);
- queueItem.setStatus(QueueStatusEnum.AFFINITY_WAITING.getStatus()); //鏀瑰彉 鎺掗槦鐘舵��
- queueItem.setRoomId(preemptQueueItem.getRoomId());
- queueItem.setRoomName(preemptQueueItem.getRoomName());
- queueItem.setBedNo(preemptQueueItem.getBedNo());
- queueItem.setSeqNum( preemptQueueItem.getSeqNum()); // 浣跨敤鍚屼竴涓� 鍐呴儴搴忓彿
- queueMapper.updateById(queueItem);
- }
+ private void procAffinityWhenPreempt(QueueDO preemptQueueItem, Integer[] affinityCheckTypes) {
+ List<QueueDO> affinityItems = queueMapper.getCurPatGivenCheckTypesAndStatus(
+ preemptQueueItem.getPatId(), affinityCheckTypes, QueueStatusEnum.WAITING.getStatus());
+ for (int i = 0; i < affinityItems.size(); i++) {
+ QueueDO queueItem = affinityItems.get(i);
+ queueItem.setStatus(QueueStatusEnum.AFFINITY_WAITING.getStatus()); //鏀瑰彉 鎺掗槦鐘舵��
+ queueItem.setRoomId(preemptQueueItem.getRoomId());
+ queueItem.setRoomName(preemptQueueItem.getRoomName());
+ queueItem.setBedNo(preemptQueueItem.getBedNo());
+ queueItem.setSeqNum( preemptQueueItem.getSeqNum()); // 浣跨敤鍚屼竴涓� 鍐呴儴搴忓彿
+ queueMapper.updateById(queueItem);
}
}
- private void updateAffinityItemsWhenRecalled(QueueDO recalledQueueItem) {
- CheckTypeDO checkTypeDO = getCheckTypeItem( recalledQueueItem.getBookCheckType() );
- if ( checkTypeDO.getAffinityCheckTypes().length > 0) {
- List<QueueDO> affinityItems = queueMapper.getCurPatGivenCheckTypesAndStatus(recalledQueueItem.getPatId(),
- checkTypeDO.getAffinityCheckTypes(), QueueStatusEnum.AFFINITY_WAITING.getStatus());
- for (int i = 0; i < affinityItems.size(); i++) {
- QueueDO queueItem = affinityItems.get(i);
- queueItem.setSeqNum( recalledQueueItem.getSeqNum() ); // 鍙洖鍚庯紝鍘熷唴閮ㄥ簭鍙锋洿鏂�
- queueMapper.updateById(queueItem);
- }
+ private void procAffinityWhenRecalled(QueueDO recalledQueueItem, Integer[] affinityCheckTypes) {
+ List<QueueDO> affinityItems = queueMapper.getCurPatGivenCheckTypesAndStatus(
+ recalledQueueItem.getPatId(), affinityCheckTypes, QueueStatusEnum.AFFINITY_WAITING.getStatus());
+ for (int i = 0; i < affinityItems.size(); i++) {
+ QueueDO queueItem = affinityItems.get(i);
+ queueItem.setSeqNum( recalledQueueItem.getSeqNum() ); // 鍙洖鍚庯紝鍘熷唴閮ㄥ簭鍙锋洿鏂�
+ queueMapper.updateById(queueItem);
}
}
@@ -590,6 +585,19 @@
});
}
+ private void procAffinityWhenSomeOneEntryInstalling(String patId, Long roomId_operator, String bedNo_operator, Integer[] affinityCheckTypes) {
+ // 瀵逛簬 鍒氳繘鍏ュ埌 [瀹夎涓璢鐨勯」, 濡傛灉瀛樺湪 [宸查鐢╙ 鐨勪翰鍜岄」锛屽垯闇�瑕佸叾璺熼殢
+ List<QueueDO> affinityItems = queueMapper.getCurPatGivenCheckTypesAndStatus(
+ patId, affinityCheckTypes, QueueStatusEnum.RECEIVED.getStatus());
+ for (int i = 0; i < affinityItems.size(); i++) {
+ QueueDO queueItem = affinityItems.get(i);
+ queueItem.setStatus(QueueStatusEnum.AFFINITY_RECEIVED.getStatus()); //鏀瑰彉 鎺掗槦鐘舵��
+ queueItem.setRoomId(roomId_operator);
+ queueItem.setBedNo(bedNo_operator); // 璺熼殢鍒� 瑁呮満 宸ヤ綅
+ queueMapper.updateById(queueItem);
+ }
+ }
+
private void roomBedStatistic(MonitorInfoVO monitorInfoVO) {
Map<Integer, Integer> mapOpeningCheckBedStatInfo = new HashMap<>();
Map<Integer, Integer> mapOpeningInstallBedStatInfo = new HashMap<>();
--
Gitblit v1.9.3