Browse Source

[update]修改pom文件

xiahailong 2 years ago
parent
commit
98b65920dd

+ 1 - 0
.idea/compiler.xml

@@ -12,5 +12,6 @@
         <module name="fusion-analysis" />
       </profile>
     </annotationProcessing>
+    <bytecodeTargetLevel target="8" />
   </component>
 </project>

+ 65 - 11
.idea/workspace.xml

@@ -4,9 +4,25 @@
     <option name="autoReloadType" value="SELECTIVE" />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="3bf79822-fe13-41ea-bc8f-858fbea129e7" name="Changes" comment="[insert]新增融合解析--识别融合数据率波动问题导出">
+    <list default="true" id="3bf79822-fe13-41ea-bc8f-858fbea129e7" name="Changes" comment="[update]修改pom文件">
+      <change afterPath="$PROJECT_DIR$/fusion-analysis/src/main/java/cn/com/taiji/config/EsClientConfiguration.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/fusion-analysis/src/main/java/cn/com/taiji/constants/EsIndexConstants.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/fusion-analysis/src/main/java/cn/com/taiji/domain/LeaveOutData.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/fusion-analysis/src/main/java/cn/com/taiji/domain/StaticOrDynamicData.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/fusion-analysis/src/main/java/cn/com/taiji/domain/dto/LeaceOutDto.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/es-track-common/target/classes/cn/com/taiji/EsTrackAnAlySisApplication.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/es-track-common/target/classes/cn/com/taiji/config/EsClientConfiguration.class" beforeDir="false" />
       <change beforePath="$PROJECT_DIR$/fusion-analysis/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/fusion-analysis/pom.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/fusion-analysis/src/main/java/cn/com/taiji/controller/FusionAnalysisController.java" beforeDir="false" afterPath="$PROJECT_DIR$/fusion-analysis/src/main/java/cn/com/taiji/controller/FusionAnalysisController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/fusion-analysis/src/main/java/cn/com/taiji/domain/FusionData.java" beforeDir="false" afterPath="$PROJECT_DIR$/fusion-analysis/src/main/java/cn/com/taiji/domain/FusionData.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/fusion-analysis/src/main/java/cn/com/taiji/domain/FusionQuery.java" beforeDir="false" afterPath="$PROJECT_DIR$/fusion-analysis/src/main/java/cn/com/taiji/domain/FusionQuery.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/fusion-analysis/src/main/java/cn/com/taiji/service/FusionAnalysisService.java" beforeDir="false" afterPath="$PROJECT_DIR$/fusion-analysis/src/main/java/cn/com/taiji/service/FusionAnalysisService.java" 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" />
+      <change beforePath="$PROJECT_DIR$/fusion-analysis/src/main/resources/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/fusion-analysis/src/main/resources/application.yml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/tianao-analysis/target/classes/application.yml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/tianao-analysis/target/classes/cn/com/taiji/TianaoAnalySisApplication.class" beforeDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -23,7 +39,7 @@
   <component name="Git.Settings">
     <option name="RECENT_BRANCH_BY_REPOSITORY">
       <map>
-        <entry key="$PROJECT_DIR$" value="master" />
+        <entry key="$PROJECT_DIR$" value="xiahailong" />
       </map>
     </option>
     <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
@@ -51,7 +67,6 @@
   <component name="ProjectViewState">
     <option name="autoscrollFromSource" value="true" />
     <option name="hideEmptyMiddlePackages" value="true" />
-    <option name="showExcludedFiles" value="false" />
     <option name="showLibraryContents" value="true" />
     <option name="showVisibilityIcons" value="true" />
   </component>
@@ -60,21 +75,22 @@
     <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
     <property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
     <property name="WebServerToolWindowFactoryState" value="false" />
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/fusion-analysis/src/main/resources" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/fusion-analysis/src/main/java/cn/com/taiji" />
     <property name="node.js.detected.package.eslint" value="true" />
     <property name="node.js.detected.package.tslint" value="true" />
     <property name="node.js.selected.package.eslint" value="(autodetect)" />
     <property name="node.js.selected.package.tslint" value="(autodetect)" />
-    <property name="project.structure.last.edited" value="模块" />
-    <property name="project.structure.proportion" value="0.0" />
-    <property name="project.structure.side.proportion" value="0.0" />
-    <property name="settings.editor.selected.configurable" value="MavenSettings" />
+    <property name="project.structure.last.edited" value="项目" />
+    <property name="project.structure.proportion" value="0.15" />
+    <property name="project.structure.side.proportion" value="0.2904762" />
+    <property name="settings.editor.selected.configurable" value="reference.projectsettings.compiler.javacompiler" />
   </component>
   <component name="RebelAgentSelection">
     <selection>jr</selection>
   </component>
   <component name="RecentsManager">
     <key name="CopyFile.RECENT_KEYS">
+      <recent name="D:\FusionAnalysis\fusion-analysis\src\main\java\cn\com\taiji" />
       <recent name="D:\FusionAnalysis\fusion-analysis\src\main\resources" />
     </key>
     <key name="CopyClassDialog.RECENTS_KEY">
@@ -82,7 +98,7 @@
       <recent name="cn.com.taiji.config" />
     </key>
   </component>
-  <component name="RunManager">
+  <component name="RunManager" selected="Spring Boot.FusionAnalysisApplication">
     <configuration name="EsTrackAnAlySisApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" temporary="true" nameIsGenerated="true">
       <module name="es-track-common" />
       <extension name="coverage">
@@ -96,9 +112,18 @@
         <option name="Make" enabled="true" />
       </method>
     </configuration>
+    <configuration name="FusionAnalysisApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
+      <module name="fusion-analysis" />
+      <option name="SPRING_BOOT_MAIN_CLASS" value="cn.com.taiji.FusionAnalysisApplication" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
     <recent_temporary>
       <list>
         <item itemvalue="Spring Boot.EsTrackAnAlySisApplication" />
+        <item itemvalue="Spring Boot.EsTrackAnAlySisApplication" />
+        <item itemvalue="Spring Boot.EsTrackAnAlySisApplication" />
       </list>
     </recent_temporary>
   </component>
@@ -113,6 +138,8 @@
       <workItem from="1675647750482" duration="488000" />
       <workItem from="1675651220605" duration="3438000" />
       <workItem from="1675666106206" duration="7273000" />
+      <workItem from="1675730151616" duration="2482000" />
+      <workItem from="1675751880629" duration="13334000" />
     </task>
     <task id="LOCAL-00001" summary="[insert]新增prod环境配置,完善es连接配置">
       <created>1675652041715</created>
@@ -128,7 +155,14 @@
       <option name="project" value="LOCAL" />
       <updated>1675652628130</updated>
     </task>
-    <option name="localTasksCounter" value="3" />
+    <task id="LOCAL-00003" summary="[update]修改pom文件">
+      <created>1675677271908</created>
+      <option name="number" value="00003" />
+      <option name="presentableId" value="LOCAL-00003" />
+      <option name="project" value="LOCAL" />
+      <updated>1675677271908</updated>
+    </task>
+    <option name="localTasksCounter" value="4" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
@@ -144,12 +178,32 @@
         </entry>
       </map>
     </option>
+    <option name="RECENT_FILTERS">
+      <map>
+        <entry key="User">
+          <value>
+            <list>
+              <RecentGroup>
+                <option name="FILTER_VALUES">
+                  <option value="chenfangchao" />
+                </option>
+              </RecentGroup>
+            </list>
+          </value>
+        </entry>
+      </map>
+    </option>
     <option name="oldMeFiltersMigrated" value="true" />
   </component>
   <component name="VcsManagerConfiguration">
     <MESSAGE value="[insert]新增prod环境配置,完善es连接配置" />
     <MESSAGE value="[insert]新增es索引名" />
     <MESSAGE value="[insert]新增融合解析--识别融合数据率波动问题导出" />
-    <option name="LAST_COMMIT_MESSAGE" value="[insert]新增融合解析--识别融合数据率波动问题导出" />
+    <MESSAGE value="[update]修改pom文件" />
+    <option name="LAST_COMMIT_MESSAGE" value="[update]修改pom文件" />
+  </component>
+  <component name="XSLT-Support.FileAssociations.UIState">
+    <expand />
+    <select />
   </component>
 </project>

BIN
es-track-common/target/classes/cn/com/taiji/EsTrackAnAlySisApplication.class


BIN
es-track-common/target/classes/cn/com/taiji/config/EsClientConfiguration.class


+ 35 - 3
fusion-analysis/pom.xml

@@ -14,13 +14,45 @@
     <properties>
         <maven.compiler.source>8</maven.compiler.source>
         <maven.compiler.target>8</maven.compiler.target>
+        <elasticsearch.version>7.8.0</elasticsearch.version>
     </properties>
 
     <dependencies>
         <dependency>
-            <groupId>cn.com.taiji</groupId>
-            <artifactId>es-track-common</artifactId>
-            <version>1.0-SNAPSHOT</version>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <version>2.7.6</version>
+        </dependency>
+
+        <!-- es -->
+        <dependency>
+            <groupId>org.elasticsearch</groupId>
+            <artifactId>elasticsearch</artifactId>
+            <version>${elasticsearch.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.elasticsearch.client</groupId>
+            <artifactId>elasticsearch-rest-client</artifactId>
+            <version>${elasticsearch.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.elasticsearch.client</groupId>
+            <artifactId>elasticsearch-rest-high-level-client</artifactId>
+            <version>${elasticsearch.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-core</artifactId>
+            <version>2.14.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>2.14.2</version>
         </dependency>
         <dependency>
             <groupId>org.projectlombok</groupId>

+ 91 - 0
fusion-analysis/src/main/java/cn/com/taiji/config/EsClientConfiguration.java

@@ -0,0 +1,91 @@
+package cn.com.taiji.config;
+
+import org.apache.http.HttpHost;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.elasticsearch.client.RestClient;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.util.StringUtils;
+
+/**
+ * @ClassNmae EsClientConfiguration
+ * @Description es连接类
+ * @Author suhh
+ * @Date2021/9/417:25
+ * @Version 1.0
+ **/
+@Configuration
+public class EsClientConfiguration {
+    @Value("${taiji.elasticsearch.rest.uris}")
+    private String[] esUris;
+    @Value("${taiji.elasticsearch.rest.connection-timeout}")
+    /**
+     * 连接超时时间
+     */
+    private int connectTimeOut;
+    @Value("${taiji.elasticsearch.rest.max-connection}")
+    /**
+     * 最大连接数
+     */
+    private int maxConnection;
+    @Value("${taiji.elasticsearch.rest.username}")
+    /**
+     *  用户名
+     */
+    private String userName;
+    @Value("${taiji.elasticsearch.rest.password}")
+    /**
+     * 密码
+     */
+    private String password;
+
+    @Bean
+    public RestHighLevelClient client() {
+
+        HttpHost[] httpHosts = new HttpHost[esUris.length];
+        //将地址转换为http主机数组,未配置端口则采用默认9200端口,配置了端口则用配置的端口
+        for (int i = 0; i < httpHosts.length; i++) {
+            if (!StringUtils.isEmpty(esUris[i])) {
+                if (esUris[i].contains(":")) {
+                    String[] uris = esUris[i].split(":");
+                    httpHosts[i] = new HttpHost(uris[0], Integer.parseInt(uris[1]), "http");
+                } else {
+                    httpHosts[i] = new HttpHost(esUris[i], 9200, "http");
+                }
+            }
+        }
+        //判断,如果未配置用户名,则进行无用户名密码连接,配置了用户名,则进行用户名密码连接
+        if (StringUtils.isEmpty(userName)) {
+            RestHighLevelClient client = new RestHighLevelClient(RestClient.builder(httpHosts));
+            return client;
+        } else {
+
+            final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+            credentialsProvider.setCredentials(AuthScope.ANY,
+                    //es账号密码
+                    new UsernamePasswordCredentials(userName, password));
+            RestHighLevelClient client = new RestHighLevelClient(
+                    RestClient.builder(httpHosts)
+                            .setHttpClientConfigCallback((httpClientBuilder) -> {
+                                httpClientBuilder.setMaxConnTotal(maxConnection);
+                                httpClientBuilder.disableAuthCaching();
+                                httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
+
+                                return httpClientBuilder;
+                            })
+                            .setRequestConfigCallback(builder -> {
+                                builder.setConnectTimeout(connectTimeOut);
+
+                                return builder;
+                            })
+
+            );
+            return client;
+        }
+    }
+}

+ 41 - 0
fusion-analysis/src/main/java/cn/com/taiji/constants/EsIndexConstants.java

@@ -0,0 +1,41 @@
+package cn.com.taiji.constants;
+
+/**
+ * @author chenfangchao
+ * @title: EsIndexConstants
+ * @projectName es-track-analysis
+ * @description: TODO
+ * @date 2023/2/6 10:54 AM
+ */
+public class EsIndexConstants {
+
+    /**
+     * 融合
+     */
+    public static final String INDEX_SEAT_REALTIMETRAJECTORY = "index_seat_realtimetrajectory_";
+
+    /**
+     * 北斗
+     */
+    public static final String INDEX_SEAT_TRACK_BEIDOU = "index_seat_beidou_dynamic_ship_track_";
+
+    /**
+     * AIS
+     */
+    public static final String INDEX_SEAT_TRACK_AIS = "index_seat_ztpt_dynamic_ais_ship_track_";
+
+    /**
+     * 海兰信一级融合
+     */
+    public static final String INDEX_SEAT_HLX_FUSION_SHIP = "index_seat_hlx_zww_dynamic_fusion_ship_";
+
+    /**
+     * 天奥雷达
+     */
+    public static final String INDEX_SEAT_TRACK_RADAR = "index_seat_tianao_radar_fusion_ship_track_";
+
+    /**
+     * 中远海雷达
+     */
+    public static final String INDEX_SEAT_TRACK_ZYH = "index_seat_zyh_radar_track_";
+}

+ 83 - 0
fusion-analysis/src/main/java/cn/com/taiji/controller/FusionAnalysisController.java

@@ -1,8 +1,16 @@
 package cn.com.taiji.controller;
 
+import cn.com.taiji.domain.FusionQuery;
+import cn.com.taiji.service.FusionAnalysisService;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.text.ParseException;
+
 /**
  * @author xhl
  * @date 2023/2/6
@@ -10,4 +18,79 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/es/fusion/analysis")
 @RestController
 public class FusionAnalysisController {
+
+    @Resource
+    private FusionAnalysisService fusionAnalysisService;
+
+    /**
+     * 轨迹融合-航速航向异常波动-识别融合数据率波动问题
+     * @param query
+     * @param response
+     * @throws IOException
+     * @throws ParseException
+     */
+    @PostMapping("excel/one")
+    public void fusionAnalysisExcelOne(FusionQuery query, HttpServletResponse response) throws IOException, ParseException {
+        fusionAnalysisService.fusionAnalysisExcelOne(query,response);
+    }
+
+    /**
+     * 虚假外推数据-虚假推送问题
+     * @param query
+     * @param response
+     * @throws IOException
+     * @throws ParseException
+     */
+    @PostMapping("excel/two")
+    public void fusionAnalysisExcelTwo(FusionQuery query, HttpServletResponse response) throws IOException, ParseException {
+        fusionAnalysisService.fusionAnalysisExcelTwo(query,response);
+    }
+
+    /**
+     * 遗漏融合-天奥轨迹数据遗漏
+     * @param query
+     * @param response
+     * @throws IOException
+     * @throws ParseException
+     */
+    @PostMapping("/tianao/excel")
+    public void tianAoLeaveOutExcel(FusionQuery query, HttpServletResponse response) throws IOException, ParseException {
+        fusionAnalysisService.tianAoLeaveOutExcel(query,response);
+    }
+
+    /**
+     * 遗漏融合-北斗轨迹数据遗漏
+     * @param query
+     * @param response
+     * @throws IOException
+     * @throws ParseException
+     */
+    @PostMapping("/beidou/excel")
+    public void beiDouLeaveOutExcel(FusionQuery query, HttpServletResponse response) throws IOException, ParseException {
+        fusionAnalysisService.beiDouLeaveOutExcel(query,response);
+    }
+
+    /**
+     * 遗漏融合-海兰信1级融合轨迹数据遗漏
+     * @param query
+     * @param response
+     * @throws IOException
+     * @throws ParseException
+     */
+    @PostMapping("/hlxyjrh/excel")
+    public void hlxyjrhLeaveOutExcel(FusionQuery query, HttpServletResponse response) throws IOException, ParseException {
+        fusionAnalysisService.hlxyjrhLeaveOutExcel(query,response);
+    }
+
+    /**
+     * 错误融合-天奥静态数据与动态轨迹融合
+     * @param query
+     * @param response
+     * @throws IOException
+     * @throws ParseException
+     */
+    @PostMapping("/tianao/static/excel")
+    public void tianaoStaticOrDynamicLeaveOutExcel(FusionQuery query, HttpServletResponse response) throws IOException, ParseException {
+        fusionAnalysisService.tianaoStaticOrDynamicLeaveOutExcel(query,response);
+    }
 }

+ 2 - 2
fusion-analysis/src/main/java/cn/com/taiji/domain/FusionData.java

@@ -23,9 +23,9 @@ public class FusionData {
     private String startTime;
 
     /**
-     * 结束时间
+     * 批次结束时间
      */
-    @ExcelProperty(index = 2,value = "结束时间")
+    @ExcelProperty(index = 2,value = "批次结束时间")
     private String endTime;
 
     /**

+ 0 - 1
fusion-analysis/src/main/java/cn/com/taiji/domain/FusionQuery.java

@@ -13,5 +13,4 @@ public class FusionQuery {
 
     private String endTime;
 
-    private Integer pageSize;
 }

+ 47 - 0
fusion-analysis/src/main/java/cn/com/taiji/domain/LeaveOutData.java

@@ -0,0 +1,47 @@
+package cn.com.taiji.domain;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import lombok.Data;
+
+/**
+ * @author xhl
+ * @date 2023/2/7
+ */
+@Data
+public class LeaveOutData {
+    /**
+     * 批次号
+     */
+    @ExcelProperty(index = 0,value = "批次号")
+    private String batchNumber;
+
+    /**
+     * 批次开始时间
+     */
+    @ExcelProperty(index = 1,value = "批次开始时间")
+    private String startTime;
+
+    /**
+     * 批次结束时间
+     */
+    @ExcelProperty(index = 2,value = "批次结束时间")
+    private String endTime;
+
+    /**
+     * 原始轨迹点数
+     */
+    @ExcelProperty(index = 3,value = "原始轨迹点数")
+    private Long originalCount;
+
+    /**
+     * 融合轨迹批次号
+     */
+    @ExcelProperty(index = 4,value = "融合轨迹批次号")
+    private String mergeTarget;
+
+    /**
+     * 融合轨迹中出现的次数
+     */
+    @ExcelProperty(index = 5,value = "融合轨迹中出现的次数")
+    private Long trackCount;
+}

+ 24 - 0
fusion-analysis/src/main/java/cn/com/taiji/domain/StaticOrDynamicData.java

@@ -0,0 +1,24 @@
+package cn.com.taiji.domain;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import lombok.Data;
+
+/**
+ * @author xhl
+ * @date 2023/2/7
+ */
+@Data
+public class StaticOrDynamicData {
+
+    /**
+     * 融合批次号
+     */
+    @ExcelProperty(index = 0,value = "融合批次号")
+    private String mergeTarget;
+
+    /**
+     * 天奥批次号
+     */
+    @ExcelProperty(index = 1,value = "天奥批次号")
+    private String batchNumber;
+}

+ 20 - 0
fusion-analysis/src/main/java/cn/com/taiji/domain/dto/LeaceOutDto.java

@@ -0,0 +1,20 @@
+package cn.com.taiji.domain.dto;
+
+import lombok.Data;
+
+/**
+ * @author xhl
+ * @date 2023/2/7
+ */
+@Data
+public class LeaceOutDto {
+    /**
+     * 批次号
+     */
+    private String batchNumber;
+
+    /**
+     * 数量
+     */
+    private Long count;
+}

+ 48 - 1
fusion-analysis/src/main/java/cn/com/taiji/service/FusionAnalysisService.java

@@ -16,6 +16,53 @@ public interface FusionAnalysisService {
      * 识别融合数据率波动问题
      * @param query
      * @param response
+     * @throws IOException
+     * @throws ParseException
      */
-    void fusionMergeTimeExcelExport(FusionQuery query, HttpServletResponse response) throws IOException, ParseException;
+    void fusionAnalysisExcelOne(FusionQuery query, HttpServletResponse response) throws IOException, ParseException;
+
+    /**
+     * 虚假推送问题
+     * @param query
+     * @param response
+     * @throws IOException
+     * @throws ParseException
+     */
+    void fusionAnalysisExcelTwo(FusionQuery query, HttpServletResponse response) throws IOException, ParseException;
+
+    /**
+     * 天奥轨迹数据遗漏
+     * @param query
+     * @param response
+     * @throws IOException
+     * @throws ParseException
+     */
+    void tianAoLeaveOutExcel(FusionQuery query, HttpServletResponse response) throws IOException, ParseException;
+
+    /**
+     * 北斗轨迹数据遗漏
+     * @param query
+     * @param response
+     * @throws IOException
+     * @throws ParseException
+     */
+    void beiDouLeaveOutExcel(FusionQuery query, HttpServletResponse response) throws IOException, ParseException;
+
+    /**
+     * 海兰信1级融合轨迹数据遗漏
+     * @param query
+     * @param response
+     * @throws IOException
+     * @throws ParseException
+     */
+    void hlxyjrhLeaveOutExcel(FusionQuery query, HttpServletResponse response) throws IOException, ParseException;
+
+    /**
+     * 天奥静态数据与动态轨迹融合
+     * @param query
+     * @param response
+     * @throws IOException
+     * @throws ParseException
+     */
+    void tianaoStaticOrDynamicLeaveOutExcel(FusionQuery query, HttpServletResponse response) throws IOException, ParseException;
 }

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

@@ -2,6 +2,9 @@ package cn.com.taiji.service.impl;
 
 import cn.com.taiji.domain.FusionData;
 import cn.com.taiji.domain.FusionQuery;
+import cn.com.taiji.domain.LeaveOutData;
+import cn.com.taiji.domain.StaticOrDynamicData;
+import cn.com.taiji.domain.dto.LeaceOutDto;
 import cn.com.taiji.service.FusionAnalysisService;
 import cn.com.taiji.utils.DateUtils;
 import com.alibaba.excel.EasyExcel;
@@ -37,7 +40,8 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
-import static cn.com.taiji.constants.EsIndexConstants.INDEX_SEAT_REALTIMETRAJECTORY;
+import static cn.com.taiji.constants.EsIndexConstants.*;
+
 
 /**
  * @author xhl
@@ -51,9 +55,10 @@ public class FusionAnalysisServiceImpl implements FusionAnalysisService {
     private RestHighLevelClient client;
 
     @Override
-    public void fusionMergeTimeExcelExport(FusionQuery query, HttpServletResponse response) throws IOException, ParseException {
+    public void fusionAnalysisExcelOne(FusionQuery query, HttpServletResponse response) throws IOException, ParseException {
         List<FusionData> list = new ArrayList<>();
-        String time = DateUtils.format(new Date(),"yyyy-MM-dd");
+        Date startTime = DateUtils.parse(query.getStartTime(),"yyyy-MM-dd");
+        String time = DateUtils.format(startTime,"yyyy-MM-dd");
         SearchRequest request = new SearchRequest(INDEX_SEAT_REALTIMETRAJECTORY+time);
         // 构建查询条件
         BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
@@ -62,18 +67,18 @@ public class FusionAnalysisServiceImpl implements FusionAnalysisService {
         searchSourceBuilder.query(boolQueryBuilder);
         TermsAggregationBuilder aggBuilder = AggregationBuilders.terms("ship_field_agg")
                 .field("mergeTarget")
-                .size(query.getPageSize())
+                .size(0)
                 .subAggregation(
                         AggregationBuilders.topHits("ship_field_agg_top1")
-                                .size(query.getPageSize())
+                                .size(0)
                                 .sort(
                                         SortBuilders.fieldSort("mergeTime").order(SortOrder.ASC)
                                 )
                 );
-        searchSourceBuilder.sort("merge_time", SortOrder.ASC)
+        searchSourceBuilder
                 .trackTotalHits(true)
                 .aggregation(aggBuilder)
-                .size(query.getPageSize());
+                .size(0);
         request.source(searchSourceBuilder);
         SearchResponse search = client.search(request, RequestOptions.DEFAULT);
         Aggregations aggregations = search.getAggregations();
@@ -95,8 +100,8 @@ public class FusionAnalysisServiceImpl implements FusionAnalysisService {
                 if (i != hits.length-1){
                     Map<String, Object> map = hits[i].getSourceAsMap();
                     Map<String, Object> map2 = hits[i+1].getSourceAsMap();
-                    Date date = DateUtils.parse(map.get("merge_time").toString(),"yyyy-MM-dd");
-                    Date date2 = DateUtils.parse(map2.get("merge_time").toString(),"yyyy-MM-dd");
+                    Date date = DateUtils.parse(map.get("mergeTime").toString(),"yyyy-MM-dd");
+                    Date date2 = DateUtils.parse(map2.get("mergeTime").toString(),"yyyy-MM-dd");
                     Long interval = date2.getTime()-date.getTime();
                     if (interval>6500L){
                         num++;
@@ -115,7 +120,390 @@ public class FusionAnalysisServiceImpl implements FusionAnalysisService {
                     .doWrite(list);
         } catch (Exception e) {
             // 重置response
-            log.info("导出excel失败:{}" + e.getMessage() + e);
+            log.info("导出识别融合数据率波动问题excel失败:{}" + e.getMessage() + e);
+        }
+    }
+
+    @Override
+    public void fusionAnalysisExcelTwo(FusionQuery query, HttpServletResponse response) throws IOException, ParseException {
+        List<FusionData> list = new ArrayList<>();
+        Date startTime = DateUtils.parse(query.getStartTime(),"yyyy-MM-dd");
+        String time = DateUtils.format(startTime,"yyyy-MM-dd");
+        SearchRequest request = new SearchRequest(INDEX_SEAT_REALTIMETRAJECTORY+time);
+        // 构建查询条件
+        BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
+        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
+        boolQueryBuilder.filter(QueryBuilders.rangeQuery("mergeTime").gte(query.getStartTime()).lte(query.getEndTime()));
+        searchSourceBuilder.query(boolQueryBuilder);
+        TermsAggregationBuilder aggBuilder = AggregationBuilders.terms("ship_field_agg")
+                .field("mergeTarget")
+                .size(0)
+                .subAggregation(
+                        AggregationBuilders.terms("ship_field_agg_one")
+                                .field("targetCourse")
+                                .size(0)
+                                .subAggregation(
+                                        AggregationBuilders.terms("ship_field_agg_two")
+                                                .field("targetSpeed")
+                                                .size(0)
+                                                .subAggregation(AggregationBuilders.topHits("ship_field_agg_top1")
+                                                        .size(0)
+                                                        .sort(
+                                                                SortBuilders.fieldSort("mergeTime").order(SortOrder.ASC)
+                                                        ))
+                                )
+                );
+        searchSourceBuilder
+                .trackTotalHits(true)
+                .aggregation(aggBuilder)
+                .size(0);
+        request.source(searchSourceBuilder);
+        SearchResponse search = client.search(request, RequestOptions.DEFAULT);
+        Aggregations aggregations = search.getAggregations();
+        ParsedStringTerms aggregation = aggregations.get("ship_field_agg");
+        for (Terms.Bucket bucket : aggregation.getBuckets()) {
+            FusionData data = new FusionData();
+            ParsedStringTerms terms = bucket.getAggregations().get("ship_field_agg_one");
+            Integer num = 0;
+            for (Terms.Bucket buc : terms.getBuckets()){
+                ParsedStringTerms termsTwo = buc.getAggregations().get("ship_field_agg_two");
+                for (Terms.Bucket ket : termsTwo.getBuckets()){
+                    ParsedTopHits topHit = ket.getAggregations().get("ship_field_agg_top1");
+                    SearchHits searchHit = topHit.getHits();
+                    SearchHit[] hit = searchHit.getHits();
+                    for (int i = 0; i < hit.length; i++) {
+                        if (num>2){
+                            data.setFluctuateNumber(data.getFluctuateNumber()+1);
+                            num =0;
+                        }
+                        if (i != hit.length-1){
+                            Map<String, Object> map = hit[i].getSourceAsMap();
+                            Map<String, Object> map2 = hit[i+1].getSourceAsMap();
+                            Date date = DateUtils.parse(map.get("mergeTime").toString(),"yyyy-MM-dd");
+                            Date date2 = DateUtils.parse(map2.get("mergeTime").toString(),"yyyy-MM-dd");
+                            Long interval = date2.getTime()-date.getTime();
+                            if (interval<6500L){
+                                num++;
+                            }
+                        }
+                    }
+                }
+            }
+            data.setMergeTarget(bucket.getKeyAsString());
+            data.setTrackCount(Long.valueOf(bucket.getDocCount()));
+            data.setStartTime(query.getStartTime());
+            data.setEndTime(query.getEndTime());
+            list.add(data);
+        }
+        try {
+            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+            response.setCharacterEncoding("utf-8");
+            String fileName = URLEncoder.encode("虚假推送问题", "UTF-8");
+            response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xlsx");
+            EasyExcel.write(response.getOutputStream(), FusionData.class).sheet("虚假推送问题")
+                    .doWrite(list);
+        } catch (Exception e) {
+            // 重置response
+            log.info("导出虚假推送问题excel失败:{}" + e.getMessage() + e);
+        }
+    }
+
+    @Override
+    public void tianAoLeaveOutExcel(FusionQuery query, HttpServletResponse response) throws IOException, ParseException {
+        List<LeaveOutData> list = new ArrayList<>();
+        List<LeaceOutDto> dtos = new ArrayList<>();
+        Date startTime = DateUtils.parse(query.getStartTime(),"yyyy-MM-dd");
+        String time = DateUtils.format(startTime,"yyyy-MM-dd");
+        SearchRequest request = new SearchRequest(INDEX_SEAT_TRACK_RADAR+time);
+        // 构建查询条件
+        BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
+        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
+        boolQueryBuilder.filter(QueryBuilders.rangeQuery("receiveTime").gte(query.getStartTime()).lte(query.getEndTime()));
+        searchSourceBuilder.query(boolQueryBuilder);
+        TermsAggregationBuilder aggBuilder = AggregationBuilders.terms("ship_field_agg")
+                .field("fusionBatchNum")
+                .size(0);
+        searchSourceBuilder
+                .trackTotalHits(true)
+                .aggregation(aggBuilder)
+                .size(0);
+        request.source(searchSourceBuilder);
+        SearchResponse search = client.search(request, RequestOptions.DEFAULT);
+        Aggregations aggregations = search.getAggregations();
+        ParsedStringTerms aggregation = aggregations.get("ship_field_agg");
+        for (Terms.Bucket bucket : aggregation.getBuckets()) {
+            LeaceOutDto dto = new LeaceOutDto();
+            dto.setBatchNumber(bucket.getKeyAsString());
+            dto.setCount(Long.valueOf(bucket.getDocCount()));
+            dtos.add(dto);
+        }
+        dtos.forEach(item->{
+            LeaveOutData data = new LeaveOutData();
+            SearchRequest request2 = new SearchRequest(INDEX_SEAT_REALTIMETRAJECTORY+time);
+            // 构建查询条件
+            BoolQueryBuilder boolQueryBuilder2 = QueryBuilders.boolQuery();
+            SearchSourceBuilder searchSourceBuilder2 = new SearchSourceBuilder();
+            boolQueryBuilder2.filter(QueryBuilders.wildcardQuery("trackDeviceNo", "*,"+ 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)
+                    .trackTotalHits(true)
+                    .size(0);
+            request2.source(searchSourceBuilder2);
+            try {
+                SearchResponse search2 = client.search(request, RequestOptions.DEFAULT);
+                SearchHits searchHits = search2.getHits();
+                Long totalHits = searchHits.getTotalHits().value;
+                if (totalHits<5) {
+                    SearchHit[] hits = searchHits.getHits();
+                    if (hits.length > 0) {
+                        JSONObject sourceItem = JSONObject.parseObject(hits[0].getSourceAsString());
+                        data.setMergeTarget(sourceItem.getString("mergeTarget"));
+                        data.setStartTime(query.getStartTime());
+                        data.setEndTime(query.getEndTime());
+                        data.setBatchNumber(item.getBatchNumber());
+                        data.setOriginalCount(item.getCount());
+                        data.setTrackCount(totalHits);
+                        list.add(data);
+                    }
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        });
+        try {
+            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+            response.setCharacterEncoding("utf-8");
+            String fileName = URLEncoder.encode("天奥轨迹数据遗漏", "UTF-8");
+            response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xlsx");
+            EasyExcel.write(response.getOutputStream(), LeaveOutData.class).sheet("天奥轨迹数据遗漏")
+                    .doWrite(list);
+        } catch (Exception e) {
+            // 重置response
+            log.info("导出天奥轨迹数据遗漏excel失败:{}" + e.getMessage() + e);
+        }
+    }
+
+    @Override
+    public void beiDouLeaveOutExcel(FusionQuery query, HttpServletResponse response) throws IOException, ParseException {
+        List<LeaveOutData> list = new ArrayList<>();
+        List<LeaceOutDto> dtos = new ArrayList<>();
+        Date startTime = DateUtils.parse(query.getStartTime(),"yyyy-MM-dd");
+        String time = DateUtils.format(startTime,"yyyy-MM-dd");
+        SearchRequest request = new SearchRequest(INDEX_SEAT_TRACK_BEIDOU+time);
+        // 构建查询条件
+        BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
+        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
+        boolQueryBuilder.filter(QueryBuilders.rangeQuery("locationTime").gte(query.getStartTime()).lte(query.getEndTime()));
+        searchSourceBuilder.query(boolQueryBuilder);
+        TermsAggregationBuilder aggBuilder = AggregationBuilders.terms("ship_field_agg")
+                .field("devideNo")
+                .size(0);
+        searchSourceBuilder
+                .trackTotalHits(true)
+                .aggregation(aggBuilder)
+                .size(0);
+        request.source(searchSourceBuilder);
+        SearchResponse search = client.search(request, RequestOptions.DEFAULT);
+        Aggregations aggregations = search.getAggregations();
+        ParsedStringTerms aggregation = aggregations.get("ship_field_agg");
+        for (Terms.Bucket bucket : aggregation.getBuckets()) {
+            LeaceOutDto dto = new LeaceOutDto();
+            dto.setBatchNumber(bucket.getKeyAsString());
+            dto.setCount(Long.valueOf(bucket.getDocCount()));
+            dtos.add(dto);
+        }
+        dtos.forEach(item->{
+            LeaveOutData data = new LeaveOutData();
+            SearchRequest request2 = new SearchRequest(INDEX_SEAT_REALTIMETRAJECTORY+time);
+            // 构建查询条件
+            BoolQueryBuilder boolQueryBuilder2 = QueryBuilders.boolQuery();
+            SearchSourceBuilder searchSourceBuilder2 = new SearchSourceBuilder();
+            boolQueryBuilder2.filter(QueryBuilders.wildcardQuery("trackDeviceNo", "*,"+ item.getBatchNumber() +",*"));
+            boolQueryBuilder2.filter(QueryBuilders.rangeQuery("mergeTime").gte(query.getStartTime()).lte(query.getEndTime()));
+            boolQueryBuilder2.filter(QueryBuilders.termsQuery("mergeType","BEIDOU","AIS_BEIDOU","BEIDOU_RADAR","AIS_BEIDOU_RADAR"));
+            searchSourceBuilder2.query(boolQueryBuilder2)
+                    .trackTotalHits(true)
+                    .size(0);
+            request2.source(searchSourceBuilder2);
+            try {
+                SearchResponse search2 = client.search(request, RequestOptions.DEFAULT);
+                SearchHits searchHits = search2.getHits();
+                Long totalHits = searchHits.getTotalHits().value;
+                if (totalHits<5) {
+                    SearchHit[] hits = searchHits.getHits();
+                    if (hits.length > 0) {
+                        JSONObject sourceItem = JSONObject.parseObject(hits[0].getSourceAsString());
+                        data.setMergeTarget(sourceItem.getString("mergeTarget"));
+                        data.setStartTime(query.getStartTime());
+                        data.setEndTime(query.getEndTime());
+                        data.setBatchNumber(item.getBatchNumber());
+                        data.setOriginalCount(item.getCount());
+                        data.setTrackCount(totalHits);
+                        list.add(data);
+                    }
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        });
+        try {
+            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+            response.setCharacterEncoding("utf-8");
+            String fileName = URLEncoder.encode("北斗轨迹数据遗漏", "UTF-8");
+            response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xlsx");
+            EasyExcel.write(response.getOutputStream(), LeaveOutData.class).sheet("北斗轨迹数据遗漏")
+                    .doWrite(list);
+        } catch (Exception e) {
+            // 重置response
+            log.info("导出北斗轨迹数据遗漏excel失败:{}" + e.getMessage() + e);
+        }
+    }
+
+    @Override
+    public void hlxyjrhLeaveOutExcel(FusionQuery query, HttpServletResponse response) throws IOException, ParseException {
+        List<LeaveOutData> list = new ArrayList<>();
+        List<LeaceOutDto> dtos = new ArrayList<>();
+        Date startTime = DateUtils.parse(query.getStartTime(),"yyyy-MM-dd");
+        String time = DateUtils.format(startTime,"yyyy-MM-dd");
+        SearchRequest request = new SearchRequest(INDEX_SEAT_HLX_FUSION_SHIP+time);
+        // 构建查询条件
+        BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
+        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
+        boolQueryBuilder.filter(QueryBuilders.rangeQuery("time").gte(query.getStartTime()).lte(query.getEndTime()));
+        searchSourceBuilder.query(boolQueryBuilder);
+        TermsAggregationBuilder aggBuilder = AggregationBuilders.terms("ship_field_agg")
+                .field("targetID")
+                .size(0);
+        searchSourceBuilder
+                .trackTotalHits(true)
+                .aggregation(aggBuilder)
+                .size(0);
+        request.source(searchSourceBuilder);
+        SearchResponse search = client.search(request, RequestOptions.DEFAULT);
+        Aggregations aggregations = search.getAggregations();
+        ParsedStringTerms aggregation = aggregations.get("ship_field_agg");
+        for (Terms.Bucket bucket : aggregation.getBuckets()) {
+            LeaceOutDto dto = new LeaceOutDto();
+            dto.setBatchNumber(bucket.getKeyAsString());
+            dto.setCount(Long.valueOf(bucket.getDocCount()));
+            dtos.add(dto);
+        }
+        dtos.forEach(item->{
+            LeaveOutData data = new LeaveOutData();
+            SearchRequest request2 = new SearchRequest(INDEX_SEAT_REALTIMETRAJECTORY+time);
+            // 构建查询条件
+            BoolQueryBuilder boolQueryBuilder2 = QueryBuilders.boolQuery();
+            SearchSourceBuilder searchSourceBuilder2 = new SearchSourceBuilder();
+            boolQueryBuilder2.filter(QueryBuilders.wildcardQuery("trackDeviceNo", "*,"+ 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)
+                    .trackTotalHits(true)
+                    .size(0);
+            request2.source(searchSourceBuilder2);
+            try {
+                SearchResponse search2 = client.search(request, RequestOptions.DEFAULT);
+                SearchHits searchHits = search2.getHits();
+                Long totalHits = searchHits.getTotalHits().value;
+                if (totalHits<5) {
+                    SearchHit[] hits = searchHits.getHits();
+                    if (hits.length > 0) {
+                        JSONObject sourceItem = JSONObject.parseObject(hits[0].getSourceAsString());
+                        data.setMergeTarget(sourceItem.getString("mergeTarget"));
+                        data.setStartTime(query.getStartTime());
+                        data.setEndTime(query.getEndTime());
+                        data.setBatchNumber(item.getBatchNumber());
+                        data.setOriginalCount(item.getCount());
+                        data.setTrackCount(totalHits);
+                        list.add(data);
+                    }
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        });
+        try {
+            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+            response.setCharacterEncoding("utf-8");
+            String fileName = URLEncoder.encode("海兰信1级融合轨迹数据遗漏", "UTF-8");
+            response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xlsx");
+            EasyExcel.write(response.getOutputStream(), LeaveOutData.class).sheet("海兰信1级融合轨迹数据遗漏")
+                    .doWrite(list);
+        } catch (Exception e) {
+            // 重置response
+            log.info("导出海兰信1级融合轨迹数据遗漏excel失败:{}" + e.getMessage() + e);
+        }
+    }
+
+    @Override
+    public void tianaoStaticOrDynamicLeaveOutExcel(FusionQuery query, HttpServletResponse response) throws IOException, ParseException {
+        List<StaticOrDynamicData> list = new ArrayList<>();
+        List<LeaceOutDto> dtos = new ArrayList<>();
+        Date startTime = DateUtils.parse(query.getStartTime(),"yyyy-MM-dd");
+        String time = DateUtils.format(startTime,"yyyy-MM-dd");
+        SearchRequest request = new SearchRequest(INDEX_SEAT_TRACK_RADAR+time);
+        // 构建查询条件
+        BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
+        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
+        boolQueryBuilder.filter(QueryBuilders.rangeQuery("receiveTime").gte(query.getStartTime()).lte(query.getEndTime()));
+        boolQueryBuilder.filter(QueryBuilders.termQuery("targetProper","1"));
+        searchSourceBuilder.query(boolQueryBuilder);
+        TermsAggregationBuilder aggBuilder = AggregationBuilders.terms("ship_field_agg")
+                .field("fusionBatchNum")
+                .size(0);
+        searchSourceBuilder
+                .trackTotalHits(true)
+                .aggregation(aggBuilder)
+                .size(0);
+        request.source(searchSourceBuilder);
+        SearchResponse search = client.search(request, RequestOptions.DEFAULT);
+        Aggregations aggregations = search.getAggregations();
+        ParsedStringTerms aggregation = aggregations.get("ship_field_agg");
+        for (Terms.Bucket bucket : aggregation.getBuckets()) {
+            LeaceOutDto dto = new LeaceOutDto();
+            dto.setBatchNumber(bucket.getKeyAsString());
+            dto.setCount(Long.valueOf(bucket.getDocCount()));
+            dtos.add(dto);
+        }
+        dtos.forEach(item->{
+            StaticOrDynamicData data = new StaticOrDynamicData();
+            SearchRequest request2 = new SearchRequest(INDEX_SEAT_REALTIMETRAJECTORY+time);
+            // 构建查询条件
+            BoolQueryBuilder boolQueryBuilder2 = QueryBuilders.boolQuery();
+            SearchSourceBuilder searchSourceBuilder2 = new SearchSourceBuilder();
+            boolQueryBuilder2.filter(QueryBuilders.wildcardQuery("trackDeviceNo", "*,"+ 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"));
+            searchSourceBuilder2.query(boolQueryBuilder2)
+                    .trackTotalHits(true)
+                    .size(0);
+            request2.source(searchSourceBuilder2);
+            try {
+                SearchResponse search2 = client.search(request, RequestOptions.DEFAULT);
+                SearchHits searchHits = search2.getHits();
+                SearchHit[] hits = searchHits.getHits();
+                if (hits.length > 0) {
+                    JSONObject sourceItem = JSONObject.parseObject(hits[0].getSourceAsString());
+                    data.setMergeTarget(sourceItem.getString("mergeTarget"));
+                    data.setBatchNumber(item.getBatchNumber());
+                    list.add(data);
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        });
+        try {
+            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+            response.setCharacterEncoding("utf-8");
+            String fileName = URLEncoder.encode("天奥静态数据与动态轨迹融合", "UTF-8");
+            response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xlsx");
+            EasyExcel.write(response.getOutputStream(), StaticOrDynamicData.class).sheet("天奥静态数据与动态轨迹融合")
+                    .doWrite(list);
+        } catch (Exception e) {
+            // 重置response
+            log.info("导出天奥静态数据与动态轨迹融合excel失败:{}" + e.getMessage() + e);
         }
     }
 }

+ 8 - 8
fusion-analysis/src/main/resources/application.yml

@@ -3,12 +3,12 @@ server:
 
 spring:
   application.name: fusion-analysis
-  profiles.active: prod
 
-#taiji:
-#  elasticsearch.rest:
-#    uris: 120.25.233.10:9200
-#    username: elastic       #如果你设置了基于x-pack的验证就要填写账号和密码
-#    password: root@2022!       #没有则不用配置
-#    connection-timeout: 100 #连接超时
-#    max-connection: 100  #最大连接数
+
+taiji:
+  elasticsearch.rest:
+    uris: 120.25.233.10:9200
+    username: elastic       #如果你设置了基于x-pack的验证就要填写账号和密码
+    password: root@2022!       #没有则不用配置
+    connection-timeout: 100 #连接超时
+    max-connection: 100  #最大连接数

BIN
tianao-analysis/target/classes/cn/com/taiji/TianaoAnalySisApplication.class