From 1aecee3a44782899685bd2a098a16533f7a20846 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期一, 02 九月 2024 17:10:22 +0800
Subject: [PATCH] monitor info function
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/MonitorInfoVO.java | 10 ++++++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/RoomController.java | 11 ++++++-----
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueServiceImpl.java | 9 +++++++--
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomServiceImpl.java | 6 +++---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueService.java | 5 ++---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomService.java | 3 ++-
6 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/RoomController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/RoomController.java
index d5e8195..f511f68 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/RoomController.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/RoomController.java
@@ -7,6 +7,7 @@
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
+import cn.lihu.jh.module.ecg.controller.admin.room.vo.MonitorInfoVO;
import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO;
import cn.lihu.jh.module.ecg.service.queue.QueueService;
import org.springframework.web.bind.annotation.*;
@@ -164,11 +165,11 @@
return success("reset room ok");
}
- @GetMapping(value = {"/get-opening-flag"})
- @Operation(summary = "褰撳墠寮�璇婄姸鎬佽幏鍙�", description = "褰撳墠寮�璇婄姸鎬佽幏鍙� 鐩戞帶鐢�")
- public CommonResult<Integer> getOpeningFlag() {
- Integer openingFlag = roomService.getOpeningFlag();
- return success( openingFlag );
+ @GetMapping(value = {"/monitor"})
+ @Operation(summary = "鐩戞帶鐘舵�佽幏鍙�", description = "鐩戞帶鐘舵�佽幏鍙� 鐩戞帶鐢�")
+ public CommonResult<MonitorInfoVO> getMonitorInfo() {
+ MonitorInfoVO monitorInfoVO = roomService.getMonitorInfo();
+ return success( monitorInfoVO );
}
@GetMapping("/start-biz")
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/MonitorInfoVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/MonitorInfoVO.java
new file mode 100644
index 0000000..b2027b4
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/MonitorInfoVO.java
@@ -0,0 +1,10 @@
+package cn.lihu.jh.module.ecg.controller.admin.room.vo;
+
+import lombok.Data;
+
+@Data
+public class MonitorInfoVO {
+ private Integer queueNum;
+ private Integer activeQueueNum;
+ private Integer openingFlag;
+}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueService.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueService.java
index bcefbef..c671170 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueService.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueService.java
@@ -1,16 +1,15 @@
package cn.lihu.jh.module.ecg.service.queue;
-import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import cn.lihu.jh.framework.common.exception.ErrorCode;
import cn.lihu.jh.framework.common.pojo.CommonResult;
import cn.lihu.jh.module.ecg.controller.admin.queue.vo.*;
+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 cn.lihu.jh.framework.common.pojo.PageResult;
-import org.springframework.scheduling.config.ScheduledTaskRegistrar;
/**
* 鎺掗槦 Service 鎺ュ彛
@@ -51,7 +50,7 @@
*/
void startHurryUp();
void startBedReload();
- Integer getOpeningFlag();
+ MonitorInfoVO getMonitorInfo();
ErrorCode startBedOpen(Long roomId, String bedNo);
ErrorCode startBedClose(Long roomId, String bedNo);
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueServiceImpl.java
index 31ebc00..63ed788 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueServiceImpl.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueServiceImpl.java
@@ -5,6 +5,7 @@
import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.Resource;
+import cn.lihu.jh.module.ecg.controller.admin.room.vo.MonitorInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
@@ -227,8 +228,12 @@
}
@Override
- public Integer getOpeningFlag() {
- return openingFlag.get();
+ public MonitorInfoVO getMonitorInfo() {
+ MonitorInfoVO monitorInfoVO = new MonitorInfoVO();
+ monitorInfoVO.setOpeningFlag( openingFlag.get() );
+ monitorInfoVO.setQueueNum( mapBedVsQueue.size() );
+ monitorInfoVO.setActiveQueueNum( priorityQueue.size() );
+ return monitorInfoVO;
}
/**
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomService.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomService.java
index 89de2eb..15468ad 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomService.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomService.java
@@ -3,6 +3,7 @@
import java.util.*;
import javax.validation.Valid;
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.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.RoomDO;
@@ -60,6 +61,6 @@
void resetRoom();
- Integer getOpeningFlag();
+ MonitorInfoVO getMonitorInfo();
}
\ No newline at end of file
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 e4f8cb7..2c02c92 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
@@ -4,7 +4,7 @@
import javax.annotation.Resource;
import cn.lihu.jh.framework.common.pojo.PageResult;
-import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomRespVO;
+import cn.lihu.jh.module.ecg.controller.admin.room.vo.MonitorInfoVO;
import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO;
import cn.lihu.jh.module.ecg.service.queue.QueueService;
import cn.lihu.jh.module.system.api.oauth2.OAuth2TokenApi;
@@ -112,7 +112,7 @@
}
@Override
- public Integer getOpeningFlag() {
- return queueService.getOpeningFlag();
+ public MonitorInfoVO getMonitorInfo() {
+ return queueService.getMonitorInfo();
}
}
\ No newline at end of file
--
Gitblit v1.9.3