import axios from '@/libs/api.request'

// 重点人员类别查询
export const selectRatingDictTypeList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRating/selectRatingDictTypeList',
    method: 'post',
    data: param
  })
}
// 重点人员类别查询
export const selectRatingDictList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRating/selectRatingDictList',
    method: 'post',
    data: param
  })
}
// 添加修改评分项
export const saveRatingDict = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRating/saveRatingDict',
    method: 'post',
    data: param
  })
}
// 删除评分项
export const deleteRatingDict = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRating/deleteRatingDict',
    method: 'post',
    data: param
  })
}
// 查询打分列表
export const selectRatingDetailsList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRating/selectRatingDetailsList',
    method: 'post',
    data: param
  })
}
// 添加分数
export const saveRatingDetails = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRating/saveRatingDetails',
    method: 'post',
    data: param
  })
}
// 查询评分历史
export const selectRatingSummaryByPersonIdList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRating/selectRatingSummaryByPersonIdList',
    method: 'post',
    data: param
  })
}
// 查询历史详情
export const selectSummaryRatingDetailsList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRating/selectSummaryRatingDetailsList',
    method: 'post',
    data: param
  })
}
// 回访设置管理
export const saveKeyPersonVisit = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonVisit/saveKeyPersonVisit',
    method: 'post',
    data: param
  })
}
// 删除回访设置
export const deletePersonVisit = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonVisit/deletePersonVisit',
    method: 'post',
    data: param
  })
}
// 回访设置列表
export const findPersonVisitList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonVisit/findPersonVisitList',
    method: 'post',
    data: param
  })
}
// 回访单人详情
export const getPersonVisitRecord = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonVisit/getPersonVisitRecord',
    method: 'post',
    data: param
  })
}
// 添加回访
export const insertPersonVisitRecord = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonVisit/insertPersonVisitRecord',
    method: 'post',
    data: param
  })
}
// 回访设置启停用
export const updatePersonVisitStatus = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonVisit/updatePersonVisitStatus',
    method: 'post',
    data: param
  })
}
// 根据id查询重点人员信息
export const getKeyPersonUser = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRating/getKeyPersonUser',
    method: 'post',
    data: param
  })
}

// ===== 按钮可见权限配置 =====
// 列表（来源于字典 page_button，并合并已配置的可见部门）
export const selectPageButtonPowerList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonVisitPower/selectPageButtonPowerList',
    method: 'post',
    data: param
  })
}

// ===== 评分周期设置 =====
// 列表
export const selectRatingDayList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDay/selectRatingDayList',
    method: 'post',
    data: param
  })
}

// ===== 评分等级划分设置 =====
// 列表
export const selectRatingLevelList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingLevel/selectRatingLevelList',
    method: 'post',
    data: param
  })
}
// 保存（整类覆盖保存）
export const saveRatingLevel = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingLevel/saveRatingLevel',
    method: 'post',
    data: param
  })
}
// 保存（新增/修改）
export const saveRatingDay = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDay/saveRatingDay',
    method: 'post',
    data: param
  })
}
// 保存配置（为指定按钮设置可见部门类型）
export const savePageButtonPower = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonVisitPower/savePageButtonPower',
    method: 'post',
    data: param
  })
}
// 获取超期预警统计数据
export const getOverdueWarningStatistics = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonStatistics/getOverdueWarningStatistics',
    method: 'post',
    data: param
  })
}

// 获取评分统计数据
export const getScoreStatistics = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonStatistics/getScoreStatistics',
    method: 'post',
    data: param
  })
}

// ===== 评分等级维护（sys_dict: rating_level） =====
export const selectLevelSetList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonLevelSet/selectList',
    method: 'post',
    data: param
  })
}
export const saveLevelSet = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonLevelSet/save',
    method: 'post',
    data: param
  })
}
export const deleteLevelSet = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonLevelSet/delete',
    method: 'post',
    data: param
  })
}

// 获取评分超期预警统计数据
export const getRatingStatistics = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonStatistics/getRatingStatistics',
    method: 'post',
    data: param
  })
}

// ===== 双属地管理 =====
export const getDualPushList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDual/selectPushList',
    method: 'post',
    data: param
  })
}

export const getDualForwardList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDual/selectForwardList',
    method: 'post',
    data: param
  })
}

export const getDualPendingList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDual/selectPendingList',
    method: 'post',
    data: param
  })
}

export const getDualReceivingList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDual/selectReceivingList',
    method: 'post',
    data: param
  })
}

export const getDualReceivedList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDual/selectBeReceivedList',
    method: 'post',
    data: param
  })
}

export const getDualPersonOptions = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDual/selectBelongPersonList',
    method: 'post',
    data: param
  })
}

export const saveDualPush = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDual/savePush',
    method: 'post',
    data: param
  })
}

export const selectCurrentUserInfo = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDual/selectCurrentUserInfo',
    method: 'post',
    data: param
  })
}

export const revokeDualPush = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDual/revokePush',
    method: 'post',
    data: param
  })
}

export const acceptDualPush = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDual/acceptPush',
    method: 'post',
    data: param
  })
}

export const rejectDualPush = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDual/rejectPush',
    method: 'post',
    data: param
  })
}

export const returnDualPerson = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDual/returnPerson',
    method: 'post',
    data: param
  })
}

export const getDualDetail = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDual/getDualDetail',
    method: 'post',
    data: param
  })
}

export const getDualWarnPushList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDual/selectDualWarnPushList',
    method: 'post',
    data: param
  })
}

export const getDualPhoneList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDual/selectDualPhoneList',
    method: 'post',
    data: param
  })
}

export const saveDualPhone = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRatingDual/saveDualPhone',
    method: 'post',
    data: param
  })
}

// ===== 回访记录办理 =====
// 查询回访记录列表
export const findVisitRecordList = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonVisitRecord/findVisitRecordList',
    method: 'post',
    data: param
  })
}
// 获取人员信息（用于回访）
export const getPersonInfoForVisit = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonVisitRecord/getPersonInfoForVisit',
    method: 'post',
    data: param
  })
}
// 保存回访记录
export const saveVisitRecord = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonVisitRecord/saveVisitRecord',
    method: 'post',
    data: param
  })
}
// 查询回访历史（分页）
export const selectVisitHistoryPage = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonVisitRecord/selectVisitHistoryPage',
    method: 'post',
    data: param
  })
}
// 查询回访记录详情
export const getVisitRecordDetail = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonVisitRecord/getVisitRecordDetail',
    method: 'post',
    data: param
  })
}
// 获取回访按钮权限
export const getVisitButtonPower = (param) => {
  return axios.request({
    url: '/api/ac/jilinsscgsdp/keyPersonRating/getVisitButtonPower',
    method: 'post',
    data: param
  })
}
