|
@@ -43,7 +43,7 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
private IBaseService baseService;
|
|
|
|
|
|
@Autowired
|
|
|
- private IEquipService equipService;
|
|
|
+ private ISpaceService spaceService;
|
|
|
|
|
|
/**
|
|
|
* 查询设备设施模块下的设备/阀门
|
|
@@ -79,17 +79,80 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public CommonResult queryHavcSystem(InstanceUrlParam context, CommonRequestDTO request) {
|
|
|
+ public CommonResult queryHavcSystem(InstanceUrlParam context, CommonRequestDTO request) throws Exception {
|
|
|
// 查询冷却塔设备类下的设备,制冷机房空间下的设备/阀门信息
|
|
|
+ List<JSONObject> result = new ArrayList<>();
|
|
|
|
|
|
//1.查询冷却塔设备类下的设备/阀门
|
|
|
List<DefineTypeRel> coolTowerDefineTypeRels = queryGldHavcTypeRel(CommonConsant.ACCCOT_BIMTYPEID,CommonConsant.WD_HAVC_SYSTEM_CODE);
|
|
|
List<JSONObject> coolTowerObjects = queryEquipObjectByInfoCode(context, coolTowerDefineTypeRels, request, CommonConsant.BIM_TYPE_ID);
|
|
|
+ if(CollUtil.isNotEmpty(coolTowerObjects)){
|
|
|
+ result.addAll(coolTowerObjects);
|
|
|
+ }
|
|
|
+
|
|
|
+ //2. 查询制冷机房空间下的所有空间
|
|
|
+ QueryCriteria queryCriteria = new QueryCriteria();
|
|
|
+ ObjectNode objectNode = JsonNodeFactory.instance.objectNode();
|
|
|
+ objectNode.put(CommonConsant.BIM_TYPE_ID,CommonConsant.ACCCOT_SPACE_BIMTYPEID);
|
|
|
+ queryCriteria.setCriteria(objectNode);
|
|
|
+ CommonResult commonResult = baseService.doQuery(context, queryCriteria, JSONObject.class);
|
|
|
+ List<JSONObject> spaceList = (List<JSONObject>) commonResult.getContent();
|
|
|
+
|
|
|
+ if(CollUtil.isEmpty(spaceList)){
|
|
|
+ return CommonResult.success(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ //3.查询空间下的设备/阀门
|
|
|
+ Set<String> spaceIds = spaceList.stream().map(k->k.getString("id")).collect(Collectors.toSet());
|
|
|
+ request.setSpaceIds(spaceIds);
|
|
|
+ List<JSONObject> content = spaceService.queryEquipInSpace(context, request, CommonConsant.ACCCOT_SPACE_BIMTYPEID);
|
|
|
+ if(CollUtil.isNotEmpty(content)){
|
|
|
+ result.addAll(content);
|
|
|
+ }
|
|
|
+
|
|
|
+ return CommonResult.success(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设备设施-暖通系统-分集水器原理图查询
|
|
|
+ * @param context
|
|
|
+ * @param request
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public CommonResult querysubCatchment(InstanceUrlParam context, CommonRequestDTO request) throws Exception {
|
|
|
+ // 查询分水器/集水器下的对象信息
|
|
|
+ List<JSONObject> result = new ArrayList<>();
|
|
|
+
|
|
|
+ //1.查询分水器
|
|
|
+ List<DefineTypeRel> divideDefineTypeRels = queryGldHavcTypeRel(CommonConsant.DIVIDE_BREECH_BIMTYPEID,CommonConsant.WD_HAVC_SYSTEM_CODE);
|
|
|
+ List<JSONObject> divideBreechObjects = queryEquipObjectByInfoCode(context, divideDefineTypeRels, request, CommonConsant.BIM_TYPE_ID);
|
|
|
+ if(CollUtil.isNotEmpty(divideBreechObjects)){
|
|
|
+ result.addAll(divideBreechObjects);
|
|
|
+ }
|
|
|
+ //2. 查询集水器
|
|
|
+ List<DefineTypeRel> collectDefineTypeRels = queryGldHavcTypeRel(CommonConsant.COLLECT_BREECH_BIMTYPEID,CommonConsant.WD_HAVC_SYSTEM_CODE);
|
|
|
+ List<JSONObject> collectBreechObjects = queryEquipObjectByInfoCode(context, collectDefineTypeRels, request, CommonConsant.BIM_TYPE_ID);
|
|
|
+ if(CollUtil.isNotEmpty(collectBreechObjects)){
|
|
|
+ result.addAll(collectBreechObjects);
|
|
|
+ }
|
|
|
+ return CommonResult.success(result);
|
|
|
+ }
|
|
|
|
|
|
- //2.查询制冷机房空间下的设备/阀门
|
|
|
+ /**
|
|
|
+ * 统计防火分区数量
|
|
|
+ * @param context
|
|
|
+ * @param request
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public CommonResult countFireZone(InstanceUrlParam context, CommonRequestDTO request) throws Exception {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 获取系统下的设备
|
|
|
* @param context
|
|
@@ -97,17 +160,18 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
*/
|
|
|
private List<JSONObject> querySystemEquipList(InstanceUrlParam context, CommonRequestDTO request){
|
|
|
//查询广联达设备类型
|
|
|
- List<DefineTypeRel> defineTypeRels = equipService.queryGldEquipTypeRel();
|
|
|
+ List<DefineTypeRel> defineTypeRels = queryGldEquipTypeRel();
|
|
|
//根据系统过滤
|
|
|
if(StringUtils.isNotEmpty(request.getSystemCode())){
|
|
|
String systemCode = request.getSystemCode();
|
|
|
defineTypeRels = defineTypeRels.stream().filter(k->!systemCode.equals(k.getWdSystemCode())).collect(Collectors.toList());
|
|
|
}
|
|
|
//根据广联达设备类型查询设备信息
|
|
|
- List<JSONObject> equipList = equipService.queryEquipByGldTypeRel(context, defineTypeRels, request);
|
|
|
+ List<JSONObject> equipList = queryEquipByGldTypeRel(context, defineTypeRels, request);
|
|
|
return equipList;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 获取系统下的阀门
|
|
|
* @param context
|
|
@@ -115,17 +179,18 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
*/
|
|
|
private List<JSONObject> querySystemMateriaList(InstanceUrlParam context, CommonRequestDTO request){
|
|
|
//查询广联达设备类型
|
|
|
- List<DefineTypeRel> defineTypeRels = equipService.queryGldMateriaTypeRel();
|
|
|
+ List<DefineTypeRel> defineTypeRels = queryGldMateriaTypeRel();
|
|
|
//根据系统过滤
|
|
|
if(StringUtils.isNotEmpty(request.getSystemCode())){
|
|
|
String systemCode = request.getSystemCode();
|
|
|
defineTypeRels = defineTypeRels.stream().filter(k->!systemCode.equals(k.getWdSystemCode())).collect(Collectors.toList());
|
|
|
}
|
|
|
//根据广联达设备类型查询设备信息
|
|
|
- List<JSONObject> equipList = equipService.queryMateriaByGldTypeRel(context, defineTypeRels, request);
|
|
|
+ List<JSONObject> equipList = queryMateriaByGldTypeRel(context, defineTypeRels, request);
|
|
|
return equipList;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 查询万达映射表中的设备类型
|
|
|
*/
|
|
@@ -153,6 +218,7 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 根据信息点查询楼层下的设备对象信息
|
|
|
* @param context
|
|
@@ -182,6 +248,7 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
return (List<JSONObject>)commonResult.getContent();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 查询万达映射表中的阀门类型
|
|
|
*/
|
|
@@ -193,6 +260,7 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
return defineTypeRels;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 根据广联达阀门类型查询阀门信息
|
|
|
* @param context
|
|
@@ -208,39 +276,6 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 根据信息点查询楼层下的阀门对象信息
|
|
|
- * @param context
|
|
|
- * @param defineTypeRels
|
|
|
- * @param request
|
|
|
- * @return
|
|
|
- */
|
|
|
- /*private List<JSONObject> queryMateriaObjectByInfoCode(InstanceUrlParam context,List<DefineTypeRel> defineTypeRels,CommonRequestDTO request,String infoCode){
|
|
|
- //获取所有的bimTypeId
|
|
|
- Set<String> bimTypeIdSets = defineTypeRels.stream().filter(k-> StringUtils.isNotEmpty(k.getBimTypeId())).map(k->k.getBimTypeId()).collect(Collectors.toSet());
|
|
|
- ObjectNode criteria = JsonNodeFactory.instance.objectNode();
|
|
|
- ArrayNode bimTypeIds = criteria.withArray(infoCode);
|
|
|
- bimTypeIdSets.forEach(item->{bimTypeIds.add(item);});
|
|
|
-
|
|
|
- //获取万达的类型编码
|
|
|
- *//*Set<String> wdClassCode = defineTypeRels.stream().filter(k-> StringUtils.isNotEmpty(k.getWdClassCode())).map(k->k.getWdClassCode()).collect(Collectors.toSet());
|
|
|
- ArrayNode wdClassCodes = criteria.withArray("wdCode");
|
|
|
- wdClassCode.forEach(item->{wdClassCodes.add(item);});*//*
|
|
|
-
|
|
|
- QueryCriteria queryCriteria = new QueryCriteria();
|
|
|
- //获取对应的关系查询条件
|
|
|
- if(StringUtils.isNotEmpty(request.getFloorId())){
|
|
|
- queryCriteria = EntityTransferUtil.transDmpRelationCriteria(criteria, RelationTypeEnum.MECHINARCH_Eq2Fl.getGraphCode(),
|
|
|
- RelationTypeEnum.MECHINARCH_Eq2Fl.getRelCode(), request.getFloorId(), 1);
|
|
|
- }else{
|
|
|
- queryCriteria = EntityTransferUtil.transDmpRelationCriteria(criteria, RelationTypeEnum.MECHINARCH_Eq2Bd.getGraphCode(),
|
|
|
- RelationTypeEnum.MECHINARCH_Eq2Bd.getRelCode(), request.getBuildId(), 1);
|
|
|
- }
|
|
|
-
|
|
|
- //查询阀门对象信息
|
|
|
- CommonResult commonResult = baseService.doQuery(context, queryCriteria, JsonNode.class);
|
|
|
- return (List<JSONObject>)commonResult.getContent();
|
|
|
- }*/
|
|
|
|
|
|
/**
|
|
|
* 组装查询设备结果
|
|
@@ -253,7 +288,6 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
if(CollUtil.isEmpty(defineTypeRels)){
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
-
|
|
|
Map<String, List<JSONObject>> spaceMap = spaceList.stream().collect(Collectors.groupingBy(k->k.getString(infoCode)));
|
|
|
|
|
|
//数据组装
|
|
@@ -277,7 +311,10 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 查询暖通系统下制冷机房,冷却塔映射关系
|
|
|
+ * 条件查询广联达映射关系
|
|
|
+ * @param bimTypeId
|
|
|
+ * @param systemCode
|
|
|
+ * @return
|
|
|
*/
|
|
|
public List<DefineTypeRel> queryGldHavcTypeRel(String bimTypeId,String systemCode){
|
|
|
QueryWrapper<DefineTypeRel> wrapper = new QueryWrapper<>();
|