package com.hzs.member.statis.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.constant.CountryConstants;
import com.hzs.common.core.enums.EBonusItems;
import com.hzs.common.core.enums.EDelFlag;
import com.hzs.common.core.enums.EOrderStatus;
import com.hzs.common.core.enums.EOrderType;
import com.hzs.common.domain.member.statis.CuBonusStatis;
import com.hzs.member.achieve.service.ICuMemberSettlePeriodService;
import com.hzs.member.statis.mapper.CuBonusStatisMapper;
import com.hzs.member.statis.service.ICuBonusStatisService;
import com.hzs.member.statis.vo.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;

/**
 * 奖金拨比统计 服务实现类
 */
@Service
@Slf4j
public class CuBonusStatisServiceImpl extends ServiceImpl<CuBonusStatisMapper, CuBonusStatis> implements ICuBonusStatisService {

    @Autowired
    ICuMemberSettlePeriodService cuMemberSettlePeriodService;

    /**
     * 保存奖金拨比订单数据
     **/
    private void saveBonusStatis(List<CuBonusStatisVO> soList) {
        for (CuBonusStatisVO so : soList) {
            if (so.getPkCountry() == null) {
                continue;
            }
            CuBonusStatis bs = new CuBonusStatis();
            bs.setPkBdVertex(so.getPkVertex());
            bs.setCreationTime(so.getCreationTime());
            bs.setPkCountry(so.getPkCountry());
            bs.setPkTeamCode(so.getPkTeamCode());
            bs.setMainRegAmount(so.getMainRegAmount());
            bs.setMainUpAmount(so.getMainUpAmount());
            bs.setSpecialRegisterAmount(so.getSpecialRegisterAmount());
            bs.setSpecialUpgradeAmount(so.getSpecialUpgradeAmount());
            bs.setMainRepurAmount(so.getMainRepurAmount());
            bs.setMallAmount(so.getMallAmount());
            bs.setCooperateAmount(so.getCooperateAmount());
            bs.setSpecialRepurchaseAmount(so.getSpecialRepurchaseAmount());
            bs.setFictitiousAmount(so.getFictitiousAmount());
            bs.setWelfareOrder(so.getWelfareOrder());

            /**
             * 注册新增PV
             */
            bs.setMainRegPv(so.getMainRegPv());
            /**
             * 升级新增PV
             */
            bs.setMainUpPv(so.getMainUpPv());
            /**
             *复购新增PV
             */
            bs.setMainRepurPv(so.getMainRepurPv());
            /**
             *特殊注册PV
             */
            bs.setSpecialRegisterPv(so.getSpecialRegisterPv());
            /**
             *特殊升级PV
             */
            bs.setSpecialUpgradePv(so.getSpecialUpgradePv());
            /**
             *特殊复购PV
             */
            bs.setSpecialRepurchasePv(so.getSpecialRepurchasePv());
            /**
             *虚拟订单PV
             */
            bs.setFictitiousPv(so.getFictitiousPv());
            /**
             *直播订单PV
             */
            bs.setMallPv(so.getMallPv());
            /**
             *合作订单PV
             */
            bs.setCooperatePv(so.getCooperatePv());
            /**
             *福利专区PV
             */
            bs.setWelfareOrderPv(so.getWelfareOrderPv());
            // 查询数据库判断记录是否存在
            List<CuBonusStatis> existingRecord = getCuBonusStatis(bs);
            if (CollectionUtil.isEmpty(existingRecord)) {
                baseMapper.insert(bs); // 不存在则插入新记录
            } else {
                bs.setPkId(existingRecord.get(0).getPkId()); // 设置主键ID
                baseMapper.updateById(bs); // 存在则更新记录
            }
        }

    }

    /**
     * 累加订单金额
     **/
    private CuBonusStatisVO addOrderAmount(CuBonusStatisVO oldSo, Integer pkCountry, Integer pkVertex, List<CuBonusStatisVO> orachList, int type) {
        for (CuBonusStatisVO newSo : orachList) {
            // 修改统计数据
            if ((pkCountry == null && pkVertex != null && pkVertex.equals(newSo.getPkVertex())) ||
                    (pkCountry != null && pkVertex == null && pkCountry.equals(newSo.getPkCountry()))) {
                oldSo.setPkCountry(newSo.getPkCountry());
                oldSo.setCreationTime(newSo.getCreationTime());
                if (newSo.getPkVertex() != null) {
                    oldSo.setPkVertex(newSo.getPkVertex());
                }
                if (newSo.getPkTeamCode() != null) {
                    oldSo.setPkTeamCode(newSo.getPkTeamCode());
                }
                switch (EOrderType.getEnumByValue(newSo.getOrderType())) {
                    // 首购
                    case RETAIL_REGISTER:
                        oldSo.setMainRegAmount(addOrInitializeAmount(oldSo.getMainRegAmount(), newSo.getOrderAmount(), type));
                        oldSo.setMainRegPv(addOrInitializeAmount(oldSo.getMainRegPv(), newSo.getOrderAchieve(), type));
                        break;
                    case RETAIL_UPGRADE:
                        oldSo.setMainUpAmount(addOrInitializeAmount(oldSo.getMainUpAmount(), newSo.getOrderAmount(), type));
                        oldSo.setMainUpPv(addOrInitializeAmount(oldSo.getMainUpPv(), newSo.getOrderAchieve(), type));
                        break;
                    // 复购 43
                    case RETAIL_REPURCHASE:
                        oldSo.setMainRepurAmount(addOrInitializeAmount(oldSo.getMainRepurAmount(), newSo.getOrderAmount(), type));
                        oldSo.setMainRepurPv(addOrInitializeAmount(oldSo.getMainRepurPv(), newSo.getOrderAchieve(), type));
                        break;
                    default:
                        break;
                }
            }
        }
        return oldSo;
    }


    //累计中国奖金
    private CuBonusStatisVO addChAchieve(CuBonusStatisVO oldBon, CuBonusStatisVO newBon) {
        oldBon.setPkCountry(newBon.getPkCountry());
        oldBon.setCreationTime(newBon.getCreationTime());
        oldBon.setPkVertex(newBon.getPkVertex());
        oldBon.setPkTeamCode(newBon.getPkTeamCode());

        switch (EBonusItems.getEnumByValue(newBon.getBonusType())) {
            // 首购 3,4,5,7
            case DIRECT_INCOME:
                oldBon.setIntroduceBonus(addOrInitializeAmount(oldBon.getIntroduceBonus(), newBon.getRealIncome(), 2));
                break;
            case EXPANSION_INCOME:
                oldBon.setOrgBonus(addOrInitializeAmount(oldBon.getOrgBonus(), newBon.getRealIncome(), 2));
                break;
            case COACHING_INCOME:
                oldBon.setLeaderBonus(addOrInitializeAmount(oldBon.getLeaderBonus(), newBon.getRealIncome(), 2));
                break;
            case SERVICE_SUBSIDIES:
                oldBon.setServiceBonus(addOrInitializeAmount(oldBon.getServiceBonus(), newBon.getRealIncome(), 2));
                break;
            //复购 8,9,12,24,20,21,1
            case REPURCHASE_RANGE_INCOME:
                oldBon.setRepurRangeBonus(addOrInitializeAmount(oldBon.getRepurRangeBonus(), newBon.getRealIncome(), 2));
                break;
            case CONSUMPTION_EXPANSION_INCOME:
                oldBon.setRepurOrgBonus(addOrInitializeAmount(oldBon.getRepurOrgBonus(), newBon.getRealIncome(), 2));
                break;
            case REPURCHASE_COUPONS:
                oldBon.setRepurCouponSubtotal(addOrInitializeAmount(oldBon.getRepurCouponSubtotal(), newBon.getRealIncome(), 2));
                break;
        }
        return oldBon;
    }

    /**
     * 累计国外奖金
     **/
    private CuBonusStatisVO addFcAchieve(CuBonusStatisVO oldBon, CuBonusStatisVO newBon) {
        oldBon.setPkCountry(newBon.getPkCountry());
        oldBon.setCreationTime(newBon.getCreationTime());

        switch (EBonusItems.getEnumByValue(newBon.getBonusType())) {
            // 首购
            case DIRECT_INCOME:
                oldBon.setIntroduceBonus(addOrInitializeAmount(oldBon.getIntroduceBonus(), newBon.getRealIncome(), 2));
                break;
            case EXPANSION_INCOME:
                oldBon.setOrgBonus(addOrInitializeAmount(oldBon.getOrgBonus(), newBon.getRealIncome(), 2));
                break;
            case COACHING_INCOME:
                oldBon.setLeaderBonus(addOrInitializeAmount(oldBon.getLeaderBonus(), newBon.getRealIncome(), 2));
                break;
            case SERVICE_SUBSIDIES:
                oldBon.setServiceBonus(addOrInitializeAmount(oldBon.getServiceBonus(), newBon.getRealIncome(), 2));
                break;
            //复购
            case REPURCHASE_RANGE_INCOME:
                oldBon.setRepurRangeBonus(addOrInitializeAmount(oldBon.getRepurRangeBonus(), newBon.getRealIncome(), 2));
                break;
            case CONSUMPTION_EXPANSION_INCOME:
                oldBon.setRepurOrgBonus(addOrInitializeAmount(oldBon.getRepurOrgBonus(), newBon.getRealIncome(), 2));
                break;
        }
        return oldBon;
    }

    /**
     * 保存国内奖金拨比奖金数据
     **/
    private void saveBonusStatisAchieve(List<CuBonusStatisVO> cblist) {
        for (CuBonusStatisVO cb : cblist) {
            if (cb.getPkCountry() == null) {
                continue;
            }
            //查询体系是否添加
            CuBonusStatis bs = new CuBonusStatis();
            bs.setPkBdVertex(cb.getPkVertex());
            bs.setPkTeamCode(cb.getPkTeamCode());
            bs.setCreationTime(cb.getCreationTime());
            bs.setPeriod(cb.getPeriod());
            bs.setPkCountry(cb.getPkCountry());
            bs.setIntroduceBonus(cb.getIntroduceBonus());
            bs.setOrgBonus(cb.getOrgBonus());
            bs.setLeaderBonus(cb.getLeaderBonus());
            bs.setShareBonus(cb.getShareBonus());
            bs.setServiceBonus(cb.getServiceBonus());
            bs.setRepurRangeBonus(cb.getRepurRangeBonus());
            bs.setRepurOrgBonus(cb.getRepurOrgBonus());
            bs.setRepurCouponSubtotal(cb.getRepurCouponSubtotal());
            bs.setRepurPushIncome(cb.getRepurPushIncome());

            // 查询数据库判断记录是否存在
            List<CuBonusStatis> existingRecord = getCuBonusStatis(bs);
            if (CollectionUtil.isEmpty(existingRecord)) {
                baseMapper.insert(bs); // 不存在则插入新记录
            } else {
                bs.setPkId(existingRecord.get(0).getPkId()); // 设置主键ID
                baseMapper.updateById(bs); // 存在则更新记录
            }
        }
    }

    /**
     * 保存国外奖金拨比奖金数据
     **/
    private void saveForeignCountryBonus(List<CuBonusStatisVO> cblist) {
        for (CuBonusStatisVO cb : cblist) {
            if (cb.getPkCountry() == null) {
                continue;
            }
            //查询体系是否添加
            CuBonusStatis bs = new CuBonusStatis();
            bs.setCreationTime(cb.getCreationTime());
            bs.setPkCountry(cb.getPkCountry());
            bs.setIntroduceBonus(cb.getIntroduceBonus());
            bs.setOrgBonus(cb.getOrgBonus());
            bs.setLeaderBonus(cb.getLeaderBonus());
            bs.setShareBonus(cb.getShareBonus());
            bs.setServiceBonus(cb.getServiceBonus());
            bs.setRepurRangeBonus(cb.getRepurRangeBonus());
            bs.setRepurOrgBonus(cb.getRepurOrgBonus());
            bs.setRepurPushIncome(cb.getRepurPushIncome());
            // 查询数据库判断记录是否存在
            List<CuBonusStatis> existingRecord = getCuBonusStatis(bs);
            if (CollectionUtil.isEmpty(existingRecord)) {
                baseMapper.insert(bs); // 不存在则插入新记录
            } else {
                bs.setPkId(existingRecord.get(0).getPkId()); // 设置主键ID
                baseMapper.updateById(bs); // 存在则更新记录
            }
        }
    }

    // 获取或初始化金额
    private BigDecimal addOrInitializeAmount(BigDecimal currentAmount, BigDecimal newAmount, int type) {
        if (type == 1) {
            if (currentAmount != null) {
                return currentAmount.subtract(newAmount);
            } else {
                return newAmount;
            }
        } else {
            if (currentAmount != null) {
                return currentAmount.add(newAmount);
            } else {
                return newAmount;
            }
        }
    }

    /**
     * 奖金拨比列表
     **/
    @Override
    public List<CuBonusStatisVO> queryCuBonusStatis(CuBonusStatisVO cuBonusStatisVO) {
        return baseMapper.queryCuBonusStatis(cuBonusStatisVO);
    }

    /**
     * 查询国外奖金拨比
     **/
    @Override
    public List<CuBonusStatisVO> queryForeignCountryCuBonusStatis(CuBonusStatisVO cuBonusStatisVO) {
        return baseMapper.queryForeignCountryCuBonusStatis(cuBonusStatisVO);
    }

    /**
     * 查询体系合计的订单业绩
     **/
    @Override
    public CuBonusStatisVO queryOrderAchieveSum(CuBonusStatisVO cuBonusStatisVO) {
        return baseMapper.queryOrderAchieveSum(cuBonusStatisVO);
    }

    /**
     * 奖金拨比列表统计小计（最后一行）
     **/
    @Override
    public CuBonusStatisVO queryCuBonusSumStatis(CuBonusStatisVO cuBonusStatisVO) {
        return baseMapper.queryCuBonusSumStatis(cuBonusStatisVO);
    }

    /**
     * 查询个人奖金拨比
     **/
    @Override
    public CuBonusSinglePersonStatisVO bonusSingleSum(CuBonusSinglePersonStatisVO csps) {
        return baseMapper.bonusSingleSum(csps);
    }

    /**
     * 奖金拨比图表
     **/
    @Override
    public List<CuBonusStatisChartVO> queryCuBonusStatisChart(CuBonusStatisChartVO chartVO) {
        return baseMapper.queryCuBonusStatisChart(chartVO);
    }

    /**
     * 奖金拨比图表合计
     **/
    @Override
    public CuBonusStatisChartVO queryCuBonusSumStatisChart(CuBonusStatisChartVO chartVO) {
        return baseMapper.queryCuBonusSumStatisChart(chartVO);
    }

    /**
     * 查询奖金拨比图形数据-柱形图
     **/
    @Override
    public CuBonusStatisColumnarVO pillarRatio(CuBonusStatisColumnarVO columnarVO) {
        // 查询当年的数据
        CuBonusStatisColumnarVO thisYear = queryYearData(columnarVO);
        // 查询去年的数据
        LocalDate startDate = LocalDate.parse(columnarVO.getStartDate());
        LocalDate lastYearDate = startDate.minusYears(1);
        String startDateStr = lastYearDate.toString();
        columnarVO.setStartDate(startDateStr);

        LocalDate endDate = LocalDate.parse(columnarVO.getEndDate());
        lastYearDate = endDate.minusYears(1);
        String endDateStr = lastYearDate.toString();
        columnarVO.setEndDate(endDateStr);
        CuBonusStatisColumnarVO lastYear = queryYearData(columnarVO);

        // 设置去年数据的属性，如果查询结果为空，则设置为 BigDecimal.ZERO
        if (thisYear != null) {
            thisYear.setLastHifansRegAmount(lastYear != null ? lastYear.getHifansRegAmount() : BigDecimal.ZERO);
            thisYear.setLastMainRegAmount(lastYear != null ? lastYear.getMainRegAmount() : BigDecimal.ZERO);
            thisYear.setLastMainRepurAmount(lastYear != null ? lastYear.getMainRepurAmount() : BigDecimal.ZERO);
            thisYear.setLastMainUpAmount(lastYear != null ? lastYear.getMainUpAmount() : BigDecimal.ZERO);
        }
        return thisYear;
    }

    /**
     * 查询一年注册、升级、复购、嗨粉合计
     **/
    @Override
    public CuBonusStatisColumnarVO queryYearData(CuBonusStatisColumnarVO columnarVO) {
        Optional<CuBonusStatisColumnarVO> opt = Optional.ofNullable(baseMapper.queryYearData(columnarVO));
        return opt.orElse(null);
    }

    /**
     * 查询奖金拨比(饼状图)
     **/
    @Override
    public CuBonusStatisRoundVO queryDiallingRatio(CuBonusStatisRoundVO roundVO) {
        return baseMapper.queryDiallingRatio(roundVO);
    }

    /**
     * 查询当天团队统计数据
     **/
    public List<CuBonusStatis> getCuBonusStatis(CuBonusStatis cuBonusStatis) {
        return baseMapper.getCuBonusStatis(cuBonusStatis);
    }

    /**
     * 统计历史奖金拨比数据
     **/
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean statisHistoryBonus(String startDate, String endDate) {
        //查询新增订单
        CuBonusStatisVO cbs = new CuBonusStatisVO();
        //累加好的数据存入soAll
        List<CuBonusStatisVO> soAll = new ArrayList<>();
        cbs.setDelFlag(EDelFlag.UN_DELETE.getValue());
        cbs.setOrderStatus(EOrderStatus.PAY.getValue());
        cbs.setStartDate(startDate);
        cbs.setEndDate(endDate);
        cbs.setPkCountry(CountryConstants.CHINA_COUNTRY);
//        //先查中国订单
        List<CuBonusStatisVO> orachList = baseMapper.querySaOrderByLessDay(cbs);
        Map<Date, List<CuBonusStatisVO>> orachListMap = orachList.stream()
                .collect(Collectors.groupingBy(CuBonusStatisVO::getCreationTime));
        //查询所有体系
        List<CuBonusStatisVO> vertexlist = vertexList();
        if (CollectionUtil.isNotEmpty(orachList)) {
            if (CollectionUtil.isNotEmpty(vertexlist)) {
                for (Map.Entry<Date, List<CuBonusStatisVO>> entry : orachListMap.entrySet()) {
                    for (CuBonusStatisVO ve : entry.getValue()) {
                        CuBonusStatisVO oldSo = new CuBonusStatisVO();
                        oldSo = addOrderAmount(oldSo, null, ve.getPkVertex(), entry.getValue(), 2);
                        if (oldSo.getPkCountry() != null) {
                            soAll.add(oldSo);
                        }
                    }
                }
            }
        }
//        Map<Date, List<CuBonusStatisVO>> soAllMap = soAll.stream()
//                .collect(Collectors.groupingBy(CuBonusStatisVO::getCreationTime));
        //累加好的数据存入acAll
        List<CuBonusStatisVO> acAll = new ArrayList<>();
        //查询中国统计奖金
//        List<CuMemberBonus> listCn = cuMemberBonusService.queryMemberBonusByPeriod(null, startDate, endDate, CountryConstants.CHINA_COUNTRY);
        List<CuBonusStatisVO> listCn = queryChinaCountryBonus(cbs);
        Map<Date, List<CuBonusStatisVO>> listCnMap = listCn.stream()
                .collect(Collectors.groupingBy(CuBonusStatisVO::getCreationTime));
        if (CollectionUtil.isNotEmpty(listCn)) {
            if (CollectionUtil.isNotEmpty(vertexlist)) {
                for (CuBonusStatisVO ve : vertexlist) {
                    for (Map.Entry<Date, List<CuBonusStatisVO>> entry : listCnMap.entrySet()) {
                        CuBonusStatisVO oldSo = new CuBonusStatisVO();
                        for (CuBonusStatisVO cb : entry.getValue()) {
                            if (ve.getPkVertex().equals(cb.getPkVertex())) {
                                oldSo = addChAchieve(oldSo, cb);
                                if (oldSo.getPkCountry() != null) {
                                    acAll.add(oldSo);
                                }
                            }
                        }

                    }
                }
            }
        }

        //查询国外国家列表 查询国外统计奖金
        //累加好的数据存入fcAll
        List<CuBonusStatisVO> fcAll = new ArrayList<>();
        List<CuBonusStatisVO> countrylist = countrylist(cbs);
        if (CollectionUtil.isNotEmpty(countrylist)) {
            for (CuBonusStatisVO con : countrylist) {
                cbs.setDelFlag(EDelFlag.UN_DELETE.getValue());
                cbs.setOrderStatus(EOrderStatus.PAY.getValue());
                cbs.setStartDate(startDate);
                cbs.setEndDate(endDate);
                cbs.setPkCountry(con.getPkCountry());
                //查询国外订单
                List<CuBonusStatisVO> orach = baseMapper.querySaOrderByLessDay(cbs);
                Map<Date, List<CuBonusStatisVO>> orachMap = orach.stream()
                        .collect(Collectors.groupingBy(CuBonusStatisVO::getCreationTime));
                if (CollectionUtil.isNotEmpty(orach)) {
                    for (Map.Entry<Date, List<CuBonusStatisVO>> entry : orachMap.entrySet()) {
                        CuBonusStatisVO oldSo = new CuBonusStatisVO();
                        oldSo = addOrderAmount(oldSo, con.getPkCountry(), null, entry.getValue(), 2);
                        if (oldSo.getPkCountry() != null) {
                            soAll.add(oldSo);
                        }
                    }
                }

                //查询国外统计奖金
                //累加好的数据存入fcAll
                CuBonusStatisVO cuBonusStatisVO = new CuBonusStatisVO();
                cuBonusStatisVO.setStartDate(startDate);
                cuBonusStatisVO.setEndDate(endDate);
                cuBonusStatisVO.setPkCountry(con.getPkCountry());
                //查询国外奖金
                List<CuBonusStatisVO> bsList = queryForeignCountryBonus(cuBonusStatisVO);
                Map<Date, List<CuBonusStatisVO>> bsListMap = bsList.stream()
                        .collect(Collectors.groupingBy(CuBonusStatisVO::getCreationTime));
                if (CollectionUtil.isNotEmpty(bsList)) {
                    for (Map.Entry<Date, List<CuBonusStatisVO>> entry : bsListMap.entrySet()) {
                        CuBonusStatisVO oldSo1 = new CuBonusStatisVO();
                        for (CuBonusStatisVO cb : entry.getValue()) {
                            if (con.getPkCountry().equals(cb.getPkCountry())) {
                                oldSo1 = addFcAchieve(oldSo1, cb);
                            }
                        }
                        if (oldSo1.getPkCountry() != null) {
                            fcAll.add(oldSo1);
                        }
                    }

                }
            }
        }

        //存入订单信息
        saveBonusStatis(soAll);
        //存入国内奖金信息
        saveBonusStatisAchieve(acAll);
        //存入国外奖金信息
        saveForeignCountryBonus(fcAll);
        return true;
    }

    /**
     * 删除奖金拨比统计表数据
     **/
    @Override
    public Boolean delStatis(String startDate, String endDate) {
        return baseMapper.delStatis(startDate, endDate);
    }

    /**
     * 查询奖金扣项配置参数
     **/
    @Override
    public List<CuBonusStatisVO> bonusDeductlist(CuBonusStatisVO cuBonusStatisVO) {
        return baseMapper.bonusDeductlist(cuBonusStatisVO);
    }


    /**
     * 查询分红比例配置
     **/
    @Override
    public List<CuBonusStatisVO> bonusDividendRatiolist(CuBonusStatisVO cuBonusStatisVO) {
        return baseMapper.bonusDividendRatiolist(cuBonusStatisVO);
    }

    /**
     * 查询国外奖金
     **/
    @Override
    public List<CuBonusStatisVO> queryForeignCountryBonus(CuBonusStatisVO cuBonusStatisVO) {
        return baseMapper.queryForeignCountryBonus(cuBonusStatisVO);
    }

    /**
     * 查询中国奖金
     **/
    @Override
    public List<CuBonusStatisVO> queryChinaCountryBonus(CuBonusStatisVO cuBonusStatisVO) {
        return baseMapper.queryChinaCountryBonus(cuBonusStatisVO);
    }


    /**
     * 查询生效国外国家列表
     **/
    @Override
    public List<CuBonusStatisVO> countrylist(CuBonusStatisVO cuBonusStatisVO) {
        return baseMapper.countrylist(cuBonusStatisVO);
    }

    /**
     * 查询有效体系
     **/
    @Override
    public List<CuBonusStatisVO> vertexList() {
        return baseMapper.vertexList();
    }


}
