浏览代码

数量显示

wanglang 6 天之前
父节点
当前提交
ef8a559506

+ 4 - 0
trade-service/src/main/java/com/trade/service/trade/purchaseorder/service/impl/PurchaseOrderInvoiceServiceImpl.java

@@ -142,6 +142,10 @@ public class PurchaseOrderInvoiceServiceImpl extends ServiceImpl<PurchaseOrderIn
                 }
                 invoiceCommodityDtos.add(invoiceCommodityDto);
             }
+            BigDecimal allNumber = invoiceCommodityDtos.stream()
+                    .filter(commodityDto -> commodityDto.getNumber() != null).map(InvoiceCommodityDto::getNumber)
+                    .reduce(BigDecimal.ZERO, BigDecimal::add);
+            purchaseOrderInvoiceDetailsVo.setNumber(allNumber);
             purchaseOrderInvoiceDetailsVo.setInvoiceCommodityList(invoiceCommodityDtos);
         }
         return purchaseOrderInvoiceDetailsVo;