健务室设备检测报告

订阅 workplace.device_report.created 后,用 Webhook 中的 resource_no 回拉。查询返回 SM4 信封,解密后才是明文:报告头、企业、用户与设备原始 raw_data。

概述

开通、验签、SM4 信封与企业 / 用户字段见接入方式。 本期仅 created,覆盖不另推。

事件推送

事件名必须精确订阅,通配无效。

{
  "event": "workplace.device_report.created",
  "delivery_id": "6b0c0123-4567-89ab-cdef-0123456789ab",
  "enterprise_id": 12,
  "resource_type": "device_report",
  "resource_no": "RPT20261021ABCDEFGH",
  "user_id": 1024,
  "occurred_at": "2026-10-21T09:58:00+08:00"
}

resource_no 即查询路径中的 reportNo,按此幂等。

查询接口

GET/open/v1/workplace/device-reports/{reportNo}

路径参数:

参数类型说明
reportNostring设备报告号,Webhook 的 resource_no

请求示例:

GET /open/v1/workplace/device-reports/RPT20261021ABCDEFGH
X-App-Key: ak_xxx
X-Timestamp: 1743494400
X-Nonce: n1
X-Signature: ...

成功响应(200 OK):

{
  "success": true,
  "code": 0,
  "message": "获取成功",
  "data": {
    "encrypt_type": "SM4-ECB",
    "key_version": 1,
    "cipher_text": "..."
  },
  "timestamp": "2026-10-21T10:00:00+08:00"
}

解密算法见SM4 解密。

明文结构

{
  "report": {
    "report_no": "RPT20261021ABCDEFGH",
    "measurement_no": "M202610210001",
    "report_name": "健康一体机检测报告",
    "device_model": "AIO_STANDARD",
    "device_sn": "SN0001",
    "points_code": "P001",
    "station": { "id": 3, "name": "总部健务室" },
    "exam_at": "2026-10-21 09:58:00",
    "report_file_path": "https://example.com/report.pdf",
    "h5_url": "https://example.com/h5",
    "raw_data": {}
  },
  "enterprise": {
    "id": 12,
    "enterprise_no": "E0012",
    "name": "某某科技有限公司"
  },
  "user": {
    "user_id": 1024,
    "user_type": "employee",
    "name": "张三",
    "gender": "MALE",
    "birth_date": "1988-03-12",
    "id_type": "ID_CARD",
    "id_number": "11010119880312xxxx",
    "id_number_masked": false,
    "phone": "13800001111",
    "email": "zhangsan@example.com",
    "employee_no": "E10086",
    "guest_login_account": null
  }
}

report 字段:

字段类型说明
report_nostring设备报告号
measurement_nostring | null检测编号
report_namestring | null报告名称
device_modelstring | null设备型号
device_snstring | null设备序列号
points_codestring | null点位编码
stationobject | nullid / name;映射不到时为 null
exam_atstring | null检测时间,Y-m-d H:i:s
report_file_pathstring | null报告文件路径
h5_urlstring | nullH5 报告链接(设备报告有值则原样返回)
raw_dataobject设备原始报文,缺省为空对象

enterprise / user 字段与员工 / 访客差异见企业与用户。 设备报告用户信息取查询时刻当前值。

raw_data

原样透传 health_check_reports.raw_data,不清洗、不改结构。 结构随 device_model 变化(例如一体机为嵌套站点报文)。 厂商原文若含姓名手机号,同样在 SM4 加密体内。

错误码

HTTPcode含义
404REPORT_NOT_FOUND未订阅 / 企业未开通 / 报告号不存在
503ENCRYPT_KEY_MISSING报告加密密钥未就绪,联系晓葆开通