From cc479e6a056785103996cc7ea67dbd5faa3e800e Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 19 十月 2026 18:07:22 +0800
Subject: [PATCH] 数据采集模块

---
 smartor/src/main/java/com/smartor/service/IPatMedInhospService.java |   71 ++++++++++++++++++++++++++++++++---
 1 files changed, 65 insertions(+), 6 deletions(-)

diff --git a/smartor/src/main/java/com/smartor/service/IPatMedInhospService.java b/smartor/src/main/java/com/smartor/service/IPatMedInhospService.java
index 774c5bc..2ef4a0d 100644
--- a/smartor/src/main/java/com/smartor/service/IPatMedInhospService.java
+++ b/smartor/src/main/java/com/smartor/service/IPatMedInhospService.java
@@ -2,12 +2,20 @@
 
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.core.service.dto.PatMedReq;
+import com.ruoyi.common.core.service.dto.PatMedRes;
 import com.smartor.domain.*;
+import com.ruoyi.inhospvisit.domain.PatMedInhospDTO;
 import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.List;
 import java.util.Map;
 
+import com.ruoyi.inhospvisit.domain.PatMedInhospVO;
+import com.ruoyi.inhospvisit.domain.PatMedInhosp;
+import com.ruoyi.common.core.domain.entity.PatArchive;
+import com.ruoyi.task.domain.ServiceSubtask;
+import com.ruoyi.task.domain.ServiceTask;
 /**
  * 鎮h�呬綇闄㈣褰昐ervice鎺ュ彛
  *
@@ -33,10 +41,7 @@
      */
     public List<PatMedInhosp> selectPatMedInhospList(PatMedInhosp patMedInhosp);
 
-    /**
-     * 鍑洪櫌銆侀棬璇婁汉鏁板拰闅忚閲忕粺璁★紙鍛紝鏈堬紝骞达級
-     */
-    public Map<String, Integer> queryPersonCount(PatServiceCount patServiceCount);
+    public List<PatMedInhospDTO> selectPatMedInhospByApplication(PatMedInhosp patMedInhosp);
 
     /**
      * 鏌ヨ褰撳墠鐧婚檰浜鸿嚜宸憋紙鐥呭尯銆侀儴闂級鐨勬偅鑰呬綇闄㈣褰曞垪琛�
@@ -93,12 +98,12 @@
     public int dealOutHospInfo(String config);
 
     /**
-     * 澶勭悊浠巋is鍙栨潵鐨勫嚭闄㈡暟鎹�
+     * 澶勭悊浠巋is鍙栨潵鐨勫嚭闄㈡暟鎹� 浠诲姟缁勭敓鎴�
      *
      * @param
      * @return 缁撴灉
      */
-    public int dealOutHospInfoByDimension(String config);
+    public int dealOutHospInfoBySchedule(String config);
 
     /**
      * 鑾峰彇鍑洪櫌锛屼綇闄紝闂ㄨ瘖鏈嶅姟浜烘
@@ -123,4 +128,58 @@
      * @return 缁撴灉
      */
     public void addOperationSubTask(String config);
+
+    public ServiceSubtask boxedServiceSubtask(ServiceTask serviceTask, PatMedInhosp patMedInhosp1, PatArchive patArchive, String config, Integer type);
+
+    // ==========================================================================
+    // 鍑哄叆闄㈤殢璁挎ā鍧楀寲锛堢涓�鎵癸級鈥斺�� 渚� VisitTaskCreateApiBridge / OtherVisitApiBridge 澶嶇敤鐨勮繃娓″叆鍙�
+    //
+    // 鈿狅笍 杩� 3 涓柟娉曟槸<b>鍒绘剰鏂板</b>鐨勮繃娓℃湡鍏ュ彛锛堢函杞彂锛岄浂涓氬姟閫昏緫锛夛紝
+    //    涓嶆槸璇姞銆佷篃涓嶈"椤烘墜鍒犳帀"锛�
+    //      路 runOperationVisit(config)              鈥斺�� 璁� OtherVisitApiBridge 鏈変釜"闅忚鑳藉姏"褰㈢姸鐨勫叆鍙�
+    //      路 persistSubtask(subtask)                鈥斺�� 璁� VisitTaskCreateApiBridge 鏈夊敮涓�鐨勮惤搴撳叆鍙�
+    //      路 selectPendingDeptPatientsForVisit()    鈥斺�� 璁� PatMedInhospController 鍒囧埌鏂板叆鍙e悗
+    //                                                  浠嶈兘鎶婂垪琛ㄤ氦缁欓櫌澶�/闂ㄨ瘖鍚堝苟
+    //    鐢� sql/_probe/verify_step16_service_restore.py 涓� audit_worktree_changes.py 鐧昏鎶婂叧銆�
+    // ==========================================================================
+
+    /**
+     * 銆愯繃娓℃湡鐢ㄣ�戞墜鏈殢璁挎壂鎻忋��
+     * <p>
+     * 涓� {@link #addOperationSubTask(String)} <b>瀹屽叏绛変环</b>锛堟湰鏂规硶灏辨槸杞彂鍒板畠锛夛紝
+     * 瀛樺湪鐨勫敮涓�鐞嗙敱鏄粰 {@code OtherVisitApiBridge} 涓�涓�"鐪嬭捣鏉ュ睘浜庨殢璁胯兘鍔�"鐨勫叆鍙o紝
+     * 璁╂墜鏈殢璁垮皢鏉ユ惉鍘� {@code ruoyi-othervisit} 鏃跺彧鎹㈠疄鐜版柟銆�
+     * <p>
+     * 娉ㄦ剰锛歿@code addOperationSubTask} <b>涓嶈兘鍒�</b> 鈥斺�� 瀹冭
+     * {@code PatMedInhospController#addOperationSubTask}锛圲RL 涓嶅彉锛夌洿鎺ヨ皟鐢ㄣ��
+     *
+     * @param config {@code sys_config: visit.early.day}
+     * @return 澶勭悊鐨勬墜鏈褰曟暟
+     */
+    int runOperationVisit(String config);
+
+    /**
+     * 銆愯繃娓℃湡鐢ㄣ�戞妸銆岀瀹ょ淮搴︽湭澶勭悊鐨勫湪闄㈡偅鑰呫�嶅垪琛ㄨ鍑烘潵銆�
+     * <p>
+     * 渚� {@code PatMedInhospController#dealOutHospInfo}锛圲RL 涓嶅彉锛夊湪鍒囨崲鍒版柊鍏ュ彛鍚�
+     * 浠嶈兘鎶婂垪琛ㄤ氦缁� {@code IPatMedOuthospService} 鍋�"闄㈠闂ㄨ瘖 + 鍦ㄩ櫌"鍚堝苟銆�
+     * <p>
+     * 鏉′欢涓庡師 {@code dealOutHospInfo} 鐨勭涓�娈垫煡璇�<b>瀹屽叏涓�鑷�</b>锛�
+     * {@code deptcheck_flag='0'} + {@code inhospstate='1'} + {@code fuflag='1'}銆�
+     * 瀹炵幇鏄函杞彂锛坽@code selectPatMedInhospList}锛夛紝闆堕�昏緫鏀瑰姩銆�
+     *
+     * @return 绉戝缁村害鏈鐞嗙殑鍦ㄩ櫌鎮h��
+     */
+    List<PatMedInhosp> selectPendingDeptPatientsForVisit();
+
+    /**
+     * 銆愯繃娓℃湡鐢ㄣ�戞妸涓�鏉″凡缁勮濂界殑瀛愪换鍔¤惤搴撱��
+     * <p>
+     * 鍗曠嫭鎶藉嚭鏉ョ殑鐞嗙敱锛氳 {@code VisitTaskCreateApiBridge} 鏈変竴涓彲鎺х殑鍐欏叆鍙o紝
+     * 渚夸簬"鎼縼鍓嶅悗閫愯绛変环"鐨勬帰閽堟瘮瀵癸紱灏嗘潵銆岄殢璁夸换鍔″垱寤烘ā鍧椼�嶆帴绠℃椂鏇挎崲瀹炵幇鏂广��
+     *
+     * @param serviceSubtask 宸茬粍瑁呭ソ鐨勫瓙浠诲姟锛堣皟鐢ㄦ柟璐熻矗濉叏瀛楁锛�
+     * @return true = 钀藉簱鎴愬姛
+     */
+    boolean persistSubtask(ServiceSubtask serviceSubtask);
 }

--
Gitblit v1.9.3