|
@@ -5,6 +5,8 @@ import cn.hutool.core.util.IdUtil;
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
import com.persagy.adm.diagram.core.model.base.*;
|
|
import com.persagy.adm.diagram.core.model.base.*;
|
|
import com.persagy.adm.diagram.core.model.logic.DataFilter;
|
|
import com.persagy.adm.diagram.core.model.logic.DataFilter;
|
|
|
|
+import com.persagy.adm.diagram.core.model.logic.DynGroup;
|
|
|
|
+import com.persagy.adm.diagram.core.model.logic.EquipPack;
|
|
import com.persagy.adm.diagram.core.model.logic.MatchFilter;
|
|
import com.persagy.adm.diagram.core.model.logic.MatchFilter;
|
|
import com.persagy.adm.diagram.entity.DiagramType;
|
|
import com.persagy.adm.diagram.entity.DiagramType;
|
|
import com.persagy.adm.diagram.frame.EditRequest;
|
|
import com.persagy.adm.diagram.frame.EditRequest;
|
|
@@ -16,6 +18,7 @@ import com.persagy.adm.diagram.core.model.template.MainPipePoint;
|
|
import com.persagy.adm.diagram.frame.BdtpRequest;
|
|
import com.persagy.adm.diagram.frame.BdtpRequest;
|
|
import com.persagy.adm.diagram.service.BdtpDataService;
|
|
import com.persagy.adm.diagram.service.BdtpDataService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Qualifier;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -33,7 +36,7 @@ public class TemplateManager {
|
|
private final DataStrategy dataStrategy;
|
|
private final DataStrategy dataStrategy;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- public TemplateManager(DataStrategy dataStrategy) {
|
|
|
|
|
|
+ public TemplateManager(@Qualifier(DataStrategy.implQualifier) DataStrategy dataStrategy) {
|
|
this.dataStrategy = dataStrategy;
|
|
this.dataStrategy = dataStrategy;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -145,7 +148,9 @@ public class TemplateManager {
|
|
template.init();
|
|
template.init();
|
|
|
|
|
|
Container con = template.getContainerById(containerId);
|
|
Container con = template.getContainerById(containerId);
|
|
- if(con.getParent() != null)
|
|
|
|
|
|
+ if(con.isAbsolutePosition())
|
|
|
|
+ template.getScatteredContainers().remove(con);
|
|
|
|
+ else if(con.getParent() != null)
|
|
con.getParent().removeComp(containerId);
|
|
con.getParent().removeComp(containerId);
|
|
|
|
|
|
return saveTemplate(template);
|
|
return saveTemplate(template);
|
|
@@ -334,6 +339,7 @@ public class TemplateManager {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 修改设备数据过滤条件
|
|
* 修改设备数据过滤条件
|
|
|
|
+ * filter可能是多种类型,通过Map转换
|
|
*/
|
|
*/
|
|
public DiagramTemplate modifyFilter(Map<String, Object> filter, String containerId, String templateId){
|
|
public DiagramTemplate modifyFilter(Map<String, Object> filter, String containerId, String templateId){
|
|
DiagramTemplate template = dataStrategy.getTemplate(templateId);
|
|
DiagramTemplate template = dataStrategy.getTemplate(templateId);
|
|
@@ -356,4 +362,30 @@ public class TemplateManager {
|
|
return saveTemplate(template);
|
|
return saveTemplate(template);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 修改设备打包配置
|
|
|
|
+ */
|
|
|
|
+ public DiagramTemplate modifyPack(EquipPack pack, String containerId, String templateId){
|
|
|
|
+ DiagramTemplate template = dataStrategy.getTemplate(templateId);
|
|
|
|
+ template.init();
|
|
|
|
+
|
|
|
|
+ Container con = template.getContainerById(containerId);
|
|
|
|
+ con.setEquipPack(pack);
|
|
|
|
+
|
|
|
|
+ return saveTemplate(template);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改容器的动态组配置
|
|
|
|
+ */
|
|
|
|
+ public DiagramTemplate modifyDynGroup(DynGroup dynGroup, String containerId, String templateId){
|
|
|
|
+ DiagramTemplate template = dataStrategy.getTemplate(templateId);
|
|
|
|
+ template.init();
|
|
|
|
+
|
|
|
|
+ Container con = template.getContainerById(containerId);
|
|
|
|
+ con.setDynGroup(dynGroup);
|
|
|
|
+
|
|
|
|
+ return saveTemplate(template);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|