From da5f06024406c4f210d9a410addc237ba1413217 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期二, 19 十一月 2024 15:14:33 +0800
Subject: [PATCH] 患者详情

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentRespVO.java    |    3 +
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devmanage/DeviceDO.java            |    7 +++
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DeviceMapper.java             |    8 ++--
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/QueueMapper.java                  |    3 +
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentSaveReqVO.java |    5 ++
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueuePageReqVO.java     |    4 +
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devrent/DevRentDO.java             |    7 ++-
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java           |    8 +++-
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DeviceRespVO.java   |    5 ++
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java   |   21 +++++++++-
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/patient/PatDetails.java            |   21 ++++++++++
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queue/QueueDO.java                 |    5 ++
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devrent/DevRentMapper.java              |    7 ++-
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueueSaveReqVO.java     |    4 +
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueueRespVO.java        |    5 ++
 15 files changed, 94 insertions(+), 19 deletions(-)

diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DeviceRespVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DeviceRespVO.java
index 477acfe..d899088 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DeviceRespVO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DeviceRespVO.java
@@ -1,5 +1,6 @@
 package cn.lihu.jh.module.ecg.controller.admin.devmanage.vo;
 
+import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
 
@@ -68,4 +69,8 @@
     @Schema(description = "鎷嗚缂栧彿")
     @ExcelProperty("鎷嗚缂栧彿")
     private Long rentId;
+
+    @Schema(description = "鎮h�呰鎯�")
+    @ExcelProperty("鎮h�呰鎯�")
+    private PatDetails patDetails;
 }
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentRespVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentRespVO.java
index 3f2d837..ed9e53d 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentRespVO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentRespVO.java
@@ -1,5 +1,6 @@
 package cn.lihu.jh.module.ecg.controller.admin.devrent.vo;
 
+import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
 import java.util.*;
@@ -30,7 +31,7 @@
 
     @Schema(description = "鎮h�呰鎯�", requiredMode = Schema.RequiredMode.REQUIRED, example = "鑺嬭壙")
     @ExcelProperty("鎮h�呰鎯�")
-    private String patDetails;
+    private PatDetails patDetails;
 
     @Schema(description = "瑁呮満鏃堕棿")
     @ExcelProperty("瑁呮満鏃堕棿")
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentSaveReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentSaveReqVO.java
index 5c696eb..687a2e5 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentSaveReqVO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentSaveReqVO.java
@@ -1,5 +1,6 @@
 package cn.lihu.jh.module.ecg.controller.admin.devrent.vo;
 
+import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails;
 import com.alibaba.excel.annotation.ExcelProperty;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
@@ -7,6 +8,7 @@
 
 import javax.validation.constraints.NotEmpty;
 import java.time.LocalDateTime;
+import java.util.Map;
 
 @Schema(description = "绠$悊鍚庡彴 - 瑁呮満鎷嗘満鏂板/淇敼 Request VO")
 @Data
@@ -62,4 +64,7 @@
 
     @Schema(description = "璇婂簥缂栧彿")
     String bedNo;
+
+    @Schema(description = "鎮h�呰鎯�")
+    PatDetails patDetails;
 }
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueuePageReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueuePageReqVO.java
index 6de11da..d4d6b95 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueuePageReqVO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueuePageReqVO.java
@@ -1,5 +1,6 @@
 package cn.lihu.jh.module.ecg.controller.admin.queue.vo;
 
+import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails;
 import lombok.*;
 import io.swagger.v3.oas.annotations.media.Schema;
 import cn.lihu.jh.framework.common.pojo.PageParam;
@@ -7,6 +8,7 @@
 
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.util.Map;
 
 import static cn.lihu.jh.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
 
@@ -26,7 +28,7 @@
     private Boolean patGender;
 
     @Schema(description = "鎮h�呰鎯�")
-    private String patDetails;
+    private PatDetails patDetails;
 
     @Schema(description = "棰勭害鏃ユ湡")
     private LocalDate bookDate;
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueueRespVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueueRespVO.java
index f866b37..3df20bf 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueueRespVO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueueRespVO.java
@@ -1,10 +1,13 @@
 package cn.lihu.jh.module.ecg.controller.admin.queue.vo;
 
+import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
 
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.util.Map;
+
 import com.alibaba.excel.annotation.*;
 
 @Schema(description = "绠$悊鍚庡彴 - 鎺掗槦 Response VO")
@@ -30,7 +33,7 @@
 
     @Schema(description = "鎮h�呰鎯�")
     @ExcelProperty("鎮h�呰鎯�")
-    private String patDetails;
+    private PatDetails patDetails;
 
     @Schema(description = "棰勭害鏃ユ湡")
     @ExcelProperty("棰勭害鏃ユ湡")
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueueSaveReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueueSaveReqVO.java
index 0295694..553a2f1 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueueSaveReqVO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueueSaveReqVO.java
@@ -1,5 +1,6 @@
 package cn.lihu.jh.module.ecg.controller.admin.queue.vo;
 
+import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
 import io.swagger.v3.oas.annotations.media.Schema;
@@ -9,6 +10,7 @@
 import javax.validation.constraints.NotNull;
 import java.time.LocalDate;
 import java.util.List;
+import java.util.Map;
 
 
 @Schema(description = "绠$悊鍚庡彴 - 鎺掗槦鏂板/淇敼 Request VO")
@@ -30,7 +32,7 @@
     private Byte patGender;
 
     @Schema(description = "鎮h�呰鎯�")
-    private String patDetails;
+    private PatDetails patDetails;
 
     @Schema(description = "棰勭害鏃ユ湡", requiredMode = Schema.RequiredMode.REQUIRED)
     @NotNull(message = "棰勭害鏃ユ湡涓嶈兘涓虹┖")
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devmanage/DeviceDO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devmanage/DeviceDO.java
index 68c86f6..8f0fbe6 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devmanage/DeviceDO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devmanage/DeviceDO.java
@@ -1,5 +1,7 @@
 package cn.lihu.jh.module.ecg.dal.dataobject.devmanage;
 
+import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails;
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
 import lombok.*;
 
 import java.time.LocalDate;
@@ -14,7 +16,7 @@
  *
  * @author majianbo
  */
-@TableName("device")
+@TableName(value="device", autoResultMap = true)
 @KeySequence("device_seq") // 鐢ㄤ簬 Oracle銆丳ostgreSQL銆並ingbase銆丏B2銆丠2 鏁版嵁搴撶殑涓婚敭鑷銆傚鏋滄槸 MySQL 绛夋暟鎹簱锛屽彲涓嶅啓銆�
 @Data
 @EqualsAndHashCode(callSuper = true)
@@ -75,4 +77,7 @@
 
     @TableField(updateStrategy = FieldStrategy.ALWAYS)
     private Long rentId;
+
+    @TableField(typeHandler = JacksonTypeHandler.class)
+    private PatDetails patDetails;
 }
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devrent/DevRentDO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devrent/DevRentDO.java
index 53fdf09..f0aa71f 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devrent/DevRentDO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devrent/DevRentDO.java
@@ -1,6 +1,8 @@
 package cn.lihu.jh.module.ecg.dal.dataobject.devrent;
 
+import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails;
 import cn.lihu.jh.module.ecg.enums.DevRentStateEnum;
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
 import lombok.*;
 import java.util.*;
 import java.time.LocalDateTime;
@@ -15,7 +17,7 @@
  *
  * @author 鑺嬮亾婧愮爜
  */
-@TableName("dev_rent")
+@TableName(value="dev_rent", autoResultMap = true)
 @KeySequence("dev_rent_seq") // 鐢ㄤ簬 Oracle銆丳ostgreSQL銆並ingbase銆丏B2銆丠2 鏁版嵁搴撶殑涓婚敭鑷銆傚鏋滄槸 MySQL 绛夋暟鎹簱锛屽彲涓嶅啓銆�
 @Data
 @EqualsAndHashCode(callSuper = true)
@@ -41,7 +43,8 @@
     /**
      * 鎮h�呰鎯�
      */
-    private String patDetails;
+    @TableField(typeHandler = JacksonTypeHandler.class)
+    private PatDetails patDetails;
     /**
      * 妫�鏌ョ被鍨�
      */
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/patient/PatDetails.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/patient/PatDetails.java
new file mode 100644
index 0000000..0520a47
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/patient/PatDetails.java
@@ -0,0 +1,21 @@
+package cn.lihu.jh.module.ecg.dal.dataobject.patient;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class PatDetails {
+    String Id;
+    String Name;
+    String mobile;
+    String deptCode;
+    String deptDesc;
+    String wardCode;
+    String wardDesc;
+    String bedNo;
+}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queue/QueueDO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queue/QueueDO.java
index c88619d..e12bd5c 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queue/QueueDO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queue/QueueDO.java
@@ -1,5 +1,6 @@
 package cn.lihu.jh.module.ecg.dal.dataobject.queue;
 
+import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails;
 import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
 import lombok.*;
 import com.baomidou.mybatisplus.annotation.*;
@@ -7,6 +8,7 @@
 
 import java.time.LocalDate;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 鎺掗槦 DO
@@ -43,7 +45,8 @@
     /**
      * 鎮h�呰鎯�
      */
-    private String patDetails;
+    @TableField(typeHandler = JacksonTypeHandler.class)
+    private PatDetails patDetails;
     /**
      * 棰勭害鏃ユ湡
      */
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DeviceMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DeviceMapper.java
index 4bd0235..125c9f9 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DeviceMapper.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DeviceMapper.java
@@ -10,11 +10,8 @@
 import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceDO;
 import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceStatisticDO;
 import cn.lihu.jh.module.ecg.dal.dataobject.jobrecord.JobRecordStatisticDO;
-import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.*;
 import cn.lihu.jh.module.ecg.controller.admin.devmanage.vo.*;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-import org.apache.ibatis.annotations.Update;
 
 /**
  * 璁惧 Mapper
@@ -37,6 +34,9 @@
     }
 
     @Select("select * from lihu.device where dev_id=#{devId}")
+    @Results({
+            @Result(property = "patDetails", column = "pat_details", typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class)
+    })
     DeviceDO getDeviceByDevId(@Param("devId") String devId);
 
     @Update("update lihu.device set state=#{state}, state_date=#{stateDate} where dev_id=#{devId}")
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devrent/DevRentMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devrent/DevRentMapper.java
index db431d6..98400d7 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devrent/DevRentMapper.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devrent/DevRentMapper.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.devrent.DevRentDO;
-import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.*;
 import cn.lihu.jh.module.ecg.controller.admin.devrent.vo.*;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
 
 /**
  * 瑁呮満鎷嗘満 Mapper
@@ -56,6 +54,9 @@
             "order by create_time desc " +
             "limit 1 " +
             "</script>")
+    @Results({
+            @Result(property = "patDetails", column = "pat_details", typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class)
+    })
     DevRentDO getRentByState(DevRentSearchReqVO reqVO );
 
     @Select("select * from lihu.dev_rent where state=#{state} and pat_id=#{patId} and check_type=#{checkType} and to_days(create_time)=to_days(now())")
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 3bcf171..057296c 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
@@ -175,6 +175,9 @@
             " </foreach> ) " +
             " order by status desc, seq_num " +
             "</script>")
+    @Results({
+            @Result(property = "patDetails", column = "pat_details", typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class)
+    })
     List<QueueDO> getBedQueueByStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("statusList")List<Integer> statusList);
 
     @Select("SELECT * from lihu.queue where room_id = #{roomId} and bed_no = #{bedNo} and status = #{curStatus} order by seq_num, create_time limit 1")
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java
index a374f68..e126dce 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java
@@ -4,6 +4,7 @@
 import cn.lihu.jh.framework.common.util.date.LocalDateTimeUtils;
 import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueueSaveReqVO;
 import cn.lihu.jh.module.ecg.dal.dataobject.checktype.CheckTypeDO;
+import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails;
 import cn.lihu.jh.module.ecg.feign.RemoteDataService;
 import cn.lihu.jh.module.ecg.feign.RestApiReqBodyVo;
 import cn.lihu.jh.module.ecg.feign.RestApiResult;
@@ -31,7 +32,9 @@
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.lihu.jh.framework.common.pojo.CommonResult.error;
@@ -241,7 +244,7 @@
             queueSaveReqVO.setIsVip( confirmReqVO.getIsVip() );
             queueSaveReqVO.setPassed((byte) 0);
             queueSaveReqVO.setExpired((byte) 0);
-            queueSaveReqVO.setPatDetails( appointment.getPatDeptDesc() + "-" + appointment.getPatWardDesc() + "-" + appointment.getPatBedNo());
+            queueSaveReqVO.setPatDetails( getPatDetails(appointment) );
             queueService.queue(queueSaveReqVO);
         } catch (DuplicateKeyException duplicateKeyException) {
             throw exception(APPOINTMENT_HAVE_QUEUED);
@@ -297,4 +300,18 @@
 
         return 0;
     }
-}
\ No newline at end of file
+
+    private PatDetails getPatDetails(AppointmentDO appointment) {
+        PatDetails patDetails = new PatDetails();
+        patDetails.setId( appointment.getPatId() );
+        patDetails.setName( appointment.getPatName() );
+        patDetails.setMobile( appointment.getPatMobile() );
+        patDetails.setDeptCode( appointment.getPatDeptCode() );
+        patDetails.setDeptDesc( appointment.getPatDeptDesc() );
+        patDetails.setWardCode( appointment.getPatWardCode() );
+        patDetails.setWardDesc( appointment.getPatWardDesc() );
+        patDetails.setBedNo( appointment.getPatBedNo() );
+        return patDetails;
+    }
+}
+
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
index f1ddcc6..5607b22 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
@@ -6,6 +6,7 @@
 import cn.lihu.jh.module.ecg.dal.dataobject.checktype.CheckTypeDO;
 import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceDO;
 import cn.lihu.jh.module.ecg.dal.dataobject.jobrecord.JobRecordDO;
+import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails;
 import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO;
 import cn.lihu.jh.module.ecg.dal.mysql.devmanage.DeviceMapper;
 import cn.lihu.jh.module.ecg.dal.mysql.jobrecord.JobRecordMapper;
@@ -22,6 +23,7 @@
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 import cn.lihu.jh.module.ecg.controller.admin.devrent.vo.*;
 import cn.lihu.jh.module.ecg.dal.dataobject.devrent.DevRentDO;
@@ -155,7 +157,7 @@
         Long rent_id = createReqVO.getId();  // dev_rent 琛ㄧ殑ID
 
         // 鏍囨敞璁惧 宸查鍙�
-        Integer ret = markDevRecieved(createReqVO.getDevId(), rent_id);
+        Integer ret = markDevRecieved(createReqVO.getDevId(), rent_id, createReqVO.getPatDetails());
         if (null == ret || 0 == ret) {
             throw exception(DEVICE_NOT_FREE);
         }
@@ -706,13 +708,14 @@
     }
 
     // 鏍囪 璁惧宸茶棰嗗彇
-    private Integer markDevRecieved(String devId, Long rentId) {
+    private Integer markDevRecieved(String devId, Long rentId, PatDetails patDetails) {
         // 璁惧鏍囨敞 宸查鍙�
         DeviceDO deviceDO = deviceMapper.getDeviceByDevId(devId);
         if (null != deviceDO && DevStateEnum.FREE.isEqual(deviceDO.getState())) {
             deviceDO.setState( DevStateEnum.RECEIVED.getState() );
             deviceDO.setRentId( rentId );
             deviceDO.setStateDate( LocalDate.now() );
+            deviceDO.setPatDetails( patDetails );
             return deviceMapper.updateById(deviceDO);
         }
 
@@ -760,6 +763,7 @@
             deviceDO.setState( DevStateEnum.FREE.getState() );
             deviceDO.setStateDate( LocalDate.now() );
             deviceDO.setRentId(null);
+            deviceDO.setPatDetails(null);
             return deviceMapper.updateById(deviceDO);
         }
         

--
Gitblit v1.9.3