Browse Source

[update]0.3版本

xiahailong 2 years ago
parent
commit
a95b7c2068

+ 2 - 1
.idea/workspace.xml

@@ -4,7 +4,7 @@
     <option name="autoReloadType" value="SELECTIVE" />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="3bf79822-fe13-41ea-bc8f-858fbea129e7" name="Changes" comment="[update]0.2版本">
+    <list default="true" id="3bf79822-fe13-41ea-bc8f-858fbea129e7" name="Changes" comment="[update]0.3版本">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/fusion-analysis/src/main/java/cn/com/taiji/service/impl/FusionAnalysisServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/fusion-analysis/src/main/java/cn/com/taiji/service/impl/FusionAnalysisServiceImpl.java" afterDir="false" />
     </list>
@@ -178,6 +178,7 @@
       <workItem from="1675844180241" duration="4939000" />
       <workItem from="1675902989280" duration="632000" />
       <workItem from="1675904453292" duration="806000" />
+      <workItem from="1675910279608" duration="3089000" />
     </task>
     <task id="LOCAL-00001" summary="[insert]新增prod环境配置,完善es连接配置">
       <created>1675652041715</created>

+ 18 - 18
fusion-analysis/src/main/java/cn/com/taiji/service/impl/FusionAnalysisServiceImpl.java

@@ -414,7 +414,7 @@ public class FusionAnalysisServiceImpl implements FusionAnalysisService {
             // 构建查询条件
             BoolQueryBuilder boolQueryBuilder2 = QueryBuilders.boolQuery();
             SearchSourceBuilder searchSourceBuilder2 = new SearchSourceBuilder();
-            boolQueryBuilder2.filter(QueryBuilders.wildcardQuery("trackDeviceNo", "*,"+ item.getBatchNumber() +",*"));
+            boolQueryBuilder2.filter(QueryBuilders.wildcardQuery("targetSource", "*"+ item.getBatchNumber() +"*"));
             boolQueryBuilder2.filter(QueryBuilders.rangeQuery("mergeTime").gte(query.getStartTime()).lte(query.getEndTime()));
             boolQueryBuilder2.filter(QueryBuilders.termsQuery("mergeType","RADAR","AIS_RADAR","BEIDOU_RADAR","AIS_BEIDOU_RADAR"));
             searchSourceBuilder2.query(boolQueryBuilder2)
@@ -431,11 +431,11 @@ public class FusionAnalysisServiceImpl implements FusionAnalysisService {
                 if (totalHits<5) {
                     SearchHit[] hits2 = searchHits2.getHits();
                     if (hits2.length > 0) {
-                        JSONObject sourceItem = JSONObject.parseObject(hits2[0].getSourceAsString());
-                        JSONObject sourceItem2 = JSONObject.parseObject(hits2[hits2.length-1].getSourceAsString());
-                        data.setMergeTarget(sourceItem.getString("mergeTarget"));
-                        data.setStartTime(sourceItem.getString("mergeTime"));
-                        data.setEndTime(sourceItem2.getString("mergeTime"));
+                        Map<String, Object> map = hits2[0].getSourceAsMap();
+                        Map<String, Object> map2 = hits2[hits2.length-1].getSourceAsMap();
+                        data.setMergeTarget(map.get("mergeTarget").toString());
+                        data.setStartTime(map.get("mergeTime").toString());
+                        data.setEndTime(map2.get("mergeTime").toString());
                         data.setBatchNumber(item.getBatchNumber());
                         data.setOriginalCount(item.getCount());
                         data.setTrackCount(totalHits);
@@ -548,11 +548,11 @@ public class FusionAnalysisServiceImpl implements FusionAnalysisService {
                 if (totalHits<5) {
                     SearchHit[] hits2 = searchHits2.getHits();
                     if (hits2.length > 0) {
-                        JSONObject sourceItem = JSONObject.parseObject(hits2[0].getSourceAsString());
-                        JSONObject sourceItem2 = JSONObject.parseObject(hits2[hits2.length-1].getSourceAsString());
-                        data.setMergeTarget(sourceItem.getString("mergeTarget"));
-                        data.setStartTime(sourceItem.getString("mergeTime"));
-                        data.setEndTime(sourceItem2.getString("mergeTime"));
+                        Map<String, Object> map = hits2[0].getSourceAsMap();
+                        Map<String, Object> map2 = hits2[hits2.length-1].getSourceAsMap();
+                        data.setMergeTarget(map.get("mergeTarget").toString());
+                        data.setStartTime(map.get("mergeTime").toString());
+                        data.setEndTime(map2.get("mergeTime").toString());
                         data.setBatchNumber(item.getBatchNumber());
                         data.setOriginalCount(item.getCount());
                         data.setTrackCount(totalHits);
@@ -648,7 +648,7 @@ public class FusionAnalysisServiceImpl implements FusionAnalysisService {
             // 构建查询条件
             BoolQueryBuilder boolQueryBuilder2 = QueryBuilders.boolQuery();
             SearchSourceBuilder searchSourceBuilder2 = new SearchSourceBuilder();
-            boolQueryBuilder2.filter(QueryBuilders.wildcardQuery("trackDeviceNo", "*,"+ item.getBatchNumber() +",*"));
+            boolQueryBuilder2.filter(QueryBuilders.wildcardQuery("targetSource", "*"+ item.getBatchNumber() +"*"));
             boolQueryBuilder2.filter(QueryBuilders.rangeQuery("mergeTime").gte(query.getStartTime()).lte(query.getEndTime()));
             boolQueryBuilder2.filter(QueryBuilders.termsQuery("mergeType","AIS","RADAR","AIS_BEIDOU","AIS_RADAR","BEIDOU_RADAR","AIS_BEIDOU_RADAR"));
             searchSourceBuilder2.query(boolQueryBuilder2)
@@ -665,11 +665,11 @@ public class FusionAnalysisServiceImpl implements FusionAnalysisService {
                 if (totalHits<5) {
                     SearchHit[] hits2 = searchHits2.getHits();
                     if (hits2.length > 0) {
-                        JSONObject sourceItem = JSONObject.parseObject(hits2[0].getSourceAsString());
-                        JSONObject sourceItem2 = JSONObject.parseObject(hits2[hits2.length-1].getSourceAsString());
-                        data.setMergeTarget(sourceItem.getString("mergeTarget"));
-                        data.setStartTime(sourceItem.getString("mergeTime"));
-                        data.setEndTime(sourceItem2.getString("mergeTime"));
+                        Map<String, Object> map = hits2[0].getSourceAsMap();
+                        Map<String, Object> map2 = hits2[hits2.length-1].getSourceAsMap();
+                        data.setMergeTarget(map.get("mergeTarget").toString());
+                        data.setStartTime(map.get("mergeTime").toString());
+                        data.setEndTime(map2.get("mergeTime").toString());
                         data.setBatchNumber(item.getBatchNumber());
                         data.setOriginalCount(item.getCount());
                         data.setTrackCount(totalHits);
@@ -757,7 +757,7 @@ public class FusionAnalysisServiceImpl implements FusionAnalysisService {
             // 构建查询条件
             BoolQueryBuilder boolQueryBuilder2 = QueryBuilders.boolQuery();
             SearchSourceBuilder searchSourceBuilder2 = new SearchSourceBuilder();
-            boolQueryBuilder2.filter(QueryBuilders.wildcardQuery("trackDeviceNo", "*,"+ item.getBatchNumber() +",*"));
+            boolQueryBuilder2.filter(QueryBuilders.wildcardQuery("targetSource", "*"+ item.getBatchNumber() +"*"));
             boolQueryBuilder2.filter(QueryBuilders.termQuery("targetType","0"));
             boolQueryBuilder2.filter(QueryBuilders.rangeQuery("mergeTime").gte(query.getStartTime()).lte(query.getEndTime()));
             boolQueryBuilder2.filter(QueryBuilders.termsQuery("mergeType","RADAR","AIS_RADAR","BEIDOU_RADAR","AIS_BEIDOU_RADAR"));