From ef86458242721792b2f181183811904eddfb8ef5 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期二, 08 四月 2025 11:44:38 +0800
Subject: [PATCH] 大屏显示患者 实现调整
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/callingscreen/CallingScreenController.java | 10 ---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/QueueMapper.java | 2
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenService.java | 14 ----
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenServiceImpl.java | 106 +++--------------------------------
4 files changed, 12 insertions(+), 120 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 2e90bad..6e8abc4 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
@@ -2,15 +2,9 @@
import cn.hutool.extra.servlet.ServletUtil;
import cn.lihu.jh.framework.common.pojo.CommonResult;
-import cn.lihu.jh.framework.common.pojo.PageResult;
import cn.lihu.jh.framework.common.util.object.BeanUtils;
-import cn.lihu.jh.module.ecg.controller.admin.checktype.vo.CheckTypePageReqVO;
-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.enums.QueueStatusEnum;
import cn.lihu.jh.module.ecg.service.callingscreen.CallingScreenService;
-import cn.lihu.jh.module.ecg.service.checktype.CheckTypeService;
-import cn.lihu.jh.module.ecg.service.config.EcgConfigService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
@@ -20,11 +14,9 @@
import javax.annotation.Resource;
import javax.annotation.security.PermitAll;
import javax.servlet.http.HttpServletRequest;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.stream.Collectors;
import static cn.lihu.jh.framework.common.pojo.CommonResult.error;
import static cn.lihu.jh.framework.common.pojo.CommonResult.success;
@@ -53,7 +45,7 @@
@PermitAll
public CommonResult<Map<Integer, Map<Integer, List<ScreenQueueRespVO>>>> callingData()
{
- Map<Integer, Map<Integer, List<QueueDO>>> map = callingScreenService.callingData();
+ Map<Integer, Map<Integer, List<QueueDO>>> map = callingScreenService.getBigScreenPatient();
Map<Integer, Map<Integer, List<ScreenQueueRespVO>>> mapVO = new HashMap<>();
map.keySet().forEach( displayCol -> {
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/QueueMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/QueueMapper.java
index a037c4f..9b42c14 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/QueueMapper.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/QueueMapper.java
@@ -61,7 +61,7 @@
" <foreach collection='statusList' separator=',' item='status'>" +
" #{status} " +
" </foreach> )" +
- " order by status desc, seq_num" +
+ " order by status desc, seq_num, book_timeslot" +
"</script>")
List<QueueDO> getQueueByStatus( @Param("statusList")List<Integer> statusList);
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 a270588..9cba6af 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
@@ -1,16 +1,7 @@
package cn.lihu.jh.module.ecg.service.callingscreen;
-import cn.lihu.jh.framework.common.exception.ErrorCode;
-import cn.lihu.jh.framework.common.pojo.CommonResult;
-import cn.lihu.jh.framework.common.pojo.PageResult;
-import cn.lihu.jh.module.ecg.controller.admin.queue.vo.PatientStatisticVO;
-import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueuePageReqVO;
-import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueueSaveReqVO;
-import cn.lihu.jh.module.ecg.controller.admin.room.vo.MonitorInfoVO;
-import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomRespVO;
import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO;
-import javax.validation.Valid;
import java.util.List;
import java.util.Map;
@@ -24,10 +15,7 @@
void setBigScreenConfig(BigScreenConfig bigScreenConfig);
Map<Integer, List<String>> getDisplayColInfo();
- Map<Integer, Map<Integer, List<QueueDO>>> callingData();
- Map<Integer, List<QueueDO>> callingData2();
-
- List<QueueDO> getRoomQueue(String ip, List<Integer> statusList);
+ Map<Integer, List<QueueDO>> getBigScreenPatient();
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 6a9acd0..e152f46 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
@@ -76,20 +76,15 @@
* 涓嶄細鏈夊畨瑁呯浉鍏崇殑鎮h�呬俊鎭�
*/
@Override
- public Map<Integer, Map<Integer, List<QueueDO>>> callingData() {
- Map<Integer, Map<Integer, List<QueueDO>>> mapDisplayColQueue = new HashMap<>();
+ public Map<Integer, List<QueueDO>> getBigScreenPatient() {
+ Map<Integer, List<QueueDO>> mapDisplayColQueue = new HashMap<>();
int displayColCnt = (int) mapCheckTypeVsDisplayColumn.values().stream().distinct().count();
for (int dispCol=0; dispCol<displayColCnt; dispCol++) {
- Map<Integer, List<QueueDO>> mapSoltQueueData = new HashMap<>();
- mapSoltQueueData.put(0, new ArrayList<>());
- mapSoltQueueData.put(1, new ArrayList<>());
- mapSoltQueueData.put(2, new ArrayList<>());
- mapDisplayColQueue.put(dispCol, mapSoltQueueData);
+ List<QueueDO> columnQueueData = new ArrayList<>();
+ mapDisplayColQueue.put(dispCol, columnQueueData);
}
- mapDisplayColQueue.values().stream().forEach(mapSlotQueue -> {
- mapSlotQueue.values().stream().forEach(queueList -> queueList.clear());
- });
+ mapDisplayColQueue.values().forEach(List::clear);
List<Integer> queueStatusList = new ArrayList<>();
queueStatusList.add(QueueStatusEnum.READY.getStatus());
@@ -97,83 +92,15 @@
queueStatusList.add(QueueStatusEnum.WAITING.getStatus());
queueStatusList.add(QueueStatusEnum.RECALLED.getStatus());
queueStatusList.add(QueueStatusEnum.PASSED.getStatus());
+ queueStatusList.add(QueueStatusEnum.PASSED_WAITING.getStatus());
queueStatusList.add(QueueStatusEnum.AFFINITY.getStatus());
List<QueueDO> queueDOList = queueMapper.getQueueByStatus( queueStatusList );
- queueDOList.stream().forEach(queueDO -> {
- Map<Integer, List<QueueDO>> mapSlotQueue = mapDisplayColQueue.get(mapCheckTypeVsDisplayColumn.get(queueDO.getBookCheckType()));
- List<QueueDO> soltList = mapSlotQueue.get(getDisplatSlotByQueueStatus(queueDO.getStatus()));
- soltList.add( queueDO );
+ queueDOList.forEach(queueDO -> {
+ List<QueueDO> columnQueueData = mapDisplayColQueue.get(mapCheckTypeVsDisplayColumn.get(queueDO.getBookCheckType()));
+ columnQueueData.add( queueDO );
});
- mapDisplayColQueue.values().stream().forEach(mapSoltQueue -> mapSoltQueue.values().stream().forEach(
- slotQueueList -> slotQueueList.sort((o1, o2) -> {
- if (null == o1.getSeqNum() && null == o2.getSeqNum()) {
- return o1.getBookTimeslot() - o2.getBookTimeslot();
- } else if (null != o1.getSeqNum() && null != o2.getSeqNum()) {
- return o1.getSeqNum() - o2.getSeqNum();
- } else if (null == o1.getSeqNum()) {
- return 1;
- } else { //杩欓噷 蹇呭畾 null == o2.getSeqNum()
- return -1;
- }
- })));
return mapDisplayColQueue;
- }
-
- @Override
- public Map<Integer, List<QueueDO>> callingData2() {
- List<Integer> queueStatusList = new ArrayList<>();
- queueStatusList.add(QueueStatusEnum.READY.getStatus());
- queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus());
- List<QueueDO> listReady = queueMapper.getQueueByStatus( queueStatusList );
-
- queueStatusList.clear();
- queueStatusList.add(QueueStatusEnum.WAITING.getStatus());
- queueStatusList.add(QueueStatusEnum.RECALLED.getStatus());
- List<QueueDO> listWaiting = queueMapper.getPartialQueueByStatus( queueStatusList, waitingFrom, bigScreenConfig.waitingSize );
- if (listWaiting.size() < bigScreenConfig.waitingSize && waitingFrom != 0) {
- List<QueueDO> listWaiting_next = queueMapper.getPartialQueueByStatus( queueStatusList, 0, bigScreenConfig.waitingSize - listWaiting.size());
- listWaiting.addAll(listWaiting_next);
- }
- if (listWaiting.size() < bigScreenConfig.waitingSize) {
- waitingFrom = 0;
- } else {
- waitingFrom = listWaiting.getLast().getId() + 1;
- }
-
- queueStatusList.clear();
- queueStatusList.add(QueueStatusEnum.PASSED.getStatus());
- List<QueueDO> listPassed = queueMapper.getPartialQueueByStatus( queueStatusList, passedFrom, bigScreenConfig.passedSize );
- if (listPassed.size() < bigScreenConfig.passedSize && passedFrom != 0) {
- List<QueueDO> listPassed_next = queueMapper.getPartialQueueByStatus( queueStatusList, 0, bigScreenConfig.passedSize - listPassed.size());
- listPassed.addAll(listPassed_next);
- }
- if (listPassed.size() < bigScreenConfig.passedSize) {
- passedFrom = 0;
- } else {
- passedFrom = listPassed.getLast().getId();
- }
-
- log.info( " waitingFrom: {} passedFrom: {} ", waitingFrom, passedFrom);
-
- Map<Integer, List<QueueDO>> map = new HashMap<>();
- map.put(1, listReady);
- map.put(2, listWaiting);
- map.put(3, listPassed);
- return map;
- }
-
- @Override
- public List<QueueDO> getRoomQueue(String ip, List<Integer> statusList) {
- 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<QueueDO> queueDOList = queueMapper.getRoomQueueByStatus(roomId, statusList);
- return queueDOList;
}
@Override
@@ -252,21 +179,6 @@
});
return queueDOList;
- }
-
- private Integer getDisplatSlotByQueueStatus( Integer queueStatus ) {
- if (QueueStatusEnum.READY.getStatus() == queueStatus)
- return 0;
- else if (QueueStatusEnum.ONSTAGE.getStatus() == queueStatus)
- return 0;
- else if (QueueStatusEnum.WAITING.getStatus() == queueStatus)
- return 1;
- else if (QueueStatusEnum.RECALLED.getStatus() == queueStatus)
- return 1;
- else if (QueueStatusEnum.PASSED.getStatus() == queueStatus)
- return 2;
- else
- return 0;
}
}
--
Gitblit v1.9.3