Browse Source

- 定时任务添加;
- 正式环境配置;

Gizmo 1 year ago
parent
commit
dcc7df4cde

+ 27 - 86
src/main/java/com/warewms/job/task/WareWmsTask.java

@@ -1,8 +1,6 @@
 package com.warewms.job.task;
 
-import com.jfinal.plugin.activerecord.Db;
-import com.warewms.common.annotation.JFinalTx;
-import com.warewms.common.utils.HttpRequest;
+import com.warewms.service.HeXunDataService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -19,92 +17,35 @@ import org.springframework.stereotype.Component;
 @Component("wareWmsTask")
 public class WareWmsTask {
 
+    @Autowired
+    private HeXunDataService heXunDataService;
 
-//
-//    /**
-//     * 检验WMS企业信息证照信息是否过期
-//     */
-//    public void checkEnterpriseDateValidation() {
-//        try {
-//            HttpRequest.postData("kayeeApiConfig.getUrl()");
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//    }
-//
-//    /**
-//     * 刷新提醒数据
-//     */
-//    public void requestRemind() {
-//        try {
-//            HttpRequest.postData("http://47.100.226.205:8080/remindController.do?remind");
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//    }
-//
-//    /**
-//     * 统计用户绩效
-//     */
-//    public void requestUserStatisticsPerformance() {
-//        try {
-//            HttpRequest.postData("http://47.100.226.205:8080/userStatisticsPerformanceController.do?performanceStatistics");
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//    }
-//
     /**
-     * 清除定时任务日志
+     * 定时回传报警信息
      */
     public void exec(){
-        log.info("Schedule...................");
+
+        log.info("------------------回传报警信息------------------");
+        heXunDataService.uploadAlarmData();
+    }
+
+    /**
+     * 定时回传检测点信息
+     */
+    public void uploadPointData() {
+
+        log.info("------------------回传检测点信息------------------");
+        heXunDataService.uploadPointOneData();
+        heXunDataService.uploadPointTwoData();
+    }
+
+    /**
+     * 定时回传机器人信息
+     */
+    public void uploadRobotData() {
+
+        log.info("------------------回传机器人信息------------------");
+        heXunDataService.uploadRobotOneData();
+        heXunDataService.uploadRobotTwoData();
     }
-//
-//    /**
-//     * 初始化库位状态
-//     */
-//    public void initLocationStatus(){
-//
-//        log.info("开始初始化库位状态------------->>>>");
-//        String sql = Db.getSql("location.initLocationStatus");
-//        Db.update(sql);
-//        log.info("初始化库位状态完成-------------<<<<");
-//    }
-//
-//    /**
-//     * 库存备份、库存量监测
-//     */
-//    public void invBackup() {
-//
-//        log.info("↓↓↓↓↓↓↓↓↓↓↓↓↓库存备份、库存量监测↓↓↓↓↓↓↓↓↓↓↓↓↓");
-//        try {
-//
-//            invLotBackupService.backup();
-//            invLotLocIdBackupService.backup();
-//
-//            commonService.inventoryDetection();
-//        } catch (Exception e) {
-//
-//            e.printStackTrace();
-//        }
-//    }
-//
-//    /**
-//     * !!!!!!数据归档 !!!!!!
-//     * 不了解业务请不要随意动
-//     */
-//    @JFinalTx
-//    public void dataArchive() {
-//
-//        log.info("↓↓↓↓↓↓↓↓↓↓↓↓↓归档↓↓↓↓↓↓↓↓↓↓↓↓↓");
-//        try {
-//
-//            commonService.dataArchive();
-//        } catch (Exception e) {
-//
-//            log.error("数据定时归档操作失败:》》》》》》》》》》》》》》》》》》》》》》》》" + e.getMessage());
-//            throw new RuntimeException(e);
-//        }
-//    }
 }

+ 71 - 8
src/main/resources/application-prod.yml

@@ -36,19 +36,82 @@ spring:
                         config:
                             multi-statement-allow: true
             second:  #数据源2
-                driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
-                url: jdbc:sqlserver://172.27.16.3:1433;DatabaseName=SOADB
-                username: agv
-                password: agv
-                initial-size: 1
-                max-active: 10
-                min-idle: 10
+                url: jdbc:log4jdbc:mysql://localhost:3306/x521?allowMultiQueries=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
+                username: root
+                password: wyt312gizmo
+                initial-size: 10
+                max-active: 50
+                min-idle: 1
                 max-wait: 60000
                 pool-prepared-statements: true
                 max-pool-prepared-statement-per-connection-size: 20
                 time-between-eviction-runs-millis: 60000
                 min-evictable-idle-time-millis: 300000
-                validation-query: SELECT getdate()
+                validation-query: SELECT 1 FROM DUAL
+                test-while-idle: true
+                test-on-borrow: false
+                test-on-return: false
+                removeAbandonedTimeout: 1800
+                removeAbandoned: false
+                #removeAbandonedTimeoutMillis: 300000
+                stat-view-servlet:
+                    enabled: true
+                    url-pattern: /druid/*
+                    #login-username: admin
+                    #login-password: admin
+                filter:
+                    stat:
+                        log-slow-sql: true
+                        slow-sql-millis: 1000
+                        merge-sql: true
+                    wall:
+                        config:
+                            multi-statement-allow: true
+            third:  #数据源3
+                url: jdbc:log4jdbc:mysql://localhost:3306/x521_2?allowMultiQueries=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
+                username: root
+                password: wyt312gizmo
+                initial-size: 10
+                max-active: 50
+                min-idle: 1
+                max-wait: 60000
+                pool-prepared-statements: true
+                max-pool-prepared-statement-per-connection-size: 20
+                time-between-eviction-runs-millis: 60000
+                min-evictable-idle-time-millis: 300000
+                validation-query: SELECT 1 FROM DUAL
+                test-while-idle: true
+                test-on-borrow: false
+                test-on-return: false
+                removeAbandonedTimeout: 1800
+                removeAbandoned: false
+                #removeAbandonedTimeoutMillis: 300000
+                stat-view-servlet:
+                    enabled: true
+                    url-pattern: /druid/*
+                    #login-username: admin
+                    #login-password: admin
+                filter:
+                    stat:
+                        log-slow-sql: true
+                        slow-sql-millis: 1000
+                        merge-sql: true
+                    wall:
+                        config:
+                            multi-statement-allow: true
+            fourth:  #数据源4
+                url: jdbc:log4jdbc:mysql://localhost:3306/x521_1?allowMultiQueries=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
+                username: root
+                password: wyt312gizmo
+                initial-size: 10
+                max-active: 50
+                min-idle: 1
+                max-wait: 60000
+                pool-prepared-statements: true
+                max-pool-prepared-statement-per-connection-size: 20
+                time-between-eviction-runs-millis: 60000
+                min-evictable-idle-time-millis: 300000
+                validation-query: SELECT 1 FROM DUAL
                 test-while-idle: true
                 test-on-borrow: false
                 test-on-return: false