Răsfoiți Sursa

工业库获取数据地址调整 从10.0.0.27 换成192.168.40.23

王苗苗 3 luni în urmă
părinte
comite
a71f718f84

BIN
.DS_Store


+ 3 - 2
slibra-admin/src/main/java/com/slibra/web/controller/business/DataHandleByHand.java

@@ -10,6 +10,8 @@ import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 
+import static com.slibra.common.constant.MyConstants.INDUSTRY_INTERFACE_ADDR;
+
 /***
  *
  * 手动处处理一些数据
@@ -49,13 +51,12 @@ public class DataHandleByHand {
             currentHour = currentHour.plusMinutes(10);
 
             //每个小时查询一次数据
-            String url = "http://10.0.0.27:4568/api/v1/khquerydata";
             HashMap<String, Object> req = new HashMap<>();
             req.put("tagNames", queryTags);
             req.put("startTime", begin);
             req.put("endTime", end);
             req.put("recordNumbers", 100000);
-            String body = HttpRequest.post(url).header("Authorization", "c2E6c2E=").header("clientName", "hongshan").body(JSON.toJSONString(req)).execute().body();
+            String body = HttpRequest.post(INDUSTRY_INTERFACE_ADDR).header("Authorization", "c2E6c2E=").header("clientName", "hongshan").body(JSON.toJSONString(req)).execute().body();
             System.out.println("body = " + body);
             //行转列数据处理
             for (String queryTag : queryTags) {

+ 2 - 4
slibra-admin/src/main/java/com/slibra/web/controller/business/HandleDataController.java

@@ -234,13 +234,12 @@ public class HandleDataController extends BaseController
             currentHour = currentHour.plusMinutes(10);
 
             //每个小时查询一次数据
-            String url = "http://10.0.0.27:4568/api/v1/khquerydata";
             HashMap<String, Object> req = new HashMap<>();
             req.put("tagNames", queryTags);
             req.put("startTime", begin);
             req.put("endTime", end);
             req.put("recordNumbers", 100000);
-            String body = HttpRequest.post(url).header("Authorization", "c2E6c2E=").header("clientName", "hongshan").body(JSON.toJSONString(req)).execute().body();
+            String body = HttpRequest.post(INDUSTRY_INTERFACE_ADDR).header("Authorization", "c2E6c2E=").header("clientName", "hongshan").body(JSON.toJSONString(req)).execute().body();
 //            System.out.println("body = " + body);
             List<HashMap<String, String>> list = new ArrayList<>();
 
@@ -759,13 +758,12 @@ public class HandleDataController extends BaseController
             currentHour = currentHour.plusDays(1);
 
             //每个小时查询一次数据
-            String url = "http://10.0.0.27:4568/api/v1/khquerydata";
             HashMap<String, Object> req = new HashMap<>();
             req.put("tagNames", queryTags);
             req.put("startTime", begin);
             req.put("endTime", end);
             req.put("recordNumbers", 100000);
-            String body = HttpRequest.post(url).header("Authorization", "c2E6c2E=").header("clientName", "hongshan").body(JSON.toJSONString(req)).execute().body();
+            String body = HttpRequest.post(INDUSTRY_INTERFACE_ADDR).header("Authorization", "c2E6c2E=").header("clientName", "hongshan").body(JSON.toJSONString(req)).execute().body();
 //            System.out.println("body = " + body);
             List<HashMap<String, String>> list = new ArrayList<>();
 

+ 1 - 1
slibra-common/src/main/java/com/slibra/common/constant/MyConstants.java

@@ -18,7 +18,7 @@ public class MyConstants {
     public static final String DENGBAO_ENVIRONMENT = "dengbao";
 
 
-
+    public static final String INDUSTRY_INTERFACE_ADDR = "http://192.168.40.23:4568/api/v1/khquerydata";
 
 
     //报警计算使用的比例  默认是1.1倍

+ 3 - 2
slibra-quartz/src/main/java/com/slibra/quartz/task/GetRealTimeData.java

@@ -13,6 +13,8 @@ import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 
+import static com.slibra.common.constant.MyConstants.INDUSTRY_INTERFACE_ADDR;
+
 @Slf4j
 public class GetRealTimeData {
 
@@ -47,13 +49,12 @@ public class GetRealTimeData {
         System.out.println("结束时间:" + end);
 
         //每个小时查询一次数据
-        String url = "http://10.0.0.27:4568/api/v1/khquerydata";
         HashMap<String, Object> req = new HashMap<>();
         req.put("tagNames", queryTags);
         req.put("startTime", begin);
         req.put("endTime", end);
         req.put("recordNumbers", 100000);
-        String body = HttpRequest.post(url).header("Authorization", "c2E6c2E=").header("clientName", "hongshan").body(JSON.toJSONString(req)).execute().body();
+        String body = HttpRequest.post(INDUSTRY_INTERFACE_ADDR).header("Authorization", "c2E6c2E=").header("clientName", "hongshan").body(JSON.toJSONString(req)).execute().body();
         System.out.println("body = " + body);
     }
 }

+ 2 - 4
slibra-quartz/src/main/java/com/slibra/quartz/task/RyTask.java

@@ -192,13 +192,12 @@ public class RyTask
             currentHour = currentHour.plusMinutes(5);
 
             //每个小时查询一次数据
-            String url = "http://10.0.0.27:4568/api/v1/khquerydata";
             HashMap<String, Object> req = new HashMap<>();
             req.put("tagNames", queryTags);
             req.put("startTime", begin);
             req.put("endTime", end);
             req.put("recordNumbers", 100000);
-            String body = HttpRequest.post(url).header("Authorization", "c2E6c2E=").header("clientName", "hongshan").body(JSON.toJSONString(req)).execute().body();
+            String body = HttpRequest.post(INDUSTRY_INTERFACE_ADDR).header("Authorization", "c2E6c2E=").header("clientName", "hongshan").body(JSON.toJSONString(req)).execute().body();
 //            System.out.println("body = " + body);
             List<HashMap<String, String>> list = new ArrayList<>();
 
@@ -2294,13 +2293,12 @@ public class RyTask
             currentHour = currentHour.plusMinutes(5);
 
             //每个小时查询一次数据
-            String url = "http://10.0.0.27:4568/api/v1/khquerydata";
             HashMap<String, Object> req = new HashMap<>();
             req.put("tagNames", queryTags);
             req.put("startTime", begin);
             req.put("endTime", end);
             req.put("recordNumbers", 100000);
-            String body = HttpRequest.post(url).header("Authorization", "c2E6c2E=").header("clientName", "hongshan").body(JSON.toJSONString(req)).execute().body();
+            String body = HttpRequest.post(INDUSTRY_INTERFACE_ADDR).header("Authorization", "c2E6c2E=").header("clientName", "hongshan").body(JSON.toJSONString(req)).execute().body();
 //            System.out.println("body = " + body);
             List<HashMap<String, String>> list = new ArrayList<>();
 

+ 1 - 1
slibra-quartz/src/main/java/com/slibra/quartz/task/RyTask_bak.java

@@ -98,7 +98,7 @@
 //            currentHour = currentHour.plusMinutes(5);
 //
 //            //每个小时查询一次数据
-//            String url = "http://10.0.0.27:4568/api/v1/khquerydata";
+//            String url = INDUSTRY_INTERFACE_ADDR;
 //            HashMap<String, Object> req = new HashMap<>();
 //            req.put("tagNames", queryTags);
 //            req.put("startTime", begin);

+ 1 - 1
slibra-system/src/main/java/com/slibra/business/service/impl/FrontServiceImpl.java

@@ -686,7 +686,7 @@ public class FrontServiceImpl implements IFrontService {
         LocalDateTime beginTime = nowTime.plusMinutes(-1);
 
         //调用工业库接口
-        String url = "http://10.0.0.27:4568/api/v1/khquerydata";
+        String url = INDUSTRY_INTERFACE_ADDR;
         HashMap<String, Object> req = new HashMap<>();
         req.put("tagNames", queryTags);
         req.put("startTime", formatter.format(beginTime));