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
7386a626
Commit
7386a626
authored
Dec 24, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店经纬度
parent
32bcea00
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
31 deletions
+61
-31
StoreSearchDTO.java
...e-api/src/main/java/com/gic/store/dto/StoreSearchDTO.java
+9
-0
StoreApiService.java
.../src/main/java/com/gic/store/service/StoreApiService.java
+1
-1
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+49
-30
StoreController.java
...in/java/com/gic/store/web/controller/StoreController.java
+2
-0
No files found.
gic-store-api/src/main/java/com/gic/store/dto/StoreSearchDTO.java
View file @
7386a626
...
...
@@ -19,6 +19,7 @@ public class StoreSearchDTO implements Serializable {
private
String
authSearchJson
;
private
String
latitude
;
private
String
longitude
;
private
Long
storeResource
;
private
Integer
currentPage
=
1
;
private
Integer
pageSize
=
20
;
...
...
@@ -165,4 +166,12 @@ public class StoreSearchDTO implements Serializable {
public
void
setLongitude
(
String
longitude
)
{
this
.
longitude
=
longitude
;
}
public
Long
getStoreResource
()
{
return
storeResource
;
}
public
void
setStoreResource
(
Long
storeResource
)
{
this
.
storeResource
=
storeResource
;
}
}
gic-store-api/src/main/java/com/gic/store/service/StoreApiService.java
View file @
7386a626
...
...
@@ -232,7 +232,7 @@ public interface StoreApiService {
/** @Description: 小程序开卡门店
* @author taogs
* @Date 1
7:2
8 2019/12/24
* @Date 1
8:3
8 2019/12/24
* @Param
* @return
*/
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
7386a626
...
...
@@ -90,6 +90,8 @@ public class StoreApiServiceImpl implements StoreApiService {
private
CustomStoreApiService
customStoreApiService
;
@Autowired
private
StoreWidgetApiService
storeWidgetApiService
;
@Autowired
private
StoreWidgetService
storeWidgetService
;
static
{
storeStrtegyMap
.
put
(
1
,
new
StoreStatusStrategyImpl
());
...
...
@@ -370,6 +372,9 @@ public class StoreApiServiceImpl implements StoreApiService {
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
ENTERPRISE_EMPTY
);
}
JSONObject
enterpriseJson
=
this
.
buildSearchJSON
(
storeSearchDTO
);
if
(
enterpriseJson
==
null
){
//null表示没有权限
return
ServiceResponse
.
success
();
}
JSONObject
sortJson
=
null
;
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getLatitude
())
&&
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getLatitude
())){
sortJson
=
QueryConditionAssemblyUtil
.
createSortNodeByLocation
(
StoreESFieldsEnum
.
LOCATION
.
getField
(),
QueryConditionAssemblyUtil
.
SORT_RULE_ASC
,
...
...
@@ -515,20 +520,16 @@ public class StoreApiServiceImpl implements StoreApiService {
ServiceResponse
<
CustomStoreDTO
>
customStore
=
this
.
customStoreApiService
.
getCustomStore
(
nearByStoreSearchDTO
.
getEnterpriseId
(),
nearByStoreSearchDTO
.
getAppid
());
if
(
customStore
.
isSuccess
()
&&
customStore
.
getResult
()
!=
null
){
Integer
storeWidgetId
=
customStore
.
getResult
().
getStoreWidgetId
();
ServiceResponse
<
StoreWidgetDTO
>
response
=
this
.
storeWidgetApiService
.
getStoreWidget
(
storeWidgetId
);
if
(
response
.
isSuccess
()
&&
response
.
getResult
()
!=
null
){
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
nearByStoreSearchDTO
.
getEnterpriseId
());
storeSearchDTO
.
setStoreBrandId
(
nearByStoreSearchDTO
.
getBrandId
());
storeSearchDTO
.
setLongitude
(
nearByStoreSearchDTO
.
getLongitude
());
storeSearchDTO
.
setLatitude
(
nearByStoreSearchDTO
.
getLatitude
());
storeSearchDTO
.
setCityId
(
nearByStoreSearchDTO
.
getCityId
());
storeSearchDTO
.
setAuthSearchJson
(
response
.
getResult
().
getAuthSearchParam
());
storeSearchDTO
.
setSearchJson
(
response
.
getResult
().
getSearchParam
());
ServiceResponse
<
Page
<
StoreDTO
>>
storePage
=
this
.
listStore
(
storeSearchDTO
,
nearByStoreSearchDTO
.
getPageNum
(),
nearByStoreSearchDTO
.
getPageSize
());
logger
.
info
(
"pageNearbyStore:{}"
,
JSON
.
toJSONString
(
storePage
,
true
));
return
ServiceResponse
.
success
(
storePage
.
getResult
());
}
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
nearByStoreSearchDTO
.
getEnterpriseId
());
storeSearchDTO
.
setStoreBrandId
(
nearByStoreSearchDTO
.
getBrandId
());
storeSearchDTO
.
setLongitude
(
nearByStoreSearchDTO
.
getLongitude
());
storeSearchDTO
.
setLatitude
(
nearByStoreSearchDTO
.
getLatitude
());
storeSearchDTO
.
setCityId
(
nearByStoreSearchDTO
.
getCityId
());
storeSearchDTO
.
setStoreResource
(
Long
.
valueOf
(
storeWidgetId
+
""
));
ServiceResponse
<
Page
<
StoreDTO
>>
storePage
=
this
.
listStore
(
storeSearchDTO
,
nearByStoreSearchDTO
.
getPageNum
(),
nearByStoreSearchDTO
.
getPageSize
());
logger
.
info
(
"pageNearbyStore:{}"
,
JSON
.
toJSONString
(
storePage
,
true
));
return
ServiceResponse
.
success
(
storePage
.
getResult
());
}
return
ServiceResponse
.
success
();
}
...
...
@@ -537,20 +538,16 @@ public class StoreApiServiceImpl implements StoreApiService {
public
ServiceResponse
<
Page
<
StoreDTO
>>
pageCoupApplyStore
(
WxSearchStoreSearchDTO
coupApplyStoreSearchDTO
)
{
if
(
coupApplyStoreSearchDTO
.
getStoreWidgetId
()
!=
null
){
Integer
storeWidgetId
=
coupApplyStoreSearchDTO
.
getStoreWidgetId
();
ServiceResponse
<
StoreWidgetDTO
>
response
=
this
.
storeWidgetApiService
.
getStoreWidget
(
storeWidgetId
);
if
(
response
.
isSuccess
()
&&
response
.
getResult
()
!=
null
){
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
coupApplyStoreSearchDTO
.
getEnterpriseId
());
storeSearchDTO
.
setStoreBrandId
(
coupApplyStoreSearchDTO
.
getBrandId
());
storeSearchDTO
.
setLongitude
(
coupApplyStoreSearchDTO
.
getLongitude
());
storeSearchDTO
.
setLatitude
(
coupApplyStoreSearchDTO
.
getLatitude
());
storeSearchDTO
.
setCityId
(
coupApplyStoreSearchDTO
.
getCityId
());
storeSearchDTO
.
setAuthSearchJson
(
response
.
getResult
().
getAuthSearchParam
());
storeSearchDTO
.
setSearchJson
(
response
.
getResult
().
getSearchParam
());
ServiceResponse
<
Page
<
StoreDTO
>>
storePage
=
this
.
listStore
(
storeSearchDTO
,
coupApplyStoreSearchDTO
.
getPageNum
(),
coupApplyStoreSearchDTO
.
getPageSize
());
logger
.
info
(
"pageCoupApplyStore:{}"
,
JSON
.
toJSONString
(
storePage
,
true
));
return
ServiceResponse
.
success
(
storePage
.
getResult
());
}
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
coupApplyStoreSearchDTO
.
getEnterpriseId
());
storeSearchDTO
.
setStoreBrandId
(
coupApplyStoreSearchDTO
.
getBrandId
());
storeSearchDTO
.
setLongitude
(
coupApplyStoreSearchDTO
.
getLongitude
());
storeSearchDTO
.
setLatitude
(
coupApplyStoreSearchDTO
.
getLatitude
());
storeSearchDTO
.
setCityId
(
coupApplyStoreSearchDTO
.
getCityId
());
storeSearchDTO
.
setStoreResource
(
Long
.
valueOf
(
storeWidgetId
+
""
));
ServiceResponse
<
Page
<
StoreDTO
>>
storePage
=
this
.
listStore
(
storeSearchDTO
,
coupApplyStoreSearchDTO
.
getPageNum
(),
coupApplyStoreSearchDTO
.
getPageSize
());
logger
.
info
(
"pageCoupApplyStore:{}"
,
JSON
.
toJSONString
(
storePage
,
true
));
return
ServiceResponse
.
success
(
storePage
.
getResult
());
}
return
ServiceResponse
.
success
();
}
...
...
@@ -969,14 +966,14 @@ public class StoreApiServiceImpl implements StoreApiService {
json
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
StoreESFieldsEnum
.
STOREBRANDIDLIST
.
getField
(),
OperateEnum
.
OPERATE_ARR_CONTAIN
,
storeSearchDTO
.
getStoreBrandId
());
jsonObjectList
.
add
(
json
);
}
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getSearchJson
())){
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getSearchJson
())
&&
!
"{}"
.
equals
(
storeSearchDTO
.
getSearchJson
())
){
ServiceResponse
<
JSONObject
>
jsonObjectServiceResponse
=
this
.
parseStoreSelectJson
(
storeSearchDTO
.
getSearchJson
());
if
(
jsonObjectServiceResponse
.
isSuccess
()){
json
=
jsonObjectServiceResponse
.
getResult
();
jsonObjectList
.
add
(
json
);
}
}
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getAuthSearchJson
())){
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getAuthSearchJson
())
&&
!
"{}"
.
equals
(
storeSearchDTO
.
getAuthSearchJson
())
){
ServiceResponse
<
JSONObject
>
jsonObjectServiceResponse
=
this
.
parseStoreSelectJson
(
storeSearchDTO
.
getAuthSearchJson
());
if
(
jsonObjectServiceResponse
.
isSuccess
()){
json
=
jsonObjectServiceResponse
.
getResult
();
...
...
@@ -987,6 +984,28 @@ public class StoreApiServiceImpl implements StoreApiService {
json
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
StoreESFieldsEnum
.
LOCATION
.
getField
(),
OperateEnum
.
OPERATE_LOCATION
,
storeSearchDTO
.
getLatitude
()+
","
+
storeSearchDTO
.
getLongitude
());
jsonObjectList
.
add
(
json
);
}
if
(
storeSearchDTO
.
getStoreResource
()
!=
null
){
StoreWidgetDTO
storeWidget
=
this
.
storeWidgetService
.
getStoreWidget
(
storeSearchDTO
.
getStoreResource
().
intValue
());
if
(
storeWidget
!=
null
){
if
(
storeWidget
.
getAuthMode
()
==
1
&&
StringUtils
.
isNotBlank
(
storeWidget
.
getSearchParam
())
&&
!
"{}"
.
equals
(
storeWidget
.
getSearchParam
())){
ServiceResponse
<
JSONObject
>
jsonObjectServiceResponse
=
this
.
parseStoreSelectJson
(
storeWidget
.
getSearchParam
());
if
(
jsonObjectServiceResponse
.
isSuccess
()){
json
=
jsonObjectServiceResponse
.
getResult
();
jsonObjectList
.
add
(
json
);
}
}
if
(
storeWidget
.
getAuthMode
()
==
1
&&
StringUtils
.
isNotBlank
(
storeWidget
.
getAuthSearchParam
())
&&
!
"{}"
.
equals
(
storeWidget
.
getAuthSearchParam
())){
ServiceResponse
<
JSONObject
>
jsonObjectServiceResponse
=
this
.
parseStoreSelectJson
(
storeWidget
.
getAuthSearchParam
());
if
(
jsonObjectServiceResponse
.
isSuccess
()){
json
=
jsonObjectServiceResponse
.
getResult
();
jsonObjectList
.
add
(
json
);
}
}
if
(
storeWidget
.
getAuthMode
()
==
2
){
return
null
;
}
}
}
enterpriseJson
=
QueryConditionAssemblyUtil
.
createListQueryNode
(
jsonObjectList
,
OperateEnum
.
OPERATE_AND
);
return
enterpriseJson
;
}
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreController.java
View file @
7386a626
...
...
@@ -28,6 +28,7 @@ import com.gic.store.web.qo.store.StoreQO;
import
com.gic.store.web.vo.StoreExportFieldVO
;
import
com.gic.store.web.vo.StoreListSourceVO
;
import
com.gic.store.web.vo.StoreOverflowVO
;
import
org.apache.catalina.User
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -126,6 +127,7 @@ public class StoreController extends DownloadUtils {
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
Integer
userId
=
UserDetailUtils
.
getUserDetail
().
getUserId
();
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
Long
storeResource
=
UserDetailUtils
.
getUserDetail
().
getUserResourceInfo
().
getStoreResource
();
String
key
=
StoreRedisKeyUtils
.
getStoreListSourceKey
(
enterpriseId
,
userId
);
Object
obj
=
RedisUtil
.
getCache
(
key
);
String
returnFileds
=
StoreESFieldsEnum
.
STOREID
.
getField
();
...
...
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