From 0abbee42ed08582645795b4b98e2637cc10cfed0 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期日, 19 四月 2026 20:12:01 +0800
Subject: [PATCH] 修改一下fuFlag的默认值 fuFlag:0不要   1要(默认)

---
 smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java
index a0f265d..b0e83b2 100644
--- a/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java
@@ -172,16 +172,24 @@
             log.error("闂ㄦ�ュ氨璇婃椂闂翠笉鑳戒负绌�");
             return 0;
         }
+        // 闇�瑕佹彃鍏ュ埌鍝釜琛紝鏍规嵁灏辫瘖鏃堕棿鐨勬棩鏈熸潵瀹氾紝濡傛灉鏍规嵁灏辫瘖鏃堕棿鏉ョ‘瀹氱殑琛ㄤ笉瀛樺湪锛屽垯瀛樺湪pat_med_outhosp琛ㄤ腑
+        String targetTable = resolveTargetTable(patMedOuthosp.getAdmitdate());
+        if (targetTable == null) {
+            return 0;
+        }
+        // 鎻掑叆鍓嶆寜 serialnum 鏌ラ噸锛岄槻姝㈤噸澶嶉噰闆嗗鑷撮噸澶嶅叆搴�
+        if (org.apache.commons.lang3.StringUtils.isNotBlank(patMedOuthosp.getSerialnum())) {
+            int exists = patMedOuthospMapper.countBySerialnum(targetTable, patMedOuthosp.getSerialnum());
+            if (exists > 0) {
+                log.info("[insert] serialnum={} 宸插瓨鍦ㄤ簬琛� {}锛岃烦杩囨彃鍏�", patMedOuthosp.getSerialnum(), targetTable);
+                return 0;
+            }
+        }
         patMedOuthosp.setCreateTime(DateUtils.getNowDate());
         patMedOuthosp.setUpdateTime(DateUtils.getNowDate());
         patMedOuthosp.setGuid(UUID.randomUUID().toString());
-        //闇�瑕佹彃鍏ュ埌鍝釜琛紝鏍规嵁灏辫瘖鏃堕棿鐨勬棩鏈熸潵瀹氾紝濡傛灉鏍规嵁灏辫瘖鏃堕棿鏉ョ‘瀹氱殑琛ㄤ笉瀛樺湪锛屽垯瀛樺湪pat_med_outhosp琛ㄤ腑
-        String targetTable = resolveTargetTable(patMedOuthosp.getAdmitdate());
-        if (targetTable != null) {
-            log.info("[insert] 璺敱鍒板垎琛�: {}", targetTable);
-            return patMedOuthospMapper.insertIntoTable(targetTable, patMedOuthosp);
-        }
-        return 0;
+        log.info("[insert] 璺敱鍒板垎琛�: {}", targetTable);
+        return patMedOuthospMapper.insertIntoTable(targetTable, patMedOuthosp);
     }
 
     /**
@@ -296,7 +304,7 @@
         PatMedOuthospQueryReq req = new PatMedOuthospQueryReq();
         String deptcodes = CollectionUtils.isEmpty(patMedReq.getDeptcodeList()) ? null : String.join(",", patMedReq.getDeptcodeList());
         req.setBeginAdmitdate(patMedReq.getStartDate());
-        req.setEndAdmitdate(patMedReq.getEndDate());
+        req.setEndAdmitdate(DateUtils.addDays(patMedReq.getEndDate(),1));
         req.setDeptcode(deptcodes);
         req.setOrgid(patMedReq.getOrgid());
 //        req.setCampusid(patMedReq.getCampusid());
@@ -326,6 +334,7 @@
     public Integer dealOutpatientInfo() {
         PatMedOuthosp patMedOuthosp = new PatMedOuthosp();
         patMedOuthosp.setDiagcheckFlag("0");
+        patMedOuthosp.setFuflag("1");
         List<PatMedOuthosp> patMedOuthosps = selectPatMedOuthospList(patMedOuthosp);
         for (PatMedOuthosp patMedOuthosp1 : patMedOuthosps) {
             PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patMedOuthosp1.getPatid());

--
Gitblit v1.9.3