修改获取平台证书接口;创建设备操作日志表

This commit is contained in:
2024-12-30 14:32:03 +08:00
parent aa97a61285
commit d7cd539478
13 changed files with 674 additions and 148 deletions

View File

@ -55,7 +55,7 @@ public class DeviceOtherMsgConsumer {
public void consume(DeviceReportBo bo){
try {
//处理emq订阅的非 property/post 属性上报的消息 ,因为其他消息量小,放在一起处理
Long productId;//产品id
Long productId;//产品id,设备所属产品
Long packetId;//包号
byte[] data = bo.getData();//数据
String topic=bo.getTopicName();//主题
@ -70,13 +70,13 @@ public class DeviceOtherMsgConsumer {
if(topic.endsWith("/info/up")){
deviceDataReportHandler(new String(data));
//更新设备在线状态
updateDeviceOnlineStatus( productId,serialNumber);
updateDeviceOnlineStatus( productId,serialNumber);//拼成一个唯一的key只要key存在则设备在线
// updateDeviceOnlineStatusDb(serialNumber);
//保存使用记录
NgWaterPumpUsageRecords pumpUsageRecords=new NgWaterPumpUsageRecords();
pumpUsageRecords.setDeviceNumber(serialNumber);
JSONObject jsonObject = JSONUtil.parseObj(data);
jsonObject.set("time", (LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))));
jsonObject.set("time", (LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))));//收到消息的当地时间
if(jsonObject.getStr("type")!=null){
if(jsonObject.getStr("type").equals("waterEleData")){
String data1 = jsonObject.getStr("data");