Browse Source

实现/rel-manual-calc/query接口

lijie 3 years ago
parent
commit
78f605302c

+ 111 - 0
src/main/java/com/persagy/proxy/adm/constant/AdmObjectInfoConstant.java

@@ -32,4 +32,115 @@ public interface AdmObjectInfoConstant {
     Set<String> CHECK_SPECIAL_TYPES= CollUtil.newHashSet("sp2sp_RadiationNetwork_2","sp2sp_RadiationNetwork_1",
             "sp2sp_ConvectionNetwork_2","sp2sp_ConvectionNetwork_3","sp2sp_ConvectionNetwork_1",
             "sp2sp_TrafficNetwork_3","sp2sp_TrafficNetwork_2","sp2sp_TrafficNetwork_1");
+
+    Set<String> SOURCE_FLAG_FALSE=CollUtil.newHashSet("eq2eq_GasNetwork_2", "eq2fl",
+            "sp2sp_SpaceNeighborhood_3", "eq2sp_in", "sh2bd", "sp2sp_SpaceNeighborhood_2", "sp2sp_SpaceNeighborhood_5",
+            "eq2sp_in", "sy2sh_for", "eq2sp_for", "eq2sp_in", "eq2sy", "eq2eq_ChillWaterLoop_4", "eq2bd_for",
+            "sp2sp_SpaceNeighborhood_1", "eq2eq_ValveRelationship_vv2eq", "eq2eq_SensorNetwork_1", "eq2sp_in",
+            "eq2eq_CoolingWaterLoop_3", "eq2fl_for", "eq2eq_EquipPower_3", "eq2sp_for", "eq2eq_ACAirNetwork_3",
+            "eq2sp_for", "eq2eq_SupplyWaterNetwork_2", "eq2sy_ControlRelation_2", "eq2sp_in", "eq2sp_in",
+            "eq2eq_HeatWaterLoop_4", "bd2sp", "sp2sp_TrafficNetwork_2", "fl2sp", "Sh2Sp_ArchSubset", "eq2sp_for",
+            "sp2sp_ConvectionNetwork_2", "sy2sh", "sy2bd_MechInArch", "eq2eq_DHWNetwork_2", "eq2sp_for",
+            "sp2sp_ConvectionNetwork_3", "eq2eq_ControlEquipNetwork", "sy2fl_for", "eq2eq_RecycleWaterNetwork_2",
+            "eq2sy_SensorRelationship_ss2sy", "sp2sp_SpaceNeighborhood_4", "eq2sp_in", "eq2sp_in", "pe2fl",
+            "eq2sp_in", "eq2sp_for", "sh2sh", "eq2eq_LUDistribution_1", "eq2eq_HUDistribution_2",
+            "eq2eq_DrainingWaterNetwork_2", "fl2fl", "eq2eq_LUDistribution_2", "eq2sp_for",
+            "eq2eq_DrinkingWaterNetwork_2", "eq2sp_SensorRelationship_ss2sp", "eq2sp_in", "tn2sp",
+            "eq2eq_ChillWaterLoop_3", "eq2eq_GasNetwork_1", "sy2bd_for", "eq2eq_EquipPower_4", "eq2sp_for",
+            "eq2eq_CoolingWaterLoop_4", "eq2sp_in", "eq2sh", "pe2bd", "eq2sh_for", "eq2eq_EquipPower_2",
+            "eq2sy_ValveRelationship_vv2sy", "sp2sp_TrafficNetwork_1", "eq2sp_in", "eq2sp_in", "eq2sp_in",
+            "eq2sp_in", "sp2sp_RadiationNetwork_2", "eq2eq_FireWaterNetwork_2", "sp2sp_ConvectionNetwork_1",
+            "sp2sp_TrafficNetwork_3", "eq2eq_EquipPower_1", "sy2fl", "eq2sp_for", "eq2eq_SensorRelationship_ss2eq",
+            "eq2sp_for", "pe2sh", "eq2eq_ControlRelation_1", "sp2sp_RadiationNetwork_1", "sh2sp",
+            "eq2eq_HeatWaterLoop_3", "bd2bd_ArchForArch", "sh2fl_ArchForArch", "sh2sh_ArchForArch",
+            "sh2sp_ArchForArch", "sp2bd_ArchForArch", "sp2fl_ArchForArch", "sp2sh_ArchForArch", "sp2sp_ArchForArch",
+            "bd2fl_ArchForArch", "bd2sh_ArchForArch", "bd2sh_ArchSubset", "bd2sp_ArchForArch", "fl2bd_ArchForArch",
+            "fl2fl_ArchForArch", "fl2sh_ArchForArch", "fl2sp_ArchForArch", "sh2bd_ArchForArch", "sy2sp",
+            "syeq2bd", "sy2sp_for", "eq2sp_for", "eq2sp_for", "eq2sp_for", "eq2sp_for", "eq2sp_for",
+            "eq2eq_VentNetwork_3", "eq2eq_HUDistribution_1");
+
+    Set<String> SOURCE_FLAG_TRUE=CollUtil.newHashSet("eq2eq_DrainingWaterNetwork_1",
+            "eq2eq_ACAirNetwork_2", "eq2eq_CondWaterNetwork_1", "eq2eq_HeatWaterLoop_1", "eq2eq_DHWNetwork_1",
+            "eq2eq_RecycleWaterNetwork_1", "eq2eq_FireVentNetwork_1", "eq2eq_FireWaterNetwork_1", "eq2eq_VRFNetwork_1",
+            "eq2eq_ChillWaterLoop_2", "eq2eqFreshAirNetwork_1", "eq2eq_ChillWaterLoop_1",
+            "eq2eq_DrinkingWaterNetwork_2", "eq2eq_CoolingWaterLoop_2", "eq2eq_VentNetwork_1", "eq2eq_HeatWaterLoop_2",
+            "eq2eq_CoolingWaterLoop_1", "eq2eq_ACAirNetwork_1", "eq2eq_SupplyWaterNetwork_1");
+
+    Set<String> AUTOMATIC_FLAG_FALSE=CollUtil.newHashSet("eq2eq_GasNetwork_2", "sp2sp_SpaceNeighborhood_3", "sp2sp_SpaceNeighborhood_2",
+            "sy2sh_for", "eq2sp_for", "eq2sy", "eq2eq_ChillWaterLoop_4", "eq2bd_for", "sp2sp_SpaceNeighborhood_1",
+            "eq2eq_ValveRelationship_vv2eq", "eq2eq_SensorNetwork_1", "eq2eq_CoolingWaterLoop_3", "eq2fl_for",
+            "eq2eq_EquipPower_3", "eq2sp_for", "eq2eq_SupplyWaterNetwork_2", "eq2sy_ControlRelation_2",
+            "sp2sp_TrafficNetwork_2", "Sh2Sp_ArchSubset", "eq2sp_for", "sp2sp_ConvectionNetwork_2",
+            "sy2bd_MechInArch", "eq2eq_DHWNetwork_2", "eq2sp_for", "sp2sp_ConvectionNetwork_3",
+            "eq2eq_ControlEquipNetwork", "sy2fl_for", "eq2eq_RecycleWaterNetwork_2", "eq2sy_SensorRelationship_ss2sy",
+            "sp2sp_SpaceNeighborhood_4", "eq2sp_for", "eq2eq_LUDistribution_1", "eq2eq_HUDistribution_2",
+            "eq2eq_DrainingWaterNetwork_2", "eq2eq_LUDistribution_2", "eq2sp_for", "eq2eq_DrinkingWaterNetwork_2",
+            "tn2sp", "eq2eq_ChillWaterLoop_3", "eq2eq_GasNetwork_1", "sy2bd_for", "eq2eq_EquipPower_4", "eq2sp_for",
+            "eq2eq_CoolingWaterLoop_4", "eq2sh_for", "eq2eq_EquipPower_2", "eq2sy_ValveRelationship_vv2sy",
+            "sp2sp_RadiationNetwork_2", "eq2eq_FireWaterNetwork_2", "sp2sp_TrafficNetwork_3", "eq2eq_EquipPower_1",
+            "eq2eq_SensorRelationship_ss2eq", "eq2sp_for", "eq2eq_ControlRelation_1", "sh2sp", "eq2eq_HeatWaterLoop_3",
+            "bd2bd_ArchForArch", "sh2fl_ArchForArch", "sh2sh_ArchForArch", "sh2sp_ArchForArch", "sp2bd_ArchForArch",
+            "sp2fl_ArchForArch", "sp2sh_ArchForArch", "sp2sp_ArchForArch", "bd2fl_ArchForArch", "bd2sh_ArchForArch",
+            "bd2sh_ArchSubset", "bd2sp_ArchForArch", "fl2bd_ArchForArch", "fl2fl_ArchForArch", "fl2sh_ArchForArch",
+            "fl2sp_ArchForArch", "sh2bd_ArchForArch", "sy2sp_for", "eq2sp_for", "eq2sp_for", "eq2sp_for",
+            "eq2sp_for", "eq2sp_for", "eq2eq_VentNetwork_3", "eq2eq_HUDistribution_1");
+
+    Set<String> AUTOMATIC_FLAG_TRUE=CollUtil.newHashSet("eq2fl", "eq2sp_in", "sh2bd", "sp2sp_SpaceNeighborhood_5",
+            "eq2sp_in", "eq2eq_DrainingWaterNetwork_1", "eq2sp_in", "eq2eq_ACAirNetwork_2",
+            "eq2eq_CondWaterNetwork_1", "pe2sp", "eq2eq_VentNetwork_2", "eq2sp_in", "eq2sp_for",
+            "eq2eq_ACAirNetwork_3", "eq2sp_in", "eq2sp_in", "eq2eq_HeatWaterLoop_4", "bd2sp", "fl2sp",
+            "sy2sh", "eq2eq_HeatWaterLoop_1", "eq2eq_DHWNetwork_1", "eq2sp_in", "eq2sp_in", "pe2fl",
+            "eq2eq_RecycleWaterNetwork_1", "eq2sp_in", "sh2sh", "eq2eq_FireVentNetwork_1", "eq2eq_FireWaterNetwork_1",
+            "fl2fl", "eq2eq_VRFNetwork_1", "eq2sp_SensorRelationship_ss2sp", "eq2sp_in", "eq2eq_ChillWaterLoop_2",
+            "eq2eqFreshAirNetwork_1", "eq2sp_in", "eq2sh", "eq2eq_ChillWaterLoop_1", "eq2eq_DrinkingWaterNetwork_2",
+            "pe2bd", "eq2eq_CoolingWaterLoop_2", "sp2sp_TrafficNetwork_1", "eq2sp_in", "eq2sp_in", "eq2sp_in",
+            "eq2sp_in", "sp2sp_ConvectionNetwork_1", "eq2eq_VentNetwork_1", "sy2fl", "eq2sp_for", "pe2sh",
+            "eq2eq_HeatWaterLoop_2", "sp2sp_RadiationNetwork_1", "eq2eq_CoolingWaterLoop_1", "sy2sp",
+            "syeq2bd", "eq2eq_ACAirNetwork_1", "eq2eq_SupplyWaterNetwork_1");
+
+    Set<String> MANUAL_FLAG_TWO = CollUtil.newHashSet("eq2fl", "eq2sp_in", "sh2bd", "eq2sp_in", "eq2sp_for",
+            "eq2sp_in", "eq2sy", "eq2sp_in", "eq2sp_for", "eq2sp_for", "eq2sp_in", "eq2sp_in", "bd2sp", "fl2sp",
+            "Sh2Sp_ArchSubset", "eq2sp_for", "sy2sh", "sy2bd_MechInArch", "eq2sp_for", "eq2sp_in", "eq2sp_in",
+            "pe2fl", "eq2sp_in", "eq2sp_for", "sh2sh", "fl2fl", "eq2sp_for", "eq2sp_in", "tn2sp", "eq2sp_for",
+            "eq2sp_in", "eq2sh", "pe2bd", "eq2sp_in", "eq2sp_in", "eq2sp_in", "eq2sp_in", "sy2fl", "eq2sp_for",
+            "eq2sp_for", "sh2sp", "bd2sh_ArchSubset", "sy2sp", "syeq2bd", "eq2sp_for", "eq2sp_for", "eq2sp_for",
+            "eq2sp_for", "eq2sp_for");
+
+    Set<String> MANUAL_FLAG_THREE = CollUtil.newHashSet("eq2eq_GasNetwork_2", "sp2sp_SpaceNeighborhood_3",
+            "sp2sp_SpaceNeighborhood_2", "sp2sp_SpaceNeighborhood_5", "sy2sh_for", "eq2eq_DrainingWaterNetwork_1",
+            "eq2eq_ACAirNetwork_2", "eq2eq_ChillWaterLoop_4", "eq2bd_for", "eq2eq_CondWaterNetwork_1",
+            "sp2sp_SpaceNeighborhood_1", "eq2eq_ValveRelationship_vv2eq", "pe2sp", "eq2eq_VentNetwork_2",
+            "eq2eq_SensorNetwork_1", "eq2eq_CoolingWaterLoop_3", "eq2fl_for", "eq2eq_EquipPower_3",
+            "eq2eq_ACAirNetwork_3", "eq2eq_SupplyWaterNetwork_2", "eq2sy_ControlRelation_2", "eq2eq_HeatWaterLoop_4",
+            "sp2sp_TrafficNetwork_2", "sp2sp_ConvectionNetwork_2", "eq2eq_DHWNetwork_2", "eq2eq_HeatWaterLoop_1",
+            "sp2sp_ConvectionNetwork_3", "eq2eq_ControlEquipNetwork", "sy2fl_for", "eq2eq_DHWNetwork_1",
+            "eq2eq_RecycleWaterNetwork_2", "eq2sy_SensorRelationship_ss2sy", "sp2sp_SpaceNeighborhood_4",
+            "eq2eq_RecycleWaterNetwork_1", "eq2eq_LUDistribution_1", "eq2eq_FireVentNetwork_1",
+            "eq2eq_FireWaterNetwork_1", "eq2eq_HUDistribution_2", "eq2eq_DrainingWaterNetwork_2",
+            "eq2eq_VRFNetwork_1", "eq2eq_LUDistribution_2", "eq2eq_DrinkingWaterNetwork_2",
+            "eq2sp_SensorRelationship_ss2sp", "eq2eq_ChillWaterLoop_3", "eq2eq_ChillWaterLoop_2",
+            "eq2eq_GasNetwork_1", "sy2bd_for", "eq2eqFreshAirNetwork_1", "eq2eq_EquipPower_4",
+            "eq2eq_CoolingWaterLoop_4", "eq2eq_ChillWaterLoop_1", "eq2eq_DrinkingWaterNetwork_2", "eq2sh_for",
+            "eq2eq_EquipPower_2", "eq2eq_CoolingWaterLoop_2", "eq2sy_ValveRelationship_vv2sy", "sp2sp_TrafficNetwork_1",
+            "sp2sp_RadiationNetwork_2", "eq2eq_FireWaterNetwork_2", "sp2sp_ConvectionNetwork_1", "eq2eq_VentNetwork_1",
+            "sp2sp_TrafficNetwork_3", "eq2eq_EquipPower_1", "eq2eq_SensorRelationship_ss2eq", "pe2sh",
+            "eq2eq_HeatWaterLoop_2", "eq2eq_ControlRelation_1", "sp2sp_RadiationNetwork_1", "eq2eq_HeatWaterLoop_3",
+            "eq2eq_CoolingWaterLoop_1", "bd2bd_ArchForArch", "sh2fl_ArchForArch", "sh2sh_ArchForArch",
+            "sh2sp_ArchForArch", "sp2bd_ArchForArch", "sp2fl_ArchForArch", "sp2sh_ArchForArch", "sp2sp_ArchForArch",
+            "bd2fl_ArchForArch", "bd2sh_ArchForArch", "bd2sp_ArchForArch", "fl2bd_ArchForArch", "fl2fl_ArchForArch",
+            "fl2sh_ArchForArch", "fl2sp_ArchForArch", "sh2bd_ArchForArch", "sy2sp_for", "eq2eq_ACAirNetwork_1",
+            "eq2eq_SupplyWaterNetwork_1", "eq2eq_VentNetwork_3", "eq2eq_HUDistribution_1");
+    /**系统类型,风系统1,水系统0*/
+    Set<String> SYSTEM_TYPE_FALSE = CollUtil.newHashSet("eq2eq_GasNetwork_2", "eq2eq_DrainingWaterNetwork_1",
+            "eq2eq_CondWaterNetwork_1", "eq2eq_CoolingWaterLoop_3", "eq2eq_SupplyWaterNetwork_2",
+            "eq2eq_HeatWaterLoop_4", "eq2eq_DHWNetwork_2", "eq2eq_HeatWaterLoop_1", "eq2eq_DHWNetwork_1",
+            "eq2eq_RecycleWaterNetwork_2", "eq2eq_RecycleWaterNetwork_1", "eq2eq_FireWaterNetwork_1",
+            "eq2eq_DrainingWaterNetwork_2", "eq2eq_VRFNetwork_1", "eq2eq_DrinkingWaterNetwork_2",
+            "eq2eq_ChillWaterLoop_3", "eq2eq_ChillWaterLoop_2", "eq2eq_GasNetwork_1", "eq2eq_CoolingWaterLoop_4",
+            "eq2eq_ChillWaterLoop_1", "eq2eq_DrinkingWaterNetwork_2", "eq2eq_CoolingWaterLoop_2",
+            "eq2eq_FireWaterNetwork_2", "eq2eq_HeatWaterLoop_2", "eq2eq_HeatWaterLoop_3",
+            "eq2eq_CoolingWaterLoop_1", "eq2eq_SupplyWaterNetwork_1");
+    /**系统类型,风系统1,水系统0*/
+    Set<String> SYSTEM_TYPE_TRUE = CollUtil.newHashSet("eq2eq_VentNetwork_2", "eq2eq_ACAirNetwork_3",
+            "eq2eq_FireVentNetwork_1", "eq2eq_VentNetwork_1", "eq2eq_ACAirNetwork_1", "eq2eq_VentNetwork_3");
 }

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

@@ -270,6 +270,16 @@ public enum AdmRelationTypeEnum {
     private Set<String> checkClassCodes;
     /**是否检查传感器使用的传感器类型*/
     private Set<String> checkSensorCodes;
+    /**是否需要配置源末端,0-不需要,1-需要*/
+    private Integer sourceFlag;
+    /**是否自动计算类型,0-不自动计算,1-自动计算*/
+    private Integer automaticFlag;
+    /**手动计算类型 1 禁用  2提示引导 3手动维护*/
+    private Integer manualFlag;
+    /**风系统1,水系统0*/
+    private Integer systemType;
+    ///**业务分区类型*/
+//    private String zoneType;
 
     /***
      * Description: 构造函数
@@ -300,6 +310,34 @@ public enum AdmRelationTypeEnum {
         this.hasCheckClassCode = hasCheckClassCode;
         this.checkClassCodes = CollUtil.newHashSet(AdmObjectInfoConstant.CHECK_CLASS_CODES);
         this.checkSensorCodes = CollUtil.newHashSet(AdmObjectInfoConstant.CHECK_SENSOR_CODES);
+        this.sourceFlag=null;
+        if (AdmObjectInfoConstant.SOURCE_FLAG_FALSE.contains(relationType)){
+            this.sourceFlag=0;
+        }
+        if (AdmObjectInfoConstant.SOURCE_FLAG_TRUE.contains(relationType)){
+            this.sourceFlag=1;
+        }
+        this.automaticFlag=null;
+        if (AdmObjectInfoConstant.AUTOMATIC_FLAG_FALSE.contains(relationType)){
+            this.automaticFlag=0;
+        }
+        if (AdmObjectInfoConstant.AUTOMATIC_FLAG_TRUE.contains(relationType)){
+            this.automaticFlag=1;
+        }
+        this.manualFlag=null;
+        if (AdmObjectInfoConstant.MANUAL_FLAG_TWO.contains(relationType)){
+            this.manualFlag=2;
+        }
+        if (AdmObjectInfoConstant.MANUAL_FLAG_THREE.contains(relationType)){
+            this.manualFlag=3;
+        }
+        this.systemType=null;
+        if (AdmObjectInfoConstant.SYSTEM_TYPE_FALSE.contains(relationType)){
+            this.systemType=0;
+        }
+        if (AdmObjectInfoConstant.SYSTEM_TYPE_TRUE.contains(relationType)){
+            this.systemType=1;
+        }
     }
     /***
      * Description: 构造函数

+ 18 - 0
src/main/java/com/persagy/proxy/adm/controller/AdmManualRelCalController.java

@@ -1,9 +1,12 @@
 package com.persagy.proxy.adm.controller;
 
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
+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.AdmManualRelCalResponse;
+import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.service.AdmManualRelCalService;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
 import lombok.RequiredArgsConstructor;
@@ -61,6 +64,21 @@ public class AdmManualRelCalController {
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
         return admManualRelationCalcService.delRels(context,admManualRelationCalcDel);
     }
+    /***
+     * Description: 查询关系数据
+     * @param admManualRelCalRequest : 请求参数
+     * @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 = "query")
+    public AdmResponse query(@QueryParam("projectId") String projectId,
+                             @Validated @RequestBody AdmManualRelCalRequest admManualRelCalRequest) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
+        return admManualRelationCalcService.query(context,admManualRelCalRequest);
+    }
 
 
 

+ 27 - 0
src/main/java/com/persagy/proxy/adm/model/AdmManualRelCalRequest.java

@@ -0,0 +1,27 @@
+package com.persagy.proxy.adm.model;
+
+import lombok.Data;
+
+@Data
+public class AdmManualRelCalRequest {
+
+    /**主从对象类型,主1、从2*/
+    private String objectType;
+    /**关系类型*/
+    private String relType;
+    /**分类类型*/
+    private String category;
+    /**楼层id,未明确楼层传(isNull)*/
+    private String floorId;
+    /**建筑id,未明确建筑传(isNull)*/
+    private String buildingId;
+    /**模糊查询 关键词*/
+    private String vague;
+    /**模糊查询 关键词*/
+    private String vagueTo;
+    /** 第几页(从1开始) */
+    private Integer pageNumber;
+    /** 每页记录数(0 < 记录数 < 1000) */
+    private Integer pageSize;
+
+}

+ 41 - 0
src/main/java/com/persagy/proxy/adm/request/AdmManualRelCalResponse.java

@@ -0,0 +1,41 @@
+package com.persagy.proxy.adm.request;
+
+import lombok.*;
+
+import java.util.List;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@AllArgsConstructor
+@NoArgsConstructor
+public class AdmManualRelCalResponse extends AdmResponse {
+
+    private final static String SUCCESS = "success";
+    private final static String FAILURE = "failure";
+
+    /** 方向 Left、right */
+    private String direction;
+
+    public AdmManualRelCalResponse(String result, String message, Long total, Integer pageNumber, Integer pageSize, List<?> content, String direction) {
+        this.setResult(result);
+        this.setMessage(message);
+        this.setTotal(total);
+        this.setPageNumber(pageNumber);
+        this.setPageSize(pageSize);
+        this.setContent(content);
+        this.setDirection(direction);
+    }
+
+    public static AdmResponse success() {
+        return new AdmManualRelCalResponse(SUCCESS, null, null, null, null, null,null);
+    }
+
+    public static AdmResponse failure(String message, String direction) {
+        return new AdmManualRelCalResponse(FAILURE, message, null, null, null, null,direction);
+    }
+
+    public static AdmResponse success(List<?> content, String direction) {
+        return new AdmManualRelCalResponse(SUCCESS, null, null, null, null, content,direction);
+    }
+}

+ 13 - 0
src/main/java/com/persagy/proxy/adm/service/AdmManualRelCalService.java

@@ -1,8 +1,11 @@
 package com.persagy.proxy.adm.service;
 
+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.AdmManualRelCalResponse;
+import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
 
 /***
@@ -32,4 +35,14 @@ public interface AdmManualRelCalService {
      * Update By lijie 2021/8/31 12:10
      */
     AdmCreateResponse delRels(InstanceUrlParam context, AdmManualRelationCalcDel admManualRelationCalcDel);
+    /***
+     * Description: 查询关系数据
+     * @param admManualRelCalRequest : 请求参数
+     * @return : com.persagy.proxy.adm.request.AdmCreateResponse
+     * @author : lijie
+     * @date :2021/8/31 12:10
+     * Update By lijie 2021/8/31 12:10
+     */
+    AdmResponse query(InstanceUrlParam context, AdmManualRelCalRequest admManualRelCalRequest);
+
 }

+ 47 - 0
src/main/java/com/persagy/proxy/adm/service/impl/AdmManualRelCalServiceImpl.java

@@ -1,17 +1,24 @@
 package com.persagy.proxy.adm.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.StrUtil;
 import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.common.context.AppContext;
 import com.persagy.dmp.common.model.response.CommonResult;
+import com.persagy.dmp.digital.client.DigitalObjectClient;
+import com.persagy.dmp.digital.client.DigitalObjectFacade;
 import com.persagy.dmp.digital.client.DigitalRelationCaclClient;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
 import com.persagy.proxy.adm.constant.BusinessErrorRwdCode;
+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.AdmManualRelCalResponse;
+import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.service.AdmManualRelCalService;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
@@ -35,6 +42,8 @@ import java.util.Set;
 public class AdmManualRelCalServiceImpl implements AdmManualRelCalService {
 
     private final DigitalRelationCaclClient digitalRelationCaclClient;
+    private final DigitalObjectClient digitalObjectClient;
+
 
 
     /***
@@ -299,4 +308,42 @@ public class AdmManualRelCalServiceImpl implements AdmManualRelCalService {
         }
         return AdmCreateResponse.success("删除关系成功");
     }
+
+    /***
+     * Description: 查询关系数据
+     * @param admManualRelCalRequest : 请求参数
+     * @return : com.persagy.proxy.adm.request.AdmCreateResponse
+     * @author : lijie
+     * @date :2021/8/31 12:10
+     * Update By lijie 2021/8/31 12:10
+     */
+    @Override
+    public AdmResponse query(InstanceUrlParam context, AdmManualRelCalRequest admManualRelCalRequest) {
+        Map<String, AdmRelationTypeEnum> relationTypeMap = AdmRelationTypeEnum.getRelationTypeMap();
+        if (relationTypeMap.containsKey(admManualRelCalRequest.getRelType())){
+            return AdmManualRelCalResponse.failure("不存在的关系类型");
+        }
+        AdmRelationTypeEnum relationTypeEnum = relationTypeMap.get(admManualRelCalRequest.getRelType());
+        RequestData requestData = RequestData.builder()
+                .graphCode(relationTypeEnum.getGraphCode())
+                .relCode(relationTypeEnum.getRelCode())
+                .relValue(admManualRelCalRequest.getCategory())
+                .mainContent(admManualRelCalRequest.getVague())
+                .build();
+        if (null!=admManualRelCalRequest.getPageNumber()){
+            requestData.setPage(Long.valueOf(admManualRelCalRequest.getPageNumber()));
+        }
+        if (null!=admManualRelCalRequest.getPageSize()){
+            requestData.setSize(Long.valueOf(admManualRelCalRequest.getPageSize()));
+        }
+        if (StrUtil.isNotBlank(admManualRelCalRequest.getVagueTo())){
+            requestData.setFromContent(CollUtil.newHashSet(admManualRelCalRequest.getVagueTo()));
+        }
+        CommonResult<List<ObjectDigital>> commonResult = digitalObjectClient
+                .queryObjectListByGraphCodeAndRelCode(context.getGroupCode(), context.getProjectId(),
+                        context.getAppId(), "0", requestData);
+        return new AdmManualRelCalResponse(commonResult.getResult(),commonResult.getMessage(),commonResult.getCount(),
+                admManualRelCalRequest.getPageNumber(),admManualRelCalRequest.getPageSize(),
+                commonResult.getData(),"Left");
+    }
 }