/*
 *  全系列 restful api格式, 定义通用req对象
 *
 *  @author terrfly
 *  @site https://www.jeepay.vip
 *  @date 2021/5/8 07:18
 */

import request from "@/http/request";
import { Base64 } from "js-base64";
import $infoBox from "@/utils/infoBox";

export const req = {
  // 通用列表查询接口
  list: (url, params) => {
    return request.request(
      { url: url, method: "GET", params: params },
      true,
      true,
      false
    );
  },

  // 通用新增接口
  add: (url, data) => {
    return request.request(
      { url: url, method: "POST", data: data },
      true,
      true,
      false
    );
  },

  // 通用查询单条数据接口
  getById: (url, bizId, params = {}) => {
    return request.request(
      { url: url + "/" + bizId, method: "GET", params: params },
      true,
      true,
      false
    );
  },

  // 通用修改接口
  updateById: (url, bizId, data) => {
    return request.request(
      { url: url + "/" + bizId, method: "PUT", data: data },
      true,
      true,
      false
    );
  },

  // 通用删除接口
  delById: (url, bizId) => {
    return request.request(
      { url: url + "/" + bizId, method: "DELETE" },
      true,
      true,
      false
    );
  },

  // 通用 新增 or 更新
  addOrUpdate: (bizId, url, data, showMessage = true) => {
    //包含bizId 请求的是修改接口
    if (bizId) {
      return req.updateById(url, bizId, data).then((res) => {
        if (showMessage) $infoBox.message.success("更新成功");
        return Promise.resolve(res);
      });
    } else {
      return req.add(url, data).then((res) => {
        if (showMessage) $infoBox.message.success("新增成功");
        return Promise.resolve(res);
      });
    }
  },
};

// 全系列 restful api格式 (全局loading方式)
export const reqLoad = {
  // 通用列表查询接口
  list: (url, params) => {
    return request.request(
      { url: url, method: "GET", params: params },
      true,
      true,
      true
    );
  },

  // 通用新增接口
  add: (url, data) => {
    return request.request(
      { url: url, method: "POST", data: data },
      true,
      true,
      true
    );
  },

  // 通用查询单条数据接口
  getById: (url, bizId, params = {}) => {
    return request.request(
      { url: url + "/" + bizId, method: "GET", params: params },
      true,
      true,
      true
    );
  },

  // 通用修改接口
  updateById: (url, bizId, data) => {
    return request.request(
      { url: url + "/" + bizId, method: "PUT", data: data },
      true,
      true,
      true
    );
  },

  // 通用删除接口
  delById: (url, bizId) => {
    return request.request(
      { url: url + "/" + bizId, method: "DELETE" },
      true,
      true,
      true
    );
  },
};

/** 角色管理页面 **/
export const API_URL_ENT_LIST = "/api/sysEnts";
export const API_URL_ROLE_LIST = "/api/sysRoles";
export const API_URL_ROLE_ENT_RELA_LIST = "/api/sysRoleEntRelas";
export const API_URL_SYS_USER_LIST = "/api/sysUsers";
export const API_URL_USER_ROLE_RELA_LIST = "/api/sysUserRoleRelas";
/** 首页统计 **/
export const API_URL_MAIN_STATISTIC = "/api/mainChart";

/** 商户App管理 **/
export const API_URL_MCH_APP = "/api/mchApps";
/** 支付订单管理 **/
export const API_URL_PAY_ORDER_LIST = "/api/payOrder";
/** 退款订单管理 **/
export const API_URL_REFUND_ORDER_LIST = "/api/refundOrder";
/** 支付方式列表 **/
export const API_URL_PAYWAYS_LIST = "/api/payWays";
/** 支付接口定义页面 **/
export const API_URL_IFDEFINES_LIST = "/api/payIfDefines";
/** 商户支付参数配置 **/
export const API_URL_MCH_PAYCONFIGS_LIST = "/api/mch/payConfigs";
/** 商户支付通道配置 **/
export const API_URL_MCH_PAYPASSAGE_LIST = "/api/mch/payPassages";
/** 转账订单管理 **/
export const API_URL_TRANSFER_ORDER_LIST = "/api/transferOrders";

/** 分账组管理 **/
export const API_URL_DIVISION_RECEIVER_GROUP = "/api/divisionReceiverGroups";

/** 分账账号管理 **/
export const API_URL_DIVISION_RECEIVER = "/api/divisionReceivers";

/** 分账记录管理 **/
export const API_URL_PAY_ORDER_DIVISION_RECORD_LIST = "/api/division/records";

/** 分账回退管理 **/
export const API_URL_PAY_ORDER_DIVISION_REFUND_RECORD_LIST =
  "/api/division/refunds/records";

/** 三方账号信息 **/
export const API_URL_CHANNEL_ACCOUNT_INFO = "/api/channelAccountInfo";

/** 商户静态码管理 **/
export const API_URL_MCH_QR_CODE_LIST = "/api/mchQrCodes";

/** 商户门店管理 **/
export const API_URL_MCH_STORE_LIST = "/api/mchStore";

/** 商户门店员工交接班记录 **/
export const API_URL_MCH_WORK_RECORD_LIST = "/api/user/workRecords";

/** 微信公众号消息接收者管理 **/
export const API_URL_MCH_WXMP_UESR = "/api/wxmp";

/** 设备厂商配置 **/
export const API_URL_DEVICE_PROVIDER = "/api/device/provider";

/** 门店设备配置 **/
export const API_URL_STORE_DEVICE = "/api/store/device";

/** 进件管理 **/
export const API_URL_MCH_APPLYMENT_LIST = "/api/mchApplyments";

/** 商户配置 **/
export const API_URL_MCH_CONFIG = "/api/mchConfig";

/** 代理商  **/
export const API_URL_AGENT_LIST = "/api/agents";

/** 兼容组件包 (单纯修改数据) **/
export const API_URL_MCH_LIST = "";

export const API_URL_MCH_TERMINAL = "/api/mchTerminals";

export const API_URL_UPLOAD_SINGLE_FILE_URL =
  process.env.VITE_API_BASE_URL + "/api/ossFiles/singleFile";

export const API_URL_ISV_LIST = "/api/isvInfo";
/** 统计接口 **/
export const API_URL_STATISTIC = "/api/statistic";
/** 公告*/
export const API_URL_NOTICELIST = "/api/sysArticles";
/** 广告 **/
export const API_URL_ADVERT = "/api/advert";

/** 支付宝服务商代运营授权接口 */
export const API_ALIPAY_SP_OPERATION = "/api/alipaySpOperation";

/** 支付宝  蚂蚁店铺接口 */
export const API_ALIPAY_SHOP = "/api/alipayShop";

/** 支付宝  如意设备接口 */
export const API_ALIPAY_IOT = "/api/alipayIot";

/** 会员管理 */
export const API_URL_MEMBER_LIST = "/api/member";

/** 会员账户流水 */
export const API_URL_MEMBER_ACCOUNT_HISTORY_LIST =
  API_URL_MEMBER_LIST + "/accountHistory";

/** 会员充值记录 */
export const API_URL_MEMBER_RECHARGE_RECORD_LIST =
  API_URL_MEMBER_LIST + "/rechargeRecord";

/** 会员充值规则 */
export const API_URL_MEMBER_RECHARGE_RULE_LIST =
  API_URL_MEMBER_LIST + "/rechargeRule";

/** 代理商配置 **/
export const API_URL_AGENT_CONFIG = "/api/agentConfig";
/** 产品中心 */
export const API_URL_PRODUCT_LIST = "/api/product/getProductList"; //产品列表
export const API_URL_PRODUCT_TYPE_LIST = "/api/product/getProductTypeList"; //分类列表
export const API_URL_PRODUCT_DETAIL_LIST = "/api/product/getProductById"; //详情
export const API_URL_PRODUCT_START_LIST = "/api/product/startProduct"; //开通

export const API_APP_PRODUCT_LIST = "/api/mchApps/getNewProductList"; //新产品列表（包含绑定关系
export const API_APP_PRODUCT_LIST_STATE = "/api/mchApps/relevancyProduct"; //关联/解除关联关系

export const API_APP_SHOP_LIST = "/api/mchappapplyment"; //应用关联商户列表
export const API_APP_SHOP_LIST_STATUS = "/api/mchappapplyment"; //应用关联商户状态
export const API_APP_SHOP_LIST_RELEVANCE = "/api/mchApps/relevance"; //一键关联商户

export const API_MCH_APPLYMENT_RISK = "/api/mchApplyments/risk"; //风控标记
export const API_MCH_APPLYMENT_REMARK = "/api/mchApplyments/remark"; //商户备注修改
export const API_MCH_PAY_DEFINES = "/api/payIfDefines"; //通道

export const API_MCH_PAY_SETTLE_LOG = "/api/settle"; //结算记录查询

/*资金管理*/
export const API_MCH_PAY_ACCOUNT = "/api/account"; //资金总览 （退款账户，营销账户）
export const API_MCH_PAY_ACCOUNT_RECHARGE = "/api/account/recharge"; //充值
export const API_MCH_ACCOUNT_CHANGE_LOG_LIST = "/api/accountChange"; //资金明细
export const API_MCH_PAY_DEFINESPAGE = "/api/payIfDefines/listPage";
export const API_MCH_ACCOUNT_FUND_LOG_LIST = "/api/accountFund"; //资金明细

export const API_URL_PAY_CONFIG_ALTERNATIVE_LIST =
  "/api/payConfig/configAlternativeList";

export const API_URL_PACKAGE_LIST = "/api/packageInfo/getPackageList"; //方案中心
export const API_URL_PACKAGE_TYPE_LIST = "/api/packageInfo/getPackageTypeList"; //方案分类
export const API_URL_PACKAGE_DETAIL_LIST = "/api/packageInfo/getPackageById"; //方案分类
export const API_URL_PACKAGE_ORDER = "/api/packageInfo/getPackageOder"; //开通记录

export const API_URL_PRODUCT_EXAMINE_LIST = "/api/packageInfo/getPackageOder"; //开通记录

export const API_URL_QUALIFICATIONDEFINE_PAGE = "/api/qualificationDefine/page"; //商户资质模板信息分页查询

export const API_URL_ACCOUNT_CASH = "/api/account/cash"; //商户发起提现

export const API_URL_MCH_APPS = "/api/mchApps"; //新增应用

//商户资质模板信息分页查询
export const API_URL_APTITUDE = "/api/qualificationDefine/page";
//获取服务商关联的渠道信息
export const API_URL_ISV_INFO_LIST = "/api/isvInfo/isvInfoList";
//申请单接口
export const API_URL_MCH_MODIFY_APPLYMENT_LIST = "/api/mchModifyApplyment";

//营销红包开始

//红包规则
export const API_URL_MCH_REF_PACKET_RULE_LIST = "/api/redPacketRule";
//新增红包规则
export const API_URL_MCH_REF_PACKET_RULE_ADD = "/api/redPacketRule";

//顾客统计
export const API_URL_MCH_REF_PACKET_RULE_COUNT = "/api/redPacketUser/count";
//顾客列表
export const API_URL_MCH_REF_PACKET_USER_LIST = "/api/redPacketUser";
//顾客红包
export const API_URL_MCH_REF_PACKET_INFO_LIST = "/api/redPacketInfo";
//红包查询规则详情
export const API_URL_MCH_REF_PACKET_RULE_QUERY = "/api/redPacketRule";
//红包修改规则
export const API_URL_MCH_REF_PACKET_RULE_EDIT = "/api/redPacketRule/edit";
//红包余额变动明细列表
export const API_URL_MCH_REF_PACKET_CHANGE = "/api/redPacketChange";

//视频列表数据
export const API_URL_MCH_VIDEO_DATA_LIST = "/api/mchVideo/dataList";
//订单分账分页查询
export const API_URL_DIVISION_TEMPLATE_LIST = "/api/divisionTemplate";
//订单分账分页新增
export const API_URL_DIVISION_TEMPLATE_ADD = "/api/divisionTemplate";
//订单分账分页修改
export const API_URL_DIVISION_TEMPLATE_EDIT = "/api/divisionTemplate";
//订单分账分页删除
export const API_URL_DIVISION_TEMPLATE_DEL = "/api/divisionTemplate";
//新增订单分账配置
export const API_URL_DIVISION_TEMPLATE_SAVE_CONFIG =
  "/api/divisionTemplate/saveConfig";

//红包结束
//交易路由
export const API_URL_ENT_MCH_ROUTE_LIST = "/api/mchRoute";
//交易路由新增
export const API_URL_ENT_MCH_ROUTE_ADD = "/api/mchRoute";
//交易路由修改
export const API_URL_ENT_MCH_ROUTE_EDIT = "/api/mchRoute";
//交易路由删除
export const API_URL_ENT_MCH_ROUTE_DEL = "/api/mchRoute";
//交易路由更新
export const API_URL_ENT_MCH_ROUTE_SAVE = "/api/mchRoute/onlyUpdate";

//数据统计
export const API_URL_PAY_ORDER_ROUTE_COUNT = "/api/route/count";
//交易路由管理统计
export const API_URL_PAY_ORDER_ROUTE_DATA = "/api/routeData";
//交易路由管理统计
export const API_URL_PAY_ORDER_ROUTE_DATA_COUNT = "/api/routeData/count";

/** 安全发 开始 **/
//代付
//新增
export const API_URL_PAY_AQF_ADD = "/api/aqf/add";
//查询详情
export const API_URL_PAY_AQF_QUERY = "/api/aqf";
//付款账号列表
export const API_URL_PAY_AQF_LIST = "/api/aqf/getPageList";
//删除
export const API_URL_PAY_AQF_DEL = "/api/aqf";
//修改
export const API_URL_PAY_AQF_SAVE = "/api/aqf";
//获取签约连接
export const API_URL_PAY_AQF_SIGN_URL = "/api/aqfApi/signUrl";
//新增收款账户
export const API_URL_PAY_AQF_ADD_JS = "/api/aqf/addJs";

//安全发解约
export const API_URL_PAY_AQF_AGREEMENT_UNSIGN =
  "/api/aqfApi/userAgreementUnsign";
//记账本查询
export const API_URL_PAY_AQF_ACCOUNT_BOOK_QUERY =
  "/api/aqfApi/alipayFundAccountbookQuery";

//单笔生成待发待结算信息
export const API_URL_PAY_AQF_SETTLEMENT_DATE = "/api/aqfApi/settlementData";
//批量生成待发待结算信息
export const API_URL_PAY_AQF_BATCH_SETTLEMENT_DATE =
  "/api/aqfApi/batchSettlementData";
//结算订单列表
export const API_URL_PAY_AQF_ORDER_LIST = "/api/transferOrders";

//任务发布
//新增
export const API_URL_PAY_TASK_ADD = "/api/taskList/add";
//查询详情
export const API_URL_PAY_TASK_QUERY = "/api/taskList";
//付款账号列表
export const API_URL_PAY_TASK_LIST = "/api/taskList/getPageList";
//删除
export const API_URL_PAY_TASK_DEL = "/api/taskList/";
//修改
export const API_URL_PAY_TASK_SAVE = "/api/taskList";

//查询收款人信息
export const API_URL_PAY_BATCH_DATA = "/api/aqf/getBatchData";
//订单统计
export const API_URL_TRANSFERORDERS_STATSDATA = "/api/transferOrders/statsData";

/** 安全发 结束 **/

/** 交易路由 开始 **/
//列表
export const API_URL_PAY_ORDER_ROUTE_LIST = "/api/route";
//新增
export const API_URL_PAY_ORDER_ROUTE_ADD = "/api/route";
//修改
export const API_URL_PAY_ORDER_ROUTE_SAVE = "/api/route";
//删除
export const API_URL_PAY_ORDER_ROUTE_DEL = "/api/route";

//绑定门店路由
export const API_URL_ROUTE_MANAGE_ADD = "/api/routeManage";
//分页查询列表
export const API_URL_ROUTE_MANAGE_LIST = "/api/routeManage";
//修改接口
export const API_URL_ROUTE_MANAGE_SAVE = "/api/routeManage";
//删除接口
export const API_URL_ROUTE_MANAGE_DEL = "/api/routeManage";
//运行分页查询
export const API_URL_ROUTE_RECORD = "/api/routeRecord";

//获取进件成功的通道
export const API_URL_MCHAPPLYMENTS_SUCCEEDIFNAME =
  "/api/mchApplyments/getSucceedIfName";
//获取进件成功的渠道
export const API_URL_MCHAPPLYMENTS_SUCCEEDISVNAME =
  "/api/mchApplyments/getSucceedIsvName";
/** 交易路由 结束 **/

/** 交易分账 开始 **/
//新增分账分出方
export const API_URL_DIVISIONSUBJECT_DIVISION_ADD =
  "/api/divisionSubject/addDivision";
//修改分账分出方 删除分账分出方
export const API_URL_DIVISIONSUBJECT_DIVISION_SAVE = "/api/divisionSubject";
//查询分账分出方
export const API_URL_DIVISIONSUBJECT_DIVISION_DIVPAGE =
  "/api/divisionSubject/divPage";

//新增分账接收方
export const API_URL_DIVISIONSUBJECT_RECEIVER_ADD =
  "/api/divisionSubject/addReceiver";
//修改分账接收方 删除分账接收方
export const API_URL_DIVISIONSUBJECT_RECEIVER_SAVE = "/api/divisionSubject";
//查询分账接收方
export const API_URL_DIVISIONSUBJECT_RECEIVER_RECPAGE =
  "/api/divisionSubject/recPage";

//分账任务管理
//列表  查询 新增 删除
export const API_URL_DIVISIONTASK = "/api/divisionTask";

/** 交易分账 结束 **/

/** 上传图片/文件地址 **/
export const upload = {
  avatar: request.baseUrl + "/api/ossFiles/avatar",
  cert: request.baseUrl + "/api/ossFiles/cert",
  applyment: request.baseUrl + "/api/ossFiles/applyment",
};

const api = {
  user: "/user",
  role_list: "/role",
  service: "/service",
  permission: "/permission",
  permissionNoPager: "/permission/no-pager",
  orgTree: "/org/tree",
};

export default api;

/** 导出文件地址 **/
export const exportExcelUrl = {
  payOrder: "/api/payOrder/exportExcel",
  settleOrder: "/api/settle/exportExcel",
  refundOrder: "/api/refundOrder/exportExcel",
  transferOrder: "/api/transferOrders/exportExcel",
  statistic: "/api/statistic/export",
  memberInfo: "/api/member/exportExcel",
};

/** 获取权限树状结构图 **/
export function $getEntTree() {
  return request.request({ url: "/api/sysEnts/showTree", method: "GET" });
}

/** 更新用户角色信息 */
export function $uSysUserRoleRela(sysUserId, roleIdList) {
  return request.request({
    url: "api/sysUserRoleRelas/relas/" + sysUserId,
    method: "POST",
    data: { roleIdListStr: JSON.stringify(roleIdList) },
  });
}

export function $getRoleList(parameter) {
  return request({
    url: "/api/sysRoles",
    method: "get",
    params: parameter,
  });
}

/** 支付体验配置 **/
export function $payTest(appId) {
  return request.request({
    url: "api/paytest/payways/" + appId,
    method: "GET",
  });
}

/** 支付体验下单配置 **/
export function $payTestOrder(parameter) {
  return request.request({
    url: "/api/paytest/payOrders",
    method: "POST",
    data: parameter,
  });
}

/** 创建支付收银台地址 **/
export function $payTestCreateCashier(parameter) {
  return request.request({
    url: "/api/paytest/createCashier",
    method: "POST",
    data: parameter,
  });
}

export function $getPayAmountWeek() {
  return request.request({
    url: API_URL_MAIN_STATISTIC + "/payAmountWeek",
    method: "GET",
  });
}

export function $getNumCount(data) {
  return request.request({
    url: API_URL_MAIN_STATISTIC + "/payDayCount",
    method: "GET",
    params: data,
  });
}

export function $getPayCount(parameter) {
  return request.request({
    url: API_URL_MAIN_STATISTIC + "/payCount",
    method: "GET",
    params: { queryDateRange: parameter },
  });
}

export function $getPayType(parameter) {
  return request.request({
    url: API_URL_MAIN_STATISTIC + "/payTypeCount",
    method: "GET",
    params: { queryDateRange: parameter },
  });
}

export function $getMainUserInfo() {
  return request.request({
    url: API_URL_MAIN_STATISTIC,
    method: "GET",
  });
}

export function $updateUserPass(parameter) {
  return request.request({
    url: "/api/current/modifyPwd",
    method: "put",
    data: parameter,
  });
}

export function $getPayTrendCount(date) {
  return request.request({
    url: API_URL_MAIN_STATISTIC + "/payTrendCount",
    method: "GET",
    params: { recentDay: date },
  });
}

export function $updateUserInfo(parameter) {
  return request.request({
    url: "/api/current/user",
    method: "put",
    data: parameter,
  });
}

export function $getUserInfo() {
  return request.request({
    url: "/api/current/user",
    method: "get",
  });
}

/** MFA认证信息 **/
export function $getMFAInfo() {
  return request.request({
    url: "/api/current/mfaInfo",
    method: "get",
  });
}

/** MFA认证绑定 **/
export function $mfaBind(parameter) {
  return request.request({
    url: "/api/current/mfaBind",
    method: "put",
    data: parameter,
  });
}

/** MFA认证解绑 **/
export function $mfaRelieve(parameter) {
  return request.request({
    url: "/api/current/mfaRelieve",
    method: "put",
    data: parameter,
  });
}

export function $getPasswordRules() {
  return request.request({
    url: "/api/anon/cipher/pwdRulesRegexp",
    method: "get",
  });
}

/** 获取到webSocket的前缀 （ws://localhost） **/
export function $getWebSocketPrefix() {
  // 获取网站域名 +  端口号
  let domain = document.location.protocol + "//" + document.location.host;

  // 判断api_base_url 是否设置
  if (
    process.env.VUE_APP_API_BASE_URL &&
    process.env.VUE_APP_API_BASE_URL !== "/"
  ) {
    domain = process.env.VUE_APP_API_BASE_URL;
  }

  if (domain.startsWith("https:")) {
    return "wss://" + domain.replace("https://", "");
  } else {
    return "ws://" + domain.replace("http://", "");
  }
}

/** 查询支付宝授权地址URL **/
export function $queryAlipayIsvsubMchAuthUrl(mchAppId) {
  return request.request({
    url: "/api/mch/payConfigs/alipayIsvsubMchAuthUrls/" + mchAppId,
    method: "GET",
  });
}

/** 查询商户转账支出的接口 **/
export function $queryMchTransferIfCode(appId) {
  return request.request({
    url: "api/mchTransfers/ifCodes/" + appId,
    method: "GET",
  });
}

/** 获取渠道用户ID二维码地址 **/
export function $getChannelUserQrImgUrl(ifCode, appId, extParam) {
  return request.request({
    url: "/api/mchTransfers/channelUserId",
    method: "GET",
    params: { ifCode, appId, extParam },
  });
}

/** 转账 **/
export function $doTransfer(parameter) {
  return request.request(
    {
      url: "/api/mchTransfers/doTransfer",
      method: "POST",
      data: parameter,
    },
    true,
    true,
    true
  );
}

/** 查询当前应用支持的支付接口 **/
export function $getIfCodeByAppId(appId) {
  return request.request(
    {
      url: "/api/mch/payConfigs/ifCodes/" + appId,
      method: "GET",
    },
    true,
    true,
    true
  );
}

/** 退款接口 */
export function $payOrderRefund(
  payOrderId,
  refundAmount,
  refundReason,
  refundPassword,
  refundModel
) {
  return request.request({
    url: "/api/payOrder/refunds/" + payOrderId,
    method: "POST",
    data: {
      refundAmount,
      refundReason,
      refundPassword: Base64.encode(refundPassword),
      refundModel,
    },
  });
}

/** 获取公众号授权信息接口 */
export function $getWxmpInfo() {
  return request.request({
    url: "/api/wxmp/getWxmpInfo",
    method: "GET",
  });
}

/** 测试云喇叭播报接口 */
export function $speakTest(deviceId, amount) {
  return request.request({
    url: "/api/store/device/speak/" + deviceId,
    method: "POST",
    data: { amount },
  });
}

/** 测试云打印接口 */
export function $printTest(deviceId, amount) {
  return request.request({
    url: "/api/store/device/print/" + deviceId,
    method: "POST",
    data: { amount },
  });
}

/** 清空打印队列接口 */
export function $clearPrint(deviceId) {
  return request.request({
    url: "/api/store/device/clear/" + deviceId,
    method: "POST",
  });
}

/* 查询进件接口的最新状态 */
export function $getMchApplymentChannelState(applyId) {
  return request.request({
    url: "/api/mchApplyments/channelState/" + applyId,
    method: "get",
  });
}

/* 获取合并的进件信息（智能读取） [兼容全部系统的数据， mchNo无需传入api ]  */
export function $getMergeApplyDetailInfos(
  mchNo,
  fixApplyId,
  currentPageIfCode
) {
  return request.request({
    url: "/api/mchApplyments/mergeApplyDetailInfos/",
    method: "get",
    params: { fixApplyId, currentPageIfCode },
  });
}

/* 二维码下载 */
export function $qrcShellViewByQrc(qrcId) {
  return request.request({
    url: "/api/mchQrcShells/viewByQrc/" + qrcId,
    method: "get",
  });
}

/** 绑定码牌 */
export function $bindQrc(recordId, bindObject) {
  return request.request({
    url: "/api/mchQrCodes/bind/" + recordId,
    data: bindObject,
    method: "PUT",
  });
}

/** 解绑码牌 */
export function $unbindQrc(recordId) {
  return request.request({
    url: "/api/mchQrCodes/unbind/" + recordId,
    method: "POST",
  });
}

/** 码牌受支持设备列表 */
export function $bindDeviceList(recordId, params) {
  return request.request({
    url: "/api/mchQrCodes/bindDevice/" + recordId,
    data: params,
    method: "GET",
  });
}

/** 绑定空码 */
export function $bindEmptyQr(params) {
  return request.request({
    url: "/api/mchQrCodes/bindEmptyQR",
    data: params,
    method: "POST",
  });
}

/* 获取请求参数 */
export function $getUploadFormParams(file, bizType) {
  return request.request({
    url: "/api/ossFiles/form",
    method: "post",
    data: {
      bizType: bizType,
      sourceFileName: file.name,
      sourceFileSize: file.size,
    },
  });
}

/* orc识别 */
export function $orcScan(imgUrl, type) {
  return request.request({
    url: "/api/imgInfo/detail/",
    method: "post",
    data: { imgUrl, type },
  });
}

/** 导出功能 **/
export function $exportExcel(url, params) {
  return request.exportExcel(url, params);
}

/* 支付订单数据统计 */
export function $payOrderCount(parameter) {
  return request.request({
    url: "/api/payOrder/count",
    method: "get",
    params: parameter,
  });
}

/* 退款订单数据统计 */
export function $refundOrderCount(parameter) {
  return request.request({
    url: "/api/refundOrder/count",
    method: "get",
    params: parameter,
  });
}

/** 分账重试 */
export function $resendDivision(recordIds, isResendAndRecalAmount) {
  return request.request({
    url: "/api/division/records/resend",
    method: "POST",
    data: { recordIds, isResendAndRecalAmount },
  });
}

// 更新商户级别
export function $updateMchLevel(mchLevel) {
  return request.request({
    url: "/api/mchConfig/mchLevel",
    method: "PUT",
    data: { mchLevel },
  });
}

// 更新支付密码
export function $updateMchSipw(originalPwd, confirmPwd) {
  return request.request({
    url: "/api/mchConfig/mchSipw",
    method: "PUT",
    data: {
      originalPwd: Base64.encode(originalPwd),
      confirmPwd: Base64.encode(confirmPwd),
    },
  });
}

/** 查询网站配置信息 */
export function $getSiteInfos() {
  return request.request({
    url: "/api/anon/siteInfos",
    method: "GET",
    params: { queryConfig: 1 },
  });
}

/** 预先检查 */
export function $applyPreCheck(mchNo, ifCode, isvNo) {
  return request.request({
    url: "/api/mchApplyments/applyPreCheck/" + ifCode,
    method: "GET",
    params: { isvNo: isvNo },
  });
}

/** 查询地图配置 */
export function $getMapConfig() {
  return request.request({
    url: "/api/mchStore/mapConfig",
    method: "get",
  });
}

/* 查询合同信息 */
export function $getMchApplymentChannelSignInfo(applyId) {
  return request.request({
    url: "/api/mchApplyments/channelSignInfo/" + applyId,
    method: "get",
  });
}

/* 合同信息(重签等) */
export function $getMchApplyReSign(applyId, extSignInfo) {
  return request.request({
    url: "/api/mchApplyments/channelSignInfo/" + applyId,
    method: "get",
    params: { extSignInfo },
  });
}

/* 开户意愿查询微信 */
export function $getMchApplymentWxOpenInfo(applyId) {
  return request.request({
    url: "/api/mchApplyments/channelWxOpenInfo/" + applyId,
    method: "get",
  });
}

/* 开户意愿查询 支付宝*/
export function $getMchApplymentAlipayOpenInfo(applyId) {
  return request.request({
    url: "/api/mchApplyments/channelAlipayOpenInfo/" + applyId,
    method: "get",
  });
}

/** 费率配置： 获取全部接口 */
export function $getRateConfigIfcodes(infoId, configMode, ifName) {
  return request.request({
    url: "/api/rateConfig/ifCodes",
    params: { infoId, configMode, ifName },
    method: "GET",
  });
}

/* 检查设备是否允许绑定 */
export function $checkDevice(deviceNo, deviceType) {
  return request.request({
    url: "/api/store/device/check/" + deviceNo,
    data: { deviceType },
    method: "post",
  });
}

/** 解绑设备 */
export function $unbindDevice(recordId) {
  return request.request({
    url: "/api/store/device/unbind/" + recordId,
    method: "POST",
  });
}

// -- 支付接口参数 & 费率配置组件 接口 --

/** 费率配置： 获取全部接口 */
export function $getPayConfigIfcodes(infoId, configMode, ifName) {
  return request.request({
    url: "/api/payConfig/ifCodes",
    params: { infoId, configMode, ifName },
    method: "GET",
  });
}

/**查询商户应用支付参数、费率是否配置 */
export function $getMchPayParamsExist(infoId, ifCode) {
  return request.request({
    url: "/api/payConfig/existPayParams/" + infoId + "/" + ifCode,
    method: "get",
  });
}

/**查询某一进件记录下，商户应用支付通道是否已配置 */
export function $getMchPayPassageExist(applyId, appId) {
  return request.request({
    url: "/api/mch/payPassages/exist/" + applyId + "/" + appId,
    method: "get",
  });
}

/** 进件成功，一键配置应用支付信息 */
export function $autoConfigMchPayInfo(applyId, appId, data) {
  return request.request({
    url: "/api/mch/payPassages/applyment/" + applyId + "/" + appId,
    method: "post",
    data: data,
  });
}

/**查询已经配置的参数  */
export function $getInterfaceSavedConfigs(
  infoId,
  ifCode,
  configMode,
  qcreals = 0
) {
  return request.request({
    url: "/api/payConfig/interfaceSavedConfigs",
    method: "get",
    params: { infoId, ifCode, configMode },
  });
}

/**更新支付参数配置的参数  */
export function $saveInterfaceParams(data) {
  return request.request({
    url: "/api/payConfig/interfaceParams",
    method: "post",
    data: data,
  });
}

/** 费率配置：获取 支付方式 */
export function $getRateConfigPayways(
  infoId,
  configMode,
  ifCode,
  range = 0,
  mccCode = "",
  isvNo = "",
  appId = ""
) {
  return request.request({
    url: "/api/rateConfig/payways",
    params: { infoId, configMode, ifCode, range, mccCode, isvNo, appId },
    method: "GET",
  });
}

/** 费率配置：获取 支付方式 */
export function $getRateConfigSavedMapData(
  infoId,
  configMode,
  ifCode,
  range = 0,
  mccCode = "",
  isvNo = "",
  appId = ""
) {
  return request.request({
    url: "/api/rateConfig/savedMapData",
    params: { infoId, configMode, ifCode, range, mccCode, isvNo, appId },
    method: "GET",
  });
}

/** 费率配置： 保存 */
export function $saveRateConfig(reqData) {
  return request.request({
    url: "/api/rateConfig",
    data: reqData,
    method: "POST",
  });
}

// 隐私政策与服务协议
export function $getTreaty() {
  return request.request({
    url: "/api/anon/treaty",
    method: "GET",
  });
}

/** 商户支付通道配置 （ 左侧列表  ）  **/
// export const API_URL_MCH_PAYPASSAGE_LIST = '/api/mch/payPassages'

/** 商户通道选中： 右侧列表 */
export function $getAvailablePayInterfaceList(mchNo, wayCode) {
  return request.request({
    url: "/api/mch/payPassages/availablePayInterface/" + mchNo + "/" + wayCode,
    method: "GET",
  });
}

/** 更新商户的通道状态 */
export function $updateMchPassageState(appId, wayCode, ifCode, state) {
  return request.request({
    url: "/api/mch/payPassages/mchPassage",
    method: "POST",
    params: { appId, wayCode, ifCode, state },
  });
}

/** 收付通进件  动态获取银行支行列表 */
export function $bankBranchList(mchNo, ifCode, params, isvNo = "") {
  return request.request({
    url: "/api/mchApplyments/bankList/" + mchNo + "/" + ifCode + "/" + isvNo,
    params: params,
    method: "GET",
  });
}

// -- 支付接口参数 & 费率配置组件 接口 --

/** 更新默认设备 */
export function $updateMchTermDefault(trmId, defaultFlag) {
  return request.request({
    url: "/api/mchTerminals/trmDefaults",
    data: { trmId, defaultFlag },
    method: "PUT",
  });
}

/** 报备信息集合 */
export function $getMchTermChannelBindInfos(trmId) {
  return request.request({
    url: "/api/mchTerminals/channelBindInfos/" + trmId,
    method: "GET",
  });
}

/** 接口报备 */
export function $mchTermChannelSendup(trmId, ifCode, state) {
  return request.request({
    url: "/api/mchTerminals/channelSendup/" + trmId,
    data: { ifCode, state },
    method: "POST",
  });
}

/** 更新信息 */
export function $updMchTermChannelBindInfos(trmId, data) {
  return request.request({
    url: "/api/mchTerminals/channelBindInfos/" + trmId,
    data: data,
    method: "POST",
  });
}

/* 分账： 账户余额查询 */
export function $divisionReceiverBalance(recordId) {
  return request.request({
    url: "/api/divisionReceivers/channelBalances/" + recordId,
    method: "get",
  });
}

/* 分账： 账户余额提现 */
export function $divisionReceiverCashout(recordId, cashoutAmount) {
  return request.request({
    url: "/api/divisionReceivers/channelCashout/" + recordId,
    data: { cashoutAmount },
    method: "POST",
  });
}

/* 富友电子协议生成 */
export function $elecContractGenerate(applyId) {
  return request.request({
    url: "/api/mchApplyments/elecContractGenerate/" + applyId,
    method: "post",
  });
}

/* 富友电子协议签署 */
export function $elecContractSign(applyId) {
  return request.request({
    url: "/api/mchApplyments/elecContractSign/" + applyId,
    method: "post",
  });
}

/* 富友  上传图片 */
export function $fuiouUpload(applyId) {
  return request.request({
    url: "/api/mchApplyments/fuiouUpload/" + applyId,
    method: "post",
  });
}

/* 富友  提交审核 */
export function $fuiouConfirm(applyId) {
  return request.request({
    url: "/api/mchApplyments/fuiouConfirm/" + applyId,
    method: "post",
  });
}

/* 富友微信参数配置 */
export function $fuiouWxSet(applyId, data) {
  return request.request({
    url: "/api/mchApplyments/fuiouWxConfigSet/" + applyId,
    method: "post",
    data: data,
  });
}

/* 富友微信参数查询 */
export function $fuiouWxGet(applyId) {
  return request.request({
    url: "/api/mchApplyments/fuiouWxConfigGet/" + applyId,
    method: "post",
  });
}

/* 应用： 查询系统公钥 */
export function $getSysRSA2PublicKey() {
  return request.request({
    url: "/api/mchApps/sysRSA2PublicKey",
    method: "GET",
  });
}

/** 解除登录限制 **/
export function $deleteLoginLimit(recordId) {
  return request.request({
    url: "/api/sysUsers/loginLimit/" + recordId,
    method: "delete",
  });
}

/* 斗拱微信参数配置 */
export function $dgWxSet(applyId, data) {
  return request.request({
    url: "/api/mchApplyments/dgWxConfigSet/" + applyId,
    method: "post",
    data: data,
  });
}

/* 斗拱微信实名认证 */
export function $dgpayWxRealName(applyId, reqParams) {
  return request.request({
    url: "/api/mchApplyments/dgpayWxRealName/" + applyId,
    data: reqParams,
    method: "post",
  });
}

/* 斗拱分账配置 */
export function $dgpayConfigOpen(applyId, reqParams) {
  return request.request({
    url: "/api/mchApplyments/dgpayConfigOpen/" + applyId,
    data: reqParams,
    method: "post",
  });
}

/* 斗拱分账配置查询 */
export function $dgpayConfigOpenQuery(applyId) {
  return request.request({
    url: "/api/mchApplyments/dgpayConfigOpenQuery/" + applyId,
    method: "get",
  });
}

/* 获取终端记过参数 */
export function $sqbActivationConfig(reqParams) {
  return request.request({
    url: "/api/mchConfig/activation",
    data: reqParams,
    method: "post",
  });
}

/* 快钱 发起合同签约 */
export function $kqSignApply(applyId, params) {
  return request.request({
    url: "/api/mchApplyments/kqSignApply/" + applyId,
    data: params,
    method: "post",
  });
}

/* 银盛  上传图片 */
export function $yspayUpload(applyId, reqParams) {
  return request.request({
    url: "/api/mchApplyments/yspayUpload/" + applyId,
    data: reqParams,
    method: "post",
  });
}

/* 银盛  资料确认 */
export function $yspayConfirm(applyId, reqParams) {
  return request.request({
    url: "/api/mchApplyments/yspayConfirm/" + applyId,
    data: reqParams,
    method: "post",
  });
}

/* 银盛  签约通知重发 */
export function $ysSignSendAgain(applyId) {
  return request.request({
    url: "/api/mchApplyments/ysSignSendAgain/" + applyId,
    method: "post",
  });
}

/* 银盛  发起合同签约 */
export function $ysSignApply(applyId, params) {
  return request.request({
    url: "/api/mchApplyments/ysSignApply/" + applyId,
    method: "post",
    data: params,
  });
}

/* 银盛  签约结果查询 */
export function $ysSignQuery(applyId) {
  return request.request({
    url: "/api/mchApplyments/ysSignQuery/" + applyId,
    method: "post",
  });
}

/* 拉卡拉saas支行列表 */
export function $lklGetBankList(areaCode, branchName: string) {
  return request.request({
    url: "/api/mchApplyments/getLklBankList/" + areaCode + "/" + branchName,
    method: "get",
  });
}

/** 应用私钥查询 */
export function $mchAppSecret(payPassword, appId) {
  return request.request({
    url: "/api/mchApps/secret",
    method: "POST",
    data: { appId: appId, payPassword: Base64.encode(payPassword) },
  });
}

/* 瑞银信获取银行开户支行信息列表 */
export function $ruipayGetBankList(ifCode, headBankNo, mchNo, queryData) {
  return request.request({
    url: "/api/mchApplyments/bankCode/" + ifCode,
    method: "get",
    params: { headBankNo, mchNo, queryData },
  });
}
export function $isSipw() {
  return request.request({
    url: "/api/mchConfig/hasSipwValidate",
    method: "get",
  });
}

/* 星驿付获取银行开户支行信息列表 */
export function $terpayGetBankList(ifCode, queryBankData) {
  return request.request({
    url: "/api/mchApplyments/bankCode/" + ifCode,
    method: "get",
    params: queryBankData,
  });
}

/* 星驿付发送短信验证码 */
export function $terpayAnSignMsg(
  ifCode,
  mchNo,
  applyId,
  terpayApplymjsonStrentInfo
) {
  return request.request({
    url: "/api/mchApplyments/iApplyRes/sendPubRequst/" + ifCode,
    method: "post",
    data: {
      mchNo,
      applyId,
      jsonStr: JSON.stringify(terpayApplymjsonStrentInfo),
    },
  });
}

/* 获取请求参数 */
export function $applymentAppConfig(applyId, mchAppId) {
  return request.request({
    url: "/api/mchApplyments/appConfig/" + applyId + "/" + mchAppId,
    method: "post",
  });
}

/* 查询接口配置参数 */
export function $queryInterfaceConfig(
  applyId,
  applyIdConvertMchAppId,
  convertMchAppIfCode
) {
  return request.request({
    url: "/api/mchApplyments/interfaceConfig/" + applyId,
    method: "get",
  });
}

/* 配置 */
export function $configInterfaceConfig(
  applyId,
  mchAppId,
  configType,
  configVal,
  appConfigModeAndIfCode
) {
  return request.request({
    url: "/api/mchApplyments/interfaceConfig/" + applyId + "/" + mchAppId,
    method: "post",
    data: { configType, configVal },
  });
}

/* 乐刷业务开通 */
export function $leshuapayConfigOpen(applyId, reqParams) {
  return request.request({
    url: "/api/mchApplyments/leshuapayConfigOpen/" + applyId,
    data: reqParams,
    method: "post",
  });
}

/* 获取请求参数 */
export function $lklApplymentAppConfig(applyId, mchAppId, reqParams) {
  return request.request({
    url: "/api/mchApplyments/lklAppConfig/" + applyId + "/" + mchAppId,
    data: reqParams,
    method: "post",
  });
}

/* 银联前置  新增支付类型 */
export function $payConfAdd(applyId, reqParams) {
  return request.request({
    url: "/api/mchApplyments/payConf/" + applyId,
    data: reqParams,
    method: "post",
  });
}

/* 银联前置  查询第三方交易识别码 */
export function $getMchPartner(applyId, mchAppId, appConfigModeAndIfCode) {
  return request.request({
    url: "/api/mchApplyments/mchPartner/" + applyId + "/" + mchAppId,
    method: "post",
    data: { appConfigModeAndIfCode },
  });
}

/* 银盛  新增支付类型 */
export function $ysPayRateConfig(applyId, reqParams) {
  return request.request({
    url: "/api/mchApplyments/ysPayRateConfig/" + applyId,
    data: reqParams,
    method: "post",
  });
}

/**查询已经配置的oauth2参数 */
export function $getOauth2SavedConfigs(infoId, ifCode, configMode) {
  return request.request({
    url: "/api/payOauth2Config/savedConfigs",
    method: "get",
    params: { infoId, ifCode, configMode },
  });
}

/**更新oauth2配置的参数 */
export function $saveOauth2ConfigParams(data) {
  return request.request({
    url: "/api/payOauth2Config/configParams",
    method: "post",
    data: data,
  });
}

/** 查询出diy列表  */
export function $getOauth2DiyList(infoId, configMode) {
  return request.request({
    url: "/api/payOauth2Config/diyList",
    method: "get",
    params: { infoId, configMode },
  });
}

/** 新增 diy列表  */
export function $addOauth2DiyList(
  infoId,
  configMode,
  remark,
  copySourceInfoId
) {
  return request.request({
    url: "/api/payOauth2Config/diyList",
    method: "POST",
    data: { infoId, configMode, remark },
  });
}

/** 获取App下载链接*/
export function $getAppDownloadUrl() {
  return request.request({
    url: "/api/anon/clientVersion/downloadUrl",
    method: "GET",
  });
}

/** 批量删除广告 */
export function $batchDelAdvert(advertIds) {
  return request.request({
    url: "/api/advert",
    data: { delAdvertIds: advertIds },
    method: "DELETE",
  });
}

/* 银盛微信配置 */
export function $yspayConfigInterfaceConfig(
  applyId,
  mchAppId,
  configType,
  configVal
) {
  return request.request({
    url: "/api/mchApplyments/yspayInterfaceConfig/" + applyId + "/" + mchAppId,
    method: "post",
    data: { configType, configVal },
  });
}

/** 支付宝安全发授权 **/
export function $alipayAgreementPageSign(mchAppId) {
  return request.request({
    url: "/api/mch/payConfigs/alipayAgreementPageSign/" + mchAppId,
    method: "GET",
  });
}

/** 查询支付宝安全发授权结果 **/
export function $queryUserAgreementPageSign(mchAppId) {
  return request.request({
    url: "/api/mch/payConfigs/queryUserAgreementPageSign/" + mchAppId,
    method: "GET",
  });
}

/** 查询支付宝安全发记账本详情 **/
export function $fundAccountbookQuery(mchAppId) {
  return request.request({
    url: "/api/mch/payConfigs/fundAccountbookQuery/" + mchAppId,
    method: "GET",
  });
}

/** 资金转账页 **/
export function $fundTransPage(mchAppId, transAmount) {
  return request.request({
    url: "/api/mch/payConfigs/fundTransPage/" + mchAppId,
    method: "post",
    data: { transAmount },
  });
}

/** 会员手动调账 **/
export function $memberChangeBalancePage(recordId, realReqObject) {
  return request.request({
    url: "/api/member/manual/" + recordId,
    method: "post",
    data: realReqObject,
  });
}

/* 会员充值记录数据统计 */
export function $rechargeRecordCount(parameter) {
  return request.request({
    url: "/api/member/rechargeRecord/count",
    method: "get",
    params: parameter,
  });
}

/* 会员账户流水数据统计 */
export function $memberAccountHistoryCount(parameter) {
  return request.request({
    url: "/api/member/accountHistory/count",
    method: "get",
    params: parameter,
  });
}

/* 转账订单数据统计 */
export function $transferOrdersCount(parameter) {
  return request.request({
    url: "/api/transferOrders/count",
    method: "get",
    params: parameter,
  });
}

/* 会员数据统计 */
export function $memberInfoCount(parameter) {
  return request.request({
    url: "/api/member/count",
    method: "get",
    params: parameter,
  });
}

/* 进件api */
export function $applymentNextBiz(applyId, parameter) {
  return request.request({
    url: "/api/mchApplyments/applymentNextBiz/" + applyId,
    method: "post",
    data: parameter,
  });
}

/** 服务商渠道参数配置*/
export function $getIsvChannelConfig(mchNo, ifCode, isvNo) {
  return request.request({
    url:
      "/api/mchApplyments/getIsvChannelConfig/" +
      mchNo +
      "/" +
      ifCode +
      "/" +
      isvNo,
    method: "GET",
  });
}

/* 河马付后续流程 */
export function $hmpayAfterOperate(
  ifCode,
  mchNo,
  applyId,
  operationType,
  hmApplyData
) {
  return request.request({
    url: "/api/mchApplyments/iApplyRes/sendPubRequst/" + ifCode,
    method: "post",
    data: {
      mchNo: mchNo,
      applyId: applyId,
      operationType: operationType,
      jsonStr: JSON.stringify(hmApplyData),
    },
  });
}

/* 门店入驻申请 */
export function $applymentStore(storeId, state, applyId, params) {
  return request.request({
    url:
      "/api/mchApplyments/storeApplyment/" +
      storeId +
      "/" +
      state +
      "/" +
      applyId,
    method: "post",
    data: { applyId, state, storeId, params },
  });
}

/* 河马查询商户门店信息 */
export function $hmpayQueryStoreInfo(applyId) {
  return request.request({
    url: "/api/mchApplyments/storeApplyment/" + applyId,
    method: "get",
  });
}

/** 支付宝直付通商户作废接口 */
export function $zftMchDelete(appId, smId) {
  return request.request({
    url: API_URL_MCH_APPLYMENT_LIST + "/zftMchDelete/" + appId + "/" + smId,
    method: "POST",
  });
}

/** 代理商配置 */
export function $getAgentConfig(configKey) {
  return request.request({
    url: API_URL_AGENT_CONFIG + "/" + configKey,
    method: "GET",
  });
}

/** 商户参数配置开始  */
//添加
export function $addMchOauth2Config(data) {
  return request.request({
    url: "/api/mchApplyments/addConfig",
    method: "POST",
    data: data,
  });
}

export function $getMchOauth2Config(mchNo) {
  return request.request({
    url: "api/mchApplyments/getConfig?mchNo=" + mchNo,
    method: "GET",
  });
}

//更新订单
export function $getPayOrderRefresh(ordeSn) {
  return request.request({
    url: "api/payOrder/refresh/" + ordeSn,
    method: "POST",
  });
}
/** 商户参数配置结束  */

//商户进件信息变更回显
export function $getMerchantInformation(mchApplyId, modifyApplyType) {
  return request.request({
    url:
      "/api/mchApplyments/modifyApplyment?mchApplyId=" +
      mchApplyId +
      "&modifyApplyType=" +
      modifyApplyType,
    method: "GET",
  });
}

//商户进件信息详情变更回显
export function $getMerchantChangeModifyApply(data) {
  return request.request({
    url: "/api/mchApplyments/modifyApplyment?" + data,
    method: "GET",
  });
}
//商户进件信息变更
export function $getMchIncomingRefresh($data) {
  return request.request({
    url: "/api/mchApplyments/modifyApplyment",
    method: "POST",
    data: $data,
  });
}

/*  渠道支付配置接口 */
//查询通道参数配置实例
export function $getPayConfigAlternativeList(infoId, configMode, ifName) {
  return request.request({
    url: "/api/payConfig/configAlternativeList",
    params: { infoId, configMode, ifName },
    method: "GET",
  });
}
//渠道下指定通道参数配置
export function $getPayConfigChosenConfigAlternative(data) {
  return request.request({
    url: "/api/payConfig/chosenConfigAlternative",
    method: "post",
    data: data,
  });
}
//保存通道参数配置实例
export function $getPaySaveConfigAlternative(data) {
  return request.request({
    url: "/api/payConfig/saveConfigAlternative",
    method: "post",
    data: data,
  });
}

//资金总览-预警设置
export function $getPayAccountWarnRule(data) {
  return request.request({
    url: "/api/account/warnRule",
    method: "post",
    data: data,
  });
}
//设置默认isv
export function $getMchInfoIsv(data) {
  return request.request({
    url: "/api/mchInfo/defIsv",
    method: "post",
    data,
  });
}

//新增关联渠道
export function $getIsvInfoConn(data) {
  return request.request({
    url: "/api/isvInfo/isvConn",
    method: "post",
    data: data,
  });
}

//顾客统计
export function $redUserInfoCount(parameter) {
  return request.request({
    url: "/api/redPacketUser/count",
    method: "get",
    params: parameter,
  });
}

//修改下级自动绑定状态
export function $getMchAutoBindIsvConn(data) {
  return request.request({
    url: "/api/isvInfo/autoBindIsvConn",
    method: "post",
    data,
  });
}

//绑定查询码牌是否支持绑定
export function $checkQrCodeBind(data) {
  return request.request({
    url: "/api/mchQrCodes/checkQrCodeBind",
    method: "post",
    data,
  });
}
//查询码牌是否支持绑定
export function $checkQrCodeBindId(qrcId) {
  return request.request({
    url: "/api/mchQrCodes/checkQrCodeBind/" + qrcId,
    method: "get",
  });
}

//进件获取结算类型
export function $getSettType(yspay, infoId) {
  return request.request({
    url: "/api/isvInfo/getSettType?ifCode=" + yspay + "&infoId=" + infoId,
    method: "get",
  });
}

/* 结算订单数据统计 */
export function $settleOrderCount(parameter) {
  return request.request({
    url: "/api/settle/count",
    method: "get",
    params: parameter,
  });
}

//同步结算状态
export function $getSettTypeSync(Id) {
  return request.request({
    url: "/api/settle/sync/" + Id,
    method: "get",
  });
}

/* 验证一般户退款 */
export function $getPayOrderRefundsIsPlatCheck(payOrderId) {
  return request.request({
    url: "/api/payOrder/refunds/limit/" + payOrderId,
    method: "get",
  });
}
//退款账号申请
export function $getPayOrderRefundsApply(recordId) {
  return request.request({
    url: "/api/payOrder/refunds/apply/" + recordId,
    method: "post",
  });
}
//配置列表
export function $getMchConfigConfig(data) {
  return request.request({
    url: "api/mchConfig/config",
    method: "post",
    data,
  });
}

//进件状态标记
export function $getMchApplymentsState(data) {
  return request.request({
    url: "api/mchApplyments/state",
    method: "post",
    data,
  });
}
//商户反扫开关标记调整
export function $getMchApplymentsScanPayFlag(data) {
  return request.request({
    url: "/api/mchApplyments/scanPayFlag",
    method: "post",
    data,
  });
}

//商户变更状态刷新
export function $getMchApplymentsModifyApplyId(modifyApplyId) {
  return request.request({
    url: "/api/mchModifyApplyment/result/" + modifyApplyId,
    method: "get",
  });
}

//业务变更状态刷新
export function $getMchModifyApplyments(modifyApplyId) {
  return request.request({
    url: "/api/mchModifyApplyment/" + modifyApplyId,
    method: "get",
  });
}

//创建授权任务
export function $getMchSphVideoTask(data) {
  return request.request({
    url: "/api/mchVideo/authTask",
    method: "post",
    data,
  });
}

//查询授权任务状态
export function $getMchSphVideoAuthTask(taskId) {
  return request.request({
    url: "/api/mchVideo/authTask?taskId=" + taskId,
    method: "get",
  });
}

//视频号数据标记
export function $getMchChoiceFlag(id, data) {
  return request.request({
    url: "/api/mchVideo/choiceFlag/" + id,
    method: "post",
    data,
  });
}

/** 视频号数据删除 **/
export function $deleteMchVideo(videoId) {
  return request.request({
    url: "/api/mchVideo/" + videoId,
    method: "delete",
  });
}
//服务商修改渠道关联关系
export function $getMchIsvEditStatus(data) {
  return request.request({
    url: "/api/isvInfo/editStatus",
    method: "post",
    data,
  });
}

//获取分账配置
export function $getMchDivisionTemplateConfig(id) {
  return request.request({
    url: "/api/divisionTemplate/config/" + id,
    method: "get",
  });
}

//商户授权变更
export function $getMchApplymentRefreshAudit($data) {
  return request.request({
    url: "/api/mchApplyments/modifyApplyment",
    method: "POST",
    data: $data,
  });
}
//设置路由配置
export function $getMchRouteSetConfigSave(routeId, data) {
  return request.request({
    url: "/api/mchRoute/setConfig/" + routeId,
    method: "POST",
    data,
  });
}

//获取路由配置详情
export function $getMchRouteConfig(routeId) {
  return request.request({
    url: "/api/mchRoute/getConfig/" + routeId,
    method: "GET",
  });
}

/* 配置 */
export function $getWaitOperationNumber(data = {}) {
  return request.request({
    url: "/api/mainChart/getWaitOperationNumber",
    method: "GET",
    data,
  });
}

//获取交易路由详情
export function $getMchRouteDetail(routeId) {
  return request.request({
    url: "/api/mchRoute/" + routeId,
    method: "GET",
  });
}

/* 获取交易路由详情二维码下载 */
export function $getMchRouteQrcode(routeId) {
  return request.request({
    url: "/api/mchRoute/qrcode/" + routeId,
    method: "get",
  });
}

/**更新代付参数配置的参数 */
export function $getAqfApisignUrl(subId) {
  return request.request({
    url: "/api/aqfApi/signUrl?subId=" + subId,
    method: "GET",
  });
}

/**安全发充值 */
export function $getAqfApiTransPage(subId, transAmount, remark) {
  return request.request({
    url:
      "/api/aqfApi/transPage?subId=" +
      subId +
      "&transAmount=" +
      transAmount +
      "&transferDesc=" +
      remark,
    method: "GET",
  });
}

//记账本查询
export function $getAqfApiAlipayFundAccountbookQuery(transferSubjectId) {
  return request.request({
    url: "/api/transferSubject/refreshBalance",
    method: "POST",
    data: { transferSubjectId: transferSubjectId },
  });
}

//付款账户启用状态审核
export function $getAqfState(data) {
  return request.request({
    url: "/api/aqf/state",
    method: "POST",
    data,
  });
}

/**电子回单申请 */
export function $getAqfApplicationForm(transferId, ersubId) {
  return request.request({
    url:
      "/api/aqfApi/applicationForm?transferId=" +
      transferId +
      "&ersubId=" +
      ersubId,
    method: "GET",
  });
}
export function $getIsvAndMchCount() {
  return request.request({
    url: API_URL_MAIN_STATISTIC + "/isvAndMchCount",
    method: "GET",
  });
}
/**电子回单下载地址获取 */
export function $getAqfApplicationFormDownload(transferId, ersubId) {
  return request.request({
    url:
      "/api/aqfApi/applicationFormDownload?transferId=" +
      transferId +
      "&ersubId=" +
      ersubId,
    method: "GET",
  });
}
//任务审核
export function $applymentTaskListPreAudit(recordId, reqParams) {
  return request.request({
    url: "/api/taskList/" + recordId,
    data: reqParams,
    method: "PUT",
  });
}

//获取路由策略的二维码
export function $getAqfRouteQrcode(routeId) {
  return request.request({
    url: "/api/route/qrcode/" + routeId,
    method: "GET",
  });
}
//商户审核收起
export function $getMchModifyApplymentAudit(data) {
  return request.request({
    url: "/api/mchModifyApplyment/audit",
    method: "post",
    data,
  });
}

/** 分账完结 */
export function $finsihDivision(recordIds) {
  return request.request({
    url: "/api/division/records/finish",
    method: "POST",
    data: { recordIds },
  });
}

///调整代付账户限额
export function $getApiTransferConfigQuota(data) {
  return request.request({
    url: "/api/transferConfig/quota",
    method: "POST",
    data,
  });
}
