Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
825ab5ca
Commit
825ab5ca
authored
Mar 05, 2020
by
huangZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
05fcd82e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
22 deletions
+21
-22
StoreController.java
...com/gic/haoban/manage/web/controller/StoreController.java
+21
-22
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/StoreController.java
View file @
825ab5ca
...
...
@@ -58,37 +58,36 @@ public class StoreController extends WebBaseController{
if
(
StringUtils
.
isAnyBlank
(
staffId
,
wxEnterpriseId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
List
<
DepartmentDTO
>
list
=
departmentApiService
.
listStoreByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollectionUtil
.
isEmpty
(
list
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
//1、初始化Department表数据
List
<
StoreVO
>
resultList
=
new
ArrayList
<
StoreVO
>();
for
(
DepartmentDTO
dto
:
list
){
StoreVO
VO
=
new
StoreVO
();
VO
.
setDepartmentId
(
dto
.
getDepartmentId
());
VO
.
setStoreId
(
dto
.
getRelatedId
());
//为空,则无该值
VO
.
setStoreName
(
dto
.
getDepartmentName
());
VO
.
setWxEnterpriseId
(
dto
.
getWxEnterpriseId
());
VO
.
setStoreImg
(
""
);
//先置空
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
dto
.
getRelatedId
())){
StoreDTO
storeDTO
=
storeService
.
getStore
(
dto
.
getRelatedId
());
if
(
storeDTO
!=
null
){
VO
.
setEnterpriseId
(
storeDTO
.
getEnterpriseId
());
}
}
resultList
.
add
(
VO
);
}
//2、获取关联表数据
List
<
StaffDepartmentRelatedDTO
>
relateList
=
staffDepartmentRelatedApiService
.
listByStaffId
(
staffId
);
if
(
CollectionUtil
.
isNotEmpty
(
relateList
)){
List
<
String
>
departmentIds
=
relateList
.
stream
().
map
(
s
->
s
.
getDepartmentId
()).
collect
(
Collectors
.
toList
());
List
<
DepartmentDTO
>
departmentList
=
departmentApiService
.
listByDepartmentIds
(
departmentIds
,
1
);
//1、初始化Department表数据
for
(
DepartmentDTO
dto
:
departmentList
){
StoreVO
VO
=
new
StoreVO
();
VO
.
setDepartmentId
(
dto
.
getDepartmentId
());
VO
.
setStoreId
(
dto
.
getRelatedId
());
//为空,则无该值
VO
.
setStoreName
(
dto
.
getDepartmentName
());
VO
.
setWxEnterpriseId
(
dto
.
getWxEnterpriseId
());
VO
.
setStoreImg
(
""
);
//先置空
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
dto
.
getRelatedId
())){
StoreDTO
storeDTO
=
storeService
.
getStore
(
dto
.
getRelatedId
());
if
(
storeDTO
!=
null
){
VO
.
setEnterpriseId
(
storeDTO
.
getEnterpriseId
());
}
}
resultList
.
add
(
VO
);
}
Map
<
String
,
StaffDepartmentRelatedDTO
>
map
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
relateList
,
"departmentId"
);
for
(
StoreVO
VO
:
resultList
){
StaffDepartmentRelatedDTO
staffDepartmentRelatedDTO
=
map
.
get
(
VO
.
getDepartmentId
());
if
(
staffDepartmentRelatedDTO
!=
null
){
String
clerkCode
=
staffDepartmentRelatedDTO
.
getClerkCode
();
VO
.
setBindFlag
(
1
);
VO
.
setBindFlag
(
StringUtils
.
isEmpty
(
clerkCode
)?
0
:
1
);
VO
.
setClerkCode
(
clerkCode
);
VO
.
setStaffDepartmentRelatedId
(
staffDepartmentRelatedDTO
.
getStaffDepartmentRelatedId
());
VO
.
setStaffId
(
staffId
);
...
...
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