|
|
|
@ -130,14 +130,16 @@ public class QuoteDetailBomTreeServiceImpl extends ServiceImpl<QuoteDetailBomTre |
|
|
|
* @param ifsConFactory IFS 连接工厂,每个并发线程调用 get() 获取独立连接,避免共享连接线程安全问题 |
|
|
|
*/ |
|
|
|
private BomNodeData collectBomData(QuoteDetail detail, Long parentId, Integer level, Supplier<Server> ifsConFactory, Map<String, BigDecimal> costCache) { |
|
|
|
// 统一先尝试将临时料映射到正式料,保证新建与“切换版本刷新”取数来源一致 |
|
|
|
PartInformationEntity mappedPart = baseMapper.queryPart(detail.getSite(), detail.getPartNo()); |
|
|
|
if (Objects.nonNull(mappedPart) && "Y".equals(mappedPart.getStatus())) { |
|
|
|
detail.setPartNo(mappedPart.getPartNo()); |
|
|
|
} |
|
|
|
|
|
|
|
// 确定 BOM 类型 |
|
|
|
if (parentId.equals(0L)) { |
|
|
|
detail.setBomType("Manufacturing"); |
|
|
|
} else { |
|
|
|
PartInformationEntity part = baseMapper.queryPart(detail.getSite(), detail.getPartNo()); |
|
|
|
if (Objects.nonNull(part) && "Y".equals(part.getStatus())) { |
|
|
|
detail.setPartNo(part.getPartNo()); |
|
|
|
} |
|
|
|
if (detail.getBomType() == null || detail.getBomType().isEmpty()) { |
|
|
|
String partType = baseMapper.queryPartType(detail.getSite(), detail.getPartNo()); |
|
|
|
if ("Manufactured".equals(partType) || "Manufactured Recipe".equals(partType)) { |
|
|
|
|