Sp2SpMixMechRelationObject.java 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package com.persagy.proxy.adm.strategy.relationdata;
  2. import java.util.List;
  3. import java.util.Map;
  4. import org.springframework.stereotype.Component;
  5. import com.fasterxml.jackson.databind.node.ObjectNode;
  6. import com.persagy.proxy.adm.constant.AdmRelationType;
  7. import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
  8. import com.persagy.proxy.adm.constant.SpaceTypeEnum;
  9. import com.persagy.proxy.adm.model.AdmRelationObject;
  10. import com.persagy.proxy.adm.service.IRelationReportService;
  11. /**
  12. *
  13. * @version 1.0.0
  14. * @company persagy
  15. * @author zhangqiankun
  16. * @date 2021年9月3日 上午9:42:46
  17. */
  18. @Component(value = AdmRelationType.SP2SP_CONVECTIONNETWORK_2)
  19. public class Sp2SpMixMechRelationObject extends AbstractQueryRelationObject {
  20. public Sp2SpMixMechRelationObject(IRelationReportService relationReportService) {
  21. super(relationReportService);
  22. }
  23. @Override
  24. public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
  25. throw new UnsupportedOperationException("未实现的策略类");
  26. }
  27. @Override
  28. protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
  29. String projectId) {
  30. throw new UnsupportedOperationException("未实现的策略类");
  31. }
  32. @Override
  33. public String beforeSaveRelationObject(ObjectNode objectNode, AdmRelationObject relationObject, String groupCode,
  34. String projectId, String code) {
  35. return this.beforeSaveRelationObject(objectNode, relationObject, AdmRelationTypeEnum.SP2SP_CONVECTIONNETWORK_2,
  36. groupCode, projectId, code);
  37. }
  38. @Override
  39. protected String checkRelationObject(ObjectNode master, String masterClassCode, ObjectNode slave,
  40. String slaveClassCode) {
  41. if (!SpaceTypeEnum.AirConditioningZone.getCode().equals(masterClassCode)) {
  42. return "主对象不属于空调分区类型,请参考规则";
  43. }
  44. if (!SpaceTypeEnum.AirConditioningZone.getCode().equals(slaveClassCode)) {
  45. return "从对象不属于空调分区类型,请参考规则";
  46. }
  47. return null;
  48. }
  49. }