/*
 * @Author: zc
 * @description 数据共享平台-数据共享平台配置
 */
import request from '@/utils/request';
import {useUserInfo} from "@/stores/userInfo";
import {storeToRefs} from "pinia";
const userStore = useUserInfo();
const { userInfos } = storeToRefs(userStore);
/**
 * @description 查询数据共享平台配置
 * @param {object}  params
 */
export const getDataShareConfig = (params?: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/info-configurationinformation`,
    method: 'get',
    params,
  });
};
/**
 * @description 修改数据共享平台配置
 * @param {object}  data
 */
export const editDataShareConfig = (data: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/update-configurationinformation`,
    method: 'put',
    data,
  });
};
/**
 * @description 推送任务列表查询
 * @param {object}  params
 */
export const getPushTaskList = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/getdssendtask`,
    method: 'get',
    params,
  });
};
/**
 * @description 推送任务列表详情
 * @param {object}  params
 */
export const getPushTaskDetail = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/getdssendtaskinfo`,
    method: 'get',
    params,
  });
};
/**
 * @description 推送任务列表详情(新)
 * @param {object}  params
 */
export const getPushTaskDetailNew = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/getdssenddetailtaskinfo`,
    method: 'get',
    params,
  });
};
/**
 * @description 重新推送
 * @param {object}  params
 */
export const rePush = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/fromnewtasksend`,
    method: 'get',
    params
  });
};
/**
 * @description 重新推送(新)
 * @param {object}  params
 */
export const rePushNew = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/addnewtasksendbyid`,
    method: 'get',
    params,
    headers: {
      'userinfo': userInfos.value.encryptionHeader
    }
  });
};
/**
 * @description 将推送任务修改为已推送
 * @param {object}  params
 */
export const taskPushed = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/updatetasksendstate`,
    method: 'get',
    params
  });
};
/**
 * @description 查询工单及时上传列表
 * @param {object}  params
 */
export const getOrderList = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/getorderlist`,
    method: 'get',
    params
  });
};
/**
 * @description 查询工单及时上传列表(新)
 * @param {object}  params
 */
export const getOrderListNew = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/getordertimelylist`,
    method: 'get',
    params
  });
};
/**
 * @description 查询通话记录及时上传列表
 * @param {object}  params
 */
export const getCallList = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/getcalllist`,
    method: 'get',
    params
  });
};
/**
 * @description 查询没有匹配到通话记录的电话来源工单
 * @param {object}  params
 */
export const getNoCallList = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/getordermatchingcall`,
    method: 'get',
    params
  });
};
/**
 * @description 查询没有匹配到通话记录的电话来源工单(新)
 * @param {object}  params
 */
export const getNoCallListNewFixed = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/getordermatchingcalllistfixed`,
    method: 'get',
    params
  });
};
/**
 * @description 查询没有匹配到通话记录的电话来源工单(新)
 * @param {object}  params
 */
export const getNoCallListNewTotal = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/getordermatchingcalllistcount`,
    method: 'get',
    params
  });
};
/**
 * @description 查询没有匹配到通话记录的电话来源工单(新)
 * @param {object}  params
 */
export const getNoCallListNew = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/getordermatchingcalllist`,
    method: 'get',
    params
  });
};
/**
 * @description 查询及时率
 * @param {object}  params
 */
export const getTimeRate = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/calculateuploadrate`,
    method: 'get',
    params
  });
};
/**
 * @description 查询及时率(新)
 * @param {object}  params
 */
export const getTimeRateNew = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/getcalculateuploadrate`,
    method: 'get',
    params
  });
};
/**
 * @description 无通话记录工单修改来源渠道
 * @param {object}  data
 */
export const editNoCallSource = (data: object) => {
  return request({
    url: `/api/v1/Order/update-order-sourcechannel`,
    method: 'post',
    data
  });
};
/**
 * @description 修改期满时间
 * @param {object}  data
 */
export const editExpireTime = (data: object) => {
  return request({
    url: `/api/v1/Order/update-orderexpired-time`,
    method: 'post',
    data
  });
};
/**
 * @description 查看修改记录
 * @param {object}  params
 */
export const getEditRecord = (params: object) => {
  return request({
    url: `/api/v1/Order/get-order-modifying-records-list`,
    method: 'get',
    params
  });
};
/**
 * @description 对接平台用户列表
 * @param {object}  params
 */
export const getUserList = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/get-user-info-list`,
    method: 'get',
    params
  });
};
/**
 * @description 新增对接平台用户
 * @param {object}  data
 */
export const platformSourceAddUser = (data: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/adduserinfo`,
    method: 'post',
    data
  });
};
/**
 * @description 省平台待推送数据
 * @param {object}  params
 */
export const getProvincePushData = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/getprovincewaitsendtasklist`,
    method: 'get',
    params
  });
};
/**
 * @description 其他平台待推送数据
 * @param {object}  params
 */
export const getOtherPushData = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/getotherplatformswaitsendtasklist`,
    method: 'get',
    params
  });
};
/**
 * @description 查询已推送任务
 * @param {object}  params
 */
export const getPushedTask = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/getdssendendtask`,
    method: 'get',
    params
  });
};
/**
 * @description 查询推送业务系统失败数据
 * @param {object}  params
 */
export const getPushFailData = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/getsendhotlineerrordata`,
    method: 'get',
    params,
    headers: {
      'userinfo': userInfos.value.encryptionHeader
    }
  });
};
/**
 * @description 推送业务系统失败数据重推
 * @param {object}  params
 */
export const pushFailData = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/pushfromhotlinedata`,
    method: 'get',
    params,
    headers: {
      'userinfo': userInfos.value.encryptionHeader
    }
  });
};
/**
 * @description 查询接收道德原始数据
 * @param {object}  params
 */
export const getReceiveData = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/get_receive_raw_data`,
    method: 'get',
    params
  });
};
/**
 * @description 数据统计-办件统计-数据汇聚
 * @param {object}  params
 */
export const getDataConvergence = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/get_data_aggregation_situation`,
    method: 'get',
    timeout:1000 * 60 * 5, // 请求限时五分钟
    params
  });
};
/**
 * @description 获取数据共享基础数据
 * @param {object}  params
 */
export const getDataShareBaseData = (params?: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/getbaseinfo`,
    method: 'get',
    params
  });
};
/**
 * @description 未推送办理结果工单
 * @param {object}  params
 */
export const getNoPushOrder = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/get_republish_filed_orders`,
    method: 'get',
    params
  });
};
/**
 * @description 查询市场明细
 * @param {object}  params
 */
export const getMarketDetail = (params: object) => {
  return request({
    baseURL:import.meta.env.VITE_DATASHARE_API_YRL,
    url: `/api/v1/HotlineWeb/get_case_distrecord_send`,
    method: 'get',
    params
  });
};