From ed7ebfc37e525b4f52926e499cf0bec98f5e5bed Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期日, 01 九月 2024 17:52:40 +0800
Subject: [PATCH] update
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueServiceImpl.java | 33 ++++++++++++++++-----------------
1 files changed, 16 insertions(+), 17 deletions(-)
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..8a84085 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;
}
/**
@@ -483,12 +483,6 @@
public void hurryup() {
if (0 == openingFlag.get())
return;
-
- // TODO
- log.info("map " + mapBedVsQueue.size() + " priority " + priorityQueue.size());
- if (mapBedVsQueue.size() != priorityQueue.size()) {
- log.error("map " + mapBedVsQueue.size() + " priority " + priorityQueue.size());
- }
// 澶勭悊 杩囧彿-鍥炴潵 鐨勪汉
for (BedQueueBO bedQueueBO : mapBedVsQueue.values()) {
@@ -582,8 +576,7 @@
priorityQueue.remove(bo);
priorityQueue.offer(bo);
- hurryup();
- return SUCCESS;
+ return GlobalErrorCodeConstants.SUCCESS;
}
public void finishNextPatient(Long roomId, String bedNo) {
@@ -694,6 +687,12 @@
return updateNum;
}
+ @Override
+ public void monitorInfo() {
+ log.info("map " + mapBedVsQueue.size() + " priority " + priorityQueue.size()
+ + " opening " + openingFlag.get());
+ }
+
private void startHurryUp() {
singleThreadExecutor.execute( () -> {
hurryup();
--
Gitblit v1.9.3