From fce96ef468291fb9a0e6a4d34ab371315e9485d4 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期六, 03 十月 2026 00:59:44 +0800
Subject: [PATCH] ai优化
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java | 367 ++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 311 insertions(+), 56 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 fdbc85f..6359151 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
@@ -7,8 +7,10 @@
import cn.lihu.jh.module.ecg.controller.admin.call.vo.CallSaveReqVO;
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.dal.dataobject.room.RoomDO;
import cn.lihu.jh.module.ecg.enums.QueueStatusEnum;
import cn.lihu.jh.module.ecg.service.call.CallService;
import cn.lihu.jh.module.ecg.service.queue.QueueService;
@@ -28,8 +30,7 @@
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;
-import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.ECG_INNER_ERROR;
-import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.PATIENT_NOT_EXISTS;
+import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.*;
@Tag(name = "绠$悊鍚庡彴 - 鍖荤敓鍙彿")
@RestController
@@ -55,8 +56,10 @@
String userNickname = SecurityFrameworkUtils.getLoginUserNickname();
ErrorCode result = queueService.startBedDoctorPause(roomId, bedNo, userId, userNickname);
- if (result.equals(SUCCESS))
+ if (result.equals(SUCCESS)) {
+ queueService.updateStop(roomId, bedNo);
return success(SUCCESS.getCode());
+ }
return error(result);
}
@@ -112,6 +115,45 @@
return error(result);
}
+ /**
+ * 閲婃斁**褰撳墠鐧诲綍鐢ㄦ埛**鍗犵敤鐨勫叏閮ㄨ瘖鐤楀簥浣嶏紙閫�鍑虹郴缁熸椂鑷姩绂诲骇锛夈��
+ *
+ * <p>鑳屾櫙锛氬尰鐢熷湪銆岃瘖瀹ら�夋嫨銆嶉〉閫夊ソ搴婁綅鍚庡嵆鍗犵敤璇ュ簥浣嶏紙{@code clinic_room.doc_id}锛夛紝
+ * 鑻ヤ竴鐩翠笉鐐广�岀搴с�嶅氨閫�鍑虹郴缁燂紝搴婁綅浼氫竴鐩存樉绀鸿鍗犵敤锛屽叾浠栧尰鐢熸棤娉曚娇鐢ㄣ��
+ *
+ * <p>涓� {@link #bedDoctorOff} 鐨勫尯鍒細
+ * <ul>
+ * <li>{@code /bed-doctor-off} 闇�瑕佸墠绔紶 roomId + bedNo锛堢寮�鏌愪釜**鎸囧畾**搴婁綅锛夛紱</li>
+ * <li>鏈帴鍙�**涓嶉渶瑕佷换浣曞弬鏁�**锛屾寜褰撳墠鐧诲綍鐢ㄦ埛鍙嶆煡鍏跺崰鐢ㄧ殑**鎵�鏈�**搴婁綅骞堕�愪竴閲婃斁銆�</li>
+ * </ul>
+ * 涔嬫墍浠ュ仛鎴�"鏃犲弬"锛氶��鍑虹櫥褰� / 绌洪棽瓒呮椂 / 浠ょ墝澶辨晥绛夊満鏅笅锛屽墠绔彲鑳藉凡缁忔嬁涓嶅埌
+ * 搴婁綅鐨� roomId/bedNo锛堟湰鍦扮紦瀛樺凡琚竻鐞嗭級锛屾鏃跺彧鑳界敱鏈嶅姟绔寜 userId 鍙嶆煡銆�
+ * 鏈嶅姟绔弽鏌ヤ篃鏇村彲闈� 鈥斺�� 鍓嶇缂撳瓨鐨勫簥浣嶈嫢琚鐞嗗憳鏀瑰姩杩囷紝灏变細鍑虹幇"閲婃斁涓嶆帀"銆�
+ *
+ * <p>骞傜瓑锛氭湭鍗犵敤浠讳綍搴婁綅鏃剁洿鎺ヨ繑鍥炴垚鍔熴��
+ */
+ @PostMapping("/release-my-beds")
+ @Operation(summary = "閲婃斁褰撳墠鐧诲綍鐢ㄦ埛鍗犵敤鐨勫叏閮ㄥ簥浣嶏紙閫�鍑虹郴缁熸椂鑷姩绂诲骇锛�")
+ public CommonResult<Boolean> releaseMyBeds() {
+ Long userId = SecurityFrameworkUtils.getLoginUserId();
+ if (userId == null) {
+ // 鏈櫥褰曪紙鎴栦护鐗屽凡澶辨晥锛夋椂鏃犲簥浣嶅彲閲婃斁锛屾寜鎴愬姛杩斿洖锛岄伩鍏嶅墠绔姤閿�
+ return success(true);
+ }
+ String userNickname = SecurityFrameworkUtils.getLoginUserNickname();
+ List<RoomDO> occupiedBeds = queueService.getDocRoomInfo(userId);
+ if (occupiedBeds == null || occupiedBeds.isEmpty()) {
+ return success(true); // 鏈崰鐢ㄥ簥浣嶏紝鏃犻渶澶勭悊
+ }
+ log.info("[releaseMyBeds] 閫�鍑虹郴缁熻嚜鍔ㄧ搴�. userId={} nickname={} 鍗犵敤搴婁綅鏁�={}",
+ userId, userNickname, occupiedBeds.size());
+ for (RoomDO bed : occupiedBeds) {
+ // 閫愪釜閲婃斁锛涘崟涓け璐ヤ笉褰卞搷鍏跺畠搴婁綅
+ queueService.startBedDoctorOff(bed.getRoomId(), bed.getBedNo(), userId, userNickname);
+ }
+ return success(true);
+ }
+
@GetMapping("/bed-doctor-get")
@Operation(summary = "鍖荤敓宸ヤ綅鑾峰彇")
@PreAuthorize("@ss.hasPermission('ecg:doctor:state')")
@@ -136,15 +178,12 @@
{
queueService.finishNextPatient(roomId, bedNo);
- List<Byte> queueStatusList = new ArrayList<>();
- queueStatusList.add(QueueStatusEnum.RECALLED.getStatus());
- queueStatusList.add(QueueStatusEnum.READY.getStatus());
- queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus());
- queueStatusList.add(QueueStatusEnum.PASSED.getStatus());
- List<QueueDO> queueDOList = queueService.getBedQueueByStatus(roomId, bedNo, queueStatusList);
+ List<QueueDO> queueDOList = queueService.getCheckRelatedPatient(roomId, bedNo);
// 杩囨护鍑� 灏辫瘖涓殑锛屽噯澶囧彨鍙�
- QueueDO onStageItem = queueDOList.stream().filter(item -> Objects.equals(item.getStatus(), QueueStatusEnum.ONSTAGE.getStatus())).findFirst().orElse(null);
+ QueueDO onStageItem = queueDOList.stream().filter(item ->
+ item.getStatus() == QueueStatusEnum.ONSTAGE.getStatus() && item.getAffinityItem() == 0
+ ).findFirst().orElse(null);
if (null != onStageItem) {
CallSaveReqVO callSaveReqVO = BeanUtils.toBean(onStageItem, CallSaveReqVO.class);
callSaveReqVO.setId(null);
@@ -165,15 +204,12 @@
{
queueService.finishReceiveNextPatient(roomId, bedNo);
- List<Byte> queueStatusList = new ArrayList<>();
- queueStatusList.add(QueueStatusEnum.RECALLED.getStatus());
- queueStatusList.add(QueueStatusEnum.READY.getStatus());
- queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus());
- queueStatusList.add(QueueStatusEnum.PASSED.getStatus());
- List<QueueDO> queueDOList = queueService.getBedQueueByStatus(roomId, bedNo, queueStatusList);
+ List<QueueDO> queueDOList = queueService.getCheckRelatedPatient(roomId, bedNo);
// 杩囨护鍑� 灏辫瘖涓殑锛屽噯澶囧彨鍙�
- QueueDO onStageItem = queueDOList.stream().filter(item -> Objects.equals(item.getStatus(), QueueStatusEnum.ONSTAGE.getStatus())).findFirst().orElse(null);
+ QueueDO onStageItem = queueDOList.stream().filter(item ->
+ item.getStatus() == QueueStatusEnum.ONSTAGE.getStatus() && item.getAffinityItem() == 0
+ ).findFirst().orElse(null);
if (null != onStageItem) {
CallSaveReqVO callSaveReqVO = BeanUtils.toBean(onStageItem, CallSaveReqVO.class);
callSaveReqVO.setId(null);
@@ -194,24 +230,38 @@
{
queueService.finishInstallNextPatient(roomId, bedNo);
- List<Byte> queueStatusList = new ArrayList<>();
- queueStatusList.add(QueueStatusEnum.RECALLED.getStatus());
- queueStatusList.add(QueueStatusEnum.READY.getStatus());
- queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus());
- queueStatusList.add(QueueStatusEnum.PASSED.getStatus());
- List<QueueDO> queueDOList = queueService.getBedQueueByStatus(roomId, bedNo, queueStatusList);
+ List<QueueDO> queueDOList = queueService.getInstallRelatedPatient(roomId, bedNo); // 寰呭畨瑁呯殑鎮h��
- // 杩囨护鍑� 灏辫瘖涓殑锛屽噯澶囧彨鍙�
- QueueDO onStageItem = queueDOList.stream().filter(item -> Objects.equals(item.getStatus(), QueueStatusEnum.ONSTAGE.getStatus())).findFirst().orElse(null);
- if (null != onStageItem) {
+ List<QueueDO> installingQueueDOList = queueDOList.stream().filter(queueDO ->
+ queueDO.getStatus() == QueueStatusEnum.INSTALLING.getStatus() && queueDO.getAffinityItem() == 0
+ ).toList();
+ // 杩囨护鍑� [瀹夎涓璢 鐨勶紝鍑嗗鍙彿 璇ュ伐浣嶅簲璇� 鏈�澶氬彧鏈変竴涓� [瀹夎涓璢
+ if (installingQueueDOList.size() > 0) {
+ QueueDO onStageItem = installingQueueDOList.get(0);
CallSaveReqVO callSaveReqVO = BeanUtils.toBean(onStageItem, CallSaveReqVO.class);
callSaveReqVO.setId(null);
+ callSaveReqVO.setCallType(1); // 瑁呮満鍙彿
callService.createCall(callSaveReqVO);
}
return success(BeanUtils.toBean(queueDOList, QueueRespVO.class));
}
+ // 甯歌妫�鏌ヨ繃鍙枫�侀鐢ㄨ繃鍙�
+ @GetMapping("/pass-waiting-patient")
+ @Operation(summary = "杩囧彿鎺掗槦涓偅鑰�")
+ @Parameter(name = "patId", description = "鎮h�呯紪鍙�", required = true, example = "20247845")
+ @Parameter(name = "checkType", description = "棰勭害妫�鏌ョ被鍨�", required = true, example = "100")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
+ public CommonResult<Integer> passWaitingPatient(
+ @RequestParam("patId") String patId,
+ @RequestParam("checkType") Integer checkType)
+ {
+ queueService.passWaitingPatient( patId, checkType );
+ return success(0);
+ }
+
+ // 甯歌妫�鏌ヨ繃鍙枫�侀鐢ㄨ繃鍙�
@GetMapping("/pass-next-patient")
@Operation(summary = "杩囧彿銆佷笅涓�浣嶆偅鑰�")
@Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
@@ -223,12 +273,7 @@
{
queueService.passNextPatient(roomId, bedNo);
- List<Byte> queueStatusList = new ArrayList<>();
- queueStatusList.add(QueueStatusEnum.RECALLED.getStatus());
- queueStatusList.add(QueueStatusEnum.READY.getStatus());
- queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus());
- queueStatusList.add(QueueStatusEnum.PASSED.getStatus());
- List<QueueDO> queueDOList = queueService.getBedQueueByStatus(roomId, bedNo, queueStatusList);
+ List<QueueDO> queueDOList = queueService.getCheckRelatedPatient(roomId, bedNo);
// 杩囨护鍑� 灏辫瘖涓殑锛屽噯澶囧彨鍙�
QueueDO onStageItem = queueDOList.stream().filter(item -> Objects.equals(item.getStatus(), QueueStatusEnum.ONSTAGE.getStatus())).findFirst().orElse(null);
@@ -241,16 +286,42 @@
return success(BeanUtils.toBean(queueDOList, QueueRespVO.class));
}
- @GetMapping("/call-again")
- @Operation(summary = "閲嶅彨銆佹偅鑰�")
+ @GetMapping("/pass-install-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<String> callAgainPatient(
+ public CommonResult<List<QueueRespVO>> passInstallNextPatient(
@RequestParam("roomId") Long roomId,
@RequestParam("bedNo") String bedNo)
{
- List<Byte> queueStatusList = new ArrayList<>();
+ queueService.passInstallNextPatient(roomId, bedNo);
+
+ List<QueueDO> queueDOList = queueService.getInstallRelatedPatient(roomId, bedNo);
+
+ List<QueueDO> installingQueueDOList = queueDOList.stream().filter(queueDO -> queueDO.getStatus() == QueueStatusEnum.INSTALLING.getStatus()).toList();
+ // 杩囨护鍑� [瀹夎涓璢 鐨勶紝鍑嗗鍙彿 璇ュ伐浣嶅簲璇� 鏈�澶氬彧鏈変竴涓� [瀹夎涓璢
+ if (installingQueueDOList.size() > 0) {
+ QueueDO onStageItem = installingQueueDOList.get(0);
+ CallSaveReqVO callSaveReqVO = BeanUtils.toBean(onStageItem, CallSaveReqVO.class);
+ callSaveReqVO.setId(null);
+ callSaveReqVO.setCallType(1); // 瑁呮満鍙彿
+ callService.createCall(callSaveReqVO);
+ }
+
+ return success(BeanUtils.toBean(queueDOList, QueueRespVO.class));
+ }
+
+ @GetMapping("/call-again")
+ @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<String> callPatientAgain(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo)
+ {
+ List<Integer> queueStatusList = new ArrayList<>();
queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus());
List<QueueDO> queueDOList = queueService.getBedQueueByStatus(roomId, bedNo, queueStatusList);
@@ -270,40 +341,60 @@
return success("鎿嶄綔鎴愬姛");
}
- @GetMapping("/get-patient-list")
- @Operation(summary = "鍙栨偅鑰呭垪琛�")
+
+ @GetMapping("/call-install-again")
+ @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(
+ public CommonResult<String> callInstallingPatientAgain(
@RequestParam("roomId") Long roomId,
@RequestParam("bedNo") String bedNo)
{
- List<Byte> queueStatusList = new ArrayList<>();
- queueStatusList.add(QueueStatusEnum.RECALLED.getStatus());
- queueStatusList.add(QueueStatusEnum.READY.getStatus());
- queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus());
- queueStatusList.add(QueueStatusEnum.PASSED.getStatus());
+ List<Integer> queueStatusList = new ArrayList<>();
+ queueStatusList.add(QueueStatusEnum.INSTALLING.getStatus());
List<QueueDO> queueDOList = queueService.getBedQueueByStatus(roomId, bedNo, queueStatusList);
+
+ if (queueDOList.isEmpty())
+ return success("鏃犲畨瑁呬腑鐨勬偅鑰�");
+
+ if (queueDOList.size() > 1) {
+ log.error("room {} bed {} have {} 瀹夎涓殑鎮h��", roomId, bedNo, queueDOList.size());
+ return error(ECG_INNER_ERROR);
+ }
+
+ QueueDO onStageItem = queueDOList.get(0);
+ CallSaveReqVO callSaveReqVO = BeanUtils.toBean(onStageItem, CallSaveReqVO.class);
+ callSaveReqVO.setId(null);
+ callSaveReqVO.setCallType(1); // 瑁呮満鍙彿
+ callService.callAgain(callSaveReqVO);
+
+ return success("鎿嶄綔鎴愬姛");
+ }
+
+ @GetMapping("/get-to-be-checked-list")
+ @Operation(summary = "鍙� [甯歌妫�鏌 鎴� [寰呴鐢╙ 鎮h�呭垪琛�")
+ @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>> getToBeCheckedPatientList(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo)
+ {
+ List<QueueDO> queueDOList = queueService.getCheckRelatedPatient(roomId, bedNo);
return success(BeanUtils.toBean(queueDOList, QueueRespVO.class));
}
- @GetMapping("/get-received-patient-list")
- @Operation(summary = "鍙栧凡棰嗙敤鎮h�呭垪琛�")
+ @GetMapping("/get-to-be-installed-list")
+ @Operation(summary = "鍙� [寰呭畨瑁匽 鎮h�呭垪琛�")
@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>> getReceivedPatientList(
+ public CommonResult<List<QueueRespVO>> getToBeInstalledPatientList(
@RequestParam("roomId") Long roomId,
@RequestParam("bedNo") String bedNo)
{
- List<Byte> queueStatusList = new ArrayList<>();
- queueStatusList.add(QueueStatusEnum.RECEIVED.getStatus());
- List<QueueDO> queueDOList = queueService.getRoomQueueByStatus(roomId, queueStatusList);
-
- queueStatusList.clear();
- queueStatusList.add(QueueStatusEnum.INSTALLING.getStatus());
- queueDOList.addAll( queueService.getBedQueueByStatus(roomId, bedNo, queueStatusList) );
+ List<QueueDO> queueDOList = queueService.getInstallRelatedPatient(roomId, bedNo);
return success(BeanUtils.toBean(queueDOList, QueueRespVO.class));
}
@@ -320,6 +411,49 @@
return success(patientStatisticVO);
}
+ @GetMapping("/get-dev-ready-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> getDevReadyStatistic(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo)
+ {
+ PatientStatisticVO patientStatisticVO = queueService.getBedDevReadyStatistic(roomId, bedNo);
+ return success(patientStatisticVO);
+ }
+
+
+ @GetMapping("/get-dev-install-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> getDevInstallStatistic(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo)
+ {
+ PatientStatisticVO patientStatisticVO = queueService.getBedDevInstallStatistic(roomId, bedNo);
+ return success(patientStatisticVO);
+ }
+
+ @GetMapping("/recall-pass-waiting-patient")
+ @Operation(summary = "杩囧彿-鎺掗槦涓� 鎮h�呭彫鍥�")
+ @Parameter(name = "patId", description = "鎮h�呯紪鍙�", required = true, example = "B2")
+ @Parameter(name = "checkType", description = "棰勭害妫�鏌ョ被鍨�", required = true, example = "100")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
+ public CommonResult<String> recallPatient(
+ @RequestParam("patId") String patId,
+ @RequestParam("checkType") Integer checkType)
+ {
+ Integer result = queueService.recallPassWaitingPatient(patId, checkType);
+ if (null == result || 0 == result)
+ return error(PATIENT_NOT_EXISTS);
+
+ return success("鎿嶄綔鎴愬姛");
+ }
+
@GetMapping("/recall-patient")
@Operation(summary = "杩囧彿鐥呬汉鍙洖")
@Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
@@ -329,13 +463,134 @@
public CommonResult<String> recallPatient(
@RequestParam("roomId") Long roomId,
@RequestParam("bedNo") String bedNo,
- @RequestParam("patId") String patId )
+ @RequestParam("patId") String patId,
+ @RequestParam("checkType") Integer checkType,
+ @RequestParam("roomId_operator") Long roomId_operator,
+ @RequestParam("bedNo_operator") String bedNo_operator )
{
- Integer result = queueService.recallPatient(roomId, bedNo, patId);
+ Integer result = queueService.recallPatient(roomId, bedNo, patId, checkType);
if (null == result || 0 == result)
return error(PATIENT_NOT_EXISTS);
return success("鎿嶄綔鎴愬姛");
}
+ @GetMapping("/recall-install-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")
+ @Parameter(name = "checkType", description = "妫�鏌ョ被鍨�", required = true, example = "100")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
+ public CommonResult<String> recallInstallPatient(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo,
+ @RequestParam("patId") String patId,
+ @RequestParam("checkType") Integer checkType,
+ @RequestParam("roomId_operator") Long roomId_operator,
+ @RequestParam("bedNo_operator") String bedNo_operator )
+ {
+ if (roomId != roomId_operator)
+ return error(QUEUE_RECALL_INSTALL_NOT_CUR_ROOM);
+
+ Integer result = queueService.recallInstallPatient(roomId, bedNo, patId, checkType, roomId_operator, bedNo_operator);
+ if (null == result || 0 == result)
+ return error(PATIENT_NOT_EXISTS);
+
+ return success("鎿嶄綔鎴愬姛");
+ }
+
+ // ==================== 闇�姹�2锛氭挙閿�銆屽彨鍙� / 妫�鏌ュ畬鎴愩�� ====================
+
+ @GetMapping("/undo-finish-patient")
+ @Operation(summary = "鎾ら攢妫�鏌ュ畬鎴愶細宸插氨璇�(40) 鈫� 鍊欒瘖涓�(20)")
+ @Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
+ @Parameter(name = "bedNo", description = "宸ヤ綅缂栧彿", required = true, example = "A1")
+ @Parameter(name = "patId", description = "鎮h�呯紪鍙�", required = true, example = "913639423")
+ @Parameter(name = "checkType", description = "妫�鏌ョ被鍨�", required = true, example = "100")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
+ public CommonResult<String> undoFinishPatient(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo,
+ @RequestParam("patId") String patId,
+ @RequestParam("checkType") Integer checkType) {
+ // 璇存槑锛氬繀椤绘寜 patId + checkType 绮剧‘瀹氫綅锛岄伩鍏嶈鎾ら攢鍏朵粬鎮h�咃紙鏃㈡湁缂洪櫡瑙� DevRentServiceImpl锛�
+ Integer result = queueService.undoFinishPatient(roomId, bedNo, patId, checkType);
+ if (null == result || 0 == result) {
+ return error(APPOINTMENT_NOT_EXISTS);
+ }
+ return success("宸叉挙閿�妫�鏌ュ畬鎴愶紝鎮h�呭凡杩斿洖鍊欒瘖鍖�");
+ }
+
+ @GetMapping("/undo-call-patient")
+ @Operation(summary = "鎾ら攢鍙彿锛氬氨璇婁腑(30) 鈫� 鍊欒瘖涓�(20)")
+ @Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
+ @Parameter(name = "bedNo", description = "宸ヤ綅缂栧彿", required = true, example = "A1")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
+ public CommonResult<String> undoCallPatient(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo) {
+ Integer result = queueService.undoCallPatient(roomId, bedNo);
+ if (null == result || 0 == result) {
+ return error(QUEUE_NOT_EXISTS);
+ }
+ return success("宸叉挙閿�鍙彿锛屾偅鑰呭凡杩斿洖鍊欒瘖鍖�");
+ }
+
+ @GetMapping("/last-finished-patient")
+ @Operation(summary = "鍙栨湰宸ヤ綅浠婃棩鏈�杩戜竴浣嶅凡瀹屾垚鎮h�咃紙渚涙挙閿�鎻愮ず锛�")
+ @Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
+ @Parameter(name = "bedNo", description = "宸ヤ綅缂栧彿", required = true, example = "A1")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
+ public CommonResult<QueueRespVO> lastFinishedPatient(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo) {
+ QueueDO queueDO = queueService.getBedLastFinishedQueueItem(roomId, bedNo);
+ return success(BeanUtils.toBean(queueDO, QueueRespVO.class));
+ }
+
+ // ==================== 闇�姹�3锛氬仠姝㈠�欒瘖寮�鍏� ====================
+
+ @GetMapping("/stop-ready")
+ @Operation(summary = "鍋滄鍊欒瘖锛氫笉鍐嶆柊澧炲�欒瘖鎮h�咃紙宸叉湁鍊欒瘖浠嶅彲鍙彿锛�")
+ @Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
+ @Parameter(name = "bedNo", description = "宸ヤ綅缂栧彿", required = true, example = "A1")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
+ public CommonResult<Boolean> stopReady(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo) {
+ ErrorCode ec = queueService.setStopReady(roomId, bedNo, true);
+ if (!SUCCESS.getCode().equals(ec.getCode())) {
+ return error(ec);
+ }
+ return success(true);
+ }
+
+ @GetMapping("/resume-ready")
+ @Operation(summary = "鎭㈠鍊欒瘖锛氶噸鏂板紑濮嬫帴鏀跺�欒瘖鎮h��")
+ @Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
+ @Parameter(name = "bedNo", description = "宸ヤ綅缂栧彿", required = true, example = "A1")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
+ public CommonResult<Boolean> resumeReady(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo) {
+ ErrorCode ec = queueService.setStopReady(roomId, bedNo, false);
+ if (!SUCCESS.getCode().equals(ec.getCode())) {
+ return error(ec);
+ }
+ return success(true);
+ }
+
+ @GetMapping("/get-stop-ready")
+ @Operation(summary = "鏌ヨ鍋滄鍊欒瘖鐘舵��")
+ @Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
+ @Parameter(name = "bedNo", description = "宸ヤ綅缂栧彿", required = true, example = "A1")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
+ public CommonResult<Boolean> getStopReady(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo) {
+ Boolean stop = queueService.getStopReady(roomId, bedNo);
+ return success(stop != null && stop);
+ }
+
}
--
Gitblit v1.9.3