Browse Source

执法仪推送数据到事件 更改执法中心

lchao 7 tháng trước cách đây
mục cha
commit
069dd6cbcd

+ 19 - 10
src/main/java/com/sooka/sponest/dataexchange/sendChange/quartz/EquipDataJob.java

@@ -31,14 +31,14 @@ public class EquipDataJob {
     @Resource
     private RemoteLawenforcementBaseService remoteLawenforcementBaseService;
 
-    @Value("${equioData.accessKey}")
-    private String accessKey;
+//    @Value("${equioData.accessKey}")
+//    private String accessKey;
+//
+//    @Value("${equioData.ip}")
+//    private String ip;
 
-    @Value("${equioData.ip}")
-    private String ip;
-
-    @Scheduled(cron = "0 0/10 * * * ?")
-//@Scheduled(cron = "0/10 * * * * ?")
+//    @Scheduled(cron = "0 0/10 * * * ?")
+@Scheduled(cron = "0/10 * * * * ?")
     public void getEquipJobRecords() throws Exception {
         log.info("定时任务调用省平台工单开始");
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -50,19 +50,28 @@ public class EquipDataJob {
         // 获取当前时间前10分钟的日期
         calendar.add(Calendar.MINUTE, -15);
         String startTime = URLEncoder.encode(sdf.format(calendar.getTime()), "UTF-8");
-//        String accessKey = "d99f0830813a4d82921aefa002ddfb22";
+//        String accessKey = a"d99f0830813a4d82921aefa002ddfb22";
+        String accessKey = "e85332c67204481a911aaed7cdc123be";
+        String accessKey1 = "Basic";
+        String accessKey2 = "Basic NmRiNjc5NTBkYzQ2OGJlMzM3YzE5MzhmMGJiMWY5YTg6MTRjYjM0ZGY2ODVhY2Y5MDNmYzY5OWU2ZTEwYmY2OGE=";
+        String accessKey3 = "pUrKvA";
         Integer page = 1;
         for (int i = 1; i <= page; i++) {
-            String urlString = ip + "/dev-api/outData/getJobRecords?page=" + page + "&size=10&updateStartTime=" + startTime + "&updateEndTime=" + endTime;
+//            String urlString = ip + "/dev-api/outData/getJobRecords?page=" + page + "&size=10&updateStartTime=" + startTime + "&updateEndTime=" + endTime;
 //            String urlString = "http://36.135.7.83:81/dev-api/outData/getJobRecords?page=" + page + "&size=5&updateStartTime=2024-05-20%2010:50:33&updateEndTime=2024-11-20%2010:50:33";
+            String urlString = "http://172.24.5.241:6689/api/interface?page=1&size=1&createStartTime=2024-04-11 00:00:00&createEndTime=2024-04-12 12:00:00";
             log.info("请求地址:{}", urlString);
             try {
                 URL url = new URL(urlString);
                 HttpURLConnection connection = (HttpURLConnection) url.openConnection();
                 connection.setRequestMethod("GET");
                 connection.setRequestProperty("access-key", accessKey);
+                connection.setRequestProperty("Authorization-Type", accessKey1);
+                connection.setRequestProperty("Authorization", accessKey2);
+                connection.setRequestProperty("Service-ID", accessKey3);
                 int responseCode = connection.getResponseCode();
-                log.info("responseCode:{}", responseCode);
+                log.info("connection.getResponseCode():{}", connection.getResponseCode());
+                log.info("connection:{}", connection.getResponseMessage());
                 if (responseCode == HttpURLConnection.HTTP_OK) {
                     BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                     String inputLine;