import request from '@/http/request'
import $infoBox from '@/utils/infoBox'

/*
 *  全系列restful api格式, 定义通用req对象
 *
 *  @author terrfly
 *  @site https://www.jeepay.vip
 *  @date 2021/5/8 07:18
 */
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_SYS_USER_TEAM_LIST = '/api/userTeams'
export const API_URL_SYS_USER_TEAM_USER_LIST = 'api/userTeams/userList'
export const API_URL_USER_ROLE_RELA_LIST = '/api/sysUserRoleRelas'

/** 服务商、商户管理**/
export const API_URL_ISV_LIST = '/api/isvInfo'
export const API_URL_MCH_LIST = '/api/mchInfo'

/** 代理商 **/
export const API_URL_AGENT_LIST = '/api/agents'
/** 代理商配置 **/
export const API_URL_AGENT_CONFIG = '/api/agentConfig'

/** 商户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_MCH_NOTIFY_LIST = '/api/mchNotify'
/** 系统日志 **/
export const API_URL_SYS_LOG = '/api/sysLog'
/** 设备厂商配置 **/
export const API_URL_DEVICE_PROVIDER = '/api/device/provider'
/** 钱包流水列表 **/
export const API_URL_WALLET_HISTORY_LIST = '/api/accountHistory'
/** 门店设备配置 **/
export const API_URL_STORE_DEVICE = '/api/store/device'
/** 系统配置 **/
export const API_URL_SYS_CONFIG = '/api/sysConfigs'
/** 法定节假日 **/
export const API_URL_SYS_LEGAL_DAY = '/api/sysLegelDay'
/** 首页统计 **/
export const API_URL_MAIN_STATISTIC = '/api/mainChart'

/** 支付接口定义页面 **/
export const API_URL_IFDEFINES_LIST = '/api/payIfDefines'
export const API_URL_PAYWAYS_LIST = '/api/payWays'
/** 商户支付通道配置 **/
export const API_URL_MCH_PAYPASSAGE_LIST = '/api/mch/payPassages'
/** 转账订单管理 **/
export const API_URL_TRANSFER_ORDER_LIST = '/api/transferOrders'

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

/** 版本管理 **/
export const API_URL_CLIENT_VERSION_LIST = '/api/clientVersion'
//订单分账分页新增
export const API_URL_DIVISION_TEMPLATE_ADD = '/api/divisionTemplate'
/** 商户门店管理 **/
export const API_URL_MCH_STORE_LIST = '/api/mchStore'
/** 商户三方账户管理 **/
export const ENT_MCH_CHANNEL_ACCOUNT = '/api/channel/cashouts'
export const API_URL_DIVISION_TEMPLATE_LIST = '/api/divisionTemplate'

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

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

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

/** 分账记录管理 **/
export const API_URL_PAY_ORDER_DIVISION_RECORD_LIST = '/api/division/records'
//订单分账分页修改
export const API_URL_DIVISION_TEMPLATE_EDIT = '/api/divisionTemplate'
/** 分账回退管理 **/
export const API_URL_PAY_ORDER_DIVISION_REFUND_RECORD_LIST = '/api/division/refunds/records'
//新增订单分账配置
export const API_URL_DIVISION_TEMPLATE_SAVE_CONFIG = '/api/divisionTemplate/saveConfig'
/** 账单批次管理 **/
export const API_URL_CHECK_BATCH_LIST = '/api/check/batch'

/** 渠道账单管理 **/
export const API_URL_CHANNEL_BILL_LIST = '/api/channel/bill'

/** 账单差异管理 **/
export const API_URL_CHECK_DIFF_LIST = '/api/check/diff'

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

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

export const API_URL_QRC_SHELL_LIST = '/api/mchQrcShells'

export const API_URL_ISV_RATE_CONFIG = '/api/isvRateConfig'

export const API_URL_CASHOUT_RECORD = '/api/cashouts'


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

export const API_URL_MCH_TERMINAL = '/api/mchTerminals'

/** 统计接口 **/
export const API_URL_STATISTIC = '/api/statistic'
/** 统计任务记录接口 **/
export const API_URL_STATS_RECORD = '/api/stats/record'
/** 公告*/
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_PROVIDER_DEVICE = '/api/provider/device'

/** 直付通结算记录列表 */
export const API_URL_ZFT_SETT_RECORD = '/api/zftSettRecords'


/* 产品管理 product */
export const API_URL_PRODUCT_LIST = '/api/product/getProductList'
export const API_URL_PRODUCT_Add = '/api/product/add'
export const API_URL_PRODUCT_SAVE = '/api/product'
export const API_URL_PRODUCT_ID = '/api/product/getDetailById'

// 产品分类
export const API_URL_PRODUCT_TYPE_LIST = '/api/productType/getList'
export const API_URL_PRODUCT_TYPE_Add = '/api/productType/add'
export const API_URL_PRODUCT_TYPE_SAVE = '/api/productType'
export const API_URL_PRODUCT_TYPE_ID = '/api/productType/getDetailById'


// 产品审核
export const API_URL_PRODUCT_EXAMINE_LIST = '/api/product/getProductCheckList'
export const API_URL_PRODUCT_EXAMINEE_CHECK = '/api/product/checkProduct'


//方案管理 packageInfo
export const API_URL_PACKAGE_LIST = '/api/packageInfo'
export const API_URL_PACKAGE_SAVE = '/api/packageInfo/saveOrUpdate'
export const API_URL_PACKAGE_DETAIL_ID = '/api/packageInfo/getDetailById'

// 方案分类
export const API_URL_PACKAGE_TYPE_LIST = '/api/packageType/getList'
export const API_URL_PACKAGE_TYPE_Add = '/api/packageType/add'
export const API_URL_QUALIFICATIONDEFINE_PAGE = '/api/qualificationDefine/page'
export const API_URL_MCH_APPS = '/api/mchApps'//新增应用
export const API_URL_PACKAGE_TYPE_UPDATE = '/api/packageType/updatePackage'
export const API_URL_PACKAGE_TYPE_DEL = '/api/packageType/deletePackage'

//渠道通道配置
export const API_URL_PAY_CONFIG_ALTERNATIVE_LIST = '/api/payConfig/configAlternativeList'


//商户资质模板信息分页查询
export const API_URL_APTITUDE = '/api/qualificationDefine/page'

//商户资质模板信息保存
export const API_URL_APTITUDE_SAVE = '/api/qualificationDefine/save'
//商户资质模板信息更新
export const API_URL_APTITUDE_update = '/api/qualificationDefine/update'
//获取服务商关联的渠道信息
export const API_URL_ISV_INFO_LIST = '/api/isvInfo/isvInfoList'

//资金明细
export const API_MCH_ACCOUNT_CHANGE_LOG_LIST = '/api/accountChange'
//资金管理
export const API_MCH_ACCOUNT_FUND_LOG_LIST = '/api/accountFund'

//申请单接口
export const API_URL_MCH_MODIFY_APPLYMENT_LIST = '/api/mchModifyApplyment'
//申请单审核接口
export const API_URL_MCH_MODIFY_APPLYMENT_AUDIT = '/api/mchModifyApplyment/audit'

//用户/应用/进件数据关联配置信息获取
export const API_URL_MCH_APP_CONFIG = '/api/mchConfig'
//用户/应用/进件数据关联配置信息
export const API_URL_MCH_APP_CONFIG_API_ENT = '/api/mchConfig'

//视频列表数据
export const API_URL_MCH_VIDEO_DATA_LIST = '/api/mchVideo/dataList'

export const API_MCH_PAY_ACCOUNT = '/api/account'//资金总览 （退款账户，营销账户）


//代付
export const API_URL_PAY_TRANSFERDEFINE_LIST = '/api/transferDefine/definePage'

export const API_URL_PAY_TRANSFERDEFINE_DEL = '/api/transferDefine/define'
export const API_URL_PAY_TRANSFERDEFINE_ADD = '/api/transferDefine/define'



/** 安全发 开始 **/
//代付
//新增
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_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_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',
    ifBG: request.baseUrl + '/api/ossFiles/ifBG',
    cert: request.baseUrl + '/api/ossFiles/cert',
    wxFile: request.baseUrl + '/api/ossFiles/wxFile',
    applyment: request.baseUrl + '/api/ossFiles/applyment',
    wx3rdCheckFile: request.baseUrl + '/api/ossFiles/wx3rdCheckFile' // 解析微信三方校验文件
}
/** 导出文件地址 **/
export const exportExcelUrl = {
    payOrder: '/api/payOrder/exportExcel',
    settleOrder: '/api/settle/exportExcel',
    refundOrder: '/api/refundOrder/exportExcel',
    transferOrder: '/api/transferOrders/exportExcel',
    qrCodes: '/api/mchQrCodes/exportExcel',
    statistic: '/api/statistic/export',
    memberInfo: '/api/member/exportExcel',
    agentCashouts: '/api/cashouts/exportExcel',
}

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

export default api

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

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

/** 更新用户角色信息 */
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 $getServiceList(parameter) {
    return request({
        url: api.service,
        method: 'get',
        params: parameter
    })
}

export function $getPermissions(parameter) {
    return request({
        url: api.permissionNoPager,
        method: 'get',
        params: parameter
    })
}

export function $getTeamUserList(recordId, parameter) {
    return request.request({
        url: API_URL_SYS_USER_TEAM_USER_LIST + '/' + recordId,
        method: 'GET',
        params: parameter
    })
}

export function $getOrgTree(parameter) {
    return request({
        url: api.orgTree,
        method: 'get',
        params: parameter
    })
}

// id == 0 add     post
// id != 0 update  put
export function $saveService(parameter) {
    return request({
        url: api.service,
        method: parameter.id === 0 ? 'post' : 'put',
        data: parameter
    })
}

export function $saveSub(sub) {
    return request({
        url: '/sub',
        method: sub.id === 0 ? 'post' : 'put',
        data: sub
    })
}

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

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

export function $getIsvAndMchCount() {
    return request.request({
        url: API_URL_MAIN_STATISTIC + '/isvAndMchCount',
        method: 'GET'
    })
}

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(parameter = {}) {
    return request.request({
        url: API_URL_MAIN_STATISTIC + '/' + parameter,
        method: 'GET'
    })
}

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

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
    })
}
//获取分账配置
export function $getMchDivisionTemplateConfig(id) {
    return request.request({
        url: '/api/divisionTemplate/config/' + id,
        method: 'get',
    })
}
/** MFA认证解绑 **/
export function $mfaRelieve(parameter) {
    return request.request({
        url: '/api/current/mfaRelieve',
        method: 'put',
        data: parameter
    })
}

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

export function $getConfigs(parameter) {
    return request.request({
        url: API_URL_SYS_CONFIG + '/' + parameter,
        method: 'GET'
    })
}

export function $getEntBySysType(entId, sysType) {
    return request.request({
        url: '/api/sysEnts/bySysType',
        method: 'GET',
        params: { entId: entId, sysType: sysType }
    })
}

export function $mchNotifyResend(notifyId) {
    return request.request({
        url: '/api/mchNotify/resend/' + notifyId,
        method: 'POST'
    })
}

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

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

/** 获取到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://', '')
    }
}

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

/* 查询进件接口的最新状态*/
export function $getMchApplymentChannelState(applyId) {
    return request.request({
        url: '/api/mchApplyments/channelState/' + applyId,
        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 $getMergeApplyDetailInfos(mchNo, fixApplyId, currentPageIfCode) {
    return request.request({
        url: '/api/mchApplyments/mergeApplyDetailInfos/' + mchNo,
        method: 'get',
        params: { fixApplyId, currentPageIfCode }
    })
}


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

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


/* 获取请求参数 */
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',
        params: { applyIdConvertMchAppId, convertMchAppIfCode } // applyId 转换为 商户应用ID
    })
}

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

/* 门店入驻申请 */
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 $qrcShellView(styleCode, configModel) {
    return request.request({
        url: '/api/mchQrcShells/view',
        method: 'post',
        data: {
            configModelStr: JSON.stringify(configModel),
            styleCode: styleCode
        }
    })
}


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

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

/* 支付订单数据统计 */
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 $channelBillCount(parameter) {
    return request.request({
        url: '/api/channel/bill/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 $finsihDivision(recordIds) {
    return request.request({
        url: '/api/division/records/finish',
        method: 'POST',
        data: { recordIds }
    })
}


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

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

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

/** 查询地图配置 */
export function $getMapConfig() {
    return request.request({
        url: '/api/mchStore/mapConfig',
        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 $bindDevice(recordId, bindObject) {
    return request.request({
        url: '/api/store/device/bind/' + recordId,
        data: bindObject,
        method: 'PUT'
    })
}

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

/** 划拨设备 */
export function $allotDevice(allotObject) {
    return request.request({
        url: '/api/store/device/allotDevice',
        data: allotObject,
        method: 'POST'
    })
}

/** 批量删除设备 */
export function $batchDelDevice(deviceIds) {
    return request.request({
        url: '/api/store/device',
        data: { delDeviceIds: deviceIds },
        method: 'DELETE'
    })
}

/** 绑定码牌 */
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 $allotQrc(allotObject) {
    return request.request({
        url: '/api/mchQrCodes/allotQrc',
        data: allotObject,
        method: 'POST'
    })
}

/** 区间划拨码牌校验 */
export function $check4RangeAllot(allotObject) {
    return request.request({
        url: '/api/mchQrCodes/check4RangeAllot',
        data: allotObject,
        method: 'POST'
    })
}

/** 批量删除码牌 */
export function $batchDelQrc(delQrcIds) {
    return request.request({
        url: '/api/mchQrCodes',
        data: { delQrcIds: delQrcIds },
        method: 'DELETE'
    })
}


/** 审核提现 */
export function $cashoutAudit(rid, reqData) {
    return request.request({
        url: '/api/cashouts/audit/' + rid,
        data: reqData,
        method: 'POST'
    })
}

/** 提现人工结算 */
export function $cashoutProcess(rid, reqData) {
    return request.request({
        url: '/api/cashouts/recordProcess/' + rid,
        data: reqData,
        method: 'POST'
    })
}

/** 查询平台账户 */
export function $getPlatformProfit() {
    return request.request({
        url: '/api/account/platformProfit',
        method: 'GET'
    })
}

/** 拓展员商户统计数据*/
export function $userChart(sysUserId, queryDateRange) {
    return request.request({
        url: '/api/mainChart/userChart',
        method: 'GET',
        params: { sysUserId, queryDateRange },
    })
}

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

/** 费率配置：获取全部接口 */
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, qcreals }
    })
}

/**更新支付参数配置的参数 */
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 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 $selectBatchIdDistinctCount() {
    return request.request({
        url: '/api/mchQrCodes/batchIdDistinctCount',
        method: 'GET'
    })
}

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

/** 进件 动态获取地区信息列表*/

/* export function $getAreaCodeList (mchNo, ifCode, params) {
  return request.request({
    url: '/api/mchApplyments/areaCode/' + mchNo + '/' + ifCode,
    params: params,
    method: 'GET'
  })
} */


/** 代理商调账*/
export function $agentChangeBalance(reqParams, agentId) {
    return request.request({
        url: '/api/agents/balanceAmounts/' + agentId,
        data: reqParams,
        method: 'POST'
    })
}

/** 更新默认设备 */
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 $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 $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 $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 $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 $leshuapayConfigOpen(applyId, reqParams) {
    return request.request({
        url: '/api/mchApplyments/leshuapayConfigOpen/' + applyId,
        data: reqParams,
        method: 'post'
    })
}

/* 斗拱微信参数配置 */
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 $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 $lklApplymentAppConfig(applyId, mchAppId, reqParams) {
    return request.request({
        url: '/api/mchApplyments/lklAppConfig/' + applyId + '/' + mchAppId,
        data: reqParams,
        method: 'post'
    })
}

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

/* 预审核 */
export function $applymentPreAudit(recordId, reqParams) {
    return request.request({
        url: '/api/mchApplyments/preAudit/' + recordId,
        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'
    })
}

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

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

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

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

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


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

/**查询已经配置的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, copySourceInfoId }
    })
}

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

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

/** 支付宝安全发授权 **/
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 $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 $cashoutCount(parameter) {
    return request.request({
        url: '/api/cashouts/count',
        method: 'get',
        params: parameter
    })
}

/* 代理商列表统计 */
export function $agentInfoCount(parameter) {
    return request.request({
        url: '/api/agents/count',
        method: 'get',
        params: parameter
    })
}

/* 厂商设备参数获取 */
export function $getProviderParams(reqUrl, parameter) {
    return request.request({
        url: API_URL_PROVIDER_DEVICE + reqUrl,
        method: 'get',
        params: parameter
    })
}

/* 河马付后续流程 */
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 $hmpayQueryStoreInfo(applyId) {
    return request.request({
        url: '/api/mchApplyments/storeApplyment/' + applyId,
        method: 'get'
    })
}

// 短信信息 余额查询接口
export function $getSmsBalance(bizQueryType) {
    return request.request({
        url: API_URL_SYS_CONFIG + '/smsBalance',
        method: 'get',
        data: { bizQueryType: bizQueryType }
    })
}

// 商户二维码： 查询支付系统的url
export function $getqrCodePaySiteUrl() {
    return request.request({
        url: API_URL_MCH_QR_CODE_LIST + '/paySiteUrl',
        method: 'get',
        data: {}
    })
}

// 查询克隆信息
export function $queryCloneInfos(ifCode) {
    return request.request({
        url: API_URL_IFDEFINES_LIST + '/cloneInfos/' + ifCode,
        method: 'get',
        data: {}
    })
}

// 更新副本配置信息
export function $syncConfigInfo2CloneIfCodes(ifCode) {
    return request.request({
        url: API_URL_IFDEFINES_LIST + '/syncConfigInfo2CloneIfCodes/' + ifCode,
        method: 'put',
        data: {}
    })
}


/** 提现选择 灵活用工渠道时， 查询当前配置的自营商户的应用信息 */
export function $queryPlatformSelfMchNoAppInfos(rid) {
    return request.request({
        url: '/api/cashouts/platformSelfMchNoAppInfos',
        params: { rid },
        method: 'GET'
    })
}

/** 直付通批量结算 */
export function $zftBattchSett(data) {
    return request.request({
        url: API_URL_ZFT_SETT_RECORD + '/batchSett',
        data: data,
        method: 'POST'
    })
}

/** 支付宝直付通商户作废接口 */
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 $getMerchantInformation(mchApplyId, modifyApplyType) {
    return request.request({
        url: '/api/mchApplyments/modifyApplyment?mchApplyId=' + mchApplyId + "&modifyApplyType=" + modifyApplyType,
        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 $getMchAppConfigAppCapability(data) {
    return request.request({
        url: '/api/mchApps/configAppCapability',
        method: 'post',
        data: data
    })
}

//应用的全部功能列表
export function $getMchAppAllCapability(data) {
    return request.request({
        url: '/api/mchApps/allCapability',
        method: 'get',
    })
}

//资金明细确认
export function $getAccountChangeConfirm(data) {
    return request.request({
        url: '/api/accountChange/confirm/',
        method: 'post',
        data
    })
}
//资金管理变动确认
export function $getAccountFundConfirm(data) {
    return request.request({
        url: '/api/accountFund/confirm/',
        method: 'post',
        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 $getMchAppAudit(data) {
    return request.request({
        url: '/api/mchApps/audit',
        method: 'post',
        data: data
    })
}


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

//服务商修改渠道关联关系
export function $getMchIsvEditStatus(data) {
    return request.request({
        url: '/api/isvInfo/editStatus',
        method: 'post',
        data
    })
}
//进件获取结算类型
export function $getSettType(yspay, infoId) {
    return request.request({
        url: '/api/isvInfo/getSettType?ifCode=' + yspay + '&infoId=' + infoId,
        method: 'get',
    })
}
//配置列表
export function $getMchConfigConfig(data) {
    return request.request({
        url: 'api/mchConfig/config',
        method: 'post',
        data
    })
}
//业务变更状态刷新
export function $getMchModifyApplyments(modifyApplyId) {
    return request.request({
        url: '/api/mchModifyApplyment/'+modifyApplyId,
        method: 'get',
    })
}
/* 配置 */
export function $getWaitOperationNumber(data = {}) {
    return request.request({
        url: '/api/mainChart/getWaitOperationNumber',
        method: 'GET',
        data,
    })
}
//商户进件信息详情变更回显
export function $getMerchantChangeModifyApply(data) {
    return request.request({
        url: '/api/mchApplyments/modifyApplyment?' + data,
        method: 'GET',
    })
}
/** 支付体验配置 **/
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 $getTreaty() {
    return request.request({
        url: '/api/anon/treaty',
        method: 'GET'
    })
}

export const API_URL_PACKAGE_DETAIL_LIST = '/api/packageInfo/getPackageById'//方案分类
export const API_URL_PRODUCT_START_LIST = '/api/product/startProduct'//开通
export const API_URL_PACKAGE_ORDER = '/api/packageInfo/getPackageOder'//开通记录


/** 产品中心 */
export const API_URL_PRODUCT_DETAIL_LIST = '/api/product/getProductById'//详情


export const API_MCH_APPLYMENT_REMARK = '/api/mchApplyments/remark'//商户备注修改
export const API_MCH_PAY_DEFINES = '/api/payIfDefines'//通道

export const API_MCH_PAY_DEFINESPAGE = '/api/payIfDefines/listPage'

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



// OEM获取域名配置
export function $getAgentConfigSiteConfig(agentNo) {
    return request.request({
        url: '/api/agentConfig/siteConfig?agentNo=' + agentNo,
        method: 'get'
    })
}
/** OEM配置域名 **/
export function $postAgentConfigSiteConfig(data) {
    return request.request({
        url: '/api/agentConfig/siteConfig',
        method: 'post',
        data
    })
}


// OEM获取平台配置
export function $getAgentConfigSite(agentNo, groupKey) {
    return request.request({
        url: '/api/agentConfig?agentNo=' + agentNo + '&groupKey=' + groupKey,
        method: 'get'
    })
}
/** OEM设置平台配置 **/
export const API_URL_AGENT_CONFIG_UPDATE_OEM = '/api/agentConfig/updateOem'
/** OEM设置平台配置 **/
export const API_URL_PAYIFDEFIHNES = '/api/payIfDefines/getPayIfDefines'

//商户反扫开关标记调整
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 $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 $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 $getSettTypeSync(Id) {
    return request.request({
        url: '/api/settle/sync/' + Id,
        method: 'get',
    })
}
/* 结算订单数据统计 */
export function $settleOrderCount(parameter) {
    return request.request({
        url: '/api/settle/count',
        method: 'get',
        params: parameter
    })
}

//更新订单
export function $getPayOrderRefresh(ordeSn) {
    return request.request({
        url: 'api/payOrder/refresh/' + ordeSn,
        method: 'POST'
    })
}


/**获取代付参数配置的参数 */
export function $getPayTransferDefineDefinePage(infoId, configMode, ifName) {
    return request.request({
        url: '/api/transferDefine/definePage',
        params: { infoId, configMode, ifName },
        method: 'GET'
    })
}

/**获取代付参数配置的参数 */
export function $getPayTransferConfigIfCodePage(infoId, configMode, ifName) {
    return request.request({
        url: '/api/transferConfig/ifCodes',
        params: { infoId, configMode, ifName },
        method: 'GET'
    })
}
/**获取代付参数配置的参数 */
export function $getTransferDefineInstanceCode(code, isvNo) {
    return request.request({
        url: '/api/transferDefine/instance/code/' + code + "?isvNo=" + isvNo,
        method: 'get',
    })
}

/**更新代付参数配置的参数 */
export function $saveTransferDefineInstance(data) {
    return request.request({
        url: '/api/transferDefine/instance',
        method: 'post',
        data: data
    })
}
/**更新代付参数配置的参数 */
export function $deleteQualificationDefine(code) {
    return request.request({
        url: '/api/qualificationDefine/' + code,
        method: 'DELETE'
    })
}

/**更新代付参数配置的参数 */
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 $getAqfTaskList(subId, data) {
    return request.request({
        url: '/api/taskList/' + subId,
        method: 'put',
        data,
    })
}


/**电子回单申请 */
export function $getAqfApplicationForm(transferId, ersubId) {
    return request.request({
        url: '/api/aqfApi/applicationForm?transferId=' + transferId + '&ersubId=' + ersubId,
        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 $getRateConfigTateInfoDetail(isvNo, ifCode, infoId, infoType) {
    return request.request({
        url: '/api/rateConfig/rateInfoDetail?isvNo=' + isvNo + '&ifCode=' + ifCode + '&infoType=' + infoType + '&infoId=' + infoId,
        method: 'GET',
    })
}

//新版费率配置接口
export function $savetRateConfigResetV2(data) {
    return request.request({
        url: '/api/rateConfig/resetV2',
        method: 'POST',
        data
    })
}

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

//商户冻结
export function $getMchApplymentsState(data) {
    return request.request({
        url: '/api/mchApplyments/state',
        method: 'POST',
        data
    })
}

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

//获取路由策略的二维码
export function $getAqfRouteQrcode(routeId) {
    return request.request({
        url: '/api/route/qrcode/' + routeId,
        method: 'GET'
    })
}
/** 获取公众号授权信息接口 */
export function $getWxmpInfo() {
    return request.request({
        url: '/api/wxmp/getWxmpInfo',
        method: 'GET'
    })
}

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


