Sfoglia il codice sorgente

完善下载报表功能

zhangqiankun 3 anni fa
parent
commit
839088fc90
22 ha cambiato i file con 961 aggiunte e 7 eliminazioni
  1. 32 2
      src/main/java/com/persagy/proxy/adm/constant/AdmRelationType.java
  2. 41 0
      src/main/java/com/persagy/proxy/adm/constant/SpaceTypeEnum.java
  3. 3 2
      src/main/java/com/persagy/proxy/adm/controller/RelationReportController.java
  4. 9 1
      src/main/java/com/persagy/proxy/adm/handler/RelationImportExcelDataHandler.java
  5. 4 0
      src/main/java/com/persagy/proxy/adm/service/impl/RelationReportService.java
  6. 4 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/AbstractQueryRelationObject.java
  7. 56 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqEqBackupRelationObject.java
  8. 56 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqEqNormalRelationObject.java
  9. 56 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqSyBackupRelationObject.java
  10. 56 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqSyNormalRelationObject.java
  11. 1 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2SpRelationObject.java
  12. 59 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpConnectRelationObject.java
  13. 59 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpFFCloseRelationObject.java
  14. 59 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpFFOpenRelationObject.java
  15. 59 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpMixMechRelationObject.java
  16. 59 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpNaturalRelationObject.java
  17. 59 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpNormalRelationObject.java
  18. 59 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpOnewayMechRelationObject.java
  19. 59 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpTransparentRelationObject.java
  20. 57 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2EqShipRelationObject.java
  21. 57 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2SpShipRelationObject.java
  22. 57 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2SyShipRelationObject.java

+ 32 - 2
src/main/java/com/persagy/proxy/adm/constant/AdmRelationType.java

@@ -14,6 +14,8 @@ public interface AdmRelationType {
 	String EQ2BD = "eq2bd";
 	
 	String EQ2FL = "eq2fl";
+	
+	String EQ2SP = "eq2sp";
 
 	String EQ2BD_FOR = "eq2bd_for";
 	
@@ -29,8 +31,6 @@ public interface AdmRelationType {
 	
 	String SY2SP_FOR = "sy2sp_for";
 	
-	String EQ2SP_SENSORRELATIONSHIP_SS2SP = "eq2sp_SensorRelationship_ss2sp";
-	
 	String SH2BD_ARCHFORARCH = "sh2bd_ArchForArch";
 	
 	String SH2FL_ARCHFORARCH = "sh2fl_ArchForArch";
@@ -43,4 +43,34 @@ public interface AdmRelationType {
 	
 	String SP2FL_ARCHFORARCH ="sp2fl_ArchForArch";
 	
+	String SP2SP_RADIATIONNETWORK_2 = "sp2sp_RadiationNetwork_2";
+	
+	String SP2SP_RADIATIONNETWORK_1 = "sp2sp_RadiationNetwork_1";
+	
+	String SP2SP_CONVECTIONNETWORK_2 = "sp2sp_ConvectionNetwork_2";
+	
+	String SP2SP_CONVECTIONNETWORK_3 = "sp2sp_ConvectionNetwork_3";
+	
+	String SP2SP_CONVECTIONNETWORK_1 = "sp2sp_ConvectionNetwork_1";
+	
+	String SP2SP_TRAFFICNETWORK_3 = "sp2sp_TrafficNetwork_3";
+	
+	String SP2SP_TRAFFICNETWORK_2 = "sp2sp_TrafficNetwork_2";
+	
+	String SP2SP_TRAFFICNETWORK_1 = "sp2sp_TrafficNetwork_1";
+	
+	String EQ2EQ_EQUIPPOWER_1 = "eq2eq_EquipPower_1";
+	
+	String EQ2EQ_EQUIPPOWER_2 = "eq2eq_EquipPower_2";
+	
+	String EQ2EQ_EQUIPPOWER_3 = "eq2eq_EquipPower_3";
+	
+	String EQ2EQ_EQUIPPOWER_4 = "eq2eq_EquipPower_4";
+	
+	String EQ2EQ_SENSORRELATIONSHIP_SS2EQ = "eq2eq_SensorRelationship_ss2eq";
+	
+	String EQ2SY_SENSORRELATIONSHIP_SS2SY = "eq2sy_SensorRelationship_ss2sy";
+	
+	String EQ2SP_SENSORRELATIONSHIP_SS2SP = "eq2sp_SensorRelationship_ss2sp";
+	
 }

+ 41 - 0
src/main/java/com/persagy/proxy/adm/constant/SpaceTypeEnum.java

@@ -0,0 +1,41 @@
+package com.persagy.proxy.adm.constant;
+
+import lombok.Getter;
+
+/**
+ * 业务空间类型
+ * 
+ * @version 1.0.0
+ * @company persagy 
+ * @author zhangqiankun
+ * @date 2021年9月6日 下午3:43:35
+ */
+@Getter
+public enum SpaceTypeEnum {
+
+	GeneralZone("GeneralZone", "物业分区"),
+	PowerSupplyZone("PowerSupplyZone", "供电分区"),
+	LightingZone("LightingZone", "照明分区"),
+	NetworkZone("NetworkZone", "网络分区"),
+	AirConditioningZone("AirConditioningZone", "空调分区"),
+	HeatingZone("HeatingZone", "采暖分区"),
+	CleanZone("CleanZone", "洁净分区"),
+	DomesticWaterSupplyZone("DomesticWaterSupplyZone", "生活给水分区"),
+	FireZone("FireZone", "防火分区"),
+	SecurityZone("SecurityZone", "安防分区"),
+	TenantZone("TenantZone", "租户分区"),
+	FunctionZone("FunctionZone", "功能分区"),
+	PassengerFlowZone("PassengerFlowZone", "客流分区"),
+	EvacuateZone("EvacuateZone", "疏散分区"),
+	EnvironmentZone("EnvironmentZone", "环境分区"),
+	OtherZone("OtherZone", "其他分区");
+
+	private String code;
+    private String desc;
+
+    SpaceTypeEnum(String code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+    
+}

+ 3 - 2
src/main/java/com/persagy/proxy/adm/controller/RelationReportController.java

@@ -18,6 +18,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.ExcelWriter;
+import com.google.common.collect.Lists;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.handler.RelationImportExcelDataHandler;
 import com.persagy.proxy.adm.model.AdmRelationObject;
@@ -251,9 +252,9 @@ public class RelationReportController {
 			String projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER);
 			
 			RelationImportExcelDataHandler excelDataHandler = new RelationImportExcelDataHandler(groupCode, projectId, relType, queryRelationObjectContext);
-			
         	EasyExcel.read(file.getInputStream(), AdmRelationObject.class, excelDataHandler).sheet(EXPORT_SHEET_NAME).doRead();
-        	return AdmResponse.success();
+        	
+        	return AdmResponse.success(Lists.newArrayList(excelDataHandler.afterWriteObject()));
 		} catch (Exception e) {
 			log.error("文件导入失败", e);
 			failure = e.getMessage();

+ 9 - 1
src/main/java/com/persagy/proxy/adm/handler/RelationImportExcelDataHandler.java

@@ -129,7 +129,15 @@ public class RelationImportExcelDataHandler extends AnalysisEventListener<AdmRel
 		result.put("relationType", graphId);
 		result.put("successCount", successNum);
 		result.put("failCount", failureNum);
-		result.put("state", graphId);
+		String state = null;
+        if (successNum > 0 && failureNum > 0) {
+        	state = "1";
+        } else if (successNum > 0 && failureNum == 0) {
+            state = "0";
+        } else {
+            state = "2";
+        }
+        result.put("state", state);
 		return result;
 	}
 	

+ 4 - 0
src/main/java/com/persagy/proxy/adm/service/impl/RelationReportService.java

@@ -15,6 +15,7 @@ import com.persagy.dmp.digital.client.DigitalObjectFacade;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
+import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 import com.persagy.proxy.adm.strategy.QueryRelationObjectContext;
@@ -123,6 +124,9 @@ public class RelationReportService implements IRelationReportService {
 	@Override
 	public List<AdmRelationObject> reportRelationObject(String groupCode, String projectId, String relType, String code, String zoneType) {
 		groupCode = StrUtil.isBlank(groupCode) ? defaultCode : groupCode;
+		if (AdmRelationType.EQ2SP_SENSORRELATIONSHIP_SS2SP.equals(relType)){
+			relType = AdmRelationType.EQ2SP;
+        }
 		log.info("下载报表: groupCode[{}], projectId[{}], relType[{}], code[{}]", groupCode, projectId, relType, code);
 		return this.queryRelationObjectContext.findRelationObject(groupCode, projectId, relType);
 	}

+ 4 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/AbstractQueryRelationObject.java

@@ -165,7 +165,10 @@ public abstract class AbstractQueryRelationObject implements QueryRelationObject
 	protected String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, AdmRelationTypeEnum relationTypeEnum,
 			String groupCode, String projectId, String code) {
 		if (!StrUtil.isAllNotBlank(relationObject.getMasterCode(), relationObject.getSlaveCode())) {
-			return "主对象和从对象的识别编码为空";
+			return "主对象或从对象的识别编码为空";
+		}
+		if (!StrUtil.isAllNotBlank(relationObject.getMasterId(), relationObject.getSlaveId())) {
+			return "主对象或从对象的ID为空";
 		}
 		
 		String relCode = relationTypeEnum.getRelCode();

+ 56 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqEqBackupRelationObject.java

@@ -0,0 +1,56 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
+import com.persagy.proxy.adm.constant.AdmRelationType;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.model.AdmRelationObject;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+/**
+ * 
+ * @version 1.0.0
+ * @company persagy
+ * @author zhangqiankun
+ * @date 2021年9月3日 上午9:42:46
+ */
+@Component(value = AdmRelationType.EQ2EQ_EQUIPPOWER_2)
+public class Eq2EqEqBackupRelationObject extends AbstractQueryRelationObject {
+	
+	public Eq2EqEqBackupRelationObject(IRelationReportService relationReportService) {
+		super(relationReportService);
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
+			String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	public String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, String groupCode,
+			String projectId, String code) {
+		return this.beforeSaveRelationObject(objectNode, relationObject, AdmRelationTypeEnum.EQ2EQ_EQUIPPOWER_2,
+				groupCode, projectId, code);
+	}
+
+	@Override
+	protected String checkRelationObject(ObjectNode master, String masterClassCode, ObjectNode slave,
+			String slaveClassCode) {
+		if (!AdmObjectInfoConstant.CHECK_CLASS_CODES.contains(masterClassCode)) {
+			return "主对象不属于低/高压开关柜,请参考规则";
+		}
+		return null;
+	}
+	
+}

+ 56 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqEqNormalRelationObject.java

@@ -0,0 +1,56 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
+import com.persagy.proxy.adm.constant.AdmRelationType;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.model.AdmRelationObject;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+/**
+ * 
+ * @version 1.0.0
+ * @company persagy
+ * @author zhangqiankun
+ * @date 2021年9月3日 上午9:42:46
+ */
+@Component(value = AdmRelationType.EQ2EQ_EQUIPPOWER_1)
+public class Eq2EqEqNormalRelationObject extends AbstractQueryRelationObject {
+	
+	public Eq2EqEqNormalRelationObject(IRelationReportService relationReportService) {
+		super(relationReportService);
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
+			String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	public String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, String groupCode,
+			String projectId, String code) {
+		return this.beforeSaveRelationObject(objectNode, relationObject, AdmRelationTypeEnum.EQ2EQ_EQUIPPOWER_1,
+				groupCode, projectId, code);
+	}
+
+	@Override
+	protected String checkRelationObject(ObjectNode master, String masterClassCode, ObjectNode slave,
+			String slaveClassCode) {
+		if (!AdmObjectInfoConstant.CHECK_CLASS_CODES.contains(masterClassCode)) {
+			return "主对象不属于低/高压开关柜,请参考规则";
+		}
+		return null;
+	}
+	
+}

+ 56 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqSyBackupRelationObject.java

@@ -0,0 +1,56 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
+import com.persagy.proxy.adm.constant.AdmRelationType;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.model.AdmRelationObject;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+/**
+ * 
+ * @version 1.0.0
+ * @company persagy
+ * @author zhangqiankun
+ * @date 2021年9月3日 上午9:42:46
+ */
+@Component(value = AdmRelationType.EQ2EQ_EQUIPPOWER_4)
+public class Eq2EqSyBackupRelationObject extends AbstractQueryRelationObject {
+	
+	public Eq2EqSyBackupRelationObject(IRelationReportService relationReportService) {
+		super(relationReportService);
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
+			String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	public String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, String groupCode,
+			String projectId, String code) {
+		return this.beforeSaveRelationObject(objectNode, relationObject, AdmRelationTypeEnum.EQ2EQ_EQUIPPOWER_4,
+				groupCode, projectId, code);
+	}
+
+	@Override
+	protected String checkRelationObject(ObjectNode master, String masterClassCode, ObjectNode slave,
+			String slaveClassCode) {
+		if (!AdmObjectInfoConstant.CHECK_CLASS_CODES.contains(masterClassCode)) {
+			return "主对象不属于低/高压开关柜,请参考规则";
+		}
+		return null;
+	}
+	
+}

+ 56 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqSyNormalRelationObject.java

@@ -0,0 +1,56 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
+import com.persagy.proxy.adm.constant.AdmRelationType;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.model.AdmRelationObject;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+/**
+ * 
+ * @version 1.0.0
+ * @company persagy
+ * @author zhangqiankun
+ * @date 2021年9月3日 上午9:42:46
+ */
+@Component(value = AdmRelationType.EQ2EQ_EQUIPPOWER_3)
+public class Eq2EqSyNormalRelationObject extends AbstractQueryRelationObject {
+	
+	public Eq2EqSyNormalRelationObject(IRelationReportService relationReportService) {
+		super(relationReportService);
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
+			String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	public String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, String groupCode,
+			String projectId, String code) {
+		return this.beforeSaveRelationObject(objectNode, relationObject, AdmRelationTypeEnum.EQ2EQ_EQUIPPOWER_3,
+				groupCode, projectId, code);
+	}
+
+	@Override
+	protected String checkRelationObject(ObjectNode master, String masterClassCode, ObjectNode slave,
+			String slaveClassCode) {
+		if (!AdmObjectInfoConstant.CHECK_CLASS_CODES.contains(masterClassCode)) {
+			return "主对象不属于低/高压开关柜,请参考规则";
+		}
+		return null;
+	}
+	
+}

+ 1 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2SpRelationObject.java

@@ -27,7 +27,7 @@ import com.persagy.proxy.adm.service.IRelationReportService;
  * @author zhangqiankun
  * @date 2021年9月3日 上午9:42:46
  */
-@Component(value = AdmRelationType.EQ2SP_SENSORRELATIONSHIP_SS2SP)
+@Component(value = AdmRelationType.EQ2SP)
 public class Eq2SpRelationObject extends AbstractQueryRelationObject {
 
 	public Eq2SpRelationObject(IRelationReportService relationReportService) {

+ 59 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpConnectRelationObject.java

@@ -0,0 +1,59 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.proxy.adm.constant.AdmRelationType;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.constant.SpaceTypeEnum;
+import com.persagy.proxy.adm.model.AdmRelationObject;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+/**
+ * 
+ * @version 1.0.0
+ * @company persagy
+ * @author zhangqiankun
+ * @date 2021年9月3日 上午9:42:46
+ */
+@Component(value = AdmRelationType.SP2SP_RADIATIONNETWORK_2)
+public class Sp2SpConnectRelationObject extends AbstractQueryRelationObject {
+	
+	public Sp2SpConnectRelationObject(IRelationReportService relationReportService) {
+		super(relationReportService);
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
+			String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	public String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, String groupCode,
+			String projectId, String code) {
+		return this.beforeSaveRelationObject(objectNode, relationObject, AdmRelationTypeEnum.SP2SP_RADIATIONNETWORK_2,
+				groupCode, projectId, code);
+	}
+
+	@Override
+	protected String checkRelationObject(ObjectNode master, String masterClassCode, ObjectNode slave,
+			String slaveClassCode) {
+		if (!SpaceTypeEnum.LightingZone.getCode().equals(masterClassCode)) {
+			return "主对象不属于照明分区类型,请参考规则";
+		}
+		if (!SpaceTypeEnum.LightingZone.getCode().equals(slaveClassCode)) {
+			return "从对象不属于照明分区类型,请参考规则";
+		}
+		return null;
+	}
+	
+}

+ 59 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpFFCloseRelationObject.java

@@ -0,0 +1,59 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.proxy.adm.constant.AdmRelationType;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.constant.SpaceTypeEnum;
+import com.persagy.proxy.adm.model.AdmRelationObject;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+/**
+ * 
+ * @version 1.0.0
+ * @company persagy
+ * @author zhangqiankun
+ * @date 2021年9月3日 上午9:42:46
+ */
+@Component(value = AdmRelationType.SP2SP_TRAFFICNETWORK_3)
+public class Sp2SpFFCloseRelationObject extends AbstractQueryRelationObject {
+	
+	public Sp2SpFFCloseRelationObject(IRelationReportService relationReportService) {
+		super(relationReportService);
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
+			String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	public String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, String groupCode,
+			String projectId, String code) {
+		return this.beforeSaveRelationObject(objectNode, relationObject, AdmRelationTypeEnum.SP2SP_TRAFFICNETWORK_3,
+				groupCode, projectId, code);
+	}
+
+	@Override
+	protected String checkRelationObject(ObjectNode master, String masterClassCode, ObjectNode slave,
+			String slaveClassCode) {
+		if (!SpaceTypeEnum.GeneralZone.getCode().equals(masterClassCode)) {
+			return "主对象不属于物业分区类型,请参考规则";
+		}
+		if (!SpaceTypeEnum.GeneralZone.getCode().equals(slaveClassCode)) {
+			return "从对象不属于物业分区类型,请参考规则";
+		}
+		return null;
+	}
+	
+}

+ 59 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpFFOpenRelationObject.java

@@ -0,0 +1,59 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.proxy.adm.constant.AdmRelationType;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.constant.SpaceTypeEnum;
+import com.persagy.proxy.adm.model.AdmRelationObject;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+/**
+ * 
+ * @version 1.0.0
+ * @company persagy
+ * @author zhangqiankun
+ * @date 2021年9月3日 上午9:42:46
+ */
+@Component(value = AdmRelationType.SP2SP_TRAFFICNETWORK_2)
+public class Sp2SpFFOpenRelationObject extends AbstractQueryRelationObject {
+	
+	public Sp2SpFFOpenRelationObject(IRelationReportService relationReportService) {
+		super(relationReportService);
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
+			String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	public String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, String groupCode,
+			String projectId, String code) {
+		return this.beforeSaveRelationObject(objectNode, relationObject, AdmRelationTypeEnum.SP2SP_TRAFFICNETWORK_2,
+				groupCode, projectId, code);
+	}
+
+	@Override
+	protected String checkRelationObject(ObjectNode master, String masterClassCode, ObjectNode slave,
+			String slaveClassCode) {
+		if (!SpaceTypeEnum.GeneralZone.getCode().equals(masterClassCode)) {
+			return "主对象不属于物业分区类型,请参考规则";
+		}
+		if (!SpaceTypeEnum.GeneralZone.getCode().equals(slaveClassCode)) {
+			return "从对象不属于物业分区类型,请参考规则";
+		}
+		return null;
+	}
+	
+}

+ 59 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpMixMechRelationObject.java

@@ -0,0 +1,59 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.proxy.adm.constant.AdmRelationType;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.constant.SpaceTypeEnum;
+import com.persagy.proxy.adm.model.AdmRelationObject;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+/**
+ * 
+ * @version 1.0.0
+ * @company persagy
+ * @author zhangqiankun
+ * @date 2021年9月3日 上午9:42:46
+ */
+@Component(value = AdmRelationType.SP2SP_CONVECTIONNETWORK_2)
+public class Sp2SpMixMechRelationObject extends AbstractQueryRelationObject {
+	
+	public Sp2SpMixMechRelationObject(IRelationReportService relationReportService) {
+		super(relationReportService);
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
+			String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	public String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, String groupCode,
+			String projectId, String code) {
+		return this.beforeSaveRelationObject(objectNode, relationObject, AdmRelationTypeEnum.SP2SP_CONVECTIONNETWORK_2,
+				groupCode, projectId, code);
+	}
+
+	@Override
+	protected String checkRelationObject(ObjectNode master, String masterClassCode, ObjectNode slave,
+			String slaveClassCode) {
+		if (!SpaceTypeEnum.AirConditioningZone.getCode().equals(masterClassCode)) {
+			return "主对象不属于空调分区类型,请参考规则";
+		}
+		if (!SpaceTypeEnum.AirConditioningZone.getCode().equals(slaveClassCode)) {
+			return "从对象不属于空调分区类型,请参考规则";
+		}
+		return null;
+	}
+	
+}

+ 59 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpNaturalRelationObject.java

@@ -0,0 +1,59 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.proxy.adm.constant.AdmRelationType;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.constant.SpaceTypeEnum;
+import com.persagy.proxy.adm.model.AdmRelationObject;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+/**
+ * 
+ * @version 1.0.0
+ * @company persagy
+ * @author zhangqiankun
+ * @date 2021年9月3日 上午9:42:46
+ */
+@Component(value = AdmRelationType.SP2SP_CONVECTIONNETWORK_1)
+public class Sp2SpNaturalRelationObject extends AbstractQueryRelationObject {
+	
+	public Sp2SpNaturalRelationObject(IRelationReportService relationReportService) {
+		super(relationReportService);
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
+			String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	public String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, String groupCode,
+			String projectId, String code) {
+		return this.beforeSaveRelationObject(objectNode, relationObject, AdmRelationTypeEnum.SP2SP_CONVECTIONNETWORK_1,
+				groupCode, projectId, code);
+	}
+
+	@Override
+	protected String checkRelationObject(ObjectNode master, String masterClassCode, ObjectNode slave,
+			String slaveClassCode) {
+		if (!SpaceTypeEnum.AirConditioningZone.getCode().equals(masterClassCode)) {
+			return "主对象不属于空调分区类型,请参考规则";
+		}
+		if (!SpaceTypeEnum.AirConditioningZone.getCode().equals(slaveClassCode)) {
+			return "从对象不属于空调分区类型,请参考规则";
+		}
+		return null;
+	}
+	
+}

+ 59 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpNormalRelationObject.java

@@ -0,0 +1,59 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.proxy.adm.constant.AdmRelationType;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.constant.SpaceTypeEnum;
+import com.persagy.proxy.adm.model.AdmRelationObject;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+/**
+ * 
+ * @version 1.0.0
+ * @company persagy
+ * @author zhangqiankun
+ * @date 2021年9月3日 上午9:42:46
+ */
+@Component(value = AdmRelationType.SP2SP_TRAFFICNETWORK_1)
+public class Sp2SpNormalRelationObject extends AbstractQueryRelationObject {
+	
+	public Sp2SpNormalRelationObject(IRelationReportService relationReportService) {
+		super(relationReportService);
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
+			String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	public String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, String groupCode,
+			String projectId, String code) {
+		return this.beforeSaveRelationObject(objectNode, relationObject, AdmRelationTypeEnum.SP2SP_TRAFFICNETWORK_1,
+				groupCode, projectId, code);
+	}
+
+	@Override
+	protected String checkRelationObject(ObjectNode master, String masterClassCode, ObjectNode slave,
+			String slaveClassCode) {
+		if (!SpaceTypeEnum.GeneralZone.getCode().equals(masterClassCode)) {
+			return "主对象不属于物业分区类型,请参考规则";
+		}
+		if (!SpaceTypeEnum.GeneralZone.getCode().equals(slaveClassCode)) {
+			return "从对象不属于物业分区类型,请参考规则";
+		}
+		return null;
+	}
+	
+}

+ 59 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpOnewayMechRelationObject.java

@@ -0,0 +1,59 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.proxy.adm.constant.AdmRelationType;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.constant.SpaceTypeEnum;
+import com.persagy.proxy.adm.model.AdmRelationObject;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+/**
+ * 
+ * @version 1.0.0
+ * @company persagy
+ * @author zhangqiankun
+ * @date 2021年9月3日 上午9:42:46
+ */
+@Component(value = AdmRelationType.SP2SP_CONVECTIONNETWORK_3)
+public class Sp2SpOnewayMechRelationObject extends AbstractQueryRelationObject {
+	
+	public Sp2SpOnewayMechRelationObject(IRelationReportService relationReportService) {
+		super(relationReportService);
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
+			String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	public String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, String groupCode,
+			String projectId, String code) {
+		return this.beforeSaveRelationObject(objectNode, relationObject, AdmRelationTypeEnum.SP2SP_CONVECTIONNETWORK_3,
+				groupCode, projectId, code);
+	}
+
+	@Override
+	protected String checkRelationObject(ObjectNode master, String masterClassCode, ObjectNode slave,
+			String slaveClassCode) {
+		if (!SpaceTypeEnum.AirConditioningZone.getCode().equals(masterClassCode)) {
+			return "主对象不属于空调分区类型,请参考规则";
+		}
+		if (!SpaceTypeEnum.AirConditioningZone.getCode().equals(slaveClassCode)) {
+			return "从对象不属于空调分区类型,请参考规则";
+		}
+		return null;
+	}
+	
+}

+ 59 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpTransparentRelationObject.java

@@ -0,0 +1,59 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.proxy.adm.constant.AdmRelationType;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.constant.SpaceTypeEnum;
+import com.persagy.proxy.adm.model.AdmRelationObject;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+/**
+ * 
+ * @version 1.0.0
+ * @company persagy
+ * @author zhangqiankun
+ * @date 2021年9月3日 上午9:42:46
+ */
+@Component(value = AdmRelationType.SP2SP_RADIATIONNETWORK_1)
+public class Sp2SpTransparentRelationObject extends AbstractQueryRelationObject {
+	
+	public Sp2SpTransparentRelationObject(IRelationReportService relationReportService) {
+		super(relationReportService);
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
+			String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	public String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, String groupCode,
+			String projectId, String code) {
+		return this.beforeSaveRelationObject(objectNode, relationObject, AdmRelationTypeEnum.SP2SP_RADIATIONNETWORK_1,
+				groupCode, projectId, code);
+	}
+
+	@Override
+	protected String checkRelationObject(ObjectNode master, String masterClassCode, ObjectNode slave,
+			String slaveClassCode) {
+		if (!SpaceTypeEnum.LightingZone.getCode().equals(masterClassCode)) {
+			return "主对象不属于照明分区类型,请参考规则";
+		}
+		if (!SpaceTypeEnum.LightingZone.getCode().equals(slaveClassCode)) {
+			return "从对象不属于照明分区类型,请参考规则";
+		}
+		return null;
+	}
+	
+}

+ 57 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2EqShipRelationObject.java

@@ -0,0 +1,57 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
+import com.persagy.proxy.adm.constant.AdmRelationType;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.model.AdmRelationObject;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+/**
+ * 图类型编码 -- SensorRelationship
+ * 
+ * @version 1.0.0
+ * @company persagy
+ * @author zhangqiankun
+ * @date 2021年9月3日 上午9:42:46
+ */
+@Component(value = AdmRelationType.EQ2EQ_SENSORRELATIONSHIP_SS2EQ)
+public class Ss2EqShipRelationObject extends AbstractQueryRelationObject {
+	
+	public Ss2EqShipRelationObject(IRelationReportService relationReportService) {
+		super(relationReportService);
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
+			String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	public String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, String groupCode,
+			String projectId, String code) {
+		return this.beforeSaveRelationObject(objectNode, relationObject, AdmRelationTypeEnum.EQ2EQ_SENSORRELATIONSHIP_SS2EQ,
+				groupCode, projectId, code);
+	}
+
+	@Override
+	protected String checkRelationObject(ObjectNode master, String masterClassCode, ObjectNode slave,
+			String slaveClassCode) {
+		if (!AdmObjectInfoConstant.CHECK_SENSOR_CODES.contains(masterClassCode)) {
+			return "主对象不是传感器,请参考规则";
+		}
+		return null;
+	}
+	
+}

+ 57 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2SpShipRelationObject.java

@@ -0,0 +1,57 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
+import com.persagy.proxy.adm.constant.AdmRelationType;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.model.AdmRelationObject;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+/**
+ * 图类型编码 -- SensorRelationship
+ * 
+ * @version 1.0.0
+ * @company persagy
+ * @author zhangqiankun
+ * @date 2021年9月3日 上午9:42:46
+ */
+@Component(value = AdmRelationType.EQ2SP_SENSORRELATIONSHIP_SS2SP)
+public class Ss2SpShipRelationObject extends AbstractQueryRelationObject {
+	
+	public Ss2SpShipRelationObject(IRelationReportService relationReportService) {
+		super(relationReportService);
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
+			String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	public String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, String groupCode,
+			String projectId, String code) {
+		return this.beforeSaveRelationObject(objectNode, relationObject, AdmRelationTypeEnum.EQ2SP_SENSORRELATIONSHIP_SS2SP,
+				groupCode, projectId, code);
+	}
+
+	@Override
+	protected String checkRelationObject(ObjectNode master, String masterClassCode, ObjectNode slave,
+			String slaveClassCode) {
+		if (!AdmObjectInfoConstant.CHECK_SENSOR_CODES.contains(masterClassCode)) {
+			return "主对象不是传感器,请参考规则";
+		}
+		return null;
+	}
+	
+}

+ 57 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2SyShipRelationObject.java

@@ -0,0 +1,57 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
+import com.persagy.proxy.adm.constant.AdmRelationType;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.model.AdmRelationObject;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+/**
+ * 图类型编码 -- SensorRelationship
+ * 
+ * @version 1.0.0
+ * @company persagy
+ * @author zhangqiankun
+ * @date 2021年9月3日 上午9:42:46
+ */
+@Component(value = AdmRelationType.EQ2SY_SENSORRELATIONSHIP_SS2SY)
+public class Ss2SyShipRelationObject extends AbstractQueryRelationObject {
+	
+	public Ss2SyShipRelationObject(IRelationReportService relationReportService) {
+		super(relationReportService);
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
+			String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	public String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, String groupCode,
+			String projectId, String code) {
+		return this.beforeSaveRelationObject(objectNode, relationObject, AdmRelationTypeEnum.EQ2SY_SENSORRELATIONSHIP_SS2SY,
+				groupCode, projectId, code);
+	}
+
+	@Override
+	protected String checkRelationObject(ObjectNode master, String masterClassCode, ObjectNode slave,
+			String slaveClassCode) {
+		if (!AdmObjectInfoConstant.CHECK_SENSOR_CODES.contains(masterClassCode)) {
+			return "主对象不是传感器,请参考规则";
+		}
+		return null;
+	}
+	
+}