|
@@ -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;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|