From 599beddc80e7e50b2099bacdbf7df2d89df00ef2 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期六, 07 十一月 2026 14:42:31 +0800
Subject: [PATCH] fix: 完成时状态与超时判断区分任务组

---
 ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/CollectHISController.java |   43 ++++++++++++++++++++++++++++++++++---------
 1 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/CollectHISController.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/CollectHISController.java
index 0de0204..5cf62bb 100644
--- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/CollectHISController.java
+++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/CollectHISController.java
@@ -5,9 +5,10 @@
 import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.quartz.service.ICollectHISService;
-import com.smartor.domain.HnDataGatherVO;
-import com.smartor.domain.Icd10;
-import com.smartor.service.IHNGatherPatArchiveService;
+import com.ruoyi.datacollection.domain.HnDataGatherVO;
+import com.ruoyi.common.core.domain.entity.Icd10;
+import com.ruoyi.datacollection.service.IHNGatherPatArchiveService;
+import com.smartor.common.SpecificArchiveConstants;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -31,10 +32,31 @@
     @PostMapping("/collect")
     @ApiOperation("鍚屾鐥呬汉鐩稿叧鏁版嵁")
     public AjaxResult hnDataGather(@RequestBody HnDataGatherVO hnDataGatherVO) {
+        try {
+            Integer count =ichService.sync();
+            return AjaxResult.success(count);
+        } catch (Exception ex) {
+            return AjaxResult.error(ex.getMessage());
+        }
 
-        //Boolean aBoolean = ichService.hnDataGather(hnDataGatherVO);
-       Integer count= ichService.sync();
-        return AjaxResult.success(count);
+    }
+
+    /**
+     * 閲囬泦涓芥按甯傚骞间繚鍋ラ櫌闂ㄨ瘖鎺ヨ瘖瀹屾垚璁板綍锛屽苟鐢熸垚濡囩/鍎跨妗f銆�
+     * 璇锋眰浣撳彲浼� startTime銆乪ndTime锛坹yyy-MM-dd 鎴� yyyy-MM-dd HH:mm:ss锛夛紝涓嶄紶榛樿閲囬泦鏄ㄥぉ銆�
+     */
+    @PostMapping("/collectMchArchive")
+    @ApiOperation("閲囬泦涓芥按濡囧辜闂ㄨ瘖鎺ヨ瘖瀹屾垚璁板綍骞剁敓鎴愪笓绉戞。妗�")
+    public AjaxResult collectMchArchive(@RequestBody(required = false) HnDataGatherVO hnDataGatherVO) {
+        try {
+            HnDataGatherVO request = hnDataGatherVO != null ? hnDataGatherVO : new HnDataGatherVO();
+            Integer count = ichService.collectMchOuthospAndGenerateArchive(
+                    SpecificArchiveConstants.LISHUI_MCH_ORG_ID, request.getStartTime(), request.getEndTime());
+            return AjaxResult.success(count);
+        } catch (Exception ex) {
+            log.error("閲囬泦涓芥按濡囧辜闂ㄨ瘖鎺ヨ瘖瀹屾垚璁板綍澶辫触", ex);
+            return AjaxResult.error(ex.getMessage());
+        }
     }
 
     /**
@@ -48,13 +70,16 @@
     }
 
     /**
-     * 鐢ㄦ埛淇℃伅闆嗗悎淇℃伅鏁版嵁閲囬泦
+     * 鐢ㄦ埛淇℃伅闆嗗悎淇℃伅鏁版嵁閲囬泦锛堝紓姝ユ墽琛岋紝鎺ュ彛绔嬪嵆杩斿洖锛�
      */
     @PostMapping("/collectUser")
     @ApiOperation("鍚屾鐢ㄦ埛淇℃伅")
     public AjaxResult selectUserList(@RequestBody SysUser sysUser) {
-        Integer integer = ichService.selectUserList(sysUser);
-        return AjaxResult.success(integer);
+        boolean submitted = ichService.selectUserListAsync(sysUser);
+        if (!submitted) {
+            return AjaxResult.warn("鐢ㄦ埛淇℃伅鍚屾浠诲姟姝e湪鎵ц涓紝璇峰嬁閲嶅鎻愪氦");
+        }
+        return AjaxResult.success("鐢ㄦ埛淇℃伅鍚屾浠诲姟宸叉彁浜わ紝鍚庡彴鎵ц涓紝璇烽�氳繃鏃ュ織鏌ョ湅杩涘害");
     }
 
     /**

--
Gitblit v1.9.3