From fdbf09b4120558114e45134322aadb6a8d4bffc8 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期五, 08 十一月 2024 18:46:10 +0800
Subject: [PATCH] update
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java | 163 ++++++++++++++++++++++++++++++++++--------------------
1 files changed, 103 insertions(+), 60 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 7d5d6e3..86f8b28 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
@@ -3,16 +3,20 @@
import cn.lihu.jh.framework.common.exception.ErrorCode;
import cn.lihu.jh.framework.common.exception.enums.GlobalErrorCodeConstants;
import cn.lihu.jh.framework.common.util.object.BeanUtils;
+import cn.lihu.jh.module.ecg.Utils;
import cn.lihu.jh.module.ecg.controller.admin.room.vo.MonitorInfoVO;
+import cn.lihu.jh.module.ecg.dal.dataobject.checktype.CheckTypeDO;
import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO;
import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueStatisticDO;
import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO;
import cn.lihu.jh.module.ecg.dal.mysql.call.CallMapper;
+import cn.lihu.jh.module.ecg.dal.mysql.checktype.CheckTypeMapper;
import cn.lihu.jh.module.ecg.dal.mysql.devrent.DevRentMapper;
-import cn.lihu.jh.module.ecg.dal.mysql.queue.queueMapper;
+import cn.lihu.jh.module.ecg.dal.mysql.queue.QueueMapper;
import cn.lihu.jh.module.ecg.dal.mysql.room.RoomMapper;
import cn.lihu.jh.module.ecg.enums.BedStatusEnum;
import cn.lihu.jh.module.ecg.enums.QueueStatusEnum;
+import cn.lihu.jh.module.infra.api.config.ConfigApi;
import cn.lihu.jh.module.system.api.oauth2.OAuth2TokenApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@@ -22,9 +26,11 @@
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.lihu.jh.framework.common.pojo.CommonResult.error;
+import static cn.lihu.jh.module.ecg.Constants.*;
import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.*;
/**
@@ -38,10 +44,13 @@
public class QueueServiceTxFunctions {
@Resource
+ private ConfigApi configApi;
+
+ @Resource
private OAuth2TokenApi oAuth2TokenApi;
@Resource
- private queueMapper queueMapper;
+ private QueueMapper queueMapper;
@Resource
private RoomMapper roomMapper;
@@ -52,18 +61,22 @@
@Resource
private DevRentMapper devRentMapper;
+ @Resource
+ private CheckTypeMapper checkTypeMapper;
+
+
AtomicInteger openingFlag = new AtomicInteger(0);
AtomicInteger curSeqNum = new AtomicInteger(0);
ConcurrentHashMap<String, BedQueueBO > mapBedVsQueue = new ConcurrentHashMap<>();
- // 鍩轰簬绫诲瀷鐨�, 妫�鏌ユ垨瑁呮満鐨勪紭鍏堥槦鍒�
- Map<Integer, PriorityBlockingQueue<BedQueueBO>> mapCheckPriorityQueue = new HashMap();
+ // 瑁呮満宸ヤ綅..涓嶈繘鍏ヤ紭鍏堥槦鍒�
+ Map<Integer, PriorityBlockingQueue<BedQueueBO>> mapCheckTypePriorityQueue = new HashMap();
// 鍩轰簬绫诲瀷鐨�, 瑁呮満鍑嗗鐨勪紭鍏堥槦鍒�
- Map<Integer, PriorityBlockingQueue<BedQueueBO>> mapReadyPriorityQueue = new HashMap();
+ // Map<Integer, PriorityBlockingQueue<BedQueueBO>> mapReadyPriorityQueue = new HashMap();
- Map<Integer, Integer> mapCheckTypeVsReadyMax = null;
+ Map<Integer, CheckTypeDO> mapCheckTypeVsReadyMax = null;
/**
* 宸插叧闂� 鎴栬�� 鍏抽棴涓紝鍙互寮�閫氬伐浣�
@@ -72,7 +85,7 @@
* @return
*/
public ErrorCode bedOpen(Long roomId, String roomName, String bedNo) {
- BedQueueBO bedQueueBO2 = mapBedVsQueue.get(String.format("%09d%s", roomId, bedNo));
+ BedQueueBO bedQueueBO2 = mapBedVsQueue.get( Utils.formatRoomBed(roomId, bedNo) );
if (null != bedQueueBO2) {
log.error("bedOpen mapBedVsQueue has existed. " + roomId + " " + bedNo);
return QUEUE_BED_EXIST;
@@ -87,9 +100,9 @@
return ROOM_INVALID_STATUS;
}
- List<Byte> queueStatusList = new ArrayList<>();
+ List<Integer> queueStatusList = new ArrayList<>();
queueStatusList.add(QueueStatusEnum.READY.getStatus());
- List<QueueDO> queueDOList = queueMapper.getDoctorQueueByStatus(roomId, bedNo, queueStatusList);
+ List<QueueDO> queueDOList = queueMapper.getBedQueueByStatus(roomId, bedNo, queueStatusList);
RoomDO roomDO = roomMapper.getRoom(roomId, bedNo);
@@ -103,13 +116,13 @@
bedQueueBO.setStatus(BedStatusEnum.OPENING.getStatus());
bedQueueBO.setCheckTypes( roomDO.getCheckTypes() );
bedQueueBO.setOpType( roomDO.getOpType() );
- mapBedVsQueue.put(String.format("%09d%s", roomId, bedNo), bedQueueBO);
+ mapBedVsQueue.put( Utils.formatRoomBed(roomId, bedNo), bedQueueBO);
return GlobalErrorCodeConstants.SUCCESS;
}
public ErrorCode bedClose(Long roomId, String bedNo) {
- BedQueueBO bedQueueBO = mapBedVsQueue.get(String.format("%09d%s", roomId, bedNo));
+ BedQueueBO bedQueueBO = mapBedVsQueue.get( Utils.formatRoomBed(roomId, bedNo) );
if (null == bedQueueBO) {
log.error("bedClose mapBedVsQueue DONOT existed. " + roomId + " " + bedNo);
return QUEUE_BED_NOT_EXIST;
@@ -118,11 +131,11 @@
// 闄や簡鍒ゆ柇 鍑嗗鍊欒瘖涓� 鐨勪汉鏁帮紝杩橀渶瑕� 鍒ゆ柇 杩囧彿鐨勪汉鏁�
//if (bedQueueBO.getQueueNum().get() >0)
// return QUEUE_HAVE_PATIENT;
- List<Byte> queueStatusList = new ArrayList<>();
+ List<Integer> queueStatusList = new ArrayList<>();
queueStatusList.add(QueueStatusEnum.READY.getStatus());
queueStatusList.add(QueueStatusEnum.PASSED.getStatus());
queueStatusList.add(QueueStatusEnum.RECALLED.getStatus());
- List<QueueDO> queueDOList = queueMapper.getDoctorQueueByStatus(roomId, bedNo, queueStatusList);
+ List<QueueDO> queueDOList = queueMapper.getBedQueueByStatus(roomId, bedNo, queueStatusList);
if (queueDOList.size() > 0)
return QUEUE_HAVE_PATIENT;
@@ -138,13 +151,13 @@
return ROOM_INVALID_STATUS;
}
- mapBedVsQueue.remove(String.format("%09d%s", roomId, bedNo));
+ mapBedVsQueue.remove( Utils.formatRoomBed(roomId, bedNo) );
removePriorityQueue(bedQueueBO);
return GlobalErrorCodeConstants.SUCCESS;
}
public ErrorCode bedDoctorPause(Long roomId, String bedNo, Long docId, String docName) {
- BedQueueBO bedQueueBO = mapBedVsQueue.get(String.format("%09d%s", roomId, bedNo));
+ BedQueueBO bedQueueBO = mapBedVsQueue.get( Utils.formatRoomBed(roomId, bedNo) );
if (null == bedQueueBO) {
log.error("bedDoctorPause mapBedVsQueue DONOT existed. " + roomId + " " + bedNo);
return QUEUE_BED_NOT_EXIST;
@@ -165,7 +178,7 @@
}
public ErrorCode bedDoctorResume(Long roomId, String bedNo, Long docId, String docName) {
- BedQueueBO bedQueueBO = mapBedVsQueue.get(String.format("%09d%s", roomId, bedNo));
+ BedQueueBO bedQueueBO = mapBedVsQueue.get( Utils.formatRoomBed(roomId, bedNo) );
if (null == bedQueueBO || !bedQueueBO.getStatus().equals(BedStatusEnum.PAUSE.getStatus())) {
log.error("bedDoctorResume mapBedVsQueue DONOT existed OR NOT Paused. " + roomId + " " + bedNo);
return QUEUE_BED_NOT_EXIST;
@@ -187,7 +200,7 @@
}
public ErrorCode bedDoctorOn(Long roomId, String bedNo, Long docId, String docName) {
- BedQueueBO bedQueueBO = mapBedVsQueue.get(String.format("%09d%s", roomId, bedNo));
+ BedQueueBO bedQueueBO = mapBedVsQueue.get( Utils.formatRoomBed(roomId, bedNo) );
if (null == bedQueueBO) {
log.error("bedDoctorOn mapBedVsQueue DONOT existed. " + roomId + " " + bedNo);
return QUEUE_BED_NOT_EXIST;
@@ -208,7 +221,7 @@
}
public ErrorCode bedDoctorOff(Long roomId, String bedNo, Long docId, String docName) {
- BedQueueBO bedQueueBO = mapBedVsQueue.get(String.format("%09d%s", roomId, bedNo));
+ BedQueueBO bedQueueBO = mapBedVsQueue.get( Utils.formatRoomBed( roomId, bedNo ) );
if (null == bedQueueBO) {
log.error("bedDoctorOff mapBedVsQueue DONOT existed. " + roomId + " " + bedNo);
return QUEUE_BED_NOT_EXIST;
@@ -230,20 +243,41 @@
return GlobalErrorCodeConstants.SUCCESS;
}
+ // 甯歌 鎴栬�� 棰嗙敤 鏃� 鍖荤敓 鍙栦笅涓�浣嶆偅鑰�
public ErrorCode nextPatient(Long roomId, String bedNo) {
- // 浠� DB 鎶� 搴忓彿鏈�灏忕殑 灏辫瘖鍑嗗涓殑浜� 璁剧疆涓哄氨璇婁腑
- Integer updateNum = queueMapper.updateQueueStatus(roomId, bedNo,
+ // 浠� DB 鎶婅宸ヤ綅.搴忓彿鏈�灏忕殑 [灏辫瘖鍑嗗涓璢 鐨勪汉 璁剧疆涓� [灏辫瘖涓璢 (鎴栭鐢ㄤ腑)
+ Integer updateNum = queueMapper.updateBedQueueStatus(roomId, bedNo,
QueueStatusEnum.READY.getStatus(), QueueStatusEnum.ONSTAGE.getStatus());
- // 璇ュ伐浣� 娌℃湁 灏辫瘖鍑嗗涓� 浜哄憳
+ // 璇ュ伐浣� 娌℃湁 [灏辫瘖鍑嗗涓璢 浜哄憳
if (null == updateNum || 0 == updateNum) {
return QUEUE_NOT_READY_PATIENT;
}
// 浼樺厛闃熷垪涓� 璇ュ伐浣� 灏辫瘖鍑嗗涓汉鐨勬暟閲� 鍑忎竴
- BedQueueBO bo = mapBedVsQueue.get(String.format("%09d%s", roomId, bedNo));
+ BedQueueBO bo = mapBedVsQueue.get( Utils.formatRoomBed( roomId, bedNo ) );
bo.queueNum.getAndDecrement(); // 鍙兘宸茬粡銆愬苟鍙戠殑銆戝湪 hurry-up 涓敼鍙樹簡鍊�
- removePriorityQueue(bo);
+ refreshPriorityQueue(bo);
+ return GlobalErrorCodeConstants.SUCCESS;
+ }
+
+ // 瑁呮満鏃� 鍖荤敓 鍙栦笅涓�浣嶆偅鑰�
+ public ErrorCode nextInstallPatient(Long roomId, String bedNo) {
+ // 浠� DB 鎶� 搴忓彿鏈�灏忕殑 [宸查鐢╙ 鐨勪汉 璁剧疆涓� [瀹夎涓璢
+ Integer updateNum = queueMapper.preemptToBeInstalledPatient(roomId, bedNo,
+ List.of(QueueStatusEnum.RECEIVED.getStatus(), QueueStatusEnum.RECALLED_INSTALL.getStatus()),
+ QueueStatusEnum.INSTALLING.getStatus());
+ // 璇ュ伐浣� 娌℃湁 [宸查鐢╙ 浜哄憳
+ if (null == updateNum || 0 == updateNum) {
+ return QUEUE_NOT_READY_PATIENT;
+ }
+
+ // 瑁呮満宸ヤ綅 鏃犱紭鍏堥槦鍒�
+ // 浼樺厛闃熷垪涓� 璇ュ伐浣� [宸查鐢╙浜虹殑鏁伴噺 鍑忎竴
+ //BedQueueBO bo = mapBedVsQueue.get( Utils.formatRoomBed( roomId, bedNo ) );
+ //bo.queueNum.getAndDecrement(); // 鍙兘宸茬粡銆愬苟鍙戠殑銆戝湪 hurry-up 涓敼鍙樹簡鍊�
+ //refreshPriorityQueue(bo);
+
return GlobalErrorCodeConstants.SUCCESS;
}
@@ -252,7 +286,7 @@
* 2. 鏈嶅姟杩愮淮閲嶅惎鏃�
*/
public ErrorCode bedReload() {
- mapCheckPriorityQueue.clear();
+ mapCheckTypePriorityQueue.clear();
mapBedVsQueue.clear();
// 娓呴櫎闈炲綋澶╃殑鎺掗槦浜哄憳
@@ -269,7 +303,7 @@
List<BedQueueBO> bedQueueBOList = roomDOList.stream().map(item -> BeanUtils.toBean(item, BedQueueBO.class)).toList();
// 浠嶥B 鑾峰彇 闃熷垪涓� 灏辫瘖鍑嗗涓汉鍛樼粺璁� 鍒楄〃
- List<Byte> queueStatusList = new ArrayList<>();
+ List<Integer> queueStatusList = new ArrayList<>();
queueStatusList.add(QueueStatusEnum.READY.getStatus());
List<QueueStatisticDO> queueStatisticDOList = queueMapper.queueStatistic(queueStatusList);
@@ -281,7 +315,7 @@
throw new RuntimeException("init: exceed max queue number!");
item.queueNum.set( queueNum );
- mapBedVsQueue.put(String.format("%09d%s", item.roomId, item.bedNo), item);
+ mapBedVsQueue.put( Utils.formatRoomBed(item.roomId, item.bedNo), item);
if (BedStatusEnum.DOCTOR_ON.getStatus() == item.getStatus()) {
addPriorityQueue(item);
}
@@ -332,7 +366,7 @@
bedQueueBO.getRoomName(),
bedQueueBO.getBedNo(),
curSeqNum.get() + 1,
- QueueStatusEnum.RECALLED.getStatus(),
+ QueueStatusEnum.RECALLED.getStatus(), // 涓嶉渶瑕佸鐞� [瀹夎鍙洖], 鍘熷洜: 瀹夎宸ヤ綅 娌℃湁浼樺厛闃熷垪
QueueStatusEnum.READY.getStatus());
if (null == updateNum || 0 == updateNum)
break;
@@ -353,7 +387,7 @@
public void hurryupOneCheckType(Integer checkType) {
- PriorityBlockingQueue<BedQueueBO> priorityQueue = mapCheckPriorityQueue.get(checkType);
+ PriorityBlockingQueue<BedQueueBO> priorityQueue = mapCheckTypePriorityQueue.get(checkType);
if (null == priorityQueue)
return;
@@ -370,7 +404,7 @@
return;
// 鏌ョ湅 鏄惁鏈夋帓闃熶腑鐨勬偅鑰�
- Integer updateNum = queueMapper.preemptPatient(
+ Integer updateNum = queueMapper.preemptWaitingPatient(
bedQueueBO.getRoomId(),
bedQueueBO.getRoomName(),
bedQueueBO.getBedNo(),
@@ -402,12 +436,13 @@
openingFlag.set(flag);
}
- public void setCheckTypeReadyMax(Map<Integer, Integer> max) {
- mapCheckTypeVsReadyMax = max;
+ public void initCheckType() {
+ List<CheckTypeDO> checkTypeDOList = checkTypeMapper.simpleCheckTypeList();
+ mapCheckTypeVsReadyMax = checkTypeDOList.stream().collect(Collectors.toMap(CheckTypeDO::getValue, checkType -> checkType));
}
public BedQueueBO getBedQueueBO(Long roomId, String bedNo) {
- return mapBedVsQueue.get(String.format("%09d%s", roomId, bedNo));
+ return mapBedVsQueue.get( Utils.formatRoomBed(roomId, bedNo) );
}
public MonitorInfoVO getMonitorInfo() {
@@ -429,7 +464,8 @@
Integer[] checkTypes = roomDO.getCheckTypes();
Integer ret = 0;
for (int i=0; i<checkTypes.length; i++) {
- Integer tmp = mapCheckTypeVsReadyMax.get(checkTypes[i]);
+ CheckTypeDO checkTypeDO = mapCheckTypeVsReadyMax.get(checkTypes[i]);
+ Integer tmp = checkTypeDO.getReadyNum();
ret = ret < tmp ? tmp : ret; //鍙栧ぇ鍊�
}
return ret;
@@ -438,7 +474,18 @@
private void addPriorityQueue(BedQueueBO bedQueueBO) {
Integer[] checkTypes = bedQueueBO.getCheckTypes();
Arrays.stream(checkTypes).forEach(checkType -> {
- PriorityBlockingQueue<BedQueueBO> priorityQueue = mapCheckPriorityQueue.get(checkType);
+ CheckTypeDO checkTypeDO = mapCheckTypeVsReadyMax.get(checkType);
+ // 瑁呮満宸ヤ綅 涓嶈繘 浼樺厛闃熷垪锛屼笉浠庢帓闃熶腑鎺ユ敹浜�
+ if (checkTypeDO.getNeedDevReady() == 1 && bedQueueBO.getOpType() == 2) {
+ return;
+ }
+
+ PriorityBlockingQueue<BedQueueBO> priorityQueue = mapCheckTypePriorityQueue.get(checkType);
+ if (null == priorityQueue) {
+ priorityQueue = new PriorityBlockingQueue<BedQueueBO>();
+ mapCheckTypePriorityQueue.put( checkType, priorityQueue );
+ }
+
if (!priorityQueue.contains(bedQueueBO)) {
priorityQueue.offer(bedQueueBO);
} else {
@@ -450,7 +497,7 @@
private void removePriorityQueue(BedQueueBO bedQueueBO) {
Integer[] checkTypes = bedQueueBO.getCheckTypes();
Arrays.stream(checkTypes).forEach(checkType -> {
- PriorityBlockingQueue<BedQueueBO> priorityBlockingQueue = mapCheckPriorityQueue.get(checkType);
+ PriorityBlockingQueue<BedQueueBO> priorityBlockingQueue = mapCheckTypePriorityQueue.get(checkType);
if (null != priorityBlockingQueue)
priorityBlockingQueue.remove(bedQueueBO);
});
@@ -459,7 +506,7 @@
private void refreshPriorityQueue(BedQueueBO bedQueueBO) {
Integer[] checkTypes = bedQueueBO.getCheckTypes();
Arrays.stream(checkTypes).forEach(checkType -> {
- PriorityBlockingQueue<BedQueueBO> priorityQueue = mapCheckPriorityQueue.get(checkType);
+ PriorityBlockingQueue<BedQueueBO> priorityQueue = mapCheckTypePriorityQueue.get(checkType);
priorityQueue.remove(bedQueueBO);
priorityQueue.offer(bedQueueBO);
});
@@ -467,58 +514,54 @@
private void roomBedStatistic(MonitorInfoVO monitorInfoVO) {
Map<Integer, Integer> mapOpeningCheckBedStatInfo = new HashMap<>();
- Map<Integer, Integer> mapOpeningReadyBedStatInfo = new HashMap<>();
+ Map<Integer, Integer> mapOpeningInstallBedStatInfo = new HashMap<>();
Map<Integer, Integer> mapOperatingCheckBedStatInfo = new HashMap<>();
- Map<Integer, Integer> mapOperatingReadyBedStatInfo = new HashMap<>();
+ Map<Integer, Integer> mapOperatingInstallBedStatInfo = new HashMap<>();
mapCheckTypeVsReadyMax.keySet().forEach( checkType -> {
mapOpeningCheckBedStatInfo.put(checkType, 0);
- mapOpeningReadyBedStatInfo.put(checkType, 0);
+ mapOpeningInstallBedStatInfo.put(checkType, 0);
mapOperatingCheckBedStatInfo.put(checkType, 0);
- mapOperatingReadyBedStatInfo.put(checkType, 0);
+ mapOperatingInstallBedStatInfo.put(checkType, 0);
});
- //寮�閫氱殑宸ヤ綅缁熻
+ //寮�閫氱殑 鍜� 杩愯惀涓� 鐨勫伐浣嶇粺璁�
mapBedVsQueue.values().forEach( bedQueueBO -> {
Integer[] checkTypes = bedQueueBO.getCheckTypes();
Arrays.stream(checkTypes).forEach(checkType -> {
- if (bedQueueBO.opType == 0)
+ if (bedQueueBO.opType == 0 || bedQueueBO.opType == 1)
mapOpeningCheckBedStatInfo.put(checkType, mapOpeningCheckBedStatInfo.get(checkType) + 1 );
else
- mapOpeningReadyBedStatInfo.put(checkType, mapOpeningReadyBedStatInfo.get(checkType) + 1 );
+ mapOpeningInstallBedStatInfo.put(checkType, mapOpeningInstallBedStatInfo.get(checkType) + 1 );
+
+ if (bedQueueBO.getStatus() == BedStatusEnum.DOCTOR_ON.getStatus()) {
+ if (bedQueueBO.opType == 0 || bedQueueBO.opType == 1)
+ mapOperatingCheckBedStatInfo.put(checkType, mapOperatingCheckBedStatInfo.get(checkType) + 1);
+ else
+ mapOperatingInstallBedStatInfo.put(checkType, mapOperatingInstallBedStatInfo.get(checkType) + 1);
+ }
});
});
- //杩愯惀涓伐浣嶇粺璁�
+ // 鎺ユ敹..鎺掗槦涓偅鑰�..鐨勪紭鍏堥槦鍒�
HashSet<BedQueueBO> hashSetOperatingBedQueue = new HashSet<>();
- mapCheckPriorityQueue.values().forEach(priorityQueue->{
- priorityQueue.stream().forEach(bedQueueBO -> hashSetOperatingBedQueue.add(bedQueueBO));
- });
- mapReadyPriorityQueue.values().forEach(priorityQueue->{
+ mapCheckTypePriorityQueue.values().forEach(priorityQueue->{
priorityQueue.stream().forEach(bedQueueBO -> hashSetOperatingBedQueue.add(bedQueueBO));
});
- hashSetOperatingBedQueue.stream().forEach( bedQueueBO -> {
- Integer[] checkTypes = bedQueueBO.getCheckTypes();
- Arrays.stream(checkTypes).forEach(checkType -> {
- if (bedQueueBO.opType == 0)
- mapOperatingCheckBedStatInfo.put(checkType, mapOperatingCheckBedStatInfo.get(checkType) + 1 );
- else
- mapOperatingReadyBedStatInfo.put(checkType, mapOperatingReadyBedStatInfo.get(checkType) + 1 );
- });
- });
Map<Integer, String> mapCheckTypeBedInfo = new HashMap<>();
mapCheckTypeVsReadyMax.keySet().forEach( checkType -> {
String str = mapOpeningCheckBedStatInfo.get(checkType) + " " +
- mapOpeningReadyBedStatInfo.get(checkType) + " " +
+ mapOpeningInstallBedStatInfo.get(checkType) + " " +
mapOperatingCheckBedStatInfo.get(checkType) + " " +
- mapOperatingReadyBedStatInfo.get(checkType) + " ";
+ mapOperatingInstallBedStatInfo.get(checkType) + " ";
mapCheckTypeBedInfo.put( checkType, str);
});
monitorInfoVO.setCheckTypeBedInfo(mapCheckTypeBedInfo);
monitorInfoVO.setQueueNum(mapBedVsQueue.size());
- monitorInfoVO.setActiveQueueNum(hashSetOperatingBedQueue.size());
+ monitorInfoVO.setActiveQueueNum((int) mapBedVsQueue.values().stream().filter(item -> item.getStatus() == BedStatusEnum.DOCTOR_ON.getStatus()).count());
+ monitorInfoVO.setPriorityQueueNum( hashSetOperatingBedQueue.size() );
}
}
--
Gitblit v1.9.3