diff --git a/src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java b/src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java index bf7b76bc..b058fc91 100644 --- a/src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java +++ b/src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java @@ -3864,23 +3864,29 @@ public class PartInformationServiceImpl extends ServiceImpl ifsConFactory, Map costCache, Map workCenterCostCache) { + private BomNodeData collectBomData(QuoteDetail detail, + Long parentId, + Integer level, + Supplier ifsConFactory, + Map costCache, + Map workCenterCostCache) { + return collectBomData(detail, parentId, level, ifsConFactory, costCache, workCenterCostCache, new LinkedHashSet<>()); + } + + private BomNodeData collectBomData(QuoteDetail detail, + Long parentId, + Integer level, + Supplier ifsConFactory, + Map costCache, + Map workCenterCostCache, + Set recursionPath) { // 统一先尝试将临时料映射到正式料,保证新建与“切换版本刷新”取数来源一致 PartInformationEntity mappedPart = baseMapper.queryPart(detail.getSite(), detail.getPartNo()); if (Objects.nonNull(mappedPart) && "Y".equals(mappedPart.getStatus())) { @@ -161,6 +176,15 @@ public class QuoteDetailBomTreeServiceImpl extends ServiceImpl nextRecursionPath = new LinkedHashSet<>(recursionPath); + nextRecursionPath.add(currentBomPathKey); bom.setParentId(parentId); bom.setLevel(level); log.info("BOM信息:{}", bom); @@ -205,7 +229,15 @@ public class QuoteDetailBomTreeServiceImpl extends ServiceImpl recursionPath, String currentBomPathKey) { + List fullPath = new ArrayList<>(recursionPath); + fullPath.add(currentBomPathKey); + return String.join(" -> ", fullPath); + } + private void copyCommonFields(QuoteDetail source, QuoteDetail target) { target.setId(source.getId()); target.setQuoteId(source.getQuoteId());