Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
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
base_platform_enterprise
gic-store
Commits
3c0c5137
Commit
3c0c5137
authored
Dec 23, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店经纬度
parent
88d10453
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
1 deletions
+51
-1
StoreESFieldsEnum.java
...c/main/java/com/gic/store/constant/StoreESFieldsEnum.java
+2
-0
StoreEsDTO.java
...store-api/src/main/java/com/gic/store/dto/StoreEsDTO.java
+18
-0
StoreSearchDTO.java
...e-api/src/main/java/com/gic/store/dto/StoreSearchDTO.java
+18
-0
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+13
-1
No files found.
gic-store-api/src/main/java/com/gic/store/constant/StoreESFieldsEnum.java
View file @
3c0c5137
...
...
@@ -30,6 +30,8 @@ public enum StoreESFieldsEnum {
OWNTYPE
(
"ownType"
,
"门店是否共享"
),
PHOTOLIST
(
"photoList"
,
"门店图片"
),
BUSSINESSTIME
(
"businessTimeList"
,
"门店营业时间"
),
ADDRESS
(
"address"
,
"门店详细地址"
),
LOCATION
(
"location"
,
"经纬度"
),
C1
(
"c1"
,
"自定义字段1"
),
C2
(
"c2"
,
"自定义字段2"
),
C3
(
"c3"
,
"自定义字段3"
),
...
...
gic-store-api/src/main/java/com/gic/store/dto/StoreEsDTO.java
View file @
3c0c5137
...
...
@@ -30,6 +30,8 @@ public class StoreEsDTO implements Serializable {
private
Integer
ownType
;
private
List
<
StorePhotoDTO
>
photoList
;
private
List
<
StoreBusinessTimeDTO
>
businessTimeList
;
private
String
location
;
private
String
address
;
public
Integer
getStoreId
()
{
return
storeId
;
...
...
@@ -238,4 +240,20 @@ public class StoreEsDTO implements Serializable {
public
void
setBusinessTimeList
(
List
<
StoreBusinessTimeDTO
>
businessTimeList
)
{
this
.
businessTimeList
=
businessTimeList
;
}
public
String
getLocation
()
{
return
location
;
}
public
void
setLocation
(
String
location
)
{
this
.
location
=
location
;
}
public
String
getAddress
()
{
return
address
;
}
public
void
setAddress
(
String
address
)
{
this
.
address
=
address
;
}
}
gic-store-api/src/main/java/com/gic/store/dto/StoreSearchDTO.java
View file @
3c0c5137
...
...
@@ -17,6 +17,8 @@ public class StoreSearchDTO implements Serializable {
private
Integer
storeBrandId
;
private
String
searchJson
;
private
String
authSearchJson
;
private
String
latitude
;
private
String
longitude
;
private
Integer
currentPage
=
1
;
private
Integer
pageSize
=
20
;
...
...
@@ -147,4 +149,20 @@ public class StoreSearchDTO implements Serializable {
public
void
setAuthSearchJson
(
String
authSearchJson
)
{
this
.
authSearchJson
=
authSearchJson
;
}
public
String
getLatitude
()
{
return
latitude
;
}
public
void
setLatitude
(
String
latitude
)
{
this
.
latitude
=
latitude
;
}
public
String
getLongitude
()
{
return
longitude
;
}
public
void
setLongitude
(
String
longitude
)
{
this
.
longitude
=
longitude
;
}
}
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
3c0c5137
...
...
@@ -369,7 +369,13 @@ public class StoreApiServiceImpl implements StoreApiService {
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
ENTERPRISE_EMPTY
);
}
JSONObject
enterpriseJson
=
this
.
buildSearchJSON
(
storeSearchDTO
);
JSONObject
sortJson
=
QueryConditionAssemblyUtil
.
createSortNode
(
StoreESFieldsEnum
.
STORECODE
.
getField
(),
QueryConditionAssemblyUtil
.
SORT_RULE_ASC
);
JSONObject
sortJson
=
null
;
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getLatitude
())
&&
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getLatitude
())){
sortJson
=
QueryConditionAssemblyUtil
.
createSortNodeByLocation
(
StoreESFieldsEnum
.
LOCATION
.
getField
(),
QueryConditionAssemblyUtil
.
SORT_RULE_ASC
,
Double
.
valueOf
(
storeSearchDTO
.
getLatitude
()),
Double
.
valueOf
(
storeSearchDTO
.
getLongitude
()));
}
else
{
sortJson
=
QueryConditionAssemblyUtil
.
createSortNode
(
StoreESFieldsEnum
.
STORECODE
.
getField
(),
QueryConditionAssemblyUtil
.
SORT_RULE_ASC
);
}
ServiceResponse
<
ESResponseQueryBatchDTO
>
response
=
this
.
queryStoreFromES
(
enterpriseJson
,
pageNum
,
pageSize
,
sortJson
,
returnFileds
);
if
(
response
.
isSuccess
())
{
Page
<
StoreDTO
>
page
=
new
Page
(
pageNum
,
pageSize
);
...
...
@@ -824,6 +830,8 @@ public class StoreApiServiceImpl implements StoreApiService {
esDTO
.
setOwnType
(
dto
.
getOwnType
());
esDTO
.
setBusinessTimeList
(
dto
.
getBusinessTimeList
());
esDTO
.
setPhotoList
(
dto
.
getPhotoList
());
esDTO
.
setAddress
(
dto
.
getAddress
());
esDTO
.
setLocation
(
dto
.
getLatitude
()+
","
+
dto
.
getLongitude
());
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
esDTO
));
List
<
StoreExtendDTO
>
storeExtendDTOList
=
dto
.
getStoreExtendList
();
for
(
StoreExtendDTO
extendDTO
:
storeExtendDTOList
)
{
...
...
@@ -934,6 +942,10 @@ public class StoreApiServiceImpl implements StoreApiService {
jsonObjectList
.
add
(
json
);
}
}
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getLatitude
())
&&
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getLongitude
())){
json
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
StoreESFieldsEnum
.
LOCATION
.
getField
(),
OperateEnum
.
OPERATE_LOCATION
,
storeSearchDTO
.
getLatitude
()+
","
+
storeSearchDTO
.
getLongitude
());
jsonObjectList
.
add
(
json
);
}
enterpriseJson
=
QueryConditionAssemblyUtil
.
createListQueryNode
(
jsonObjectList
,
OperateEnum
.
OPERATE_AND
);
return
enterpriseJson
;
}
...
...
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