feat:退换各自食堂统计

This commit is contained in:
dzc committed 2025-06-18 11:46:29 +08:00
1 parent 1529301deb
commit 4971373843
2 files changed
+28

No files matched your search

@@ -24,6 +24,12 @@ public class HardDeptTotalVo {
@Schema(description = "批量扣减次数")
private Long walletReduceCount = 0L;
@Schema(description = "退还各自食堂金额")
private Long walletReturnCanteenPrice = 0L;
@Schema(description = "退还各自食堂次数")
private Long walletReturnCanteenCount = 0L;
@Schema(description = "单次充值金额")
private Long walletOncePrice = 0L;
@@ -365,6 +365,20 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
}
return remoteWalletTransactionService.sumAndCount(walletDto).getData();
});
// 查询钱包退还各自食堂
CompletableFuture<List<WalletTransactionSumAndCountVo>> walletRetrunCanteenFuture = CompletableFuture.supplyAsync(() -> {
WalletTransactionSumAndCountDto walletDto = new WalletTransactionSumAndCountDto();
walletDto.setDeptIds(deptIds);
walletDto.setBizTypes(List.of(WalletBizEnum.RETURN_CANTEEN.getCode()));
walletDto.setType(WalletTransactionSumAndCountDto.TYPE_EXPENSE);
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
walletDto.setCreateTimeList(dto.getCreateTimeList());
}
if (ObjectUtil.isNotEmpty(dto.getWalletTypeId())) {
walletDto.setWalletTypeId(dto.getWalletTypeId());
}
return remoteWalletTransactionService.sumAndCount(walletDto).getData();
});
// 查询钱包单次充值流水
CompletableFuture<List<WalletTransactionSumAndCountVo>> walletOnceBatchFuture = CompletableFuture.supplyAsync(() -> {
WalletTransactionSumAndCountDto walletDto = new WalletTransactionSumAndCountDto();
@@ -424,6 +438,7 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
allFutures.join();
List<WalletTransactionSumAndCountVo> walletBatchList = walletBatchFuture.join();
List<WalletTransactionSumAndCountVo> walletReduceList = walletReduceFuture.join();
List<WalletTransactionSumAndCountVo> walletRetrunCanteenList = walletRetrunCanteenFuture.join();
List<WalletTransactionSumAndCountVo> walletOnceBatchList = walletOnceBatchFuture.join();
List<WalletTransactionSumAndCountVo> walletOnceReduceList = walletOnceReduceFuture.join();
List<HardOrderSumAndCountVo> payList = payFuture.join();
@@ -443,6 +458,13 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
v.setWalletReduceCount(i.getCount());
});
}
// 退还各自食堂
if (ObjectUtil.isNotEmpty(walletRetrunCanteenList)) {
walletRetrunCanteenList.stream().filter(i -> ObjectUtil.equals(i.getDeptId(), v.getDeptId())).findFirst().ifPresent(i -> {
v.setWalletReturnCanteenPrice(Math.abs(i.getSum()));
v.setWalletReturnCanteenCount(i.getCount());
});
}
if (ObjectUtil.isNotEmpty(walletOnceBatchList)) {
walletOnceBatchList.stream().filter(i -> ObjectUtil.equals(i.getDeptId(), v.getDeptId())).findFirst().ifPresent(i -> {
v.setWalletOncePrice(i.getSum());