Browse Source

:sparkles: 松浦大桥卡口过滤

lag 7 months ago
parent
commit
7eaf4f0245

+ 17 - 3
download-center-server/src/main/java/com/shanghaichengdi/downloadcenterserver/faced/AnalyseFaced.java

@@ -46,7 +46,13 @@ public class AnalyseFaced {
       yunParam.put("data", responseBody);
       yunParam.put("bayonetId", bayonetId);
       String coverJsonString = JSONObject.toJSONString(yunParam);
-      log.info("覆盖物调用云上传参为:{}", coverJsonString);
+//      log.info("覆盖物调用云上传参为:{}", coverJsonString);
+      HttpRequest ghPost = HttpUtil.createPost(GH_CLOUD_SERVER);
+      ghPost.addHeaders(headers);
+      ghPost.body(coverJsonString)
+          .setReadTimeout(3600000)
+          .execute()
+          .body();
     }
     return responseBody;
   }
@@ -86,8 +92,16 @@ public class AnalyseFaced {
     yunParam.put("id", id);
     yunParam.put("data", result);
     yunParam.put("bayonetId", bayonetId);
-    String coverJsonString = JSONObject.toJSONString(yunParam);
-    log.info("国旗调用云上传参为:{}", coverJsonString);
+    String flagJsonString = JSONObject.toJSONString(yunParam);
+//    log.info("国旗调用云上传参为:{}", flagJsonString);
+    HttpRequest ghPost = HttpUtil.createPost(GH_CLOUD_SERVER);
+    Map<String, String> headers = new HashMap<>();
+    headers.put("Content-Type", "application/json;charset=utf-8");
+    ghPost.addHeaders(headers);
+    ghPost.body(flagJsonString)
+        .setReadTimeout(3600000)
+        .execute()
+        .body();
     return null;
   }
 

+ 5 - 3
download-center-server/src/main/java/com/shanghaichengdi/downloadcenterserver/faced/PicDownloadFaced.java

@@ -82,9 +82,11 @@ public class PicDownloadFaced extends Thread {
     addQueue(id, imgUrlToSave);
 //    log.warn("======>   取出并移除首位元素:{}", JSONObject.toJSONString(UrlData.URL_IMG_TO_SAVE.poll()));
     Map<String, List<String>> polled = UrlData.URL_IMG_TO_SAVE.poll();
-    String id = new ArrayList<>(polled.keySet()).get(0);
-    AnalyseFaced.shipCoverAnalyse(id, polled.get(id).get(0),bayonetId);
-    AnalyseFaced.boatFlagAnalyse(id, polled.get(id),bayonetId);
+    if (!"8".equals(bayonetId)) {
+      String id = new ArrayList<>(polled.keySet()).get(0);
+      AnalyseFaced.shipCoverAnalyse(id, polled.get(id).get(0), bayonetId);
+      AnalyseFaced.boatFlagAnalyse(id, polled.get(id), bayonetId);
+    }
   }
 
   private synchronized static void addQueue(String id, List<String> imgUrlToSave) {