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
25602f59
Commit
25602f59
authored
Mar 21, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
ac467c14
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
17 deletions
+24
-17
DepartmentContoller.java
...gic/haoban/manage/web/controller/DepartmentContoller.java
+24
-17
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/DepartmentContoller.java
View file @
25602f59
...
...
@@ -2,8 +2,10 @@ package com.gic.haoban.manage.web.controller;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -121,30 +123,35 @@ public class DepartmentContoller extends WebBaseController{
DepartmentDTO
dto
=
departmentApiService
.
getRootByEnterpriseId
(
wxEnterpriseId
);
list
.
add
(
dto
);
}
Set
<
String
>
enterpriseSet
=
new
HashSet
<>();
for
(
DepartmentDTO
departmentDTO
:
list
)
{
String
relatedId
=
departmentDTO
.
getRelatedId
();
if
(
StringUtils
.
isBlank
(
relatedId
)){
departmentDTO
.
setBindFlag
(
0
);
}
else
{
String
gicEnterpriseName
=
""
;
String
gicEnterpriseId
=
""
;
if
(
departmentDTO
.
getIsStore
()
==
1
){
StoreDTO
store
=
storeService
.
getStore
(
relatedId
);
if
(
store
!=
null
){
gicEnterpriseId
=
store
.
getEnterpriseId
();
}
}
else
{
StoreGroupDTO
department
=
storeGroupService
.
getStoreGroupById
(
relatedId
);
if
(
department
!=
null
){
gicEnterpriseId
=
department
.
getEnterpriseId
();
}
}
EnterpriseDTO
enterprise
=
enterpriseService
.
getEnterpriseById
(
gicEnterpriseId
);
String
gicEnterpriseId
=
departmentDTO
.
getEnterpriseId
();
enterpriseSet
.
add
(
gicEnterpriseId
);
departmentDTO
.
setBindFlag
(
1
);
}
departmentDTO
.
setHasSonNode
(
departmentApiService
.
hasSonNode
(
departmentDTO
.
getDepartmentId
()));
}
Map
<
String
,
EnterpriseDTO
>
enterpriseMap
=
new
HashMap
<>();
for
(
String
enterpriseId
:
enterpriseSet
)
{
EnterpriseDTO
enterprise
=
enterpriseService
.
getEnterpriseById
(
enterpriseId
);
if
(
enterprise
!=
null
){
enterpriseMap
.
put
(
enterpriseId
,
enterprise
);
}
}
for
(
DepartmentDTO
departmentDTO
:
list
)
{
String
enterpriseId
=
departmentDTO
.
getEnterpriseId
();
if
(
StringUtils
.
isNotBlank
(
enterpriseId
)){
EnterpriseDTO
enterprise
=
enterpriseMap
.
get
(
enterpriseId
);
if
(
enterprise
!=
null
){
gicEnterpriseName
=
enterprise
.
getEnterpriseName
(
);
departmentDTO
.
setGicEnterpriseName
(
enterprise
.
getEnterpriseName
()
);
}
departmentDTO
.
setGicEnterpriseName
(
gicEnterpriseName
);
departmentDTO
.
setBindFlag
(
1
);
}
departmentDTO
.
setHasSonNode
(
departmentApiService
.
hasSonNode
(
departmentDTO
.
getDepartmentId
()));
...
...
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