xiaoyong931011
2022-09-05 3d83fe59399df5f7c80749841b8d26851c016c18
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallTeamLeaderServiceImpl.java
@@ -389,14 +389,23 @@
    public FebsResponse leaderProfit() {
        MallMember loginUser = LoginUserUtil.getLoginUser();
        ApiLeaderProfitVo apiLeaderProfitVo = new ApiLeaderProfitVo();
//        BigDecimal TotalProfit = mallLeaderAchieveMapper.selectProfitByStateAndDateTimeAndUniqueCode(null,null,loginUser.getInviteId()).setScale(2,BigDecimal.ROUND_DOWN);
//        apiLeaderProfitVo.setTotalProfit(TotalProfit);
        BigDecimal todayProfit = mallLeaderAchieveMapper.selectProfitByStateAndDateTimeAndUniqueCode(2,DateUtil.date(),loginUser.getInviteId()).setScale(2,BigDecimal.ROUND_DOWN);
        BigDecimal totalProfit = mallMoneyFlowMapper.selectAmountByFlowtypeAndType(loginUser.getId(),FlowTypeEnum.BALANCE.getValue(),MoneyFlowTypeEnum.LEADERACHIEVE.getValue(),null,null,null);
        apiLeaderProfitVo.setTotalProfit(totalProfit);
        BigDecimal todayProfit = mallMoneyFlowMapper.selectAmountByFlowtypeAndType(loginUser.getId(),FlowTypeEnum.BALANCE.getValue(),
                MoneyFlowTypeEnum.LEADERACHIEVE.getValue(),
                null,DateUtil.date(),
                null);
        apiLeaderProfitVo.setTodayProfit(todayProfit);
        BigDecimal monthProfit = mallMoneyFlowMapper.selectAmountByFlowtypeAndType(loginUser.getId(),FlowTypeEnum.BALANCE.getValue(),
                MoneyFlowTypeEnum.LEADERACHIEVE.getValue(),
                null,null,
                DateUtil.date());
        apiLeaderProfitVo.setMonthProfit(monthProfit);
        BigDecimal waitProfit = mallLeaderAchieveMapper.selectProfitByStateAndDateTimeAndUniqueCode(1,null,loginUser.getInviteId()).setScale(2,BigDecimal.ROUND_DOWN);
        apiLeaderProfitVo.setWaitProfit(waitProfit);
        BigDecimal totalProfit = mallMoneyFlowMapper.selectAmountByFlowtypeAndType(loginUser.getId(),FlowTypeEnum.BALANCE.getValue(),MoneyFlowTypeEnum.LEADERACHIEVE.getValue(),null);
        apiLeaderProfitVo.setTotalProfit(totalProfit);
        return new FebsResponse().success().data(apiLeaderProfitVo);
    }