Browse Source

Merge remote-tracking branch 'origin/develop' into develop

liyang 3 years ago
parent
commit
2e5c508d24

+ 4 - 2
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/DiagramBuilder.java

@@ -110,7 +110,7 @@ public class DiagramBuilder {
 		}
 
 		EquipmentNode node = new EquipmentNode();
-		node.setId(IdUtil.simpleUUID());
+		node.setId(IdUtil.fastSimpleUUID());
 		node.setDataObjectId(obj.get("id").asText());
 		node.setObjClassCode(DiagramBuilder.getClassCode(obj));
 		node.setDataObject(obj);
@@ -128,6 +128,7 @@ public class DiagramBuilder {
 		node.setLayoutIndex(con.getChildren().size() - 1);
 
 		Label label = new Label();
+		label.setId(IdUtil.fastSimpleUUID());
 		label.setContent(name);
 		node.setLabel(label);
 
@@ -180,7 +181,7 @@ public class DiagramBuilder {
 
 	private PackNode newPackNode(String objClsCode, Container con, String packName){
 		PackNode pn = new PackNode();
-		pn.setId(IdUtil.simpleUUID());
+		pn.setId(IdUtil.fastSimpleUUID());
 		pn.setObjClassCode(objClsCode);
 
 		initNode(pn, packName, con);
@@ -392,6 +393,7 @@ public class DiagramBuilder {
 	}
 
 	private void addLine(Line line) {
+		line.setId(IdUtil.fastSimpleUUID());
 		markAnchorLine(line.getFrom(), line);
 		markAnchorLine(line.getTo(), line);
 		diagram.getLines().add(line);

+ 26 - 0
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/Diagram.java

@@ -129,12 +129,25 @@ public class Diagram {
 			size = template.getFrame().getSize();
 		}
 
+		layoutLines(context);
+	}
+
+	public void layoutLines(CalcContext context) {
 		LineLayoutManager lineLayoutManager = new LineLayoutManager(context);
 		for(Line line : lines) {
 			line.layout(lineLayoutManager);
 		}
 	}
 
+	public void layoutLine(String lineId, CalcContext context){
+		for(Line line : lines) {
+			if(lineId.equals(line.getId())) {
+				line.layout(new LineLayoutManager(context));
+				break;
+			}
+		}
+	}
+
 	public void clearLayout(){
 		if(template != null) {
 			template.clearLayout();
@@ -306,4 +319,17 @@ public class Diagram {
 		this.template = template;
 	}
 
+	public String[] getLegendIds() {
+		HashSet<String> ids = new HashSet<>();
+		nodes.forEach(node -> {
+			if(node instanceof EquipmentNode) {
+				String legendId = ((EquipmentNode) node).getLegendId();
+				if(StrUtil.isNotBlank(legendId)){
+					ids.add(legendId);
+				}
+			}
+		});
+		return ids.toArray(new String[ids.size()]);
+	}
+
 }

+ 15 - 1
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/logic/DynGroup.java

@@ -9,12 +9,18 @@ import com.google.gson.annotations.Expose;
 public class DynGroup {
 
 	/**
-	 * 动态源,可选值:floor | building | mainPipe:id | containerElement:id
+	 * 动态源(floor | building | mainPipe.id | container.id)
 	 */
 	@Expose
 	private String dynSource;
 
 	/**
+	 * 动态源类型,可选值: data | group | mainPipe | container
+	 */
+	@Expose
+	private String dynSourceType;
+
+	/**
 	 * 分组标签的位置, top | bottom | left | right
 	 */
 	@Expose
@@ -28,6 +34,14 @@ public class DynGroup {
 		this.dynSource = dynSource;
 	}
 
+	public String getDynSourceType() {
+		return dynSourceType;
+	}
+
+	public void setDynSourceType(String dynSourceType) {
+		this.dynSourceType = dynSourceType;
+	}
+
 	public String getLabelPosition() {
 		return labelPosition;
 	}

+ 9 - 5
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/manage/TemplateManager.java

@@ -444,15 +444,19 @@ public class TemplateManager {
                 } else if(o instanceof Container) {
                     Container target = null;
                     if(StrUtil.isNotBlank(compId)) {
-                        Container con = template.getContainerById(compId);
-                        if(con != null){
-                            target = con;
+                        Container c = template.getContainerById(compId);
+                        if(c != null){
+                            target = c;
                         }
                     } else {
                       target = template.getFrame();
                     }
-                    if(target != null){
-                        target.addComp((Container)o);
+                    if(target != null && !target.isEquipmentBox()){
+                        Container con = (Container)o;
+                        if(template.getContainerById(con.getId()) != null){
+                            con.setId(IdUtil.simpleUUID());
+                        }
+                        target.addComp(con);
                     }
                 } else {
                     //暂不支持干管粘贴

+ 2 - 2
adm-business/adm-middleware/src/main/java/com/persagy/proxy/calculation/model/AdmRelationAddRequest.java

@@ -34,7 +34,7 @@ public class AdmRelationAddRequest implements Serializable {
     @JSONField(name = "graphicType",alternateNames = {"parentCode","graphic_type"})
     private String graphicType;
 
-    /** 交付范围 0项目交付,1现场交付**/
-    private Integer deliveryType;
+    /** 是否仅查看项目交付范围内数据:0/null-否 1-是 **/
+    private Integer isDelivery;
 
 }

+ 10 - 7
adm-business/adm-middleware/src/main/java/com/persagy/proxy/calculation/service/impl/AdmManualRelCalServiceImpl.java

@@ -156,7 +156,7 @@ public class AdmManualRelCalServiceImpl implements AdmManualRelCalService {
             }
         }
         //验证 项目交付范围
-        Integer flag = validRelCollect(context, relationTypeEnum, request.getDeliveryType(), mainResultData, fromResultData);
+        Integer flag = validRelCollect(context, relationTypeEnum, request.getIsDelivery(), mainResultData, fromResultData);
         switch (flag){
             case 1 : return AdmCreateResponse.failure(mainResultData +":不存在","1");
             case 2 : return AdmCreateResponse.failure(fromResultData +":不存在","2");
@@ -518,22 +518,23 @@ public class AdmManualRelCalServiceImpl implements AdmManualRelCalService {
      * @param fromResultData 从对象
      * @return 0 成功; 1 主对象为空; 2 从对象为空; 3 不在项目交付范围内
      **/
-    private Integer validRelCollect(InstanceUrlParam context, AdmRelationTypeEnum relationTypeEnum , Integer deliveryType, List<ObjectNode> mainResultData, List<ObjectNode> fromResultData){
+    private Integer validRelCollect(InstanceUrlParam context, AdmRelationTypeEnum relationTypeEnum , Integer isDelivery, List<ObjectNode> mainResultData, List<ObjectNode> fromResultData){
         if(CollUtil.isEmpty(mainResultData)){
             return 1;
         }
         if(CollUtil.isEmpty(fromResultData)){
             return 2;
         }
-        if(deliveryType != null){
+        if(isDelivery != null && isDelivery == 1){
             QueryCriteria queryCriteria = new QueryCriteria();
             ObjectNode objectNode = JsonNodeFactory.instance.objectNode();
             objectNode.put("projectId", context.getProjectId());
             objectNode.put("relCode", relationTypeEnum.getRelCode());
             objectNode.put("graphCode", relationTypeEnum.getGraphCode());
-            objectNode.put("deliveryType",deliveryType);
+            objectNode.put("deliveryType",0);
+            objectNode.put("valid",1);
             queryCriteria.setCriteria(objectNode);
-            List<RelationDefineCollect> relationDefineCollects = relationReportService.doQueryRelationDefineCollectList(context, queryCriteria);
+             List<RelationDefineCollect> relationDefineCollects = relationReportService.doQueryRelationDefineCollectList(context, queryCriteria);
             if(CollUtil.isEmpty(relationDefineCollects)){
                 return 3;
             }
@@ -558,13 +559,15 @@ public class AdmManualRelCalServiceImpl implements AdmManualRelCalService {
                 ArrayNode endTypeCodes = collect.getEndTypeCodes();
                 Set<String> endTypeCodeSet = CollUtil.newHashSet();
                 endTypeCodes.forEach(classCode -> endTypeCodeSet.add(classCode.isTextual() ? classCode.asText() : ""));
-                if(sourceTypeCodeSet.contains(mainSet) && endTypeCodeSet.contains(endTypeCodeSet)){
+                if(sourceTypeCodeSet.containsAll(mainSet) && endTypeCodeSet.containsAll(fromSet)){
                     return 0;
                 }
-                if(sourceTypeCodeSet.contains(endTypeCodes) && endTypeCodeSet.contains(mainSet)){
+                if(sourceTypeCodeSet.containsAll(fromSet) && endTypeCodeSet.containsAll(mainSet)){
                     return 0;
                 }
             }
+        }else{
+            return 0;
         }
         return 3;
     }

+ 15 - 0
adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/service/impl/AdmDictServiceImpl.java

@@ -404,6 +404,11 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
         //查询类型下的所有信息点信息
         AdmResponse admResponse = doQueryObjectInfo(context, request, AdmDictConstant.CLASS_CODE, clazz);
         List<AdmObjectInfo> admObjectInfos = (List<AdmObjectInfo>) admResponse.getContent();
+        //项目信息点 进行定制过滤
+        if(request.getType().equals(AdmProject.OBJ_TYPE)){
+            admObjectInfos = filterInfosForProject(admObjectInfos);
+            admResponse.setTotal(admObjectInfos.size()*1L);
+        }
         admObjectInfos = sortFuncidForEdit(admObjectInfos);
         //查询平台级信息点采集信息
         List<ObjectInfoCollect> commonObjectInfoCollect = queryObjectInfoCollect(context, "common", request.getType(), clazz);
@@ -625,6 +630,16 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
         return resultOrders;
     }
 
+    /** 项目需要展示的信息点**/
+    private List<AdmObjectInfo> filterInfosForProject(List<AdmObjectInfo> list){
+        if(CollUtil.isEmpty(list)){
+            return Collections.emptyList();
+        }
+        List<String> projectCodes = Arrays.asList("businessOpeningTime","owner","property","designer","constructor","longitude",
+                "latitude","sFI","address","projUnderfloorNum","fireResistanceLev","projNeighborLocationMap","projLogo","projIntro",
+                "projHeight","projFuncType","projCoverArea","projCityLocationMap","projArea","assetManager");
+        return list.stream().filter(info -> projectCodes.contains(info.getCode())).collect(Collectors.toList());
+    }
     /**
      * 统计类型下的非静态信息点
      * @param context