From cced6dcf0a6eb12712737806c46d8ef35d1c65ac Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期五, 25 十月 2024 17:35:41 +0800
Subject: [PATCH] update
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/RoomController.java | 28 ++++++++++++++++++++++------
1 files changed, 22 insertions(+), 6 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..15a95f0 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,11 +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;
@@ -78,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,15 +175,15 @@
@GetMapping(value = {"/reset-room"})
@Operation(summary = "閲嶇疆闂ㄨ瘖瀹�", description = "涓昏鐢ㄤ簬姣忓ぉ鍏抽棴宸ヤ綅")
public CommonResult<String> resetRoom() {
- roomService.resetRoom();
+ roomService.resetRoom(true);
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")
@@ -187,4 +202,5 @@
return success(0);
}
+
}
--
Gitblit v1.9.3