From c116b3cd452dcb3de02935711a1ca3441382657d Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期一, 11 十一月 2024 14:36:50 +0800
Subject: [PATCH] update

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java |   27 ++++++++++++++++++++-------
 1 files changed, 20 insertions(+), 7 deletions(-)

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 1d2cd35..93a8719 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
@@ -418,6 +418,22 @@
                 return;
             }
 
+            // 鎶㈠埌鎺掗槦鎮h�呭悗锛屽鐞� 妫�鏌ラ」鐩�.浜插拰鎬� 閫昏緫
+            QueueDO queueDO = queueMapper.getQueueItemBySeqNum(curSeqNum.get() + 1);
+            CheckTypeDO checkTypeDO = getCheckTypeItem( queueDO.getBookCheckType() );
+            if ( checkTypeDO.getAffinityCheckTypes().length > 0) {
+                List<QueueDO> affinityItems = queueMapper.getCurPatGivenCheckItems(queueDO.getPatId(), checkTypeDO.getAffinityCheckTypes());
+                for (int i = 0; i < affinityItems.size(); i++) {
+                    QueueDO queueItem = affinityItems.get(i);
+                    queueItem.setStatus(QueueStatusEnum.AFFINITY_ALREADY.getStatus()); //鏀瑰彉 鎺掗槦鐘舵��
+                    queueItem.setRoomId(queueItem.getRoomId());
+                    queueItem.setRoomName(queueItem.getRoomName());
+                    queueItem.setBedNo(queueItem.getBedNo());
+                    queueItem.setSeqNum(curSeqNum.get() + 1);  // 浣跨敤鍚屼竴涓� 鍐呴儴搴忓彿
+                    queueMapper.updateById(queueItem);
+                }
+            }
+
             curSeqNum.getAndIncrement();
 
             // 鍙兘宸茬粡銆愬苟鍙戠殑銆戝湪 nextPatient 涓敼鍙樹簡鍊�
@@ -441,6 +457,10 @@
         mapCheckTypeVsReadyMax = checkTypeDOList.stream().collect(Collectors.toMap(CheckTypeDO::getValue, checkType -> checkType));
     }
 
+    public CheckTypeDO getCheckTypeItem(Integer checkType) {
+        return mapCheckTypeVsReadyMax.get( checkType );
+    }
+
     public BedQueueBO getBedQueueBO(Long roomId, String bedNo) {
         return mapBedVsQueue.get( Utils.formatRoomBed(roomId, bedNo) );
     }
@@ -457,13 +477,6 @@
         MonitorInfoVO monitorInfoVO = new MonitorInfoVO();
         roomBedStatistic(monitorInfoVO);
         log.info(" opening " + openingFlag.get() + " " + monitorInfoVO.getQueueNum() + " " + monitorInfoVO.getActiveQueueNum() + " " + monitorInfoVO.getCheckTypeBedInfo().toString() );
-    }
-
-    public void resetQueueSequenceTable() {
-        String strBookTimeslotLength = configApi.getConfigValueByKey(BOOK_TIMESLOT_LENGTH);
-        String strBookTimeslotList = configApi.getConfigValueByKey(BOOK_TIMESLOT_LIST);
-
-
     }
 
     private Integer getBedReadyMax(Long roomId, String bedNo) {

--
Gitblit v1.9.3