package com.ruoyi.project.business.service;

import com.github.pagehelper.PageInfo;
import com.ruoyi.common.importExcel.excel.helper.BasicTableInfoHelper;
import com.ruoyi.common.importExcel.excel.tempInfo.ProjectFromInfo;
import com.ruoyi.common.importExcel.utils.ExcelUtils.UploadResult;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.project.business.domain.TcProject;
import com.ruoyi.project.business.domain.TcProjectForRelated;
import com.ruoyi.project.business.domain.vo.board.*;
import com.ruoyi.project.business.domain.vo.project.ProjectExportVO;
import com.ruoyi.project.business.domain.vo.selectParam.ProjectParam;
import java.util.List;
import org.springframework.data.util.Pair;

/**
 * 项目Service接口
 *
 * @author ruoyi
 * @date 2024-04-10
 */
public interface ITcProjectService extends IService<TcProject> {

    /**
     * 查询项目
     *
     * @param projectId 项目主键
     * @return 项目
     */
    public TcProject selectTcProjectByProjectId(Long projectId);

    /**
     * 查询关联项目
     *
     * @return 项目集合
     */
    public List<TcProjectForRelated> selectProjectListByLoginId();

    public List<TcProjectForRelated> selectProjectListByProjectId(TcProject tcProject);

    public List<TcProjectForRelated> selectProjectListByQuery(TcProject tcProject);

    /**
     * 查询需要提醒的项目
     *
     * @param cycle 项目跟踪周期
     * @return 项目集合
     */
    public List<TcProject> selectProjectListByCycle(Long cycle);

    /**
     * 查询项目列表
     *
     * @param tcProject 项目
     * @return 项目集合
     */
    public PageInfo<TcProject> selectTcProjectList(ProjectParam tcProject);
    public PageInfo<TcProject> selectTcProjectListNew(ProjectParam tcProject);

    public List<ProjectExportVO> selectTcProjectListExport(ProjectParam tcProject);



    /**
     * 新增项目
     *
     * @param tcProject 项目
     * @return 结果
     */
    public int insertTcProject(TcProject tcProject, Boolean needCheck);

    /**
     * 修改项目
     *
     * @param tcProject 项目
     * @return 结果
     */
    public int updateTcProject(TcProject tcProject);

    /**
     * 批量删除项目
     *
     * @param projectIds 需要删除的项目主键集合
     * @return 结果
     */
    public int deleteTcProjectByProjectIds(Long[] projectIds);

    /**
     * 删除项目信息
     *
     * @param projectId 项目主键
     * @return 结果
     */
    public int deleteTcProjectByProjectId(Long projectId);

    /**
     * 查询客户关联项目
     *
     * @param tcProject 项目
     * @return 结果
     */
    List<TcProjectForRelated> selectProjectListByAccount(TcProject tcProject);

    /**
     * 设为标杆项目
     *
     * @param tcProject 项目
     * @return 结果
     */
    int setModel(TcProject tcProject);

    /**
     * 延期/丢单
     *
     * @param tcProject 项目
     * @return 结果
     */
    int delayLost(TcProject tcProject);

    /**
     * 审批
     *
     * @param tcProject 项目
     * @return 结果
     */
    int approve(TcProject tcProject);

    List<TcProject> getUnFollowedList(String unfollowedMode);

    int changeOwner(TcProject tcProject);

    List<TcProject> selectTcProjectListApp();

    Integer existProjectByAgentIds(Long[] agentIds);

    List<TcProject> listAllProject(ProjectParam tcProject);

    List<Pair<Long, String>> selectAreasByCurUser();

    List<Pair<Long, String>> selectCountriesByCurUser();

    List<String> getProjectName(Long ownerAgent);

    UploadResult<ProjectFromInfo> checkProjectFormInfoImport(BasicTableInfoHelper tableInfo,
        List<ProjectFromInfo> list);

    // 插入新项目
    List<String> insertProjectImportExcel(BasicTableInfoHelper basicTableInfoHelper,
        List<ProjectFromInfo> transform);

    List<TcProject> selectProjectListJDRQ();

    List<AgentProjectStatisticsVo> getAgentProjectStatisticsList(AgentProjectStatistics agentProjectStatistics);

    List<AgentCompleteOrderVo> getAgentCompleteOrderList(AgentCompleteOrder agentCompleteOrder);
    List<AccountCompleteOrderVo> getAccountCompleteOrderList(AgentCompleteOrder agentCompleteOrder);

    List<AgentTargetProgressVo> getAgentTargetProgressList(AgentCompleteOrder agentCompleteOrder);
}
