|
@@ -3,18 +3,22 @@ package com.persagy.dmp.middleware.service.impl;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
import com.fasterxml.jackson.databind.node.ArrayNode;
|
|
import com.fasterxml.jackson.databind.node.ArrayNode;
|
|
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
|
|
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
import com.persagy.dmp.basic.model.QueryCriteria;
|
|
import com.persagy.dmp.basic.model.QueryCriteria;
|
|
|
|
+import com.persagy.dmp.digital.entity.ObjectRelation;
|
|
import com.persagy.dmp.middleware.constant.CommonConsant;
|
|
import com.persagy.dmp.middleware.constant.CommonConsant;
|
|
import com.persagy.dmp.middleware.constant.enums.RelationTypeEnum;
|
|
import com.persagy.dmp.middleware.constant.enums.RelationTypeEnum;
|
|
-import com.persagy.dmp.middleware.dao.DefineTypeRelMapper;
|
|
|
|
|
|
+import com.persagy.dmp.middleware.dao.WdConstructDescriptionMapper;
|
|
|
|
+import com.persagy.dmp.middleware.dao.WdDefineTypeRelMapper;
|
|
import com.persagy.dmp.middleware.entity.dto.CommonRequestDTO;
|
|
import com.persagy.dmp.middleware.entity.dto.CommonRequestDTO;
|
|
import com.persagy.dmp.middleware.entity.dto.InstanceUrlParam;
|
|
import com.persagy.dmp.middleware.entity.dto.InstanceUrlParam;
|
|
import com.persagy.dmp.middleware.entity.response.CommonResult;
|
|
import com.persagy.dmp.middleware.entity.response.CommonResult;
|
|
-import com.persagy.dmp.middleware.entity.vo.DefineTypeRel;
|
|
|
|
|
|
+import com.persagy.dmp.middleware.entity.vo.WdConstructDescription;
|
|
|
|
+import com.persagy.dmp.middleware.entity.vo.WdDefineTypeRel;
|
|
import com.persagy.dmp.middleware.service.IBaseService;
|
|
import com.persagy.dmp.middleware.service.IBaseService;
|
|
import com.persagy.dmp.middleware.service.IEquipService;
|
|
import com.persagy.dmp.middleware.service.IEquipService;
|
|
import com.persagy.dmp.middleware.service.ISpaceService;
|
|
import com.persagy.dmp.middleware.service.ISpaceService;
|
|
@@ -37,7 +41,7 @@ import java.util.stream.Collectors;
|
|
public class EquipServiceImpl implements IEquipService {
|
|
public class EquipServiceImpl implements IEquipService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private DefineTypeRelMapper defineTypeRelMapper;
|
|
|
|
|
|
+ private WdDefineTypeRelMapper defineTypeRelMapper;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IBaseService baseService;
|
|
private IBaseService baseService;
|
|
@@ -45,6 +49,9 @@ public class EquipServiceImpl implements IEquipService {
|
|
@Autowired
|
|
@Autowired
|
|
private ISpaceService spaceService;
|
|
private ISpaceService spaceService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private WdConstructDescriptionMapper constructDescriptionMapper;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询设备设施模块下的设备/阀门
|
|
* 查询设备设施模块下的设备/阀门
|
|
* @param context
|
|
* @param context
|
|
@@ -84,7 +91,7 @@ public class EquipServiceImpl implements IEquipService {
|
|
List<JSONObject> result = new ArrayList<>();
|
|
List<JSONObject> result = new ArrayList<>();
|
|
|
|
|
|
//1.查询冷却塔设备类下的设备/阀门
|
|
//1.查询冷却塔设备类下的设备/阀门
|
|
- List<DefineTypeRel> coolTowerDefineTypeRels = queryGldHavcTypeRel(CommonConsant.ACCCOT_BIMTYPEID,CommonConsant.WD_HAVC_SYSTEM_CODE);
|
|
|
|
|
|
+ List<WdDefineTypeRel> coolTowerDefineTypeRels = queryGldHavcTypeRel(CommonConsant.ACCCOT_BIMTYPEID,CommonConsant.WD_HAVC_SYSTEM_CODE);
|
|
List<JSONObject> coolTowerObjects = queryEquipObjectByInfoCode(context, coolTowerDefineTypeRels, request, CommonConsant.BIM_TYPE_ID);
|
|
List<JSONObject> coolTowerObjects = queryEquipObjectByInfoCode(context, coolTowerDefineTypeRels, request, CommonConsant.BIM_TYPE_ID);
|
|
if(CollUtil.isNotEmpty(coolTowerObjects)){
|
|
if(CollUtil.isNotEmpty(coolTowerObjects)){
|
|
result.addAll(coolTowerObjects);
|
|
result.addAll(coolTowerObjects);
|
|
@@ -126,13 +133,13 @@ public class EquipServiceImpl implements IEquipService {
|
|
List<JSONObject> result = new ArrayList<>();
|
|
List<JSONObject> result = new ArrayList<>();
|
|
|
|
|
|
//1.查询分水器
|
|
//1.查询分水器
|
|
- List<DefineTypeRel> divideDefineTypeRels = queryGldHavcTypeRel(CommonConsant.DIVIDE_BREECH_BIMTYPEID,CommonConsant.WD_HAVC_SYSTEM_CODE);
|
|
|
|
|
|
+ List<WdDefineTypeRel> divideDefineTypeRels = queryGldHavcTypeRel(CommonConsant.DIVIDE_BREECH_BIMTYPEID,CommonConsant.WD_HAVC_SYSTEM_CODE);
|
|
List<JSONObject> divideBreechObjects = queryEquipObjectByInfoCode(context, divideDefineTypeRels, request, CommonConsant.BIM_TYPE_ID);
|
|
List<JSONObject> divideBreechObjects = queryEquipObjectByInfoCode(context, divideDefineTypeRels, request, CommonConsant.BIM_TYPE_ID);
|
|
if(CollUtil.isNotEmpty(divideBreechObjects)){
|
|
if(CollUtil.isNotEmpty(divideBreechObjects)){
|
|
result.addAll(divideBreechObjects);
|
|
result.addAll(divideBreechObjects);
|
|
}
|
|
}
|
|
//2. 查询集水器
|
|
//2. 查询集水器
|
|
- List<DefineTypeRel> collectDefineTypeRels = queryGldHavcTypeRel(CommonConsant.COLLECT_BREECH_BIMTYPEID,CommonConsant.WD_HAVC_SYSTEM_CODE);
|
|
|
|
|
|
+ List<WdDefineTypeRel> collectDefineTypeRels = queryGldHavcTypeRel(CommonConsant.COLLECT_BREECH_BIMTYPEID,CommonConsant.WD_HAVC_SYSTEM_CODE);
|
|
List<JSONObject> collectBreechObjects = queryEquipObjectByInfoCode(context, collectDefineTypeRels, request, CommonConsant.BIM_TYPE_ID);
|
|
List<JSONObject> collectBreechObjects = queryEquipObjectByInfoCode(context, collectDefineTypeRels, request, CommonConsant.BIM_TYPE_ID);
|
|
if(CollUtil.isNotEmpty(collectBreechObjects)){
|
|
if(CollUtil.isNotEmpty(collectBreechObjects)){
|
|
result.addAll(collectBreechObjects);
|
|
result.addAll(collectBreechObjects);
|
|
@@ -160,7 +167,7 @@ public class EquipServiceImpl implements IEquipService {
|
|
*/
|
|
*/
|
|
private List<JSONObject> querySystemEquipList(InstanceUrlParam context, CommonRequestDTO request){
|
|
private List<JSONObject> querySystemEquipList(InstanceUrlParam context, CommonRequestDTO request){
|
|
//查询广联达设备类型
|
|
//查询广联达设备类型
|
|
- List<DefineTypeRel> defineTypeRels = queryGldEquipTypeRel();
|
|
|
|
|
|
+ List<WdDefineTypeRel> defineTypeRels = queryGldEquipTypeRel();
|
|
//根据系统过滤
|
|
//根据系统过滤
|
|
if(StringUtils.isNotEmpty(request.getSystemCode())){
|
|
if(StringUtils.isNotEmpty(request.getSystemCode())){
|
|
String systemCode = request.getSystemCode();
|
|
String systemCode = request.getSystemCode();
|
|
@@ -179,7 +186,7 @@ public class EquipServiceImpl implements IEquipService {
|
|
*/
|
|
*/
|
|
private List<JSONObject> querySystemMateriaList(InstanceUrlParam context, CommonRequestDTO request){
|
|
private List<JSONObject> querySystemMateriaList(InstanceUrlParam context, CommonRequestDTO request){
|
|
//查询广联达设备类型
|
|
//查询广联达设备类型
|
|
- List<DefineTypeRel> defineTypeRels = queryGldMateriaTypeRel();
|
|
|
|
|
|
+ List<WdDefineTypeRel> defineTypeRels = queryGldMateriaTypeRel();
|
|
//根据系统过滤
|
|
//根据系统过滤
|
|
if(StringUtils.isNotEmpty(request.getSystemCode())){
|
|
if(StringUtils.isNotEmpty(request.getSystemCode())){
|
|
String systemCode = request.getSystemCode();
|
|
String systemCode = request.getSystemCode();
|
|
@@ -195,10 +202,10 @@ public class EquipServiceImpl implements IEquipService {
|
|
* 查询万达映射表中的设备类型
|
|
* 查询万达映射表中的设备类型
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public List<DefineTypeRel> queryGldEquipTypeRel(){
|
|
|
|
- QueryWrapper<DefineTypeRel> wrapper = new QueryWrapper<>();
|
|
|
|
|
|
+ public List<WdDefineTypeRel> queryGldEquipTypeRel(){
|
|
|
|
+ QueryWrapper<WdDefineTypeRel> wrapper = new QueryWrapper<>();
|
|
wrapper.eq("obj_type","equipment");
|
|
wrapper.eq("obj_type","equipment");
|
|
- List<DefineTypeRel> defineTypeRels = defineTypeRelMapper.selectList(wrapper);
|
|
|
|
|
|
+ List<WdDefineTypeRel> defineTypeRels = defineTypeRelMapper.selectList(wrapper);
|
|
return defineTypeRels;
|
|
return defineTypeRels;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -210,7 +217,7 @@ public class EquipServiceImpl implements IEquipService {
|
|
* @param request
|
|
* @param request
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public List<JSONObject> queryEquipByGldTypeRel(InstanceUrlParam context, List<DefineTypeRel> defineTypeRels, CommonRequestDTO request){
|
|
|
|
|
|
+ public List<JSONObject> queryEquipByGldTypeRel(InstanceUrlParam context, List<WdDefineTypeRel> defineTypeRels, CommonRequestDTO request){
|
|
// 根据bimTypeId查询楼层下的设备
|
|
// 根据bimTypeId查询楼层下的设备
|
|
List<JSONObject> bimTypeSpace = queryEquipObjectByInfoCode(context, defineTypeRels, request, "bimTypeId");
|
|
List<JSONObject> bimTypeSpace = queryEquipObjectByInfoCode(context, defineTypeRels, request, "bimTypeId");
|
|
// 数据组装:根据bimTypeId查询楼层下的设备结果
|
|
// 数据组装:根据bimTypeId查询楼层下的设备结果
|
|
@@ -227,7 +234,7 @@ public class EquipServiceImpl implements IEquipService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public List<JSONObject> queryEquipObjectByInfoCode(InstanceUrlParam context,List<DefineTypeRel> defineTypeRels,CommonRequestDTO request,String infoCode){
|
|
|
|
|
|
+ public List<JSONObject> queryEquipObjectByInfoCode(InstanceUrlParam context, List<WdDefineTypeRel> defineTypeRels, CommonRequestDTO request, String infoCode){
|
|
//1. 根据bimTypeId查询楼层下的设备
|
|
//1. 根据bimTypeId查询楼层下的设备
|
|
Set<String> bimTypeIdSets = defineTypeRels.stream().filter(k-> StringUtils.isNotEmpty(k.getBimTypeId())).map(k->k.getBimTypeId()).collect(Collectors.toSet());
|
|
Set<String> bimTypeIdSets = defineTypeRels.stream().filter(k-> StringUtils.isNotEmpty(k.getBimTypeId())).map(k->k.getBimTypeId()).collect(Collectors.toSet());
|
|
ObjectNode criteria = JsonNodeFactory.instance.objectNode();
|
|
ObjectNode criteria = JsonNodeFactory.instance.objectNode();
|
|
@@ -253,10 +260,10 @@ public class EquipServiceImpl implements IEquipService {
|
|
* 查询万达映射表中的阀门类型
|
|
* 查询万达映射表中的阀门类型
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public List<DefineTypeRel> queryGldMateriaTypeRel(){
|
|
|
|
- QueryWrapper<DefineTypeRel> wrapper = new QueryWrapper<>();
|
|
|
|
|
|
+ public List<WdDefineTypeRel> queryGldMateriaTypeRel(){
|
|
|
|
+ QueryWrapper<WdDefineTypeRel> wrapper = new QueryWrapper<>();
|
|
wrapper.eq("obj_type","material");
|
|
wrapper.eq("obj_type","material");
|
|
- List<DefineTypeRel> defineTypeRels = defineTypeRelMapper.selectList(wrapper);
|
|
|
|
|
|
+ List<WdDefineTypeRel> defineTypeRels = defineTypeRelMapper.selectList(wrapper);
|
|
return defineTypeRels;
|
|
return defineTypeRels;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -268,7 +275,7 @@ public class EquipServiceImpl implements IEquipService {
|
|
* @param request
|
|
* @param request
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public List<JSONObject> queryMateriaByGldTypeRel(InstanceUrlParam context, List<DefineTypeRel> defineTypeRels, CommonRequestDTO request){
|
|
|
|
|
|
+ public List<JSONObject> queryMateriaByGldTypeRel(InstanceUrlParam context, List<WdDefineTypeRel> defineTypeRels, CommonRequestDTO request){
|
|
// 根据bimTypeId查询楼层下的设备
|
|
// 根据bimTypeId查询楼层下的设备
|
|
List<JSONObject> bimTypeSpace = queryEquipObjectByInfoCode(context, defineTypeRels, request,"bimTypeId");
|
|
List<JSONObject> bimTypeSpace = queryEquipObjectByInfoCode(context, defineTypeRels, request,"bimTypeId");
|
|
// 数据组装:根据bimTypeId查询楼层下的设备结果
|
|
// 数据组装:根据bimTypeId查询楼层下的设备结果
|
|
@@ -284,7 +291,7 @@ public class EquipServiceImpl implements IEquipService {
|
|
* @param infoCode
|
|
* @param infoCode
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- private List<JSONObject> combineQueryEquipResultData(List<DefineTypeRel> defineTypeRels,List<JSONObject> spaceList,String infoCode){
|
|
|
|
|
|
+ private List<JSONObject> combineQueryEquipResultData(List<WdDefineTypeRel> defineTypeRels, List<JSONObject> spaceList, String infoCode){
|
|
if(CollUtil.isEmpty(defineTypeRels)){
|
|
if(CollUtil.isEmpty(defineTypeRels)){
|
|
return new ArrayList<>();
|
|
return new ArrayList<>();
|
|
}
|
|
}
|
|
@@ -292,7 +299,7 @@ public class EquipServiceImpl implements IEquipService {
|
|
|
|
|
|
//数据组装
|
|
//数据组装
|
|
List<JSONObject> result = new ArrayList<>();
|
|
List<JSONObject> result = new ArrayList<>();
|
|
- for (DefineTypeRel defineTypeRel : defineTypeRels) {
|
|
|
|
|
|
+ for (WdDefineTypeRel defineTypeRel : defineTypeRels) {
|
|
JSONObject data = new JSONObject();
|
|
JSONObject data = new JSONObject();
|
|
data.put("bimTypeId",defineTypeRel.getBimTypeId());
|
|
data.put("bimTypeId",defineTypeRel.getBimTypeId());
|
|
data.put("className",defineTypeRel.getWdClassName());
|
|
data.put("className",defineTypeRel.getWdClassName());
|
|
@@ -316,12 +323,12 @@ public class EquipServiceImpl implements IEquipService {
|
|
* @param systemCode
|
|
* @param systemCode
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public List<DefineTypeRel> queryGldHavcTypeRel(String bimTypeId,String systemCode){
|
|
|
|
- QueryWrapper<DefineTypeRel> wrapper = new QueryWrapper<>();
|
|
|
|
|
|
+ public List<WdDefineTypeRel> queryGldHavcTypeRel(String bimTypeId, String systemCode){
|
|
|
|
+ QueryWrapper<WdDefineTypeRel> wrapper = new QueryWrapper<>();
|
|
|
|
|
|
wrapper.eq("bim_type_id",bimTypeId);
|
|
wrapper.eq("bim_type_id",bimTypeId);
|
|
wrapper.eq("wd_system_code",systemCode);
|
|
wrapper.eq("wd_system_code",systemCode);
|
|
- List<DefineTypeRel> defineTypeRels = defineTypeRelMapper.selectList(wrapper);
|
|
|
|
|
|
+ List<WdDefineTypeRel> defineTypeRels = defineTypeRelMapper.selectList(wrapper);
|
|
return defineTypeRels;
|
|
return defineTypeRels;
|
|
}
|
|
}
|
|
|
|
|