From ab2884ade73fed97d1e7d7daf4b9b5b6dee83fdd Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期四, 29 十月 2026 09:26:12 +0800
Subject: [PATCH] 代码提交

---
 ruoyi-inhospvisit/src/main/java/com/ruoyi/inhospvisit/service/InhospVisitTaskService.java |   61 +++++++++++++++---------------
 1 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/ruoyi-inhospvisit/src/main/java/com/ruoyi/inhospvisit/service/InhospVisitTaskService.java b/ruoyi-inhospvisit/src/main/java/com/ruoyi/inhospvisit/service/InhospVisitTaskService.java
index da4789a..3abdc83 100644
--- a/ruoyi-inhospvisit/src/main/java/com/ruoyi/inhospvisit/service/InhospVisitTaskService.java
+++ b/ruoyi-inhospvisit/src/main/java/com/ruoyi/inhospvisit/service/InhospVisitTaskService.java
@@ -4,6 +4,7 @@
 import com.ruoyi.common.core.service.PublicityApi;
 import com.ruoyi.common.core.service.PublicityDataPort;
 import com.ruoyi.common.core.service.dto.InHospPublicityRowDto;
+import com.ruoyi.common.core.service.dto.VisitInhospUpdateDto;
 import com.ruoyi.common.core.service.dto.VisitTaskRuleDto;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.core.service.dto.VisitArchiveRow;
@@ -100,7 +101,7 @@
 
         // 鍘� L331-409 + L411-444锛氫袱娈靛鏁欐敼涓哄洖璋冨鏁欐ā鍧�
         // 鈿狅笍 杩欓噷涓嶅啀鍐呰仈瀹炵幇 鈥斺�� 鍚﹀垯浼氫笌 ruoyi-publicity 閲岀殑瀹炵幇"鍙戜袱閬�"
-        dealInHospPublicityAndMedical(config);
+//        dealInHospPublicityAndMedical(config);
 
         // 鍘� L445-451锛氬熀浜庤鍒欑殑鍑洪櫌闅忚 + 鎵嬫湳闅忚
         addSubTaskByRule(config, patMedInhosps);
@@ -179,8 +180,7 @@
             // 鍘� L1692-1700锛氳幏鍙栨偅鑰呭熀鏈俊鎭紝涓虹┖鍒欏啓 deptcheck=2 + reason
             VisitArchiveRow archive = archiveMapper.selectByPatid(row.getPatid());
             if (archive == null) {
-                com.ruoyi.common.core.service.dto.VisitInhospUpdateDto u =
-                        new com.ruoyi.common.core.service.dto.VisitInhospUpdateDto();
+                VisitInhospUpdateDto u = new VisitInhospUpdateDto();
                 u.setInhospid(row.getInhospid());
                 u.setDeptcheckFlag("2");
                 u.setLongTaskReason("鎮h�呭熀鏈俊鎭负绌�");
@@ -197,8 +197,7 @@
                 // 鍘� L1839-1845锛堝湪缂栨帓鍣ㄩ噷涔熸湁锛屼絾澶栧眰閬嶅巻杩欎竴灞傚師瀹炵幇娌℃湁 try/catch锛�
                 // 杩欓噷鍔犱竴灞傛槸涓轰簡"鍗曟偅鑰呭け璐ヤ笉褰卞搷鍏跺畠鎮h��"锛屽睘鍋ュ.鎬ф敼杩涳紝宸茬櫥璁帮級
                 log.error("銆愬熀浜庤鍒欍�戞偅鑰厈}澶栧眰澶勭悊寮傚父锛歿}", row.getInhospid(), e.getMessage());
-                com.ruoyi.common.core.service.dto.VisitInhospUpdateDto u =
-                        new com.ruoyi.common.core.service.dto.VisitInhospUpdateDto();
+                com.ruoyi.common.core.service.dto.VisitInhospUpdateDto u = new com.ruoyi.common.core.service.dto.VisitInhospUpdateDto();
                 u.setInhospid(row.getInhospid());
                 u.setDeptcheckFlag("2");
                 u.setLongTaskReason("鍩轰簬瑙勫垯澶勭悊寮傚父");
@@ -221,32 +220,31 @@
     // ==========================================================================
 
     /**
-     * 浠诲姟缁勶紙appltype=5锛夐杞撼鍏� 鈥斺�� <b>鏈涓嶆惉锛屼粛鐣欏湪 smartor</b>銆�
+     * 浠诲姟缁勶紙appltype=5锛夐杞撼鍏� 鈥斺�� 鏈柟娉�<b>鏄┖澹�</b>锛岀湡姝g殑瀹炵幇涓嶅湪鏈ā鍧椼��
      *
-     * <h3>涓轰粈涔堜笉鎼紙涓�涓繀椤昏鏄庣殑鑼冨洿鍐冲畾锛�</h3>
-     * 鍘� {@code dealOutHospInfoBySchedule}(L471-614) 鐢变袱娈垫瀯鎴愶細
-     * <ul>
-     *   <li><b>闈炴墜鏈垎鏀�</b>锛圠518-558锛夛細鎸夌淮搴﹁繃婊ゆ壂鎮h�� 鈫� {@code boxedServiceSubtask} 鈫�
-     *       {@code scheduleSubtaskBuilder.buildSubtasksForPatient}锛堜竴娆$敓鎴� N 鏉★級鈫� 缃� flag锛�</li>
-     *   <li><b>鎵嬫湳鍒嗘敮</b>锛圠559-608锛夛細{@code selectOperationItemListMaxLevel} +
-     *       {@code boxedServiceSubtaskForOp} 鈫� 鍚屼竴 builder銆�</li>
-     * </ul>
-     * 涓ゆ閮戒緷璧� {@code ScheduleSubtaskBuilder} 鈥斺�� 瀹冨悓鏃舵湇鍔�"HIS 鑷姩绾冲叆"涓�
-     * "鍓嶇鎵嬪姩鍕鹃�夋偅鑰�"涓ゆ潯璺緞锛堣鍏剁被娉ㄩ噴锛夛紝**涓嶅睘浜庢湰娆¤寖鍥�**銆�
-     * 鑰屾墜鏈垎鏀寜鐗堝浘灞炵浜屾壒鐨� {@code ruoyi-othervisit}銆�
-     * <p>
-     * 鎵�浠ユ湰娆℃妸<b>鏁翠釜鏂规硶鐣欏湪 smartor</b>锛堣涓轰竴琛屼笉鍙橈級锛�
-     * 绛夌浜屾壒鍋� {@code ruoyi-othervisit} 鏃惰繛鍚屼换鍔$粍閾捐矾涓�璧锋敹璧般��
-     * <p>
-     * 杩欐牱鍋氱殑濂藉锛氭湰杞笉闇�瑕佷负 {@code ScheduleSubtaskBuilder} 鍐嶉�犱竴涓鍙o紝
-     * 涔熶笉浼氬洜涓�"鎼竴鍗婄暀涓�鍗�"鑰屽湪涓ゅ鐢熸垚浠诲姟缁勭殑瀛愪换鍔°��
+     * <h3>2026-11 绗� 7 杞箣鍚庣殑瀹為檯閾捐矾</h3>
+     * <pre>
+     * InhospVisitFacade#dealOutHospInfoBySchedule
+     *   鈫� DefaultInhospVisitApi#dealOutHospInfoBySchedule
+     *     鈫� OtherVisitApi锛坮uoyi-common 濂戠害锛�
+     *       鈫� ruoyi-task/api/contract/OtherVisitApiImpl
+     *         鈫� OperationSubtaskWriter#dealOutHospInfoBySchedule
+     * </pre>
+     * 鍗筹細瀹炵幇鍦� <b>ruoyi-task</b>锛坰martor 渚ч偅涓� {@code OtherVisitApiBridge} 宸插湪绗� 7 杞垹闄わ級銆�
+     * 涔嬫墍浠ヤ笉鍦� othervisit锛歿@code task -> othervisit -> patarchive -> task} 浼氭垚鐜��
+     *
+     * <h3>涓轰粈涔堣繖閲屼笉瀹炵幇銆佷篃涓嶅垹</h3>
+     * 鏈柟娉�<b>鍏ㄤ粨闆惰皟鐢�</b>锛堝彧鏈� {@code DefaultInhospVisitApi} 璋冪殑鏄�
+     * {@code inhospVisitTaskService.dealOutHospInfo}锛屼笉鏄畠锛夛紝
+     * 鏄渶鏃╀竴杞暀涓嬬殑鍗犱綅锛涘垹瀹冭璧� {@code plan_method_prune.py} 鐨勮瘉鎹祦绋嬶紝
+     * 鏈疆鍙妸"浠嶇敱 smartor 鎵挎帴"杩欏彞宸茬粡杩囨湡鐨勮瘽鏀规帀锛屽厤寰楀悗浜虹収鐫�娉ㄩ噴鎵鹃敊鍦版柟銆�
      *
      * @param config {@code sys_config: visit.early.day}
      * @return 鍘熷疄鐜板浐瀹氳繑鍥� 1
      */
     public int dealOutHospInfoBySchedule(String config) {
-        log.warn("銆愬嚭鍏ラ櫌闅忚銆慸ealOutHospInfoBySchedule 鏈鏈惉杩侊紙鍚墜鏈垎鏀笌浠诲姟缁� builder锛�"
-                + "灞炵浜屾壒 ruoyi-othervisit 鑼冨洿锛夛紝浠嶇敱 smartor 鐨勫疄鐜版壙鎺ャ�俢onfig={}", config);
+        log.warn("銆愬嚭鍏ラ櫌闅忚銆慖nhospVisitTaskService#dealOutHospInfoBySchedule 鏄湭琚皟鐢ㄧ殑鍗犱綅锛�"
+                + "鐪熸鐨勫疄鐜板湪 ruoyi-task/api/contract/OtherVisitApiImpl銆俢onfig={}", config);
         return 1;
     }
 
@@ -254,12 +252,13 @@
     // 杈呭姪
     // ==========================================================================
 
-    /** 鍘� L1703-1707锛氭寜绂婚櫌绉戝/鐥呭尯鏌ヨ鍒欙紙鍙栦笉鍒扮鍙f椂杩斿洖 null = 鏈厤缃鍒� 鈫� 鍏ㄩ儴鐢熸垚锛� */
+    /**
+     * 鍘� L1703-1707锛氭寜绂婚櫌绉戝/鐥呭尯鏌ヨ鍒欙紙鍙栦笉鍒扮鍙f椂杩斿洖 null = 鏈厤缃鍒� 鈫� 鍏ㄩ儴鐢熸垚锛�
+     */
     private VisitTaskRuleDto findTaskRule(VisitInhospRow row) {
         PublicityDataPort port = dataPort();
         if (port == null) {
-            log.warn("銆愬嚭鍏ラ櫌闅忚銆慞ublicityDataPort 涓嶅彲鐢紝瑙勫垯鎸夈�屾湭閰嶇疆銆嶅鐞嗭紙鍏ㄩ儴鐢熸垚锛夈�俰nhospid={}",
-                    row.getInhospid());
+            log.warn("銆愬嚭鍏ラ櫌闅忚銆慞ublicityDataPort 涓嶅彲鐢紝瑙勫垯鎸夈�屾湭閰嶇疆銆嶅鐞嗭紙鍏ㄩ儴鐢熸垚锛夈�俰nhospid={}", row.getInhospid());
             return null;
         }
         try {
@@ -270,7 +269,9 @@
         }
     }
 
-    /** 鎶婄鍙g殑瑙勫垯 DTO 閫傞厤鎴愮紪鎺掑櫒鍐呭祵鐨勮鍒欒鍥撅紙瀛楁涓�涓�瀵瑰簲锛屽惈鎷奸敊鐨� {@code wradRule}锛� */
+    /**
+     * 鎶婄鍙g殑瑙勫垯 DTO 閫傞厤鎴愮紪鎺掑櫒鍐呭祵鐨勮鍒欒鍥撅紙瀛楁涓�涓�瀵瑰簲锛屽惈鎷奸敊鐨� {@code wradRule}锛�
+     */
     private InhospTaskOrchestrator.VisitTaskRule toOrchestratorRule(VisitTaskRuleDto dto) {
         if (dto == null) {
             return null;
@@ -282,7 +283,7 @@
         return r;
     }
 
-    private void updateInhosp(com.ruoyi.common.core.service.dto.VisitInhospUpdateDto u) {
+    private void updateInhosp(VisitInhospUpdateDto u) {
         PublicityDataPort port = dataPort();
         if (port == null) {
             log.warn("銆愬嚭鍏ラ櫌闅忚銆慞ublicityDataPort 涓嶅彲鐢紝鏃犳硶鍐欏洖鏍囧織浣嶃�俰nhospid={}", u.getInhospid());

--
Gitblit v1.9.3