import request from '/@/utils/request';

/**
 * 分页查询班主任考核学期汇总列表
 * @param query 查询参数
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/classmasterevaluationsummary/page',
    method: 'get',
    params: query
  });
};

/**
 * 生成学期汇总数据
 * @param data 参数
 */
export const generateSummary = (data: any) => {
  return request({
    url: '/stuwork/classmasterevaluationsummary/generate',
    method: 'post',
    data
  });
};

/**
 * 重新计算排名
 * @param data 参数
 */
export const recalculateRanking = (data: any) => {
  return request({
    url: '/stuwork/classmasterevaluationsummary/recalculate',
    method: 'post',
    data
  });
};

/**
 * 查询班主任学期汇总详情
 * @param classMasterCode 工号
 * @param schoolYear 学年
 * @param schoolTerm 学期
 */
export const getSummaryByMaster = (classMasterCode: string, schoolYear: string, schoolTerm: string) => {
  return request({
    url: '/stuwork/classmasterevaluationsummary/detail',
    method: 'get',
    params: { classMasterCode, schoolYear, schoolTerm }
  });
};

/**
 * 获取待处理申诉提醒
 * @param schoolYear 学年
 * @param schoolTerm 学期
 */
export const getPendingAppealReminders = (schoolYear: string, schoolTerm: string) => {
  return request({
    url: '/stuwork/classmasterevaluationsummary/pending-appeals',
    method: 'get',
    params: { schoolYear, schoolTerm }
  });
};

/**
 * 导出学期汇总数据
 * @param data 查询条件
 */
export const exportSummary = (data: any) => {
  return request({
    url: '/stuwork/classmasterevaluationsummary/export',
    method: 'post',
    data
  });
};