|
@@ -149,12 +149,13 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
|
|
|
Map<String, Long> billetCountMap = billetAutoTmpList.stream()
|
|
|
.collect(Collectors.groupingBy(BilletAutoTmp::getStorageBillId, Collectors.counting()));
|
|
|
|
|
|
- // 遍历所有 StorageBill 记录,累加 amountTotal,并过滤 amountTotal > 0
|
|
|
List<StorageBill> filteredRecords = allRecords.stream()
|
|
|
- .peek(bill -> bill.setAmountTotal(bill.getAmountTotal() + billetCountMap.getOrDefault(bill.getId(), 0L).intValue()))
|
|
|
- .filter(bill -> bill.getAmountTotal() > 0) // 最终过滤掉 amountTotal 为 0 的数据
|
|
|
+ .peek(bill -> bill.setAmountTotal(
|
|
|
+ bill.getAmountTotal() + billetCountMap.getOrDefault(bill.getId(), 0L).intValue()))
|
|
|
+ .filter(bill -> bill.getOutTime() == null || bill.getAmountTotal() > 0) // 仅当 outTime 非空时过滤 0
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
+
|
|
|
// 更新 total
|
|
|
long total = filteredRecords.size(); // 最终过滤后的总记录数
|
|
|
|