From a022ae9804d0c2f402711b6b5202319d853919cf Mon Sep 17 00:00:00 2001
From: cjl <909710561@qq.com>
Date: Fri, 09 Aug 2024 13:38:47 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into cjl

---
 screen-job/src/main/java/com/moral/api/task/CreateTableTask.java |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 52 insertions(+), 2 deletions(-)

diff --git a/screen-job/src/main/java/com/moral/api/task/CreateTableTask.java b/screen-job/src/main/java/com/moral/api/task/CreateTableTask.java
index 2fab184..b6e0621 100644
--- a/screen-job/src/main/java/com/moral/api/task/CreateTableTask.java
+++ b/screen-job/src/main/java/com/moral/api/task/CreateTableTask.java
@@ -1,9 +1,11 @@
 package com.moral.api.task;
 
+import com.moral.api.service.AlarmInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import com.moral.api.service.HistoryFiveMinutelyService;
+import com.moral.api.service.HistoryHourlyService;
 import com.moral.api.service.HistoryMinutelyService;
 import com.moral.constant.Constants;
 import com.moral.util.DateUtils;
@@ -20,6 +22,12 @@
     @Autowired
     private HistoryMinutelyService historyMinutelyService;
 
+    @Autowired
+    private HistoryHourlyService historyHourlyService;
+
+    @Autowired
+    private AlarmInfoService alarmInfoService;
+
 
     //���������������������
     @XxlJob("createHistoryMinutelyTable")
@@ -32,7 +40,7 @@
             historyMinutelyService.createTable(timeUnits + "_" + Constants.UN_ADJUST);
         } catch (Exception e) {
             XxlJobHelper.log(e.getMessage());
-            return ReturnT.FAIL;
+            return new ReturnT(ReturnT.FAIL_CODE, e.getMessage());
         }
         return ReturnT.SUCCESS;
     }
@@ -45,7 +53,49 @@
             historyFiveMinutelyService.createTable(timeUnits);
         } catch (Exception e) {
             XxlJobHelper.log(e.getMessage());
-            return ReturnT.FAIL;
+            return new ReturnT(ReturnT.FAIL_CODE, e.getMessage());
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    //���������������������
+    @XxlJob("createHistoryHourlyTable")
+    public ReturnT createHistoryHourlyTable() {
+        String timeUnits = DateUtils.getDateStringOfMon(1, DateUtils.yyyyMM_EN);
+        try {
+            //������������������
+            historyHourlyService.createTable(timeUnits);
+            //������������������
+            historyHourlyService.createTable(timeUnits + "_" + Constants.UN_ADJUST);
+        } catch (Exception e) {
+            XxlJobHelper.log(e.getMessage());
+            return new ReturnT(ReturnT.FAIL_CODE, e.getMessage());
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    //���������������������������������������������������������������
+    @XxlJob("createHistoryHourlyCompleteTable")
+    public ReturnT createHistoryHourlyCompleteTable(){
+        String timeUnits = DateUtils.getDateStringOfMon(1, DateUtils.yyyyMM_EN);
+        try {
+            historyHourlyService.createTableComplete(timeUnits);
+        } catch (Exception e) {
+            XxlJobHelper.log(e.getMessage());
+            return new ReturnT(ReturnT.FAIL_CODE, e.getMessage());
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    //���������������������
+    @XxlJob("createAlarmInfoTable")
+    public ReturnT createAlarmInfoTable() {
+        String timeUnits = DateUtils.getDateStringOfMon(1, DateUtils.yyyyMM_EN);
+        try {
+            alarmInfoService.createTable(timeUnits);
+        } catch (Exception e) {
+            XxlJobHelper.log(e.getMessage());
+            return new ReturnT(ReturnT.FAIL_CODE, e.getMessage());
         }
         return ReturnT.SUCCESS;
     }

--
Gitblit v1.8.0