import request from '@/utils/request'

// ===== 台账一键全量导入（多Sheet合并Excel）=====
export function importCombinedLedger(data) {
  return request({ url: '/ledger/import/combined', method: 'post', data })
}

// ===== 台账数据清理（按导入时间范围）=====
export function clearLedgerByTimeRange(params) {
  return request({ url: '/ledger/import/clear', method: 'delete', params })
}

// ===== 导入模板下载 =====
// type 为空 → 合并模板（全部20个Sheet）；type=supervisionProblem 等 → 单台账模板
export function downloadLedgerTemplate(params) {
  return request({ url: '/ledger/template', method: 'get', params, responseType: 'blob' })
}

// ===== 台账一键导入 =====
export function importSupervisionProblem(data) {
  return request({ url: '/ledger/import/supervisionProblem', method: 'post', data })
}
export function importPatrolInspection(data) {
  return request({ url: '/ledger/import/patrolInspection', method: 'post', data })
}
export function importRealtimeInterception(data) {
  return request({ url: '/ledger/import/realtimeInterception', method: 'post', data })
}
export function importServicePatrol(data) {
  return request({ url: '/ledger/import/servicePatrol', method: 'post', data })
}
export function importComplaint(data) {
  return request({ url: '/ledger/import/complaint', method: 'post', data })
}
export function importSecurityTest(data) {
  return request({ url: '/ledger/import/securityTest', method: 'post', data })
}
export function importChannelPassRate(data) {
  return request({ url: '/ledger/import/channelPassRate', method: 'post', data })
}
export function importUnsafeEvent(data) {
  return request({ url: '/ledger/import/unsafeEvent', method: 'post', data })
}
export function importSeizureStats(data) {
  return request({ url: '/ledger/import/seizureStats', method: 'post', data })
}
export function importTerminalBonus(data) {
  return request({ url: '/ledger/import/terminalBonus', method: 'post', data })
}
export function importExamScore(data) {
  return request({ url: '/ledger/import/examScore', method: 'post', data })
}
export function importRewardApproval(data) {
  return request({ url: '/ledger/import/rewardApproval', method: 'post', data })
}

// ===== 部门监察问题记录 =====
export function listSupervisionProblem(query) {
  return request({ url: '/ledger/supervisionProblem/list', method: 'get', params: query })
}
export function getSupervisionProblem(id) {
  return request({ url: '/ledger/supervisionProblem/' + id, method: 'get' })
}
export function exportSupervisionProblem(query) {
  return request({ url: '/ledger/supervisionProblem/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 队室三级质控巡查记录 =====
export function listPatrolInspection(query) {
  return request({ url: '/ledger/patrolInspection/list', method: 'get', params: query })
}
export function exportPatrolInspection(query) {
  return request({ url: '/ledger/patrolInspection/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 部门实时质控拦截记录 =====
export function listRealtimeInterception(query) {
  return request({ url: '/ledger/realtimeInterception/list', method: 'get', params: query })
}
export function exportRealtimeInterception(query) {
  return request({ url: '/ledger/realtimeInterception/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 服务巡查记录 =====
export function listServicePatrol(query) {
  return request({ url: '/ledger/servicePatrol/list', method: 'get', params: query })
}
export function exportServicePatrol(query) {
  return request({ url: '/ledger/servicePatrol/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 投诉情况记录 =====
export function listComplaint(query) {
  return request({ url: '/ledger/complaint/list', method: 'get', params: query })
}
export function exportComplaint(query) {
  return request({ url: '/ledger/complaint/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 安保测试记录 =====
export function listSecurityTest(query) {
  return request({ url: '/ledger/securityTest/list', method: 'get', params: query })
}
export function exportSecurityTest(query) {
  return request({ url: '/ledger/securityTest/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 通道过检率记录 =====
export function listChannelPassRate(query) {
  return request({ url: '/ledger/channelPassRate/list', method: 'get', params: query })
}
export function exportChannelPassRate(query) {
  return request({ url: '/ledger/channelPassRate/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 不安全事件记录 =====
export function listUnsafeEvent(query) {
  return request({ url: '/ledger/unsafeEvent/list', method: 'get', params: query })
}
export function exportUnsafeEvent(query) {
  return request({ url: '/ledger/unsafeEvent/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 查获违规品统计 =====
export function listSeizureStats(query) {
  return request({ url: '/ledger/seizureStats/list', method: 'get', params: query })
}
export function exportSeizureStats(query) {
  return request({ url: '/ledger/seizureStats/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 航站楼加分记录 =====
export function listTerminalBonus(query) {
  return request({ url: '/ledger/terminalBonus/list', method: 'get', params: query })
}
export function exportTerminalBonus(query) {
  return request({ url: '/ledger/terminalBonus/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 成绩收集 =====
export function listExamScore(query) {
  return request({ url: '/ledger/examScore/list', method: 'get', params: query })
}
export function exportExamScore(query) {
  return request({ url: '/ledger/examScore/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 小额奖励审批单 =====
export function listRewardApproval(query) {
  return request({ url: '/ledger/rewardApproval/list', method: 'get', params: query })
}
export function exportRewardApproval(query) {
  return request({ url: '/ledger/rewardApproval/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 部门奖惩记录（增删改查） =====
export function listRewardPenalty(query) {
  return request({ url: '/ledger/rewardPenalty/list', method: 'get', params: query })
}
export function getRewardPenalty(id) {
  return request({ url: '/ledger/rewardPenalty/' + id, method: 'get' })
}
export function addRewardPenalty(data) {
  return request({ url: '/ledger/rewardPenalty', method: 'post', data })
}
export function updateRewardPenalty(data) {
  return request({ url: '/ledger/rewardPenalty', method: 'put', data })
}
export function delRewardPenalty(ids) {
  return request({ url: '/ledger/rewardPenalty/' + ids, method: 'delete' })
}
export function exportRewardPenalty(query) {
  return request({ url: '/ledger/rewardPenalty/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 请休假记录（特殊）（增删改查） =====
export function listLeaveSpecial(query) {
  return request({ url: '/ledger/leaveSpecial/list', method: 'get', params: query })
}
export function getLeaveSpecial(id) {
  return request({ url: '/ledger/leaveSpecial/' + id, method: 'get' })
}
export function addLeaveSpecial(data) {
  return request({ url: '/ledger/leaveSpecial', method: 'post', data })
}
export function updateLeaveSpecial(data) {
  return request({ url: '/ledger/leaveSpecial', method: 'put', data })
}
export function delLeaveSpecial(ids) {
  return request({ url: '/ledger/leaveSpecial/' + ids, method: 'delete' })
}
export function exportLeaveSpecial(query) {
  return request({ url: '/ledger/leaveSpecial/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 锦旗及感谢信记录（增删改查） =====
export function listBannerLetter(query) {
  return request({ url: '/ledger/bannerLetter/list', method: 'get', params: query })
}
export function getBannerLetter(id) {
  return request({ url: '/ledger/bannerLetter/' + id, method: 'get' })
}
export function addBannerLetter(data) {
  return request({ url: '/ledger/bannerLetter', method: 'post', data })
}
export function updateBannerLetter(data) {
  return request({ url: '/ledger/bannerLetter', method: 'put', data })
}
export function delBannerLetter(ids) {
  return request({ url: '/ledger/bannerLetter/' + ids, method: 'delete' })
}
export function exportBannerLetter(query) {
  return request({ url: '/ledger/bannerLetter/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 日常培训记录 =====
export function importDailyTraining(data) {
  return request({ url: '/ledger/import/dailyTraining', method: 'post', data })
}
export function listDailyTraining(query) {
  return request({ url: '/ledger/dailyTraining/list', method: 'get', params: query })
}
export function getDailyTraining(id) {
  return request({ url: '/ledger/dailyTraining/' + id, method: 'get' })
}
export function exportDailyTraining(query) {
  return request({ url: '/ledger/dailyTraining/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 组长履职情况记录 =====
export function importLeaderDuty(data) {
  return request({ url: '/ledger/import/leaderDuty', method: 'post', data })
}
export function listLeaderDuty(query) {
  return request({ url: '/ledger/leaderDuty/list', method: 'get', params: query })
}
export function getLeaderDuty(id) {
  return request({ url: '/ledger/leaderDuty/' + id, method: 'get' })
}
export function exportLeaderDuty(query) {
  return request({ url: '/ledger/leaderDuty/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 健康锐兵 =====
export function importHealthSoldier(data) {
  return request({ url: '/ledger/import/healthSoldier', method: 'post', data })
}
export function listHealthSoldier(query) {
  return request({ url: '/ledger/healthSoldier/list', method: 'get', params: query })
}
export function getHealthSoldier(id) {
  return request({ url: '/ledger/healthSoldier/' + id, method: 'get' })
}
export function exportHealthSoldier(query) {
  return request({ url: '/ledger/healthSoldier/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 宿舍消防安全专项自查 =====
export function importDormFireSafety(data) {
  return request({ url: '/ledger/import/dormFireSafety', method: 'post', data })
}
export function listDormFireSafety(query) {
  return request({ url: '/ledger/dormFireSafety/list', method: 'get', params: query })
}
export function getDormFireSafety(id) {
  return request({ url: '/ledger/dormFireSafety/' + id, method: 'get' })
}
export function exportDormFireSafety(query) {
  return request({ url: '/ledger/dormFireSafety/export', method: 'post', params: query, responseType: 'blob' })
}

// ===== 培训台账问题通报 =====
export function importTrainingIssue(data) {
  return request({ url: '/ledger/import/trainingIssue', method: 'post', data })
}
export function listTrainingIssue(query) {
  return request({ url: '/ledger/trainingIssue/list', method: 'get', params: query })
}
export function getTrainingIssue(id) {
  return request({ url: '/ledger/trainingIssue/' + id, method: 'get' })
}
export function exportTrainingIssue(query) {
  return request({ url: '/ledger/trainingIssue/export', method: 'post', params: query, responseType: 'blob' })
}
