Commit 96f5032c authored by litengwei's avatar litengwei

bug 提交

parent ad0a8b93
...@@ -79,4 +79,10 @@ public class ImportantEquipmentVO { ...@@ -79,4 +79,10 @@ public class ImportantEquipmentVO {
* 图片 * 图片
*/ */
List<PreplanPictureVO> images; List<PreplanPictureVO> images;
/**
* type
*/
private String type;
} }
...@@ -74,4 +74,7 @@ public class BuildingTreeVo { ...@@ -74,4 +74,7 @@ public class BuildingTreeVo {
@ApiModelProperty("机构名称") @ApiModelProperty("机构名称")
private String bizOrgName; private String bizOrgName;
@ApiModelProperty("类型")
private String type;
} }
...@@ -152,8 +152,10 @@ public class BuildingController extends AbstractBaseController { ...@@ -152,8 +152,10 @@ public class BuildingController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑树") @ApiOperation("消防建筑树")
@GetMapping(value = "/BuildingtreeAndEquip") @GetMapping(value = "/BuildingtreeAndEquip")
public List<BuildingTreeAndEquipVO> gettreeAndEquip() { public List<BuildingTreeVo> gettreeAndEquip() {
return buildService.gettreeAndEquip(); ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
return buildService.gettreeAndEquip(bizOrgCode);
} }
@GetMapping(value = "/scenesList") @GetMapping(value = "/scenesList")
......
...@@ -89,6 +89,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -89,6 +89,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List findAllParents(); List findAllParents();
List<ImportantEquipmentVO> getEquipment();
List findAllMenuChildren(); List findAllMenuChildren();
Long getEquipBySourceIdBycount(@Param("sourceId") String sourceId, @Param("categoryId") String categoryId, @Param("equipCode") String equipCode, @Param("equipName") String equipName); Long getEquipBySourceIdBycount(@Param("sourceId") String sourceId, @Param("categoryId") String categoryId, @Param("equipCode") String equipCode, @Param("equipName") String equipName);
......
...@@ -278,7 +278,7 @@ public interface IBuilldService extends IService<Building> { ...@@ -278,7 +278,7 @@ public interface IBuilldService extends IService<Building> {
* 建筑和装备树 * 建筑和装备树
* @return * @return
*/ */
List<BuildingTreeAndEquipVO> gettreeAndEquip(); List<BuildingTreeVo> gettreeAndEquip(String bizOrgCode);
Map<String ,Object> getBuildDetaliByFloorId( String instanceId); Map<String ,Object> getBuildDetaliByFloorId( String instanceId);
......
...@@ -619,6 +619,27 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -619,6 +619,27 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
return children; return children;
} }
private List<BuildingTreeVo> getChildrenNew(Long parentId, List<BuildingTreeVo> allListVo, List<ImportantEquipmentVO> listEqu) {
List<BuildingTreeVo> children = new ArrayList<>();
allListVo.stream().filter(a -> !ObjectUtils.isEmpty(a.getParentId()) && a.getParentId().equals(String.valueOf(parentId))).forEach(s -> {
s.setChildren(this.getChildrenNew(s.getInstanceId(), allListVo, listEqu));
s.setType("building");
children.add(s);
for (ImportantEquipmentVO v :listEqu
) {
if(v.getRiskSource().equals(s.getInstanceId().toString())) {
BuildingTreeVo buildTree = new BuildingTreeVo();
buildTree.setId(v.getId());
buildTree.setName(v.getName());
buildTree.setParentId(s.getParentId());
buildTree.setType("equipment");
children.add(buildTree);
}
}
});
return children;
}
@Override @Override
public List<PointTreeVo> getBuildTree(String bizOrgCode,String instanceId) { public List<PointTreeVo> getBuildTree(String bizOrgCode,String instanceId) {
List<PointTreeVo> responses = this.baseMapper.getBuildList(bizOrgCode,instanceId); List<PointTreeVo> responses = this.baseMapper.getBuildList(bizOrgCode,instanceId);
...@@ -1174,8 +1195,18 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1174,8 +1195,18 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
} }
@Override @Override
public List<BuildingTreeAndEquipVO> gettreeAndEquip() { public List<BuildingTreeVo> gettreeAndEquip(String bizOrgCode) {
return this.baseMapper.getBuildingtreeAndEquip(); List<ImportantEquipmentVO> equipment = equipmentSpecificMapper.getEquipment();
List<BuildingTreeVo> allListVo = getBuildingTreeVos(true, bizOrgCode);
allListVo.stream().filter(s -> "-1".equals(s.getParentId())).map(s -> {
BuildingTreeVo t = new BuildingTreeVo();
Bean.copyExistPropertis(s, t);
t.setChildren(this.getChildrenNew(t.getInstanceId(), allListVo, equipment));
t.setType("building");
return t;
}).collect(Collectors.toList());
return allListVo;
} }
@Override @Override
......
...@@ -2335,4 +2335,14 @@ ...@@ -2335,4 +2335,14 @@
</if> </if>
</where> </where>
</select> </select>
<select id="getEquipment" resultType="com.yeejoin.equipmanage.common.entity.vo.ImportantEquipmentVO">
SELECT
a.id,
a.`name`,
a.`status`,
a.risk_source_id AS riskSource,
'equipment' AS type
FROM
`f_equipment` a
</select>
</mapper> </mapper>
\ No newline at end of file
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