From 6a7f481d975f94984602b15c90904090f30b9b67 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期六, 12 十月 2024 10:15:17 +0800
Subject: [PATCH] 叫号分 领用叫号、安装叫号、常规叫号
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java | 60 +++++++++++++++++++++++++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java | 22 +++++++++++
jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/QueueStatusEnum.java | 7 ++-
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueService.java | 12 +++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/DevRentController.java | 1
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java | 8 ----
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java | 2
7 files changed, 97 insertions(+), 15 deletions(-)
diff --git a/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/QueueStatusEnum.java b/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/QueueStatusEnum.java
index 74e6c76..d44dc55 100644
--- a/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/QueueStatusEnum.java
+++ b/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/QueueStatusEnum.java
@@ -20,9 +20,10 @@
WAITING((byte)10, "鎺掗槦涓�"),
RECALLED((byte)15, "宸插彫鍥�"),
READY((byte)20, "鍊欒瘖涓�"),
- ONSTAGE((byte)30, "灏辫瘖涓�"),
- RECEIVED((byte)40, "宸查鐢�"),
- FINISH((byte)50, "宸插氨璇�");
+ ONSTAGE((byte)30, "灏辫瘖涓�"), // 鎴� 棰嗙敤涓�
+ RECEIVED((byte)33, "宸查鐢�"),
+ INSTALLING((byte)36, "瀹夎涓�"),
+ FINISH((byte)40, "宸插氨璇�");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(QueueStatusEnum::getStatus).toArray();
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/DevRentController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/DevRentController.java
index 738f5c4..bfe957c 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/DevRentController.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/DevRentController.java
@@ -56,7 +56,6 @@
public CommonResult<Long> devReady(@Valid @RequestBody DevRentSaveReqVO createReqVO) {
try {
CommonResult<Long> result = devRentService.readyOperation(createReqVO);
- queueService.startHurryUpOneBed(createReqVO.getRoomId(), createReqVO.getBedNo());
return result;
} catch ( RuntimeException runtimeException ) {
String err = ExceptionUtils.formatException( runtimeException );
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 ea70ee0..a54333b 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
@@ -126,7 +126,7 @@
}
@GetMapping("/finish-next-patient")
- @Operation(summary = "瀹屾垚銆佷笅涓�浣嶆偅鑰�")
+ @Operation(summary = "甯歌鍙彿銆佷笅涓�浣嶆偅鑰�")
@Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
@Parameter(name = "bedNo", description = "宸ヤ綅缂栧彿", required = true, example = "B2")
@PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
@@ -154,6 +154,64 @@
return success(BeanUtils.toBean(queueDOList, QueueRespVO.class));
}
+ @GetMapping("/finish-receive-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>> finishReceiveNextPatient(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo)
+ {
+ 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.getDoctorQueueByStatus(roomId, bedNo, queueStatusList);
+
+ // 杩囨护鍑� 灏辫瘖涓殑锛屽噯澶囧彨鍙�
+ QueueDO onStageItem = queueDOList.stream().filter(item -> Objects.equals(item.getStatus(), QueueStatusEnum.ONSTAGE.getStatus())).findFirst().orElse(null);
+ if (null != onStageItem) {
+ CallSaveReqVO callSaveReqVO = BeanUtils.toBean(onStageItem, CallSaveReqVO.class);
+ callSaveReqVO.setId(null);
+ callService.createCall(callSaveReqVO);
+ }
+
+ return success(BeanUtils.toBean(queueDOList, QueueRespVO.class));
+ }
+
+ @GetMapping("/finish-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<List<QueueRespVO>> finishInstallNextPatient(
+ @RequestParam("roomId") Long roomId,
+ @RequestParam("bedNo") String bedNo)
+ {
+ 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.getDoctorQueueByStatus(roomId, bedNo, queueStatusList);
+
+ // 杩囨护鍑� 灏辫瘖涓殑锛屽噯澶囧彨鍙�
+ QueueDO onStageItem = queueDOList.stream().filter(item -> Objects.equals(item.getStatus(), QueueStatusEnum.ONSTAGE.getStatus())).findFirst().orElse(null);
+ if (null != onStageItem) {
+ CallSaveReqVO callSaveReqVO = BeanUtils.toBean(onStageItem, CallSaveReqVO.class);
+ callSaveReqVO.setId(null);
+ callService.createCall(callSaveReqVO);
+ }
+
+ return success(BeanUtils.toBean(queueDOList, QueueRespVO.class));
+ }
+
@GetMapping("/pass-next-patient")
@Operation(summary = "杩囧彿銆佷笅涓�浣嶆偅鑰�")
@Parameter(name = "roomId", description = "璇婂缂栧彿", required = true, example = "116")
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
index 980551d..a59f286 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
@@ -120,10 +120,6 @@
}
}
- // 鎮h�呮帓闃熺姸鎬� 鏇存柊涓� 宸查鐢�
- queueMapper.updatePatientQueueStatus( createReqVO.getPatId(),
- QueueStatusEnum.ONSTAGE.getStatus(), QueueStatusEnum.RECEIVED.getStatus());
-
return CommonResult.success(rent_id);
}
@@ -188,10 +184,6 @@
jobRecordDO.setUpdateTime(LocalDateTime.now());
jobRecordMapper.updateById(jobRecordDO);
}
-
- // 鎮h�呮帓闃熺姸鎬� 鏇存柊涓� 宸插氨璇�
- queueMapper.updatePatientQueueStatus( createReqVO.getPatId(),
- QueueStatusEnum.RECEIVED.getStatus(), QueueStatusEnum.FINISH.getStatus());
return CommonResult.success(rent_id);
}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueService.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueService.java
index 6d62b73..d9d9805 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueService.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueService.java
@@ -90,11 +90,21 @@
void queue(QueueSaveReqVO queueSaveReqVO);
/**
- * 鍖荤敓鍙笅涓�浣嶆偅鑰�
+ * 甯歌妫�鏌� 鍖荤敓鍙笅涓�浣嶆偅鑰�
*/
void finishNextPatient(Long roomId, String bedNo);
/**
+ * 棰嗙敤 鍖荤敓鍙笅涓�浣嶆偅鑰�
+ */
+ void finishReceiveNextPatient(Long roomId, String bedNo);
+
+ /**
+ * 瑁呮満 鍖荤敓鍙笅涓�浣嶆偅鑰�
+ */
+ void finishInstallNextPatient(Long roomId, String bedNo);
+
+ /**
* 鍖荤敓鐪嬪畬鎮h��
*/
void passNextPatient(Long roomId, String bedNo);
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java
index f26af26..7a960a4 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java
@@ -306,6 +306,8 @@
startHurryUpOneCheckType( queue.getBookCheckType() );
}
+ // 甯歌妫�鏌� 鍙彿
+ @Override
public void finishNextPatient(Long roomId, String bedNo) {
// 浠� DB 鎶� 灏辫瘖涓殑浜� 璁剧疆涓哄氨璇婂畬鎴�
Integer ret = queueMapper.updateQueueStatus(roomId, bedNo,
@@ -314,6 +316,26 @@
startNextPatient(roomId, bedNo);
}
+ // 棰嗙敤 鍙彿
+ @Override
+ public void finishReceiveNextPatient(Long roomId, String bedNo) {
+ // 浠� DB 鎶� 灏辫瘖涓殑浜� 璁剧疆涓哄氨璇婂畬鎴�
+ Integer ret = queueMapper.updateQueueStatus(roomId, bedNo,
+ QueueStatusEnum.ONSTAGE.getStatus(), QueueStatusEnum.RECEIVED.getStatus());
+
+ startNextPatient(roomId, bedNo);
+ }
+
+ // 瑁呮満 鍙彿
+ @Override
+ public void finishInstallNextPatient(Long roomId, String bedNo) {
+ // 浠� DB 鎶� 灏辫瘖涓殑浜� 璁剧疆涓哄氨璇婂畬鎴�
+ Integer ret = queueMapper.updateQueueStatus(roomId, bedNo,
+ QueueStatusEnum.ONSTAGE.getStatus(), QueueStatusEnum.FINISH.getStatus());
+
+ startNextPatient(roomId, bedNo);
+ }
+
public void passNextPatient(Long roomId, String bedNo) {
// 浠� DB 鎶� 灏辫瘖涓殑浜� 璁剧疆涓鸿繃鍙�
Integer ret = queueMapper.updateQueueStatus(roomId, bedNo,
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java
index fef9abe..6ef229c 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java
@@ -250,7 +250,7 @@
BedQueueBO bo = mapBedVsQueue.get(String.format("%09d%s", roomId, bedNo));
bo.queueNum.getAndDecrement(); // 鍙兘宸茬粡銆愬苟鍙戠殑銆戝湪 hurry-up 涓敼鍙樹簡鍊�
- removePriorityQueue(bo);
+ refreshPriorityQueue(bo);
return GlobalErrorCodeConstants.SUCCESS;
}
--
Gitblit v1.9.3