From d78710765c31d449bef4f1af3de285221eb12080 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期四, 19 九月 2024 18:31:28 +0800
Subject: [PATCH] update

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/call/vo/CallSaveReqVO.java         |    5 +++++
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/call/CallMapper.java                      |    7 ++++---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java                 |    6 ++++++
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenServiceImpl.java |    1 -
 sql/mysql/jh.sql                                                                                                        |    1 +
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java                    |    5 +++--
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/call/vo/CallRespVO.java            |    6 ++++++
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/call/CallDO.java                     |    6 ++++++
 8 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/call/vo/CallRespVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/call/vo/CallRespVO.java
index ed0d51f..e28ce2a 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/call/vo/CallRespVO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/call/vo/CallRespVO.java
@@ -2,6 +2,8 @@
 
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
+
+import java.time.LocalDate;
 import java.util.*;
 import org.springframework.format.annotation.DateTimeFormat;
 import java.time.LocalDateTime;
@@ -28,6 +30,10 @@
     @ExcelProperty("鎮h�呮�у埆")
     private Integer patGender;
 
+    @Schema(description = "棰勭害鏃ユ湡")
+    @ExcelProperty("棰勭害鏃ユ湡")
+    private LocalDate bookDate;
+
     @Schema(description = "鎺掗槦搴忓彿")
     @ExcelProperty("鎺掗槦搴忓彿")
     private Integer seqNum;
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/call/vo/CallSaveReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/call/vo/CallSaveReqVO.java
index 0320cb6..1c261da 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/call/vo/CallSaveReqVO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/call/vo/CallSaveReqVO.java
@@ -4,6 +4,8 @@
 import lombok.*;
 
 import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import java.time.LocalDate;
 import java.util.*;
 
 @Schema(description = "绠$悊鍚庡彴 - 鍙彿鏂板/淇敼 Request VO")
@@ -24,6 +26,9 @@
     @Schema(description = "鎮h�呮�у埆")
     private Integer patGender;
 
+    @Schema(description = "棰勭害鏃ユ湡", requiredMode = Schema.RequiredMode.REQUIRED)
+    private LocalDate bookDate;
+
     @Schema(description = "鎺掗槦搴忓彿")
     private Integer seqNum;
 
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/call/CallDO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/call/CallDO.java
index b75619d..d51b3fc 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/call/CallDO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/call/CallDO.java
@@ -1,6 +1,8 @@
 package cn.lihu.jh.module.ecg.dal.dataobject.call;
 
 import lombok.*;
+
+import java.time.LocalDate;
 import java.util.*;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
@@ -40,6 +42,10 @@
      */
     private Integer patGender;
     /**
+     * 棰勭害鏃ユ湡
+     */
+    private LocalDate bookDate;
+    /**
      * 鎺掗槦搴忓彿
      */
     private Integer seqNum;
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/call/CallMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/call/CallMapper.java
index 952896d..2fe939d 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/call/CallMapper.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/call/CallMapper.java
@@ -6,10 +6,8 @@
 import cn.lihu.jh.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.lihu.jh.framework.mybatis.core.mapper.BaseMapperX;
 import cn.lihu.jh.module.ecg.dal.dataobject.call.CallDO;
-import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.*;
 import cn.lihu.jh.module.ecg.controller.admin.call.vo.*;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
 
 /**
  * 鍙彿 Mapper
@@ -41,4 +39,7 @@
 
     @Select("select * from lihu.call_patient where called = 0 order by id limit 1")
     CallDO getNextCall();
+
+    @Update("TRUNCATE TABLE lihu.call_patient")
+    void clearCall();
 }
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java
index 7c68e12..06cd3e9 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java
@@ -135,7 +135,8 @@
             " where status = #{curStatus} and pat_id = #{patId}")
     Integer queueJump(@Param("patId")String patId, @Param("curStatus")Byte curStatus, @Param("jumped")Byte jumped );
 
-    @Delete("delete from lihu.queue where TO_DAYS(book_date) != TO_DAYS(NOW())")
-    Integer clearQueue();
+    //@Delete("delete from lihu.queue where TO_DAYS(book_date) != TO_DAYS(NOW())")
+    @Update("TRUNCATE TABLE lihu.queue")
+    void clearQueue();
 }
 
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenServiceImpl.java
index fb405e7..fa9b52c 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenServiceImpl.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenServiceImpl.java
@@ -57,7 +57,6 @@
         if (listWaiting.size() < bigScreenConfig.waitingSize && waitingFrom != 0) {
             List<QueueDO> listWaiting_next = queueMapper.getPartialQueueByStatus( queueStatusList, 0, bigScreenConfig.waitingSize - listWaiting.size());
             listWaiting.addAll(listWaiting_next);
-            waitingFrom = listWaiting.getLast().getId() + 1;
         }
         if (listWaiting.size() < bigScreenConfig.waitingSize) {
             waitingFrom = 0;
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 8efdddd..aa243de 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 javax.annotation.Resource;
 
 import cn.lihu.jh.module.ecg.controller.admin.room.vo.MonitorInfoVO;
+import cn.lihu.jh.module.ecg.dal.mysql.call.CallMapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -46,6 +47,9 @@
 
     @Resource
     private RoomMapper roomMapper;
+
+    @Resource
+    private CallMapper callMapper;
 
     AtomicInteger openingFlag = new AtomicInteger(0);
     AtomicInteger curSeqNum = new AtomicInteger(0);
@@ -468,6 +472,8 @@
 
         // 娓呴櫎闈炲綋澶╃殑鎺掗槦浜哄憳
         queueMapper.clearQueue();
+        // 娓呴櫎闈炲綋澶╃殑璇煶鍙彿璁板綍
+        callMapper.clearCall();
 
         // 浠嶥B 鑾峰彇 宸ヤ綅鍒楄〃
         List<BedStatusEnum> bedStatusEnumList = new ArrayList<BedStatusEnum>();
diff --git a/sql/mysql/jh.sql b/sql/mysql/jh.sql
index 6ac4975..a55d596 100644
--- a/sql/mysql/jh.sql
+++ b/sql/mysql/jh.sql
@@ -198,6 +198,7 @@
   `pat_id` varchar(30) NOT NULL COMMENT '鎮h�呯紪鍙�',
   `pat_name` varchar(10) NOT NULL COMMENT '鎮h�呭鍚�',
   `pat_gender` int DEFAULT NULL COMMENT '鎮h�呮�у埆',
+  `book_date` date NOT NULL COMMENT '棰勭害鏃ユ湡',
   `seq_num` int DEFAULT NULL COMMENT '鎺掗槦搴忓彿',
   `passed` int DEFAULT '0' COMMENT '杩囧彿鏍囪',
   `expired` int DEFAULT '0' COMMENT '棰勭害杩囨湡鏍囪',

--
Gitblit v1.9.3