Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
9a78b109
Commit
9a78b109
authored
Nov 19, 2024
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
换流站树按照类型调顺序,特高压站在前面
parent
de7b2493
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
1 deletion
+52
-1
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+52
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
View file @
9a78b109
...
...
@@ -56,6 +56,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.annotation.Resource
;
...
...
@@ -3013,7 +3014,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
PermissionInterceptorContext
.
setDataAuthRule
(
authKey
);
param
.
put
(
"bizOrgCode"
,
bizOrgCode
);
List
<
OrgUsr
>
list
=
orgUsrMapper
.
companyListWithPersonCount
(
param
);
return
buildTreeParallel2
(
list
);
List
<
OrgMenuDto
>
orgMenuDtos
=
buildTreeParallel2
(
list
);
// 重新排序: 特高压换流站 -> 常规换流站
List
<
Map
<
String
,
Object
>>
onlineStations
=
stationInfoMapper
.
selectStationInfoList
();
return
this
.
reOrder
(
orgMenuDtos
,
onlineStations
);
}
public
List
<
OrgMenuDto
>
companyTreeByUserNumberNew
(
ReginParams
reginParams
)
{
...
...
@@ -3939,4 +3944,49 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
.
eq
(
OrgUsr:
:
getIsDelete
,
false
)
);
}
private
List
<
OrgMenuDto
>
reOrder
(
List
<
OrgMenuDto
>
orgMenus
,
List
<
Map
<
String
,
Object
>>
onlineStations
)
{
for
(
OrgMenuDto
orgMenu
:
orgMenus
)
{
if
(
orgMenu
.
getBizOrgCode
().
length
()
<
12
)
{
this
.
reOrder
(
orgMenu
.
getChildren
(),
onlineStations
);
}
else
{
if
(
Objects
.
nonNull
(
orgMenu
.
getChildren
()))
{
List
<
OrgMenuDto
>
children
=
this
.
doReOrder
(
orgMenu
.
getChildren
(),
onlineStations
);
orgMenu
.
setChildren
(
children
);
}
}
}
return
orgMenus
;
}
/**
* 场站排序: 特高压换流站 -> 常规换流站
*/
private
List
<
OrgMenuDto
>
doReOrder
(
List
<
OrgMenuDto
>
orgMenus
,
List
<
Map
<
String
,
Object
>>
onlineStations
)
{
List
<
OrgMenuDto
>
orderedOrgMenus
=
new
ArrayList
<>(
orgMenus
.
size
());
onlineStations
=
onlineStations
.
stream
().
filter
(
map
->
orgMenus
.
stream
().
anyMatch
(
orgMenu
->
orgMenu
.
getBizOrgCode
().
equals
(
map
.
get
(
"biz_org_code"
)))).
collect
(
Collectors
.
toList
());
List
<
String
>
tgyStationOrgCodes
=
new
ArrayList
<>(),
cgStationOrgCodes
=
new
ArrayList
<>();
for
(
Map
<
String
,
Object
>
onlineStation
:
onlineStations
)
{
Object
bizOrgCode
=
onlineStation
.
get
(
"biz_org_code"
);
if
(
Objects
.
isNull
(
bizOrgCode
))
{
throw
new
BadRequest
(
"场站信息配置错误!!!"
);
}
if
(
"特高压"
.
equals
(
onlineStation
.
get
(
"station_type"
)))
{
tgyStationOrgCodes
.
add
(
bizOrgCode
.
toString
());
}
else
{
cgStationOrgCodes
.
add
(
bizOrgCode
.
toString
());
}
}
for
(
OrgMenuDto
orgMenu
:
orgMenus
)
{
if
(
tgyStationOrgCodes
.
contains
(
orgMenu
.
getBizOrgCode
()))
{
orderedOrgMenus
.
add
(
orgMenu
);
}
}
for
(
OrgMenuDto
orgMenu
:
orgMenus
)
{
if
(
cgStationOrgCodes
.
contains
(
orgMenu
.
getBizOrgCode
()))
{
orderedOrgMenus
.
add
(
orgMenu
);
}
}
return
orderedOrgMenus
;
}
}
\ No newline at end of file
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