From a156ddbb26693b8040f9dbbd7582a12c1fc8d61b Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期四, 07 十一月 2024 17:04:47 +0800
Subject: [PATCH] 预约序号

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queuesequence/QueueSequenceServiceImpl.java |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queuesequence/QueueSequenceServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queuesequence/QueueSequenceServiceImpl.java
index d99ebbd..ec1e59b 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queuesequence/QueueSequenceServiceImpl.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queuesequence/QueueSequenceServiceImpl.java
@@ -119,5 +119,37 @@
         });
     }
 
+    @Override
+    @Transactional
+    public Integer distributeSeqNo(Integer checkType, Integer timeslot) {
+        Integer curSeqNo = queueSequenceMapper.selectQueueNoForUpdate(checkType, timeslot);
+        if (null == curSeqNo) {
+            throw exception(QUEUE_SEQUENCE_TIMESLOT_FULL);
+        }
+
+        Integer updateRowNum = queueSequenceMapper.updateGivenCheckTypeTimeslotSeqNo(checkType, timeslot, curSeqNo);
+        if (null == updateRowNum || updateRowNum == 0) {
+            throw exception(QUEUE_SEQUENCE_TIMESLOT_EXCEPTION);
+        }
+
+        return curSeqNo + 1;
+    }
+
+    @Override
+    @Transactional
+    public Integer distributeVipSeqNo(Integer checkType, Integer timeslot) {
+        Integer curVipSeqNo = queueSequenceMapper.selectQueueVipNoForUpdate(checkType, timeslot);
+        if (null == curVipSeqNo) {
+            throw exception(QUEUE_SEQUENCE_TIMESLOT_FULL);
+        }
+
+        Integer updateRowNum = queueSequenceMapper.updateGivenCheckTypeTimeslotVipSeqNo(checkType, timeslot, curVipSeqNo);
+        if (null == updateRowNum || updateRowNum == 0) {
+            throw exception(QUEUE_SEQUENCE_TIMESLOT_EXCEPTION);
+        }
+
+        return curVipSeqNo + 1;
+    }
+
 }
 

--
Gitblit v1.9.3