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
be9eb1e6
Commit
be9eb1e6
authored
May 19, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分组
parent
f5d58cba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
12 deletions
+27
-12
GicDepartmentController.java
...haoban/manage/web/controller/GicDepartmentController.java
+27
-12
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/GicDepartmentController.java
View file @
be9eb1e6
...
@@ -2,8 +2,10 @@ package com.gic.haoban.manage.web.controller;
...
@@ -2,8 +2,10 @@ package com.gic.haoban.manage.web.controller;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
...
@@ -26,11 +28,13 @@ import com.gic.enterprise.api.service.StoreGroupService;
...
@@ -26,11 +28,13 @@ import com.gic.enterprise.api.service.StoreGroupService;
import
com.gic.enterprise.api.service.StoreWidgetService
;
import
com.gic.enterprise.api.service.StoreWidgetService
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.StoreRangeInfoDTO
;
import
com.gic.haoban.manage.api.dto.StoreRangeInfoDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.HaobanStoreGroupVO
;
import
com.gic.haoban.manage.web.vo.StoreGroupVo
;
import
com.gic.haoban.manage.web.vo.StoreGroupVo
;
...
@@ -81,29 +85,40 @@ public class GicDepartmentController extends WebBaseController{
...
@@ -81,29 +85,40 @@ public class GicDepartmentController extends WebBaseController{
}
}
}
}
}
}
List
<
HaobanStoreGroupVO
>
retList
=
new
ArrayList
<>();
List
<
PowerStoreGroupDTO
>
departmentList
=
storeGroupService
.
getStoreGroupList
(
enterpriseId
,
keyWord
);
List
<
PowerStoreGroupDTO
>
departmentList
=
storeGroupService
.
getStoreGroupList
(
enterpriseId
,
keyWord
);
if
(
null
!=
list
)
{
if
(
null
!=
list
)
{
List
<
PowerStoreGroupDTO
>
retList
=
new
ArrayList
<>();
List
<
String
>
idList
=
list
.
stream
().
map
(
dto
->
dto
.
getId
()).
collect
(
Collectors
.
toList
())
;
List
<
String
>
idList
=
list
.
stream
().
map
(
dto
->
dto
.
getId
()).
collect
(
Collectors
.
toList
())
;
Set
<
String
>
otherList
=
new
HashSet
<>();
for
(
PowerStoreGroupDTO
item
:
departmentList
)
{
for
(
PowerStoreGroupDTO
item
:
departmentList
)
{
if
(
"0"
.
equals
(
item
.
getParentGroupId
()))
{
retList
.
add
(
item
)
;
continue
;
}
if
(
idList
.
contains
(
item
.
getStoreGroupId
()))
{
if
(
idList
.
contains
(
item
.
getStoreGroupId
()))
{
retList
.
add
(
item
)
;
HaobanStoreGroupVO
vo
=
EntityUtil
.
changeEntityByOrika
(
HaobanStoreGroupVO
.
class
,
item
)
;
}
else
{
vo
.
setHasRight
(
true
);
for
(
String
id
:
idList
)
{
retList
.
add
(
vo
)
;
if
(
item
.
getStoreGroupChain
().
contains
(
id
))
{
String
chain
=
item
.
getStoreGroupChain
()
;
retList
.
add
(
item
)
;
String
[]
arr
=
chain
.
split
(
"_"
)
;
break
;
for
(
int
i
=
0
;
i
<
arr
.
length
;
i
++)
{
String
s
=
arr
[
i
]
;
if
(
StringUtils
.
isNotBlank
(
s
)
&&
!
s
.
equals
(
item
.
getStoreGroupId
()))
{
otherList
.
add
(
s
)
;
}
}
}
}
}
}
}
}
for
(
PowerStoreGroupDTO
item
:
departmentList
)
{
if
(
otherList
.
contains
(
item
.
getStoreGroupId
()))
{
HaobanStoreGroupVO
vo
=
EntityUtil
.
changeEntityByOrika
(
HaobanStoreGroupVO
.
class
,
item
)
;
retList
.
add
(
vo
)
;
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
retList
)
;
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
retList
)
;
}
else
{
retList
=
EntityUtil
.
changeEntityListByOrika
(
HaobanStoreGroupVO
.
class
,
departmentList
)
;
retList
.
forEach
(
item
->{;
item
.
setHasRight
(
true
);
});
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
departmen
tList
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
re
tList
);
}
}
...
...
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