Excel导入流程图review ,编号跨级问题修改

This commit is contained in:
anhc 2022-09-19 16:39:44 +08:00
parent 7c8e0d59b2
commit 0790e9664e
2 changed files with 73 additions and 63 deletions

View File

@ -358,6 +358,9 @@ public class ImportShapeExcel1 {
for (int level = 0; level < maxLevel; level++) {
//同层级多分支节点信息, <序号同序号listNode>
Map<String, List<CellObject>> numList = levelMap.get("" + level);
if (null == numList){
continue;
}
for (int i = 0; i < numList.keySet().size()+1; i++) {
//构建同层级的分支序号
@ -424,8 +427,8 @@ public class ImportShapeExcel1 {
for (int level = 0; level < maxLevel; level++) {
//同层级多分支节点信息, <序号同序号listNode>
Map<String, List<CellObject>> numList = levelMap.get("" + level);
if (numList.keySet().size()<=1){
//只调整分支节点
if (numList == null ){
//跳级处理,
continue;
}
//找到一个出现分支的层级
@ -655,6 +658,7 @@ public class ImportShapeExcel1 {
Map<String, List<CellObject>> numList = levelMap.get(level);
List<CellObject> upList = numList.get(level + "." + branch);
if (upList == null || upList.isEmpty()){
return leftLine;
@ -1506,7 +1510,6 @@ public class ImportShapeExcel1 {
list.addAll(upBranchNode);
}
return list;
}
@ -1553,6 +1556,11 @@ public class ImportShapeExcel1 {
Map<String, List<CellObject>> numMap = levelMap.get(level);
if (null == numMap){
//出现跨级越级处理
List<JSONObject> list = this.find(StringUtils.isNotEmpty(branch) ? level +"."+ branch : level, levelMap, nodeMap); ;
upList.addAll(list);
}else{
if (StringUtils.isEmpty(branch)){
//整数节点找父级节点
boolean flag = false;
@ -1636,6 +1644,8 @@ public class ImportShapeExcel1 {
}
}
}
return upList;
}