From 4d537968ac6efb3a5e3d0f8ea5071d5254eb63c3 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 29 七月 2025 14:37:17 +0800
Subject: [PATCH] 代码提交

---
 smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
index c8e8bb5..e4f500d 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
@@ -396,6 +396,7 @@
         //鏂板鎮h�呭熀鏈俊鎭柊澧炴垨淇敼
         PatArchive patArchive = addPatArchive(externalInHospPatientInfo, externalInHospPatientAddrInfo, externalInHospPatientLiaisonInfo);
 
+
         PatMedInhosp patMedInhosp = new PatMedInhosp();
         patMedInhosp.setInhospno(externalInHospPatientInfo.getBingAnHao());
         patMedInhosp.setSerialnum(externalInHospPatientInfo.getJiuZhenYWID());
@@ -920,7 +921,7 @@
         int count = patMedOuthospMapper.countPatMedOuthosp();
         if (count > 3000000) {
             // 2. 鍐疯棌琛ㄥ苟鏂板缓
-            String timeSuffix = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
+            String timeSuffix = new SimpleDateFormat("yyyyMM").format(new Date());
             String oldName = "pat_med_outhosp";
             String newName = oldName + "_" + timeSuffix;
 
@@ -937,13 +938,15 @@
                 }
             }
 
-            // 4. 鏂板缓
-            patMedOuthospMapper.createPatMedOuthosp(oldName, newName);
+            // 4. 鏂板缓(姝ゆ椂鍙墿鍐疯〃锛孭atMedOuthosp娌′簡锛岄渶瑕佹柊寤轰竴涓�)
+            patMedOuthospMapper.createPatMedOuthosp(newName, oldName);
 
-            // 5. 璁剧疆鏂拌〃鑷璧峰鍊�
+            //5.璁剧疆鏂拌〃鑷涓婚敭
+            patMedOuthospMapper.createPatMedOuthospAutoAdd(oldName);
+            //6. 璁剧疆鏂拌〃鑷璧峰鍊�
             patMedOuthospMapper.setAutoIncrement(oldName, maxId + 1);
 
-            // 6. 鏇存柊/鏂板缓瑙嗗浘
+            // 7. 鏇存柊/鏂板缓瑙嗗浘
             // 閲嶆柊鑾峰彇鎵�鏈夎〃鍚嶏紙鍖呭惈鍒氭柊寤虹殑涓昏〃锛�
             List<String> allTables = patMedOuthospMapper.getAllOuthospTableNames();
             StringBuilder sb = new StringBuilder();
@@ -1196,6 +1199,9 @@
         PatArchive patArchive = new PatArchive();
         //濡傛灉鏄垰鍑虹敓鐨勫皬瀛╁瓙锛屾槸娌℃湁韬唤璇佺殑锛屾�庝箞澶勭悊锛燂紵锛燂紵锛燂紵锛燂紵
         patArchive.setIdcardno(externalInHospPatientInfo.getZhengJianHM());
+        //濡傛灉韬唤璇佷负绌虹殑璇濓紝灏辩敤灏辫瘖鍗″彿浠f浛
+        if (StringUtils.isEmpty(externalInHospPatientInfo.getZhengJianHM()))
+            patArchive.setIdcardno(externalInHospPatientInfo.getJiuZhenKH());
         patArchive.setOrgid(externalInHospPatientInfo.getZuZhiJGID());
         List<PatArchive> patArchives = null;
         if (ObjectUtils.isNotEmpty(patArchive.getIdcardno()))

--
Gitblit v1.9.3