From 02856700ce4cc57cf9447134a9f0c6860d85b802 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期三, 11 九月 2024 10:19:01 +0800
Subject: [PATCH] 拆机功能
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java | 190 +++++++++++++++++++++++++++++++++++++++-------
1 files changed, 159 insertions(+), 31 deletions(-)
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java
index 3caf902..daa8274 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java
@@ -1,14 +1,12 @@
package cn.lihu.jh.module.ecg.controller.admin.doctor;
-import cn.lihu.jh.framework.apilog.core.annotation.ApiAccessLog;
+import cn.lihu.jh.framework.common.exception.ErrorCode;
import cn.lihu.jh.framework.common.pojo.CommonResult;
-import cn.lihu.jh.framework.common.pojo.PageParam;
-import cn.lihu.jh.framework.common.pojo.PageResult;
import cn.lihu.jh.framework.common.util.object.BeanUtils;
-import cn.lihu.jh.framework.excel.core.util.ExcelUtils;
-import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueuePageReqVO;
+import cn.lihu.jh.framework.security.core.util.SecurityFrameworkUtils;
+import cn.lihu.jh.module.ecg.controller.admin.queue.vo.PatientStatisticVO;
import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueueRespVO;
-import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueueSaveReqVO;
+import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomRespVO;
import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO;
import cn.lihu.jh.module.ecg.enums.QueueStatusEnum;
import cn.lihu.jh.module.ecg.service.queue.QueueService;
@@ -20,13 +18,11 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-import javax.validation.Valid;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-import static cn.lihu.jh.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
+import static cn.lihu.jh.framework.common.exception.enums.GlobalErrorCodeConstants.SUCCESS;
+import static cn.lihu.jh.framework.common.pojo.CommonResult.error;
import static cn.lihu.jh.framework.common.pojo.CommonResult.success;
@Tag(name = "绠$悊鍚庡彴 - 鍖荤敓鍙彿")
@@ -38,16 +34,97 @@
@Resource
private QueueService queueService;
- @GetMapping("/nextpatient")
- @Operation(summary = "涓嬩竴浣嶆偅鑰�")
- @Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
- @Parameter(name = "bedNo", description = "宸ヤ綅缂栧彿", required = true, example = "B2")
- @PreAuthorize("@ss.hasPermission('ecg:doctor:nextpatient')")
- public CommonResult<List<QueueRespVO>> nextPatient(
+ @GetMapping("/bed-doctor-pause")
+ @Operation(summary = "鍖荤敓鏆傚仠")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:state')")
+ public CommonResult<Integer> bedPause(
@RequestParam("roomId") Long roomId,
@RequestParam("bedNo") String bedNo)
{
- queueService.nextPatient(roomId, bedNo);
+ Long userId = SecurityFrameworkUtils.getLoginUserId();
+ String userNickname = SecurityFrameworkUtils.getLoginUserNickname();
+
+ ErrorCode result = queueService.startBedDoctorPause(roomId, bedNo, userId, userNickname);
+ if (result.equals(SUCCESS))
+ return success(SUCCESS.getCode());
+
+ return error(result);
+ }
+
+ @GetMapping("/bed-doctor-resume")
+ @Operation(summary = "鍖荤敓鎭㈠")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:state')")
+ public CommonResult<Integer> bedResume(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo)
+ {
+ Long userId = SecurityFrameworkUtils.getLoginUserId();
+ String userNickname = SecurityFrameworkUtils.getLoginUserNickname();
+
+ ErrorCode result = queueService.startBedDoctorResume(roomId, bedNo, userId, userNickname);
+ if (result.equals(SUCCESS))
+ return success(SUCCESS.getCode());
+
+ return error(result);
+ }
+
+ @GetMapping("/bed-doctor-on")
+ @Operation(summary = "鍖荤敓鍏ュ骇")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:state')")
+ public CommonResult<Integer> bedDoctorOn(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo)
+ {
+ Long userId = SecurityFrameworkUtils.getLoginUserId();
+ String userNickname = SecurityFrameworkUtils.getLoginUserNickname();
+
+ ErrorCode result = queueService.startBedDoctorOn(roomId, bedNo, userId, userNickname);
+ if (result.equals(SUCCESS))
+ return success(0);
+
+ return error(result);
+ }
+
+ @GetMapping("/bed-doctor-off")
+ @Operation(summary = "鍖荤敓绂诲骇")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:state')")
+ public CommonResult<Integer> bedDoctorOff(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo)
+ {
+ Long userId = SecurityFrameworkUtils.getLoginUserId();
+ String userNickname = SecurityFrameworkUtils.getLoginUserNickname();
+
+ ErrorCode result = queueService.startBedDoctorOff(roomId, bedNo, userId, userNickname);
+ if (result.equals(SUCCESS))
+ return success(SUCCESS.getCode());
+
+ return error(result);
+ }
+
+ @GetMapping("/bed-doctor-get")
+ @Operation(summary = "鍖荤敓宸ヤ綅鑾峰彇")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:state')")
+ public CommonResult<RoomRespVO> bedDoctorGet(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo)
+ {
+ Long userId = SecurityFrameworkUtils.getLoginUserId();
+
+ CommonResult<RoomRespVO> result = queueService.getRoom(roomId, bedNo, userId);
+ return result;
+ }
+
+ @GetMapping("/finish-next-patient")
+ @Operation(summary = "瀹屾垚銆佷笅涓�浣嶆偅鑰�")
+ @Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
+ @Parameter(name = "bedNo", description = "宸ヤ綅缂栧彿", required = true, example = "B2")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
+ public CommonResult<List<QueueRespVO>> finishNextPatient(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo)
+ {
+ queueService.finishNextPatient(roomId, bedNo);
List<Byte> queueStatusList = new ArrayList<>();
queueStatusList.add(QueueStatusEnum.READY.getStatus());
@@ -57,20 +134,71 @@
return success(BeanUtils.toBean(queueDOList, QueueRespVO.class));
}
- @GetMapping("/page")
- @Operation(summary = "鑾峰緱鎺掗槦鍒嗛〉")
- @PreAuthorize("@ss.hasPermission('ecg:queue:query')")
- public CommonResult<PageResult<QueueRespVO>> getqueuePage(@Valid QueuePageReqVO pageReqVO) {
- PageResult<QueueDO> pageResult = queueService.getqueuePage(pageReqVO);
- return success(BeanUtils.toBean(pageResult, QueueRespVO.class));
+ @GetMapping("/pass-next-patient")
+ @Operation(summary = "杩囧彿銆佷笅涓�浣嶆偅鑰�")
+ @Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
+ @Parameter(name = "bedNo", description = "宸ヤ綅缂栧彿", required = true, example = "B2")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
+ public CommonResult<List<QueueRespVO>> passNextPatient(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo)
+ {
+ queueService.passNextPatient(roomId, bedNo);
+
+ List<Byte> queueStatusList = new ArrayList<>();
+ queueStatusList.add(QueueStatusEnum.READY.getStatus());
+ queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus());
+ queueStatusList.add(QueueStatusEnum.PASSED.getStatus());
+ List<QueueDO> queueDOList = queueService.getDoctorQueueByStatus(roomId, bedNo, queueStatusList);
+ return success(BeanUtils.toBean(queueDOList, QueueRespVO.class));
}
- @GetMapping("/opening-setting")
- @Operation(summary = "寮�璇婅缃�")
- @PreAuthorize("@ss.hasPermission('ecg:queue:setting')")
- public CommonResult<Integer> openingSetting() {
- queueService.initQueue();
- queueService.hurryup();
- return success(0);
+ @GetMapping("/get-patient-list")
+ @Operation(summary = "鍙栨偅鑰呭垪琛�")
+ @Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
+ @Parameter(name = "bedNo", description = "宸ヤ綅缂栧彿", required = true, example = "B2")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
+ public CommonResult<List<QueueRespVO>> getPatientList(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo)
+ {
+ List<Byte> queueStatusList = new ArrayList<>();
+ queueStatusList.add(QueueStatusEnum.READY.getStatus());
+ queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus());
+ queueStatusList.add(QueueStatusEnum.PASSED.getStatus());
+ List<QueueDO> queueDOList = queueService.getDoctorQueueByStatus(roomId, bedNo, queueStatusList);
+ return success(BeanUtils.toBean(queueDOList, QueueRespVO.class));
}
-}
\ No newline at end of file
+
+ @GetMapping("/get-patient-statistic")
+ @Operation(summary = "鍙栨偅鑰呯粺璁�")
+ @Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
+ @Parameter(name = "bedNo", description = "宸ヤ綅缂栧彿", required = true, example = "B2")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
+ public CommonResult<PatientStatisticVO> getPatientStatistic(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo)
+ {
+ PatientStatisticVO patientStatisticVO = queueService.getPatientStatistic(roomId, bedNo);
+ return success(patientStatisticVO);
+ }
+
+ @GetMapping("/recall-patient")
+ @Operation(summary = "杩囨湡鐥呬汉鍙洖")
+ @Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
+ @Parameter(name = "bedNo", description = "宸ヤ綅缂栧彿", required = true, example = "B2")
+ @Parameter(name = "patId", description = "鎮h�呯紪鍙�", required = true, example = "B2")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
+ public CommonResult<String> recallPatient(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo,
+ @RequestParam("patId") String patId )
+ {
+ Integer result = queueService.recallPatient(roomId, bedNo, patId);
+ if (null == result || 0 == result)
+ return error( new ErrorCode(201, "鎵句笉鍒版偅鑰�") );
+
+ return success("success");
+ }
+
+}
--
Gitblit v1.9.3