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
f87ef47f
Commit
f87ef47f
authored
Feb 10, 2022
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.新增消防建筑树接口
parent
829e7bcd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
4 deletions
+31
-4
BuildingController.java
...om/yeejoin/equipmanage/controller/BuildingController.java
+9
-0
IBuilldService.java
.../java/com/yeejoin/equipmanage/service/IBuilldService.java
+7
-0
BuildingServiceImpl.java
...yeejoin/equipmanage/service/impl/BuildingServiceImpl.java
+14
-3
WarehouseStructureServiceImpl.java
...uipmanage/service/impl/WarehouseStructureServiceImpl.java
+1
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/BuildingController.java
View file @
f87ef47f
...
...
@@ -4,6 +4,7 @@ import java.util.LinkedHashMap;
import
java.util.List
;
import
java.util.Map
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.MediaType
;
...
...
@@ -302,4 +303,12 @@ public class BuildingController extends AbstractBaseController {
return
buildService
.
getCompanyBuildingTree
(
null
);
}
@ApiOperation
(
value
=
"查询指定单位的建筑树"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{bizOrgCode}/tree"
)
public
List
<
BuildingTreeVo
>
buildingTree
(
@ApiParam
(
value
=
"单位编码"
)
@PathVariable
String
bizOrgCode
){
return
buildService
.
getBuildingTreeInOrgCode
(
bizOrgCode
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IBuilldService.java
View file @
f87ef47f
...
...
@@ -309,4 +309,11 @@ public interface IBuilldService extends IService<Building> {
* @return List<EquiplistSpecificBySystemVO>
*/
List
<
EquiplistSpecificBySystemVO
>
getPointInFloor
(
Long
floorId
);
/**
* 建筑树
* @param bizOrgCode 所在公司
* @return List<BuildingTreeVo>
*/
List
<
BuildingTreeVo
>
getBuildingTreeInOrgCode
(
String
bizOrgCode
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/BuildingServiceImpl.java
View file @
f87ef47f
...
...
@@ -450,6 +450,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
BuildingTreeVo
treeNode
=
new
BuildingTreeVo
();
treeNode
.
setDetailPaneApi
(
address
);
treeNode
.
setApiUrl
(
apiUrl
);
treeNode
.
setName
(
formGroup
.
getGroupName
());
treeNode
.
setInstanceId
(
formGroup
.
getId
());
treeNode
.
setInstanceName
(
formGroup
.
getGroupName
());
treeNode
.
setParentId
(
"-1"
);
...
...
@@ -1160,9 +1161,9 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
List
<
BuildingTreeVo
>
companyBuildingList
=
buildBuildingAndCompanyListVos
(
buildVideoAuthKey
);
List
<
Map
<
String
,
Long
>>
countList
=
iFormInstanceService
.
getBuildVideoCount
();
Map
<
Long
,
Long
>
countMap
=
countList
.
stream
().
collect
(
Collectors
.
toMap
(
p
->
p
.
get
(
"buildId"
),
p
->
p
.
get
(
"total"
)));
companyBuildingList
.
forEach
(
c
->
{
companyBuildingList
.
forEach
(
c
->
{
// 建筑类型数据,填充本级及子级包含的摄像头数量
if
(!
ALL_BUILDING
.
equals
(
c
.
getGroupType
()))
{
if
(!
ALL_BUILDING
.
equals
(
c
.
getGroupType
()))
{
c
.
setTotal
(
countMap
.
get
(
c
.
getInstanceId
())
==
null
?
0L
:
countMap
.
get
(
c
.
getInstanceId
()));
}
else
{
// 方法 复用,覆盖掉不需要的数据
...
...
@@ -1182,7 +1183,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
return
companyBuildingList
.
stream
().
filter
(
a
->
parentId
.
equals
(
a
.
getParentId
())).
peek
(
a
->
{
a
.
setChildren
(
getCompanyBuildingChildrenWithCount
(
a
.
getId
().
toString
(),
companyBuildingList
));
//单位类型节点才需要设置摄像头总数,建筑的下摄像头总数已经在sql计算出来
if
(
ALL_BUILDING
.
equals
(
a
.
getGroupType
()))
{
if
(
ALL_BUILDING
.
equals
(
a
.
getGroupType
()))
{
a
.
setTotal
(
a
.
getChildren
().
stream
().
filter
(
c
->
c
.
getTotal
()
!=
null
).
mapToLong
(
BuildingTreeVo:
:
getTotal
).
sum
());
}
}).
collect
(
Collectors
.
toList
());
...
...
@@ -1222,6 +1223,16 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
return
bySystemVOS
;
}
@Override
public
List
<
BuildingTreeVo
>
getBuildingTreeInOrgCode
(
String
bizOrgCode
)
{
List
<
BuildingTreeVo
>
buildingTreeVos
=
this
.
getBuildingTreeVos
(
true
);
List
<
BuildingTreeVo
>
orgBuildingTreeVos
=
buildingTreeVos
.
stream
().
filter
(
b
->
b
.
getBizOrgCode
()
!=
null
&&
b
.
getBizOrgCode
().
contains
(
bizOrgCode
)).
collect
(
Collectors
.
toList
());
return
buildingTreeVos
.
stream
().
filter
(
b
->
"-1"
.
equals
(
b
.
getParentId
())).
peek
(
b
->
{
b
.
setId
(
0L
);
b
.
setChildren
(
this
.
getCompanyBuildingChildrenTree
(
b
.
getId
().
toString
(),
orgBuildingTreeVos
));
}).
collect
(
Collectors
.
toList
());
}
private
List
<
BuildingTreeVo
>
getCompanyBuildingChildrenTree
(
String
parentId
,
List
<
BuildingTreeVo
>
all
)
{
return
all
.
stream
().
filter
(
a
->
parentId
.
equals
(
a
.
getParentId
())).
peek
(
a
->
{
a
.
setChildren
(
getCompanyBuildingChildrenTree
(
a
.
getId
().
toString
(),
all
));
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/WarehouseStructureServiceImpl.java
View file @
f87ef47f
...
...
@@ -122,7 +122,7 @@ public class WarehouseStructureServiceImpl extends ServiceImpl<WarehouseStructur
for
(
WarehouseStructure
it
:
treeNodes
)
{
if
(
treeNode
.
getId
().
equals
(
it
.
getParentId
()))
{
if
(
treeNode
.
getChildren
()
==
null
)
{
treeNode
.
setChildren
(
new
ArrayList
<
WarehouseStructure
>());
treeNode
.
setChildren
(
new
ArrayList
<>());
}
treeNode
.
getChildren
().
add
(
findChildren
(
it
,
treeNodes
));
}
...
...
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