fix:充值钱包统计优化

This commit is contained in:
dzc committed 2026-07-13 12:36:54 +08:00
1 parent 19e7b42c4f
commit 67823d9644
4 files changed
+15 -4

No files matched your search

@@ -528,7 +528,7 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
WalletTransactionSumAndCountDto walletDto = new WalletTransactionSumAndCountDto();
walletDto.setDeptIds(dto.getDeptIds());
walletDto.setIsInclude(dto.getIsInclude());
walletDto.setBizTypes(List.of(WalletBizEnum.UPDATE.getCode()));
walletDto.setBizTypes(List.of(WalletBizEnum.UPDATE.getCode(), WalletBizEnum.RECHARGE.getCode()));
walletDto.setType(WalletTransactionSumAndCountDto.TYPE_INCOME);
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
walletDto.setCreateTimeList(dto.getCreateTimeList());
@@ -543,7 +543,7 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
WalletTransactionSumAndCountDto walletDto = new WalletTransactionSumAndCountDto();
walletDto.setDeptIds(dto.getDeptIds());
walletDto.setIsInclude(dto.getIsInclude());
walletDto.setBizTypes(List.of(WalletBizEnum.UPDATE.getCode()));
walletDto.setBizTypes(List.of(WalletBizEnum.UPDATE.getCode(), WalletBizEnum.RECHARGE.getCode()));
walletDto.setType(WalletTransactionSumAndCountDto.TYPE_EXPENSE);
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
walletDto.setCreateTimeList(dto.getCreateTimeList());
@@ -192,7 +192,7 @@ public class SysUserTransactionServiceImpl extends ServiceImpl<SysUserTransactio
* 回调
*/
@Override
@Transactional(rollbackFor = Exception.class)
// @Transactional(rollbackFor = Exception.class)
public void applyCallback(ProcessNodeRecordAssignUserParamDto dto, Long tenantId) {
if (!flowUtil.checkCallback(dto)) {
return;
@@ -20,4 +20,9 @@ public class WalletQbTotalVo {
*/
private Long payTotal = 0L;
/**
* 充值钱包余额
*/
private Long topupTotal = 0L;
}
@@ -309,6 +309,9 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
WalletQbTotalVo result = new WalletQbTotalVo();
// 查询钱包类表
List<WalletTypeEntity> walletTypeList = walletTypeService.list();
if (ObjectUtil.isNotEmpty(dto.getWalletTypeId())) {
walletTypeList = walletTypeList.stream().filter(item -> ObjectUtil.equals(item.getId(), dto.getWalletTypeId())).toList();
}
// 查询所有钱包类型的流水记录
for (WalletTypeEntity i : walletTypeList) {
WalletManageBalanceDto walletBalanceDto = BeanUtils.toBean(dto, WalletManageBalanceDto.class);
@@ -323,8 +326,11 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
if (ObjectUtil.equals(i.getUniqueCode(), WalletTypeEnum.PAY.getCode())) {
result.setPayTotal(total);
}
if (ObjectUtil.equals(i.getUniqueCode(), WalletTypeEnum.TOPUP.getCode())) {
result.setTopupTotal(total);
}
}
result.setTotal(result.getEatTotal() + result.getPayTotal());
result.setTotal(result.getEatTotal() + result.getPayTotal() + result.getTopupTotal());
return result;
}