This commit is contained in:
2023-09-14 09:41:58 +08:00
parent 9e62fc2b9e
commit 8ffb290425
3 changed files with 10 additions and 26 deletions

View File

@@ -1,21 +0,0 @@
package com.njcn.access.pojo.dto.heart;
import com.njcn.access.annotation.ParamName;
import lombok.Data;
import java.io.Serializable;
/**
* 类的介绍:
*
* @author xuyang
* @version 1.0.0
* @createTime 2023/4/28 10:42
*/
@Data
public class HeartBeatDto implements Serializable {
@ParamName("Time")
private Long time;
}

View File

@@ -14,7 +14,6 @@ import com.njcn.access.enums.TypeEnum;
import com.njcn.access.pojo.RspDataDto;
import com.njcn.access.pojo.dto.*;
import com.njcn.access.pojo.dto.file.FileDto;
import com.njcn.access.pojo.dto.heart.HeartBeatDto;
import com.njcn.access.pojo.param.ReqAndResParam;
import com.njcn.access.pojo.po.CsDeviceOnlineLogs;
import com.njcn.access.pojo.po.CsLineModel;
@@ -383,15 +382,15 @@ public class MqttMessageHandler {
csEquipmentDeliveryService.updateRunStatusBynDid(nDid,AccessEnum.ONLINE.getCode());
//处理心跳
ReqAndResDto.Res reqAndResParam = new ReqAndResDto.Res();
HeartBeatDto heartBeatDto = new HeartBeatDto();
//fixme 前置处理的时间应该是UTC时间所以需要加8小时。
heartBeatDto.setTime(System.currentTimeMillis()/1000+8*3600);
reqAndResParam.setMid(res.getMid());
reqAndResParam.setDid(0);
reqAndResParam.setPri(AccessEnum.FIRST_CHANNEL.getCode());
reqAndResParam.setType(Integer.parseInt(TypeEnum.TYPE_29.getCode()));
reqAndResParam.setCode(200);
reqAndResParam.setMsg(heartBeatDto);
//fixme 前置处理的时间应该是UTC时间所以需要加8小时。
String json = "{Time:\""+(System.currentTimeMillis()/1000+8*3600)+"\"}";
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(json);
reqAndResParam.setMsg(jsonObject);
publisher.send("/Dev/DataRsp/"+version+"/"+nDid,gson.toJson(reqAndResParam),1,false);
//处理业务逻辑
Object object = res.getMsg();

View File

@@ -242,4 +242,10 @@ public class EventServiceImpl implements IEventService {
}
return result;
}
/**
* 发送通知消息
*/
}