From 7049a3710a5d38ac72303eae01704c1a82bc38bf Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期一, 02 九月 2024 16:01:03 +0800
Subject: [PATCH] 检测 当天预约

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/RoomController.java |   70 +++++++++++++++++++++++++----------
 1 files changed, 50 insertions(+), 20 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 c52395f..d5e8195 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
@@ -1,39 +1,35 @@
 package cn.lihu.jh.module.ecg.controller.admin.room;
 
-import cn.lihu.jh.framework.common.enums.CommonStatusEnum;
-import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomPageReqVO;
-import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomRespVO;
-import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomSaveReqVO;
-import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO;
-import cn.lihu.jh.module.ecg.service.room.RoomService;
-import cn.lihu.jh.module.system.api.dept.DeptApi;
-import cn.lihu.jh.module.system.api.dept.dto.DeptRespDTO;
-import org.springframework.web.bind.annotation.*;
+import java.util.*;
+import java.io.IOException;
+import java.util.stream.Collectors;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
 
+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.*;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.security.access.prepost.PreAuthorize;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.Operation;
 
-import java.util.*;
-import java.io.IOException;
-import java.util.stream.Collectors;
-
+import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomPageReqVO;
+import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomRespVO;
+import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomSaveReqVO;
+import cn.lihu.jh.module.ecg.service.room.RoomService;
+import cn.lihu.jh.module.system.api.dept.DeptApi;
+import cn.lihu.jh.module.system.api.dept.dto.DeptRespDTO;
 import cn.lihu.jh.framework.common.pojo.PageParam;
 import cn.lihu.jh.framework.common.pojo.PageResult;
 import cn.lihu.jh.framework.common.pojo.CommonResult;
 import cn.lihu.jh.framework.common.util.object.BeanUtils;
-import static cn.lihu.jh.framework.common.pojo.CommonResult.success;
-
 import cn.lihu.jh.framework.excel.core.util.ExcelUtils;
-
 import cn.lihu.jh.framework.apilog.core.annotation.ApiAccessLog;
 
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-import javax.validation.Valid;
-
+import static cn.lihu.jh.framework.common.pojo.CommonResult.success;
 import static cn.lihu.jh.framework.apilog.core.enums.OperateTypeEnum.*;
 
 
@@ -45,6 +41,9 @@
 
     @Resource
     private RoomService roomService;
+
+    @Resource
+    private QueueService queueService;
 
     @Resource
     private DeptApi deptApi;
@@ -157,4 +156,35 @@
         Map<String, List<RoomRespVO>> map = list2.stream().collect(Collectors.groupingBy(RoomRespVO::getRoomName));
         return success(map);
     }
+
+    @GetMapping(value = {"/reset-room"})
+    @Operation(summary = "閲嶇疆闂ㄨ瘖瀹�", description = "涓昏鐢ㄤ簬姣忓ぉ鍏抽棴宸ヤ綅")
+    public CommonResult<String> resetRoom() {
+        roomService.resetRoom();
+        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("/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