Commit c44af7ef by qiuchaofei

返回结果集添加:“颜色”

parent bc7c3367
...@@ -3,6 +3,7 @@ package com.keymobile.metadata.metadataRelation.pojo.returnBean; ...@@ -3,6 +3,7 @@ package com.keymobile.metadata.metadataRelation.pojo.returnBean;
import org.apache.commons.collections.map.HashedMap; import org.apache.commons.collections.map.HashedMap;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -10,6 +11,17 @@ public class ReturnReslult { ...@@ -10,6 +11,17 @@ public class ReturnReslult {
//统计遍历的层次 //统计遍历的层次
int count; int count;
public Map<String, String> getColorMap() {
return colorMap;
}
public void setColorMap(Map<String, String> colorMap) {
this.colorMap = colorMap;
}
Map<String,String> colorMap = new HashMap<>();
public int getCount() { public int getCount() {
return count; return count;
} }
......
...@@ -564,6 +564,7 @@ public class MetadataServiceImpl implements IMetadataService { ...@@ -564,6 +564,7 @@ public class MetadataServiceImpl implements IMetadataService {
Map<String ,ReturnEdge> returnEdgeMap = new HashMap<>(); Map<String ,ReturnEdge> returnEdgeMap = new HashMap<>();
Map<String,String> colorMap = new HashMap<>();
while (statementResult.hasNext()) { while (statementResult.hasNext()) {
Record record = statementResult.next(); Record record = statementResult.next();
List<Value> values = record.values(); List<Value> values = record.values();
...@@ -574,7 +575,7 @@ public class MetadataServiceImpl implements IMetadataService { ...@@ -574,7 +575,7 @@ public class MetadataServiceImpl implements IMetadataService {
getNodesMapFromNeo4jSystem(nodesMap, metaModelMap, nodes); getNodesMapFromNeo4jSystem(nodesMap, metaModelMap, nodes);
Iterable<Relationship> relationships = p.relationships(); Iterable<Relationship> relationships = p.relationships();
getRelationFromneo4jRelationSystem(returnEdgeMap, nodesMap, relationships); getRelationFromneo4jRelationSystem(returnEdgeMap, nodesMap, relationships,colorMap);
} }
} }
} }
...@@ -587,13 +588,14 @@ public class MetadataServiceImpl implements IMetadataService { ...@@ -587,13 +588,14 @@ public class MetadataServiceImpl implements IMetadataService {
returnReslult.getEdges().add(returnEdge); returnReslult.getEdges().add(returnEdge);
} }
returnReslult.setMetaModelMap(metaModelMap);
returnReslult.setColorMap(colorMap);
return returnReslult; return returnReslult;
} }
private void getRelationFromneo4jRelationSystem(Map<String ,ReturnEdge> returnEdgeMap, Map<Long, ReturnNode> nodesMap, private void getRelationFromneo4jRelationSystem(Map<String, ReturnEdge> returnEdgeMap, Map<Long, ReturnNode> nodesMap,
Iterable<Relationship> relationships) { Iterable<Relationship> relationships, Map<String, String> colorMap) {
for (Relationship relationship : relationships) { for (Relationship relationship : relationships) {
Long startID = relationship.startNodeId(); Long startID = relationship.startNodeId();
...@@ -610,6 +612,7 @@ public class MetadataServiceImpl implements IMetadataService { ...@@ -610,6 +612,7 @@ public class MetadataServiceImpl implements IMetadataService {
String shujujiegou =""+ relationship.asMap().get("数据结构"); String shujujiegou =""+ relationship.asMap().get("数据结构");
String yewushuoming =""+ relationship.asMap().get("业务说明"); String yewushuoming =""+ relationship.asMap().get("业务说明");
colorMap.put(rType,yanse);
String startMetaId = ""; String startMetaId = "";
String endMetaId = ""; String endMetaId = "";
if (nodesMap.containsKey(startID)) { if (nodesMap.containsKey(startID)) {
...@@ -630,7 +633,8 @@ public class MetadataServiceImpl implements IMetadataService { ...@@ -630,7 +633,8 @@ public class MetadataServiceImpl implements IMetadataService {
edge.getAttributeMaps().put("业务类别",yewuleibie); edge.getAttributeMaps().put("业务类别",yewuleibie);
edge.getAttributeMaps().put("数据结构",shujujiegou); edge.getAttributeMaps().put("数据结构",shujujiegou);
edge.getAttributeMaps().put("业务说明",yewushuoming); edge.getAttributeMaps().put("业务说明",yewushuoming);
edge.getAttributeMaps().put("颜色",yanse); //
returnEdgeMap .put(edgeId,edge ); returnEdgeMap .put(edgeId,edge );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment