MQ订阅消息

通过MQ订阅系统消息格式说明。

消息定义

消息体

字段

类型

说明

EventCatgory

String

事件分类,取值范围:

"DEVICE":设备事件

"BIZ": 业务事件

Event

String

事件说明:

"DEVICE_OFFLINE": 设备下线

"DEVICE_PROPERTY":设备属性变更

"BIZ_REFRESH_DELAY":显示延迟

"BIZ_BATTERY_LOW":缺电

"BIZ_EVENT_STATUS_CHANGE": 事件状态变更

"BIZ_PING": 连通性测试消息

"BIZ_SEND":价签已发送指令

"BIZ_SEND_FAILED":价签发送指令失败

"BIZ_DISPLAY_RETRYING":价签显示重试中

"BIZ_DISPLAY_TEMPO_FAILED":价签显示重试失败

"BIZ_DISPLAY_SUCCESS":价签显示成功

"BIZ_DISPLAY_FAILED":价签显示失败

EventId

String

事件唯一id

EventTime

Long

事件发生时间

Payload

JsonObject

详见各消息说明

Payload字段定义

字段

类型

说明

Type

String

分类,取值范围:

AP:基站

ESL:价签

DeviceBarCode

String

设备条码

StoreId

String

门店id

ItemBarCode

String

商品条码

ItemId

String

自定义商品编码

ItemTitle

String

商品title

PropertyKey

String

变更的属性名称

目前支持的是BatteryLevel

PropertyVal

String

变更的属性值

BatteryLevel

String

电量值

WarningLevel

String

配置的阈值

ProcessedInfo

JsonObject

事件处理结果

ProcessedInfo字段定义

字段

类型

说明

Staff

String

处理的员工名称

Time

Long

处理时间

Reason

String

处理定位原因和采取的操作

Status

String

当前状态,取值:

新建:"New"

处理中:"Processing"

已取消:"Cancel"

已完结:"Close"

重新开启:"Reopen"

消息内容

基站离线

基站与云价签系统连接中断后触发消息,例如:门店网络故障或基站故障

{
  "EventCatgory":"DEVICE",
  "Event":"DEVICE_OFFLINE",
  "EventId":"abfhjkfsbeuyftfkhjlj",
  "EventTime":1648096954000,
  "Payload":{
    "Type":"AP",
    "DeviceBarCode":"abcdefg",
    "StoreId":"s-123456"
  }
}

价签电量变更

云价签电量发生变化时触发消息

{
  "EventCatgory":"DEVICE",
  "Event":"DEVICE_PROPERTY",
  "EventId":"abfhjkfsbeuyftfkhjlj",
  "EventTime":1648096954000,
  "Payload":{
    "Type":"ESL",
    "PropertyKey":"BatteryLevel",
    "PropertyVal":"30",
    "DeviceBarCode":"abcdefg",
    "StoreId":"s-123456",
    "ItemBarCode":"1245677966",
    "ItemId":"1245677966",
    "ItemTitle":"澳洲大龙虾"
  }
}

价签显示延迟

云价签在下发商品信息后超过设定时间还未显示成功时触发消息

{
  "EventCatgory":"BIZ",
  "Event":"BIZ_REFRESH_DELAY",
  "EventId":"abfhjkfsbeuyftfkhjlj",
  "EventTime":1648096954000,
  "Payload":{
    "Type":"ESL",
    "DeviceBarCode":"abcdefg",
    "StoreId":"s-123456",
    "ItemBarCode":"1245677966",
    "ItemId":"1245677966",
    "ItemTitle":"澳洲大龙虾",
    "DelayTime":30000
  }
}

价签缺电

云价签电量低于设定最低阈值时触发消息

{
  "EventCatgory":"DEVICE",
  "Event":"BIZ_BATTERY_LOW",
  "EventId":"abfhjkfsbeuyftfkhjlj",
  "EventTime":1648096954000,
  "Payload":{
    "Type":"ESL",
    "DeviceBarCode":"abcdefg",
    "StoreId":"s-123456",
    "ItemBarCode":"1245677966",
    "ItemId":"1245677966",
    "ItemTitle":"澳洲大龙虾",
    "WarningLevel":30,
    "BatteryLevel":25
  }
}

事件处理结果

通过预警规则生成的事件被处理时触发消息

{
  "EventCatgory":"DEVICE",
  "Event":"BIZ_BATTERY_LOW",
  "EventId":"abfhjkfsbeuyftfkhjlj",
  "EventTime":1648096954000,
  "Payload":{
    "Type":"ESL",
    "DeviceBarCode":"abcdefg",
    "StoreId":"s-123456",
    "ItemBarCode":"1245677966",
    "ItemId":"1245677966",
    "ItemTitle":"澳洲大龙虾",
    "WarningLevel":30,
    "BatteryLevel":25,
    "ProcessedInfo":{
      "Staff":"林老板",
      "Time":1648097054000,
      "Reason":"更换价签",
      "Status":"Close"
    }
  }
}

连通性测试

验证MQ配置正确性时触发消息,消费方可以忽略该消息,仅用于连通性测试

{
  "EventCatgory":"BIZ",
  "Event":"BIZ_PING",
  "EventId":"abfhjkfsbeuyftfkhjlj",
  "EventTime":1648096954000,
  "Payload":{
  }
}

价签显示重试中

当价签系统进行重新下发内容时触发消息,系统会在有效期内不断进行重试,消费方可能收到多次重试消息

{
  "EventCatgory":"BIZ",
  "Event":"BIZ_DISPLAY_RETRYING",
  "EventId":"abfhjkfsbeuyftfkhjlj",
  "EventTime":1648096954000,
  "Payload":{
    "Type":"ESL",
    "DeviceBarCode":"abcdefg",
    "StoreId":"s-123456",
    "ItemBarCode":"1245677966",
    "ItemId":"1245677966",
    "ItemTitle":"澳洲大龙虾"
  }
}

价签显示重试失败

当价签系统进行重新下发内容后再次失败时触发消息,该消息不是显示内容的最终态,仅表示当前重试过程失败,后续会继续发起重试操作

{
  "EventCatgory":"BIZ",
  "Event":"BIZ_DISPLAY_TEMPO_FAILED",
  "EventId":"abfhjkfsbeuyftfkhjlj",
  "EventTime":1648096954000,
  "Payload":{
    "Type":"ESL",
    "DeviceBarCode":"abcdefg",
    "StoreId":"s-123456",
    "ItemBarCode":"1245677966",
    "ItemId":"1245677966",
    "ItemTitle":"澳洲大龙虾"
  }
}

价签显示成功

当价签显示内容成功后触发消息

{
  "EventCatgory":"BIZ",
  "Event":"BIZ_DISPLAY_SUCCESS",
  "EventId":"abfhjkfsbeuyftfkhjlj",
  "EventTime":1648096954000,
  "Payload":{
    "Type":"ESL",
    "DeviceBarCode":"abcdefg",
    "StoreId":"s-123456",
    "ItemBarCode":"1245677966",
    "ItemId":"1245677966",
    "ItemTitle":"澳洲大龙虾"
  }
}

价签显示失败

当价签显示内容失败后触发消息,该消息为失败最终态,消费方收到该消息,可以判定为再次下发过程已经失败,系统不会再重新下发

{
  "EventCatgory":"BIZ",
  "Event":"BIZ_DISPLAY_FAILED",
  "EventId":"abfhjkfsbeuyftfkhjlj",
  "EventTime":1648096954000,
  "Payload":{
    "Type":"ESL",
    "DeviceBarCode":"abcdefg",
    "StoreId":"s-123456",
    "ItemBarCode":"1245677966",
    "ItemId":"1245677966",
    "ItemTitle":"澳洲大龙虾"
  }
}