90
91
set EXEC_DIR=%CD%
92
set WDIR=%EXEC_DIR%
93
:findBaseDir
94
IF EXIST "%WDIR%"\.mvn goto baseDirFound
95
cd ..
96
IF "%WDIR%"=="%CD%" goto baseDirNotFound
97
set WDIR=%CD%
98
goto findBaseDir
99
100
:baseDirFound
101
set MAVEN_PROJECTBASEDIR=%WDIR%
102
cd "%EXEC_DIR%"
103
goto endDetectBaseDir
104
105
:baseDirNotFound
106
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107
cd "%EXEC_DIR%"
108
109
:endDetectBaseDir
110
111
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112
113
@setlocal EnableExtensions EnableDelayedExpansion
114
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116
117
:endReadAdditionalConfig
118
119
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
121
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
122
123
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
124
125
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
126
    IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
127
)
128
129
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
130
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
131
if exist %WRAPPER_JAR% (
132
    if "%MVNW_VERBOSE%" == "true" (
133
        echo Found %WRAPPER_JAR%
134
    )
135
) else (
136
    if not "%MVNW_REPOURL%" == "" (
137
        SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
138
    )
139
    if "%MVNW_VERBOSE%" == "true" (
140
        echo Couldn't find %WRAPPER_JAR%, downloading it ...
141
        echo Downloading from: %DOWNLOAD_URL%
142
    )
143
144
    powershell -Command "&{"^
145
		"$webclient = new-object System.Net.WebClient;"^
146
		"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
147
		"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
148
		"}"^
149
		"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
150
		"}"
151
    if "%MVNW_VERBOSE%" == "true" (
152
        echo Finished downloading %WRAPPER_JAR%
153
    )
154
)
155
@REM End of extension
156
157
@REM Provide a "standardized" way to retrieve the CLI args that will
158
@REM work with both Windows and non-Windows executions.
159
set MAVEN_CMD_LINE_ARGS=%*
160
161
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
162
if ERRORLEVEL 1 goto error
163
goto end
164
165
:error
166
set ERROR_CODE=1
167
168
:end
169
@endlocal & set ERROR_CODE=%ERROR_CODE%
170
171
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
172
@REM check for post script, once with legacy .bat ending and once with .cmd ending
173
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
174
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
175
:skipRcPost
176
177
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
178
if "%MAVEN_BATCH_PAUSE%" == "on" pause
179
180
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
181
182
exit /B %ERROR_CODE%

+ 223 - 0
pom.xml

@ -0,0 +1,223 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4
    <modelVersion>4.0.0</modelVersion>
5
    <parent>
6
        <groupId>org.springframework.boot</groupId>
7
        <artifactId>spring-boot-starter-parent</artifactId>
8
        <version>2.3.4.RELEASE</version>
9
        <relativePath/> <!-- lookup parent from repository -->
10
    </parent>
11
    <groupId>com.ai.bss.es</groupId>
12
    <artifactId>es-manage</artifactId>
13
    <version>0.0.1-SNAPSHOT</version>
14
    <name>es-manage</name>
15
    <description>es manage for Spring Boot</description>
16
17
    <properties>
18
        <java.version>1.8</java.version>
19
        <!-- 这里必须要填写,因为springboot2.3.2默认的elasticsearch版本为7.6.2,我们使用的是7.4.2,不更改会产生版本不兼容等问题 -->
20
        <elasticsearch.version>7.4.2</elasticsearch.version>
21
    </properties>
22
23
    <dependencies>
24
        <dependency>
25
            <groupId>org.springframework.boot</groupId>
26
            <artifactId>spring-boot-starter-web</artifactId>
27
        </dependency>
28
29
30
<!--         这里我使用的是elasticsearch的high-level-client 版本要和你的elasticsearch版本对应-->
31
<!--        <dependency>-->
32
<!--            <groupId>org.elasticsearch.client</groupId>-->
33
<!--            <artifactId>elasticsearch-rest-high-level-client</artifactId>-->
34
<!--            <version>7.4.2</version>-->
35
<!--            <exclusions>-->
36
<!--                <exclusion>-->
37
<!--                    <groupId>org.elasticsearch</groupId>-->
38
<!--                    <artifactId>elasticsearch</artifactId>-->
39
<!--                </exclusion>-->
40
<!--            </exclusions>-->
41
<!--        </dependency>-->
42
43
        <dependency>
44
            <groupId>org.springframework.boot</groupId>
45
            <artifactId>spring-boot-starter-test</artifactId>
46
            <scope>test</scope>
47
            <exclusions>
48
                <exclusion>
49
                    <groupId>org.junit.vintage</groupId>
50
                    <artifactId>junit-vintage-engine</artifactId>
51
                </exclusion>
52
            </exclusions>
53
        </dependency>
54
55
        <dependency>
56
            <groupId>org.projectlombok</groupId>
57
            <artifactId>lombok</artifactId>
58
            <version>1.18.12</version>
59
        </dependency>
60
61
        <dependency>
62
            <groupId>com.ai.abc</groupId>
63
            <artifactId>persistence-es</artifactId>
64
            <version>2.0-SNAPSHOT</version>
65
            <exclusions>
66
                <exclusion>
67
                    <groupId>org.springframework.boot</groupId>
68
                    <artifactId>spring-boot-starter-log4j2</artifactId>
69
                </exclusion>
70
<!--                <exclusion>-->
71
<!--                    <groupId>org.elasticsearch</groupId>-->
72
<!--                    <artifactId>elasticsearch</artifactId>-->
73
<!--                </exclusion>-->
74
<!--                <exclusion>-->
75
<!--                    <groupId>org.elasticsearch.client</groupId>-->
76
<!--                    <artifactId>elasticsearch-rest-high-level-client</artifactId>-->
77
<!--                </exclusion>-->
78
<!--                <exclusion>-->
79
<!--                    <groupId>org.projectlombok</groupId>-->
80
<!--                    <artifactId>lombok</artifactId>-->
81
<!--                </exclusion>-->
82
            </exclusions>
83
        </dependency>
84
    </dependencies>
85
86
    <build>
87
88
        <resources>
89
            <resource>
90
                <directory>src/main/resources</directory>
91
                <excludes>
92
                    <exclude>environment/dev/**</exclude>
93
                    <exclude>environment/product/**</exclude>
94
                    <exclude>environment/test/**</exclude>
95
                </excludes>
96
            </resource>
97
            <resource>
98
                <directory>${project.basedir}/src/main/resources/environment/${env}</directory>
99
            </resource>
100
        </resources>
101
102
103
        <plugins>
104
            <plugin>
105
                <groupId>org.springframework.boot</groupId>
106
                <artifactId>spring-boot-maven-plugin</artifactId>
107
            </plugin>
108
            <!--            <plugin>
109
                            <groupId>org.apache.maven.plugins</groupId>
110
                            <artifactId>maven-resources-plugin</artifactId>
111
                            <executions>
112
                                <execution>
113
                                    <id>copy-resources</id>
114
                                    <phase>package</phase>
115
                                    <goals>
116
                                        <goal>copy-resources</goal>
117
                                    </goals>
118
                                    <configuration>
119
                                        <encoding>UTF-8</encoding>
120
                                        <outputDirectory>
121
                                            ${project.build.directory}/config
122
                                        </outputDirectory>
123
                                        <resources>
124
                                            <resource>
125
                                                <directory>src/main/resources/environment/${env}</directory>
126
                                                <includes>
127
                                                    <include>**/*.properties</include>
128
                                                    <include>**/*.xml</include>
129
                                                </includes>
130
                                            </resource>
131
                                        </resources>
132
                                    </configuration>
133
                                </execution>
134
                            </executions>
135
                        </plugin>-->
136
137
            <!-- The configuration of maven-jar-plugin -->
138
            <plugin>
139
                <groupId>org.apache.maven.plugins</groupId>
140
                <artifactId>maven-jar-plugin</artifactId>
141
                <version>2.4</version>
142
                <!-- The configuration of the plugin -->
143
                <configuration>
144
                    <!-- Configuration of the archiver -->
145
                    <archive>
146
                        <!--生成的jar中,不要包含pom.xml和pom.properties这两个文件-->
147
                        <addMavenDescriptor>false</addMavenDescriptor>
148
149
                        <!-- Manifest specific configuration -->
150
                        <manifest>
151
                            <!--是否要把第三方jar放到manifest的classpath中-->
152
                            <addClasspath>true</addClasspath>
153
                            <!--生成的manifest中classpath的前缀,因为要把第三方jar放到lib目录下,所以classpath的前缀是lib/-->
154
                            <classpathPrefix>lib/</classpathPrefix>
155
                            <!--应用的main class-->
156
                            <mainClass>com.ai.bss.es.esmanage.EsManageApplication</mainClass>
157
                        </manifest>
158
                        <manifestEntries>
159
                            <Class-Path>./config/</Class-Path>
160
                        </manifestEntries>
161
                    </archive>
162
                    <!--过滤掉不希望包含在jar中的文件-->
163
                    <excludes>
164
                        <exclude>**/*.properties</exclude>
165
                        <exclude>**/*.xml</exclude>
166
                    </excludes>
167
                </configuration>
168
            </plugin>
169
170
            <plugin>
171
                <groupId>org.apache.maven.plugins</groupId>
172
                <artifactId>maven-dependency-plugin</artifactId>
173
                <version>2.10</version>
174
                <executions>
175
                    <execution>
176
                        <id>copy-dependencies</id>
177
                        <phase>package</phase>
178
                        <goals>
179
                            <goal>copy-dependencies</goal>
180
                        </goals>
181
                        <configuration>
182
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
183
                        </configuration>
184
                    </execution>
185
                </executions>
186
            </plugin>
187
188
            <!-- The configuration of maven-assembly-plugin -->
189
            <plugin>
190
                <groupId>org.apache.maven.plugins</groupId>
191
                <artifactId>maven-assembly-plugin</artifactId>
192
                <version>2.4</version>
193
                <!-- The configuration of the plugin -->
194
                <configuration>
195
                    <!-- Specifies the configuration file of the assembly plugin -->
196
                    <descriptors>
197
                        <descriptor>${project.basedir}/src/main/assembly/package.xml</descriptor>
198
                    </descriptors>
199
                </configuration>
200
                <executions>
201
                    <execution>
202
                        <id>make-assembly</id>
203
                        <phase>package</phase>
204
                        <goals>
205
                            <goal>single</goal>
206
                        </goals>
207
                    </execution>
208
                </executions>
209
            </plugin>
210
211
            <plugin>
212
                <groupId>org.apache.maven.plugins</groupId>
213
                <artifactId>maven-surefire-plugin</artifactId>
214
                <configuration>
215
                    <skip>true</skip>
216
                </configuration>
217
            </plugin>
218
        </plugins>
219
220
    </build>
221
222
223
</project>

+ 60 - 0
src/main/assembly/package.xml

@ -0,0 +1,60 @@
1
<assembly>
2
  <id>bin</id>
3
  <!-- 最终打包成一个用于发布的zip文件 -->
4
  <formats>
5
    <format>zip</format>
6
  </formats>
7
8
  <!-- Adds dependencies to zip package under lib directory -->
9
  <dependencySets>
10
    <dependencySet>
11
      <!-- 不使用项目的artifact,第三方jar不要解压,打包进zip文件的lib目录 -->
12
      <useProjectArtifact>false</useProjectArtifact>
13
      <outputDirectory>lib</outputDirectory>
14
      <unpack>false</unpack>
15
      <scope>runtime</scope>
16
    </dependencySet>
17
  </dependencySets>
18
19
  <fileSets>
20
    <!-- 把项目相关的说明文件,打包进zip文件的根目录 -->
21
    <fileSet>
22
      <directory>${project.basedir}</directory>
23
      <outputDirectory>/</outputDirectory>
24
      <includes>
25
        <include>README*</include>
26
        <include>LICENSE*</include>
27
        <include>NOTICE*</include>
28
      </includes>
29
    </fileSet>
30
31
    <!-- 把项目的配置文件,打包进zip文件的config目录 -->
32
    <fileSet>
33
<!--      <directory>/src/main/resources/environment/${env}</directory>-->
34
      <directory>/src/main/resources</directory>
35
      <outputDirectory>/config</outputDirectory>
36
      <includes>
37
        <include>**/*.properties</include>
38
        <include>**/*.xml</include>
39
      </includes>
40
    </fileSet>
41
42
    <!-- 把项目的脚本文件目录( src/main/scripts )中的启动脚本文件,打包进zip文件的跟目录 -->
43
    <fileSet>
44
      <directory>${project.build.scriptSourceDirectory}</directory>
45
      <outputDirectory></outputDirectory>
46
      <includes>
47
        <include>startup.*</include>
48
      </includes>
49
    </fileSet>
50
51
    <!-- 把项目自己编译出来的jar文件,打包进zip文件的根目录 -->
52
    <fileSet>
53
      <directory>${project.build.directory}</directory>
54
      <outputDirectory></outputDirectory>
55
      <includes>
56
        <include>*.jar</include>
57
      </includes>
58
    </fileSet>
59
  </fileSets>
60
</assembly>

+ 13 - 0
src/main/java/com/ai/bss/es/esmanage/EsManageApplication.java

@ -0,0 +1,13 @@
1
package com.ai.bss.es.esmanage;
2
3
import org.springframework.boot.SpringApplication;
4
import org.springframework.boot.autoconfigure.SpringBootApplication;
5
6
@SpringBootApplication
7
public class EsManageApplication {
8
9
    public static void main(String[] args) {
10
        SpringApplication.run(EsManageApplication.class, args);
11
    }
12
13
}

+ 133 - 0
src/main/java/com/ai/bss/es/esmanage/controller/EsController.java

@ -0,0 +1,133 @@
1
package com.ai.bss.es.esmanage.controller;
2
3
import com.ai.bss.es.esmanage.service.EsService;
4
import com.ai.bss.es.esmanage.utils.RequestEntity;
5
import com.ai.bss.es.esmanage.utils.ResponseResult;
6
import org.elasticsearch.action.index.IndexRequest;
7
import org.elasticsearch.action.index.IndexResponse;
8
import org.elasticsearch.action.search.SearchRequest;
9
import org.elasticsearch.action.search.SearchResponse;
10
import org.elasticsearch.client.RequestOptions;
11
import org.elasticsearch.client.RestHighLevelClient;
12
import org.elasticsearch.common.xcontent.XContentType;
13
import org.elasticsearch.index.query.BoolQueryBuilder;
14
import org.elasticsearch.index.query.MatchQueryBuilder;
15
import org.elasticsearch.index.query.QueryBuilders;
16
import org.elasticsearch.search.SearchHit;
17
import org.elasticsearch.search.aggregations.AggregationBuilders;
18
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
19
import org.elasticsearch.search.aggregations.metrics.AvgAggregationBuilder;
20
import org.elasticsearch.search.builder.SearchSourceBuilder;
21
import org.springframework.beans.factory.annotation.Autowired;
22
import org.springframework.beans.factory.annotation.Value;
23
import org.springframework.web.bind.annotation.PostMapping;
24
import org.springframework.web.bind.annotation.RequestBody;
25
import org.springframework.web.bind.annotation.RequestMapping;
26
import org.springframework.web.bind.annotation.RestController;
27
28
import java.io.IOException;
29
import java.util.ArrayList;
30
import java.util.List;
31
import java.util.Map;
32
33
@RestController
34
@RequestMapping("/es")
35
public class EsController {
36
37
    @Autowired
38
    private RestHighLevelClient client;
39
40
    @Autowired
41
    private EsService esService;
42
43
    @PostMapping("/execute")
44
    ResponseResult execute(@RequestBody RequestEntity requestEntity) throws IOException {
45
//        SearchRequest requestEs = null;
46
//        String entity = requestEntity.getEntity();
47
//        String methods = requestEntity.getMethods();
48
//        String tableName = requestEntity.getTableName();
49
//        String type = requestEntity.getType();
50
//        if("search".equals(methods)){
51
//            requestEs =  new SearchRequest(tableName);
52
//            SearchResponse searchResponse = client.search(requestEs, RequestOptions.DEFAULT);
53
//
54
//            //6、开始处理返回的数据
55
//            SearchHit[] hits = searchResponse.getHits().getHits();
56
//            List<String> list = new ArrayList<String>();
57
//            for (SearchHit hit : hits) {
58
//                String hitString = hit.getSourceAsString();
59
//                System.out.println(hitString);
60
//                list.add(hitString);
61
//            }
62
//            ResponseResult.sucess(list);
63
//        }
64
//
65
//        if("GET".equals(methods)){
66
//            requestEs =  new SearchRequest(tableName);
67
//            SearchResponse searchResponse = null;//purePersist(requestEs, RequestOptions.DEFAULT);
68
//
69
//            //6、开始处理返回的数据
70
//            SearchHit[] hits = searchResponse.getHits().getHits();
71
//            List<String> list = new ArrayList<String>();
72
//            for (SearchHit hit : hits) {
73
//                String hitString = hit.getSourceAsString();
74
//                System.out.println(hitString);
75
//                list.add(hitString);
76
//            }
77
//            ResponseResult.sucess(list);
78
//        }
79
80
        return esService.executeEsEntity(requestEntity);
81
    }
82
83
84
    @RequestMapping("/test")
85
    List<String> contextLoads() throws IOException {
86
        //1、创建查询请求,规定查询的索引
87
        SearchRequest request = new SearchRequest("es_terminal_event");
88
        //2、创建条件构造
89
        SearchSourceBuilder builder = new SearchSourceBuilder();
90
        //3、构造条件
91
        MatchQueryBuilder matchQueryBuilder = QueryBuilders.matchQuery("address", "Lane");
92
        builder.query(matchQueryBuilder);
93
        //聚合年龄分布
94
        TermsAggregationBuilder ageAgg = AggregationBuilders.terms("ageAgg").field("age");
95
        builder.aggregation(ageAgg);
96
//
97
//        //聚合平均年龄
98
        AvgAggregationBuilder balanceAvg = AggregationBuilders.avg("balanceAvg").field("balance");
99
        builder.aggregation(balanceAvg);
100
101
        List<String> ids = new ArrayList();
102
        ids.add("981489");
103
        ids.add("155682");
104
        BoolQueryBuilder exersiceBoolQuery = QueryBuilders.boolQuery();
105
        for (String exerciseId: ids)
106
        {
107
            exersiceBoolQuery.must(QueryBuilders.termQuery("resourceId", exerciseId));
108
        }
109
        builder.query(exersiceBoolQuery);
110
111
        //4、将构造好的条件放入请求中
112
        request.source(builder);
113
114
        //5、开始执行发送request请求
115
        SearchResponse searchResponse = client.search(request, RequestOptions.DEFAULT);
116
117
118
119
        //6、开始处理返回的数据
120
        SearchHit[] hits = searchResponse.getHits().getHits();
121
        List<String> list = new ArrayList<String>();
122
        for (SearchHit hit : hits) {
123
            String hitString = hit.getSourceAsString();
124
            System.out.println(hitString);
125
            list.add(hitString);
126
        }
127
        return list;
128
129
130
131
132
    }
133
}

+ 11 - 0
src/main/java/com/ai/bss/es/esmanage/service/EsService.java

@ -0,0 +1,11 @@
1
package com.ai.bss.es.esmanage.service;
2
3
import com.ai.bss.es.esmanage.utils.RequestEntity;
4
import com.ai.bss.es.esmanage.utils.ResponseResult;
5
6
public interface EsService {
7
8
    ResponseResult executeEsEntity(RequestEntity requestEntity);
9
10
11
}

+ 137 - 0
src/main/java/com/ai/bss/es/esmanage/service/impl/EsServiceImpl.java

@ -0,0 +1,137 @@
1
package com.ai.bss.es.esmanage.service.impl;
2
3
import com.ai.abc.jpa.elastic.model.ElasticPage;
4
import com.ai.abc.jpa.elastic.model.PageInfo;
5
import com.ai.abc.jpa.elastic.model.TimeInfo;
6
import com.ai.abc.jpa.elastic.repository.ElasticEntityRepository;
7
import com.ai.abc.jpa.elastic.repository.impl.ElasticEntityRepositoryImpl;
8
import com.ai.bss.es.esmanage.service.EsService;
9
import com.ai.bss.es.esmanage.utils.RequestEntity;
10
import com.ai.bss.es.esmanage.utils.ResponseResult;
11
import com.alibaba.fastjson.JSONArray;
12
import com.alibaba.fastjson.JSONObject;
13
import com.alibaba.fastjson.TypeReference;
14
import lombok.extern.slf4j.Slf4j;
15
import org.elasticsearch.index.query.QueryBuilders;
16
import org.elasticsearch.index.query.TermsQueryBuilder;
17
import org.springframework.beans.factory.annotation.Value;
18
import org.springframework.stereotype.Service;
19
import org.springframework.util.StringUtils;
20
21
import java.util.*;
22
23
24
@Slf4j
25
@Service
26
public class EsServiceImpl implements EsService {
27
28
29
    @Value("${es.server:47.105.160.21:10020}")
30
    String esServer ;
31
32
33
    ElasticEntityRepository elasticEntityRepository = null;
34
35
    private ElasticEntityRepository getElasticEntityRepository(){
36
        if(elasticEntityRepository==null){
37
            elasticEntityRepository = new ElasticEntityRepositoryImpl();
38
            elasticEntityRepository.initServer(esServer);
39
        }
40
        return elasticEntityRepository;
41
    }
42
43
44
    @Override
45
    public ResponseResult executeEsEntity(RequestEntity requestEntity) {
46
47
        if(requestEntity==null){
48
            return null;
49
        }
50
51
        String methods = requestEntity.getMethods();
52
53
        if("SAVE".equals(methods)){
54
            saveEsEntity(requestEntity);
55
            return ResponseResult.sucess();
56
        }else{
57
            return findEsEntityList(requestEntity);
58
        }
59
60
    }
61
62
    private void saveEsEntity(RequestEntity requestEntity){
63
64
        getElasticEntityRepository().purePersist(requestEntity.getTableName(), "", requestEntity.getEntity());
65
    }
66
67
    private ResponseResult findEsEntityList(RequestEntity requestEntity) {
68
69
        PageInfo pageInfo = new PageInfo();
70
        int pageSize = requestEntity.getPageSize() == null ? 0 : requestEntity.getPageSize();
71
        int startNum = requestEntity.getStartNumber() == null ? 0 : requestEntity.getStartNumber()*pageSize;
72
        pageInfo.setStartNumber(startNum);
73
        pageInfo.setPageSize(pageSize);
74
        Map entityMap = null;
75
        if (!StringUtils.isEmpty(requestEntity.getEntity())) {
76
77
            String entityStr = requestEntity.getEntity();
78
            entityMap = JSONObject.parseObject(entityStr, new TypeReference<Map<String, Object>>() {});
79
        }
80
81
82
        Map fieldMap = null;
83
        String entityKey;
84
        if (entityMap != null && !entityMap.isEmpty()) {
85
            fieldMap = new HashMap();
86
            Iterator var10 = entityMap.entrySet().iterator();
87
88
            while(var10.hasNext()) {
89
                Map.Entry<String, Object> entry = (Map.Entry)var10.next();
90
                entityKey = (String)entry.getKey();
91
                if (entry.getValue() != null) {
92
                    TermsQueryBuilder termsQueryBuilder = null;
93
                    if (entry.getValue().getClass() == JSONArray.class) {
94
//                        this.log.debug("mapKey=" + sortType + ",entry.getValue()=" + entry.getValue());
95
//                        termsQueryBuilder = QueryBuilders.termsQuery(sortType, (ArrayList)entry.getValue());
96
                        fieldMap.put(entityKey,JSONArrayToArrayList((JSONArray)entry.getValue()));
97
                    } else {
98
                        String mapValue = entry.getValue().toString();
99
//                        termsQueryBuilder = QueryBuilders.termsQuery(sortType, new String[]{mapValue});
100
                        fieldMap.put(entityKey,mapValue);
101
                    }
102
103
                }
104
//                fieldMap.put(entityKey)
105
            }
106
        }
107
108
109
        Map sortMap = new HashMap();
110
        if(!StringUtils.isEmpty(requestEntity.getSortFieldName())){
111
            sortMap.put("sortFieldName",requestEntity.getSortFieldName());
112
            sortMap.put("sortType",requestEntity.getSortType());
113
        }
114
        TimeInfo timeInfo =new TimeInfo();
115
        timeInfo.setStartTime(requestEntity.getStartTime());
116
        timeInfo.setEndTime(requestEntity.getEndTime());
117
        timeInfo.setFieldName(requestEntity.getTimeFieldName());
118
        ElasticPage elasticPage = getElasticEntityRepository().findEntity(requestEntity.getTableName(), fieldMap, timeInfo, pageInfo,sortMap);
119
120
        return ResponseResult.sucess(elasticPage.getTotalSize(),elasticPage.getResults());
121
    }
122
123
    private ArrayList<String> JSONArrayToArrayList(JSONArray jsonArray){
124
        ArrayList<String> listdata = null;
125
        if (jsonArray != null) {
126
            listdata = new ArrayList<String>();
127
            for (int i=0;i<jsonArray.size();i++){
128
                listdata.add(jsonArray.getString(i));
129
            }
130
        }
131
        return listdata;
132
    }
133
134
    private Object findEsEntity(){
135
        return null;
136
    }
137
}

+ 100 - 0
src/main/java/com/ai/bss/es/esmanage/utils/CommonConsts.java

@ -0,0 +1,100 @@
1
package com.ai.bss.es.esmanage.utils;
2
3
/**
4
 * 公共常量类
5
 *
6
 * @author chencai
7
 */
8
public class CommonConsts {
9
    /**
10
     * 接口调用返回的成功编码
11
     */
12
    public static final String RESULT_CODE_SUCCESSFUL = "0";
13
14
    /**
15
     * 接口调用返回的失败编码
16
     */
17
    public static final String RESULT_CODE_FAILED = "1";
18
19
    /**
20
     * 接口调用返回的成功描述信息
21
     */
22
    public static final String RESULT_MSG_SUCCESSFUL = "成功";
23
24
    /**
25
     * 接口调用返回的失败的描述信息
26
     */
27
    public static final String RESULT_MSG_FAILED = "失败";
28
29
    /**
30
     * CSV文件列分隔符
31
     */
32
    public static final String CSV_COLUMN_SEPARATOR = ",";
33
    public static final String CSV_COLUMN_SEPARATOR2 = "|";
34
35
36
    /**
37
     * CSV文件列分隔符
38
     */
39
    public static final String CSV_RN = "\r\n";
40
41
    /**
42
     * 最小误差
43
     */
44
    public static final double EPSILON = 0.00000000000000022204;
45
46
    /**
47
     * 时间格式转化 yyyyMMdd_HHmmss
48
     */
49
    public static final String DATE_FORMAT_YYYYMMDD_HHMMSS = "yyyyMMdd_HHmmss";
50
51
    /**
52
     * 时间格式转化 yyyyMM
53
     */
54
    public static final String DATE_FORMAT_YYYYMM = "yyyyMM";
55
56
    /**
57
     * 时间格式转化 yyyyMMdd
58
     */
59
    public static final String DATE_FORMAT_YYYYMMDD = "yyyyMMdd";
60
61
    /**
62
     *
63
     */
64
    public static final String RESULT_MSG_CREATE_CSV_FAILED = "生成csv文件失败";
65
66
    /**
67
     * uspa组织类型-基础平台
68
     */
69
    public static final String USPA_ORG_TYPE_PLATFORM_ORG = "PLATFORM_ORG";
70
71
    /**
72
     * uspa组织类型-行业云
73
     */
74
    public static final String USPA_ORG_TYPE_INDUSTRY_ORG = "INDUSTRY_ORG";
75
76
    /**
77
     * uspa组织类型-客户
78
     */
79
    public static final String USPA_ORG_TYPE_CUSTOMER_ORG = "CUSTOMER_ORG";
80
81
82
83
    public static final String CHARSET_UTF8 = "UTF-8";
84
85
86
    public static final String HTTP_CONTENT_TYPE_JSON = "application/json; charset=utf-8";
87
88
    private CommonConsts() {}
89
90
91
//
92
//    /** 
93
//     * callsTimesMap存放方法被调用的次数O 
94
//     */
95
//    public  static ThreadLocal<Map<String, Long >> callsTimesMap = new ThreadLocal<Map<String, Long>>();// new ThreadLocal<>();
96
//    /** 
97
//     * methodTotalTmieMap存放方法总耗时 
98
//     */
99
//    public  static ThreadLocal<Map<String, Long >> methodTotalTmieMap = new ThreadLocal<Map<String, Long>>();
100
}

+ 35 - 0
src/main/java/com/ai/bss/es/esmanage/utils/ElasticSearchConfig.java

@ -0,0 +1,35 @@
1
package com.ai.bss.es.esmanage.utils;
2
3
import org.apache.http.HttpHost;
4
import org.elasticsearch.client.RestClient;
5
import org.elasticsearch.client.RestHighLevelClient;
6
import org.springframework.beans.factory.annotation.Value;
7
import org.springframework.context.annotation.Bean;
8
import org.springframework.context.annotation.Configuration;
9
10
/**
11
 * 给容器中注入一个RestHighLevelClient
12
 */
13
@Configuration
14
public class ElasticSearchConfig {
15
16
17
18
    @Value("${es.server:47.105.160.21}")
19
    String esServer ;
20
21
22
    @Value("${es.server.port:10020}")
23
    Integer esServerPort ;
24
25
    @Bean
26
    public RestHighLevelClient esRestClient(){
27
        RestHighLevelClient client = new RestHighLevelClient(
28
                RestClient.builder(
29
                        //在这里配置你的elasticsearch的情况
30
                        new HttpHost(esServer, esServerPort, "http")
31
                )
32
        );
33
        return client;
34
    }
35
}

+ 22 - 0
src/main/java/com/ai/bss/es/esmanage/utils/RequestEntity.java

@ -0,0 +1,22 @@
1
package com.ai.bss.es.esmanage.utils;
2
3
import lombok.Getter;
4
import lombok.Setter;
5
6
@Setter
7
@Getter
8
public class RequestEntity {
9
10
    private String tableName;
11
    private String type;
12
    private String methods;
13
    private String entity;
14
    private Integer startNumber;
15
    private Integer pageSize;
16
    private String startTime;
17
    private String endTime;
18
    private String timeFieldName;
19
    private String sortFieldName;
20
    private String sortType;
21
22
}

+ 105 - 0
src/main/java/com/ai/bss/es/esmanage/utils/ResponseResult.java

@ -0,0 +1,105 @@
1
package com.ai.bss.es.esmanage.utils;
2
3
4
import lombok.Getter;
5
import lombok.NoArgsConstructor;
6
import lombok.Setter;
7
8
/**
9
 * 接口响应参数公共类
10
 *
11
 * @author chencai
12
 */
13
@NoArgsConstructor
14
@Getter
15
@Setter
16
public class ResponseResult<T> {
17
    /**
18
     * 结果编码
19
     */
20
    private String resultCode;
21
22
    /**
23
     * 结果信息
24
     */
25
    private String resultMsg;
26
27
    /**
28
     * 调用轨迹标识
29
     */
30
    private Long traceId;
31
32
    /**
33
     * 结果集数量
34
     */
35
    private Long totalResultNumber;
36
37
    /**
38
     * 结果集信息
39
     */
40
    private T result;
41
42
    private ResponseResult(String resultCode, String resultMsg) {
43
        this.resultCode = resultCode;
44
        this.resultMsg = resultMsg;
45
    }
46
47
    private ResponseResult(String resultCode, String resultMsg, T result) {
48
        this.resultCode = resultCode;
49
        this.resultMsg = resultMsg;
50
        this.result = result;
51
    }
52
53
    private ResponseResult(String resultCode, String resultMsg, Long totalResuleNumber,
54
                           T result) {
55
        this.resultCode = resultCode;
56
        this.resultMsg = resultMsg;
57
        this.totalResultNumber = totalResuleNumber;
58
        this.result = result;
59
    }
60
61
    private ResponseResult(String resultCode, String resultMsg, Long traceId, Long totalResuleNumber,
62
                           T result) {
63
        this.resultCode = resultCode;
64
        this.resultMsg = resultMsg;
65
        this.traceId = traceId;
66
        this.totalResultNumber = totalResuleNumber;
67
        this.result = result;
68
    }
69
    
70
    public static <T> ResponseResult<T> sucess() {
71
        return new ResponseResult<T>(CommonConsts.RESULT_CODE_SUCCESSFUL, CommonConsts.RESULT_MSG_SUCCESSFUL);
72
    }
73
74
    public static <T> ResponseResult<T> sucess(String resultMsg) {
75
        return new ResponseResult<T>(CommonConsts.RESULT_CODE_SUCCESSFUL, resultMsg);
76
    }
77
78
    public static <T> ResponseResult<T> sucess(T result) {
79
        return new ResponseResult<T>(CommonConsts.RESULT_CODE_SUCCESSFUL, CommonConsts.RESULT_MSG_SUCCESSFUL, result);
80
    }
81
82
    public static <T> ResponseResult<T> sucess(long totalResuleNumber, T result) {
83
        return new ResponseResult<T>(CommonConsts.RESULT_CODE_SUCCESSFUL, CommonConsts.RESULT_MSG_SUCCESSFUL, totalResuleNumber, result);
84
    }
85
86
    public static <T> ResponseResult<T> sucess(Long traceId, Long totalResuleNumber, T result) {
87
        return new ResponseResult<T>(CommonConsts.RESULT_CODE_SUCCESSFUL, CommonConsts.RESULT_MSG_SUCCESSFUL, traceId, totalResuleNumber, result);
88
    }
89
90
    public static <T> ResponseResult<T> error() {
91
        return new ResponseResult<T>(CommonConsts.RESULT_CODE_FAILED, CommonConsts.RESULT_MSG_FAILED);
92
    }
93
94
    public static <T> ResponseResult<T> error(String errorMsg) {
95
        return new ResponseResult<T>(CommonConsts.RESULT_CODE_FAILED, errorMsg);
96
    }
97
98
    public static <T> ResponseResult<T> error(String resultCode, String errorMsg) {
99
        return new ResponseResult<T>(resultCode, errorMsg);
100
    }
101
102
    public static <T> ResponseResult<T> error(String resultCode, String errorMsg, Long traceId) {
103
        return new ResponseResult<T>(resultCode, errorMsg, traceId, 0L, null);
104
    }
105
}

+ 6 - 0
src/main/resources/application.properties

@ -0,0 +1,6 @@
1
server.port=8111
2
spring.application.name=elastic
3
4
5
es.server=47.105.160.21:10020
6
es.server.port=10020

+ 6 - 0
src/main/resources/environment/dev/application.properties

@ -0,0 +1,6 @@
1
server.port=8111
2
spring.application.name=elastic
3
4
5
es.server=47.105.160.21:10020
6
es.server.port=10020

+ 6 - 0
src/main/resources/environment/product/application.properties

@ -0,0 +1,6 @@
1
server.port=8111
2
spring.application.name=elastic
3
4
5
es.server=47.105.160.21:10020
6
es.server.port=10020

+ 6 - 0
src/main/resources/environment/test/application.properties

@ -0,0 +1,6 @@
1
server.port=8111
2
spring.application.name=elastic
3
4
5
es.server=47.105.160.21:10020
6
es.server.port=10020

+ 155 - 0
src/test/java/com/ai/bss/es/esmanage/EsManageApplicationTests.java

@ -0,0 +1,155 @@
1
package com.ai.bss.es.esmanage;
2
3
import com.ai.abc.jpa.elastic.model.ElasticPage;
4
import com.ai.abc.jpa.elastic.model.PageInfo;
5
import com.ai.abc.jpa.elastic.model.TimeInfo;
6
import com.ai.abc.jpa.elastic.repository.ElasticEntityRepository;
7
import com.ai.abc.jpa.elastic.repository.impl.ElasticEntityRepositoryImpl;
8
import com.alibaba.fastjson.JSONObject;
9
import com.alibaba.fastjson.TypeReference;
10
import org.elasticsearch.action.search.SearchRequest;
11
import org.elasticsearch.action.search.SearchRequestBuilder;
12
import org.elasticsearch.action.search.SearchResponse;
13
import org.elasticsearch.client.RequestOptions;
14
import org.elasticsearch.client.RestHighLevelClient;
15
import org.elasticsearch.index.query.BoolQueryBuilder;
16
import org.elasticsearch.index.query.MatchQueryBuilder;
17
import org.elasticsearch.index.query.QueryBuilders;
18
import org.elasticsearch.search.SearchHit;
19
import org.elasticsearch.search.aggregations.AggregationBuilders;
20
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
21
import org.elasticsearch.search.aggregations.metrics.AvgAggregationBuilder;
22
import org.elasticsearch.search.builder.SearchSourceBuilder;
23
import org.junit.jupiter.api.Test;
24
import org.springframework.beans.factory.annotation.Autowired;
25
import org.springframework.boot.test.context.SpringBootTest;
26
27
import java.io.IOException;
28
import java.text.SimpleDateFormat;
29
import java.util.*;
30
31
@SpringBootTest
32
class EsManageApplicationTests {
33
34
35
    @Autowired
36
    private RestHighLevelClient client;
37
38
    @Test
39
    void contextLoads()  {
40
41
        ElasticEntityRepository elasticEntityRepository = new ElasticEntityRepositoryImpl();
42
        elasticEntityRepository.initServer("47.105.160.21:10020");
43
//        JSONObject jsonObject = new JSONObject();
44
//        jsonObject.put("id", "113");
45
//        jsonObject.put("type", "1");
46
//        jsonObject.put("name", "yaxin12");
47
//        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
48
//        jsonObject.put("create_date", df.format(new Date()));
49
//
50
//        //插入
51
//        String entity = jsonObject.toString();
52
//
53
//        entity = "{\"dataExchangeProtocol\":\"Hex\",\"detailInfo\":\"2454585858002a0efa90600ef9f1000000b000b01409020a2d1c45672b1f024e1d0a12010000874d00b0\",\"eventSpecId\":57700004350,\"eventSpecName\":\"定位\",\"eventTime\":1603255716747,\"eventTimeStr\":\"2020-10-21 12:48:36 747\",\"eventTypeName\":\"上行消息\",\"imei\":\"\",\"messageTopic\":\"DW\",\"messageTypeId\":57700000031,\"physicalProtocol\":\"TCP\",\"resourceId\":981489,\"resourceName\":\"手持定位仪001\",\"resourceSpecId\":57700004344,\"terminalEventId\":21700,\"terminalSN\":\"\"}";
54
//        elasticEntityRepository.purePersist("es_terminal_event", "", entity);
55
56
57
        //查询
58
        Map jsonSearch = new HashMap();
59
        //jsonSearch.put("id", "101");
60
//        jsonSearch.put("type", "1");
61
        //jsonSearch.put("name", "yaxin");
62
63
        List<String> ids = new ArrayList<>();
64
        ids.add("981489");
65
        ids.add("155682");
66
        jsonSearch.put("resourceId", ids);
67
68
        PageInfo pageInfo = new PageInfo();
69
        pageInfo.setStartNumber(0);
70
        pageInfo.setPageSize(20);
71
//        Map jsonSearchMap = JSONObject.parseObject(jsonSearch.toJSONString(), new TypeReference<Map<String, String>>(){});
72
//        Map sortMap = new HashMap();
73
        TimeInfo timeInfo = new TimeInfo();
74
        timeInfo.setFieldName("eventTimeStr");
75
        timeInfo.setStartTime("2020-10-28 00:09:51");
76
        timeInfo.setEndTime("2020-10-28 00:09:53");
77
        ElasticPage elasticPage = elasticEntityRepository.findEntity("es_terminal_event", null, timeInfo, pageInfo,null);
78
        System.out.println(elasticPage.getResults());
79
80
81
82
83
//        List<String> ids = new ArrayList();
84
//        ids.add("981489");
85
//        ids.add("155682");
86
//        BoolQueryBuilder exersiceBoolQuery = QueryBuilders.boolQuery();
87
//        for (String exerciseId: ids)
88
//        {
89
//            exersiceBoolQuery.must(QueryBuilders.termQuery("resourceId", exerciseId));
90
//        }
91
//
92
//        SearchRequest request = new SearchRequest("es_terminal_event");
93
94
        //5、开始执行发送request请求
95
//        SearchResponse searchResponse = client.search(request, RequestOptions.DEFAULT);
96
97
//        SearchRequestBuilder searchRequestBuilder = client.prepareSearch("index name").setTypes("type name")
98
//                         .setQuery(exersiceBoolQuery)
99
//                        .addHighlightedField("*")/*星号表示在所有字段都高亮*/.setHighlighterRequireFieldMatch(false)//配置高亮显示搜索结果
100
//                .setHighlighterPreTags("<高亮前缀标签>").setHighlighterPostTags("<高亮后缀标签>");//配置高亮显示搜索结果
101
//
102
//                         searchRequestBuilder = searchRequestBuilder.addAggregation(AggregationBuilders.terms("agg1(聚类返回时根据此key获取聚类结果)")
103
//                                         .size(1000)/*返回1000条聚类结果*/.field("要在文档中聚类的字段,如果是嵌套的则用点连接父子字段,如【person.company.name】"));
104
//
105
//        SearchResponse searchResponse = searchRequestBuilder.setFrom((0) * 10)//分页起始位置(跳过开始的n个)
106
//                         .setSize(10)//本次返回的文档数量
107
//                         .execute().actionGet();//执行搜索
108
109
110
    }
111
112
113
    @Test
114
    List<String> inSearch() throws IOException {
115
        //1、创建查询请求,规定查询的索引
116
        SearchRequest request = new SearchRequest("es_terminal_event");
117
        //2、创建条件构造
118
        SearchSourceBuilder builder = new SearchSourceBuilder();
119
//        //3、构造条件
120
//        MatchQueryBuilder matchQueryBuilder = QueryBuilders.matchQuery("address", "Lane");
121
//        builder.query(matchQueryBuilder);
122
//        //聚合年龄分布
123
//        TermsAggregationBuilder ageAgg = AggregationBuilders.terms("ageAgg").field("age");
124
//        builder.aggregation(ageAgg);
125
////
126
////        //聚合平均年龄
127
//        AvgAggregationBuilder balanceAvg = AggregationBuilders.avg("balanceAvg").field("balance");
128
//        builder.aggregation(balanceAvg);
129
130
        List<String> ids = new ArrayList();
131
        ids.add("981489");
132
        ids.add("155682");
133
        BoolQueryBuilder exersiceBoolQuery = QueryBuilders.boolQuery();
134
        for (String exerciseId : ids) {
135
            exersiceBoolQuery.must(QueryBuilders.termQuery("resourceId", exerciseId));
136
        }
137
        builder.query(exersiceBoolQuery);
138
139
        //4、将构造好的条件放入请求中
140
        request.source(builder);
141
142
        //5、开始执行发送request请求
143
        SearchResponse searchResponse = client.search(request, RequestOptions.DEFAULT);
144
        //6、开始处理返回的数据
145
        SearchHit[] hits = searchResponse.getHits().getHits();
146
        List<String> list = new ArrayList<String>();
147
        for (SearchHit hit : hits) {
148
            String hitString = hit.getSourceAsString();
149
            System.out.println(hitString);
150
            list.add(hitString);
151
        }
152
        return list;
153
    }
154
155
    }

Merge remote-tracking branch 'origin/master' · 99e53bd823 - Nuosi Git Service
ソースを参照

Merge remote-tracking branch 'origin/master'

wangdong6 4 年 前
コミット
99e53bd823
共有21 個のファイルを変更した518 個の追加404 個の削除を含む
  1. 15 4
      ebc-middle-platform/.aid/aid.js
  2. 90 53
      ebc-middle-platform/src/modules/call-help/current.vue
  3. 105 5
      ebc-sea-platform/pom.xml
  4. 59 0
      ebc-sea-platform/src/main/assembly/package.xml
  5. 9 5
      ebc-sea-platform/src/main/java/com/ai/bss/location/rescue/LocationRescueApp.java
  6. 0 0
      ebc-sea-platform/src/main/resources/application-gis.properties
  7. 0 0
      ebc-sea-platform/src/main/resources/application-iot.properties
  8. 0 0
      ebc-sea-platform/src/main/resources/application.properties
  9. 0 0
      ebc-sea-platform/src/main/resources/ipu-cache.xml
  10. 0 0
      ebc-sea-platform/src/main/resources/sso.properties
  11. 0 232
      location-rescue-service/location-rescue-service.iml
  12. 158 52
      location-rescue-service/pom.xml
  13. 59 0
      location-rescue-service/src/main/assembly/package.xml
  14. 0 39
      location-rescue-service/src/main/java/com/ai/bss/location/rescue/EbcSeaPlatformStart.java
  15. 2 0
      location-rescue-service/src/main/java/com/ai/bss/location/rescue/LocationRescueApp.java
  16. 1 2
      location-rescue-service/src/main/java/com/ai/bss/location/rescue/controller/MapTagManageController.java
  17. 5 2
      location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/impl/AlarmManagementServiceImpl.java
  18. 5 2
      location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/impl/LocationManagementServiceImpl.java
  19. 2 1
      location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/impl/MapTagManageServiceImpl.java
  20. 2 1
      location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/interfaces/MapTagManageService.java
  21. 6 6
      location-rescue-service/src/main/resources/application.properties

+ 15 - 4
ebc-middle-platform/.aid/aid.js

@ -51,11 +51,22 @@ module.exports = {
51 51
  beforeBuild(config) {
52 52
    let result = rules(config)
53 53
    result.output = {
54
      publicPath: '/energy/'
54
      publicPath: '/'
55 55
    }
56 56
    return result
57 57
  },
58
  imagePrefix: '/energy/',
59
  staticPrefix: '/energy/',
60
  outputPrefix: '/energy/' // 构建后index.html中资源路径的前缀
58
  outputPrefix: '/' // 构建后index.html中资源路径的前缀
59
  // ,
60
  // proxy: [
61
  //   {
62
  //     url: '/ipu',
63
  //     options: {
64
  //       target: 'http://127.0.0.1:8086',
65
  //       changeOrigin: true,
66
  //       pathRewrite: {
67
  //         '^/ipu': '/'
68
  //       }
69
  //     }
70
  //   },
71
  // ]
61 72
}

+ 90 - 53
ebc-middle-platform/src/modules/call-help/current.vue

@ -147,10 +147,31 @@ export default {
147 147
          // 请求失败处理...
148 148
        })
149 149
      this.$test
150
        .post(services.organization.EQUIPMENT_NOT_BIND, {})
150
        .post(services.alarm.LOAD_MAP_AREA_TOOL, {})
151 151
        .then((res) => {
152 152
          console.log(res)
153
          res.data.forEach(e => {
153
          res.data.mapAreaList.forEach(e => {
154
            var typeObj = res.data.mapAreaTypeList.filter(type => {
155
              return e.businessType == type.mapAreaBusinessType
156
            })
157
            var polygon = Ai.Polygon(e.mapAreaContent, {color: typeObj[0].color})
158
            this.map.addLayer(polygon)
159
          })
160
          res.data.toolList.forEach(e => {
161
            var typeObj = res.data.toolTypeList.filter(type => {
162
              return e.resourceToolType == type.resourceToolType
163
            })
164
            var point = Ai.Point([e.latitude, e.longitude], {
165
              icon: Ai.Icon({
166
              // 设置图标URL路径
167
                iconUrl: typeObj[0].iconUrl,
168
                // 设置图标大小
169
                iconSize: [20, 20],
170
                // 设置点对象和图标的相对偏移量
171
                iconAnchor: [100, 100]
172
              })
173
            })
174
            this.map.addLayer(point)
154 175
          })
155 176
        })
156 177
        .catch((res) => {
@ -161,20 +182,23 @@ export default {
161 182
      var obj = JSON.parse(msg)
162 183
      if (obj.data.currentEntityPosition) {
163 184
        var targetPoint = null
185
        var flag = true
164 186
        this.personLayer.eachLayer((point) => {
165
          if (point.getAttributes().rescueEntityPosition && point.getAttributes().rescueEntityPosition.entityId == obj.data.currentEntityPosition.entityId) { // 救援人
166
            point.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
167
            point.getAttributes().rescueEntityPosition = obj.data.currentEntityPosition
168
            if (point.getAttributes().lineLayer) {
169
              var lineWktStr = 'LINESTRING ( ' + obj.data.currentEntityPosition.longitude + ' ' + obj.data.currentEntityPosition.latitude + ',' + point.getAttributes().rescueTargetEntityPosition.longitude + ' ' + point.getAttributes().rescueTargetEntityPosition.latitude + ')'
170
              console.log(lineWktStr)
171
              point.getAttributes().lineLayer.setPoints(lineWktStr)
172
            }
173
            if (point.getAttributes().popup) {
174
              point.getAttributes().popup.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
175
              var tips
176
              tips = '<div class="hand-alarm">救援人员</div>'
177
              var content =
187
          if (flag) {
188
            if (point.getAttributes().rescueEntityPosition && (point.getAttributes().rescueEntityPosition.entityId == obj.data.currentEntityPosition.entityId) && !point.target) { // 救援人
189
              flag = false
190
              point.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
191
              point.getAttributes().rescueEntityPosition = obj.data.currentEntityPosition
192
              if (point.getAttributes().lineLayer) {
193
                var lineWktStr = 'LINESTRING ( ' + obj.data.currentEntityPosition.longitude + ' ' + obj.data.currentEntityPosition.latitude + ',' + point.getAttributes().rescueTargetEntityPosition.longitude + ' ' + point.getAttributes().rescueTargetEntityPosition.latitude + ')'
194
                console.log(lineWktStr)
195
                point.getAttributes().lineLayer.setPoints(lineWktStr)
196
              }
197
              if (point.popup) {
198
                point.popup.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
199
                var tips
200
                tips = '<div class="hand-alarm">救援人员</div>'
201
                var content =
178 202
                  '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>' + obj.data.currentEntityPosition.name + '</div>' + tips + '</div><div class="middle">' +
179 203
                  '<div class="row">' +
180 204
                  '<div>经度</div>' +
@ -186,51 +210,52 @@ export default {
186 210
                  '</div>' +
187 211
                  '<div class="row">' +
188 212
                  '<div>最新定位时间</div>' +
189
                  '<div>' + new Date(obj.data.currentEntityPosition.createDate) + '</div>' +
213
                  '<div>' + this.formatDate(new Date(obj.data.currentEntityPosition.createDate)) + '</div>' +
190 214
                  '</div></div></div>' +
191 215
                  '</div></div>'
192
              point.getAttributes().popup.setContent(content)
193
            }
194
          } else if (point.getAttributes().rescueTargetEntityPosition && point.getAttributes().rescueTargetEntityPosition.entityId == obj.data.currentEntityPosition.entityId) { // 报警人
195
            point.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
196
            point.getAttributes().rescueTargetEntityPosition = obj.data.currentEntityPosition
197
            if (point.getAttributes().lineLayer) {
198
              var lineWktStr = 'LINESTRING ( ' + obj.data.currentEntityPosition.longitude + ' ' + obj.data.currentEntityPosition.latitude + ',' + point.getAttributes().rescueEntityPosition.longitude + ' ' + point.getAttributes().rescueEntityPosition.latitude + ')'
199
              console.log(lineWktStr)
200
              point.getAttributes().lineLayer.setPoints(lineWktStr)
201
            }
202
            if (point.getAttributes().popup) {
203
              point.getAttributes().popup.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
204
              var e = point.getAttributes()
205
              console.log(e.terminalId)
206
              var tips
207
              var callHelp = ''
208
              var other = ''
209
              var className = 'alarm'
210
              if (e.businessType == '2') {
211
                className = 'hand-alarm'
212
              } else if (e.businessType == '4') {
213
                className = 'offline'
216
                point.popup.setContent(content).openOn(this.map)
217
              }
218
            } else if (point.getAttributes().rescueTargetEntityPosition && (point.getAttributes().rescueTargetEntityPosition.entityId == obj.data.currentEntityPosition.entityId) && point.target) { // 报警人
219
              flag = false
220
              point.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
221
              point.getAttributes().rescueTargetEntityPosition = obj.data.currentEntityPosition
222
              if (point.getAttributes().lineLayer) {
223
                var lineWktStr = 'LINESTRING ( ' + obj.data.currentEntityPosition.longitude + ' ' + obj.data.currentEntityPosition.latitude + ',' + point.getAttributes().rescueEntityPosition.longitude + ' ' + point.getAttributes().rescueEntityPosition.latitude + ')'
224
                console.log(lineWktStr)
225
                point.getAttributes().lineLayer.setPoints(lineWktStr)
214 226
              }
215
              tips = '<div class="' + className + '">' + e.businessTypeZH + '</div>'
216
              other = '<div class="row sos">' +
227
              if (point.popup) {
228
                point.popup.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
229
                var e = point.getAttributes()
230
                console.log(e.terminalId)
231
                var tips
232
                var callHelp = ''
233
                var other = ''
234
                var className = 'alarm'
235
                if (e.businessType == '2') {
236
                  className = 'hand-alarm'
237
                } else if (e.businessType == '4') {
238
                  className = 'offline'
239
                }
240
                tips = '<div class="' + className + '">' + e.businessTypeZH + '</div>'
241
                other = '<div class="row sos">' +
217 242
                '<div>求救时间</div>' +
218 243
                '<div>' + e.alarmTime + '</div>' +
219 244
                '</div>' + '<div class="row sos">' +
220 245
                '<div>求救时长</div>' +
221 246
                '<div>' + this.getDurationTime(e.alarmTime) + '</div>' +
222 247
                '</div>'
223
              if (e.isAssignAlarm == '0') {
224
                callHelp = '<div style="display:flex;">' +
248
                if (e.isAssignAlarm == '0') {
249
                  callHelp = '<div style="display:flex;">' +
225 250
                "<button class='point-out' onClick='window.Vue.appoint(" + e + ")'><i style='font-size: 20px;' class='aidicon aidicon-user-outline'></i>指派</button>" +
226 251
                "<button class='close-confirm' onClick='window.Vue.close(" + e + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
227 252
                '</div>'
228
              } else {
229
                callHelp = '<div style="display:flex;justify-content: flex-end;">' +
253
                } else {
254
                  callHelp = '<div style="display:flex;justify-content: flex-end;">' +
230 255
                "<button class='close-confirm' onClick='window.Vue.close(" + e + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
231 256
                '</div>'
232
              }
233
              var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>' + e.rescueTargetEntityPosition.name + '</div>' + tips + '</div><div class="middle"><div class="row">' +
257
                }
258
                var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>' + e.rescueTargetEntityPosition.name + '</div>' + tips + '</div><div class="middle"><div class="row">' +
234 259
                  '<div>终端编号</div>' +
235 260
                  '<div>' + e.terminalId + '</div>' +
236 261
                  '</div>' +
@ -247,12 +272,14 @@ export default {
247 272
                  '<div>' + e.alarmTime + '</div>' +
248 273
                  '</div></div></div>' + callHelp +
249 274
                  '</div></div>'
250
              point.getAttributes().popup.setContent(content)
275
                point.popup.setContent(content).openOn(this.map)
276
              }
251 277
            }
252
          }
253
          if (!point.getAttributes().rescueEntityPosition) {
254
            if (point.getAttributes().rescueWorkEmployeeRoleId == obj.data.currentEntityPosition.entityId) {
255
              targetPoint = point
278
            if (!point.getAttributes().rescueEntityPosition) {
279
              if (point.getAttributes().rescueWorkEmployeeRoleId == obj.data.currentEntityPosition.entityId) {
280
                flag = false
281
                targetPoint = point
282
              }
256 283
            }
257 284
          }
258 285
        })
@ -342,7 +369,8 @@ export default {
342 369
      point.on('click', (pointE) => {
343 370
        popup.openOn(this.map)
344 371
      })
345
      point.getAttributes().popup = popup
372
      point.target = true
373
      point.popup = popup
346 374
      this.personLayer.addLayer(point)
347 375
      return point
348 376
    },
@ -387,13 +415,22 @@ export default {
387 415
      // 设置弹出框弹出内容
388 416
      popup.setContent(content)
389 417
      popup.openOn(this.map)
390
      point.getAttributes().popup = popup
418
      point.target = false
419
      point.popup = popup
391 420
      point.on('click', (pointE) => {
392 421
        popup.openOn(this.map)
393 422
      })
394 423
      this.personLayer.addLayer(point)
395 424
      return point
396 425
    },
426
    formatDate(date) {
427
      var month = (date.getMonth() + 1) < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)
428
      var day = (date.getDate()) < 10 ? '0' + (date.getDate()) : (date.getDate())
429
      var hour = (date.getHours()) < 10 ? '0' + (date.getHours()) : (date.getHours())
430
      var minutes = (date.getMinutes()) < 10 ? '0' + (date.getMinutes()) : (date.getMinutes() + 1)
431
      var seconds = (date.getSeconds()) < 10 ? '0' + (date.getSeconds()) : (date.getSeconds())
432
      return date.getFullYear() + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
433
    },
397 434
    getDurationTime(time) {
398 435
      let date = new Date(time)
399 436
      let diff = (new Date().getTime() - date.getTime()) / 1000

+ 105 - 5
ebc-sea-platform/pom.xml

@ -10,13 +10,16 @@
10 10
        <version>2.1.5-SNAPSHOT</version>
11 11
    </parent>
12 12

13

14
    <groupId>com.ai.bss</groupId>
13 15
    <artifactId>ebc-sea-platform</artifactId>
14
	<packaging>jar</packaging>
16
    <name>ebc-sea-platform</name>
15 17

16
	<properties>
17
		<start-class>com.ai.bss.location.rescue.LocationRescueApp</start-class>
18
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19
	</properties>
18
<!--	<properties>-->
19
<!--		<start-class>com.ai.bss.location.rescue.LocationRescueApp</start-class>-->
20
<!--		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>-->
21
<!--        <jdk>1.8</jdk>-->
22
<!--	</properties>-->
20 23

21 24
    <dependencies>
22 25
        <dependency>
@ -160,6 +163,8 @@
160 163
        </dependency>
161 164
    </dependencies>
162 165

166
	
167

163 168
    <!--
164 169
    <repositories>
165 170
        <repository>
@ -184,4 +189,99 @@
184 189
    </pluginRepositories>
185 190
    -->
186 191

192
    <build>
193

194
        <resources>
195
            <resource>
196
                <directory>src/main/resources</directory>
197
            </resource>
198
        </resources>
199

200
        <plugins>
201

202
            <!-- The configuration of maven-jar-plugin -->
203
            <plugin>
204
                <groupId>org.apache.maven.plugins</groupId>
205
                <artifactId>maven-jar-plugin</artifactId>
206
                <version>2.4</version>
207
                <!-- The configuration of the plugin -->
208
                <configuration>
209
                    <!-- Configuration of the archiver -->
210
                    <archive>
211
                        <!--生成的jar中,不要包含pom.xml和pom.properties这两个文件-->
212
                        <addMavenDescriptor>false</addMavenDescriptor>
213

214
                        <!-- Manifest specific configuration -->
215
                        <manifest>
216
                            <!--是否要把第三方jar放到manifest的classpath中-->
217
                            <addClasspath>true</addClasspath>
218
                            <!--生成的manifest中classpath的前缀,因为要把第三方jar放到lib目录下,所以classpath的前缀是lib/-->
219
                            <classpathPrefix>lib/</classpathPrefix>
220
                            <!--应用的main class-->
221
                            <mainClass>com.ai.bss.location.rescue.LocationRescueApp</mainClass>
222
                        </manifest>
223
                        <manifestEntries>
224
                            <Class-Path>./config/</Class-Path>
225
                        </manifestEntries>
226
                    </archive>
227
                    <!--过滤掉不希望包含在jar中的文件-->
228
                    <excludes>
229
                        <exclude>**/*.properties</exclude>
230
                        <exclude>**/*.xml</exclude>
231
                    </excludes>
232
                </configuration>
233
            </plugin>
234

235
            <plugin>
236
                <groupId>org.apache.maven.plugins</groupId>
237
                <artifactId>maven-dependency-plugin</artifactId>
238
                <version>2.10</version>
239
                <executions>
240
                    <execution>
241
                        <id>copy-dependencies</id>
242
                        <phase>package</phase>
243
                        <goals>
244
                            <goal>copy-dependencies</goal>
245
                        </goals>
246
                        <configuration>
247
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
248
                        </configuration>
249
                    </execution>
250
                </executions>
251
            </plugin>
252

253
            <!-- The configuration of maven-assembly-plugin -->
254
            <plugin>
255
                <groupId>org.apache.maven.plugins</groupId>
256
                <artifactId>maven-assembly-plugin</artifactId>
257
                <version>2.4</version>
258
                <!-- The configuration of the plugin -->
259
                <configuration>
260
                    <!-- Specifies the configuration file of the assembly plugin -->
261
                    <descriptors>
262
                        <descriptor>src/main/assembly/package.xml</descriptor>
263
                    </descriptors>
264
                </configuration>
265
                <executions>
266
                    <execution>
267
                        <id>make-assembly</id>
268
                        <phase>package</phase>
269
                        <goals>
270
                            <goal>single</goal>
271
                        </goals>
272
                    </execution>
273
                </executions>
274
            </plugin>
275

276
            <plugin>
277
                <groupId>org.apache.maven.plugins</groupId>
278
                <artifactId>maven-surefire-plugin</artifactId>
279
                <configuration>
280
                    <skip>true</skip>
281
                </configuration>
282
            </plugin>
283
        </plugins>
284

285
    </build>
286

187 287
</project>

+ 59 - 0
ebc-sea-platform/src/main/assembly/package.xml

@ -0,0 +1,59 @@
1
<assembly>
2
    <id>bin</id>
3
    <!-- 最终打包成一个用于发布的zip文件 -->
4
    <formats>
5
        <format>zip</format>
6
    </formats>
7
8
    <!-- Adds dependencies to zip package under lib directory -->
9
    <dependencySets>
10
        <dependencySet>
11
            <!-- 不使用项目的artifact,第三方jar不要解压,打包进zip文件的lib目录 -->
12
            <useProjectArtifact>false</useProjectArtifact>
13
            <outputDirectory>lib</outputDirectory>
14
            <unpack>false</unpack>
15
            <scope>runtime</scope>
16
        </dependencySet>
17
    </dependencySets>
18
19
    <fileSets>
20
        <!-- 把项目相关的说明文件,打包进zip文件的根目录 -->
21
        <fileSet>
22
            <directory>${project.basedir}</directory>
23
            <outputDirectory>/</outputDirectory>
24
        <includes>
25
            <include>README*</include>
26
            <include>LICENSE*</include>
27
            <include>NOTICE*</include>
28
        </includes>
29
    </fileSet>
30
31
        <!-- 把项目的配置文件,打包进zip文件的config目录 -->
32
        <fileSet>
33
            <directory>src/main/resources</directory>
34
            <outputDirectory>/config</outputDirectory>
35
            <includes>
36
                <include>**/*.properties</include>
37
                <include>**/*.xml</include>
38
            </includes>
39
        </fileSet>
40
41
        <!-- 把项目的脚本文件目录( src/main/scripts )中的启动脚本文件,打包进zip文件的跟目录 -->
42
        <fileSet>
43
            <directory>${project.build.scriptSourceDirectory}</directory>
44
            <outputDirectory></outputDirectory>
45
            <includes>
46
                <include>startup.*</include>
47
            </includes>
48
        </fileSet>
49
50
        <!-- 把项目自己编译出来的jar文件,打包进zip文件的根目录 -->
51
        <fileSet>
52
            <directory>${project.build.directory}</directory>
53
            <outputDirectory></outputDirectory>
54
            <includes>
55
                <include>*.jar</include>
56
            </includes>
57
        </fileSet>
58
    </fileSets>
59
</assembly>

+ 9 - 5
ebc-sea-platform/src/main/java/com/ai/bss/location/rescue/LocationRescueApp.java

@ -1,5 +1,6 @@
1 1
package com.ai.bss.location.rescue;
2 2
3
import com.ailk.org.apache.commons.lang3.ArrayUtils;
3 4
import org.springframework.boot.SpringApplication;
4 5
import org.springframework.boot.autoconfigure.SpringBootApplication;
5 6
import org.springframework.boot.autoconfigure.domain.EntityScan;
@ -23,11 +24,14 @@ import com.ai.ipu.server.stomp.WebSocketStompServer;
23 24
@SpringBootApplication
24 25
public class LocationRescueApp {
25 26
    public static void main(String[] args) throws Exception {
26
    	//注册镜屏服务
27
		ConnectServerManager.registerServer("websocket.port", new WebSocketStompServer("/stomp"));
28
		//镜屏服务启动
29
		ConnectServerStart.start(args, false);
30
    	
27
        System.setProperty("websocket.port", "7100");
28
        //注册镜屏服务
29
        //ConnectServerManager.registerServer("websocket.port", new WebSocketStompServer("/stomp"));
30
        ConnectServerManager.registerServer("websocket.port", new WebSocketStompServer("/stomp"));
31
        //镜屏服务启动
32
        ConnectServerStart.start(args, false);
33
34
31 35
        SpringApplication.run(LocationRescueApp.class, args);
32 36
    }
33 37
}

ebc-sea-platform/src/main/resources/pro/application-gis.properties → ebc-sea-platform/src/main/resources/application-gis.properties


ebc-sea-platform/src/main/resources/pro/application-iot.properties → ebc-sea-platform/src/main/resources/application-iot.properties


ebc-sea-platform/src/main/resources/pro/application.properties → ebc-sea-platform/src/main/resources/application.properties


ebc-sea-platform/src/main/resources/pro/ipu-cache.xml → ebc-sea-platform/src/main/resources/ipu-cache.xml


ebc-sea-platform/src/main/resources/pro/sso.properties → ebc-sea-platform/src/main/resources/sso.properties


+ 0 - 232
location-rescue-service/location-rescue-service.iml

@ -1,232 +0,0 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" version="4">
3
  <component name="FacetManager">
4
    <facet type="Spring" name="Spring">
5
      <configuration />
6
    </facet>
7
    <facet type="jpa" name="JPA">
8
      <configuration>
9
        <setting name="validation-enabled" value="true" />
10
        <setting name="provider-name" value="Hibernate" />
11
        <datasource-mapping>
12
          <factory-entry name="entityManagerFactory" />
13
        </datasource-mapping>
14
        <naming-strategy-map />
15
      </configuration>
16
    </facet>
17
  </component>
18
  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
19
    <output url="file://$MODULE_DIR$/target/classes" />
20
    <output-test url="file://$MODULE_DIR$/target/test-classes" />
21
    <content url="file://$MODULE_DIR$">
22
      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
23
      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
24
      <excludeFolder url="file://$MODULE_DIR$/target" />
25
    </content>
26
    <orderEntry type="inheritedJdk" />
27
    <orderEntry type="sourceFolder" forTests="false" />
28
    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.0.3" level="project" />
29
    <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:1.0" level="project" />
30
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
31
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.8" level="project" />
32
    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
33
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.8" level="project" />
34
    <orderEntry type="library" name="Maven: com.ai.bss:work-tool-service-api:2.1-SNAPSHOT" level="project" />
35
    <orderEntry type="library" name="Maven: com.ai.bss:work-tool-model:2.1-SNAPSHOT" level="project" />
36
    <orderEntry type="library" name="Maven: com.ai.abc:persistence-mysql8:2.1-SNAPSHOT" level="project" />
37
    <orderEntry type="library" name="Maven: com.ai.abc:persistence-api:2.1-SNAPSHOT" level="project" />
38
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.1.5.RELEASE" level="project" />
39
    <orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final" level="project" />
40
    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-jpa:2.1.8.RELEASE" level="project" />
41
    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.1.8.RELEASE" level="project" />
42
    <orderEntry type="library" name="Maven: org.springframework:spring-orm:5.1.7.RELEASE" level="project" />
43
    <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.1.7.RELEASE" level="project" />
44
    <orderEntry type="library" name="Maven: org.aspectj:aspectjrt:1.9.4" level="project" />
45
    <orderEntry type="library" name="Maven: org.hibernate:hibernate-core:5.3.10.Final" level="project" />
46
    <orderEntry type="library" name="Maven: javax.persistence:javax.persistence-api:2.2" level="project" />
47
    <orderEntry type="library" name="Maven: org.javassist:javassist:3.23.2-GA" level="project" />
48
    <orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
49
    <orderEntry type="library" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.1.1.Final" level="project" />
50
    <orderEntry type="library" name="Maven: org.jboss:jandex:2.0.5.Final" level="project" />
51
    <orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
52
    <orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:5.0.4.Final" level="project" />
53
    <orderEntry type="library" name="Maven: org.hibernate:hibernate-envers:5.3.10.Final" level="project" />
54
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.1.5.RELEASE" level="project" />
55
    <orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.1.7.RELEASE" level="project" />
56
    <orderEntry type="library" name="Maven: net.sf.ehcache:ehcache-core:2.6.9" level="project" />
57
    <orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:8.0.16" level="project" />
58
    <orderEntry type="library" scope="RUNTIME" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
59
    <orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.17" level="project" />
60
    <orderEntry type="library" name="Maven: com.alibaba:druid:1.1.17" level="project" />
61
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.1.5.RELEASE" level="project" />
62
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.1.5.RELEASE" level="project" />
63
    <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.8" level="project" />
64
    <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.8" level="project" />
65
    <orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.8" level="project" />
66
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.1.5.RELEASE" level="project" />
67
    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.19" level="project" />
68
    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.19" level="project" />
69
    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.19" level="project" />
70
    <orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.16.Final" level="project" />
71
    <orderEntry type="library" name="Maven: javax.validation:validation-api:2.0.1.Final" level="project" />
72
    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.1.7.RELEASE" level="project" />
73
    <orderEntry type="library" name="Maven: com.ai.bss:components-common:2.1-SNAPSHOT" level="project" />
74
    <orderEntry type="library" name="Maven: com.ai.abc:api-common:2.1-SNAPSHOT" level="project" />
75
    <orderEntry type="library" name="Maven: com.ai.abc:exception:2.1-SNAPSHOT" level="project" />
76
    <orderEntry type="library" name="Maven: com.ai.abc:utils:2.1-SNAPSHOT" level="project" />
77
    <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
78
    <orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
79
    <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.69" level="project" />
80
    <orderEntry type="library" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
81
    <orderEntry type="library" name="Maven: net.minidev:json-smart:2.3" level="project" />
82
    <orderEntry type="library" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
83
    <orderEntry type="library" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
84
    <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.8.1" level="project" />
85
    <orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.4" level="project" />
86
    <orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.3.2" level="project" />
87
    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
88
    <orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.20" level="project" />
89
    <orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.20" level="project" />
90
    <orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
91
    <orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
92
    <orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
93
    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
94
    <orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
95
    <orderEntry type="library" name="Maven: com.google.guava:guava:27.1-jre" level="project" />
96
    <orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
97
    <orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
98
    <orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
99
    <orderEntry type="library" name="Maven: org.checkerframework:checker-qual:2.5.2" level="project" />
100
    <orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.2.0" level="project" />
101
    <orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.1" level="project" />
102
    <orderEntry type="library" name="Maven: org.codehaus.mojo:animal-sniffer-annotations:1.17" level="project" />
103
    <orderEntry type="library" name="Maven: com.fasterxml:classmate:1.4.0" level="project" />
104
    <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
105
    <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
106
    <orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
107
    <orderEntry type="library" name="Maven: com.vividsolutions:jts-core:1.14.0" level="project" />
108
    <orderEntry type="library" name="Maven: com.ai.bss:work-tool-service:2.1-SNAPSHOT" level="project" />
109
    <orderEntry type="library" name="Maven: com.ai.bss:position-service-api:2.1-SNAPSHOT" level="project" />
110
    <orderEntry type="library" name="Maven: com.ai.bss:position-model:2.1-SNAPSHOT" level="project" />
111
    <orderEntry type="library" name="Maven: com.ai.bss:position-service:2.1-SNAPSHOT" level="project" />
112
    <orderEntry type="library" name="Maven: com.ai.bss:worker-service:2.1-SNAPSHOT" level="project" />
113
    <orderEntry type="library" name="Maven: com.ai.bss:worker-model:2.1-SNAPSHOT" level="project" />
114
    <orderEntry type="library" name="Maven: org.hibernate:hibernate-spatial:5.3.10.Final" level="project" />
115
    <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
116
    <orderEntry type="library" name="Maven: org.geolatte:geolatte-geom:1.3.0" level="project" />
117
    <orderEntry type="library" name="Maven: org.postgresql:postgresql:42.2.5" level="project" />
118
    <orderEntry type="library" name="Maven: org.dom4j:dom4j:2.1.1" level="project" />
119
    <orderEntry type="library" name="Maven: com.vividsolutions:jts:1.13" level="project" />
120
    <orderEntry type="library" name="Maven: com.ai.bss:worker-service-api:2.1-SNAPSHOT" level="project" />
121
    <orderEntry type="library" name="Maven: org.springframework.kafka:spring-kafka:2.2.6.RELEASE" level="project" />
122
    <orderEntry type="library" name="Maven: org.springframework:spring-context:5.1.7.RELEASE" level="project" />
123
    <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.1.7.RELEASE" level="project" />
124
    <orderEntry type="library" name="Maven: org.springframework:spring-beans:5.1.7.RELEASE" level="project" />
125
    <orderEntry type="library" name="Maven: org.springframework:spring-expression:5.1.7.RELEASE" level="project" />
126
    <orderEntry type="library" name="Maven: org.springframework:spring-messaging:5.1.7.RELEASE" level="project" />
127
    <orderEntry type="library" name="Maven: org.springframework:spring-tx:5.1.7.RELEASE" level="project" />
128
    <orderEntry type="library" name="Maven: org.springframework.retry:spring-retry:1.2.4.RELEASE" level="project" />
129
    <orderEntry type="library" name="Maven: org.apache.kafka:kafka-clients:2.0.1" level="project" />
130
    <orderEntry type="library" name="Maven: org.lz4:lz4-java:1.4.1" level="project" />
131
    <orderEntry type="library" name="Maven: org.xerial.snappy:snappy-java:1.1.7.1" level="project" />
132
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.1.5.RELEASE" level="project" />
133
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.1.5.RELEASE" level="project" />
134
    <orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
135
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-test:2.1.5.RELEASE" level="project" />
136
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.1.5.RELEASE" level="project" />
137
    <orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
138
    <orderEntry type="library" name="Maven: org.assertj:assertj-core:3.11.1" level="project" />
139
    <orderEntry type="library" name="Maven: org.mockito:mockito-core:2.23.4" level="project" />
140
    <orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.9.12" level="project" />
141
    <orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy-agent:1.9.12" level="project" />
142
    <orderEntry type="library" name="Maven: org.objenesis:objenesis:2.6" level="project" />
143
    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
144
    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
145
    <orderEntry type="library" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
146
    <orderEntry type="library" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
147
    <orderEntry type="library" name="Maven: org.springframework:spring-core:5.1.7.RELEASE" level="project" />
148
    <orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.1.7.RELEASE" level="project" />
149
    <orderEntry type="library" name="Maven: org.springframework:spring-test:5.1.7.RELEASE" level="project" />
150
    <orderEntry type="library" name="Maven: org.xmlunit:xmlunit-core:2.6.2" level="project" />
151
    <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
152
    <orderEntry type="library" name="Maven: com.ai.bss:characteristic-spec-service:2.1-SNAPSHOT" level="project" />
153
    <orderEntry type="library" name="Maven: com.ai.bss:infrastructure:2.1-SNAPSHOT" level="project" />
154
    <orderEntry type="library" name="Maven: com.ai.abc:core:2.1-SNAPSHOT" level="project" />
155
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-jpa:2.1.5.RELEASE" level="project" />
156
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.1.5.RELEASE" level="project" />
157
    <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.4" level="project" />
158
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.1.5.RELEASE" level="project" />
159
    <orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.2.0" level="project" />
160
    <orderEntry type="library" name="Maven: javax.transaction:javax.transaction-api:1.3" level="project" />
161
    <orderEntry type="library" name="Maven: org.springframework:spring-aspects:5.1.7.RELEASE" level="project" />
162
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.1.5.RELEASE" level="project" />
163
    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.1.8.RELEASE" level="project" />
164
    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.1.8.RELEASE" level="project" />
165
    <orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.1.7.RELEASE" level="project" />
166
    <orderEntry type="library" name="Maven: io.lettuce:lettuce-core:5.1.6.RELEASE" level="project" />
167
    <orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.36.Final" level="project" />
168
    <orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.2.9.RELEASE" level="project" />
169
    <orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.2" level="project" />
170
    <orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
171
    <orderEntry type="library" name="Maven: org.springframework:spring-web:5.1.7.RELEASE" level="project" />
172
    <orderEntry type="library" name="Maven: org.apache.poi:poi:3.6" level="project" />
173
    <orderEntry type="library" scope="RUNTIME" name="Maven: commons-logging:commons-logging:1.1" level="project" />
174
    <orderEntry type="library" scope="RUNTIME" name="Maven: logkit:logkit:1.0.1" level="project" />
175
    <orderEntry type="library" scope="RUNTIME" name="Maven: avalon-framework:avalon-framework:4.1.3" level="project" />
176
    <orderEntry type="library" scope="RUNTIME" name="Maven: javax.servlet:servlet-api:2.3" level="project" />
177
    <orderEntry type="library" name="Maven: com.ai.bss:charcateristic-spec-service-api:2.1-SNAPSHOT" level="project" />
178
    <orderEntry type="library" name="Maven: com.ai.bss:characteristic-spec-model:2.1-SNAPSHOT" level="project" />
179
    <orderEntry type="library" name="Maven: com.ai.bss:system-user-service:2.1-SNAPSHOT" level="project" />
180
    <orderEntry type="library" name="Maven: com.ai.bss:system-user-model:2.1-SNAPSHOT" level="project" />
181
    <orderEntry type="library" name="Maven: com.ai.bss:person-model:2.1-SNAPSHOT" level="project" />
182
    <orderEntry type="library" name="Maven: com.ai.bss:system-user-service-api:2.1-SNAPSHOT" level="project" />
183
    <orderEntry type="library" name="Maven: com.ai.bss:person-service:2.1-SNAPSHOT" level="project" />
184
    <orderEntry type="library" name="Maven: com.ai.bss:person-service-api:2.1-SNAPSHOT" level="project" />
185
    <orderEntry type="library" name="Maven: com.wframe:sso-util:1.2" level="project" />
186
    <orderEntry type="library" name="Maven: com.ai.ipu:ipu-cache:3.1-SNAPSHOT" level="project" />
187
    <orderEntry type="library" name="Maven: com.ai.ipu:ipu-basic:3.1-SNAPSHOT" level="project" />
188
    <orderEntry type="library" name="Maven: com.ai.ipu:ipu-common:3.1-SNAPSHOT" level="project" />
189
    <orderEntry type="library" name="Maven: com.ai.wade:wade-data:1.0" level="project" />
190
    <orderEntry type="library" name="Maven: com.mashape.unirest:unirest-java:1.3.8" level="project" />
191
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.1.4" level="project" />
192
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.4.11" level="project" />
193
    <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
194
    <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
195
    <orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" />
196
    <orderEntry type="library" name="Maven: xalan:xalan:2.7.2" level="project" />
197
    <orderEntry type="library" name="Maven: xalan:serializer:2.7.2" level="project" />
198
    <orderEntry type="library" name="Maven: xerces:xercesImpl:2.12.0" level="project" />
199
    <orderEntry type="library" name="Maven: org.jsoup:jsoup:1.9.2" level="project" />
200
    <orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.23" level="project" />
201
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" />
202
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.11.2" level="project" />
203
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.11.2" level="project" />
204
    <orderEntry type="library" name="Maven: com.ai.wade:wade-cache:1.0" level="project" />
205
    <orderEntry type="library" name="Maven: com.ai.wade:wade-apache:1.0" level="project" />
206
    <orderEntry type="library" name="Maven: redis.clients:jedis:2.9.3" level="project" />
207
    <orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.6.2" level="project" />
208
    <orderEntry type="library" name="Maven: com.ai.ipu.server:iot-stomp-server:3.1-SNAPSHOT" level="project" />
209
    <orderEntry type="library" name="Maven: com.ai.ipu.server:ipu-connect-server:3.1-SNAPSHOT" level="project" />
210
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.8" level="project" />
211
    <orderEntry type="library" name="Maven: io.netty:netty-all:4.1.36.Final" level="project" />
212
    <orderEntry type="library" name="Maven: io.netty:netty-codec-mqtt:4.1.36.Final" level="project" />
213
    <orderEntry type="library" name="Maven: io.netty:netty-common:4.1.36.Final" level="project" />
214
    <orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.36.Final" level="project" />
215
    <orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.36.Final" level="project" />
216
    <orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.36.Final" level="project" />
217
    <orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.36.Final" level="project" />
218
    <orderEntry type="library" name="Maven: de.schlichtherle.truelicense:truelicense-core:1.33" level="project" />
219
    <orderEntry type="library" name="Maven: de.schlichtherle.truelicense:truelicense-xml:1.33" level="project" />
220
    <orderEntry type="library" name="Maven: de.schlichtherle.truelicense:truelicense-swing:1.33" level="project" />
221
    <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2" level="project" />
222
    <orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.8" level="project" />
223
    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.8" level="project" />
224
    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
225
    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.8" level="project" />
226
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.1.5.RELEASE" level="project" />
227
    <orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
228
    <orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
229
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.11.2" level="project" />
230
    <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.26" level="project" />
231
  </component>
232
</module>

+ 158 - 52
location-rescue-service/pom.xml

@ -3,15 +3,23 @@
3 3
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 4
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5 5
    <modelVersion>4.0.0</modelVersion>
6
6 7
    <parent>
7 8
        <artifactId>components</artifactId>
8 9
        <groupId>com.ai.bss</groupId>
9 10
        <version>2.1.5-SNAPSHOT</version>
10 11
    </parent>
11 12
13
12 14
    <groupId>com.ai.bss</groupId>
13 15
    <artifactId>location-rescue-service</artifactId>
14
    <version>1.0-SNAPSHOT</version>
16
    <name>location-rescue-service</name>
17
18
    <!--	<properties>-->
19
    <!--		<start-class>com.ai.bss.location.rescue.LocationRescueApp</start-class>-->
20
    <!--		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>-->
21
    <!--        <jdk>1.8</jdk>-->
22
    <!--	</properties>-->
15 23
16 24
    <dependencies>
17 25
        <dependency>
@ -19,7 +27,7 @@
19 27
            <artifactId>pagehelper</artifactId>
20 28
            <version>5.0.3</version>
21 29
        </dependency>
22
        
30
23 31
        <dependency>
24 32
            <groupId>org.apache.httpcomponents</groupId>
25 33
            <artifactId>httpcore</artifactId>
@ -50,22 +58,22 @@
50 58
            <artifactId>worker-service</artifactId>
51 59
            <version>2.1.5-SNAPSHOT</version>
52 60
            <exclusions>
53
            	<exclusion>
54
            		<groupId>org.springframework.boot</groupId>
55
            		<artifactId>
56
            			spring-boot-starter-security
57
            		</artifactId>
58
            	</exclusion>
61
                <exclusion>
62
                    <groupId>org.springframework.boot</groupId>
63
                    <artifactId>
64
                        spring-boot-starter-security
65
                    </artifactId>
66
                </exclusion>
59 67
            </exclusions>
60 68
        </dependency>
61 69
62
		<dependency>
70
        <dependency>
63 71
            <groupId>com.ai.bss</groupId>
64 72
            <artifactId>characteristic-spec-service</artifactId>
65 73
            <version>2.1.5-SNAPSHOT</version>
66 74
        </dependency>
67 75
68
		<dependency>
76
        <dependency>
69 77
            <groupId>com.ai.bss</groupId>
70 78
            <artifactId>work-attendance-service-api</artifactId>
71 79
            <version>2.1.5-SNAPSHOT</version>
@ -85,61 +93,61 @@
85 93
            </exclusions>
86 94
        </dependency>
87 95
88
       <!-- uspa登录拦截效验-->
89
<!--   <dependency>
90
            <groupId>com.ai.bss</groupId>
91
            <artifactId>sso-util</artifactId>
92
            <version>1.0.0-RELEASE</version>
93
        </dependency>-->
96
        <!-- uspa登录拦截效验-->
97
        <!--   <dependency>
98
                    <groupId>com.ai.bss</groupId>
99
                    <artifactId>sso-util</artifactId>
100
                    <version>1.0.0-RELEASE</version>
101
                </dependency>-->
94 102
        <dependency>
95 103
            <groupId>com.wframe</groupId>
96 104
            <artifactId>sso-util</artifactId>
97 105
            <version>1.2</version>
98 106
        </dependency>
99
        
100
<!--	<dependency>
101
             <groupId>com.ai.ipu</groupId>
102
             <artifactId>ipu-data</artifactId>
103
             <version>3.1-SNAPSHOT</version>
104
             <scope>compile</scope>
105
         </dependency>
106
         <dependency>
107
             <groupId>com.ai.ipu</groupId>
108
             <artifactId>ipu-basic</artifactId>
109
             <version>3.1-SNAPSHOT</version>
110
             <scope>compile</scope>
111
         </dependency>
112
         <dependency>
113
             <groupId>com.ai.wade</groupId>
114
             <artifactId>wade-common</artifactId>
115
             <version>1.0</version>
116
             <scope>compile</scope>
117
         </dependency>
118
		<dependency>
119
            <groupId>com.ai.ipu</groupId>
120
            <artifactId>ipu-common</artifactId>
121
            <version>3.1-SNAPSHOT</version>
122
            <scope>compile</scope>
123
        </dependency>
124
        <dependency>
125
            <groupId>org.apache.poi</groupId>
126
            <artifactId>poi-ooxml</artifactId>
127
            <version>3.14</version>
128
            <scope>compile</scope>
129
        </dependency>-->
107
108
        <!--	<dependency>
109
                     <groupId>com.ai.ipu</groupId>
110
                     <artifactId>ipu-data</artifactId>
111
                     <version>3.1-SNAPSHOT</version>
112
                     <scope>compile</scope>
113
                 </dependency>
114
                 <dependency>
115
                     <groupId>com.ai.ipu</groupId>
116
                     <artifactId>ipu-basic</artifactId>
117
                     <version>3.1-SNAPSHOT</version>
118
                     <scope>compile</scope>
119
                 </dependency>
120
                 <dependency>
121
                     <groupId>com.ai.wade</groupId>
122
                     <artifactId>wade-common</artifactId>
123
                     <version>1.0</version>
124
                     <scope>compile</scope>
125
                 </dependency>
126
                <dependency>
127
                    <groupId>com.ai.ipu</groupId>
128
                    <artifactId>ipu-common</artifactId>
129
                    <version>3.1-SNAPSHOT</version>
130
                    <scope>compile</scope>
131
                </dependency>
132
                <dependency>
133
                    <groupId>org.apache.poi</groupId>
134
                    <artifactId>poi-ooxml</artifactId>
135
                    <version>3.14</version>
136
                    <scope>compile</scope>
137
                </dependency>-->
130 138
131 139
        <!-- 缓存 -->
132 140
        <dependency>
133
		   <groupId>com.ai.ipu</groupId>
134
		   <artifactId>ipu-cache</artifactId>
135
		   <version>3.1-SNAPSHOT</version>
136
		   <exclusions>
141
            <groupId>com.ai.ipu</groupId>
142
            <artifactId>ipu-cache</artifactId>
143
            <version>3.1-SNAPSHOT</version>
144
            <exclusions>
137 145
                <exclusion>
138 146
                    <groupId>org.apache.logging.log4j</groupId>
139 147
                    <artifactId>log4j-slf4j-impl</artifactId>
140 148
                </exclusion>
141 149
            </exclusions>
142
		</dependency>
150
        </dependency>
143 151
144 152
        <!--  IPU 镜屏 -->
145 153
        <dependency>
@ -155,6 +163,8 @@
155 163
        </dependency>
156 164
    </dependencies>
157 165
166
167
158 168
    <!--
159 169
    <repositories>
160 170
        <repository>
@ -179,4 +189,100 @@
179 189
    </pluginRepositories>
180 190
    -->
181 191
192
    <build>
193
194
        <resources>
195
            <resource>
196
                <directory>src/main/resources</directory>
197
            </resource>
198
        </resources>
199
200
        <plugins>
201
202
            <!-- The configuration of maven-jar-plugin -->
203
            <plugin>
204
                <groupId>org.apache.maven.plugins</groupId>
205
                <artifactId>maven-jar-plugin</artifactId>
206
                <version>2.4</version>
207
                <!-- The configuration of the plugin -->
208
                <configuration>
209
                    <!-- Configuration of the archiver -->
210
                    <archive>
211
                        <!--生成的jar中,不要包含pom.xml和pom.properties这两个文件-->
212
                        <addMavenDescriptor>false</addMavenDescriptor>
213
214
                        <!-- Manifest specific configuration -->
215
                        <manifest>
216
                            <!--是否要把第三方jar放到manifest的classpath中-->
217
                            <addClasspath>true</addClasspath>
218
                            <!--生成的manifest中classpath的前缀,因为要把第三方jar放到lib目录下,所以classpath的前缀是lib/-->
219
                            <classpathPrefix>lib/</classpathPrefix>
220
                            <!--应用的main class-->
221
                            <mainClass>com.ai.bss.location.rescue.LocationRescueApp</mainClass>
222
                        </manifest>
223
                        <manifestEntries>
224
                            <Class-Path>./config/</Class-Path>
225
                        </manifestEntries>
226
                    </archive>
227
                    <!--过滤掉不希望包含在jar中的文件-->
228
                    <excludes>
229
                        <exclude>**/*.properties</exclude>
230
                        <exclude>**/*.xml</exclude>
231
                    </excludes>
232
                </configuration>
233
            </plugin>
234
235
            <plugin>
236
                <groupId>org.apache.maven.plugins</groupId>
237
                <artifactId>maven-dependency-plugin</artifactId>
238
                <version>2.10</version>
239
                <executions>
240
                    <execution>
241
                        <id>copy-dependencies</id>
242
                        <phase>package</phase>
243
                        <goals>
244
                            <goal>copy-dependencies</goal>
245
                        </goals>
246
                        <configuration>
247
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
248
                        </configuration>
249
                    </execution>
250
                </executions>
251
            </plugin>
252
253
            <!-- The configuration of maven-assembly-plugin -->
254
            <plugin>
255
                <groupId>org.apache.maven.plugins</groupId>
256
                <artifactId>maven-assembly-plugin</artifactId>
257
                <version>2.4</version>
258
                <!-- The configuration of the plugin -->
259
                <configuration>
260
                    <!-- Specifies the configuration file of the assembly plugin -->
261
                    <descriptors>
262
                        <descriptor>src/main/assembly/package.xml</descriptor>
263
                    </descriptors>
264
                </configuration>
265
                <executions>
266
                    <execution>
267
                        <id>make-assembly</id>
268
                        <phase>package</phase>
269
                        <goals>
270
                            <goal>single</goal>
271
                        </goals>
272
                    </execution>
273
                </executions>
274
            </plugin>
275
276
            <plugin>
277
                <groupId>org.apache.maven.plugins</groupId>
278
                <artifactId>maven-surefire-plugin</artifactId>
279
                <configuration>
280
                    <skip>true</skip>
281
                </configuration>
282
            </plugin>
283
        </plugins>
284
285
        <finalName>${project.artifactId}</finalName>
286
    </build>
287
182 288
</project>

+ 59 - 0
location-rescue-service/src/main/assembly/package.xml

@ -0,0 +1,59 @@
1
<assembly>
2
    <id>bin</id>
3
    <!-- 最终打包成一个用于发布的zip文件 -->
4
    <formats>
5
        <format>zip</format>
6
    </formats>
7
8
    <!-- Adds dependencies to zip package under lib directory -->
9
    <dependencySets>
10
        <dependencySet>
11
            <!-- 不使用项目的artifact,第三方jar不要解压,打包进zip文件的lib目录 -->
12
            <useProjectArtifact>false</useProjectArtifact>
13
            <outputDirectory>lib</outputDirectory>
14
            <unpack>false</unpack>
15
            <scope>runtime</scope>
16
        </dependencySet>
17
    </dependencySets>
18
19
    <fileSets>
20
        <!-- 把项目相关的说明文件,打包进zip文件的根目录 -->
21
        <fileSet>
22
            <directory>${project.basedir}</directory>
23
            <outputDirectory>/</outputDirectory>
24
        <includes>
25
            <include>README*</include>
26
            <include>LICENSE*</include>
27
            <include>NOTICE*</include>
28
        </includes>
29
    </fileSet>
30
31
        <!-- 把项目的配置文件,打包进zip文件的config目录 -->
32
        <fileSet>
33
            <directory>src/main/resources</directory>
34
            <outputDirectory>/config</outputDirectory>
35
            <includes>
36
                <include>**/*.properties</include>
37
                <include>**/*.xml</include>
38
            </includes>
39
        </fileSet>
40
41
        <!-- 把项目的脚本文件目录( src/main/scripts )中的启动脚本文件,打包进zip文件的跟目录 -->
42
        <fileSet>
43
            <directory>${project.build.scriptSourceDirectory}</directory>
44
            <outputDirectory></outputDirectory>
45
            <includes>
46
                <include>startup.*</include>
47
            </includes>
48
        </fileSet>
49
50
        <!-- 把项目自己编译出来的jar文件,打包进zip文件的根目录 -->
51
        <fileSet>
52
            <directory>${project.build.directory}</directory>
53
            <outputDirectory></outputDirectory>
54
            <includes>
55
                <include>*.jar</include>
56
            </includes>
57
        </fileSet>
58
    </fileSets>
59
</assembly>

+ 0 - 39
location-rescue-service/src/main/java/com/ai/bss/location/rescue/EbcSeaPlatformStart.java

@ -1,39 +0,0 @@
1
package com.ai.bss.location.rescue;
2
3
4
import org.slf4j.Logger;
5
import org.slf4j.LoggerFactory;
6
7
8
/**
9
 * @author huangbo@asiainfo.com
10
 * @team IPU
11
 * @date 2019年11月21日下午3:11:12
12
 * @desc SpringBoot应用启动类
13
 */
14
15
public class EbcSeaPlatformStart {
16
	
17
	private final static String EXCEPTION_MESSAGES_CONFIG = "exception_messages";
18
	private static final Logger logger = LoggerFactory.getLogger(EbcSeaPlatformStart.class);
19
20
	public static void main(String[] args) {
21
/*		*//*注册异常信息编码配置*//*
22
	    //热部署会多次加载,因此需要捕获并忽略异常
23
		try{
24
			IpuBaseException.registerCode(EXCEPTION_MESSAGES_CONFIG);
25
			//注册镜屏服务
26
			ConnectServerManager.registerServer("websocket.port", new WebSocketStompServer("/stomp"));
27
			//镜屏服务启动
28
			ConnectServerStart.start(args, false);
29
		}catch(Exception e) {
30
			logger.error("启动失败:" + e.getMessage());
31
			try {
32
				ReflectUtil.invokeStaticMethod(System.class, "exit", new Object[] { 0 });
33
			} catch (Exception e1) {}
34
		}
35
		*//*启动*//*
36
	    IpuRestApplication.start(args);*/
37
	}
38
	
39
}

+ 2 - 0
location-rescue-service/src/main/java/com/ai/bss/location/rescue/LocationRescueApp.java

@ -23,6 +23,8 @@ import com.ai.ipu.server.stomp.WebSocketStompServer;
23 23
@SpringBootApplication
24 24
public class LocationRescueApp {
25 25
    public static void main(String[] args) throws Exception {
26
        System.setProperty("websocket.port", "7100");
27
26 28
    	//注册镜屏服务
27 29
		ConnectServerManager.registerServer("websocket.port", new WebSocketStompServer("/stomp"));
28 30
		//镜屏服务启动

+ 1 - 2
location-rescue-service/src/main/java/com/ai/bss/location/rescue/controller/MapTagManageController.java

@ -76,8 +76,7 @@ public class MapTagManageController {
76 76
	@ResponseBody
77 77
	@RequestMapping("/queryMapAreaTypeList")
78 78
	public CommonResponse<List<MapAreaBusinessType>> queryMapAreaTypeList() {
79
		CommonRequest<Void> params = new CommonRequest(null);
80
		return mapTagManageService.queryMapAreaTypeList(params);
79
		return mapTagManageService.queryMapAreaTypeList();
81 80
	}
82 81
83 82
	/**

+ 5 - 2
location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/impl/AlarmManagementServiceImpl.java

@ -5,6 +5,7 @@ import java.util.HashMap;
5 5
import java.util.List;
6 6
import java.util.Map;
7 7
8
import com.ai.bss.location.rescue.service.interfaces.MapTagManageService;
8 9
import org.slf4j.Logger;
9 10
import org.slf4j.LoggerFactory;
10 11
import org.springframework.beans.factory.annotation.Autowired;
@ -58,6 +59,9 @@ public class AlarmManagementServiceImpl implements AlarmManagementService {
58 59
    @Autowired
59 60
    private CharacteristicSpecService characteristicSpecService;
60 61
62
    @Autowired
63
    MapTagManageService mapTagManageService;
64
61 65
    /**
62 66
     * 初始化实时报警数据
63 67
     *
@ -128,8 +132,7 @@ public class AlarmManagementServiceImpl implements AlarmManagementService {
128 132
    public CommonResponse<Map<String, Object>> loadMapAreaTool(HashMap<String, Object> dataMap) throws Exception {
129 133
        Map<String, Object> resultMap = new HashMap<String, Object>();
130 134
131
        List<MapAreaBusinessType> mapAreaTypeList = mapAreaQuery.queryAllMapAreaBusinessType(new CommonRequest(null))
132
                .getData();
135
        List<MapAreaBusinessType> mapAreaTypeList = mapTagManageService.queryMapAreaTypeList().getData();
133 136
        List<ResourceToolType> toolTypeList = resourceToolQuery.loadAllResourceToolType(new CommonRequest(null))
134 137
                .getData();
135 138

+ 5 - 2
location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/impl/LocationManagementServiceImpl.java

@ -18,6 +18,7 @@ import com.ai.bss.components.common.util.ComponentReflectionUtils;
18 18
import com.ai.bss.location.rescue.model.EbcEntityPosition;
19 19
import com.ai.bss.location.rescue.model.EbcMapArea;
20 20
import com.ai.bss.location.rescue.service.interfaces.LocationManagementService;
21
import com.ai.bss.location.rescue.service.interfaces.MapTagManageService;
21 22
import com.ai.bss.position.model.EntityPosition;
22 23
import com.ai.bss.position.model.MapArea;
23 24
import com.ai.bss.position.model.MapAreaBusinessType;
@ -43,6 +44,9 @@ public class LocationManagementServiceImpl implements LocationManagementService
43 44
	@Autowired
44 45
	private ResourceToolQuery resourceToolQuery;
45 46
47
	@Autowired
48
	MapTagManageService mapTagManageService;
49
	
46 50
	/**
47 51
	 * 初始化人员定位详细数据
48 52
	 *
@ -170,8 +174,7 @@ public class LocationManagementServiceImpl implements LocationManagementService
170 174
		if (CollectionUtils.isEmpty(mapAreaList))
171 175
			return ebcMapAreaList;
172 176
173
		List<MapAreaBusinessType> mapAreaTypeList = mapAreaQuery.queryAllMapAreaBusinessType(new CommonRequest(null))
174
				.getData();
177
		List<MapAreaBusinessType> mapAreaTypeList = mapTagManageService.queryMapAreaTypeList().getData();
175 178
		List<ResourceToolType> toolTypeList = resourceToolQuery.loadAllResourceToolType(new CommonRequest(null))
176 179
				.getData();
177 180

+ 2 - 1
location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/impl/MapTagManageServiceImpl.java

@ -55,7 +55,8 @@ public class MapTagManageServiceImpl implements MapTagManageService {
55 55
	}
56 56
57 57
	@Override
58
	public CommonResponse<List<MapAreaBusinessType>> queryMapAreaTypeList(CommonRequest<Void> params) {
58
	public CommonResponse<List<MapAreaBusinessType>> queryMapAreaTypeList() {
59
		CommonRequest params = new CommonRequest("5");
59 60
		return mapAreaQuery.queryAllMapAreaBusinessType(params);
60 61
	}
61 62

+ 2 - 1
location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/interfaces/MapTagManageService.java

@ -31,9 +31,10 @@ public interface MapTagManageService {
31 31
32 32
	/**
33 33
	 * 获取所有围栏类型
34
	 * 
34 35
	 * @return
35 36
	 */
36
	CommonResponse<List<MapAreaBusinessType>> queryMapAreaTypeList(CommonRequest<Void> params);
37
	CommonResponse<List<MapAreaBusinessType>> queryMapAreaTypeList();
37 38
38 39
	/**
39 40
	 * 新增围栏信息

+ 6 - 6
location-rescue-service/src/main/resources/application.properties

@ -20,12 +20,12 @@ spring.jpa.properties.hibernate.generate_statistics=false
20 20
spring.main.allow-bean-definition-overriding=true
21 21
22 22
#kafka
23
kafka.bootstrap-servers=47.105.160.21:9090
24
#kafka.bootstrap-servers=10.19.90.34:2182
25
#kafka.topic.deviceLocation=Topic_IoT_DeviceLocation
26
#kafka.topic.alarm=Topic_IoT_IndividualAlarm
27
kafka.topic.deviceLocation=DeviceLocationA
28
kafka.topic.alarm=IndividualAlarmA
23
#kafka.bootstrap-servers=47.105.160.21:9090
24
kafka.bootstrap-servers=10.19.90.34:9090
25
kafka.topic.deviceLocation=Topic_IoT_DeviceLocation
26
kafka.topic.alarm=Topic_IoT_IndividualAlarm
27
#kafka.topic.deviceLocation=DeviceLocationA
28
#kafka.topic.alarm=IndividualAlarmA
29 29
kafka.producer.batch-size=16785
30 30
kafka.producer.retries=1
31 31
kafka.producer.buffer-memory=33554432