bug fixed: message head改为Int型,便于比较
This commit is contained in:
parent
b4d0f27cc7
commit
7856919104
@ -33,13 +33,13 @@ public class D3F0SelfCheckMessageExecutor implements Executor<D3F0SelfCheckMessa
|
|||||||
if(device == null) return null;
|
if(device == null) return null;
|
||||||
message.setTenantId(device.getTenantId());
|
message.setTenantId(device.getTenantId());
|
||||||
|
|
||||||
// 通知beidou服务
|
|
||||||
beidouClient.onDeviceActive(message.getId());
|
|
||||||
// 存储最新设备状态信息到数据库中
|
|
||||||
ThreadManager.getFixedThreadPool().submit(() -> {
|
ThreadManager.getFixedThreadPool().submit(() -> {
|
||||||
dataPersistService.saveDeviceState(message);
|
dataPersistService.saveDeviceState(message);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 通知beidou服务
|
||||||
|
beidouClient.onDeviceActive(message.getId());
|
||||||
|
// 存储最新设备状态信息到数据库中
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,7 @@ public class RtcmUdpHandler extends ChannelInboundHandlerAdapter {
|
|||||||
void procMessage(BaseMessage message, ChannelHandlerContext ctx, InetSocketAddress senderAddr){
|
void procMessage(BaseMessage message, ChannelHandlerContext ctx, InetSocketAddress senderAddr){
|
||||||
// 为加快处理速度,只有收到D3F0/D3F2时才更新通道,包括对端地址和绑定imei
|
// 为加快处理速度,只有收到D3F0/D3F2时才更新通道,包括对端地址和绑定imei
|
||||||
DeviceChannel deviceChannel = null;
|
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);
|
OnlineChannels.INSTANCE.updateDeviceChannel(message.getId(), ctx.channel(), senderAddr);
|
||||||
} else deviceChannel = OnlineChannels.INSTANCE.getDeviceChannel(message.getId());
|
} else deviceChannel = OnlineChannels.INSTANCE.getDeviceChannel(message.getId());
|
||||||
|
|
||||||
|
|||||||
@ -103,7 +103,7 @@ public class DataPersistServiceImpl implements DataPersistService {
|
|||||||
gnssMsg.setTenantid(message.getTenantId());
|
gnssMsg.setTenantid(message.getTenantId());
|
||||||
gnssMsg.setCreatetime(message.getCreateTime());
|
gnssMsg.setCreatetime(message.getCreateTime());
|
||||||
gnssMsg.setDeviceid(message.getId());
|
gnssMsg.setDeviceid(message.getId());
|
||||||
gnssMsg.setMsgtype(((int)message.getHeader())&0xFFFF);
|
gnssMsg.setMsgtype(message.getHeader());
|
||||||
gnssMsg.setMsglen(message.getLen());
|
gnssMsg.setMsglen(message.getLen());
|
||||||
msgMapper.insert(gnssMsg);
|
msgMapper.insert(gnssMsg);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
package com.imdroid.sideslope.web;
|
package com.imdroid.sideslope.web;
|
||||||
|
|
||||||
import com.imdroid.secapi.client.HttpResp;
|
import com.imdroid.secapi.client.HttpResp;
|
||||||
import com.imdroid.sideslope.calc.GNSSCalcService;
|
|
||||||
import com.imdroid.sideslope.server.DeviceChannel;
|
import com.imdroid.sideslope.server.DeviceChannel;
|
||||||
import com.imdroid.sideslope.server.OnlineChannels;
|
import com.imdroid.sideslope.server.OnlineChannels;
|
||||||
import com.imdroid.sideslope.util.DataTypeUtil;
|
import com.imdroid.sideslope.util.DataTypeUtil;
|
||||||
@ -9,9 +8,7 @@ import io.netty.buffer.ByteBuf;
|
|||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.net.URLDecoder;
|
import java.net.URLDecoder;
|
||||||
@ -28,9 +25,6 @@ public class ApiController {
|
|||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(ApiController.class);
|
private final Logger logger = LoggerFactory.getLogger(ApiController.class);
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private GNSSCalcService gnssCalcService;
|
|
||||||
|
|
||||||
@PostMapping(value = "/config")
|
@PostMapping(value = "/config")
|
||||||
public HttpResp config(String deviceId, String configuration) {
|
public HttpResp config(String deviceId, String configuration) {
|
||||||
Map<String, Object> status = new HashMap<>();
|
Map<String, Object> status = new HashMap<>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user