From c3783c7784cdaff229b6eba5cbcedcb47644698f Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期三, 14 八月 2024 22:32:22 +0800
Subject: [PATCH] update
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomPageReqVO.java | 3 +++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomSaveReqVO.java | 6 ++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/RoomController.java | 23 ++++++++++++++++++++++-
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java | 3 +++
sql/mysql/jh.sql | 1 +
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomRespVO.java | 4 ++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomServiceImpl.java | 5 +++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomService.java | 2 ++
8 files changed, 46 insertions(+), 1 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 16a608f..fe1f1d8 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
@@ -18,6 +18,7 @@
import java.util.*;
import java.io.IOException;
+import java.util.stream.Collectors;
import cn.lihu.jh.framework.common.pojo.PageParam;
import cn.lihu.jh.framework.common.pojo.PageResult;
@@ -133,4 +134,24 @@
return success(list3);
}
-}
\ No newline at end of file
+ @GetMapping(value = {"/list-all-bed"})
+ @Operation(summary = "鑾峰彇璇婂簥鍒楄〃", description = "涓昏鐢ㄤ簬鍓嶇鐨勫紑璇婄鐞�")
+ public CommonResult<Map<Long, List<RoomRespVO>>> getAllBedMap() {
+
+ RoomPageReqVO pageReqVO = new RoomPageReqVO();
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+ List<RoomDO> list = roomService.getRoomPage(pageReqVO).getList();
+
+ List<RoomRespVO> list2 = BeanUtils.toBean(list, RoomRespVO.class);
+
+ Map<Long, List<RoomRespVO>> map = list2.stream().collect(Collectors.groupingBy(RoomRespVO::getRoomId));
+ return success(map);
+ }
+
+ @GetMapping(value = {"/list-simple-room"})
+ @Operation(summary = "鑾峰彇闂ㄨ瘖瀹ゅ垪琛�", description = "涓昏鐢ㄤ簬鍓嶇鐨勮瘖瀹ら�夋嫨")
+ public CommonResult<List<RoomRespVO>> getSimpleRoomList() {
+ List<RoomDO> list = roomService.simpleRoomList();
+ return success(BeanUtils.toBean(list, RoomRespVO.class));
+ }
+}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomPageReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomPageReqVO.java
index ec2b93a..54431fa 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomPageReqVO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomPageReqVO.java
@@ -24,6 +24,9 @@
@Schema(description = "璇婄枟搴婄紪鍙�")
private String bedNo;
+ @Schema(description = "寮�璇婄姸鎬�")
+ private Boolean onstage;
+
@Schema(description = "鍒涘缓鏃堕棿")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomRespVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomRespVO.java
index 492994e..cb522f1 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomRespVO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomRespVO.java
@@ -28,6 +28,10 @@
@ExcelProperty("璇婄枟搴婄紪鍙�")
private String bedNo;
+ @Schema(description = "寮�璇婄姸鎬�", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("寮�璇婄姸鎬�")
+ private Boolean onstage;
+
@Schema(description = "鍒涘缓鏃堕棿", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("鍒涘缓鏃堕棿")
private LocalDateTime createTime;
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomSaveReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomSaveReqVO.java
index 9f4b412..03786de 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomSaveReqVO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomSaveReqVO.java
@@ -1,10 +1,12 @@
package cn.lihu.jh.module.ecg.controller.admin.room.vo;
+import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
import java.util.*;
@@ -26,4 +28,8 @@
@NotEmpty(message = "璇婄枟搴婄紪鍙蜂笉鑳戒负绌�")
private String bedNo;
+ @Schema(description = "寮�璇婄姸鎬�", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull
+ private Boolean onstage;
+
}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java
index 30b8852..f34d020 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java
@@ -31,4 +31,7 @@
@Select({ "SELECT room_id, count(1) as bed_num FROM lihu.clinic_room group by room_id;" })
List<RoomStatisticsDO> roomStatistic();
+ @Select({ "SELECT room_id, room_name FROM lihu.clinic_room group by room_id;" })
+ List<RoomDO> simpleRoomList();
+
}
\ 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/RoomService.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/room/RoomService.java
index 3ad2e45..24e2a19 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
@@ -56,4 +56,6 @@
PageResult<RoomDO> getRoomPage(RoomPageReqVO pageReqVO);
List<RoomStatisticsDO> roomStatistics();
+
+ List<RoomDO> simpleRoomList();
}
\ 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 eca84c3..72834a7 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
@@ -78,4 +78,9 @@
public List<RoomStatisticsDO> roomStatistics() {
return roomMapper.roomStatistic();
}
+
+ @Override
+ public List<RoomDO> simpleRoomList() {
+ return roomMapper.simpleRoomList();
+ }
}
\ No newline at end of file
diff --git a/sql/mysql/jh.sql b/sql/mysql/jh.sql
index 6dc166f..423790b 100644
--- a/sql/mysql/jh.sql
+++ b/sql/mysql/jh.sql
@@ -74,6 +74,7 @@
`room_id` BIGINT NOT NULL COMMENT '璇婂缂栧彿',
`room_name` varchar(10) NOT NULL COMMENT '璇婂鍚嶇О',
`bed_no` varchar(10) NOT NULL COMMENT '璇婄枟搴婄紪鍙�',
+ `onstage` bit(1) 1 COMMENT '寮�璇�',
`tenant_id` int NOT NULL COMMENT '绉熸埛缂栧彿',
`creator` varchar(10) DEFAULT '' COMMENT '鍒涘缓鑰�',
`create_time` datetime NOT NULL COMMENT '鍒涘缓鏃堕棿',
--
Gitblit v1.9.3