Browse Source

2026-03-10

报价优化
master
fengyuan_yang 1 month ago
parent
commit
57bcbdca77
  1. 21
      src/main/java/com/spring/modules/quote/service/impl/QuoteDetailBomTreeServiceImpl.java

21
src/main/java/com/spring/modules/quote/service/impl/QuoteDetailBomTreeServiceImpl.java

@ -175,23 +175,26 @@ public class QuoteDetailBomTreeServiceImpl extends ServiceImpl<QuoteDetailBomTre
if (childNode != null) { if (childNode != null) {
nodeData.children.add(childNode); nodeData.children.add(childNode);
} }
// 半成品价格为 0bomId 在写入阶段填充
// 半成品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);
} }

Loading…
Cancel
Save