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
ff00c72f
Commit
ff00c72f
authored
Apr 29, 2022
by
maoying
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_station' of
http://39.98.45.134:8090/moa/amos-boot-biz
into develop_station
parents
65fad446
c290cdc0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
87 deletions
+68
-87
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+68
-66
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+0
-21
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
ff00c72f
...
...
@@ -21,16 +21,16 @@ import com.yeejoin.equipmanage.common.datasync.entity.FireFightingSystem;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO
;
import
com.yeejoin.equipmanage.common.entity.vo.*
;
import
com.yeejoin.equipmanage.common.enums.*
;
import
com.yeejoin.equipmanage.common.enums.AlarmStatusEnum
;
import
com.yeejoin.equipmanage.common.enums.EquipmentSpeIndexEnum
;
import
com.yeejoin.equipmanage.common.enums.SystemTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.TrueOrFalseEnum
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.common.vo.*
;
import
com.yeejoin.equipmanage.mapper.*
;
import
com.yeejoin.equipmanage.remote.RemoteSecurityService
;
import
com.yeejoin.equipmanage.service.*
;
import
com.yeejoin.equipmanage.utils.BeanUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -453,72 +453,74 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
//TODO id为空,为消防建筑使用;id不为空,为点位图使用
List
<
PointTreeVo
>
pointData
=
fireFightingSystemMapper
.
getPointData
(
id
);
if
(!
CollectionUtils
.
isEmpty
(
pointData
))
{
// List<Long> idList = pointData.stream().map(PointTreeVo::getSequenceNbr).collect(Collectors.toList());
// List<SpeIndexVo> indexVoList = fireFightingSystemMapper.getSpeIndexIn(idList);
// if (!CollectionUtils.isEmpty(indexVoList)) {
// Map<Long, List<SpeIndexVo>> indexMap = indexVoList.stream().collect(Collectors.groupingBy(SpeIndexVo::getEquipmentSpecificId));
// pointData.forEach(p -> {
// Map map = new HashMap(7);
// map.put("imgPath", p.getImgPath());
// map.put("equipCode", p.getEquipCode());
// map.put("equipSyetemId", p.getEquipSyetemId());
// map.put("equipTypeId", p.getEquipId());
// map.put("speindexList", makeStatus(indexMap.get(p.getSequenceNbr())));
// map.put("speindexApi", speindexUrl + p.getSequenceNbr());
// map.put("detailInfoApi", equipmentDetailUrl + p.getSequenceNbr());
// map.put("detailApi", equipmentDetailUrl + p.getSequenceNbr());
// p.setDataConfig(map);
// });
// }
}
// for (PointTreeVo tree : allRiskSource) {
// if (tree.getParentId() == null || tree.getParentId() == -1) {
// treeList.add(tree);
// }
// for (PointTreeVo treeNode : allRiskSource) {
// if (tree.getSequenceNbr().equals(treeNode.getParentId())) {
// if (tree.getChildren() == null) {
// tree.setChildren(new ArrayList<>());
// }
// tree.getChildren().add(treeNode);
// }
// }
// }
// 优化不查指标,
pointData
.
forEach
(
p
->
{
Map
map
=
new
HashMap
(
7
);
map
.
put
(
"imgPath"
,
p
.
getImgPath
());
map
.
put
(
"equipCode"
,
p
.
getEquipCode
());
map
.
put
(
"equipSyetemId"
,
p
.
getEquipSyetemId
());
map
.
put
(
"equipTypeId"
,
p
.
getEquipId
());
map
.
put
(
"speindexApi"
,
speindexUrl
+
p
.
getSequenceNbr
());
map
.
put
(
"detailInfoApi"
,
equipmentDetailUrl
+
p
.
getSequenceNbr
());
map
.
put
(
"detailApi"
,
equipmentDetailUrl
+
p
.
getSequenceNbr
());
p
.
setDataConfig
(
map
);
});
allRiskSource
.
addAll
(
pointData
);
// 树组装优化
Map
<
Long
,
PointTreeVo
>
map
=
new
HashMap
<>(
allRiskSource
.
size
());
allRiskSource
.
forEach
(
e
->
map
.
put
(
e
.
getSequenceNbr
(),
e
));
Set
<?
extends
Map
.
Entry
<
Long
,
?
extends
PointTreeVo
>>
entries
=
map
.
entrySet
();
List
<
PointTreeVo
>
treeList
=
new
ArrayList
<>();
entries
.
forEach
(
entry
->
{
PointTreeVo
value
=
entry
.
getValue
();
if
(
value
!=
null
)
{
PointTreeVo
treeDto
=
map
.
get
(
value
.
getParentId
());
if
(
treeDto
!=
null
)
{
List
<
PointTreeVo
>
children
=
treeDto
.
getChildren
();
if
(
children
==
null
)
{
children
=
new
ArrayList
<>();
treeDto
.
setChildren
(
children
);
// 查询所有wl_source_scene,判断是否绑定
List
<
SourceScene
>
sourceSceneList
=
sourceSceneMapper
.
selectList
(
null
);
Map
<
Long
,
String
>
sourceSceneMap
=
null
;
String
equipSpecificIds
=
null
;
if
(!
CollectionUtils
.
isEmpty
(
sourceSceneList
))
{
sourceSceneMap
=
sourceSceneList
.
stream
().
collect
(
Collectors
.
toMap
(
SourceScene:
:
getSourceId
,
SourceScene:
:
getPointInScene
));
List
<
String
>
equipSpecificIdList
=
sourceSceneList
.
stream
().
map
(
SourceScene:
:
getPointInScene
).
collect
(
Collectors
.
toList
());
equipSpecificIds
=
String
.
join
(
","
,
equipSpecificIdList
);
}
// 优化不查指标
for
(
PointTreeVo
p
:
pointData
)
{
Long
buildOrSysId
=
p
.
getParentId
();
Long
equipSpecificId
=
p
.
getSequenceNbr
();
Map
map
=
new
HashMap
(
7
);
map
.
put
(
"imgPath"
,
p
.
getImgPath
());
map
.
put
(
"equipCode"
,
p
.
getEquipCode
());
map
.
put
(
"equipSyetemId"
,
p
.
getEquipSyetemId
());
map
.
put
(
"equipTypeId"
,
p
.
getEquipId
());
map
.
put
(
"speindexApi"
,
speindexUrl
+
equipSpecificId
);
map
.
put
(
"detailInfoApi"
,
equipmentDetailUrl
+
p
.
getSequenceNbr
());
map
.
put
(
"detailApi"
,
equipmentDetailUrl
+
p
.
getSequenceNbr
());
p
.
setDataConfig
(
map
);
if
(
StringUtils
.
isEmpty
(
id
))
{
// 建筑
if
(
equipSpecificIds
.
contains
(
String
.
valueOf
(
equipSpecificId
)))
{
p
.
setBinding
(
true
);
}
else
{
p
.
setBinding
(
false
);
}
children
.
add
(
value
);
}
else
{
treeList
.
add
(
value
);
if
(
sourceSceneMap
!=
null
)
{
String
pointInScene
=
sourceSceneMap
.
get
(
buildOrSysId
);
if
(!
StringUtils
.
isEmpty
(
pointInScene
))
{
// 系统
if
(
pointInScene
.
contains
(
String
.
valueOf
(
equipSpecificId
)))
{
p
.
setBinding
(
true
);
}
else
{
p
.
setBinding
(
false
);
}
}
}
}
}
});
return
treeList
;
allRiskSource
.
addAll
(
pointData
);
// 树组装优化
Map
<
Long
,
PointTreeVo
>
map
=
new
HashMap
<>(
allRiskSource
.
size
());
allRiskSource
.
forEach
(
e
->
map
.
put
(
e
.
getSequenceNbr
(),
e
));
Set
<?
extends
Map
.
Entry
<
Long
,
?
extends
PointTreeVo
>>
entries
=
map
.
entrySet
();
List
<
PointTreeVo
>
treeList
=
new
ArrayList
<>();
entries
.
forEach
(
entry
->
{
PointTreeVo
value
=
entry
.
getValue
();
if
(
value
!=
null
)
{
PointTreeVo
treeDto
=
map
.
get
(
value
.
getParentId
());
if
(
treeDto
!=
null
)
{
List
<
PointTreeVo
>
children
=
treeDto
.
getChildren
();
if
(
children
==
null
)
{
children
=
new
ArrayList
<>();
treeDto
.
setChildren
(
children
);
}
children
.
add
(
value
);
}
else
{
treeList
.
add
(
value
);
}
}
});
return
treeList
;
}
return
Collections
.
emptyList
();
}
/**
...
...
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
ff00c72f
...
...
@@ -178,18 +178,6 @@
select
'component' as template,
true as openStatus,
<if
test=
"id == null"
>
if((select count(1) from `wl_source_scene` ss where
-- find_in_set(spe.id, ss.point_in_scene)
spe.id in (ss.point_in_scene)
and EXISTS
(SELECT es.instance_id FROM `wl_form_instance` es WHERE ss.source_id = es.instance_id)) = 0,0,1) as
isBinding, -- 一个装备只能在一个建筑使用
</if>
<if
test=
"id != null and id !=''"
>
if((SELECT count(1) FROM `wl_source_scene` ss where ss.source_id = #{id} and
FIND_IN_SET(spe.id,ss.point_in_scene)) = 0,0,1) as isBinding,-- 一个装备可在多个系统使用
</if>
if(spe.code is null,eqdet.name,concat(eqdet.name,'(',spe.code,')')) as displayName,
'{\"width\": 42, \"height\": 42}'as initStyle,
'CommonEquip' as componentName,
...
...
@@ -226,15 +214,6 @@
'component' AS template,
TRUE AS openStatus,
IF
(
( SELECT ss.id FROM wl_source_scene ss WHERE
-- ss.video_in_scene LIKE CONCAT( '%', vid.id, '%' )
vid.id in (ss.video_in_scene)
) IS NULL,
0,
1
) AS isBinding,
IF
( vid.CODE IS NULL, vid.NAME, concat( vid.NAME, '(', vid.CODE, ')' ) ) AS displayName,
'{\"width\": 42, \"height\": 42}' AS initStyle,
'CommonEquip' AS componentName,
...
...
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