From b39f9e15518fda74d33c9e3fbfb3818db5027093 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期一, 18 十一月 2024 10:00:56 +0800
Subject: [PATCH] 亲和-叫号处理

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java |   39 +++++++++++++++++++++++++++------------
 1 files changed, 27 insertions(+), 12 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 b214488..47bf81c 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
@@ -28,8 +28,7 @@
 import static cn.lihu.jh.framework.common.exception.enums.GlobalErrorCodeConstants.SUCCESS;
 import static cn.lihu.jh.framework.common.pojo.CommonResult.error;
 import static cn.lihu.jh.framework.common.pojo.CommonResult.success;
-import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.ECG_INNER_ERROR;
-import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.PATIENT_NOT_EXISTS;
+import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.*;
 
 @Tag(name = "绠$悊鍚庡彴 - 鍖荤敓鍙彿")
 @RestController
@@ -139,7 +138,9 @@
         List<QueueDO> queueDOList = queueService.getToBeCheckedPatient(roomId, bedNo);
 
         // 杩囨护鍑�  灏辫瘖涓殑锛屽噯澶囧彨鍙�
-        QueueDO onStageItem = queueDOList.stream().filter(item -> Objects.equals(item.getStatus(), QueueStatusEnum.ONSTAGE.getStatus())).findFirst().orElse(null);
+        QueueDO onStageItem = queueDOList.stream().filter(item ->
+                item.getStatus() == QueueStatusEnum.ONSTAGE.getStatus() && item.getAffinityItem() == 0
+        ).findFirst().orElse(null);
         if (null != onStageItem) {
             CallSaveReqVO callSaveReqVO = BeanUtils.toBean(onStageItem, CallSaveReqVO.class);
             callSaveReqVO.setId(null);
@@ -163,7 +164,9 @@
         List<QueueDO> queueDOList = queueService.getToBeCheckedPatient(roomId, bedNo);
 
         // 杩囨护鍑�  灏辫瘖涓殑锛屽噯澶囧彨鍙�
-        QueueDO onStageItem = queueDOList.stream().filter(item -> Objects.equals(item.getStatus(), QueueStatusEnum.ONSTAGE.getStatus())).findFirst().orElse(null);
+        QueueDO onStageItem = queueDOList.stream().filter(item ->
+                item.getStatus() == QueueStatusEnum.ONSTAGE.getStatus() && item.getAffinityItem() == 0
+        ).findFirst().orElse(null);
         if (null != onStageItem) {
             CallSaveReqVO callSaveReqVO = BeanUtils.toBean(onStageItem, CallSaveReqVO.class);
             callSaveReqVO.setId(null);
@@ -184,9 +187,11 @@
     {
         queueService.finishInstallNextPatient(roomId, bedNo);
 
-        List<QueueDO> queueDOList = queueService.getToBeInstalledPatient(roomId, bedNo);
+        List<QueueDO> queueDOList = queueService.getToBeInstalledPatient(roomId, bedNo); // 寰呭畨瑁呯殑鎮h��
 
-        List<QueueDO> installingQueueDOList = queueDOList.stream().filter(queueDO -> queueDO.getStatus() == QueueStatusEnum.INSTALLING.getStatus()).toList();
+        List<QueueDO> installingQueueDOList = queueDOList.stream().filter(queueDO ->
+                queueDO.getStatus() == QueueStatusEnum.INSTALLING.getStatus() && queueDO.getAffinityItem() == 0
+        ).toList();
         // 杩囨护鍑�  [瀹夎涓璢 鐨勶紝鍑嗗鍙彿   璇ュ伐浣嶅簲璇� 鏈�澶氬彧鏈変竴涓� [瀹夎涓璢
         if (installingQueueDOList.size() > 0) {
             QueueDO onStageItem = installingQueueDOList.getFirst();
@@ -259,7 +264,7 @@
             @RequestParam("roomId") Long roomId,
             @RequestParam("bedNo") String bedNo)
     {
-        List<Byte> queueStatusList = new ArrayList<>();
+        List<Integer> queueStatusList = new ArrayList<>();
         queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus());
         List<QueueDO> queueDOList = queueService.getBedQueueByStatus(roomId, bedNo, queueStatusList);
 
@@ -289,7 +294,7 @@
             @RequestParam("roomId") Long roomId,
             @RequestParam("bedNo") String bedNo)
     {
-        List<Byte> queueStatusList = new ArrayList<>();
+        List<Integer> queueStatusList = new ArrayList<>();
         queueStatusList.add(QueueStatusEnum.INSTALLING.getStatus());
         List<QueueDO> queueDOList = queueService.getBedQueueByStatus(roomId, bedNo, queueStatusList);
 
@@ -385,9 +390,12 @@
     public CommonResult<String> recallPatient(
             @RequestParam("roomId") Long roomId,
             @RequestParam("bedNo") String bedNo,
-            @RequestParam("patId") String patId )
+            @RequestParam("patId") String patId,
+            @RequestParam("checkType") Integer checkType,
+            @RequestParam("roomId_operator") Long roomId_operator,
+            @RequestParam("bedNo_operator") String bedNo_operator )
     {
-        Integer result = queueService.recallPatient(roomId, bedNo, patId);
+        Integer result = queueService.recallPatient(roomId, bedNo, patId, checkType);
         if (null == result || 0 == result)
             return error(PATIENT_NOT_EXISTS);
 
@@ -399,13 +407,20 @@
     @Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
     @Parameter(name = "bedNo", description = "宸ヤ綅缂栧彿", required = true, example = "B2")
     @Parameter(name = "patId", description = "鎮h�呯紪鍙�", required = true, example = "B2")
+    @Parameter(name = "checkType", description = "妫�鏌ョ被鍨�", required = true, example = "100")
     @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
     public CommonResult<String> recallInstallPatient(
             @RequestParam("roomId") Long roomId,
             @RequestParam("bedNo") String bedNo,
-            @RequestParam("patId") String patId )
+            @RequestParam("patId") String patId,
+            @RequestParam("checkType") Integer checkType,
+            @RequestParam("roomId_operator") Long roomId_operator,
+            @RequestParam("bedNo_operator") String bedNo_operator )
     {
-        Integer result = queueService.recallInstallPatient(roomId, bedNo, patId);
+        if (roomId != roomId_operator)
+            return error(QUEUE_RECALL_INSTALL_NOT_CUR_ROOM);
+
+        Integer result = queueService.recallInstallPatient(roomId, bedNo, patId, checkType, roomId_operator, bedNo_operator);
         if (null == result || 0 == result)
             return error(PATIENT_NOT_EXISTS);
 

--
Gitblit v1.9.3