package com.storlead.sales.service.target;

import com.storlead.framework.common.result.Result;
import com.storlead.sales.pojo.dto.target.TargetQuotaSearchDTO;
import com.storlead.sales.pojo.dto.target.TargetRankingDTO;
import com.storlead.sales.pojo.entity.target.TargetQuotaEntity;
import com.storlead.framework.mybatis.service.MyBaseService;

import java.util.List;

import java.util.Map;

/**
 * <p>
 * 目标配额表 服务类
 * </p>
 *
 * @author YPZ
 * @since 2024-12-11
 */
public interface TargetQuotaService extends MyBaseService<TargetQuotaEntity> {

    //成交金额业绩排行
    Map<String, Object> getTargetOrder(TargetRankingDTO targetRankingDTO);

    // 成交订单数业绩排行
    Map<String, Object> getTargetOrderCount(TargetRankingDTO targetRankingDTO);

    // 新增客户业绩排行
    Map<String, Object> getTargetCustomer(TargetRankingDTO targetRankingDTO);

    // 新增商机业绩排行
    Map<String, Object> getBusinessCount(TargetRankingDTO targetRankingDTO);

    // 跟进次数业绩排行
    Map<String, Object> getFollowUpCount(TargetRankingDTO targetRankingDTO);

    // 新增线索业绩排行
    Map<String, Object> getNewClue(TargetRankingDTO targetRankingDTO);

    // 总体业绩排行
    Map<String, Object> getOverallRanking(TargetRankingDTO targetRankingDTO);



    /***
      * @Description: 根据id计算所有子级的目标值并更新
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/12/20 11:02
      */
    void updateQuarterById(Long id);
    /***
      * @Description: 根据targetPlanId及组织机构信息查询对应userIdList集合
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/12/25 11:18
      */
    List<Long> getByTargetPlanId(Long targetPlanId, Integer organizationalType, String organizationIds);
    /***
      * @Description: 根据targetPlanIdList及组织机构信息查询对应userIdList集合
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/12/25 14:43
      */
    List<Long> getByTargetPlanIdList(List<Long> targetPlanId, Integer organizationalType, String organizationIds);

    Result<?> selectListVO(TargetQuotaSearchDTO targetQuotaSearchDTO);

    Result<?> getTargetQuotaVOById(Long id);
}
