展位门票申请列表

HTTP Request

GET /api/admin/exhibition_tickets

HEADERS

字段名 是否必填 描述
ACCESS-TOKEN true 授权token(aPaas提供)

URL Parameters

字段名 必填 描述
exhibition_id 展会ID
created_at_start 申请开始时间
created_at_end 申请结束时间
category 分类(官网:website, quick页:quick, 落地页:landing)
page 页码
per_page 每页的数量
export_format 导出专用参数,不是导出不需传此参数,目前支持: xlsx

返回数据

{
    "code": 0,
    "message": "success",
    "remark": "成功",
    "data": {
        "total_count": 1,
        "total_pages": 1,
        "next_page": null,
        "prev_page": null,
        "current_page": 1,
        "per_page": 15,
        "page": 1,
        "models": [
            {
                "id": 1,
                "contact": {
                    "job": "董事长秘书",  // 职位
                    "name": "王二小", // 姓名
                    "email": "abc@qq.com", // 邮箱
                    "phone": "13223232232", // 手机
                    "company_name": "宇宙无敌有限公司" // 公司名称
                },
                "exhibition_id": 1,
                "exhibition": { // 展会信息
                    "id": 1,
                    "name": "R+T Asia 2023 亚洲门窗遮阳展"
                },
                "note": "我想要一个小小的展位",
                "created_at": "2024-03-15T16:05:04.160+08:00", // 申请时间,
                "category": "website", // 分类(官网:website, quick页:quick, 落地页:landing),
                "no": "20240715998555" // 票号
            }
        ]
    }
}

导出返回数据

// 成功
{
    "code": 0,
    "message": "success",
    "remark": "导出任务已经加入队列,请耐心等待",
    "data": {
        "uuid": "2b44ca0c-5a69-49aa-8c2d-811a38107cf5"
    }
}

// 失败
{
    "code": 401,
    "message": "你没有应用导出的权限",
    "remark": "你没有应用导出的权限",
    "error": "errors/unauthorized_error"
}

{
    "code": -1,
    "message": "failure",
    "remark": "当前用户已经有导出任务排队或执行,请稍后再试",
    "error": "standard_error"
}

{
    "code": -1,
    "message": "failure",
    "remark": "该用户已经超过当日导出最大次数50,当前任务不允许执行",
    "error": "standard_error"
}

导出websocket channel subscribe

function withFayeClient(callback) {
  var init_faye = function () {
    if(!window.initFaye) {
      window.initFaye = $.ajax({
        url: 'https://faye-dev.ikcrm.com/faye/client.js',
        cache: true,
        dataType: "script"
      }).done(function() {
        window.fayeClient = new Faye.Client("https://faye-dev.ikcrm.com/faye");
      });
    }

    window.initFaye.done(callback);
  }

  setTimeout(init_faye, 400);
}


_function = function() {
  console.log('subscribeAsyncToFaye: ' + new Date())

  var channel = "/export/1" // 这里的channel取值为全局变量里的export_channel
  window.fayeClient.subscribe(channel, function(data) {
    // 这里的 data是后端导出任务实时推送的进度数据
    console.log("======.",data)
  })
}

withFayeClient(_function.bind(this))

后端导出任务实时推送的进度数据的几种格式

 // 1. 准备开始
 {
    "status": "starting",
    "file_url": null,
    "progress": 1,
    "service": "Exports::ApplyExhibitionTicket",
    "uuid": "0e659a8b-7a0b-4190-bbe9-89ccf95733de",
    "count": null,
    "file_size": null
  }

  // 2. 开始
  {
    "status": "start",
    "file_url": null,
    "progress": 3,
    "service": "Exports::ApplyExhibitionTicket",
    "uuid": "0e659a8b-7a0b-4190-bbe9-89ccf95733de",
    "count": 6,
    "file_size": null
 }

 // 3. 写入数据到文件
  {
    "status": "writing_file",
    "file_url": null,
    "progress": 73,
    "service": "Exports::ApplyExhibitionTicket",
    "uuid": "0e659a8b-7a0b-4190-bbe9-89ccf95733de",
    "count": 6,
    "file_size": null
  }

  // 4.1. 上传写入完成的文件到七牛
  {
    "status": "before_upload",
    "file_url": null,
    "progress": 73,
    "service": "Exports::ApplyExhibitionTicket",
    "uuid": "0e659a8b-7a0b-4190-bbe9-89ccf95733de",
    "count": 6,
    "file_size": 4202
  }

  // 4.2. 上传写入完成的文件到七牛失败
  {
    "status": "upload_failure",
    "file_url": null,
    "progress": 73,
    "service": "Exports::ApplyExhibitionTicket",
    "uuid": "0e659a8b-7a0b-4190-bbe9-89ccf95733de",
    "count": 6,
    "file_size": 4202
  }

  // 5. 导出任务完成
  {
    "status": "success",
    "file_url": "http://apaas-dev.weiwenjia.com/export/1693363081_0e659a8b-7a0b-4190-bbe9-89ccf95733de.xlsx",
    "progress": 100,
    "service": "Exports::ApplyExhibitionTicket",
    "uuid": "0e659a8b-7a0b-4190-bbe9-89ccf95733de",
    "count": 6,
    "file_size": 4202
 }
文档更新时间: 2025-04-09 17:20   作者:李辉