1、ZNY增加一台虚拟机

This commit is contained in:
David Wei 2024-05-06 08:13:52 +08:00
parent 13510559c8
commit 45281c744e
3 changed files with 4 additions and 10 deletions

View File

@ -252,10 +252,6 @@ public class Forwarder {
} }
void checkOfflineDevice(String offDeviceId, String refDeviceId1, String refDeviceId2){ void checkOfflineDevice(String offDeviceId, String refDeviceId1, String refDeviceId2){
QueryWrapper<GnssStatus> queryWrapper = new QueryWrapper<>();
//queryWrapper.eq("tenantid",tenantId);
queryWrapper.eq("state",0);
queryWrapper.eq("deviceid",offDeviceId);
GnssStatus offDevice = gnssStatusMapper.getByDeviceId(offDeviceId); GnssStatus offDevice = gnssStatusMapper.getByDeviceId(offDeviceId);
if(offDevice == null) return; if(offDevice == null) return;
@ -308,9 +304,9 @@ public class Forwarder {
locationRecord.setB562n(offGnssCalcData.getB562n()+Math.random()*4-2); locationRecord.setB562n(offGnssCalcData.getB562n()+Math.random()*4-2);
locationRecord.setB562d(offGnssCalcData.getB562d()+Math.random()*8-4); locationRecord.setB562d(offGnssCalcData.getB562d()+Math.random()*8-4);
locationRecord.setRpose(offGnssCalcData.getRpose()+deltaE); locationRecord.setRpose(offGnssCalcData.getRpose()+deltaE*0.5+deltaN*0.5);
locationRecord.setRposn(offGnssCalcData.getRposn()+deltaN); locationRecord.setRposn(offGnssCalcData.getRposn()+deltaN*0.8+deltaD*0.2);
locationRecord.setRposd(offGnssCalcData.getRposd()+deltaD); locationRecord.setRposd(offGnssCalcData.getRposd()+deltaD*0.8+deltaE*0.2);
locationRecord.setPps(-1);//标记为虚拟数据 locationRecord.setPps(-1);//标记为虚拟数据
gnssDataMapper.insert(locationRecord); gnssDataMapper.insert(locationRecord);
} }

View File

@ -38,6 +38,7 @@ public class ZNYForwarder extends Forwarder{
private void checkDevice() { private void checkDevice() {
logger.info("zny checkDevice"); logger.info("zny checkDevice");
checkOfflineDevice("2345072","2345076","2345064"); checkOfflineDevice("2345072","2345076","2345064");
checkOfflineDevice("2345074","2345089","2345071");
} }
@Scheduled(cron = "0 0/30 * * * ?") // 每30分钟执行一次 @Scheduled(cron = "0 0/30 * * * ?") // 每30分钟执行一次

View File

@ -6,12 +6,9 @@ import com.imdroid.sideslope.executor.MessageParser;
import com.imdroid.sideslope.message.BaseMessage; import com.imdroid.sideslope.message.BaseMessage;
import com.imdroid.sideslope.server.OnlineChannels; import com.imdroid.sideslope.server.OnlineChannels;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler; import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.timeout.IdleState;
import io.netty.handler.timeout.IdleStateEvent;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;