增加工程量清单的规格、以及招采和物资的审核

This commit is contained in:
2025-08-19 22:24:12 +08:00
parent c9b3fae598
commit 85f9d9b88e
2 changed files with 62 additions and 98 deletions

View File

@ -143,7 +143,7 @@ public class ExcelReader {
List<String> rowData = new ArrayList<>();
// 读取A到E列索引0到4
for (int cellIndex = 0; cellIndex < 5; cellIndex++) {
for (int cellIndex = 0; cellIndex < 6; cellIndex++) {
Cell cell = row.getCell(cellIndex, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
rowData.add(getCellValue(cell));
}
@ -228,51 +228,7 @@ public class ExcelReader {
return root;
}
// public static TreeNode buildTree(List<List<String>> data) {
// TreeNode root = new TreeNode(new ArrayList<>());
// Map<String, TreeNode> nodeMap = new HashMap<>();
// nodeMap.put("", root);
// List<String> nonEmptyKeys = new ArrayList<>(); // 记录非空A列值的顺序
//
// for (List<String> row : data) {
// String key = row.get(0).trim();
// TreeNode node = new TreeNode(row);
//
// if (!key.isEmpty()) {
// String parentKey = getParentKey(key);
// TreeNode parent = nodeMap.get(parentKey);
//
// if (parent == null) {
// parent = new TreeNode(new ArrayList<>());
// nodeMap.put(parentKey, parent);
// TreeNode grandParent = nodeMap.get(getParentKey(parentKey));
// if (grandParent != null) {
// grandParent.addChild(parent);
// } else {
// // 如果没有更高级别的父节点,就挂到根节点
// root.addChild(parent);
// }
// }
//
// parent.addChild(node);
// nodeMap.put(key, node);
// nonEmptyKeys.add(key);
// } else {
// // A列为空挂到上一个非空节点下
// if (!nonEmptyKeys.isEmpty()) {
// String lastKey = nonEmptyKeys.get(nonEmptyKeys.size() - 1);
// TreeNode parent = nodeMap.get(lastKey);
// if (parent != null) {
// parent.addChild(node);
// }
// } else {
// root.addChild(node);
// }
// }
// }
//
// return root;
// }
/**
* 以可视化方式打印树形结构
@ -362,26 +318,7 @@ public class ExcelReader {
// 其他格式默认父节点是根节点
return "";
}
// private static String getParentKey(String key) {
// // 中文数字(一、二、三...)的父节点是根节点
// if (key.matches(CHINESE_NUMBERS_REGEX)) {
// return "";
// }
//
// // 数字格式1、1.1、1.2.1等)的父节点是上一级
// if (key.matches("\\d+(\\.\\d+)*")) {
// int lastDotIndex = key.lastIndexOf('.');
// if (lastDotIndex > 0) {
// return key.substring(0, lastDotIndex);
// } else {
// // 一级数字如1、2的父节点是根节点或最近的中文数字节点
// return "";
// }
// }
//
// // 其他格式默认父节点是根节点
// return "";
// }
/**
* Excel数据实体类包含所有工作表数据
@ -459,26 +396,6 @@ public class ExcelReader {
this.parent = parent;
}
}
// public static class TreeNode {
// List<String> data;
// List<TreeNode> children;
//
// public TreeNode(List<String> data) {
// this.data = data;
// this.children = new ArrayList<>();
// }
//
// public void addChild(TreeNode child) {
// this.children.add(child);
// }
//
// public List<String> getData() {
// return data;
// }
//
// public List<TreeNode> getChildren() {
// return children;
// }
// }
}