From ee09bfa0695d0d89015ad1a7348949539b16cc1b Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期三, 09 四月 2025 08:57:47 +0800
Subject: [PATCH] 诊间屏 数据  测试支持功能

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/callingscreen/CallingScreenController.java |    6 +++---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenService.java             |    4 ++--
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenServiceImpl.java         |   31 ++++++++++++++++++-------------
 3 files changed, 23 insertions(+), 18 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 44c62b3..965228c 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
@@ -61,12 +61,12 @@
     @GetMapping("/room-screen-data")
     @Operation(summary = "璇婇棿灞忔暟鎹�")
     @PermitAll
-    public CommonResult<Map<Integer, List<ScreenQueueRespVO>>> callingDataRoom(HttpServletRequest request)
+    public CommonResult<Map<Integer, List<ScreenQueueRespVO>>> callingDataRoom(HttpServletRequest request, @RequestParam(value = "roomId", required = false)Long roomId)
     {
         String reqIp = ServletUtil.getClientIP(request);
 
-        List<QueueDO> queueDOList1 = callingScreenService.getRoomCheckRelatedPatient(reqIp);
-        List<QueueDO> queueDOList2 = callingScreenService.getRoomInstallRelatedPatient(reqIp);
+        List<QueueDO> queueDOList1 = callingScreenService.getRoomCheckRelatedPatient(reqIp, roomId);
+        List<QueueDO> queueDOList2 = callingScreenService.getRoomInstallRelatedPatient(reqIp, roomId);
 
         Map<Integer, List<ScreenQueueRespVO>> mapVO = new HashMap<>();
         mapVO.put(1, BeanUtils.toBean(queueDOList1, ScreenQueueRespVO.class));
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 9cba6af..ca02f6b 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
@@ -17,6 +17,6 @@
     Map<Integer, List<String>> getDisplayColInfo();
     Map<Integer, List<QueueDO>> getBigScreenPatient();
 
-    List<QueueDO> getRoomCheckRelatedPatient(String ip);
-    List<QueueDO> getRoomInstallRelatedPatient(String ip);
+    List<QueueDO> getRoomCheckRelatedPatient(String ip, Long roomId);
+    List<QueueDO> getRoomInstallRelatedPatient(String ip, Long roomId);
 }
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 b914470..0a96990 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
@@ -125,14 +125,16 @@
     }
 
     @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>();
+    public List<QueueDO> getRoomCheckRelatedPatient(String ip, Long roomId) {
+        if (null == roomId) {
+            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>();
+            }
+            roomId = optionalQueueDO.get().getRoomId();
         }
 
-        Long roomId = optionalQueueDO.get().getRoomId();
         List<Integer> queueStatusList = new ArrayList<>();
         queueStatusList.add(QueueStatusEnum.RECALLED.getStatus());
         queueStatusList.add(QueueStatusEnum.READY.getStatus());
@@ -164,14 +166,17 @@
     }
 
     @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>();
-        }
+    public List<QueueDO> getRoomInstallRelatedPatient(String ip, Long roomId) {
+        if (null == roomId) {
+            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();
+            roomId = optionalQueueDO.get().getRoomId();
+        }
+        
         List<Integer> queueStatusList = new ArrayList<>();
         queueStatusList.add(QueueStatusEnum.RECEIVED.getStatus());
         queueStatusList.add(QueueStatusEnum.PASSED_INSTALL.getStatus());

--
Gitblit v1.9.3