bug fixed: message head改为Int型,便于比较

This commit is contained in:
weidong 2023-12-10 08:57:44 +08:00
parent b4d0f27cc7
commit 7856919104
4 changed files with 5 additions and 11 deletions

View File

@ -33,13 +33,13 @@ public class D3F0SelfCheckMessageExecutor implements Executor<D3F0SelfCheckMessa
if(device == null) return null;
message.setTenantId(device.getTenantId());
// 通知beidou服务
beidouClient.onDeviceActive(message.getId());
// 存储最新设备状态信息到数据库中
ThreadManager.getFixedThreadPool().submit(() -> {
dataPersistService.saveDeviceState(message);
});
// 通知beidou服务
beidouClient.onDeviceActive(message.getId());
// 存储最新设备状态信息到数据库中
return null;
}

View File

@ -74,7 +74,7 @@ public class RtcmUdpHandler extends ChannelInboundHandlerAdapter {
void procMessage(BaseMessage message, ChannelHandlerContext ctx, InetSocketAddress senderAddr){
// 为加快处理速度只有收到D3F0/D3F2时才更新通道包括对端地址和绑定imei
DeviceChannel deviceChannel = null;
if (message.getHeader() == (short) 0xD3F0 || message.getHeader() == (short) 0xD3F2) {
if (message.getHeader() == 0xD3F0 || message.getHeader() == 0xD3F2) {
OnlineChannels.INSTANCE.updateDeviceChannel(message.getId(), ctx.channel(), senderAddr);
} else deviceChannel = OnlineChannels.INSTANCE.getDeviceChannel(message.getId());

View File

@ -103,7 +103,7 @@ public class DataPersistServiceImpl implements DataPersistService {
gnssMsg.setTenantid(message.getTenantId());
gnssMsg.setCreatetime(message.getCreateTime());
gnssMsg.setDeviceid(message.getId());
gnssMsg.setMsgtype(((int)message.getHeader())&0xFFFF);
gnssMsg.setMsgtype(message.getHeader());
gnssMsg.setMsglen(message.getLen());
msgMapper.insert(gnssMsg);
}

View File

@ -1,7 +1,6 @@
package com.imdroid.sideslope.web;
import com.imdroid.secapi.client.HttpResp;
import com.imdroid.sideslope.calc.GNSSCalcService;
import com.imdroid.sideslope.server.DeviceChannel;
import com.imdroid.sideslope.server.OnlineChannels;
import com.imdroid.sideslope.util.DataTypeUtil;
@ -9,9 +8,7 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.net.URLDecoder;
@ -28,9 +25,6 @@ public class ApiController {
private final Logger logger = LoggerFactory.getLogger(ApiController.class);
@Autowired
private GNSSCalcService gnssCalcService;
@PostMapping(value = "/config")
public HttpResp config(String deviceId, String configuration) {
Map<String, Object> status = new HashMap<>();