1、增加设备的使用状态判断,如果不是正常使用,就不处理这台设备的d331,也不推送
This commit is contained in:
parent
b1f4ad1599
commit
046d73ebaf
@ -18,6 +18,10 @@ public class GnssDevice {
|
||||
public static final short TYPE_ROVER = 0;
|
||||
public static final short TYPE_REFERENCE_STATION = 1;
|
||||
|
||||
public static final short OP_MODE_USE = 0;
|
||||
public static final short OP_MODE_CHECK = 1;
|
||||
public static final short OP_MODE_UNUSE = 2;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Integer tenantid;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.imdroid.sideslope.executor;
|
||||
|
||||
import com.imdroid.secapi.dto.GnssDevice;
|
||||
import com.imdroid.sideslope.message.D331RtcmMessage;
|
||||
import com.imdroid.sideslope.sal.Device;
|
||||
import com.imdroid.sideslope.sal.DeviceService;
|
||||
@ -32,7 +33,7 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
|
||||
}
|
||||
// 补齐tenantId
|
||||
Device device1 = deviceService.findByDeviceId(message.getId());
|
||||
if(device1 == null) return null;
|
||||
if(device1 == null || device1.getOpMode()!= GnssDevice.OP_MODE_USE) return null;
|
||||
message.setTenantId(device1.getTenantId());
|
||||
device1.updateD331Bytes(message.getLen());
|
||||
|
||||
@ -41,6 +42,7 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
|
||||
// 要求快速转发,因此用缓存,不要每次都查数据库
|
||||
List<Device> deviceList = deviceService.findByParentId(id);
|
||||
for (Device device : deviceList) {
|
||||
if(device.getOpMode()!=GnssDevice.OP_MODE_USE) continue;
|
||||
String deviceId = device.getDeviceId();
|
||||
OnlineChannels.INSTANCE.get(deviceId).ifPresent(deviceChannel -> {
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
||||
@ -34,6 +34,7 @@ public class DbDeviceServiceImpl implements DeviceService {
|
||||
device.setName(gnssDevice.getName());
|
||||
device.setProjectId(gnssDevice.getProject_id());
|
||||
device.setCalcGroupId(gnssDevice.getCalc_group_id());
|
||||
device.setOpMode(gnssDevice.getOpmode());
|
||||
return device;
|
||||
}
|
||||
|
||||
@ -51,6 +52,7 @@ public class DbDeviceServiceImpl implements DeviceService {
|
||||
device.setName(gnssDevice.getName());
|
||||
device.setProjectId(gnssDevice.getProject_id());
|
||||
device.setCalcGroupId(gnssDevice.getCalc_group_id());
|
||||
device.setOpMode(gnssDevice.getOpmode());
|
||||
deviceList.add(device);
|
||||
}
|
||||
return deviceList;
|
||||
|
||||
@ -32,6 +32,7 @@ public class Device {
|
||||
private Integer deviceType;
|
||||
|
||||
private Integer calcGroupId;
|
||||
private Short opMode;
|
||||
|
||||
int d3xxbytes = 0;
|
||||
int b562bytes = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user