Commit ff00c72f authored by maoying's avatar maoying

Merge branch 'develop_station' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_station

parents 65fad446 c290cdc0
......@@ -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();
}
/**
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment