Browse Source

修改货物覆盖预警:预警分析发短信的需要,暂时将除杭申线之外的卡口覆盖率降到0.7预警

sbj 1 week ago
parent
commit
7b779b13f4

+ 3 - 1
general-controller-service/src/main/java/com/shanghaichengdi/generalcontrollerservice/controller/BoatCoverAndFlagController.java

@@ -1,5 +1,6 @@
 package com.shanghaichengdi.generalcontrollerservice.controller;
 
+import cn.hutool.http.HttpResponse;
 import cn.hutool.http.HttpUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -207,7 +208,8 @@ public class BoatCoverAndFlagController {
             jsonObject.put("pictureUrl", "http://10.114.4.20:8090/static/" + lifeJacketAnalysis.getColumn1());
             jsonObject.put("bayonetId", data.getBayonetId());  //卡口id  为了封装199服务地址的路径存储
             //调用下载图片地址 参数传入下载
-            HttpUtil.createPost("https://10.83.240.193:8090/download/downloadAnalysedPicture").body(jsonObject.toJSONString()).setSSLSocketFactory(SSLUtils.getSSLSocketFactory()).executeAsync();
+            HttpResponse response = HttpUtil.createPost("https://10.83.240.193:8090/download/downloadAnalysedPicture").body(jsonObject.toJSONString()).setSSLSocketFactory(SSLUtils.getSSLSocketFactory()).executeAsync();
+            log.info("分析图上传结果:"+response);
             event.setEventValue("0");
             List<BoatWarning> boatWarningList = new ArrayList<>();
             BoatWarning boatWarning = new BoatWarning();

+ 5 - 4
general-controller-service/src/main/java/com/shanghaichengdi/generalcontrollerservice/faced/DataFaced.java

@@ -2155,11 +2155,12 @@ public class DataFaced {
   boolean checkCover(CoverageAnalysis coverageAnalysis) {
 //        判断值小于0.7的话 并且 类型砂石和白沙带可以生成,
     //覆盖物分析结果是小数,分析比较是比较0.xxx
+    // 预警分析发短信的需要,暂时将除杭申线之外的卡口覆盖率降到0.7预警
     if (coverageAnalysis.getCoverageRatio() != null &&
-        coverageAnalysis.getCoverageRatio().compareTo(new BigDecimal(0.85)) < 0 &&
-        coverageAnalysis.getTypeClass() != null
-        && ("0".equals(coverageAnalysis.getTypeClass()) || "4".equals(
-        coverageAnalysis.getTypeClass()))) {
+        ( (coverageAnalysis.getCoverageRatio().compareTo(new BigDecimal(0.85)) < 0 && "1".equals(coverageAnalysis.getBayonetId())) ||
+            (coverageAnalysis.getCoverageRatio().compareTo(new BigDecimal(0.7)) < 0 && !"1".equals(coverageAnalysis.getBayonetId()))  ) &&
+        coverageAnalysis.getTypeClass() != null &&
+        ("0".equals(coverageAnalysis.getTypeClass()) || "4".equals(coverageAnalysis.getTypeClass()))) {
       return true;
     }
     return false;