Przeglądaj źródła

- 正式环境配置;

Gizmo 1 rok temu
rodzic
commit
98edac4adf

+ 6 - 1
src/main/java/com/warewms/job/task/WareWmsTask.java

@@ -1,6 +1,7 @@
 package com.warewms.job.task;
 
 import com.warewms.service.HeXunDataService;
+import com.warewms.service.MachAlarmRecordsService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -20,12 +21,16 @@ public class WareWmsTask {
     @Autowired
     private HeXunDataService heXunDataService;
 
+    @Autowired
+    private MachAlarmRecordsService machAlarmRecordsService;
+
     /**
      * 定时回传报警信息
      */
     public void exec(){
 
-        log.info("------------------回传报警信息------------------");
+        machAlarmRecordsService.saveUnrecordedAlarm4MachineOne();
+        machAlarmRecordsService.saveUnrecordedAlarm4MachineTwo();
         heXunDataService.uploadAlarmData();
     }
 

+ 3 - 3
src/main/java/com/warewms/service/impl/HeXunDataServiceImpl.java

@@ -59,7 +59,7 @@ public class HeXunDataServiceImpl implements HeXunDataService {
             try {
 
                 log.info("Json:" + JsonUtils.toJson(heXunAlarmData));
-                String response = HttpRequest.postData("http://hxetm.com:20974/Interface_JCHGJT/info/addAlarm.do", JsonUtils.toJson(heXunAlarmData));
+                String response = HttpRequest.postData("http://61.159.85.59:20077/Interface_JCHGJT/info/addAlarm.do", JsonUtils.toJson(heXunAlarmData));
                 log.info("http response:" + response);
                 HeXunResponse heXunResponse = JSONObject.parseObject(response, HeXunResponse.class);
                 if ("200".equals(heXunResponse.getCode())) {
@@ -112,7 +112,7 @@ public class HeXunDataServiceImpl implements HeXunDataService {
             try {
 
                 log.info("Json:" + JsonUtils.toJson(parameters));
-                String response = HttpRequest.postData("http://hxetm.com:20974/Interface_JCHGJT/info/addDevice.do", JsonUtils.toJson(parameters));
+                String response = HttpRequest.postData("http://61.159.85.59:20077/Interface_JCHGJT/info/addDevice.do", JsonUtils.toJson(parameters));
                 log.info("http response:" + response);
                 HeXunResponse heXunResponse = JSONObject.parseObject(response, HeXunResponse.class);
                 if ("200".equals(heXunResponse.getCode())) {
@@ -161,7 +161,7 @@ public class HeXunDataServiceImpl implements HeXunDataService {
             try {
 
                 log.info("Json:" + JsonUtils.toJson(parameters));
-                String response = HttpRequest.postData("http://hxetm.com:20974/Interface_JCHGJT/info/addCheckPoint.do", JsonUtils.toJson(parameters));
+                String response = HttpRequest.postData("http://61.159.85.59:20077/Interface_JCHGJT/info/addCheckPoint.do", JsonUtils.toJson(parameters));
                 log.info("http response:" + response);
                 HeXunResponse heXunResponse = JSONObject.parseObject(response, HeXunResponse.class);
                 if ("200".equals(heXunResponse.getCode())) {

+ 4 - 4
src/main/java/com/warewms/service/impl/MachAlarmRecordsServiceImpl.java

@@ -39,7 +39,7 @@ public class MachAlarmRecordsServiceImpl extends BaseServiceImpl<MachAlarmRecord
                         "\tc.device_name AS 'device_name',\n" +
                         "\tb.data_img_url AS 'img_url'\n" +
                         "from x521_1.rt_device_alarm a, x521_1.rt_device_data_inf b, x521_1.rt_device c\n" +
-                        "where a.task_id = b.task_id and a.device_tag = b.device_tag \n" +
+                        "where a.alarm_date > '2022-12-31 23:59:59' and a.task_id = b.task_id and a.device_tag = b.device_tag \n" +
                         "and a.alarm_date = b.data_date and a.device_tag = c.device_tag\n" +
                         "union all\n" +
                         "select \n" +
@@ -57,7 +57,7 @@ public class MachAlarmRecordsServiceImpl extends BaseServiceImpl<MachAlarmRecord
                         "\tc.device_name AS 'device_name',\n" +
                         "\tb.data_img_url AS 'img_url'\n" +
                         "from x521_1.rt_device_alarm a, x521_1.rt_device_data_ins b, x521_1.rt_device c\n" +
-                        "where a.task_id = b.task_id and a.device_tag = b.device_tag \n" +
+                        "where a.alarm_date > '2022-12-31 23:59:59' and a.task_id = b.task_id and a.device_tag = b.device_tag \n" +
                         "and a.alarm_date = b.data_date and a.device_tag = c.device_tag) AS temp\n" +
                         "where temp.alarm_id > " + latestAlarmId);
 
@@ -98,7 +98,7 @@ public class MachAlarmRecordsServiceImpl extends BaseServiceImpl<MachAlarmRecord
                         "\tc.device_name AS 'device_name',\n" +
                         "\tb.data_img_url AS 'img_url'\n" +
                         "from x521_2.rt_device_alarm a, x521_2.rt_device_data_inf b, x521_2.rt_device c\n" +
-                        "where a.task_id = b.task_id and a.device_tag = b.device_tag \n" +
+                        "where a.alarm_date > '2022-12-31 23:59:59' and a.task_id = b.task_id and a.device_tag = b.device_tag \n" +
                         "and a.alarm_date = b.data_date and a.device_tag = c.device_tag\n" +
                         "union all\n" +
                         "select \n" +
@@ -116,7 +116,7 @@ public class MachAlarmRecordsServiceImpl extends BaseServiceImpl<MachAlarmRecord
                         "\tc.device_name AS 'device_name',\n" +
                         "\tb.data_img_url AS 'img_url'\n" +
                         "from x521_2.rt_device_alarm a, x521_2.rt_device_data_ins b, x521_2.rt_device c\n" +
-                        "where a.task_id = b.task_id and a.device_tag = b.device_tag \n" +
+                        "where a.alarm_date > '2022-12-31 23:59:59' and a.task_id = b.task_id and a.device_tag = b.device_tag \n" +
                         "and a.alarm_date = b.data_date and a.device_tag = c.device_tag) AS temp\n" +
                         "where temp.alarm_id > " + latestAlarmId);