|
@@ -2,7 +2,6 @@ package com.persagy.dmp.middleware.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import com.fasterxml.jackson.databind.node.ArrayNode;
|
|
|
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
|
|
@@ -10,8 +9,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
|
import com.persagy.dmp.basic.model.QueryCriteria;
|
|
|
import com.persagy.dmp.middleware.constant.CommonConsant;
|
|
|
import com.persagy.dmp.middleware.constant.enums.RelationTypeEnum;
|
|
|
-import com.persagy.dmp.middleware.dao.WdConstructDescriptionMapper;
|
|
|
-import com.persagy.dmp.middleware.dao.WdDefineTypeRelMapper;
|
|
|
+import com.persagy.dmp.middleware.constant.enums.WdDefTypeEnum;
|
|
|
import com.persagy.dmp.middleware.entity.dto.CommonRequestDTO;
|
|
|
import com.persagy.dmp.middleware.entity.dto.InstanceUrlParam;
|
|
|
import com.persagy.dmp.middleware.entity.response.CommonResult;
|
|
@@ -19,6 +17,7 @@ import com.persagy.dmp.middleware.entity.vo.WdDefineTypeRel;
|
|
|
import com.persagy.dmp.middleware.service.IBaseService;
|
|
|
import com.persagy.dmp.middleware.service.IEquipService;
|
|
|
import com.persagy.dmp.middleware.service.ISpaceService;
|
|
|
+import com.persagy.dmp.middleware.service.IWdDefineTypeRelService;
|
|
|
import com.persagy.dmp.middleware.utils.EntityTransferUtil;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -38,16 +37,13 @@ import java.util.stream.Collectors;
|
|
|
public class EquipServiceImpl implements IEquipService {
|
|
|
|
|
|
@Autowired
|
|
|
- private WdDefineTypeRelMapper defineTypeRelMapper;
|
|
|
-
|
|
|
- @Autowired
|
|
|
private IBaseService baseService;
|
|
|
|
|
|
@Autowired
|
|
|
private ISpaceService spaceService;
|
|
|
|
|
|
@Autowired
|
|
|
- private WdConstructDescriptionMapper constructDescriptionMapper;
|
|
|
+ private IWdDefineTypeRelService iWdDefineTypeRelService;
|
|
|
|
|
|
/**
|
|
|
* 查询设备设施模块下的设备/阀门
|
|
@@ -85,7 +81,10 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
List<JSONObject> result = new ArrayList<>();
|
|
|
|
|
|
//1.查询冷却塔设备类下的设备/阀门
|
|
|
- List<WdDefineTypeRel> coolTowerDefineTypeRels = queryGldHavcTypeRel(CommonConsant.ACCCOT_BIMTYPEID,CommonConsant.WD_HAVC_SYSTEM_CODE);
|
|
|
+ WdDefineTypeRel defineTypeRel = new WdDefineTypeRel();
|
|
|
+ defineTypeRel.setBimTypeId(CommonConsant.ACCCOT_BIMTYPEID);
|
|
|
+ defineTypeRel.setWdSystemCode(CommonConsant.WD_HAVC_SYSTEM_CODE);
|
|
|
+ List<WdDefineTypeRel> coolTowerDefineTypeRels = iWdDefineTypeRelService.query(context,defineTypeRel);
|
|
|
List<JSONObject> coolTowerObjects = queryEquipObjectByInfoCode(context, coolTowerDefineTypeRels, request, CommonConsant.BIM_TYPE_ID);
|
|
|
List<JSONObject> coolTowerContent = combineQueryEquipResultData(coolTowerDefineTypeRels, coolTowerObjects, CommonConsant.BIM_TYPE_ID);
|
|
|
if(CollUtil.isNotEmpty(coolTowerContent)){
|
|
@@ -128,15 +127,19 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
List<JSONObject> result = new ArrayList<>();
|
|
|
|
|
|
//1.查询分水器
|
|
|
- List<WdDefineTypeRel> divideDefineTypeRels = queryGldHavcTypeRel(CommonConsant.DIVIDE_BREECH_BIMTYPEID,CommonConsant.WD_HAVC_SYSTEM_CODE);
|
|
|
+ WdDefineTypeRel defineTypeRel = new WdDefineTypeRel();
|
|
|
+ defineTypeRel.setBimTypeId(CommonConsant.DIVIDE_BREECH_BIMTYPEID);
|
|
|
+ defineTypeRel.setWdSystemCode(CommonConsant.WD_HAVC_SYSTEM_CODE);
|
|
|
+
|
|
|
+ List<WdDefineTypeRel> divideDefineTypeRels = iWdDefineTypeRelService.query(context, defineTypeRel);
|
|
|
List<JSONObject> divideBreechObjects = queryEquipObjectByInfoCode(context, divideDefineTypeRels, request, CommonConsant.BIM_TYPE_ID);
|
|
|
List<JSONObject> divideContent = combineQueryEquipResultData(divideDefineTypeRels, divideBreechObjects, CommonConsant.BIM_TYPE_ID);
|
|
|
if(CollUtil.isNotEmpty(divideContent)){
|
|
|
result.addAll(divideContent);
|
|
|
}
|
|
|
//2. 查询集水器
|
|
|
- List<WdDefineTypeRel> collectDefineTypeRels = queryGldHavcTypeRel(CommonConsant.COLLECT_BREECH_BIMTYPEID,CommonConsant.WD_HAVC_SYSTEM_CODE);
|
|
|
- List<JSONObject> collectBreechObjects = queryEquipObjectByInfoCode(context, collectDefineTypeRels, request, CommonConsant.BIM_TYPE_ID);
|
|
|
+ defineTypeRel.setBimTypeId(CommonConsant.COLLECT_BREECH_BIMTYPEID);
|
|
|
+ List<WdDefineTypeRel> collectDefineTypeRels = iWdDefineTypeRelService.query(context, defineTypeRel); List<JSONObject> collectBreechObjects = queryEquipObjectByInfoCode(context, collectDefineTypeRels, request, CommonConsant.BIM_TYPE_ID);
|
|
|
List<JSONObject> collectContent = combineQueryEquipResultData(collectDefineTypeRels, collectBreechObjects, CommonConsant.BIM_TYPE_ID);
|
|
|
if(CollUtil.isNotEmpty(collectContent)){
|
|
|
result.addAll(collectContent);
|
|
@@ -156,6 +159,28 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询楼层地板
|
|
|
+ * @param context
|
|
|
+ * @param request
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<JSONObject> queryFloorBoard(InstanceUrlParam context, CommonRequestDTO request) throws Exception {
|
|
|
+ //查询楼层地板对应的bimTypeId
|
|
|
+ WdDefineTypeRel defineTypeRel = new WdDefineTypeRel();
|
|
|
+ defineTypeRel.setObjType(WdDefTypeEnum.BOARD.getValue());
|
|
|
+ List<WdDefineTypeRel> defineTypeRels = iWdDefineTypeRelService.query(context, defineTypeRel);
|
|
|
+
|
|
|
+ //根据bimTypeId,以及楼层对应关系查询地板信息
|
|
|
+ List<JSONObject> equipList = queryEquipObjectByInfoCode(context, defineTypeRels, request, CommonConsant.BIM_TYPE_ID);
|
|
|
+
|
|
|
+ //结果组装
|
|
|
+ List<JSONObject> content = combineQueryEquipResultData(defineTypeRels, equipList, CommonConsant.BIM_TYPE_ID);
|
|
|
+ return content;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 获取系统下的设备
|
|
@@ -164,7 +189,10 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
*/
|
|
|
private List<JSONObject> querySystemEquipList(InstanceUrlParam context, CommonRequestDTO request){
|
|
|
//查询广联达设备类型
|
|
|
- List<WdDefineTypeRel> defineTypeRels = queryGldEquipTypeRel();
|
|
|
+ WdDefineTypeRel defineTypeRel = new WdDefineTypeRel();
|
|
|
+ defineTypeRel.setObjType(WdDefTypeEnum.EQUIPMENT.getValue());
|
|
|
+ List<WdDefineTypeRel> defineTypeRels = iWdDefineTypeRelService.query(context,defineTypeRel);
|
|
|
+
|
|
|
//根据系统过滤
|
|
|
if(StringUtils.isNotEmpty(request.getSystemCode())){
|
|
|
String systemCode = request.getSystemCode();
|
|
@@ -183,7 +211,9 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
*/
|
|
|
private List<JSONObject> querySystemMateriaList(InstanceUrlParam context, CommonRequestDTO request){
|
|
|
//查询广联达设备类型
|
|
|
- List<WdDefineTypeRel> defineTypeRels = queryGldMateriaTypeRel();
|
|
|
+ WdDefineTypeRel defineTypeRel = new WdDefineTypeRel();
|
|
|
+ defineTypeRel.setObjType("material");
|
|
|
+ List<WdDefineTypeRel> defineTypeRels = iWdDefineTypeRelService.query(context,defineTypeRel);
|
|
|
//根据系统过滤
|
|
|
if(StringUtils.isNotEmpty(request.getSystemCode())){
|
|
|
String systemCode = request.getSystemCode();
|
|
@@ -196,18 +226,6 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 查询万达映射表中的设备类型
|
|
|
- */
|
|
|
- @Override
|
|
|
- public List<WdDefineTypeRel> queryGldEquipTypeRel(){
|
|
|
- QueryWrapper<WdDefineTypeRel> wrapper = new QueryWrapper<>();
|
|
|
- wrapper.eq("obj_type","equipment");
|
|
|
- List<WdDefineTypeRel> defineTypeRels = defineTypeRelMapper.selectList(wrapper);
|
|
|
- return defineTypeRels;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
* 根据广联达设备类型查询设备信息
|
|
|
* @param context
|
|
|
* @param defineTypeRels
|
|
@@ -257,18 +275,6 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 查询万达映射表中的阀门类型
|
|
|
- */
|
|
|
- @Override
|
|
|
- public List<WdDefineTypeRel> queryGldMateriaTypeRel(){
|
|
|
- QueryWrapper<WdDefineTypeRel> wrapper = new QueryWrapper<>();
|
|
|
- wrapper.eq("obj_type","material");
|
|
|
- List<WdDefineTypeRel> defineTypeRels = defineTypeRelMapper.selectList(wrapper);
|
|
|
- return defineTypeRels;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
* 根据广联达阀门类型查询阀门信息
|
|
|
* @param context
|
|
|
* @param defineTypeRels
|
|
@@ -318,19 +324,4 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 条件查询广联达映射关系
|
|
|
- * @param bimTypeId
|
|
|
- * @param systemCode
|
|
|
- * @return
|
|
|
- */
|
|
|
- public List<WdDefineTypeRel> queryGldHavcTypeRel(String bimTypeId, String systemCode){
|
|
|
- QueryWrapper<WdDefineTypeRel> wrapper = new QueryWrapper<>();
|
|
|
-
|
|
|
- wrapper.eq("bim_type_id",bimTypeId);
|
|
|
- wrapper.eq("wd_system_code",systemCode);
|
|
|
- List<WdDefineTypeRel> defineTypeRels = defineTypeRelMapper.selectList(wrapper);
|
|
|
- return defineTypeRels;
|
|
|
- }
|
|
|
-
|
|
|
}
|