package com.hzs.member.achieve.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.member.achieve.CuMemberAchieve;
import com.hzs.common.domain.member.achieve.ext.CuMemberAchieveExt;
import com.hzs.common.domain.sale.order.SaOrder;
import com.hzs.member.achieve.controller.vo.*;
import com.hzs.member.achieve.param.MemberAchieveDisParam;
import com.hzs.member.achieve.param.MemberAchieveParam;
import com.hzs.member.achieve.param.MonthAchieveParam;
import com.hzs.member.achieve.vo.*;
import com.hzs.member.settlecenter.param.PlacementDataParam;
import com.hzs.member.settlecenter.vo.PlacementDataVO;
import com.hzs.member.settlecenter.vo.PlacementImageDataVO;
import com.hzs.member.settlecenter.vo.RecommendImageDataVO;
import com.hzs.member.settlecenter.vo.RecommendTeamImagVO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 会员业绩记录 服务类
 * </p>
 *
 * @author hzs
 * @since 2022-10-26
 */
public interface ICuMemberAchieveService extends IService<CuMemberAchieve> {

    /**
     * 查询会员最新业绩
     *
     * @param pkMember  会员主键
     * @param pkCountry 公司
     * @return: CuMemberAchieve
     * @Author: sui q
     * @Date: 2022/10/26 15:04
     */
    CuMemberAchieve queryCuMemberAchieveByPkMember(Long pkMember, Integer pkCountry);

    /*
     * description: 业绩分布-安置图
     * @author: sui q
     * @date: 2023/4/6 18:01
     * @param: null null
     **/
    CuMemberDisVO queryCuMemberAchieveDis(MemberAchieveDisParam memberAchieveDisParam);

    /*
     * @description: 点击架构树显示会员的业绩情况
     * @author: sui q
     * @date: 2023/5/10 16:04
     * @param: null null
     **/
    CuMemberDisVO queryCuMemberDis(MemberAchieveDisParam memberAchieveDisParam);

    /*
     * description: 查询会员伞下血缘业绩
     * @author: sui q
     * @date: 2023/4/7 15:13
     * @param: null null
     **/
    BigDecimal queryCuMemberUnderBloodAchieveByPkMember(MemberAchieveDisParam memberAchieveDisParam);

    /**
     * 会员端新增业绩
     *
     * @param cuMemberNewAddAchieveVO 端新增业绩
     * @return List<CuMemberNewAddAchieveVO>
     */
    List<CuMemberNewAddAchieveVO> selectNewAddAchieve(CuMemberNewAddAchieveVO cuMemberNewAddAchieveVO);


    /**
     * 会员端首页荣誉奖衔
     *
     * @param pkMember  用户ID
     * @param pkCountry 国家ID
     * @return
     */
    CuMemberAwardsDisVO selectAwardsByPkMember(Long pkMember, Integer pkCountry);

    /**
     * 根据安置位置查询前五荣誉奖衔
     *
     * @param pkMember  用户ID
     * @param pkCountry 国家ID
     * @param placeDept 安置部门
     * @return
     */
    List<CuMemberAwardsUnderVO> selectAwardsFiveByPkMember(Long pkMember, Integer pkCountry, Integer placeDept);

    /**
     * 查询个人的奖衔信息
     *
     * @param pkMember  用户ID
     * @param pkCountry 国家ID
     * @return CuMemberAwardsUnderVO
     */
    CuMemberAwardsUnderVO selectMemberAwards(Long pkMember, Integer pkCountry);

    /**
     * 月度新增业绩对比
     *
     * @param pkMember  用户ID
     * @param pkCountry 国家ID
     * @param month     月份
     * @return CuMemberMonthAchieveContrastVO
     */
    List<CuMemberMonthAchieveContrastVO> selectNewAddAchieveContrast(Long pkMember, Integer pkCountry, Integer month);

    LocalDate getStartDateByType(Integer dayType, LocalDate localDate);

    /**
     * @description: 业绩分布-新增业绩统计
     * @author: zhang jing
     * @date: 2023/5/19 10:29
     * @param: []
     * @return: com.hzs.member.achieve.controller.vo.PlaceNewAddAchieveVO
     **/
    PlaceNewAddAchieveVO placeNewAddAchieveStat(PlaceNewAddAchieveVO pna);

    /**
     * @description: 月度业绩-详情
     * @author: zhang jing
     * @date: 2023/9/28 11:38
     * @param: [pna]
     * @return: java.util.List<com.hzs.member.achieve.controller.vo.PlaceNewAddAchieveVO>
     **/
    List<PlaceNewAddAchieveVO> placeNewAddAchieveDetails(PlaceNewAddAchieveVO pna);


    /**
     * @description: 业绩分布-直推业绩（右图）
     * @author: zhang jing
     * @date: 2023/5/20 16:22
     * @param: [pa]
     * @return: com.hzs.member.achieve.controller.vo.ParentAchieveVO
     **/
    ParentAchieveVO parentAchieveRight(ParentAchieveVO pa);

    /**
     * @description: 业绩分布-直推业绩（左图）
     * @author: zhang jing
     * @date: 2023/5/23 19:49
     * @param: [pa]
     * @return: java.util.List<com.hzs.member.achieve.controller.vo.ParentAchieveVO>
     **/
    List<ParentAchieveVO> parentAchieveLeft(ParentAchieveVO pa);

    /**
     * 查询安置数据
     *
     * @param param 入参
     * @return List<PlacementDataVO>
     */
    List<PlacementDataVO> selectPlacementDataList(PlacementDataParam param);


    /**
     * 查询推荐数据
     *
     * @param param 入参
     * @return List<PlacementDataVO>
     */
    List<PlacementDataVO> selectRecommendDataList(PlacementDataParam param);

    /**
     * 查询会员真实业绩
     *
     * @param pkMember
     * @param pkCountry
     * @param month
     * @return
     */
    RealPerformanceVo queryRealPerformance(Long pkMember, Integer pkCountry, Integer month);


    /**
     * 会员真实业绩饼状图
     *
     * @param pkMember
     * @param pkCountry
     * @param month
     * @return
     */
    AzAchievementPie queryRealPerformancePic(Long pkMember, Integer pkCountry, Integer month);

    /**
     * 查询安置图表
     *
     * @param param 入参
     * @return PlacementImageDataVO
     */
    PlacementImageDataVO selectPlaceImage(PlacementDataParam param);


    /**
     * 查询推荐体第图表
     *
     * @param param 入参
     * @return RecommendImageDataVO
     */
    List<RecommendImageDataVO> selectRecommendVertexImage(PlacementDataParam param);


    /**
     * 查询推荐团队图表
     *
     * @param param 入参
     * @return RecommendImageDataVO
     */
    List<RecommendTeamImagVO> selectRecommendTeamImage(PlacementDataParam param);

    /*
     * @description: 查询月统计数据，按照月倒叙
     * @author: sui q
     * @date: 2023/8/29 16:10
     * @param: null null
     **/
    List<CuMemberAchieveExt> queryMemberMonthAchieve(Long pkMember, String month);

    /*
     * @description: 查询月统计数据，查询明细，安置伞下
     * @author: sui q
     * @date: 2023/9/6 21:12
     * @param: null null
     **/
    List<CuMemberAchieveExt> queryPlaceParentMemberMonthAchieve(MonthAchieveParam monthAchieveParam);

    /*
     * @description: 查询月统计数据，查询明细，安置伞下
     * @author: sui q
     * @date: 2023/9/6 21:12
     * @param: null null
     **/
    List<CuMemberAchieveExt> queryParentMemberMonthAchieve(MonthAchieveParam monthAchieveParam);

    /**
     * @description: 安置数据查询
     * @author: zhang jing
     * @date: 2023/5/19 10:29
     * @param: []
     * @return: com.hzs.member.achieve.controller.vo.PlaceNewAddAchieveVO
     **/
    List<PlaceFrameQueryVO> placeFrameQuery(PlaceFrameQueryVO pfq);

    /**
     * @description:
     * @author: zhang jing
     * @date: 2024/7/24 10:02
     * @param: [pfq]
     * @return: java.util.List<com.hzs.member.achieve.controller.vo.PlaceFrameQueryVO>
     **/
    List<PlaceFrameQueryVO> placeBefFrameQuery(PlaceFrameQueryVO pfq);

    /**
     * @description: 推荐数据查询
     * @author: zhang jing
     * @date: 2024/7/17 9:28
     * @param: [pfq]
     * @return: java.util.List<com.hzs.member.achieve.controller.vo.PlaceFrameQueryVO>
     **/
    List<PlaceFrameQueryVO> parentFrameQuery(PlaceFrameQueryVO pfq);

    /**
     * @description: 查询本期推荐伞下业绩和新增人数
     * @author: zhang jing
     * @date: 2024/7/24 10:47
     * @param: [pfq]
     * @return: java.util.List<com.hzs.member.achieve.controller.vo.PlaceFrameQueryVO>
     **/
    List<PlaceFrameQueryVO> parentBefFrameQuery(PlaceFrameQueryVO pfq);

    /**
     * @description: 查询会员安置伞下第一层会员
     * @author: zhang jing
     * @date: 2024/7/17 9:29
     * @param: [pfq]
     * @return: java.util.List<com.hzs.member.achieve.controller.vo.PlaceFrameQueryVO>
     **/
    List<PlaceFrameQueryVO> placeMemberQuery(PlaceFrameQueryVO pfq);
    /**
     * @description: 查询本期安置网体会员
     * @author: zhang jing
     * @date: 2024/7/24 9:31
     * @param: [pfq]
     * @return: java.util.List<com.hzs.member.achieve.controller.vo.PlaceFrameQueryVO>
     **/
    List<PlaceFrameQueryVO> placeBefMemberQuery(PlaceFrameQueryVO pfq);
    /**
     * @description: 查询会员推荐伞下第一层会员
     * @author: zhang jing
     * @date: 2024/7/17 9:29
     * @param: [pfq]
     * @return: java.util.List<com.hzs.member.achieve.controller.vo.PlaceFrameQueryVO>
     **/
    List<PlaceFrameQueryVO> parentMemberQuery(PlaceFrameQueryVO pfq);

    /**
     * @description: 查询本期推荐伞下第一层会员
     * @author: zhang jing
     * @date: 2024/7/24 9:33
     * @param: [pfq]
     * @return: java.util.List<com.hzs.member.achieve.controller.vo.PlaceFrameQueryVO>
     **/
    List<PlaceFrameQueryVO> parentBefMemberQuery(PlaceFrameQueryVO pfq);

    /**
     * @description: 校验会员是否在某会员安置伞下
     * @author: zhang jing
     * @date: 2024/7/22 14:23
     * @param: [pfq]
     * @return: com.hzs.member.achieve.controller.vo.PlaceFrameQueryVO
     **/
    PlaceFrameQueryVO checkPlaceMemberQuery(PlaceFrameQueryVO pfq);
    /**
     * @description: 校验会员是否在某会员推荐线
     * @author: zhang jing
     * @date: 2024/7/22 14:23
     * @param: [pfq]
     * @return: com.hzs.member.achieve.controller.vo.PlaceFrameQueryVO
     **/
    PlaceFrameQueryVO checkParentMemberQuery(PlaceFrameQueryVO pfq);


}
