From 8930b494560a85c32c2f52b153aff5704abdeace Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Thu, 18 Jun 2026 09:29:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=8A=A5=E5=B7=A5BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ProductionPlanServiceImpl.java | 49 +++++++++++++++++-- src/main/resources/application.yml | 4 +- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/xujie/sys/modules/longchuang/service/impl/ProductionPlanServiceImpl.java b/src/main/java/com/xujie/sys/modules/longchuang/service/impl/ProductionPlanServiceImpl.java index ea6274a..d4f66f0 100644 --- a/src/main/java/com/xujie/sys/modules/longchuang/service/impl/ProductionPlanServiceImpl.java +++ b/src/main/java/com/xujie/sys/modules/longchuang/service/impl/ProductionPlanServiceImpl.java @@ -338,7 +338,7 @@ public class ProductionPlanServiceImpl implements ProductionPlanService { throw new I18nException("lc.production.report.log.node.not.done.or.cancelled"); } - String nodeReportMode = normalizeNodeReportMode(order.getNodeReportMode()); + String nodeReportMode = normalizeNodeReportMode(order.getNodeReportMode(), normalizedOrderType); if (NODE_REPORT_MODE_SEQUENTIAL.equals(nodeReportMode)) { ProductionPlanOrderNodeData laterDoneNode = productionPlanMapper.queryFirstDoneNodeAfterSort(reportLog.getOrderNo(), targetNode.getSortNo()); if (laterDoneNode != null) { @@ -364,6 +364,7 @@ public class ProductionPlanServiceImpl implements ProductionPlanService { productionPlanMapper.decreaseOrderReportQty(reportLog.getOrderNo(), reportQty, userId); } } + removeNodeReportMedia(reportLog.getOrderNo(), reportLog.getNodeCode(), reportLog.getLogNo(), normalizedOrderType); ProductionPlanNodeReportData cancelLogData = new ProductionPlanNodeReportData(); cancelLogData.setLogNo(generateLogNo(normalizedOrderType)); cancelLogData.setOrderNo(reportLog.getOrderNo()); @@ -673,7 +674,7 @@ public class ProductionPlanServiceImpl implements ProductionPlanService { if (data.getAutoAssignAllUsers() == null) { data.setAutoAssignAllUsers(false); } - data.setNodeReportMode(normalizeNodeReportMode(data.getNodeReportMode())); + data.setNodeReportMode(normalizeNodeReportMode(data.getNodeReportMode(), orderType)); Long userId = getCurrentUserId(); data.setUpdateBy(userId); boolean creating = !StringUtils.hasText(data.getOrderNo()); @@ -982,7 +983,7 @@ public class ProductionPlanServiceImpl implements ProductionPlanService { if (node == null) { throw new I18nException("lc.production.report.node.not.exists"); } - String nodeReportMode = normalizeNodeReportMode(order.getNodeReportMode()); + String nodeReportMode = normalizeNodeReportMode(order.getNodeReportMode(), orderType); if (NODE_REPORT_MODE_SEQUENTIAL.equals(nodeReportMode)) { List nodeList = productionPlanMapper.queryOrderNodeList(Collections.singletonList(data.getOrderNo())); ProductionPlanOrderNodeData firstUnDoneNode = null; @@ -1032,7 +1033,7 @@ public class ProductionPlanServiceImpl implements ProductionPlanService { if (node == null) { throw new I18nException("lc.production.report.node.not.exists"); } - String nodeReportMode = normalizeNodeReportMode(order.getNodeReportMode()); + String nodeReportMode = normalizeNodeReportMode(order.getNodeReportMode(), orderType); if (NODE_REPORT_MODE_SEQUENTIAL.equals(nodeReportMode)) { List nodeList = productionPlanMapper.queryOrderNodeList(Collections.singletonList(data.getOrderNo())); ProductionPlanOrderNodeData firstUnDoneNode = null; @@ -1235,6 +1236,40 @@ public class ProductionPlanServiceImpl implements ProductionPlanService { throw new XJException("打包步骤不正确,请重新选择"); } + private void removeNodeReportMedia(String orderNo, String nodeCode, String logNo, String orderType) { + if (!StringUtils.hasText(orderNo) || !StringUtils.hasText(nodeCode) || !StringUtils.hasText(logNo)) { + return; + } + SysOssEntity query = new SysOssEntity(); + query.setOrderRef1(orderNo); + query.setOrderRef2(nodeCode); + query.setOrderRef3(logNo); + List mediaList = sysOssService.queryOssFilePlus(query); + if (mediaList == null || mediaList.isEmpty()) { + return; + } + Set removeIdSet = new HashSet<>(); + for (SysOssEntity media : mediaList) { + if (media == null + || media.getId() == null + || !NODE_MEDIA_REF_TYPE.equals(media.getOrderReftype())) { + continue; + } + if (StringUtils.hasText(orderType) + && StringUtils.hasText(media.getOrderRef4()) + && !orderType.equalsIgnoreCase(media.getOrderRef4().trim())) { + continue; + } + Long mediaId = media.getId(); + if (mediaId <= Integer.MAX_VALUE && mediaId >= Integer.MIN_VALUE) { + removeIdSet.add(mediaId.intValue()); + } + } + if (!removeIdSet.isEmpty()) { + sysOssService.removeOssFile(new ArrayList<>(removeIdSet)); + } + } + private String sanitizeFolderName(String folderName) { if (!StringUtils.hasText(folderName)) { return ""; @@ -1581,8 +1616,12 @@ public class ProductionPlanServiceImpl implements ProductionPlanService { return orderType; } - private String normalizeNodeReportMode(String mode) { + private String normalizeNodeReportMode(String mode, String orderType) { if (!StringUtils.hasText(mode)) { + String normalizedOrderType = normalizeOrderType(orderType); + if (ORDER_TYPE_MACHINING.equals(normalizedOrderType) || ORDER_TYPE_RENOVATION.equals(normalizedOrderType)) { + return NODE_REPORT_MODE_SEQUENTIAL; + } return NODE_REPORT_MODE_PARALLEL; } String text = mode.trim().toUpperCase(); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 3cc05d1..8083ffb 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -36,8 +36,8 @@ spring: servlet: multipart: - max-file-size: 100MB - max-request-size: 100MB + max-file-size: 500MB + max-request-size: 500MB enabled: true mvc: throw-exception-if-no-handler-found: true