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
05646667
Commit
05646667
authored
Apr 02, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询自定义字段添加门店域筛选查询
parent
1851bba5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
11 deletions
+25
-11
StoreFieldController.java
...va/com/gic/store/web/controller/StoreFieldController.java
+25
-11
No files found.
gic-store-web/src/main/java/com/gic/store/web/controller/StoreFieldController.java
View file @
05646667
package
com
.
gic
.
store
.
web
.
controller
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.gic.auth.constant.SignConstants
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -204,17 +203,32 @@ public class StoreFieldController {
}
@RequestMapping
(
"/list-store-field"
)
public
RestResponse
listStoreField
(
String
search
,
PageQO
pageQO
)
{
public
RestResponse
listStoreField
(
String
search
,
PageQO
pageQO
,
String
regionIds
)
{
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
ServiceResponse
<
Map
<
Integer
,
String
>>
storeFieldIdMapResult
=
storeFieldApiService
.
storeFieldIdMapRegionId
(
enterpriseId
);
Map
<
Integer
,
String
>
storeFieldIdMapRegionIds
=
new
HashMap
<>(
16
);
List
<
Integer
>
storeFieldIdList
=
new
ArrayList
<>();
new
HashMap
<>(
16
);
if
(
storeFieldIdMapResult
.
isSuccess
())
{
storeFieldIdMapRegionIds
=
storeFieldIdMapResult
.
getResult
();
for
(
Map
.
Entry
<
Integer
,
String
>
entry
:
storeFieldIdMapRegionIds
.
entrySet
())
{
storeFieldIdList
.
add
(
entry
.
getKey
());
}
Map
<
Integer
,
String
>
storeFieldIdMapRegionIds
=
storeFieldIdMapResult
.
getResult
();
List
<
Integer
>
storeFieldIdList
=
Optional
.
ofNullable
(
storeFieldIdMapRegionIds
).
orElse
(
new
HashMap
<>(
2
))
.
entrySet
()
.
stream
()
.
filter
(
e
->
{
Set
<
String
>
searchSet
=
new
HashSet
<>(
Arrays
.
asList
(
Optional
.
ofNullable
(
regionIds
).
orElse
(
""
).
split
(
SignConstants
.
COMMA
)));
searchSet
.
stream
()
.
filter
(
regionId
->
{
Set
<
String
>
valueSet
=
new
HashSet
<>(
Arrays
.
asList
(
e
.
getValue
().
split
(
SignConstants
.
UNDERLINE
)));
if
(
valueSet
.
contains
(
regionId
))
{
return
true
;
}
else
{
return
false
;
}
});
return
true
;
})
.
map
(
e
->
e
.
getKey
())
.
collect
(
Collectors
.
toList
());
ServiceResponse
<
Page
<
StoreFieldDTO
>>
result
=
storeFieldApiService
.
listStoreField
(
storeFieldIdList
,
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
search
,
pageQO
.
getCurrentPage
(),
...
...
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