From 8cef5428fbeda836463463344eef4a5c5ef1cd3e Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期二, 08 四月 2025 09:59:05 +0800
Subject: [PATCH] 获取小屏显示患者列表
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/callingscreen/CallingScreenController.java | 21 ++--------
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenService.java | 3 +
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenServiceImpl.java | 78 +++++++++++++++++++++++++++++++++++++++
3 files changed, 85 insertions(+), 17 deletions(-)
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/callingscreen/CallingScreenController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/callingscreen/CallingScreenController.java
index 747faea..09d3508 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/callingscreen/CallingScreenController.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/callingscreen/CallingScreenController.java
@@ -78,25 +78,12 @@
{
String reqIp = ServletUtil.getClientIP(request);
- List<Integer> queueStatusList = new ArrayList<>();
- queueStatusList.add(QueueStatusEnum.RECALLED.getStatus());
- queueStatusList.add(QueueStatusEnum.RECALLED_INSTALL.getStatus());
- queueStatusList.add(QueueStatusEnum.READY.getStatus());
- queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus());
- queueStatusList.add(QueueStatusEnum.RECEIVED.getStatus());
- queueStatusList.add(QueueStatusEnum.INSTALLING.getStatus());
- queueStatusList.add(QueueStatusEnum.PASSED.getStatus());
- queueStatusList.add(QueueStatusEnum.PASSED_INSTALL.getStatus());
- queueStatusList.add(QueueStatusEnum.AFFINITY.getStatus());
- queueStatusList.add(QueueStatusEnum.AFFINITY_INSTALL.getStatus());
- List<QueueDO> queueDOList = callingScreenService.getRoomQueue(reqIp, queueStatusList);
-
-// List<QueueDO> passedList = queueDOList.stream().filter(queue -> queue.getStatus() == QueueStatusEnum.PASSED.getStatus() || queue.getStatus() == QueueStatusEnum.PASSED_INSTALL.getStatus()).toList();
-// queueDOList.removeIf(queue -> queue.getStatus() == QueueStatusEnum.PASSED.getStatus());
+ List<QueueDO> queueDOList1 = callingScreenService.getRoomCheckRelatedPatient(reqIp);
+ List<QueueDO> queueDOList2 = callingScreenService.getRoomInstallRelatedPatient(reqIp);
Map<Integer, List<ScreenQueueRespVO>> mapVO = new HashMap<>();
- mapVO.put(1, BeanUtils.toBean(queueDOList, ScreenQueueRespVO.class));
-// mapVO.put(2, BeanUtils.toBean(passedList, ScreenQueueRespVO.class));
+ mapVO.put(1, BeanUtils.toBean(queueDOList1, ScreenQueueRespVO.class));
+ mapVO.put(2, BeanUtils.toBean(queueDOList2, ScreenQueueRespVO.class));
return success( mapVO );
}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenService.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenService.java
index 7d89798..a270588 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenService.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenService.java
@@ -28,4 +28,7 @@
Map<Integer, List<QueueDO>> callingData2();
List<QueueDO> getRoomQueue(String ip, List<Integer> statusList);
+
+ List<QueueDO> getRoomCheckRelatedPatient(String ip);
+ List<QueueDO> getRoomInstallRelatedPatient(String ip);
}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenServiceImpl.java
index d50fcdf..db9a436 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenServiceImpl.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenServiceImpl.java
@@ -171,6 +171,84 @@
return queueDOList;
}
+ @Override
+ public List<QueueDO> getRoomCheckRelatedPatient(String ip) {
+ List<RoomDO> roomDOList = roomMapper.queueByIp(ip);
+ Optional<RoomDO> optionalQueueDO = roomDOList.stream().filter(item -> StringUtils.hasLength(item.getIp())).findFirst();
+ if (!optionalQueueDO.isPresent()) {
+ return new ArrayList<QueueDO>();
+ }
+
+ Long roomId = optionalQueueDO.get().getRoomId();
+ List<Integer> queueStatusList = new ArrayList<>();
+ queueStatusList.add(QueueStatusEnum.RECALLED.getStatus());
+ queueStatusList.add(QueueStatusEnum.READY.getStatus());
+ queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus());
+ queueStatusList.add(QueueStatusEnum.PASSED.getStatus());
+ queueStatusList.add(QueueStatusEnum.AFFINITY.getStatus());
+ List<QueueDO> queueDOList = queueMapper.getRoomQueueByStatus(roomId, queueStatusList);
+
+ //鎶� [浜插拰鐨刔 鎸埌涓婚」鍚庨潰
+ List<QueueDO> affinityWaitingList = new ArrayList<>();
+ ListIterator<QueueDO> iterator = queueDOList.listIterator();
+ while (iterator.hasNext()) {
+ QueueDO item = iterator.next();
+ if (item.getStatus() == QueueStatusEnum.AFFINITY.getStatus()) {
+ iterator.remove();
+ affinityWaitingList.add(item);
+ }
+ }
+ affinityWaitingList.forEach( affinityWaitingItem -> {
+ for (int i = queueDOList.size()-1; i >= 0; i--) {
+ if ( affinityWaitingItem.getSeqNum() == queueDOList.get(i).getSeqNum() ) {
+ queueDOList.add(i + 1, affinityWaitingItem);
+ break;
+ }
+ }
+ });
+
+ return queueDOList;
+ }
+
+ @Override
+ public List<QueueDO> getRoomInstallRelatedPatient(String ip) {
+ List<RoomDO> roomDOList = roomMapper.queueByIp(ip);
+ Optional<RoomDO> optionalQueueDO = roomDOList.stream().filter(item -> StringUtils.hasLength(item.getIp())).findFirst();
+ if (!optionalQueueDO.isPresent()) {
+ return new ArrayList<QueueDO>();
+ }
+
+ Long roomId = optionalQueueDO.get().getRoomId();
+ List<Integer> queueStatusList = new ArrayList<>();
+ queueStatusList.add(QueueStatusEnum.RECEIVED.getStatus());
+ queueStatusList.add(QueueStatusEnum.PASSED_INSTALL.getStatus());
+ queueStatusList.add(QueueStatusEnum.AFFINITY_INSTALL.getStatus());
+ queueStatusList.add(QueueStatusEnum.INSTALLING.getStatus());
+ queueStatusList.add(QueueStatusEnum.RECALLED_INSTALL.getStatus());
+ List<QueueDO> queueDOList = queueMapper.getRoomQueueByStatus(roomId, queueStatusList);
+
+ //鎶� [浜插拰鐨刔 鎸埌涓婚」鍚庨潰
+ List<QueueDO> affinityReceivedList = new ArrayList<>();
+ ListIterator<QueueDO> iterator = queueDOList.listIterator();
+ while (iterator.hasNext()) {
+ QueueDO item = iterator.next();
+ if (item.getStatus() == QueueStatusEnum.AFFINITY_INSTALL.getStatus()) {
+ iterator.remove();
+ affinityReceivedList.add(item);
+ }
+ }
+ affinityReceivedList.forEach( affinityReceivedItem -> {
+ for (int i = queueDOList.size()-1; i >= 0; i--) {
+ if ( affinityReceivedItem.getSeqNum() == queueDOList.get(i).getSeqNum() ) {
+ queueDOList.add(i + 1, affinityReceivedItem);
+ break;
+ }
+ }
+ });
+
+ return queueDOList;
+ }
+
private Integer getDisplatSlotByQueueStatus( Integer queueStatus ) {
if (QueueStatusEnum.READY.getStatus() == queueStatus)
return 0;
--
Gitblit v1.9.3