From a40c2eb885bcdb697c2e16dae4f43cb6cd718973 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期一, 22 一月 2024 11:28:03 +0800
Subject: [PATCH] 优化小区数据

---
 service-job/src/main/java/com/java110/job/export/ExportDataExecutor.java |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/service-job/src/main/java/com/java110/job/export/ExportDataExecutor.java b/service-job/src/main/java/com/java110/job/export/ExportDataExecutor.java
index 3fe7682..2037e2b 100644
--- a/service-job/src/main/java/com/java110/job/export/ExportDataExecutor.java
+++ b/service-job/src/main/java/com/java110/job/export/ExportDataExecutor.java
@@ -3,9 +3,9 @@
 import com.java110.core.client.FileUploadTemplate;
 import com.java110.core.log.LoggerFactory;
 import com.java110.dto.data.ExportDataDto;
-import com.java110.dto.userDownloadFile.UserDownloadFileDto;
+import com.java110.dto.user.UserDownloadFileDto;
 import com.java110.intf.job.IUserDownloadFileV1InnerServiceSMO;
-import com.java110.po.userDownloadFile.UserDownloadFilePo;
+import com.java110.po.user.UserDownloadFilePo;
 import com.java110.utils.factory.ApplicationContextFactory;
 import com.java110.utils.util.ExceptionUtil;
 import com.java110.utils.util.StringUtil;
@@ -33,8 +33,7 @@
     private boolean isRun = false;
 
     public ExportDataExecutor(boolean isRun) {
-        this.userDownloadFileV1InnerServiceSMOImpl = ApplicationContextFactory.getBean("userDownloadFileV1InnerServiceSMOImpl", IUserDownloadFileV1InnerServiceSMO.class);
-        this.fileUploadTemplate = ApplicationContextFactory.getBean("fileUploadTemplate", FileUploadTemplate.class);
+
         this.isRun = isRun;
     }
 
@@ -48,7 +47,7 @@
             log.debug("瀵煎嚭鏁版嵁绾跨▼寮�濮嬪鐞�");
             try {
                 doExportData();
-            } catch (Exception e) {
+            } catch (Throwable e) {
                 log.error("澶勭悊娑堟伅寮傚父", e);
                 e.printStackTrace();
             }
@@ -61,6 +60,9 @@
     private void doExportData() throws Exception {
 
         ExportDataDto exportDataDto = ExportDataQueue.getData();
+
+        this.userDownloadFileV1InnerServiceSMOImpl = ApplicationContextFactory.getBean("userDownloadFileV1InnerServiceSMOImpl", IUserDownloadFileV1InnerServiceSMO.class);
+        this.fileUploadTemplate = ApplicationContextFactory.getBean("fileUploadTemplate", FileUploadTemplate.class);
 
         ByteArrayInputStream inputStream = null;
         ByteArrayOutputStream os = null;
@@ -91,7 +93,8 @@
 
             updateUserDownloadFile(exportDataDto, UserDownloadFileDto.STATE_FINISH,fileName, "涓嬭浇瀹屾垚");
 
-        } catch (Exception e) {
+        } catch (Throwable e) {
+            e.printStackTrace();
             updateUserDownloadFile(exportDataDto, UserDownloadFileDto.STATE_FAIL, "","涓嬭浇澶辫触" + ExceptionUtil.getStackTrace(e));
         } finally {
             try {
@@ -128,7 +131,10 @@
      * 绾跨▼鍚姩鍣�
      */
     public static void startExportDataExecutor() {
+        log.debug("寮�濮嬪垵濮嬪寲瀵煎嚭闃熷垪");
         ExecutorService executorService = Executors.newFixedThreadPool(DEFAULT_EXPORT_POOL);
         executorService.execute(new ExportDataExecutor(true));
+        log.debug("鍒濆鍖栧鍑洪槦鍒楀畬鎴�");
+
     }
 }

--
Gitblit v1.8.0