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
1615c5e7
Commit
1615c5e7
authored
Jun 17, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店查询支持多个门店控件id聚合
parent
183f69b0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
16 deletions
+54
-16
StoreSearchDTO.java
...e-api/src/main/java/com/gic/store/dto/StoreSearchDTO.java
+10
-0
WxSearchStoreSearchDTO.java
...c/main/java/com/gic/store/dto/WxSearchStoreSearchDTO.java
+10
-0
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+34
-16
No files found.
gic-store-api/src/main/java/com/gic/store/dto/StoreSearchDTO.java
View file @
1615c5e7
package
com
.
gic
.
store
.
dto
;
import
java.io.Serializable
;
import
java.util.List
;
public
class
StoreSearchDTO
implements
Serializable
{
private
Integer
storeGroupId
;
...
...
@@ -26,6 +27,7 @@ public class StoreSearchDTO implements Serializable {
private
Integer
pageSize
=
20
;
private
Integer
storeTagId
;
private
Integer
completeStatus
;
private
List
<
Integer
>
storeResourceList
;
public
Integer
getStoreGroupId
()
{
return
storeGroupId
;
...
...
@@ -212,4 +214,12 @@ public class StoreSearchDTO implements Serializable {
this
.
completeStatus
=
completeStatus
;
return
this
;
}
public
List
<
Integer
>
getStoreResourceList
()
{
return
storeResourceList
;
}
public
void
setStoreResourceList
(
List
<
Integer
>
storeResourceList
)
{
this
.
storeResourceList
=
storeResourceList
;
}
}
gic-store-api/src/main/java/com/gic/store/dto/WxSearchStoreSearchDTO.java
View file @
1615c5e7
package
com
.
gic
.
store
.
dto
;
import
java.io.Serializable
;
import
java.util.List
;
public
class
WxSearchStoreSearchDTO
implements
Serializable
{
private
Integer
enterpriseId
;
...
...
@@ -10,6 +11,7 @@ public class WxSearchStoreSearchDTO implements Serializable {
private
Integer
brandId
;
private
String
appid
;
private
Integer
StoreWidgetId
;
private
List
<
Integer
>
storeWidgetIdList
;
private
Integer
pageNum
=
1
;
private
Integer
pageSize
=
20
;
...
...
@@ -84,4 +86,12 @@ public class WxSearchStoreSearchDTO implements Serializable {
public
void
setStoreWidgetId
(
Integer
storeWidgetId
)
{
StoreWidgetId
=
storeWidgetId
;
}
public
List
<
Integer
>
getStoreWidgetIdList
()
{
return
storeWidgetIdList
;
}
public
void
setStoreWidgetIdList
(
List
<
Integer
>
storeWidgetIdList
)
{
this
.
storeWidgetIdList
=
storeWidgetIdList
;
}
}
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
1615c5e7
...
...
@@ -784,6 +784,7 @@ public class StoreApiServiceImpl implements StoreApiService {
storeSearchDTO
.
setLongitude
(
wxSearchStoreSearchDTO
.
getLongitude
());
storeSearchDTO
.
setLatitude
(
wxSearchStoreSearchDTO
.
getLatitude
());
storeSearchDTO
.
setCityId
(
wxSearchStoreSearchDTO
.
getCityId
());
storeSearchDTO
.
setStoreResourceList
(
wxSearchStoreSearchDTO
.
getStoreWidgetIdList
());
ServiceResponse
<
Page
<
StoreDTO
>>
storePage
=
this
.
listStore
(
storeSearchDTO
,
wxSearchStoreSearchDTO
.
getPageNum
(),
wxSearchStoreSearchDTO
.
getPageSize
());
logger
.
info
(
"pageCoupApplyStore:{}"
,
JSON
.
toJSONString
(
storePage
,
true
));
return
ServiceResponse
.
success
(
storePage
.
getResult
());
...
...
@@ -1513,8 +1514,37 @@ 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
());
String
storeWidgetJSON
=
this
.
buildStoreWidgetJSON
(
storeSearchDTO
.
getStoreResource
()
==
null
?
null
:
storeSearchDTO
.
getStoreResource
().
intValue
(),
json
,
jsonObjectList
);
/*****如果存在没有门店权限的门店控件id,直接返回*****/
if
(
StringUtils
.
isNotBlank
(
storeWidgetJSON
))
{
return
null
;
}
if
(
CollectionUtils
.
isNotEmpty
(
storeSearchDTO
.
getStoreResourceList
())){
for
(
Integer
storeResource
:
storeSearchDTO
.
getStoreResourceList
()){
String
s
=
this
.
buildStoreWidgetJSON
(
storeResource
,
json
,
jsonObjectList
);
if
(
StringUtils
.
isNotBlank
(
s
)){
return
null
;
}
}
}
enterpriseJson
=
QueryConditionAssemblyUtil
.
createListQueryNode
(
jsonObjectList
,
OperateEnum
.
OPERATE_AND
);
/***build notIn search****/
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getStoreIdsOfNot
())){
List
<
JSONObject
>
list
=
new
ArrayList
<>();
json
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
StoreESFieldsEnum
.
STOREID
.
getField
(),
OperateEnum
.
OPERATE_ARR_CONTAIN
,
storeSearchDTO
.
getStoreIdsOfNot
());
list
.
add
(
json
);
JSONObject
notJSON
=
QueryConditionAssemblyUtil
.
createListQueryNode
(
list
,
OperateEnum
.
OPERATE_AND_NOT
);
List
<
JSONObject
>
_list
=
new
ArrayList
<>();
_list
.
add
(
enterpriseJson
);
_list
.
add
(
notJSON
);
enterpriseJson
=
QueryConditionAssemblyUtil
.
createListQueryNode
(
_list
,
OperateEnum
.
OPERATE_AND
);
}
return
enterpriseJson
;
}
private
String
buildStoreWidgetJSON
(
Integer
storeWidgetId
,
JSONObject
json
,
List
<
JSONObject
>
jsonObjectList
){
if
(
storeWidgetId
!=
null
){
StoreWidgetDTO
storeWidget
=
this
.
storeWidgetService
.
getStoreWidget
(
storeWidgetId
.
intValue
());
if
(
storeWidget
!=
null
){
if
(
storeWidget
.
getAuthMode
()
!=
null
&&
storeWidget
.
getAuthMode
()
==
1
&&
StringUtils
.
isNotBlank
(
storeWidget
.
getSearchParam
())
&&
!
"{}"
.
equals
(
storeWidget
.
getSearchParam
())){
...
...
@@ -1533,23 +1563,11 @@ public class StoreApiServiceImpl implements StoreApiService {
}
}
if
(
storeWidget
.
getAuthMode
()
!=
null
&&
storeWidget
.
getAuthMode
()
==
2
){
return
null
;
return
"noAuth"
;
}
}
}
enterpriseJson
=
QueryConditionAssemblyUtil
.
createListQueryNode
(
jsonObjectList
,
OperateEnum
.
OPERATE_AND
);
/***build notIn search****/
if
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getStoreIdsOfNot
())){
List
<
JSONObject
>
list
=
new
ArrayList
<>();
json
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
StoreESFieldsEnum
.
STOREID
.
getField
(),
OperateEnum
.
OPERATE_ARR_CONTAIN
,
storeSearchDTO
.
getStoreIdsOfNot
());
list
.
add
(
json
);
JSONObject
notJSON
=
QueryConditionAssemblyUtil
.
createListQueryNode
(
list
,
OperateEnum
.
OPERATE_AND_NOT
);
List
<
JSONObject
>
_list
=
new
ArrayList
<>();
_list
.
add
(
enterpriseJson
);
_list
.
add
(
notJSON
);
enterpriseJson
=
QueryConditionAssemblyUtil
.
createListQueryNode
(
_list
,
OperateEnum
.
OPERATE_AND
);
}
return
enterpriseJson
;
return
null
;
}
private
static
ServiceResponse
<
String
>
responseErrorElement
(
ImportStoreBatchResultEnum
error
)
{
...
...
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