From b765c3a93685c4c97601aff6291a00ec770a537e Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期三, 04 九月 2024 18:19:35 +0800
Subject: [PATCH] 诊间屏
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/RoomController.java | 43 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 43 insertions(+), 0 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 483972c..ce78549 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
@@ -4,10 +4,17 @@
import java.io.IOException;
import java.util.stream.Collectors;
import javax.annotation.Resource;
+import javax.annotation.security.PermitAll;
+import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
+import cn.hutool.extra.servlet.ServletUtil;
+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.service.queue.QueueService;
+import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -42,6 +49,9 @@
private RoomService roomService;
@Resource
+ private QueueService queueService;
+
+ @Resource
private DeptApi deptApi;
@PostMapping("/create")
@@ -74,6 +84,15 @@
@PreAuthorize("@ss.hasPermission('clinic:room:query')")
public CommonResult<RoomRespVO> getRoom(@RequestParam("id") Integer id) {
RoomDO room = roomService.getRoom(id);
+ return success(BeanUtils.toBean(room, RoomRespVO.class));
+ }
+
+ @GetMapping("/get-room-by-ip")
+ @Operation(summary = "鑾峰緱璇婂鍜岃瘖鐤楀簥")
+ @PermitAll
+ public CommonResult<RoomRespVO> getRoomByIP(HttpServletRequest request) {
+ String reqIp = ServletUtil.getClientIP(request);
+ RoomDO room = roomService.getRoomByIP(reqIp);
return success(BeanUtils.toBean(room, RoomRespVO.class));
}
@@ -160,4 +179,28 @@
return success("reset room ok");
}
+ @GetMapping(value = {"/monitor"})
+ @Operation(summary = "鐩戞帶鐘舵�佽幏鍙�", description = "鐩戞帶鐘舵�佽幏鍙� 鐩戞帶鐢�")
+ public CommonResult<MonitorInfoVO> getMonitorInfo() {
+ MonitorInfoVO monitorInfoVO = roomService.getMonitorInfo();
+ return success( monitorInfoVO );
+ }
+
+ @GetMapping("/start-biz")
+ @Operation(summary = "鎵嬪姩寮�璇�")
+ @PreAuthorize("@ss.hasPermission('ecg:room:setting')")
+ public CommonResult<Integer> startBiz() {
+ queueService.startBiz();
+ return success(0);
+ }
+
+ @GetMapping("/close-biz")
+ @Operation(summary = "鎵嬪姩闂瘖")
+ @PreAuthorize("@ss.hasPermission('ecg:room:setting')")
+ public CommonResult<Integer> stopBiz() {
+ queueService.closeBiz();
+ return success(0);
+ }
+
+
}
--
Gitblit v1.9.3