From 85f9d9b88e9ad04fb086b5c76dc2c9fdf66634bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E6=88=90?= <2847920761@qq.com> Date: Tue, 19 Aug 2025 22:24:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B7=A5=E7=A8=8B=E9=87=8F?= =?UTF-8?q?=E6=B8=85=E5=8D=95=E7=9A=84=E8=A7=84=E6=A0=BC=E3=80=81=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E6=8B=9B=E9=87=87=E5=92=8C=E7=89=A9=E8=B5=84=E7=9A=84?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/excel/coryUtils/ExcelReader.java | 91 +------------------ ...usBillofquantitiesVersionsServiceImpl.java | 69 +++++++++++--- 2 files changed, 62 insertions(+), 98 deletions(-) diff --git a/xinnengyuan/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/coryUtils/ExcelReader.java b/xinnengyuan/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/coryUtils/ExcelReader.java index 4978d7a4..ded3f0a4 100644 --- a/xinnengyuan/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/coryUtils/ExcelReader.java +++ b/xinnengyuan/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/coryUtils/ExcelReader.java @@ -143,7 +143,7 @@ public class ExcelReader { List 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> data) { -// TreeNode root = new TreeNode(new ArrayList<>()); -// Map nodeMap = new HashMap<>(); -// nodeMap.put("", root); -// List nonEmptyKeys = new ArrayList<>(); // 记录非空A列值的顺序 -// -// for (List 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 data; -// List children; -// -// public TreeNode(List data) { -// this.data = data; -// this.children = new ArrayList<>(); -// } -// -// public void addChild(TreeNode child) { -// this.children.add(child); -// } -// -// public List getData() { -// return data; -// } -// -// public List getChildren() { -// return children; -// } -// } + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/design/service/impl/BusBillofquantitiesVersionsServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/design/service/impl/BusBillofquantitiesVersionsServiceImpl.java index 10494ccd..61f6fb34 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/design/service/impl/BusBillofquantitiesVersionsServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/design/service/impl/BusBillofquantitiesVersionsServiceImpl.java @@ -333,8 +333,9 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl= 2 ? rowData.get(1).trim() : null); - material.setUnit(rowData.size() >= 3 ? rowData.get(2).trim() : null); - String quantityStr = rowData.size() >= 4 ? rowData.get(3).trim() : null; + material.setSpecification(rowData.size() >= 3 ? rowData.get(2).trim() : null); + material.setUnit(rowData.size() >= 4 ? rowData.get(3).trim() : null); + String quantityStr = rowData.size() >= 5 ? rowData.get(4).trim() : null; if (!quantityStr.isEmpty()) { try { // 支持整数和小数解析 @@ -343,7 +344,7 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl= 5 ? rowData.get(4).trim() : null); + material.setRemark(rowData.size() >= 6 ? rowData.get(5).trim() : null); // 存储映射关系(供子节点查询父sid) nodeMap.put(currentNode, material); @@ -438,11 +439,11 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl eq = new LambdaQueryWrapper() .eq(BusBillofquantitiesVersions::getVersions, id); BusBillofquantitiesVersions busBillofquantitiesVersions = new BusBillofquantitiesVersions(); @@ -450,7 +451,7 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl eq = new LambdaQueryWrapper() + .eq(BusBillofquantitiesVersions::getVersions, id); + BusBillofquantitiesVersions busBillofquantitiesVersions = new BusBillofquantitiesVersions(); + busBillofquantitiesVersions.setStatus(processEvent.getStatus()); + this.update(busBillofquantitiesVersions, eq); + } + + /** + * 执行任务创建监听 + * 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断 + * 在方法中判断流程节点key + * if ("xxx".equals(processTaskEvent.getNodeCode())) { + * //执行业务逻辑 + * } + * + * @param processTaskEvent 参数 + */ + @org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.endsWith('equipmentList ')") + public void processTaskPlansHandlerEquipmentList(ProcessTaskEvent processTaskEvent) { log.info("物资设备清单审核任务创建了{}", processTaskEvent.toString()); } @@ -500,9 +548,8 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl