package cn.iocoder.yudao.module.base.service;

import cn.iocoder.yudao.module.base.entity.DlDriveSchoolCoach;
import cn.iocoder.yudao.module.base.vo.*;
import cn.iocoder.yudao.module.base.vo.BusinessRecordExportVO;
import cn.iocoder.yudao.module.course.vo.SchoolCommissionVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 驾校教练 Service 接口
 *
 * @author pqz
 */
public interface DlDriveSchoolCoachService extends IService<DlDriveSchoolCoach> {

    /**
     * 驾校教练、普通员工列表
     *
     * @param pageReqVO {@link DlDriveSchoolCoachPageReqVO}
     * @param page      分页参数
     * @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.base.vo.DlDriveSchoolCoachRespVO>
     * @author PQZ
     * @date 15:02 2025/1/16
     **/
    IPage<DlDriveSchoolCoachRespVO> queryListPage(DlDriveSchoolCoachPageReqVO pageReqVO, Page<DlDriveSchoolCoachRespVO> page);

    /**
     * 不分页查询教练信息
     *
     * @param pageReqVO {@link DlDriveSchoolCoachPageReqVO}
     * @return java.util.List<cn.iocoder.yudao.module.base.entity.DlDriveSchoolCoach>
     * @author PQZ
     * @date 14:26 2025/2/7
     **/
    List<DlDriveSchoolCoach> listSchoolCoach(DlDriveSchoolCoachPageReqVO pageReqVO);
    List<DlDriveSchoolCoach> listSchoolBusiness(DlDriveSchoolCoachPageReqVO pageReqVO);
    List<DlDriveSchoolCoach> listSchoolCoachApp(DlDriveSchoolCoachPageReqVO pageReqVO);
    List<DlDriveSchoolCoach> listSchoolPeople(DlDriveSchoolCoachPageReqVO pageReqVO);

    /**
     * @param staffVO {@link DlDriveSchoolStaffVO}
     * @param page    分页参数
     * @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO>
     * @author PQZ
     * @date 13:51 2025/2/6
     **/
    IPage<DlDriveSchoolStaffVO> pageStaffCoach(DlDriveSchoolStaffVO staffVO, Page<DlDriveSchoolStaffVO> page);

    /**
     * 保存驾校教练
     *
     * @param createReqVO {@link DlDriveSchoolCoachSaveReqVO}
     * @author PQZ @date 2025/1/16
     **/
    void saveSchoolCoach(@Valid DlDriveSchoolCoachSaveReqVO createReqVO);

    String getCoachCarNos(String id);
    void removeCarFromCoach(String coachId, String carNo);
    /**
     * 跟新教练员车辆信息
     *
     * @param id    id
     * @param carNo 车辆
     * @author PQZ
     * @date 15:51 2025/2/7
     **/
    void updateSchoolCoachCarId(String id, String carNo);

    /**
     * 删除驾校教练
     *
     * @param id 教练id
     * @author PQZ
     * @date 21:39 2025/1/16
     **/
    void deleteDlDriveSchoolCoach(String id);

    /**
     * 获得驾校教练
     *
     * @param id 编号
     * @return 驾校教练
     */
    DlDriveSchoolCoachRespVO getDlDriveSchoolCoach(String id);

    /**
     * 获得驾校教练---通过user_id查
     *
     * @param userId 用户表id
     * @return 驾校教练
     */
    DlDriveSchoolCoachRespVO getDlDriveSchoolCoachByUserId(Long userId);

    /**
     * 通过教练id查询教练信息（APP使用）
     * @author PQZ
     * @date 13:49 2025/2/12
     * @param id 教练id
     * @return cn.iocoder.yudao.module.base.vo.CoachInfoVO
    **/
    CoachInfoVO getCoachById(String id);
    CoachInfoVO getCoachByIdAndTime(String id, String timeType, String startTime, String endTime);
    CoachInfoVO getBusinessByIdAndTime(String id, String timeType, String startTime, String endTime);

    /**
     * 根据邀请码查询教练信息
     */
    DlDriveSchoolCoach getCoachByUniqueCode(String uniqueCode);
    CoachStaffSaveVo getOnInternal(Long id);

    /**
     * 编辑驾校员工
     *
     * @param coachStaffSaveVo
     * @return
     */
    boolean edit(CoachStaffSaveVo coachStaffSaveVo);

    /**
     * 根据type查询教练列表
     */
    List<DlDriveSchoolCoach> coachListByType(String  type);

    /**
     * 保存驾校员工
     *
     * @param coachStaffSaveVo
     * @return
     */
    Long saveCoachStaff(CoachStaffSaveVo coachStaffSaveVo);

    /**
     * 添加文件夹
     *
     * @param userId 用户id
     * @return 文件夹id
     */
    Long addFolder(Long userId);

    /**
     * 导入检测员工
     *
     * @param list 检测员工
     * @return
     */
    Map<String, Object> importStaff(List<SchoolStaffImportExcelVO> list);


    /**
     * 获取所有学员信息
     *
     * @param query
     * @return
     */
    List<SchoolStaffImportExcelVO> getAll(SchoolStaffImportExcelVO query);

    IPage<BusinessRecordVO> getBusinessManager(BusinessRecordReqVO reqVO, Page<BusinessRecordReqVO> page);
    List<SchoolCommissionVO> getBusinessManagerMoney(BusinessRecordReqVO reqVO);
    BigDecimal getBusinessManagerMoneyTotal(BusinessRecordReqVO reqVO) ;

    /**
     * 获取导出数据列表
     */
    IPage<BusinessRecordExportVO> getBusinessRecordExportData(BusinessRecordExportVO reqVO, Page<BusinessRecordExportVO> page);
    BusinessRecordExportCountVO getBusinessRecordExportCount(BusinessRecordExportVO reqVO);
    /**
     * 导出的三种形式
     * @param exportVO
     * @return
     */
    List<BusinessRecordExportVO> getBusinessRecordList(BusinessRecordExportVO exportVO);
    List<BusinessRecordExportVO> getAllBusinessRecordList(BusinessRecordExportVO exportVO);
    List<BusinessRecordExportVO> getBusinessRecordListByRange(BusinessRecordExportVO exportVO);

    /**
     * 获取当前登录教练的详细信息
     */
    DlDriveSchoolCoach getLoginCoachInfo(Long userId);


}
