From c3e27cb2e84782e99a30cc5a6e8caa67ca0cb72f Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期三, 25 九月 2024 17:33:32 +0800
Subject: [PATCH] 医生登出,自动离座,自动从暂停恢复

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 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 aa243de..a2b2484 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,9 +6,13 @@
 import javax.annotation.Resource;
 
 import cn.lihu.jh.module.ecg.controller.admin.room.vo.MonitorInfoVO;
+import cn.lihu.jh.module.ecg.dal.dataobject.devrent.DevRentDO;
 import cn.lihu.jh.module.ecg.dal.mysql.call.CallMapper;
+import cn.lihu.jh.module.ecg.dal.mysql.devrent.DevRentMapper;
+import cn.lihu.jh.module.ecg.enums.DevRentStateEnum;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 import org.springframework.validation.annotation.Validated;
 
@@ -50,6 +54,9 @@
 
     @Resource
     private CallMapper callMapper;
+
+    @Resource
+    private DevRentMapper devRentMapper;
 
     AtomicInteger openingFlag = new AtomicInteger(0);
     AtomicInteger curSeqNum = new AtomicInteger(0);
@@ -583,10 +590,15 @@
      * @param queueSaveReqVO
      */
     @Override
+    @Transactional
     public void queue(QueueSaveReqVO queueSaveReqVO) {
         queueSaveReqVO.setStatus(QueueStatusEnum.WAITING.getStatus()); //鎺掗槦涓�
         QueueDO queue = BeanUtils.toBean(queueSaveReqVO, QueueDO.class);
         queueMapper.insert(queue);
+
+        DevRentDO devRent = BeanUtils.toBean(queueSaveReqVO, DevRentDO.class);
+        devRent.setState( DevRentStateEnum.FREE.getState() );
+        devRentMapper.insert(devRent);
 
         startHurryUp();
     }
@@ -691,4 +703,9 @@
                  + " opening " + openingFlag.get());
     }
 
+    @Override
+    public RoomDO getDocRoomInfo(Long docId) {
+        return roomMapper.getRoomByDocId(docId);
+    }
+
 }

--
Gitblit v1.9.3