计算金额 类型问题
This commit is contained in:
@@ -92,20 +92,21 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
|
||||
|
||||
@Override
|
||||
public Map<String, Object> centerUser(Long userId) {
|
||||
// QueryWrapper totalIncomeSumQueryWrapper = new QueryWrapper();
|
||||
// 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::getIsDel, 0);
|
||||
// DistributionCenterTopVO centerTopVO = getObjAs(totalIncomeSumQueryWrapper, DistributionCenterTopVO.class);
|
||||
DistributionCenterTopVO centerTopVO = null;
|
||||
try {
|
||||
QueryWrapper totalIncomeSumQueryWrapper = new QueryWrapper();
|
||||
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::getIsDel, 0);
|
||||
centerTopVO = getObjAs(totalIncomeSumQueryWrapper, DistributionCenterTopVO.class);
|
||||
}catch (Exception e){
|
||||
log.error("查询用户中心数据失败", e);
|
||||
}
|
||||
// 封装顶部收益数据
|
||||
Map<String, Object> result = new HashMap<>(5);
|
||||
// result.put("totalIncome", centerTopVO == null ? BigDecimal.ZERO : centerTopVO.getTotalIncome());
|
||||
// result.put("pendingIncome", centerTopVO == null ? BigDecimal.ZERO : centerTopVO.getPendingIncome());
|
||||
// result.put("cashOutAmount", centerTopVO == null ? BigDecimal.ZERO : centerTopVO.getUnCashOutAmount());
|
||||
|
||||
result.put("totalIncome", 0);
|
||||
result.put("pendingIncome", 0);
|
||||
result.put("cashOutAmount", 0);
|
||||
result.put("totalIncome", centerTopVO == null ? 0.0 : centerTopVO.getTotalIncome());
|
||||
result.put("pendingIncome", centerTopVO == null ? 0.0 : centerTopVO.getPendingIncome());
|
||||
result.put("cashOutAmount", centerTopVO == null ? 0.0 : centerTopVO.getCashOutAmount());
|
||||
|
||||
result.put("activates", activates(userId, 1, 5));
|
||||
result.put("unActivates", unActivates(userId, 1, 3));
|
||||
|
||||
Reference in New Issue
Block a user