Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-data-cloud
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-data-cloud
Commits
fa1ebe2c
Commit
fa1ebe2c
authored
Jun 16, 2021
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店控件查询
parent
c3451283
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
56 deletions
+55
-56
StoreSearchUtils.java
...n/java/com/gic/cloud/web/controller/StoreSearchUtils.java
+55
-56
No files found.
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/controller/StoreSearchUtils.java
View file @
fa1ebe2c
...
...
@@ -118,9 +118,8 @@ public class StoreSearchUtils {
StoreAuth
storeAuth
=
this
.
dataAuthUtils
.
getStoreAuth
(
userId
,
enterpriseId
);
log
.
info
(
"storeAuth:{}"
,
JSON
.
toJSONString
(
storeAuth
));
if
(!
storeAuth
.
isHasAuth
()){
ArrayList
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
0
);
return
list
;
resultList
.
add
(
0
);
return
resultList
;
}
if
(
StringUtils
.
isNotBlank
(
searchJson
)){
JSONObject
json
=
JSON
.
parseObject
(
searchJson
);
...
...
@@ -129,65 +128,65 @@ public class StoreSearchUtils {
if
(
storeSearchQo
.
getAll
()
==
1
){
storeSearchDTO
.
setStoreInfoIds
(
StringUtils
.
join
(
storeAuth
.
getStoreInfoIdList
().
toArray
(),
" "
));
}
else
{
if
(
StringUtils
.
isNotBlank
(
storeSearchQo
.
getStoreIds
()))
{
storeSearchDTO
.
setStoreInfoIds
(
storeSearchQo
.
getStoreIds
().
replaceAll
(
","
,
" "
));
if
(
StringUtils
.
isNotBlank
(
storeSearchQo
.
getStoreIds
()))
{
storeSearchDTO
.
setStoreInfoIds
(
storeSearchQo
.
getStoreIds
().
replaceAll
(
","
,
" "
));
}
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
storeSearchDTO
.
setStoreGroupIds
(
StringUtils
.
isBlank
(
storeSearchQo
.
getStoreGroupIds
())
?
null
:
storeSearchQo
.
getStoreGroupIds
().
replaceAll
(
","
,
" "
));
storeSearchDTO
.
setRegionIds
(
StringUtils
.
isBlank
(
storeSearchQo
.
getRegion
())
?
null
:
storeSearchQo
.
getRegion
().
replaceAll
(
","
,
" "
));
storeSearchDTO
.
setStoreTypes
(
StringUtils
.
isBlank
(
storeSearchQo
.
getStoreType
())
?
null
:
storeSearchQo
.
getStoreType
().
replaceAll
(
","
,
" "
));
storeSearchDTO
.
setStoreStatuss
(
StringUtils
.
isBlank
(
storeSearchQo
.
getStoreStatus
())
?
null
:
storeSearchQo
.
getStoreStatus
().
replaceAll
(
","
,
" "
));
storeSearchDTO
.
setRealStatuss
(
StringUtils
.
isBlank
(
storeSearchQo
.
getErpStatus
())
?
null
:
storeSearchQo
.
getErpStatus
().
replaceAll
(
","
,
" "
));
storeSearchDTO
.
setStoreTags
(
StringUtils
.
isBlank
(
storeSearchQo
.
getStoreTag
())
?
null
:
storeSearchQo
.
getStoreTag
().
replaceAll
(
","
,
" "
));
storeSearchDTO
.
setStoreBrandIds
(
StringUtils
.
isBlank
(
storeSearchQo
.
getStoreBrand
())
?
null
:
storeSearchQo
.
getStoreBrand
().
replaceAll
(
","
,
" "
));
String
resourceType
=
storeSearchQo
.
getResourceType
();
Integer
ownType
=
null
;
if
(
StringUtils
.
isNotBlank
(
resourceType
)){
if
(
"1"
.
equals
(
resourceType
)){
ownType
=
0
;
}
if
(
"2"
.
equals
(
resourceType
)){
ownType
=
1
;
}
}
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
storeSearchDTO
.
setStoreGroupIds
(
StringUtils
.
isBlank
(
storeSearchQo
.
getStoreGroupIds
())
?
null
:
storeSearchQo
.
getStoreGroupIds
().
replaceAll
(
","
,
" "
));
storeSearchDTO
.
setRegionIds
(
StringUtils
.
isBlank
(
storeSearchQo
.
getRegion
())
?
null
:
storeSearchQo
.
getRegion
().
replaceAll
(
","
,
" "
));
storeSearchDTO
.
setStoreTypes
(
StringUtils
.
isBlank
(
storeSearchQo
.
getStoreType
())
?
null
:
storeSearchQo
.
getStoreType
().
replaceAll
(
","
,
" "
));
storeSearchDTO
.
setStoreStatuss
(
StringUtils
.
isBlank
(
storeSearchQo
.
getStoreStatus
())
?
null
:
storeSearchQo
.
getStoreStatus
().
replaceAll
(
","
,
" "
));
storeSearchDTO
.
setRealStatuss
(
StringUtils
.
isBlank
(
storeSearchQo
.
getErpStatus
())
?
null
:
storeSearchQo
.
getErpStatus
().
replaceAll
(
","
,
" "
));
storeSearchDTO
.
setStoreTags
(
StringUtils
.
isBlank
(
storeSearchQo
.
getStoreTag
())
?
null
:
storeSearchQo
.
getStoreTag
().
replaceAll
(
","
,
" "
));
storeSearchDTO
.
setStoreBrandIds
(
StringUtils
.
isBlank
(
storeSearchQo
.
getStoreBrand
())
?
null
:
storeSearchQo
.
getStoreBrand
().
replaceAll
(
","
,
" "
));
String
resourceType
=
storeSearchQo
.
getResourceType
();
Integer
ownType
=
null
;
if
(
StringUtils
.
isNotBlank
(
resourceType
)){
if
(
"1"
.
equals
(
resourceType
)){
ownType
=
0
;
}
if
(
storeSearchQo
.
getAttentionStore
()
==
1
){
List
<
AttentionStoreDTO
>
result
=
this
.
storeAttentionApiService
.
pageStoreAttention
(
userId
,
enterpriseId
,
1
,
Integer
.
MAX_VALUE
).
getResult
().
getResult
();
List
<
Integer
>
list
=
result
.
stream
().
filter
(
t
->
{
if
(
t
.
getStoreId
()
!=
null
){
if
(
"2"
.
equals
(
resourceType
)){
ownType
=
1
;
}
}
if
(
storeSearchQo
.
getAttentionStore
()
==
1
){
List
<
AttentionStoreDTO
>
result
=
this
.
storeAttentionApiService
.
pageStoreAttention
(
userId
,
enterpriseId
,
1
,
Integer
.
MAX_VALUE
).
getResult
().
getResult
();
List
<
Integer
>
list
=
result
.
stream
().
filter
(
t
->
{
if
(
t
.
getStoreId
()
!=
null
){
return
true
;
}
else
{
return
false
;
}
}).
map
(
dto
->
dto
.
getStoreId
()).
collect
(
Collectors
.
toList
());
String
storeInfoIds
=
StringUtils
.
join
(
list
,
" "
);
storeSearchDTO
.
setStoreInfoIds
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getStoreInfoIds
())
?
storeSearchDTO
.
getStoreInfoIds
()+
" "
+
storeInfoIds
:
storeInfoIds
);
}
ServiceResponse
<
Page
<
StoreDTO
>>
pageServiceResponse
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
1
,
20000
);
if
(
pageServiceResponse
.
isSuccess
()
&&
pageServiceResponse
.
getResult
()
!=
null
&&
CollectionUtils
.
isNotEmpty
(
pageServiceResponse
.
getResult
().
getResult
())){
List
<
StoreDTO
>
storeDTOList
=
pageServiceResponse
.
getResult
().
getResult
();
Integer
finalOwnType
=
ownType
;
List
<
Integer
>
storeInfoIdList
=
storeDTOList
.
stream
().
filter
(
storeDTO
->
{
if
(
finalOwnType
!=
null
){
//按资源类型进行过滤
if
(
storeDTO
.
getOwnType
().
equals
(
finalOwnType
)){
return
true
;
}
else
{
return
false
;
return
false
;
}
}).
map
(
dto
->
dto
.
getStoreId
()).
collect
(
Collectors
.
toList
());
String
storeInfoIds
=
StringUtils
.
join
(
list
,
" "
);
storeSearchDTO
.
setStoreInfoIds
(
StringUtils
.
isNotBlank
(
storeSearchDTO
.
getStoreInfoIds
())
?
storeSearchDTO
.
getStoreInfoIds
()+
" "
+
storeInfoIds
:
storeInfoIds
);
}
ServiceResponse
<
Page
<
StoreDTO
>>
pageServiceResponse
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
1
,
20000
);
if
(
pageServiceResponse
.
isSuccess
()
&&
pageServiceResponse
.
getResult
()
!=
null
&&
CollectionUtils
.
isNotEmpty
(
pageServiceResponse
.
getResult
().
getResult
())){
List
<
StoreDTO
>
storeDTOList
=
pageServiceResponse
.
getResult
().
getResult
();
Integer
finalOwnType
=
ownType
;
List
<
Integer
>
storeInfoIdList
=
storeDTOList
.
stream
().
filter
(
storeDTO
->
{
if
(
finalOwnType
!=
null
){
//按资源类型进行过滤
if
(
storeDTO
.
getOwnType
().
equals
(
finalOwnType
)){
}
return
true
;
}).
map
(
storeDTO
->
storeDTO
.
getStoreInfoId
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
storeAuth
.
getStoreInfoIdList
())){
resultList
=
storeInfoIdList
.
stream
().
filter
(
s
->
{
for
(
Integer
storeInfoId
:
storeAuth
.
getStoreInfoIdList
())
{
//按权限门店进行过滤
if
(
s
!=
null
&&
s
.
intValue
()
==
storeInfoId
.
intValue
())
{
return
true
;
}
else
{
return
false
;
}
}
return
true
;
}).
map
(
storeDTO
->
storeDTO
.
getStoreInfoId
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
storeAuth
.
getStoreInfoIdList
())){
resultList
=
storeInfoIdList
.
stream
().
filter
(
s
->
{
for
(
Integer
storeInfoId
:
storeAuth
.
getStoreInfoIdList
())
{
//按权限门店进行过滤
if
(
s
!=
null
&&
s
.
intValue
()
==
storeInfoId
.
intValue
())
{
return
true
;
}
}
return
false
;
}).
collect
(
Collectors
.
toList
());
}
else
{
resultList
=
storeInfoIdList
;
}
return
false
;
}).
collect
(
Collectors
.
toList
());
}
else
{
resultList
=
storeInfoIdList
;
}
}
}
else
{
...
...
@@ -207,7 +206,7 @@ public class StoreSearchUtils {
List
<
String
>
list
=
new
ArrayList
<>();
int
flag
=
dealSearchJson
(
searchJson
);
if
(
flag
==
1
){
list
.
add
(
"
0
"
);
list
.
add
(
"
noauth
"
);
return
list
;
}
OnLineAuth
onlineStoreAuth
=
this
.
dataAuthUtils
.
getOnlineStore
(
userId
,
enterpriseId
);
...
...
@@ -217,7 +216,7 @@ public class StoreSearchUtils {
this
.
getOnlineStoreIds
(
searchJson
,
onlineStoreAuth
,
list
,
StoreChannelEnum
.
WMMALL
.
getChannel
(),
userId
,
enterpriseId
);
this
.
getOnlineStoreIds
(
searchJson
,
onlineStoreAuth
,
list
,
StoreChannelEnum
.
TIANMAO
.
getChannel
(),
userId
,
enterpriseId
);
}
else
{
list
.
add
(
"
0
"
);
list
.
add
(
"
noauth
"
);
}
return
list
;
}
...
...
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