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
aaccb931
Commit
aaccb931
authored
Jul 12, 2022
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改维保设施树
parent
d221cc54
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
26 deletions
+27
-26
BaseTreeNode.java
...ejoin/equipmanage/common/entity/publics/BaseTreeNode.java
+18
-0
TreeNodeUtil.java
...va/com/yeejoin/equipmanage/common/utils/TreeNodeUtil.java
+5
-3
MaintenanceResourceServiceImpl.java
...ipmanage/service/impl/MaintenanceResourceServiceImpl.java
+2
-22
EquipmentSpecificMapper.xml
...uip/src/main/resources/mapper/EquipmentSpecificMapper.xml
+1
-1
MaintenanceResourceMapper.xml
...p/src/main/resources/mapper/MaintenanceResourceMapper.xml
+1
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/publics/BaseTreeNode.java
View file @
aaccb931
...
...
@@ -29,6 +29,12 @@ public class BaseTreeNode {
private
String
companyId
;
private
String
ownerUnitId
;
private
Integer
type
;
public
BaseTreeNode
()
{
}
...
...
@@ -52,7 +58,19 @@ public class BaseTreeNode {
public
void
setParentId
(
String
parentId
)
{
this
.
parentId
=
parentId
;
}
public
void
setOwnerUnitId
(
String
ownerUnitId
)
{
this
.
ownerUnitId
=
ownerUnitId
;
}
public
String
getOwnerUnitId
()
{
return
ownerUnitId
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
public
Integer
getType
()
{
return
type
;
}
public
List
<
BaseTreeNode
>
getChildren
()
{
if
(
this
.
children
==
null
)
{
return
Lists
.
newArrayList
();
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/utils/TreeNodeUtil.java
View file @
aaccb931
...
...
@@ -313,6 +313,7 @@ public class TreeNodeUtil {
// 循环处理子节点数据
for
(
T
t
:
newTreeNodes
)
{
//递归
listNodes
.
removeAll
(
collect
);
assembleTree2
(
t
,
listNodes
);
}
return
newTreeNodes
;
...
...
@@ -328,7 +329,7 @@ public class TreeNodeUtil {
if
(!
CollectionUtils
.
isEmpty
(
node
.
getChildren
()))
{
for
(
Object
t
:
node
.
getChildren
())
{
//递归
//listNodes.remove(t
);
listNodes
.
removeAll
(
node
.
getChildren
()
);
assembleTreeSon
((
T
)
t
,
listNodes
);
}
}
...
...
@@ -339,17 +340,18 @@ public class TreeNodeUtil {
if
(
node
!=
null
&&
!
CollectionUtils
.
isEmpty
(
listNodes
))
{
// 循环节点数据,如果是子节点则添加起来
listNodes
.
stream
().
filter
(
t
->
t
.
getParentId
().
equals
(
node
.
getId
())
&&
t
.
getCompanyId
().
equals
(
node
.
getCompanyId
()
==
null
?
node
.
getParentId
():
node
.
getCompanyId
()
)
).
forEachOrdered
(
node:
:
addChild
);
listNodes
.
stream
().
filter
(
t
->
t
.
getOwnerUnitId
()!=
null
&&
t
.
getOwnerUnitId
().
equals
(
node
.
getOwnerUnitId
()==
null
?
node
.
getId
():
node
.
getOwnerUnitId
())&&
t
.
getParentId
().
equals
(
node
.
getId
())
&&
t
.
getCompanyId
().
equals
(
node
.
getCompanyId
()
==
null
?
node
.
getParentId
():
node
.
getCompanyId
()
)
).
forEachOrdered
(
node:
:
addChild
);
// 循环处理子节点数据,递归
if
(!
CollectionUtils
.
isEmpty
(
node
.
getChildren
()))
{
for
(
Object
t
:
node
.
getChildren
())
{
//递归
//listNodes.remove(t
);
listNodes
.
removeAll
(
node
.
getChildren
()
);
assembleTreeSon
((
T
)
t
,
listNodes
);
}
}
}
}
static
<
T
extends
BaseTreeNode
>
void
assembleTree_1
(
T
node
,
List
<
T
>
listNodes
)
{
if
(
node
!=
null
&&
!
CollectionUtils
.
isEmpty
(
listNodes
))
{
// 循环节点数据,如果是子节点则添加起来
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MaintenanceResourceServiceImpl.java
View file @
aaccb931
...
...
@@ -128,6 +128,7 @@ public class MaintenanceResourceServiceImpl extends ServiceImpl<MaintenanceResou
List
<
MaintenanceResourceData
>
maintenanceResourceData
=
maintenanceResourceDataMapper
.
selectMaintenanceResourceDataListByclassifyId
();
//获取第三层分类节点
List
<
MaintenanceResourceDto
>
maintenanceResourceDtos
=
this
.
baseMapper
.
selectAllType
();
List
<
MaintenanceResourceDto
>
list
=
new
ArrayList
<>();
maintenanceResourceData
.
stream
().
forEach
(
e
->
{
MaintenanceResourceDto
e1
=
new
MaintenanceResourceDto
();
...
...
@@ -136,7 +137,7 @@ public class MaintenanceResourceServiceImpl extends ServiceImpl<MaintenanceResou
e1
.
setCompanyId
(
e
.
getMaintenanceCompanyId
().
toString
());
e1
.
setType
(
MaintenanceResourceEnum
.
CLASSIFY
.
getValue
());
e1
.
setParentId
(
e
.
getFireFightSysId
().
toString
());
e1
.
set
Code
(
e
.
getClassifyCode
());
e1
.
set
OwnerUnitId
(
e
.
getOwnerUnitId
().
toString
());
list
.
add
(
e1
);
});
// List<MaintenanceResourceDto> list = this.selectAll();
...
...
@@ -144,27 +145,6 @@ public class MaintenanceResourceServiceImpl extends ServiceImpl<MaintenanceResou
//获取维保单位和业主单位
List
<
MaintenanceResourceDto
>
companyTree
=
getCompanyList
(
appKey
,
product
,
token
);
if
(!
CollectionUtils
.
isEmpty
(
companyTree
))
{
/* List<MaintenanceResourceDto> result = new ArrayList<>();
result.addAll(list);
for (int i = 0; i < list.size(); i++) {
for (int j = 0; j < companyTree.size(); j++) {
if (list.get(i).getParentId().equals(companyTree.get(j).getParentId()) && list.get(i).getId().equals(companyTree.get(j).getId()) ){
result.remove(list.get(i));
}
}
}*/
/* result.addAll(companyTree);
result.forEach(e->{if (e.getContractId() == null){
e.setContractId(QRCodeUtil.generateQRCode());
}
});
List<MaintenanceResourceDto> dataList = new ArrayList<>();
Map<String, Optional<MaintenanceResourceDto>> collect = result.stream().collect(groupingBy(MaintenanceResourceDto::getContractId, minBy(Comparator.comparing(MaintenanceResourceDto::getParentId))));
collect.entrySet().forEach(entry -> {
entry.getValue().ifPresent(v -> {
dataList.add(v);
});
});*/
list
.
addAll
(
companyTree
);
list
.
addAll
(
maintenanceResourceDtos
);
//避免造成其他代码bug,替换新的组装树
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificMapper.xml
View file @
aaccb931
...
...
@@ -1238,7 +1238,7 @@
'其他' AS fireFightSysName,
'equip' AS fireFacilityType,
ws.source_id AS buildingId,
ws.
`name`
AS buildingName,
ws.
full_name
AS buildingName,
ed.area AS location
FROM
wl_equipment_specific es
...
...
amos-boot-system-equip/src/main/resources/mapper/MaintenanceResourceMapper.xml
View file @
aaccb931
...
...
@@ -132,6 +132,7 @@
fire_fight_sys_id AS id,
fire_fight_sys_name name ,
owner_unit_id as parentId,
owner_unit_id as ownerUnitId,
IFNULL(classify_type,3) as type
FROM
`mt_maintenance_resource_data`
...
...
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