From e6456d2196b3e57bd06be0fbc74dd3e0fc28fdeb Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 22 七月 2025 19:17:55 +0800
Subject: [PATCH] 代码提交

---
 smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml            |    2 +-
 smartor/src/main/java/com/smartor/service/impl/HNGatherPatArchiveServiceImpl.java |   22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/smartor/src/main/java/com/smartor/service/impl/HNGatherPatArchiveServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/HNGatherPatArchiveServiceImpl.java
index 8c42b45..78f7303 100644
--- a/smartor/src/main/java/com/smartor/service/impl/HNGatherPatArchiveServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/HNGatherPatArchiveServiceImpl.java
@@ -62,6 +62,9 @@
     @Autowired
     private PatMedInhospMapper patMedInhospMapper;
 
+    @Autowired
+    private PatArchiveMapper patArchiveMapper;
+
 
     @Override
     public List<PatArchive> selectPatArchiveList(PatArchive patArchive) {
@@ -77,6 +80,25 @@
             patMedInhosp.setPs(1000);
             patMedInhosp.setPn(1000 * i);
             List<PatMedInhosp> patMedInhospList = hnGatherPatArchiveMapper.selectPatMedInhospList(patMedInhosp);
+            for (PatMedInhosp pm : patMedInhospList) {
+                String patno = pm.getPatno();
+                PatArchive patArchive = new PatArchive();
+                //鍏堝幓鎴戜滑鑷繁鐨勮〃閲岄�氳繃patno鏌ヨ璇ユ偅鑰呮槸鍚﹀瓨鍦�
+                patArchive.setPatientno(patno);
+                List<PatArchive> patArchives = patArchiveMapper.selectPatArchiveList(patArchive);
+                if (CollectionUtils.isEmpty(patArchives)) {
+                    //涓嶅瓨鍦紝鍒欓�氳繃patno鍘籋IS琛╤zjbxx鏌ヨ
+                    List<PatArchive> patArchives1 = hnGatherPatArchiveMapper.selectPatArchiveList(patArchive);
+                    //鎶婃煡璇㈠嚭鏉ョ殑鏁版嵁瀛樺埌pat_archive琛�
+                    PatArchive pa = patArchives1.get(0);
+                    pa.setId(null);
+                    patArchiveMapper.insertPatArchiveSingle(pa);
+                    pm.setPatid(pa.getId());
+                } else {
+                    //鐩存帴灏唒atid鏀惧埌鍑哄叆闄㈣〃涓�
+                    pm.setPatid(patArchives.get(0).getId());
+                }
+            }
             if (patMedInhospList != null && !patMedInhospList.isEmpty()) {
                 patMedInhospMapper.insertPatMedInhospBatch(patMedInhospList);
             }
diff --git a/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml b/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml
index 8fd6c45..69a0f90 100644
--- a/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml
@@ -353,7 +353,7 @@
                care_person,
                guid,
                case_person_age
-        from mbsjjk.hzjbxx
+        from hzjbxx
     </sql>
 
     <select id="selectPatArchiveList" parameterType="com.smartor.domain.PatArchive" resultMap="PatArchiveResult">

--
Gitblit v1.9.3