|
|
@ -248,13 +248,13 @@ public class QuoteDetailServiceImpl extends ServiceImpl<QuoteDetailMapper, Quote |
|
|
log.info("当前BOM:{}", bomTree.getPartNo()); |
|
|
log.info("当前BOM:{}", bomTree.getPartNo()); |
|
|
// 第二层BOM 目的是遍历所有的 BOM中 的 Part用量 |
|
|
// 第二层BOM 目的是遍历所有的 BOM中 的 Part用量 |
|
|
long parentId = bomTree.getParentId(); |
|
|
long parentId = bomTree.getParentId(); |
|
|
|
|
|
String partNo = bomTree.getPartNo(); |
|
|
for (QuoteDetailBomTree tree : list) { |
|
|
for (QuoteDetailBomTree tree : list) { |
|
|
if (tree.getLevel() > bomTree.getLevel() || tree.getId() != parentId) { |
|
|
if (tree.getLevel() > bomTree.getLevel() || tree.getId() != parentId) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
parentId = tree.getParentId(); |
|
|
|
|
|
// 获取 层级比自己高的Bom 来获得BOM信息 用量和损耗 |
|
|
// 获取 层级比自己高的Bom 来获得BOM信息 用量和损耗 |
|
|
List<QuoteDetailBom> bomList = quoteDetailBomService.lambdaQuery().eq(QuoteDetailBom::getTreeId, tree.getParentId()).eq(QuoteDetailBom::getComponentPart, tree.getPartNo()).list(); |
|
|
|
|
|
|
|
|
List<QuoteDetailBom> bomList = quoteDetailBomService.lambdaQuery().eq(QuoteDetailBom::getTreeId, parentId).eq(QuoteDetailBom::getComponentPart, partNo).list(); |
|
|
BigDecimal qtyPerAssembly = BigDecimal.ONE; |
|
|
BigDecimal qtyPerAssembly = BigDecimal.ONE; |
|
|
for (QuoteDetailBom bom : bomList) { |
|
|
for (QuoteDetailBom bom : bomList) { |
|
|
BigDecimal yield = BigDecimal.ONE.subtract(bom.getShrinkageFactor().divide( BigDecimal.valueOf(100),16,RoundingMode.HALF_UP)); |
|
|
BigDecimal yield = BigDecimal.ONE.subtract(bom.getShrinkageFactor().divide( BigDecimal.valueOf(100),16,RoundingMode.HALF_UP)); |
|
|
@ -264,6 +264,9 @@ public class QuoteDetailServiceImpl extends ServiceImpl<QuoteDetailMapper, Quote |
|
|
// 计算 损耗和用量得到的差异 |
|
|
// 计算 损耗和用量得到的差异 |
|
|
bomLabourCost = bomLabourCost.multiply(qtyPerAssembly); |
|
|
bomLabourCost = bomLabourCost.multiply(qtyPerAssembly); |
|
|
bomMachineCost = bomMachineCost.multiply(qtyPerAssembly); |
|
|
bomMachineCost = bomMachineCost.multiply(qtyPerAssembly); |
|
|
|
|
|
// 拿到上层数据 |
|
|
|
|
|
parentId = tree.getParentId(); |
|
|
|
|
|
partNo = tree.getPartNo(); |
|
|
} |
|
|
} |
|
|
labourCost = labourCost.add(bomLabourCost); |
|
|
labourCost = labourCost.add(bomLabourCost); |
|
|
machineCost = machineCost.add(bomMachineCost); |
|
|
machineCost = machineCost.add(bomMachineCost); |
|
|
|