From e4bbdaaceab80b2528924510308ef2b7c0334471 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期日, 01 九月 2024 13:13:21 +0800
Subject: [PATCH] update
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueServiceImpl.java | 21 ++++++++++-----------
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedDoctorNextPatientCallable.java | 8 +++++++-
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedDoctorResumeCallable.java | 8 +++++++-
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedOpenCallable.java | 9 ++++++++-
4 files changed, 32 insertions(+), 14 deletions(-)
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedDoctorNextPatientCallable.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedDoctorNextPatientCallable.java
index 9c58211..f7f3ea8 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedDoctorNextPatientCallable.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedDoctorNextPatientCallable.java
@@ -1,6 +1,7 @@
package cn.lihu.jh.module.ecg.service.queue;
import cn.lihu.jh.framework.common.exception.ErrorCode;
+import cn.lihu.jh.framework.common.exception.enums.GlobalErrorCodeConstants;
import java.util.concurrent.Callable;
@@ -19,7 +20,12 @@
}
public ErrorCode call() throws Exception {
- return queueService.nextPatient(roomId, bedNo);
+ ErrorCode ec = queueService.nextPatient(roomId, bedNo);
+ if (GlobalErrorCodeConstants.SUCCESS.equals(ec)) {
+ queueService.hurryup();
+ }
+
+ return ec;
}
}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedDoctorResumeCallable.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedDoctorResumeCallable.java
index aa44f25..f53bc10 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedDoctorResumeCallable.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedDoctorResumeCallable.java
@@ -1,6 +1,7 @@
package cn.lihu.jh.module.ecg.service.queue;
import cn.lihu.jh.framework.common.exception.ErrorCode;
+import cn.lihu.jh.framework.common.exception.enums.GlobalErrorCodeConstants;
import java.util.concurrent.Callable;
@@ -23,7 +24,12 @@
}
public ErrorCode call() throws Exception {
- return queueService.bedDoctorResume(roomId, bedNo, docId, docName);
+ ErrorCode ec = queueService.bedDoctorResume(roomId, bedNo, docId, docName);
+ if (GlobalErrorCodeConstants.SUCCESS.equals(ec)) {
+ queueService.hurryup();
+ }
+
+ return ec;
}
}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedOpenCallable.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedOpenCallable.java
index 2039592..51fe0a2 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedOpenCallable.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedOpenCallable.java
@@ -1,6 +1,8 @@
package cn.lihu.jh.module.ecg.service.queue;
import cn.lihu.jh.framework.common.exception.ErrorCode;
+import cn.lihu.jh.framework.common.exception.enums.GlobalErrorCodeConstants;
+
import java.util.concurrent.Callable;
public class BedOpenCallable implements Callable<ErrorCode> {
@@ -18,7 +20,12 @@
}
public ErrorCode call() throws Exception {
- return queueService.bedOpen(roomId, bedNo);
+ ErrorCode ec = queueService.bedOpen(roomId, bedNo);
+ if (GlobalErrorCodeConstants.SUCCESS.equals(ec)) {
+ queueService.hurryup();
+ }
+
+ return ec;
}
}
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 518ed2e..8f33956 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
@@ -6,6 +6,7 @@
import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.Resource;
+import cn.lihu.jh.framework.common.exception.enums.GlobalErrorCodeConstants;
import cn.lihu.jh.module.ecg.Utils;
import cn.lihu.jh.module.ecg.config.DynamicSchedulingConfig;
import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO;
@@ -32,7 +33,6 @@
import cn.lihu.jh.framework.common.util.object.BeanUtils;
import cn.lihu.jh.module.ecg.dal.mysql.queue.queueMapper;
-import static cn.lihu.jh.framework.common.exception.enums.GlobalErrorCodeConstants.SUCCESS;
import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.lihu.jh.framework.common.pojo.CommonResult.error;
import static cn.lihu.jh.framework.common.pojo.CommonResult.success;
@@ -264,7 +264,8 @@
bedQueueBO.setStatus(BedStatusEnum.OPENING.getStatus());
priorityQueue.offer(bedQueueBO);
mapBedVsQueue.put(String.format("%09d%s", roomId, bedNo), bedQueueBO);
- return SUCCESS;
+
+ return GlobalErrorCodeConstants.SUCCESS;
}
@Override
@@ -300,7 +301,7 @@
mapBedVsQueue.remove(String.format("%09d%s", roomId, bedNo));
priorityQueue.remove(bedQueueBO);
- return SUCCESS;
+ return GlobalErrorCodeConstants.SUCCESS;
}
@Override
@@ -339,7 +340,7 @@
bedQueueBO.setStatus(BedStatusEnum.PAUSE.getStatus());
priorityQueue.remove(bedQueueBO);
- return SUCCESS;
+ return GlobalErrorCodeConstants.SUCCESS;
}
@Override
@@ -368,8 +369,7 @@
return ECG_INNER_ERROR;
}
- hurryup();
- return SUCCESS;
+ return GlobalErrorCodeConstants.SUCCESS;
}
@Override
@@ -390,7 +390,7 @@
}
bedQueueBO.setStatus(BedStatusEnum.DOCTOR_ON.getStatus());
- return SUCCESS;
+ return GlobalErrorCodeConstants.SUCCESS;
}
@Override
@@ -411,7 +411,7 @@
}
bedQueueBO.setStatus(BedStatusEnum.OPENING.getStatus());
- return SUCCESS;
+ return GlobalErrorCodeConstants.SUCCESS;
}
private void validatequeueExists(Integer id) {
@@ -473,7 +473,7 @@
Integer num = queueMapper.getMaxSeqNum();
curSeqNum = new AtomicInteger(null == num ? 0 : num);
- return SUCCESS;
+ return GlobalErrorCodeConstants.SUCCESS;
}
/**
@@ -582,8 +582,7 @@
priorityQueue.remove(bo);
priorityQueue.offer(bo);
- hurryup();
- return SUCCESS;
+ return GlobalErrorCodeConstants.SUCCESS;
}
public void finishNextPatient(Long roomId, String bedNo) {
--
Gitblit v1.9.3