import http from '@/services/http'
import tradeServer from '@/services/socket/trade'

/**
 * 查询出境检测单据
 */
export function queryGZCJJCOrder(params: Ermcp.GZCJJCOrderReq) {
    return http.commonRequest<Ermcp.GZCJJCOrderRsp[]>({
        url: '/Guangzuan/QueryGZCJJCOrder',
        params,
    })
}

/**
 * 查询出境检测单据明细（批次信息）
 */
export function queryGZCJJCOrderDetail(params: Ermcp.GZCJJCOrderDetailReq) {
    return http.commonRequest<Ermcp.GZCJJCOrderDetailRsp[]>({
        url: '/Guangzuan/QueryGZCJJCOrderDetail',
        params,
    })
}

/**
 * 查询出境检测单据操作
 */
export function queryGzcjjcorderoperate(params: Ermcp.GzcjjcorderoperateReq) {
    return http.commonRequest<Ermcp.GzcjjcorderoperateRsp[]>({
        url: '/Guangzuan/QueryGzcjjcorderoperate',
        params,
    })
}

/**
 * 查询保税服务单据
 */
export function queryGZBSFWOrder(params: Ermcp.GZBSFWOrderReq) {
    return http.commonRequest<Ermcp.GZBSFWOrderRsp[]>({
        url: '/Guangzuan/QueryGZBSFWOrder',
        params,
    })
}

/**
 * 保税服务单据操作信息
 */
export function gzBSFWOrderOperate(params: Ermcp.GZBSFWOrderOperateReq) {
    return http.commonRequest<Ermcp.GZBSFWOrderOperateRsp[]>({
        url: '/Guangzuan/GZBSFWOrderOperate',
        params,
    })
}

/**
 * 查询保税服务单据明细
 */
export function queryGZBSFWOrderDetail(params: Ermcp.GZBSFWOrderDetailReq) {
    return http.commonRequest<Ermcp.GZBSFWOrderDetailRsp[]>({
        url: '/Guangzuan/QueryGZBSFWOrderDetail',
        params,
    })
}

/**
 * 出境保税单据文件
 */
export function queryGZCJBSOrderFile(params: Ermcp.GZCJBSOrderFileReq) {
    return http.commonRequest<Ermcp.GZCJBSOrderFileRsp[]>({
        url: '/Guangzuan/QueryGZCJBSOrderFile',
        params,
    })
}

/**
 * 查询保税服务单据操作
 */
export function queryFworderoperate(params: Ermcp.FworderoperateReq) {
    return http.commonRequest<Ermcp.FworderoperateRsp[]>({
        url: '/Guangzuan/QueryFworderoperate',
        params,
    })
}

/**
 * 出境检测申请
 */
export function cjjcApply(params: Partial<Proto.CJJCApplyReq>) {
    return tradeServer.sendMessage<Proto.CJJCApplyRsp>({
        params,
        reqName: 'CJJCApplyReq',
        rspName: 'CJJCApplyRsp',
        marketId: 66201
    })
}

/**
 * 出境检测会员操作
 */
export function cjjcMemberOperate(params: Proto.CJJCMemberOperateReq) {
    return tradeServer.sendMessage<Proto.CJJCMemberOperateRsp>({
        params,
        reqName: 'CJJCMemberOperateReq',
        rspName: 'CJJCMemberOperateRsp',
        marketId: 66201
    })
}

/**
 * 出境检测确认预付款生成文件
 */
export function cjjcConfirmMarginBuildFileReq(params: Proto.CJJCConfirmMarginBuildFileReq) {
    return tradeServer.sendMessage<Proto.CJJCConfirmMarginBuildFileRsp>({
        params,
        reqName: 'CJJCConfirmMarginBuildFileReq',
        rspName: 'CJJCConfirmMarginBuildFileRsp',
        marketId: 66201
    })
}

/**
 * 保税服务会员操作
 */
export function bsfwMemberOperate(params: Proto.BSFWMemberOperateReq) {
    return tradeServer.sendMessage<Proto.BSFWMemberOperateRsp>({
        params,
        reqName: 'BSFWMemberOperateReq',
        rspName: 'BSFWMemberOperateRsp',
        marketId: 66201
    })
}