diff --git a/com.actionsoft.apps.coe.pal.batch/lib/com.actionsoft.apps.coe.pal.batch.jar b/com.actionsoft.apps.coe.pal.batch/lib/com.actionsoft.apps.coe.pal.batch.jar index c550ca5a..c12eb0a5 100644 Binary files a/com.actionsoft.apps.coe.pal.batch/lib/com.actionsoft.apps.coe.pal.batch.jar and b/com.actionsoft.apps.coe.pal.batch/lib/com.actionsoft.apps.coe.pal.batch.jar differ diff --git a/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/shape/ImportShapeExcel1.java b/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/shape/ImportShapeExcel1.java index b9e49b03..2c73da57 100644 --- a/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/shape/ImportShapeExcel1.java +++ b/com.actionsoft.apps.coe.pal.batch/src/com/actionsoft/apps/coe/pal/batch/web/create/shape/ImportShapeExcel1.java @@ -628,7 +628,7 @@ public class ImportShapeExcel1 { double leftLine = leftMinLine; //递归处理父级所有图形+连线的x的偏移量 - double upLeftLine = this.changeUpLeftOffset(nodes.get(0), levelMap, nodeMap, offset, leftLine); + double upLeftLine = this.changeUpLeftOffset(nodes.get(0).getShapeNum(), levelMap, nodeMap, offset, leftLine); leftLine = Math.min(leftLine,upLeftLine); @@ -637,17 +637,16 @@ public class ImportShapeExcel1 { leftLine = Math.min(leftLine,moveLeftLine); //递归处理子级所有图形+连线x的偏移量 - double subLeftLine = this.changeSubLeftOffset(nodes.get(0), levelMap, nodeMap, offset, leftLine); + double subLeftLine = this.changeSubLeftOffset(nodes.get(0).getShapeNum(), levelMap, nodeMap, offset, leftLine); leftLine = Math.min(leftLine,subLeftLine); return Math.min(leftLine,leftMinLine); } - private double changeUpLeftOffset(CellObject node,Map>> levelMap,Map> nodeMap,double offset,double leftMinLine){ + private double changeUpLeftOffset(String shapeNum,Map>> levelMap,Map> nodeMap,double offset,double leftMinLine){ double leftLine = leftMinLine; - String shapeNum = node.getShapeNum(); if (!shapeNum.contains(".")){ return leftLine; } @@ -655,21 +654,31 @@ public class ImportShapeExcel1 { String[] split = shapeNum.split("\\."); String level = ""+ (Integer.parseInt(split[0])-1); String branch = split[1]; + if (Integer.parseInt(level)<0){ + return leftLine; + } Map> numList = levelMap.get(level); - + if (null == numList){ + //层级跳级处理 + double upLeftLine = this.changeUpLeftOffset(level+"."+branch, levelMap, nodeMap, offset, leftLine); + leftLine = Math.min(leftLine,upLeftLine); + return Math.min(leftLine,leftMinLine); + } List upList = numList.get(level + "." + branch); if (upList == null || upList.isEmpty()){ - return leftLine; + //分支父级跳级处理 + double upLeftLine = this.changeUpLeftOffset(level+"."+branch, levelMap, nodeMap, offset, leftLine); + leftLine = Math.min(leftLine,upLeftLine); + return Math.min(leftLine,leftMinLine); } - double upLeftLine = this.changeUpLeftOffset(upList.get(0), levelMap, nodeMap, offset, leftLine); + double upLeftLine = this.changeUpLeftOffset(upList.get(0).getShapeNum(), levelMap, nodeMap, offset, leftLine); leftLine = Math.min(leftLine,upLeftLine); //移动父级节点 double moveLeftLine = this.moveLeftNode(upList, nodeMap, offset, leftLine,true,false); - leftLine = Math.min(leftLine,moveLeftLine); return Math.min(leftLine,leftMinLine); @@ -723,9 +732,8 @@ public class ImportShapeExcel1 { return leftLine; } - private double changeSubLeftOffset(CellObject node,Map>> levelMap,Map> nodeMap,double offset,double leftMinLine){ + private double changeSubLeftOffset(String shapeNum,Map>> levelMap,Map> nodeMap,double offset,double leftMinLine){ double leftLine = leftMinLine; - String shapeNum = node.getShapeNum(); if (!shapeNum.contains(".")){ return leftLine; @@ -735,8 +743,18 @@ public class ImportShapeExcel1 { String[] split = shapeNum.split("\\."); String level = ""+ (Integer.parseInt(split[0])+1); String branch = split[1]; + if (Integer.parseInt(level)<0){ + return leftLine; + } Map> numList = levelMap.get(level); + if(null == numList){ + //层级跳级处理 + double subLeftOffset = this.changeSubLeftOffset(level+"."+branch, levelMap, nodeMap, offset, leftLine); + leftLine = Math.min(leftLine,subLeftOffset); + return Math.min(leftLine,leftMinLine); + } + List subList = numList.get(level + "." + branch); if (subList == null || subList.isEmpty()){ subList = numList.get(level); @@ -766,17 +784,19 @@ public class ImportShapeExcel1 { } } + }else { + //下级分支跳级直连 + double subLeftOffset = this.changeSubLeftOffset(level+"."+branch, levelMap, nodeMap, offset, leftLine); + leftLine = Math.min(leftLine,subLeftOffset); } - return leftLine; + return Math.min(leftLine,leftMinLine); } - double subLeftOffset = this.changeSubLeftOffset(subList.get(0), levelMap, nodeMap, offset, leftLine); - + double subLeftOffset = this.changeSubLeftOffset(subList.get(0).getShapeNum(), levelMap, nodeMap, offset, leftLine); leftLine = Math.min(leftLine,subLeftOffset); //移动子级节点 double moveLeftLine = this.moveLeftNode(subList, nodeMap, offset, leftLine,true,true); - leftLine = Math.min(leftLine,moveLeftLine); return Math.min(leftLine,leftMinLine); @@ -786,7 +806,7 @@ public class ImportShapeExcel1 { double rightLine = rightMaxLine; //递归处理父级所有图形+连线的x的偏移量 - double upRightOffset = this.changeUpRightOffset(nodes.get(0), levelMap, nodeMap, offset, rightLine); + double upRightOffset = this.changeUpRightOffset(nodes.get(0).getShapeNum(), levelMap, nodeMap, offset, rightLine); rightLine = Math.max(rightLine,upRightOffset); @@ -795,15 +815,14 @@ public class ImportShapeExcel1 { rightLine = Math.max(rightLine,moveRightOffset); //递归处理子级所有图形+连线x的偏移量 - double subRightOffset = this.changeSubRightOffset(nodes.get(0), levelMap, nodeMap, offset, rightLine); + double subRightOffset = this.changeSubRightOffset(nodes.get(0).getShapeNum(), levelMap, nodeMap, offset, rightLine); rightLine = Math.max(subRightOffset,rightLine); return Math.max(rightLine,rightMaxLine); } - private double changeUpRightOffset(CellObject node,Map>> levelMap,Map> nodeMap,double offset,double rightMaxLine){ + private double changeUpRightOffset(String shapeNum,Map>> levelMap,Map> nodeMap,double offset,double rightMaxLine){ double rightLine = rightMaxLine; - String shapeNum = node.getShapeNum(); if (!shapeNum.contains(".")){ return rightLine; } @@ -812,14 +831,28 @@ public class ImportShapeExcel1 { String[] split = shapeNum.split("\\."); String level = ""+ (Integer.parseInt(split[0])-1); String branch = split[1]; - Map> numList = levelMap.get(level); - List upList = numList.get(level + "." + branch); - if (upList == null || upList.isEmpty()){ + if (Integer.parseInt(level)<0){ return rightLine; } - double upRightOffset = this.changeUpRightOffset(upList.get(0), levelMap, nodeMap, offset, rightLine); + Map> numList = levelMap.get(level); + if (null == numList){ + //层级跳级 处理 + double upRightOffset = this.changeUpRightOffset(level+"."+branch, levelMap, nodeMap, offset, rightLine); + rightLine = Math.max(rightLine,upRightOffset); + return Math.max(rightLine,rightMaxLine); + } + + List upList = numList.get(level + "." + branch); + if (upList == null || upList.isEmpty()){ + //分支父级跳级处理 + double upRightOffset = this.changeUpRightOffset(level+"."+branch, levelMap, nodeMap, offset, rightLine); + rightLine = Math.max(rightLine,upRightOffset); + return Math.max(rightLine,rightMaxLine); + } + + double upRightOffset = this.changeUpRightOffset(upList.get(0).getShapeNum(), levelMap, nodeMap, offset, rightLine); rightLine = Math.max(rightLine,upRightOffset); //移动父节点x的偏移量 @@ -878,10 +911,8 @@ public class ImportShapeExcel1 { return rightLine; } - private double changeSubRightOffset(CellObject node,Map>> levelMap,Map> nodeMap,double offset,double rightMaxLine){ + private double changeSubRightOffset(String shapeNum,Map>> levelMap,Map> nodeMap,double offset,double rightMaxLine){ double rightLine = rightMaxLine; - String shapeNum = node.getShapeNum(); - if (!shapeNum.contains(".")){ return rightLine; } @@ -890,10 +921,18 @@ public class ImportShapeExcel1 { String[] split = shapeNum.split("\\."); String level = ""+ (Integer.parseInt(split[0])+1); String branch = split[1]; + if (Integer.parseInt(level)<0){ + return rightLine; + } Map> numList = levelMap.get(level); + if(null == numList){ + //层级跳级处理 + double subRightOffset = this.changeSubRightOffset(level + "." + branch, levelMap, nodeMap, offset, rightLine); + rightLine = Math.max(rightLine,subRightOffset); + return Math.max(rightLine,rightMaxLine); + } List subList = numList.get(level + "." + branch); - if (subList == null || subList.isEmpty()){ subList = numList.get(level); if (subList != null){ @@ -919,17 +958,19 @@ public class ImportShapeExcel1 { } } } + }else{ + //分支下级跳级处理 + double subRightOffset = this.changeSubRightOffset(level + "." + branch, levelMap, nodeMap, offset, rightLine); + rightLine = Math.max(rightLine,subRightOffset); } - return rightLine; + return Math.max(rightLine,rightMaxLine); } - double subRightOffset = this.changeSubRightOffset(subList.get(0), levelMap, nodeMap, offset, rightLine); - + double subRightOffset = this.changeSubRightOffset(subList.get(0).getShapeNum(), levelMap, nodeMap, offset, rightLine); rightLine = Math.max(rightLine,subRightOffset); //移动子级节点 double moveRightOffset = this.moveRightNode(subList, nodeMap, offset, rightLine, true, true); - rightLine = Math.max(rightLine,moveRightOffset); return Math.max(rightLine,rightMaxLine); @@ -1498,6 +1539,12 @@ public class ImportShapeExcel1 { } Map> numList = levelMap.get(level); + if (null == numList){ + //跳级 直接递归找上级 + List upBranchNode = this.findUpBranchNode(levelMap, level + "." + branch); + list.addAll(upBranchNode); + return list; + } List cellObjects = numList.get(level + "." + branch); if (cellObjects==null){