From 003513b047fcae16e2125ff7a59e6d46ad048ce4 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期四, 16 十月 2025 18:03:36 +0800
Subject: [PATCH] 代码提交
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomServiceImpl.java | 76 +++++++++++++++++++++++++++++--------
1 files changed, 59 insertions(+), 17 deletions(-)
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomServiceImpl.java
index 398650b..532d6de 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomServiceImpl.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomServiceImpl.java
@@ -5,17 +5,16 @@
import cn.lihu.jh.framework.common.pojo.PageResult;
import cn.lihu.jh.module.ecg.controller.admin.room.vo.MonitorInfoVO;
-import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO;
import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO;
+import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomProfile;
+import cn.lihu.jh.module.ecg.enums.RoomCallingScreenEnum;
import cn.lihu.jh.module.ecg.service.queue.QueueService;
import cn.lihu.jh.module.system.api.oauth2.OAuth2TokenApi;
import org.springframework.stereotype.Service;
-import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomPageReqVO;
import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomSaveReqVO;
-import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomStatisticsDO;
import cn.lihu.jh.module.ecg.dal.mysql.room.RoomMapper;
import cn.lihu.jh.module.ecg.enums.BedStatusEnum;
import cn.lihu.jh.framework.common.util.object.BeanUtils;
@@ -79,14 +78,62 @@
}
@Override
- public RoomDO getRoomByIP(String ip) {
- List<RoomDO> roomDOList = roomMapper.queueByIp(ip);
- Optional<RoomDO> optionalQueueDO = roomDOList.stream().filter(item -> StringUtils.hasLength(item.getIp())).findFirst();
- if (!optionalQueueDO.isPresent()) {
- return null;
+ public RoomProfile getRoomByIP(String ip, Long roomId) {
+ List<RoomDO> roomDOList = null;
+ if (null != roomId) {
+ roomDOList = roomMapper.selectList(RoomDO::getRoomId, roomId);
+ } else {
+ roomDOList = roomMapper.queueByIp(ip);
}
- return optionalQueueDO.get();
+ RoomProfile roomProfile = new RoomProfile();
+ roomProfile.setBedNum( 0 );
+ roomProfile.setCallingScreenType( RoomCallingScreenEnum.NONE.getCallingScreenType() );
+
+ for (RoomDO roomDO : roomDOList) {
+ roomProfile.setRoomId(roomDO.getRoomId());
+ roomProfile.setRoomName(roomDO.getRoomName());
+ roomProfile.setBedNum( roomProfile.getBedNum() + 1);
+
+ // 0 妫�鏌� 1 棰嗙敤 2 瑁呮満
+
+ // 璁$畻 璇婇棿灞忕被鍨�
+ if (roomProfile.getCallingScreenType() == RoomCallingScreenEnum.NONE.getCallingScreenType()) {
+ if ( roomDO.getOpType() == 0 ) {
+ roomProfile.setCallingScreenType(RoomCallingScreenEnum.CHECK_ONLY.getCallingScreenType());
+ } else if ( roomDO.getOpType() == 1 ) {
+ roomProfile.setCallingScreenType( RoomCallingScreenEnum.RECEIVE_ONLY.getCallingScreenType());
+ } else if ( roomDO.getOpType() == 2 ) {
+ roomProfile.setCallingScreenType( RoomCallingScreenEnum.INSTALL_ONLY.getCallingScreenType());
+ }
+ } else if (roomProfile.getCallingScreenType() == RoomCallingScreenEnum.CHECK_ONLY.getCallingScreenType()) {
+ if ( roomDO.getOpType() == 0 || roomDO.getOpType() == 1 ) {
+ // do nothing
+ } else if ( roomDO.getOpType() == 2 ) {
+ roomProfile.setCallingScreenType( RoomCallingScreenEnum.CHECK_INSTALL.getCallingScreenType());
+ }
+ } else if (roomProfile.getCallingScreenType() == RoomCallingScreenEnum.RECEIVE_ONLY.getCallingScreenType()) {
+ if ( roomDO.getOpType() == 0 || roomDO.getOpType() == 1 ) {
+ // do nothing
+ } else if ( roomDO.getOpType() == 2 ) {
+ roomProfile.setCallingScreenType( RoomCallingScreenEnum.RECEIVE_INSTALL.getCallingScreenType());
+ }
+ } else if (roomProfile.getCallingScreenType() == RoomCallingScreenEnum.INSTALL_ONLY.getCallingScreenType()) {
+ if ( roomDO.getOpType() == 0 ) {
+ roomProfile.setCallingScreenType( RoomCallingScreenEnum.CHECK_INSTALL.getCallingScreenType());
+ } else if ( roomDO.getOpType() == 1 ) {
+ roomProfile.setCallingScreenType( RoomCallingScreenEnum.RECEIVE_INSTALL.getCallingScreenType());
+ } else if ( roomDO.getOpType() == 2 ) {
+ // do nothing
+ }
+ } else if (roomProfile.getCallingScreenType() == RoomCallingScreenEnum.RECEIVE_INSTALL.getCallingScreenType()) {
+ // do nothing
+ } else if (roomProfile.getCallingScreenType() == RoomCallingScreenEnum.CHECK_INSTALL.getCallingScreenType()) {
+ // do nothing
+ }
+ }
+
+ return roomProfile;
}
@Override
@@ -95,22 +142,17 @@
}
@Override
- public List<RoomStatisticsDO> roomStatistics() {
- return roomMapper.roomStatistic();
- }
-
- @Override
public List<RoomDO> simpleRoomList() {
List<BedStatusEnum> bedStatusEnumList = new ArrayList<BedStatusEnum>();
bedStatusEnumList.add(BedStatusEnum.OPENING);
bedStatusEnumList.add(BedStatusEnum.DOCTOR_ON);
- bedStatusEnumList.add(BedStatusEnum.PAUSE);
+ bedStatusEnumList.add(BedStatusEnum.DOCTOR_PAUSE);
return roomMapper.simpleRoomList(bedStatusEnumList);
}
@Override
- public void resetRoom() {
- queueService.startResetRoom();
+ public void resetRoom(Boolean needCloseBed) {
+ queueService.startResetRoom(needCloseBed);
}
@Override
--
Gitblit v1.9.3