package com.storlead.sales.service.customer;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.storlead.framework.auth.vo.LoginUser;
import com.storlead.framework.common.result.Result;
import com.storlead.framework.mybatis.service.MyBaseService;
import com.storlead.sales.pojo.dto.customer.*;
import com.storlead.sales.pojo.entity.customer.BusinessEntity;
import com.storlead.sales.pojo.vo.customer.BusinessAllDetailVO;
import com.storlead.sales.pojo.vo.customer.BusinessDetailVO;
import com.storlead.sales.pojo.vo.customer.BusinessListVO;
import org.springframework.web.bind.annotation.RequestBody;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 商机表 服务类
 * </p>
 *
 * @author YPZ
 * @since 2024-05-10
 */
public interface BusinessService extends MyBaseService<BusinessEntity> {

    /***
      * @Description: 新增/修改商机
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/5/11 15:11
      */
    Result<?> addBusiness(BusinessAddDTO businessAddDTO);

    Result<IPage<BusinessListVO>> selectListVO(BusinessSearchDTO businessSearchDTO);

    IPage<?> selectSimpleListVO(CustomerSearchSearchDTO customerSearchSearchDTO);

    /***
      * @Description: 通过id查询商机详情
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/5/11 16:30
      */
    BusinessDetailVO getBusinessVOById(Long id);

    /***
      * @Description: 通过id查询商机全部概况
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/5/11 16:30
      */
    BusinessAllDetailVO getBusinessAllVOById(Long id);

    /***
     * @Description: 根据商机id获取商机信息
     * @Param:
     * @return:
     * @Author: YPZ
     * @Date: 2024/5/17 11:31
     */
    Map<Long, BusinessEntity> getBusinessMap(List<Long> businessIdList);

    /***
      * @Description: 添加协作人员
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/5/31 17:02
      */
    Result<?> collaborator(CustomerCollaboratorDTO businessCollaboratorDTO);

    /***
      * @Description: 更改商机阶段
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/6/7 15:25
      */
    Result<?> changeStage(BusinessChangeStageDTO businessChangeStage);

    /***
      * @Description: 更改商机流失状态
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/10/17 16:35
      */
    Result<?> businessLoss(BusinessLossDTO businessLossDTO);


    void replaceCollaborator(CustomerTransferDTO customerTransferDTO);
}
