Browse Source

[update]#

chenfangchao 2 years ago
parent
commit
eb03c602d6

+ 24 - 7
beidou-analysis/src/main/java/cn/com/taiji/service/impl/BeidouAnalySisServiceImpl.java

@@ -57,7 +57,7 @@ public class BeidouAnalySisServiceImpl implements BeidouAnalySisService {
 
     @Override
     public List<ExportVo> export(QueryVo query) {
-        Set<String> result = new HashSet<>();
+        Map<String,Integer> result = new ConcurrentHashMap<>();
         List<String> beidouList = new LinkedList<>();
         Map<String, CountDTO> idenNewStringMap = new ConcurrentHashMap<>();
         String time = DateUtils.format(new Date(), "yyyy-MM-dd");
@@ -138,8 +138,13 @@ public class BeidouAnalySisServiceImpl implements BeidouAnalySisService {
             if(null != countDTO){
                 if(null != countDTO.getCount()){
                     if(countDTO.getCount() > 1){
+                        //mergeTarget
                         List<String> data = countDTO.getData();
-                        result.addAll(data);
+                        if(null != data && 0 < data.size()){
+                            for (String item : data) {
+                                result.put(item,countDTO.getCount());
+                            }
+                        }
                     }
                 }
             }
@@ -152,7 +157,7 @@ public class BeidouAnalySisServiceImpl implements BeidouAnalySisService {
         SearchSourceBuilder exportSearchSourceBuilder = new SearchSourceBuilder();
         exportSearchSourceBuilder.size(1000000);
         exportSearchSourceBuilder.trackTotalHits(true);
-        exportSearchSourceBuilder.query(QueryBuilders.termsQuery("mergeTarget",result));
+        exportSearchSourceBuilder.query(QueryBuilders.termsQuery("mergeTarget",result.keySet()));
         exportFusionSearchRequest.source(exportSearchSourceBuilder);
         List<ExportVo> data = new ArrayList<>();
         try {
@@ -162,10 +167,22 @@ public class BeidouAnalySisServiceImpl implements BeidouAnalySisService {
                 Map<String, Object> sourceAsMap = hit.getSourceAsMap();
                 String mergeTarget = (String) sourceAsMap.get("mergeTarget");
                 String targetSource = (String) sourceAsMap.get("targetSource");
-                ExportVo tianaoVo = new ExportVo();
-                tianaoVo.setMergeTarget(mergeTarget);
-                tianaoVo.setStartTime(targetSource);
-                data.add(tianaoVo);
+                String mergeTime = (String) sourceAsMap.get("mergeTime");
+                Integer count = result.get(mergeTarget);
+                ExportVo exportVo = new ExportVo();
+                exportVo.setMergeTarget(mergeTarget);
+                exportVo.setTargetSource(targetSource);
+                exportVo.setEndTime(mergeTime);
+                exportVo.setCount(count);
+                List<FusionNewShipJsonDTO> targetSourceList = JSON.parseArray(targetSource, FusionNewShipJsonDTO.class);
+                for (FusionNewShipJsonDTO item : targetSourceList) {
+                    if (null != item) {
+                        if (null != item.getType() && "BEIDOU".equals(item.getType())) {
+                            exportVo.setStartTime(item.getSourceTime());
+                        }
+                    }
+                }
+                data.add(exportVo);
             }
         } catch (IOException e) {
             e.printStackTrace();

+ 7 - 1
es-track-common/src/main/java/cn/com/taiji/vo/ExportVo.java

@@ -21,8 +21,14 @@ public class ExportVo implements Serializable {
     @ExcelProperty(value = {"批次开始时间"}, index = 1)
     private String startTime;
 
+    @ExcelProperty(value = {"批次结束时间"}, index = 2)
     private String endTime;
 
-    @ExcelProperty(value = {"相同子源标识"}, index = 2)
+    @ExcelProperty(value = {"相同子源标识"}, index = 3)
     private String targetSource;
+
+    @ExcelProperty(value = {"轨迹点总数"}, index = 4)
+    private Integer count;
+
+
 }

+ 24 - 7
hlx-one-fusion-analysis/src/main/java/cn/com/taiji/service/HlxOneLevelServiceImpl.java

@@ -56,7 +56,7 @@ public class HlxOneLevelServiceImpl implements HlxOneLevelService{
 
     @Override
     public List<ExportVo> hlx(QueryVo query) {
-        Set<String> result = new HashSet<>();
+        Map<String,Integer> result = new ConcurrentHashMap<>();
         List<String> hlxList = new LinkedList<>();
         Map<String, CountDTO> idenNewStringMap = new ConcurrentHashMap<>();
         String time = DateUtils.format(new Date(), "yyyy-MM-dd");
@@ -134,7 +134,12 @@ public class HlxOneLevelServiceImpl implements HlxOneLevelService{
                 if(null != countDTO.getCount()){
                     if(countDTO.getCount() > 1){
                         List<String> data = countDTO.getData();
-                        result.addAll(data);
+                        if(null != data && 0 < data.size()){
+                            for (String item : data) {
+                                //mergeTarget
+                                result.put(item,countDTO.getCount());
+                            }
+                        }
                     }
                 }
             }
@@ -148,7 +153,7 @@ public class HlxOneLevelServiceImpl implements HlxOneLevelService{
         SearchSourceBuilder exportSearchSourceBuilder = new SearchSourceBuilder();
         exportSearchSourceBuilder.size(1000000);
         exportSearchSourceBuilder.trackTotalHits(true);
-        exportSearchSourceBuilder.query(QueryBuilders.termsQuery("mergeTarget",result));
+        exportSearchSourceBuilder.query(QueryBuilders.termsQuery("mergeTarget",result.keySet()));
         exportFusionSearchRequest.source(exportSearchSourceBuilder);
         List<ExportVo> data = new ArrayList<>();
         try {
@@ -158,10 +163,22 @@ public class HlxOneLevelServiceImpl implements HlxOneLevelService{
                 Map<String, Object> sourceAsMap = hit.getSourceAsMap();
                 String mergeTarget = (String) sourceAsMap.get("mergeTarget");
                 String targetSource = (String) sourceAsMap.get("targetSource");
-                ExportVo tianaoVo = new ExportVo();
-                tianaoVo.setMergeTarget(mergeTarget);
-                tianaoVo.setStartTime(targetSource);
-                data.add(tianaoVo);
+                String mergeTime = (String) sourceAsMap.get("mergeTime");
+                Integer count = result.get(mergeTarget);
+                ExportVo exportVo = new ExportVo();
+                exportVo.setMergeTarget(mergeTarget);
+                exportVo.setTargetSource(targetSource);
+                exportVo.setEndTime(mergeTime);
+                exportVo.setCount(count);
+                List<FusionNewShipJsonDTO> targetSourceList = JSON.parseArray(targetSource, FusionNewShipJsonDTO.class);
+                for (FusionNewShipJsonDTO item : targetSourceList) {
+                    if (null != item) {
+                        if (null != item.getType() && "HLX_AIS_RADAR".equals(item.getType())) {
+                            exportVo.setStartTime(item.getSourceTime());
+                        }
+                    }
+                }
+                data.add(exportVo);
             }
         } catch (IOException e) {
             e.printStackTrace();

+ 19 - 7
tianao-analysis/src/main/java/cn/com/taiji/service/impl/TianaoServiceImpl.java

@@ -60,7 +60,7 @@ public class TianaoServiceImpl implements TianaoService {
 
     @Override
     public List<ExportVo> tianaRader(QueryVo query) {
-        Set<String> result = new HashSet<>();
+        Map<String,Integer> result = new ConcurrentHashMap<>();
         List<String> tianaoRadarList = new LinkedList<>();
         Map<String, CountDTO> idenNewStringMap = new ConcurrentHashMap<>();
         String time = DateUtils.format(new Date(), "yyyy-MM-dd");
@@ -144,8 +144,9 @@ public class TianaoServiceImpl implements TianaoService {
                     if(countDTO.getCount() > 1){
                         List<String> data = countDTO.getData();
                         if(null != data && 0 < data.size()){
-                            for (String datum : data) {
-                                result.add(datum);
+                            for (String item : data) {
+                                //mergeTarget
+                                result.put(item,countDTO.getCount());
                             }
                         }
                     }
@@ -169,10 +170,21 @@ public class TianaoServiceImpl implements TianaoService {
                 Map<String, Object> sourceAsMap = hit.getSourceAsMap();
                 String mergeTarget = (String) sourceAsMap.get("mergeTarget");
                 String targetSource = (String) sourceAsMap.get("targetSource");
-                ExportVo tianaoVo = new ExportVo();
-                tianaoVo.setMergeTarget(mergeTarget);
-                tianaoVo.setStartTime(targetSource);
-                data.add(tianaoVo);
+                String mergeTime = (String) sourceAsMap.get("mergeTime");
+                Integer count = result.get(mergeTarget);
+                ExportVo exportVo = new ExportVo();
+                exportVo.setMergeTarget(mergeTarget);
+                exportVo.setTargetSource(targetSource);
+                exportVo.setEndTime(mergeTime);
+                exportVo.setCount(count);
+                List<FusionNewShipJsonDTO> targetSourceList = JSON.parseArray(targetSource, FusionNewShipJsonDTO.class);
+                for (FusionNewShipJsonDTO item : targetSourceList) {
+                    if (null != item) {
+                        if (null != item.getType() && "TA_RADAR".equals(item.getType())) {
+                            exportVo.setStartTime(item.getSourceTime());
+                        }
+                    }
+                }
             }
         } catch (IOException e) {
             e.printStackTrace();