Commit 96f5032c authored by litengwei's avatar litengwei

bug 提交

parent ad0a8b93
......@@ -79,4 +79,10 @@ public class ImportantEquipmentVO {
* 图片
*/
List<PreplanPictureVO> images;
/**
* type
*/
private String type;
}
......@@ -74,4 +74,7 @@ public class BuildingTreeVo {
@ApiModelProperty("机构名称")
private String bizOrgName;
@ApiModelProperty("类型")
private String type;
}
......@@ -152,8 +152,10 @@ public class BuildingController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑树")
@GetMapping(value = "/BuildingtreeAndEquip")
public List<BuildingTreeAndEquipVO> gettreeAndEquip() {
return buildService.gettreeAndEquip();
public List<BuildingTreeVo> gettreeAndEquip() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
return buildService.gettreeAndEquip(bizOrgCode);
}
@GetMapping(value = "/scenesList")
......
......@@ -89,6 +89,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List findAllParents();
List<ImportantEquipmentVO> getEquipment();
List findAllMenuChildren();
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> {
* 建筑和装备树
* @return
*/
List<BuildingTreeAndEquipVO> gettreeAndEquip();
List<BuildingTreeVo> gettreeAndEquip(String bizOrgCode);
Map<String ,Object> getBuildDetaliByFloorId( String instanceId);
......
......@@ -619,6 +619,27 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
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
public List<PointTreeVo> getBuildTree(String bizOrgCode,String instanceId) {
List<PointTreeVo> responses = this.baseMapper.getBuildList(bizOrgCode,instanceId);
......@@ -1174,8 +1195,18 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
}
@Override
public List<BuildingTreeAndEquipVO> gettreeAndEquip() {
return this.baseMapper.getBuildingtreeAndEquip();
public List<BuildingTreeVo> gettreeAndEquip(String bizOrgCode) {
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
......
......@@ -2335,4 +2335,14 @@
</if>
</where>
</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>
\ 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