Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-webapp-plug
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-webapp-plug
Commits
f2913d82
Commit
f2913d82
authored
Feb 01, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店域接口返回调整
parent
8f587d16
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
10 deletions
+24
-10
StoreController.java
...ain/java/com/gic/plug/web/controller/StoreController.java
+24
-8
StoreTagController.java
.../java/com/gic/plug/web/controller/StoreTagController.java
+0
-2
No files found.
src/main/java/com/gic/plug/web/controller/StoreController.java
View file @
f2913d82
...
@@ -3,7 +3,11 @@ package com.gic.plug.web.controller;
...
@@ -3,7 +3,11 @@ package com.gic.plug.web.controller;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
com.gic.api.base.commons.Page
;
import
com.gic.plug.web.vo.widget.StoreWidgetInterfaceVO
;
import
com.gic.store.dto.StoreDTO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -71,17 +75,18 @@ public class StoreController {
...
@@ -71,17 +75,18 @@ public class StoreController {
ServiceResponse
<
List
<
StoreRegionDTO
>>
serviceResponse
=
storeRegionApiService
.
listStoreRegion
(
enterpriseId
,
search
);
ServiceResponse
<
List
<
StoreRegionDTO
>>
serviceResponse
=
storeRegionApiService
.
listStoreRegion
(
enterpriseId
,
search
);
if
(
serviceResponse
.
isSuccess
())
{
if
(
serviceResponse
.
isSuccess
())
{
List
<
StoreRegionDTO
>
result
=
serviceResponse
.
getResult
();
List
<
StoreRegionDTO
>
result
=
serviceResponse
.
getResult
();
List
<
StoreRegionVO
>
regionList
=
new
ArrayList
<>();
List
<
StoreWidgetInterfaceVO
>
voList
=
new
ArrayList
<>();
for
(
StoreRegionDTO
storeRegionDTO
:
result
){
for
(
StoreRegionDTO
storeRegionDTO
:
result
){
if
(!
authRegionSet
.
isEmpty
())
{
if
(!
authRegionSet
.
isEmpty
())
{
if
(
authRegionSet
.
contains
(
storeRegionDTO
.
getRegionId
()+
""
)){
if
(
authRegionSet
.
contains
(
storeRegionDTO
.
getRegionId
()+
""
)){
regionList
.
add
(
EntityUtil
.
changeEntityByJSON
(
StoreRegionVO
.
class
,
storeRegionDTO
));
voList
.
add
(
new
StoreWidgetInterfaceVO
().
setLabel
(
storeRegionDTO
.
getRegionName
()).
setValue
(
storeRegionDTO
.
getRegionId
().
toString
()
));
}
}
}
else
{
}
else
{
regionList
.
add
(
EntityUtil
.
changeEntityByJSON
(
StoreRegionVO
.
class
,
storeRegionDTO
));
voList
.
add
(
new
StoreWidgetInterfaceVO
().
setLabel
(
storeRegionDTO
.
getRegionName
()).
setValue
(
storeRegionDTO
.
getRegionId
().
toString
()
));
}
}
}
}
return
RestResponse
.
success
(
region
List
);
return
RestResponse
.
success
(
vo
List
);
}
else
{
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
}
...
@@ -107,10 +112,21 @@ public class StoreController {
...
@@ -107,10 +112,21 @@ public class StoreController {
storeSearchDTO
.
setSearch
(
search
);
storeSearchDTO
.
setSearch
(
search
);
storeSearchDTO
.
setStoreResource
(
UserDetailUtils
.
getUserDetail
().
getStoreResourceId
());
storeSearchDTO
.
setStoreResource
(
UserDetailUtils
.
getUserDetail
().
getStoreResourceId
());
String
returnFields
=
StoreESFieldsEnum
.
STOREID
.
getField
()+
","
+
StoreESFieldsEnum
.
STORECODE
.
getField
()+
","
+
StoreESFieldsEnum
.
STORENAME
.
getField
();
String
returnFields
=
StoreESFieldsEnum
.
STOREID
.
getField
()+
","
+
StoreESFieldsEnum
.
STORECODE
.
getField
()+
","
+
StoreESFieldsEnum
.
STORENAME
.
getField
();
ServiceResponse
serviceResponse
=
storeApiService
.
listStore
(
storeSearchDTO
,
ServiceResponse
<
Page
<
StoreDTO
>>
serviceResponse
=
storeApiService
.
listStore
(
storeSearchDTO
,
1
,
100
,
returnFields
);
1
,
100
,
returnFields
);
if
(
serviceResponse
.
isSuccess
())
{
if
(
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
Page
<
StoreDTO
>
page
=
serviceResponse
.
getResult
();
List
<
StoreDTO
>
list
=
page
.
getResult
();
List
<
StoreWidgetInterfaceVO
>
voList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
voList
=
list
.
stream
()
.
map
(
e
->
new
StoreWidgetInterfaceVO
().
setLabel
(
e
.
getStoreName
()).
setValue
(
e
.
getStoreId
().
toString
()))
.
collect
(
Collectors
.
toList
());
}
}
return
RestResponse
.
success
(
voList
);
}
else
{
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
}
...
...
src/main/java/com/gic/plug/web/controller/StoreTagController.java
View file @
f2913d82
...
@@ -11,11 +11,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -11,11 +11,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.plug.web.utils.storeresourceauth.StoreResourceUtils
;
import
com.gic.plug.web.utils.storeresourceauth.StoreResourceUtils
;
import
com.gic.plug.web.vo.StoreTagVO
;
import
com.gic.store.constant.StoreESFieldsEnum
;
import
com.gic.store.constant.StoreESFieldsEnum
;
import
com.gic.store.dto.StoreTagDTO
;
import
com.gic.store.dto.StoreTagDTO
;
import
com.gic.store.service.StoreTagApiService
;
import
com.gic.store.service.StoreTagApiService
;
...
...
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