|
@@ -1,5 +1,6 @@
|
|
|
package com.persagy.proxy.adm.controller;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import com.persagy.dmp.common.exception.BusinessException;
|
|
|
import com.persagy.proxy.adm.constant.AdmCommonConstant;
|
|
|
import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
|
|
@@ -51,7 +52,7 @@ public class AdmRelCalController {
|
|
|
HttpServletRequest request) throws Exception {
|
|
|
// 组装上下文条件
|
|
|
InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
|
|
|
- admRelCalService.calcRelation(context,getAdmRelationTypeEnum(request),objectTypeStr,relationTypeStr);
|
|
|
+ admRelCalService.calcRelation(context,CollUtil.newArrayList(getAdmRelationTypeEnum(request)),objectTypeStr,relationTypeStr);
|
|
|
return AdmResponse.success(new ArrayList<>());
|
|
|
}
|
|
|
|
|
@@ -80,7 +81,7 @@ public class AdmRelCalController {
|
|
|
HttpServletRequest request) throws Exception {
|
|
|
// 组装上下文条件
|
|
|
InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
|
|
|
- admRelCalService.calcRelation(context,getAdmRelationTypeEnum(request),objectTypeStr,relationTypeStr);
|
|
|
+ admRelCalService.calcRelation(context, CollUtil.newArrayList(getAdmRelationTypeEnum(request)),objectTypeStr,relationTypeStr);
|
|
|
return AdmResponse.success(new ArrayList<>());
|
|
|
}
|
|
|
|
|
@@ -268,7 +269,13 @@ public class AdmRelCalController {
|
|
|
// 资产暂时未引入,直接返回成功
|
|
|
// 组装上下文条件
|
|
|
InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
|
|
|
- // admRelCalService.calcRelation(context,relType,objectTypeStr,relationTypeStr);
|
|
|
+ Map<String, AdmRelationTypeEnum> relationTypeMap = AdmRelationTypeEnum.getRelationTypeMap();
|
|
|
+ if (!relationTypeMap.containsKey("eq2bd") || !relationTypeMap.containsKey("sy2bd")){
|
|
|
+ throw new BusinessException(BusinessErrorRwdCode.A7201.getCode(),BusinessErrorRwdCode.A7201.getDesc());
|
|
|
+ }
|
|
|
+ ArrayList<AdmRelationTypeEnum> admRelationTypeEnums =
|
|
|
+ CollUtil.newArrayList(relationTypeMap.get("eq2bd"), relationTypeMap.get("sy2bd"));
|
|
|
+ admRelCalService.calcRelation(context,admRelationTypeEnums,objectTypeStr,relationTypeStr);
|
|
|
return AdmResponse.success(new ArrayList<>());
|
|
|
}
|
|
|
/***
|
|
@@ -319,30 +326,6 @@ public class AdmRelCalController {
|
|
|
return AdmResponse.success(new ArrayList<>());
|
|
|
}
|
|
|
|
|
|
-// /***
|
|
|
-// * Description: 添加关系(图类型关系为ThroughRelationship)
|
|
|
-// * @param relType : 关系类型
|
|
|
-// * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
|
|
|
-// * DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
|
|
|
-// * FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
|
|
|
-// * sign: 更改计算标记
|
|
|
-// * @return : com.persagy.proxy.adm.request.AdmCreateResponse
|
|
|
-// * @author : lijie
|
|
|
-// * @date :2021/8/31 12:10
|
|
|
-// * Update By lijie 2021/8/31 12:10
|
|
|
-// */
|
|
|
-// @PostMapping(value = {"sign"})
|
|
|
-// public AdmResponse throughRelationshipCalcRelation( @PathVariable("relType") String relType,
|
|
|
-// @QueryParam("projectId") String projectId,
|
|
|
-// @QueryParam("objectTypes") String objectTypeStr,
|
|
|
-// @QueryParam("relationType") String relationTypeStr) throws Exception {
|
|
|
-// // 资产暂时未引入,直接返回成功
|
|
|
-// // 组装上下文条件
|
|
|
-// InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
|
|
|
-// // admRelCalService.calcRelation(context,relType,objectTypeStr,relationTypeStr);
|
|
|
-// return AdmResponse.success(new ArrayList<>());
|
|
|
-// }
|
|
|
-
|
|
|
/***
|
|
|
* Description: 更改计算标记
|
|
|
* @param relType : 关系类型
|