Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
map-parent
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常超
map-parent
Commits
6862f5ac
Commit
6862f5ac
authored
Mar 10, 2021
by
chentian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
es增加抽取基站,查詢基站
parent
a2a92f90
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
16 deletions
+14
-16
common/common_utils/pom.xml
+0
-7
common/common_utils/src/main/java/com/founder/commonutils/publicEntity/GeographicInfo.java
+1
-0
common/pom.xml
+6
-1
service/es/src/main/java/com/founder/eszy/controller/EsQueryController.java
+4
-5
service/es/src/main/java/com/founder/eszy/esExtract/TbZyJzxxEs.java
+2
-2
service/es/src/main/resources/application.properties
+1
-1
No files found.
common/common_utils/pom.xml
View file @
6862f5ac
...
...
@@ -9,10 +9,4 @@
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
common_utils
</artifactId>
<dependencies>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
common/common_utils/src/main/java/com/founder/commonutils/publicEntity/GeographicInfo.java
View file @
6862f5ac
package
com
.
founder
.
commonutils
.
publicEntity
;
import
java.util.List
;
import
org.elasticsearch.common.geo.GeoPoint
;
public
class
GeographicInfo
{
private
String
field
;
//空间检索字段
...
...
common/pom.xml
View file @
6862f5ac
...
...
@@ -21,6 +21,7 @@
<artifactId>
spring-boot-starter-web
</artifactId>
<scope>
provided
</scope>
</dependency>
<!--spring切面aop依赖-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
@@ -64,7 +65,11 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
</dependency>
<!-- 引入spring-data-elasticsearch-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-elasticsearch
</artifactId>
</dependency>
<!-- spring2.X集成redis所需common-pool2
<dependency>
<groupId>org.apache.commons</groupId>
...
...
service/es/src/main/java/com/founder/eszy/controller/EsQueryController.java
View file @
6862f5ac
package
com
.
founder
.
eszy
.
controller
;
import
com.founder.commonutils.publicEntity.*
;
import
com.founder.eszy.esSearch.EsTbZyJzxxTranslationQuery
;
import
io.swagger.annotations.ApiOperation
;
import
org.elasticsearch.common.geo.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -31,20 +31,19 @@ public class EsQueryController {
String
distance
=
geographicInfo
.
getDistance
();
//判断是否是圆
if
(
distance
!=
null
&&
distance
!=
""
){
GeoPoint
point
=
geographicInfo
.
getPoint
();
org
.
elasticsearch
.
common
.
geo
.
GeoPoint
point
=
geographicInfo
.
getPoint
();
if
(
distance
==
null
||
point
==
null
){
return
null
;
}
try
{
//
result = esTbZyJzxxTranslationQuery.searchGeoDistance(bean.getIndex(),bean.getType(),geographicInfo.getField(),distance,point);
result
=
esTbZyJzxxTranslationQuery
.
searchGeoDistance
(
bean
.
getIndex
(),
bean
.
getType
(),
geographicInfo
.
getField
(),
distance
,
point
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
return
MapRestResult
.
ok
().
count
(
result
.
size
()).
data
(
result
);
//XzxtRestResult.build(200,result.size()+"",result);
}
else
{
try
{
//
result = esTbZyJzxxTranslationQuery.searchGeoPolygon(bean.getIndex(),bean.getType(),geographicInfo.getField(),geographicInfo.getPoints());
result
=
esTbZyJzxxTranslationQuery
.
searchGeoPolygon
(
bean
.
getIndex
(),
bean
.
getType
(),
geographicInfo
.
getField
(),
geographicInfo
.
getPoints
());
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
...
...
service/es/src/main/java/com/founder/eszy/esExtract/TbZyJzxxEs.java
View file @
6862f5ac
...
...
@@ -69,7 +69,7 @@ public class TbZyJzxxEs {
.
startObject
(
"xzqhDz"
).
field
(
"type"
,
"keyword"
).
endObject
()
.
startObject
(
"province"
).
field
(
"type"
,
"keyword"
).
endObject
()
.
startObject
(
"city"
).
field
(
"type"
,
"keyword"
).
endObject
()
.
startObject
(
"district"
).
field
(
"type"
,
"
geo_point
"
).
endObject
()
.
startObject
(
"district"
).
field
(
"type"
,
"
keyword
"
).
endObject
()
//更新时间
// .startObject("updatedtime").field("type", "keyword").endObject()//修改时间
...
...
@@ -126,7 +126,7 @@ public class TbZyJzxxEs {
map
.
put
(
"district"
,
e
.
getDistrict
());
//es 特需
map
.
put
(
"xy"
,
e
.
get
X
()+
","
+
e
.
getY
());
map
.
put
(
"xy"
,
e
.
get
Y
()+
","
+
e
.
getX
());
bulkRequest
.
add
(
esClient
.
prepareIndex
(
indexName
,
"pointdata"
,
e
.
getCid
()).
setSource
(
map
));
bulkRequest
.
execute
().
actionGet
();
}
catch
(
Exception
e1
)
{
...
...
service/es/src/main/resources/application.properties
View file @
6862f5ac
...
...
@@ -19,7 +19,7 @@ mybatis-plus.mapper-locations=classpath:com/founder/eszy/mapper/xml/*.xml
#mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
#基站--------------
jz_count
=
60000
0
jz_count
=
1
0
jz_limit
=
10000
jz_begin
=
0
jz_index
=
jizhan
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment