Browse Source

新增关系计算逻辑类

lijie 3 years ago
parent
commit
b862e652de

+ 1 - 1
src/main/java/com/persagy/proxy/adm/constant/AdmRelationTypeEnum.java

@@ -26,7 +26,7 @@ public enum AdmRelationTypeEnum {
     /**设备所在物业分区-设备→业务空间-【业务空间台账】*/
     EQ2SP_IN("eq2sp_in","MechInArch","Eq2Sp",AdmObjectType.EQUIPMENT.getIndex(),AdmObjectType.SPACE.getIndex(),false,false,false,false,false,false),
     /**建筑下的竖井-竖井→建筑-【竖井台账】*/
-    SH2BD("sh2bd","ShaftandBuilding","Bd2Sh",AdmObjectType.BUILDING.getIndex(),AdmObjectType.SHAFT.getIndex(),false,false,false,false,false,false),
+    SH2BD("sh2bd","ArchSubset","Bd2Sh",AdmObjectType.BUILDING.getIndex(),AdmObjectType.SHAFT.getIndex(),false,false,false,false,false,false),
     /**空间隔断有门-空间-空间-【全部关系总览】*/
     SP2SP_SPACENEIGHBORHOOD_2("sp2sp_SpaceNeighborhood_2","SpaceNeighborhood","Door",AdmObjectType.SPACE.getIndex(),AdmObjectType.SPACE.getIndex(),true,true,true,false,true,false),
     /**空间连通-空间-空间-【全部关系总览】*/

+ 2 - 0
src/main/java/com/persagy/proxy/adm/constant/BusinessErrorRwdCode.java

@@ -9,8 +9,10 @@ package com.persagy.proxy.adm.constant;
 public enum BusinessErrorRwdCode {
     /**
      * A73XX:代表关系计算的错误码
+     * A79XX:代表ADM错误码
      *
      * */
+    A7201("A7201", "关系不存在"),
 	A7301("A7301", ":不存在"),
     A7302("A7302", ":存在多个实例"),
     A7303("A7303", ":不存在"),

+ 402 - 0
src/main/java/com/persagy/proxy/adm/controller/AdmRelCalController.java

@@ -0,0 +1,402 @@
+package com.persagy.proxy.adm.controller;
+
+import com.persagy.dmp.common.exception.BusinessException;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.constant.BusinessErrorRwdCode;
+import com.persagy.proxy.adm.request.AdmResponse;
+import com.persagy.proxy.adm.service.AdmRelCalService;
+import com.persagy.proxy.common.entity.InstanceUrlParam;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.QueryParam;
+import java.util.ArrayList;
+import java.util.Map;
+
+/***
+ * Description:关系计算输入类
+ * @author : lijie
+ * @date :2021/8/31 11:37
+ * Update By lijie 2021/8/31 11:37
+ */
+@RestController
+@RequestMapping("/relation-calc/")
+@RequiredArgsConstructor
+public class AdmRelCalController {
+
+    private final AdmRelCalService admRelCalService;
+    @Value("${middleware.group.code}")
+    private String groupCode;
+    
+    /***
+     * Description: 添加关系(图类型关系为ArchSubset)
+     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
+     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
+     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
+     * bd2sp: 建筑下的空间
+     * fl2sp: 楼层下的空间
+     * sh2bd: 建筑下的竖井,实际关系应该是bd2sh
+     * @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 = {"bd2sp","fl2sp","sh2bd"})
+    public AdmResponse archSubsetCalcRelation(@QueryParam("projectId") String projectId,
+                                              @QueryParam("objectTypes") String objectTypeStr,
+                                              @QueryParam("relationType") String relationTypeStr,
+                                              HttpServletRequest request) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        admRelCalService.calcRelation(context,getAdmRelationTypeEnum(request),objectTypeStr,relationTypeStr);
+        return AdmResponse.success(new ArrayList<>());
+    }
+
+    /***
+     * Description: 添加关系(图类型关系为MechInArch)
+     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
+     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
+     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
+     * eq2bd:设备所在建筑
+     * eq2fl:设备所在楼层
+     * eq2sh:设备所在竖井
+     * eq2sp_in:设备所在业务空间
+     * sy2bd: 系统所在建筑
+     * sy2fl: 系统所在楼层
+     * sy2sh: 系统所在竖井
+     * sy2sp: 系统所在业务空间
+     * @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 = {"eq2bd","eq2fl","eq2sh","eq2sp_in","sy2bd","sy2fl","sy2sh","sy2sp"})
+    public AdmResponse mechInArchCalcRelation(@QueryParam("projectId") String projectId,
+                                              @QueryParam("objectTypes") String objectTypeStr,
+                                              @QueryParam("relationType") String relationTypeStr,
+                                              HttpServletRequest request) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        admRelCalService.calcRelation(context,getAdmRelationTypeEnum(request),objectTypeStr,relationTypeStr);
+        return AdmResponse.success(new ArrayList<>());
+    }
+
+    /***
+     * Description: 添加关系(图类型关系为PropertyInArch)
+     * @param relType : 关系类型
+     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
+     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
+     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
+     * pe2bd:资产所在建筑
+     * pe2fl:资产所在楼层
+     * pe2sh:资产所在竖井
+     * pe2sp:资产所在业务空间
+     * @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 = {"pe2bd","pe2fl","pe2sh","pe2sp"})
+    public AdmResponse propertyInArchCalcRelation( @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: 添加关系(图类型关系为MechForArch)
+     * @param relType : 关系类型
+     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
+     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
+     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
+     * eq2sp_for:设备服务空间关系
+     * @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 = {"eq2sp_for"})
+    public AdmResponse mechForArchCalcRelation( @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: 添加关系(图类型关系为ArchForArch)
+     * @param relType : 关系类型
+     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
+     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
+     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
+     * sp2sp:空间服务于空间
+     * @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 = {"sp2sp"})
+    public AdmResponse archForArchCalcRelation( @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: 添加关系(图类型关系为SensorRelationship)
+     * @param relType : 关系类型
+     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
+     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
+     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
+     * eq2sp_SensorRelationship_ss2sp:传感器测量空间关系
+     * @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 = {"eq2sp_SensorRelationship_ss2sp"})
+    public AdmResponse sensorRelationshipCalcRelation( @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: 添加关系(图类型关系为ConvectionNetwork)
+     * @param relType : 关系类型
+     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
+     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
+     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
+     * sp2sp_ConvectionNetwork_1:Natural-空气自然对流
+     * @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 = {"sp2sp_ConvectionNetwork_1"})
+    public AdmResponse convectionNetworkCalcRelation( @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: 添加关系(图类型关系为RadiationNetwork)
+     * @param relType : 关系类型
+     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
+     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
+     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
+     * sp2sp_RadiationNetwork_1:光照辐射网络-Connect-光照连通
+     * @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 = {"sp2sp_RadiationNetwork_1"})
+    public AdmResponse radiationNetworkCalcRelation( @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: 添加关系(图类型关系为SpaceNeighborhood)
+     * @param relType : 关系类型
+     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
+     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
+     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
+     * sp2sp_SpaceNeighborhood_5:业务空间(同类)邻接关系-Connect-空间连通
+     * @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 = {"sp2sp_SpaceNeighborhood_5"})
+    public AdmResponse spaceNeighborhoodCalcRelation( @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: 添加关系(计算设备所在建筑,系统所在建筑,图类型关系为MechInArch)
+     * @param relType : 关系类型
+     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
+     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
+     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
+     * syeq2bd:建筑下的系统设备部件,计算设备所在建筑(eq2bd),系统所在建筑(sy2bd)
+     * @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 = {"syeq2bd"})
+    public AdmResponse syeq2bdCalcRelation( @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: 添加关系(图类型关系为TrafficNetwork)
+     * @param relType : 关系类型
+     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
+     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
+     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
+     * sp2sp_TrafficNetwork_1:建筑交通网络(同类)-Normal-普通交通
+     * @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 = {"sp2sp_TrafficNetwork_1"})
+    public AdmResponse trafficNetworkCalcRelation( @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: 添加关系(图类型关系为ThroughRelationship)
+     * @param relType : 关系类型
+     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型),以英文逗号隔开 HeatingZone,CleanZone,
+     *                      DomesticWaterSupplyZone,NetworkZone,TenantZone,AirConditioningZone,FunctionZone,
+     *                      FireZone,SecurityZone,GeneralZone,PowerSupplyZone,LightingZone
+     * fl2fl:楼层贯通关系
+     * sh2sh:竖井贯通关系
+     * @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 = {"fl2fl","sh2sh"})
+    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: 添加关系(图类型关系为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 : 关系类型
+     * @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 changeSign( @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 request : 请求体
+     * @return : com.persagy.proxy.adm.constant.AdmRelationTypeEnum
+     * @author : lijie
+     * @date :2021/9/11 22:33
+     * Update By lijie 2021/9/11 22:33
+     */
+    private AdmRelationTypeEnum getAdmRelationTypeEnum(HttpServletRequest request) {
+        String suffix = getSuffixRequestUrl(request);
+        Map<String, AdmRelationTypeEnum> relationTypeMap = AdmRelationTypeEnum.getRelationTypeMap();
+        if (!relationTypeMap.containsKey(suffix)){
+            throw new BusinessException(BusinessErrorRwdCode.A7201.getCode(),BusinessErrorRwdCode.A7201.getDesc());
+        }
+        return relationTypeMap.get(suffix);
+    }
+
+    /***
+     * Description: 获得最后一个/后请求地址
+     * @param request : 请求对象
+     * @return : void
+     * @author : lijie
+     * @date :2021/9/11 22:09
+     * Update By lijie 2021/9/11 22:09
+     */
+    private String getSuffixRequestUrl(HttpServletRequest request) {
+        String requestURI = request.getRequestURI();
+        return requestURI.substring(requestURI.lastIndexOf("/"));
+    }
+
+
+
+}

+ 31 - 0
src/main/java/com/persagy/proxy/adm/service/AdmRelCalService.java

@@ -0,0 +1,31 @@
+package com.persagy.proxy.adm.service;
+
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.model.AdmManualRelCalRequest;
+import com.persagy.proxy.adm.model.AdmManualRelationCalcDel;
+import com.persagy.proxy.adm.model.AdmRelationAddRequest;
+import com.persagy.proxy.adm.request.AdmCreateResponse;
+import com.persagy.proxy.adm.request.AdmResponse;
+import com.persagy.proxy.common.entity.InstanceUrlParam;
+
+/***
+ * Description: 关系计算逻辑处理接口
+ * @author : lijie
+ * @date :2021/8/31 12:14
+ * Update By lijie 2021/8/31 12:14
+ */
+public interface AdmRelCalService {
+
+    /***
+     * Description: 计算关系
+     * @param context : 请求参数
+     * @param admRelationTypeEnum : 关系类型
+     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型)
+     * @param relationTypeStr : 关系类型
+     * @return : void
+     * @author : lijie
+     * @date :2021/9/11 20:35
+     * Update By lijie 2021/9/11 20:35
+     */
+    void calcRelation(InstanceUrlParam context, AdmRelationTypeEnum admRelationTypeEnum, String objectTypeStr, String relationTypeStr);
+}

+ 40 - 0
src/main/java/com/persagy/proxy/adm/service/impl/AdmRelCalServiceImpl.java

@@ -0,0 +1,40 @@
+package com.persagy.proxy.adm.service.impl;
+
+import com.persagy.dmp.basic.dto.RequestData;
+import com.persagy.dmp.common.constant.CommonConstant;
+import com.persagy.dmp.digital.client.DigitalRelationCaclFacade;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.service.AdmRelCalService;
+import com.persagy.proxy.common.entity.InstanceUrlParam;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+@Service
+@Slf4j
+@RequiredArgsConstructor
+public class AdmRelCalServiceImpl implements AdmRelCalService {
+
+    /***
+     * Description: 计算关系
+     * @param context : 请求参数
+     * @param admRelationTypeEnum : 关系类型
+     * @param objectTypeStr : 参与计算的业务空间(为空表示所有业务空间类型)
+     * @param relationTypeStr : 关系类型
+     * return : void
+     * @author : lijie
+     * date :2021/9/11 20:35
+     * Update By lijie 2021/9/11 20:35
+     */
+    @Override
+    public void calcRelation(InstanceUrlParam context, AdmRelationTypeEnum admRelationTypeEnum, String objectTypeStr,
+                             String relationTypeStr) {
+        // 调用中台的计算逻辑
+        DigitalRelationCaclFacade.calculatingObjRelationPrototype(context.getGroupCode(),context.getProjectId(),
+                context.getAppId(), CommonConstant.DEFAULT_ID, RequestData.builder()
+                        .graphCode(admRelationTypeEnum.getGraphCode())
+                        .relCode(admRelationTypeEnum.getRelCode())
+                        .calBeforeRelFlag(true)
+                        .build());
+    }
+}