Skip to content

设备管家OpenAPI文档 v1.0

1.概述

由第三方使用HTTP或者MQ的形式进行数据对接、从而获取设备的基本信息和告警信息。


2.前置准备/步骤

2.1申请clientId和clientSecret

  • 线下找对接人申请clientId和clientSecret(对clientId和clientSecret信息进行保密,不要随意泄漏)

  • clientId:应用的唯一标识。

  • clientSecret:clientId对应的密钥,访问用户资源时用来验证应用的合法性。

2.2申请请求域名

  • 具体环境域名线下找对接人提供

  • 请求域名https://xxx

  • 接口请求示例

如:分页查询设备信息

https://xxx/api/open/smartpark-equipment/openApi/iotInformation

  • 所有接口需通过clientId和clientSecret获取鉴权

3.系统交互图

3.1 http请求交互图

3.2 数据订阅交互图


4.接口鉴权算法及请求示例

4.1获取签名逻辑

  • 对需要保护的数据进行拼接

拼接方式: http请求方法 + "\n" + contentType + "\n" + 日期格式字符串 + "\n" + 请求资源uri

  • 对拼接好的字符串和clientSecret 进行HmacSHA1加密 并对加密结果进行base64加密

  • 截取base64加密后的第5位开始的后续10个字符作为签名

4.2获取签名示例

  • 签名数据
项目
clientIdyh5zmklapb0ehka0
clientSecretcb9wt3osfum3gsle37trp4lrjk1kkq4ywcgpeeg7b9e602qe
http请求方法POST
contentTypeapplication/json
日期格式RFC 1123规范,例如:"EEE, dd MMM yyyy HH:mm:ss zzz"
请求的接口https://xxx/api/open/smartpark-equipment/openApi/test
  • 签名过程
步骤结果
拼接后的字符串POST\napplication/json\nTue, 18 Nov 2025 05:50:58 GMT\n/api/open/smartpark-equipment/openApi/test
进行HmacSHA1加密和base64加密结果QDRnQ9x2uxhWSlJfkc028H6QtZw=
截取base64加密后的第5位开始的后续10个字符作为签名9x2uxhWSlJ
  • 最终http请求头需携带的信息
HeaderValue
AuthorizationclientId:sign
DateEEE, dd MMM yyyy HH:mm:ss zzz
Content-Typeapplication/json

4.3Java示例代码

见附录【Java签名示例代码】


5.MQ消息订阅

  • 消息队列用RabbitMQ,用以数据订阅

  • MQ相关信息需对接方提供(主机、账号、密码、端口号、Vhost)

5.1绑定关系定义

配置项格式示例
ExchangeName{clientId}_equipment_open_exchangeyh5zmklapb0ehka0_equipment_open_exchange
ExchangeTypeTopic-
QueueName自行定义,约定以clientId作为队列前缀yh5zmklapb0ehka0_alarm_create
设备产生的告警RoutingKey{clientId}_equipment_alarm_createyh5zmklapb0ehka0_equipment_alarm_create
告警状态改变RoutingKey{clientId}_equipment_alarm_update_statusyh5zmklapb0ehka0_equipment_alarm_update_status
告警关联的工单状态改变RoutingKey{clientId}_equipment_alarm_work_order_updateyh5zmklapb0ehka0_equipment_alarm_work_order_update

5.2消息报文

设备产生的告警

RoutingKey: {clientId}_equipment_alarm_create

报文格式:

参数类型必须说明字符长度
equipmentCodeString设备编码64
alarmCodeString告警唯一编码64
alarmLevelString告警级别(附录2)32
alarmTitleString告警标题64
alarmContentString告警内容255
alarmTimeString告警时间32
incidentStatusInteger告警状态(附录1)
workOrderNumberString告警关联的工单编码64
workOrderStatusString工单状态(附录3)32
equipmentNameString设备名称64
locationString设备位置64

报文示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "equipmentCode": "xx",
    "alarmCode": "xx",
    "projectCode": "xxx",
    "alarmLevel": "0",
    "alarmTitle": "xx告警标题",
    "alarmContent": "xx告警内容",
    "alarmTime": "2025-12-29 10:00:01",
    "incidentStatus": 0,
    "workOrderNumber": null,
    "workOrderStatus": null,
    "equipmentName": "xxx",
    "location": "xxxxx"
  },
  "msg": "操作成功"
}

告警状态改变

RoutingKey: {clientId}_equipment_alarm_update_status

报文格式:

参数类型必须说明
equipmentCodeString设备编码
incidentStatusInteger告警状态
alarmCodeString告警唯一编码

报文示例:

json
{
  "alarmCode": "xx",
  "workOrderNumber": "xx",
  "workOrderStatus": "xxx",
  "equipmentCode": "xxxx"
}

告警关联的工单状态改变

RoutingKey: {clientId}_equipment_alarm_work_order_update

报文格式:

参数类型必须说明
equipmentCodeString设备编码
alarmCodeString告警唯一编码
workOrderNumberString告警关联的工单编码
workOrderStatusString工单状态

报文示例:

json
{
  "alarmCode": "xx",
  "workOrderNumber": "xx",
  "workOrderStatus": "xxx",
  "equipmentCode": "xxxx"
}

6.接口正文

6.1分页查询设备信息

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/iotInformation

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
equipmentCode设备编码String
equipmentName设备名称String
pageNum页码Int必填默认为1
pageSize每页条数Int必填默认为10

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueboolean
data返回数据Object
records数组
equipmentName设备名称String128
equipmentCode设备编码String64
location空间位置String128
onlineStatus在线状态String2
lastestUpdateTime最近上报时间String64
equipmentPropertyVoList设备属性及值数组
code设备编码String128
propertyType属性类型String32
identifier属性名称String64
propertyValue属性值String32

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "records": [
      {
        "equipmentName": "xx",
        "equipmentCode": "xx",
        "location": "JxxA栋-A1",
        "onlineStatus": "1",
        "lastestUpdateTime": "2025-11-28 17:08:51",
        "equipmentPropertyVoList": [
          {
            "code": "xx",
            "propertyType": "{\"specs\":{\"unit\":\"kWh\",\"min\":\"\",\"max\":\"\",\"step\":\"\"},\"type\":\"double\"}",
            "status": null,
            "identifier": "EPI",
            "propertyName": "吸收有功电度",
            "propertyValue": "20.0",
            "lastUpdateTime": "2025-11-28 17:07:20"
          }
        ]
      }
    ],
    "total": 175,
    "size": 10,
    "current": 1,
    "pages": 18
  },
  "msg": "操作成功"
}

6.2分页查询设备历史属性

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/openApiHistoryData

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
equipmentCode设备编码String
pageNum页码Int必填默认为1
pageSize每页条数Int必填默认为10

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueboolean
data返回数据Object
records数组
name设备名称String128
code设备编码String128
time时间String
propertyValue属性值String32
propertyName属性名称String64

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "records": [
      {
        "createBy": null,
        "updateBy": null,
        "createTime": "2025-12-24 16:43:08",
        "updateTime": "2025-12-24 16:43:08",
        "id": "xxx",
        "projectCode": "xxx",
        "code": "xxx",
        "thirdCode": "xxx",
        "name": "dev工单xxx",
        "productType": "xxx",
        "productTypeName": "xxx品xxx",
        "location": "xxxB2",
        "identifier": "BatteryPercentage",
        "type": "xxx",
        "typeName": "电子工xxxxxx",
        "time": "2025-12-24 16:43:08",
        "propertyName": "电量百分比",
        "propertyValue": "2.0",
        "status": 1
      }
    ],
    "total": 92,
    "size": 10,
    "current": 1,
    "pages": 10
  },
  "msg": "操作成功"
}

6.3查询设备告警记录

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/pageAlarmOpenApiList

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
equipmentId设备编码String
pageNum页码Integer必填默认为1
pageSize每页条数Integer必填默认为10

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
records数组
equipmentName设备名称String128
code设备编码String128
alarmTime告警时间String32
alarmLevel告警级别String32
alarmLevelValue告警级别String32
alarmType告警类型String341.设备告警 2.业务告警
alarmTypeValue告警类型String64
content告警内容String255

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "records": [
      {
        "id": "xxx",
        "code": "111435",
        "equipmentName": "项目xxx名称设备测试",
        "alarmTime": "2025-12-25 14:36:35",
        "alarmLevel": 3,
        "alarmLevelValue": "xx紧急",
        "alarmType": 2,
        "alarmTypeValue": "业xxx务告警",
        "content": "2025-12-25 14:36:35 吸收有功电度:111.0 大于告警阈值: 15.0"
      }
    ],
    "total": 87763,
    "size": 10,
    "current": 1,
    "pages": 8777
  },
  "msg": "操作成功"
}

6.4根据类型查询设备基础信息

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/basicOpenApiEquipmentInfo

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
code设备编码String
type所属类型类型 1电梯 2消防 3其他
pageNum页码Integer必填默认为1
pageSize每页条数Integer必填默认为10

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
records数组
name设备名称String128
code设备编码String128
brand品牌String128
installationDate安装日期String
deviceType设备类型String32
deviceTypeName设备类型名称String64
manufactureCompanyTel生产单位电话String64
location所属空间String128
manufactureCompany生产单位String128
specialEquipmentCode特种设备注册代码String64
maintainUnit维保单位String128
contractType承包方式String64
responsible管理员String64
contractNumber合同编号String64
contractStartTime合同开始时间String
contractEndTime合同结束时间String64
testAverageTime曳引式电梯平衡试验时间String64
elevatorStopTime曳引式电梯125%额定载荷制动试验时间String64
elevatorSpeedCheckTime限速器动作速度校验时间String64
equipmentCheckTime设备年检时间String100
attachmentList附件数组
code附件idString255
name附件名称String128
url附件url路径String255
type附件类型Integer类型: 1-平衡实验时间;2-额定载荷制动试验时间;3-限速器动作速度校验时间;4-设备年检时间

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "records": [
      {
        "id": null,
        "name": "xxx",
        "code": "xxx",
        "brand": "",
        "installationDate": null,
        "deviceType": "xxx",
        "deviceTypeName": "气体xxxxxx主机",
        "location": "xxxA栋",
        "specification": null,
        "specialEquipmentCode": null,
        "manufactureCompany": "",
        "manufactureCompanyTel": "",
        "maintainUnit": "222",
        "contractType": "全民住xxx(全包)",
        "responsible": "",
        "contractNumber": "nb12345678",
        "contractStartTime": "2025-02-01",
        "contractEndTime": "2025-07-30",
        "testAverageTime": "2025-06-25",
        "elevatorStopTime": "2025-06-25",
        "elevatorSpeedCheckTime": "2025-06-25",
        "equipmentCheckTime": "2025-06-25",
        "attachmentList": [
          {
            "id": 373,
            "equipmentCode": "xxx",
            "code": "xxx.pdf",
            "name": "xxx",
            "url": "xx.pdf",
            "status": 1,
            "type": 1
          }
        ]
      }
    ],
    "total": 8,
    "size": 10,
    "current": 1,
    "pages": 1
  },
  "msg": "操作成功"
}

6.5查询维护日期到期提醒

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/pageOpenApiElevator

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
deviceKeyWord设备编码/设备名称String
status状态String
pageNum页码Integer必填默认为1
pageSize每页条数Integer必填默认为10

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
records
equipmentCode设备编码String128
taskType任务类型String64BALANCE:曳引式电梯平衡试验超期风险,LOAD_BRAKING:曳引式电梯125%额定荷载制动试验超期风险,CONFINE_ACTION:限速器动作速度校验超期风险,EQUIPMENT_YEAR: 设备年检超期风险
taskDescribe任务描述String64
equipmentName设备名称String128
location空间路径String128
elevatorBrand电梯品牌List64
createTime告警时间String32
equipmentType设备类型String32
specialEquipmentCode特种设备注册编码String64
status状态String32状态:待处理:WAIT_PROCESSING,已处理SUCCESS

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "records": [
      {
        "createBy": null,
        "updateBy": null,
        "createTime": "2025-11-13 17:58:01",
        "updateTime": null,
        "id": 32459,
        "equipmentCode": "xxx",
        "equipmentType": "xx",
        "equipmentName": "保洁测试xx同步-01",
        "taskType": "BALANCE",
        "taskDescribe": "保洁xxx",
        "elevatorBrand": "K360",
        "projectCode": "xxx",
        "location": "xA栋x-A1-A1公区",
        "lastHandleTime": null,
        "lastCompleteTime": null,
        "specialEquipmentCode": null,
        "status": "WAIT_PROCESSING"
      }
    ],
    "total": 4,
    "size": 10,
    "current": 1,
    "pages": 1
  },
  "msg": "操作成功"
}

6.6查询设备关联工单

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/workOrderOpenApiInfo

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
equipmentCode设备编码String
workOrderType工单类型String工单类型 报事-incident 维保-cycle
pageNum页码Integer必填默认为1
pageSize每页条数Integer必填默认为10

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
records
equipmentName设备名称string128
equipmentCode设备编码String128
workOrderNumber工单编号String64
workOrderType工单类型String32
workOrderName工单名称String64
taskResponsiblePeo接单人String32
workOrderStatus工单状态String32
dispatchTime派单时间String32
receivingTime接单时间String32
taskActualStartTime开始做单时间String32
taskPlannedEndTime计划关单时间String32
taskActualEndTime实际关单时间String32

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "records": [
      {
        "workOrderNumber": "xxx",
        "workOrderType": "维修xxx单",
        "workOrderTypeCode": "xx",
        "workOrderName": "安全xx报事",
        "taskResponsiblePeo": "xxxxx坤",
        "workOrderStatus": "已完成",
        "dispatchTime": "2025-11-24 16:08:36",
        "receivingTime": "2025-11-24 16:09:14",
        "taskActualStartTime": "2025-11-24 16:09:14",
        "taskActualEndTime": "2025-11-24 16:51:27",
        "taskPlannedEndTime": null
      }
    ],
    "total": 408,
    "size": 10,
    "current": 1,
    "pages": 41
  },
  "msg": "操作成功"
}

6.7查询电梯维保计划结果

请求方式: POST

请求路径: /api/open/smartpark-equipment/openApi/pageOpenApiCalendar

请求参数

参数参数含义数据类型必填说明
projectCode项目code编码String必填200:显示成功
equipmentCode设备编码String
pageNum页码int必填默认为1
pageSize每页条数int必填默认为10

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
records
orderCreateTime维保计划时间String32
taskActualEndTime实际完成时间String32
workOrderStatus状态(超期、完成)String32
workOrderNumber关联工单号String64工单状态 normal-正常 overdue-超期

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "records": [
      {
        "workOrderNumber": "xxx",
        "workOrderStatus": "正常",
        "orderCreateTime": "2025-09-11 14:58:00",
        "taskActualEndTime": "2025-09-11 15:24:32"
      }
    ],
    "total": 243,
    "size": 10,
    "current": 1,
    "pages": 25
  },
  "msg": "操作成功"
}

6.8查询事件工单

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/incidentWorkOrderOpenApiPage

请求参数

参数参数含义数据类型必填说明
projectCode项目code编码String必填200:显示成功
workOrderNumber设备编码String
equipmentName设备名称String
pageNum页码int必填默认为1
pageSize每页条数int必填默认为10

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
records
workOrderNumber工单编号String64
workOrderName工单名称String128
equipmentName设备名称String128
location工单位置String128
taskResponsiblePeo接单人String32
incidentStatus工单状态String32
dispatchTime派发时间String32
taskPlannedStartTime计划开始时间String32
taskActualStartTime实际开始时间String32
计划完成时间计划完成时间String32
taskActualEndTime实际完成时间String32
checkTime验收时间String32

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "records": [
      {
        "id": "xx",
        "requestClassName": null,
        "workOrderNumber": "xxx",
        "workOrderName": null,
        "description": "2025-12-26 16:01:23 设备xx低电量告警-低电量告警-低电量告警-低电量告警",
        "equipmentName": "dev工单xxx",
        "equipmentCode": "xxx",
        "spaceCode": null,
        "location": null,
        "taskResponsiblePeo": "系统自动xxx单",
        "receivingTime": null,
        "incidentStatus": "Unassigned",
        "incidentStatusValue": "待领取",
        "taskPlannedEndTime": null,
        "dispatchTime": "2025-12-26 16:01:25",
        "taskActualStartTime": null,
        "taskActualEndTime": null,
        "taskPlannedStartTime": null,
        "checkTime": null,
        "orderType": null,
        "orderTypeValue": null,
        "orderLevel": null,
        "orderLevelValue": null,
        "requestClassId": null,
        "dealUser": null,
        "dealMethodTime": null,
        "dealMethod": null,
        "dealMethodValue": null,
        "incidentTime": null,
        "workTaskAttachmentList": null,
        "worktaskContent": null,
        "assignMethod": null,
        "taskOrganization": null,
        "cameraList": null,
        "taskType": null,
        "taskTypeId": null,
        "taskTypeCode": null,
        "priority": null,
        "instId": null
      }
    ],
    "total": 202,
    "size": 10,
    "current": 1,
    "pages": 21
  },
  "msg": "操作成功"
}

6.9查询维保工单

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/maintenanceOpenApiPage

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
workOrderName工单名称String
workOrderNumber工单编号String
equipmentName设备名称String
pageNum页码Int必填默认为1
pageSize每页条数Int必填默认为10

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
records数组
workOrderNumber工单编号String64
workOrderName工单名称String128
priority优先级String32
taskResponsiblePeo维保人String32
incidentStatus工单状态String32
dispatchTime派发时间String32
taskPlannedStartTime计划开始时间String32
taskActualStartTime实际开始时间String32
taskActualEndTime实际完成时间String32
checkTime验收时间String32

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "records": [
      {
        "id": "xxx",
        "requestClassName": null,
        "workOrderNumber": "xxx",
        "workOrderName": "xxx周期工单",
        "description": "888",
        "equipmentName": "A-TEST-ANGG-2001",
        "equipmentCode": "xxx",
        "spaceCode": null,
        "location": "xx国际/xxA栋/A1/A1公区",
        "taskResponsiblePeo": "李xx燕",
        "receivingTime": "2025-09-11 15:24:25",
        "incidentStatus": "Completed",
        "incidentStatusValue": "已完成",
        "taskPlannedEndTime": null,
        "dispatchTime": "2025-09-11 14:58:00",
        "taskActualStartTime": "2025-09-11 15:24:25",
        "taskActualEndTime": "2025-09-11 15:24:32",
        "taskPlannedStartTime": null,
        "checkTime": null,
        "orderType": null,
        "orderTypeValue": null,
        "orderLevel": null,
        "orderLevelValue": null,
        "requestClassId": null,
        "dealUser": null,
        "dealMethodTime": null,
        "dealMethod": null,
        "dealMethodValue": null,
        "incidentTime": null,
        "workTaskAttachmentList": null,
        "worktaskContent": null,
        "assignMethod": null,
        "taskOrganization": null,
        "cameraList": null,
        "taskType": null,
        "taskTypeId": null,
        "taskTypeCode": null,
        "priority": "普通",
        "instId": "a75ca09e-8edc-11f0-b1cb-0255ac10017a"
      }
    ],
    "total": 216,
    "size": 10,
    "current": 1,
    "pages": 22
  },
  "msg": "操作成功"
}

6.10查询巡检工单

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/inspectionOpenApiPage

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
workOrderName工单名称String
workOrderNumber工单编号String
equipmentName设备名称String
pageNum页码Integer必填默认为1
pageSize每页条数Integer必填默认为10

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
records
workOrderNumber工单编号String64
workOrderName工单名称String128
priority优先级String32
taskResponsiblePeo维保人String32
incidentStatus工单状态String32
dispatchTime派发时间String32
taskPlannedStartTime计划开始时间String32
taskActualStartTime实际开始时间String32
计划完成时间计划完成时间String32
taskActualEndTime实际完成时间String32
checkTime验收时间String32

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "records": [
      {
        "id": "xxxx",
        "requestClassName": null,
        "workOrderNumber": "xx",
        "workOrderName": "xx周期工单",
        "description": "888",
        "equipmentName": "A-TEST-ANGG-2001",
        "equipmentCode": "xxx",
        "spaceCode": null,
        "location": "xx国际/xx栋/A1/A1公区",
        "taskResponsiblePeo": "李xx燕",
        "receivingTime": "2025-09-11 15:24:25",
        "incidentStatus": "Completed",
        "incidentStatusValue": "已完成",
        "taskPlannedEndTime": null,
        "dispatchTime": "2025-09-11 14:58:00",
        "taskActualStartTime": "2025-09-11 15:24:25",
        "taskActualEndTime": "2025-09-11 15:24:32",
        "taskPlannedStartTime": null,
        "checkTime": null,
        "orderType": null,
        "orderTypeValue": null,
        "orderLevel": null,
        "orderLevelValue": null,
        "requestClassId": null,
        "dealUser": null,
        "dealMethodTime": null,
        "dealMethod": null,
        "dealMethodValue": null,
        "incidentTime": null,
        "workTaskAttachmentList": null,
        "worktaskContent": null,
        "assignMethod": null,
        "taskOrganization": null,
        "cameraList": null,
        "taskType": null,
        "taskTypeId": null,
        "taskTypeCode": null,
        "priority": "普通",
        "instId": "a75ca09e-8edc-11f0-b1cb-0255ac10017a"
      }
    ],
    "total": 216,
    "size": 10,
    "current": 1,
    "pages": 22
  },
  "msg": "操作成功"
}

6.11查询设备告警列表

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/pageOpenApiAlarm

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
equipmentName设备名称String
pageNum页码Integer必填默认为1
pageSize每页条数Integer必填默认为10

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
records
equipmentName设备名称String128
productTypeName设备分类String64
productName产品名称String64
code设备编码String128
alarmTime告警事时间LocalDateTime32
alarmLevel告警级别String32
alarmLevelValue告警级别名称String64
title告警标题String64
description告警描述String255
location所在位置String128
incidentStatus处理结果状态Integer40未处理 1已派单 2暂不受理 3误报 4重复预警已受理 5已转发 6工单完成 7手动关闭
incidentStatusValue处理结果String32
workOrderNumber工单编号String64
recoverTime恢复时间String32

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "records": [
      {
        "id": "xx",
        "description": "2025-12-26 16:06:06 dev工单xx设备在线",
        "code": "xxx",
        "alarmTime": "2025-12-26 16:07:06",
        "alarmLevel": 3,
        "alarmLevelValue": "紧急",
        "eventType": 2,
        "alarmTypeValue": "业务告警",
        "content": "2025-12-26 16:xx:06 dev工单xx设备在线",
        "triggerValue": null,
        "incidentStatus": 0,
        "incidentStatusValue": "未处理",
        "recoverTime": "2025-12-26 16:06:06",
        "propertyName": "在线状态",
        "propertyValue": "1",
        "propertyType": null,
        "identifier": "networkStatus",
        "equipmentName": "dev工单xxx",
        "equipmentCode": "xx",
        "location": "门禁xxx栋-B2",
        "workOrderNumber": null,
        "title": "55幅888",
        "dealUser": null,
        "dealMethodTime": null,
        "dealMethod": null,
        "dealMethodValue": null,
        "handleResult": null,
        "handleAdvice": null,
        "forwardPlatform": null,
        "workIncidentStatus": null,
        "onlineStatus": 2,
        "updateTime": "2025-12-26 16:07:06",
        "cameraList": null,
        "productName": "电子工单xxx",
        "productCode": "xx",
        "productTypeName": "xxx品类"
      }
    ],
    "total": 2,
    "size": 10,
    "current": 1,
    "pages": 1
  },
  "msg": "操作成功"
}

6.12查询电梯维保信息

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/elevatorMaintenance

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
startTime开始时间String
endTime结束时间String

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
elevatorTypeNames电梯设备总数list
code产品品类编码String64
elevatorCount数量Integer16
name电梯类型名称String128
completedWorkOrder已完成维保工单Long16
notExpert检验合格率BigDecimal16
expertPassRate专家抽检合格率BigDecimal16
contractOverdueRisk合同超期风险Long8
balanceRisk曳引式电梯平衡试验超期风险Long8
restrictionSpeed限速器校验超期风险Long8
balanceOverdueRisk125%载荷和平衡试验超期风险Long8

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "elevatorTypeNames": [
      {
        "code": "xxx",
        "elevatorCount": 1,
        "name": "xxx乘客电梯"
      }
    ],
    "workOrderNumber": 1,
    "completedWorkOrder": 1,
    "aiCheckResult": 1,
    "notAiCheckResult": 0,
    "passRate": "100.00",
    "elevatorCount": 2,
    "expertCount": 0,
    "notExpert": 0,
    "expertPassRate": null,
    "contractOverdueRisk": 2,
    "balanceRisk": 0,
    "restrictionSpeed": 0,
    "balanceOverdueRisk": 0
  },
  "msg": "操作成功"
}

6.13查询设备房监测信息

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/equipmentMonitor

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
startTime开始时间String
endTime结束时间

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
name设备房String128
aiotPoints设备数量String8
alarmWorkOrder有效告警工单String8
processedAlarmWorkOrder已处理告警工单String8
processRate处理率String8

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": [
    {
      "id": null,
      "name": "xxx品类",
      "projectCode": null,
      "aiotPoints": 1,
      "alarmWorkOrder": 0,
      "processedAlarmWorkOrder": 0,
      "processRate": "100.00"
    }
  ],
  "msg": "操作成功"
}

6.14查询设备分类监测

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/classifyMonitor

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
startTime开始时间String
endTime结束时间String

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
name设备类型String32
aiotPointsAIoT监测点位Integer8
alarmWorkOrder有效告警工单Integer8
processedAlarmWorkOrder已处理告警工单Long16
processRate处理率BigDecimal16

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": [
    {
      "id": null,
      "name": "xxx品类",
      "projectCode": null,
      "aiotPoints": 1,
      "alarmWorkOrder": 0,
      "processedAlarmWorkOrder": 0,
      "processRate": "100.00"
    }
  ],
  "msg": "操作成功"
}

6.15查询设备总数

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/equipment/overview

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
total设备总数Long16
online实时在线率String16

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "total": 163,
    "online": "36.20"
  },
  "msg": "操作成功"
}

6.16查询产品统计设备数量

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/selectListTree

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
name设备分类String32
total总数int16
onlineCount离线long16
warnCount告警long16

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": [
    {
      "name": "xx设备",
      "code": "xxx10",
      "parentCode": "-1",
      "status": null,
      "childNodes": [],
      "level": 1,
      "pathCode": "xxxx",
      "createTime": null,
      "updateTime": null,
      "total": 3,
      "onlineCount": 3,
      "warnCount": 0
    }
  ],
  "msg": "操作成功"
}

6.17查询设备在线率

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/equipment/online

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
localDate日期String32
localDateString日期转换后String32
online在线率String8
total总数Integer8

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": [
    {
      "localDate": "2025-11-11",
      "localDateString": "xx月xx号",
      "online": "35.40",
      "total": null
    }
  ],
  "msg": "操作成功"
}

6.18按时间类型查询告警数量

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/alarm/overview

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
timeType时间范围类型Integer时间范围类型,【1:7天内、2:本月、3:半年内、4:1年内;(包含当天)】

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
totalToday今日新增告警总数Integer8
totalYesterday昨日新增告警总数Integer8
totalWeek本周新增告警总数Integer8
totalLastWeek上周新增告警总数Integer8
totalHistory历史累积告警总数Integer8
alarmStatisticsVoList告警数据折线图
time告警日期String32
count告警数量Integer8
alarmRankingVoList告警排名
name设备/属性类型String64
count对应设备/属性类型的告警次数

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "totalToday": 0,
    "totalYesterday": 0,
    "totalWeek": 0,
    "totalLastWeek": 1,
    "totalHistory": 1,
    "alarmStatisticsVoList": [
      {
        "time": "2025-11-12",
        "count": 1
      }
    ],
    "alarmRankingVoList": [
      {
        "name": "水浸",
        "count": "1"
      }
    ]
  },
  "msg": "操作成功"
}

6.19查询工单完成率

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/order/statistics

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
name工单类型String64
complete完成率String16
taskSpecId工单idString64

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": [
    {
      "name": "报事xxx",
      "complete": "41.61",
      "taskSpecId": null
    }
  ],
  "msg": "操作成功"
}

6.20获取电表的实时开关门状态(义乌定制)

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/electricity/open/status

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
productCode产品编码String必填

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据List
diddidString64
openStatus开门状态int1:开门 0:关门

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": [
    {
      "did": "7400090830528114688",
      "openStatus": 1
    },
    {
      "did": "7400090830528114688",
      "openStatus": 1
    }
  ],
  "msg": "操作成功"
}

6.21统计指定产品的设备状态

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/equipment/status/statistics

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
productCode产品编码String必填

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
totalCount设备总数int
offLineCount离线设备数int
alarmCount告警设备数int

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "totalCount": 13,
    "offLineCount": 0,
    "alarmCount": 1
  },
  "msg": "操作成功"
}

6.22通过产品编码和IOT属性统计属性状态

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/property/status/statistics

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
productCode产品编码String必填
identifier属性标识符String必填

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
propertyValue属性状态String
totalCount设备数量int

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": [
    {
      "propertyValue": "未知",
      "totalCount": 1
    },
    {
      "propertyValue": "1",
      "totalCount": 1
    }
  ],
  "msg": "操作成功"
}

6.23通过楼栋获取开关门数量

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/countOpenApiOpenDoor

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
buildingCode楼栋code编码String
unitCode单元code编码String
floorCode楼层code编码String

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
totalShops商铺总数int16
realtimeOpen实时开门数量int16
realtimeOpenRate实时开门率String8
cumulativeOpenToday今日累计开门数量int16
cumulativeOpenTodayRate今日累计开门率String8
stableOpenToday今日稳定开门数量int16
stableOpenTodayRate今日稳定开门率String8

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": {
    "totalShops": 2,
    "realtimeOpen": 0,
    "realtimeOpenRate": "0.00",
    "cumulativeOpenToday": 2,
    "cumulativeOpenTodayRate": "100.00",
    "stableOpenToday": 2,
    "stableOpenTodayRate": "100.00"
  },
  "msg": "操作成功"
}

6.24批量关闭未处理告警事件

请求方式: POST

请求路径:/api/open/smartpark-equipment/openApi/closeAlarmIncidentOpenApi

请求参数

参数参数含义类型长度是否必填说明
projectCode项目code编码String必填
incidentIds事件idList必填
handleAdvice原因String必填

返回参数

参数参数含义数据类型最大长度说明
code标识是否操作成功String200:显示成功
successtrueBoolean
data返回数据Object
id事件IDLong16
resultReason处理意见String32

返回参数示例:

json
{
  "code": 200,
  "success": true,
  "data": [
    {
      "id": 1,
      "resultReason": "告警已派单或不存在,无法关闭告警"
    }
  ],
  "msg": "操作成功"
}

7.附录

7.1 告警状态

状态码描述
0未处理
1已派单
2暂不受理
3误报
4重复预警已受理
5已转发
6工单完成
7手动关闭

7.2 告警级别

状态码描述
0提示
1一般
2重要
3紧急

7.3 工单状态

状态码描述
Unassigned待领取
Processing进行中
To be reviewed待验收
To be evaluated待评价
Completed已完成
Cancelled已撤销
Retired已作废
Holding已挂起

7.4 Java签名示例代码

java
import java.nio.charset.StandardCharsets;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.entity.ContentType;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StringUtils;
import org.springframework.web.client.RestTemplate;

@Slf4j
public class OpenApiClientAuth {

    private OpenApiClientAuth() {
    }

    private static final String DATE = "Date";
    private static final String KEY_MAC_SHA1 = "HmacSHA1";
    private static final String CONTENT_TYPE = "Content-Type";
    private static final String AUTHORIZATION = "Authorization";
    private static final DateTimeFormatter DATE_TIME_FORMATTER = 
        DateTimeFormatter.ofPattern("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.ENGLISH);

    private static Map<String, String> getSignHeaders(final String httpMethod,
            final String url, final String clientId, final String clientSecret, final String contentType) throws Exception {
        final String pathResource = OpenApiClientAuth.getPathResource(url);
        final String contentTypeValue = contentType != null ? contentType : "application/json";
        final String dateValue = DATE_TIME_FORMATTER.format(ZonedDateTime.now(ZoneId.of("GMT")));
        final String sign = OpenApiClientAuth.calculateSing(httpMethod, contentTypeValue, dateValue, pathResource, clientSecret);
        final Map<String, String> authHeaders = new HashMap<>(4);
        authHeaders.put(OpenApiClientAuth.DATE, dateValue);
        authHeaders.put(OpenApiClientAuth.AUTHORIZATION, clientId + ":" + sign);
        authHeaders.put(OpenApiClientAuth.CONTENT_TYPE, contentTypeValue);
        return authHeaders;
    }

    private static String getPathResource(final String url) {
        final String substring = url.substring(url.indexOf("://") + 3);
        return substring.substring(substring.indexOf('/'));
    }

    private static String calculateSing(final String httpMethodString, final String contentTypeValue,
            final String dateValue, final String pathResource, final String appSecret) throws Exception {
        final String signToString = OpenApiClientAuth.builderStringToSign(httpMethodString, contentTypeValue, dateValue, pathResource);
        final String base64HashString = hmacSha1Encrypt(signToString, appSecret);
        return base64HashString.substring(5, 15);
    }

    private static String builderStringToSign(final String method, final String contentTypeValue,
            final String dateValue, final String pathResource) {
        return method
                + "\n"
                + OpenApiClientAuth.handleNullString(contentTypeValue)
                + "\n"
                + OpenApiClientAuth.handleNullString(dateValue)
                + "\n"
                + pathResource;
    }

    private static String handleNullString(final String str) {
        return !StringUtils.hasText(str) ? "" : str;
    }

    private static String hmacSha1Encrypt(final String encryptText, final String encryptKey) throws Exception {
        final byte[] text = encryptText.getBytes(StandardCharsets.UTF_8);
        final byte[] keyData = encryptKey.getBytes(StandardCharsets.UTF_8);
        final SecretKeySpec secretKey = new SecretKeySpec(keyData, KEY_MAC_SHA1);
        final Mac mac = Mac.getInstance(secretKey.getAlgorithm());
        mac.init(secretKey);
        return new String(Base64.getEncoder().encode(mac.doFinal(text)), StandardCharsets.UTF_8);
    }

    /**
     * @param url 请求地址
     * @param body 请求参数 json格式
     * @param httpMethod 请求方法
     * @param clientId clientId
     * @param clientSecret clientSecret
     * @return 返回值
     */
    public static String openApiClientExecute(String url, String body, HttpMethod httpMethod,
            String clientId, String clientSecret) {
        log.info("request url:{},param:{},httpMethod:{},appKey:{},appSecret:{}", url, body, httpMethod, clientId, clientSecret);
        try {
            RestTemplate restTemplate = new RestTemplate();
            Map<String, String> signHeaders = OpenApiClientAuth.getSignHeaders(httpMethod.toString(), url, clientId,
                    clientSecret, ContentType.APPLICATION_JSON.toString());
            final HttpHeaders headers = new HttpHeaders();
            signHeaders.forEach(headers::set);
            if (!StringUtils.hasText(body)) {
                body = "";
            }
            final HttpEntity<String> httpEntity = new HttpEntity<>(body, headers);
            final ParameterizedTypeReference<String> parameterizedTypeReference = new ParameterizedTypeReference<String>() {
            };
            ResponseEntity<String> exchange = restTemplate.exchange(url, httpMethod, httpEntity, parameterizedTypeReference);
            String result = exchange.getBody();
            log.info("request url:{},param:{},httpMethod:{},appKey:{},appSecret:{},result:{}", url, body, httpMethod, clientId, clientSecret, result);
            return result;
        } catch (Exception e) {
            log.error("request error: ", e);
        }
        return null;
    }

    public static void main(String[] args) {
        String clientId = "yh5zmklapb0ehka0";
        String clientSecret = "cb9wt3osfum3gsle37trp4lrjk1kkq4ywcgpeeg7b9e602qe";
        String postUrl = "https://spup-uat.icloudcity.com/api/open/smartpark-equipment/openApi/test";
        JSONObject body = new JSONObject();
        body.put("projectCode", "项目编码");
        body.put("equipmentName", "设备名称");
        String s2 = openApiClientExecute(postUrl, body.toJSONString(), HttpMethod.POST, clientId, clientSecret);
        System.out.println(s2);
    }
}