package com.ym.mec.biz.service;

import com.ym.mec.biz.dal.dto.ExportDto;
import com.ym.mec.biz.dal.dto.MusicGroupExportDto;
import com.ym.mec.biz.dal.entity.ManagerDownload;
import com.ym.mec.biz.dal.enums.ExportEnum;
import com.ym.mec.biz.dal.enums.ExportTypeEnum;
import com.ym.mec.biz.dal.page.EndCourseScheduleQueryInfo;
import com.ym.mec.biz.dal.page.ExportUserAccountQueryInfo;
import com.ym.mec.biz.dal.page.StudentStatisticsQueryInfo;
import com.ym.mec.biz.dal.page.queryMusicGroupCourseScheduleQueryInfo;
import com.ym.mec.common.entity.HttpResponseResult;
import org.springframework.scheduling.annotation.Async;

import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.Map;
import java.util.function.BiFunction;
import java.util.function.Function;


public interface ExportService {

    Map<String,String> getExportMap(ExportDto exportDto) throws IOException;

    List<String> getExportFields(ExportEnum exportEnum) throws IOException;

    <T> void export(HttpServletResponse response, List<T> rows, ExportDto exportDto) throws IOException;

    Map<ExportEnum, Function<Map<String, Object>, HttpResponseResult>> getExportManageFuncMap();

    Map<ExportEnum, Function<Map<String, Object>, List>> getExportFuncMap();

    //导出对账单
    List exportBill(Map<String, Object> info);

    /**
    * @description: 乐保导出
     * @param info
    * @return void
    * @author zx
    * @date 2022/2/11 15:55
    */
    List exportStudentInstrument(Map<String, Object> info);

    /**
    * @description: 班级列表导出
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 12:18
    */
    List exportClassGroup(Map<String, Object> info);

    /**
    * @description: 导出老师结转奖励
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 12:19
    */
    List teacherCourseReward(Map<String, Object> info);

    /**
    * @description: 导出陪练课列表
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 12:19
    */
    List practiceGroupList(Map<String, Object> info);

    /**
    * @description: 乐团【报名中、缴费中】 学生详情列表导出
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 12:19
    */
    List queryStudentApplyDetailExport(Map<String, Object> info);

    /**
    * @description: 评论列表导出
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 13:32
    */
    List courseReviews(Map<String, Object> info);

    /**
     * @description: 乐团管理--乐团详情-导出学员列表
     * @param info
     * @return java.util.List
     * @author zx
     * @date 2022/2/10 13:32
     */
    List queryMusicGroupStudent(Map<String, Object> info);

    /**
    * @description: 网管课管理导出
     * @param
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 13:32
    */
    List practiceGroup();

    /**
    * @description: vip管理导出
     * @param
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 13:33
    */
    List vipGroup();

    /**
    * @description: 学生课外训练记录导出
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 13:33
    */
    List extraExercisesReplys(Map<String, Object> info);

    /**
    * @description: 教师课酬导出
     * @param info
    * @return
    * @author zx
    * @date 2022/2/10 13:33
    */
    List isSettlementCourseSalarys(Map<String, Object> info);

    /**
    * @description: 运营指标管理导出
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 13:33
    */
    List operatingStudents(Map<String, Object> info);

    /**
    * @description: vip评论列表导出
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 13:33
    */
    List vipCourseReviews(Map<String, Object> info);

    /**
    * @description: 考级报名导出
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 13:33
    */
    List degreeRegistration(Map<String, Object> info);

    /**
    * @description: 回款统计
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 13:34
    */
    List studentOrder(Map<String, Object> info);

    /**
    * @description: 销售列表导出
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 13:34
    */
    List exportSellOrders(Map<String, Object> info);

    /**
    * @description: 服务指标明细导出
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 13:34
    */
    List teacherServeInfo(Map<String, Object> info);

    /**
    * @description: 首页异常统计导出
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 13:34
    */
    List exportIndexErrData(Map<String, Object> info);

    /**
    * @description: 分部云教练学员数据预览导出
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 13:34
    */
    List organStudentOverView(Map<String, Object> info);

    /**
    * @description: 分部云教练学员训练数据导出
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 13:34
    */
    List cloudStudyStudentTrainData(Map<String, Object> info);

    /**
    * @description: 分部云教练学员数据详情导出
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 13:34
    */
    List cloudStudyStudentOverView(Map<String, Object> info);

    //乐团声部在读人数导出
    void musicGroupNormalStudentNum(HttpServletResponse response, ExportDto exportDto) throws IOException;

    /**
    * @description: 分部云教练活动统计数据导出
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 13:34
    */
    List countCloudTeacherActive(Map<String, Object> info);

    /**
    * @description: 云教练活动统计详情
     * @param info
    * @return java.util.List
    * @author zx
    * @date 2022/2/10 13:35
    */
    List countCloudTeacherActiveDetail(Map<String, Object> info);

    <T> T getQueryInfo(Map<String, Object> info, Class<T> clazz, Boolean organFlag);

    <T> T getParam(Map<String, Object> info, String key, Class<T> clazz);

    //报名中缴费中乐团缴费情况导出
    void musicGroupRegister(HttpServletResponse response, ExportDto exportDto) throws IOException;

    //财务管理导出
    HttpResponseResult routeOrderList(Map<String, Object> info);

    //学员小课记录导出
    HttpResponseResult exportStudentVipPractice(Map<String, Object> info);

    //学员小课记录导出
    HttpResponseResult exportStudentVipCourseInfo(Map<String, Object> info);

    //vip学员课程管理
    HttpResponseResult exportVipStudentCourseManage(Map<String, Object> info) throws Exception;

    //导出活动资格
    HttpResponseResult exportStudentSubCourse(Map<String, Object> info);

    //学员小课记录导出
    HttpResponseResult exportStudentMusicTheoryCourseInfo(Map<String, Object> info);

    //订单列表导出
    HttpResponseResult orderList(Map<String, Object> info);

    //订单列表汇总导出
    HttpResponseResult orderListSum(Map<String, Object> info);

    //保存下载记录
    ManagerDownload saveManagerDownload(ExportTypeEnum exportTypeEnum, Integer userId);

    void orderList(Map<String, Object> params, ManagerDownload managerDownload);

    void orderListSum(Map<String, Object> params, ManagerDownload managerDownload);

    void routeOrderList(Map<String, Object> params, ManagerDownload managerDownload);

    void superFindCourseSchedules(EndCourseScheduleQueryInfo queryInfo, ManagerDownload managerDownload);

    void studentVipPractice(String organId, ManagerDownload managerDownload, Integer tenantId);

    void queryStudentCourseInfo(String organId, Integer tenantId, String vip, ManagerDownload managerDownload,ExportEnum exportEnum);

    void queryVipStudentCourseManage(String organId, Integer tenantId, ManagerDownload managerDownload, ExportEnum exportEnum);

    void exportStudentSmallClassStatisticsSum(StudentStatisticsQueryInfo queryInfo, ManagerDownload managerDownload);

    void exportMusicGroupCourseScheduleDetail(queryMusicGroupCourseScheduleQueryInfo queryInfo, ManagerDownload managerDownload);

    void exportMusicGroupCourseList(ManagerDownload managerDownload, ExportUserAccountQueryInfo queryInfo);

    HttpResponseResult asyncExport(Runnable runnable,String excelName);
}
