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
bf2c1eb4
Commit
bf2c1eb4
authored
May 19, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店导出优化
parent
20073a1f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
2 deletions
+41
-2
StoreApiService.java
.../src/main/java/com/gic/store/service/StoreApiService.java
+12
-0
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+24
-0
StoreController.java
...in/java/com/gic/store/web/controller/StoreController.java
+5
-2
No files found.
gic-store-api/src/main/java/com/gic/store/service/StoreApiService.java
View file @
bf2c1eb4
...
...
@@ -83,6 +83,18 @@ public interface StoreApiService {
ServiceResponse
<
Map
<
Integer
,
List
<
String
>>>
listStorePhotoByStoreIds
(
Integer
enterpriseId
,
List
<
Integer
>
storeIdList
);
/**
* 按id查询门店图片 key:storeInfoIdList value:门店图片列表
* @Title: listStorePhotoByIds
* @Description:
* @author zhiwj
* @param enterpriseId
* @param storeInfoIdList
* @return com.gic.api.base.commons.ServiceResponse<java.util.Map<java.lang.Integer,java.util.List<java.lang.String>>>
* @throws
*/
ServiceResponse
<
Map
<
Integer
,
List
<
String
>>>
listStorePhotoByStoreInfoIds
(
Integer
enterpriseId
,
List
<
Integer
>
storeInfoIdList
);
/**
* @Title: getStoreById
* @Description: 查询门店详情
* @author zhiwj
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
bf2c1eb4
...
...
@@ -529,6 +529,30 @@ public class StoreApiServiceImpl implements StoreApiService {
}
@Override
public
ServiceResponse
<
Map
<
Integer
,
List
<
String
>>>
listStorePhotoByStoreInfoIds
(
Integer
enterpriseId
,
List
<
Integer
>
storeInfoIdList
)
{
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
storeSearchDTO
.
setStoreInfoIds
(
Joiner
.
on
(
" "
).
join
(
storeInfoIdList
));
ServiceResponse
<
Page
<
StoreDTO
>>
serviceResponse
=
this
.
listStore
(
storeSearchDTO
,
1
,
20
);
if
(!
serviceResponse
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
Map
<
Integer
,
List
<
String
>>
resultMap
=
new
HashMap
<>(
16
);
List
<
StoreDTO
>
storeDTOList
=
serviceResponse
.
getResult
().
getResult
();
for
(
StoreDTO
storeDTO
:
storeDTOList
)
{
List
<
StorePhotoDTO
>
photoList
=
storeDTO
.
getPhotoList
();
List
<
String
>
list
=
Optional
.
ofNullable
(
photoList
).
orElse
(
Collections
.
emptyList
()).
stream
().
map
(
StorePhotoDTO:
:
getImageUrl
).
collect
(
Collectors
.
toList
());
// 给一个门店图片默认值测试
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
list
=
Arrays
.
asList
(
Constants
.
DEFAULT_PHOTO
);
}
resultMap
.
put
(
storeDTO
.
getStoreInfoId
(),
list
);
}
return
EnterpriseServiceResponse
.
success
(
resultMap
);
}
@Override
public
ServiceResponse
queryStoreFromES
(
JSONObject
jsonObject
,
Integer
pageNum
,
Integer
pageSize
,
JSONObject
sortJson
,
String
returnFileds
)
{
if
(
StringUtils
.
isBlank
(
returnFileds
))
{
returnFileds
=
StoreESFieldsEnum
.
STOREID
.
getField
();
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreController.java
View file @
bf2c1eb4
...
...
@@ -328,8 +328,11 @@ public class StoreController extends DownloadUtils {
// 如果是批量修改状态 要转移门店
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setStoreIds
(
storeIds
.
replace
(
','
,
' '
));
List
<
String
>
list
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
1
,
1000
,
"storeInfoId"
).
getResult
().
getResult
()
.
stream
().
map
(
e
->
e
.
getStoreInfoId
().
toString
()).
collect
(
Collectors
.
toList
());
Page
<
StoreDTO
>
page
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
1
,
1000
,
"storeInfoId"
).
getResult
();
if
(
page
==
null
||
page
.
getResult
()
==
null
)
{
return
EnterpriseRestResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
}
List
<
String
>
list
=
page
.
getResult
().
stream
().
map
(
e
->
e
.
getStoreInfoId
().
toString
()).
collect
(
Collectors
.
toList
());
Integer
storeInfoId
=
storeApiService
.
getStoreById
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
toStoreId
).
getResult
().
getStoreInfoId
();
StoreBatchUpdateDTO
storeBatchUpdateDTO
=
new
StoreBatchUpdateDTO
();
storeBatchUpdateDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
...
...
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