计算金额

This commit is contained in:
2025-10-27 21:18:48 +08:00
parent d6c7402b11
commit b4cba628d4

View File

@@ -92,16 +92,20 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
@Override @Override
public Map<String, Object> centerUser(Long userId) { public Map<String, Object> centerUser(Long userId) {
QueryWrapper totalIncomeSumQueryWrapper = new QueryWrapper(); // QueryWrapper totalIncomeSumQueryWrapper = new QueryWrapper();
totalIncomeSumQueryWrapper.select("sum(total_income) as totalIncome,sum(pending_income) as pendingIncome,sum(withdrawn_income) as cashOutAmount"); // totalIncomeSumQueryWrapper.select("sum(total_income) as totalIncome,sum(pending_income) as pendingIncome,sum(withdrawn_income) as cashOutAmount");
totalIncomeSumQueryWrapper.eq(MkDistributionUser::getUserId, userId); // totalIncomeSumQueryWrapper.eq(MkDistributionUser::getUserId, userId);
totalIncomeSumQueryWrapper.eq(MkDistributionUser::getIsDel, 0); // totalIncomeSumQueryWrapper.eq(MkDistributionUser::getIsDel, 0);
DistributionCenterTopVO centerTopVO = getObjAs(totalIncomeSumQueryWrapper, DistributionCenterTopVO.class); // DistributionCenterTopVO centerTopVO = getObjAs(totalIncomeSumQueryWrapper, DistributionCenterTopVO.class);
// 封装顶部收益数据 // 封装顶部收益数据
Map<String, Object> result = new HashMap<>(5); Map<String, Object> result = new HashMap<>(5);
result.put("totalIncome", centerTopVO == null ? BigDecimal.ZERO : centerTopVO.getTotalIncome()); // result.put("totalIncome", centerTopVO == null ? BigDecimal.ZERO : centerTopVO.getTotalIncome());
result.put("pendingIncome", centerTopVO == null ? BigDecimal.ZERO : centerTopVO.getPendingIncome()); // result.put("pendingIncome", centerTopVO == null ? BigDecimal.ZERO : centerTopVO.getPendingIncome());
result.put("cashOutAmount", centerTopVO == null ? BigDecimal.ZERO : centerTopVO.getUnCashOutAmount()); // result.put("cashOutAmount", centerTopVO == null ? BigDecimal.ZERO : centerTopVO.getUnCashOutAmount());
result.put("totalIncome", 0);
result.put("pendingIncome", 0);
result.put("cashOutAmount", 0);
result.put("activates", activates(userId, 1, 5)); result.put("activates", activates(userId, 1, 5));
result.put("unActivates", unActivates(userId, 1, 3)); result.put("unActivates", unActivates(userId, 1, 3));