微调
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -242,4 +242,10 @@ public class EventServiceImpl implements IEventService {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送通知消息
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user