From 14f87cf04b519fd33ef6f76ea5e2926f30fab419 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期三, 18 十二月 2024 16:22:13 +0800
Subject: [PATCH] 设备管理: 更改设置状态时 允许同时更新备注
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/RoomController.java | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 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 f511f68..fe94bf3 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,12 +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;
@@ -82,6 +87,15 @@
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));
+ }
+
@GetMapping("/page")
@Operation(summary = "鑾峰緱璇婂鍜岃瘖鐤楀簥鍒嗛〉")
@PreAuthorize("@ss.hasPermission('clinic:room:query')")
@@ -150,18 +164,18 @@
@GetMapping(value = {"/list-simple-room"})
@Operation(summary = "鑾峰彇闂ㄨ瘖瀹ゅ垪琛�", description = "涓昏鐢ㄤ簬鍓嶇鐨勮瘖瀹ら�夋嫨")
- public CommonResult<Map<String, List<RoomRespVO>>> getSimpleRoomList() {
+ public CommonResult<Map<Long, List<RoomRespVO>>> getSimpleRoomList() {
List<RoomDO> list = roomService.simpleRoomList();
List<RoomRespVO> list2 = BeanUtils.toBean(list, RoomRespVO.class);
- Map<String, List<RoomRespVO>> map = list2.stream().collect(Collectors.groupingBy(RoomRespVO::getRoomName));
+ Map<Long, List<RoomRespVO>> map = list2.stream().collect(Collectors.groupingBy(RoomRespVO::getRoomId));
return success(map);
}
@GetMapping(value = {"/reset-room"})
@Operation(summary = "閲嶇疆闂ㄨ瘖瀹�", description = "涓昏鐢ㄤ簬姣忓ぉ鍏抽棴宸ヤ綅")
public CommonResult<String> resetRoom() {
- roomService.resetRoom();
+ roomService.resetRoom(true);
return success("reset room ok");
}
@@ -188,4 +202,5 @@
return success(0);
}
+
}
--
Gitblit v1.9.3