设备审核接口1

This commit is contained in:
mi9688
2024-12-19 16:06:17 +08:00
parent 42011de122
commit 12a6f75767
4 changed files with 93 additions and 43 deletions

View File

@ -51,21 +51,21 @@ public class DeviceOtherMsgConsumer {
System.err.println("主题:"+topic+"--产品id:"+productId+"--设备序列号:"+serialNumber);
//设备上报数据消息
if(topic.endsWith("/info/up")){
if(topic.endsWith("hzlink/info/up")){
deviceDataReportHandler(new String(data));
//构建回复消息
Map<String,Object> reportMsg=new HashMap<>();
reportMsg.put("code",0);
reportMsg.put("msg","ok");
issueInstructionsProducer.receiveDataReportResponse(productId.toString(),serialNumber,JSONUtil.toJsonStr(reportMsg));
} else if ( topic.endsWith("/info/reply")) {
} else if ( topic.endsWith("hzlink/info/reply")) {
platformDataReportAckHandler(new String(data));
} else if (topic.endsWith("cmd/down")) {
} else if (topic.endsWith("hzlink/cmd/down")) {
platformCmdHandler(new String(data));
//回应
} else if (topic.endsWith("cmd/reply")) {
} else if (topic.endsWith("hzlink/cmd/reply")) {
deviceCmdAckHandler(new String(data));
}
otherMsgHandler.messageHandler(bo);

View File

@ -16,8 +16,8 @@ public class IssueInstructionsProducer {
@Autowired
private PubMqttCallBack pubMqttCallBack;
private final String issueInstructionsTopicTemplate = "/{0}/{1}/cmd/down";//平台给设备下发指令主题模板
private final String receiveDataReportResponseTopicTemplate = "/{0}/{1}/info/reply";//平台回应收到设备上报数据主题模板
private final String issueInstructionsTopicTemplate = "hzlink/{0}/{1}/cmd/down";//平台给设备下发指令主题模板
private final String receiveDataReportResponseTopicTemplate = "hzlink/{0}/{1}/info/reply";//平台回应收到设备上报数据主题模板
/**
* 平台给设备下发的指令