|
|
@ -175,23 +175,26 @@ public class QuoteDetailBomTreeServiceImpl extends ServiceImpl<QuoteDetailBomTre |
|
|
if (childNode != null) { |
|
|
if (childNode != null) { |
|
|
nodeData.children.add(childNode); |
|
|
nodeData.children.add(childNode); |
|
|
} |
|
|
} |
|
|
// 半成品价格为 0,bomId 在写入阶段填充 |
|
|
|
|
|
|
|
|
// 半成品:bomId 在写入阶段填充,先清零价格(后续 IFS 查询会覆盖) |
|
|
component.setBomFlag("Y"); |
|
|
component.setBomFlag("Y"); |
|
|
component.setUnitPrice(BigDecimal.ZERO); |
|
|
component.setUnitPrice(BigDecimal.ZERO); |
|
|
component.setActualPrice(BigDecimal.ZERO); |
|
|
component.setActualPrice(BigDecimal.ZERO); |
|
|
component.setQuotePrice(BigDecimal.ZERO); |
|
|
component.setQuotePrice(BigDecimal.ZERO); |
|
|
} else { |
|
|
} else { |
|
|
component.setBomFlag("N"); |
|
|
component.setBomFlag("N"); |
|
|
// 正式物料:在事务外调用 IFS 查询成本 |
|
|
|
|
|
if ("Y".equals(component.getStatus())) { |
|
|
|
|
|
getFinalPartCost(component, ifsCon); |
|
|
|
|
|
if (component.getUnitPrice() != null && component.getUnitPrice().compareTo(BigDecimal.ZERO) > 0) { |
|
|
|
|
|
costQuerySuccessCount++; |
|
|
|
|
|
} else { |
|
|
|
|
|
costQueryFailCount++; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 与原逻辑保持一致:无论是否半成品,只要是正式物料(status="Y")都查询 IFS 参考成本 |
|
|
|
|
|
// 半成品的 IFS 参考成本用于在材料页签中展示,成本计算仍以 BOM 明细为准 |
|
|
|
|
|
if ("Y".equals(component.getStatus())) { |
|
|
|
|
|
getFinalPartCost(component, ifsCon); |
|
|
|
|
|
if (component.getUnitPrice() != null && component.getUnitPrice().compareTo(BigDecimal.ZERO) > 0) { |
|
|
|
|
|
costQuerySuccessCount++; |
|
|
|
|
|
} else { |
|
|
|
|
|
costQueryFailCount++; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
nodeData.components.add(component); |
|
|
nodeData.components.add(component); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|