diff --git a/com.actionsoft.apps.coe.method.process.subprocess/lib/com.actionsoft.apps.coe.method.process.subprocess.jar b/com.actionsoft.apps.coe.method.process.subprocess/lib/com.actionsoft.apps.coe.method.process.subprocess.jar index 1b017e3b..72faf8f5 100644 Binary files a/com.actionsoft.apps.coe.method.process.subprocess/lib/com.actionsoft.apps.coe.method.process.subprocess.jar and b/com.actionsoft.apps.coe.method.process.subprocess/lib/com.actionsoft.apps.coe.method.process.subprocess.jar differ diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphLayout.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphLayout.java index c94ddc5f..7dc87313 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphLayout.java +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphLayout.java @@ -225,7 +225,7 @@ public class GraphLayout { if (unIsPosition.size() == 1){ position[rearNodeIndex][0] = position[nodeIndex][0]; // 当前节点的如果为第一个后置节点 则 坐标x的值一致 }else { - position[rearNodeIndex][0] = position[nodeIndex][0] + shapeW + (unIsPosition.size() - 1) * horizInterval; // 非第一个后置节点的坐标x = 上一个节点的坐标x + 图形宽度 + 第几个后置节点 * 横向间隔 + position[rearNodeIndex][0] = realTimeX + shapeW + (unIsPosition.size() - 1) * horizInterval; // 非第一个后置节点的坐标x = 上一个节点的坐标x + 图形宽度 + 第几个后置节点 * 横向间隔 realTimeX = position[rearNodeIndex][0]; } isPosition[rearNodeIndex] = true; diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/VertexPreHandle.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/VertexPreHandle.java index cc239c93..eb6377af 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/VertexPreHandle.java +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/VertexPreHandle.java @@ -113,6 +113,8 @@ public class VertexPreHandle { * 如果未在选择的范围内 则忽略 * * 同时处理节点的前后置关系 + * + * 同时根据当前节点被指向的线条数量排序 由低到高 * @param processIdList * @param nodeIndexMap * @return 按照节点前置流程数量 从小到大排序 @@ -120,15 +122,23 @@ public class VertexPreHandle { */ public List excludeLearAndRearNode(List processIdList, Map nodeIndexMap) throws AWSException { List nodeList = new ArrayList<>(); + Map pointsMap = new HashMap<>(); for (int i = 0; i < processIdList.size(); i++) { - Node node = new Node(processIdList.get(i)); + Node node = new Node(processIdList.get(i), PALRepositoryCache.getCache().get(processIdList.get(i)).getName()); // 前置流程 List leadProcessList = DesignerShapeRelationCache.getByFileId(processIdList.get(i), SubProcessConst.LEAD_PROCESS_ATTR_ID); List leadNodeList = new ArrayList<>(); leadProcessList.stream().forEach(model -> { if (processIdList.contains(model.getRelationFileId())){ - Node leadNode = new Node(model.getRelationFileId()); + Node leadNode = new Node(model.getRelationFileId(), PALRepositoryCache.getCache().get(model.getRelationFileId()).getName()); leadNodeList.add(leadNode); + + // 当前节点被指向的线条数+1 + if (pointsMap.containsKey(node.getId())) { + pointsMap.put(node.getId(), pointsMap.get(node.getId()).intValue() + 1); + } else { + pointsMap.put(node.getId(), 1); + } } }); node.setLeadNodeList(leadNodeList); @@ -137,8 +147,14 @@ public class VertexPreHandle { List rearNodeList = new ArrayList<>(); rearProcessList.stream().forEach(model -> { if (processIdList.contains(model.getRelationFileId())){ - Node rearNode = new Node(model.getRelationFileId()); + Node rearNode = new Node(model.getRelationFileId(), PALRepositoryCache.getCache().get(model.getRelationFileId()).getName()); rearNodeList.add(rearNode); + + if (pointsMap.containsKey(model.getRelationFileId())) { + pointsMap.put(model.getRelationFileId(), pointsMap.get(model.getRelationFileId()).intValue() + 1); + } else { + pointsMap.put(model.getRelationFileId(), 1); + } } }); node.setRearNodeList(rearNodeList); @@ -147,6 +163,12 @@ public class VertexPreHandle { nodeIndexMap.put(node.getId(), nodeList.size() - 1); } + for (Node node : nodeList) { + if (pointsMap.containsKey(node.getId())){ + node.setPoints(pointsMap.get(node.getId())); + } + } + Collections.sort(nodeList); return nodeList; } diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/mode/Node.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/mode/Node.java index b870a4b4..87c76e5b 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/mode/Node.java +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/mode/Node.java @@ -10,14 +10,20 @@ import java.util.Objects; public class Node implements Comparable { private String id; + private String name; private List leadNodeList; private List rearNodeList; - + private int points; // 被指向的线条数 public Node(String id) { this.id = id; } + public Node(String id, String name) { + this.id = id; + this.name = name; + } + public String getId() { return id; } @@ -26,6 +32,14 @@ public class Node implements Comparable { this.id = id; } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + public List getLeadNodeList() { return leadNodeList; } @@ -42,6 +56,14 @@ public class Node implements Comparable { this.rearNodeList = rearNodeList; } + public int getPoints() { + return points; + } + + public void setPoints(int points) { + this.points = points; + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -57,6 +79,6 @@ public class Node implements Comparable { @Override public int compareTo(Node node) { - return Integer.compare(this.leadNodeList.size(), node.getLeadNodeList().size()); + return Integer.compare(this.points, node.points); } }