From 5e8bc21432992b32a4c80bb6645dd2f4cf468867 Mon Sep 17 00:00:00 2001 From: H Vs Date: Thu, 11 Jul 2024 17:45:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BB=E5=8F=96device=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appsettings.chaos.json | 2 +- .../Resolver/Property/GpsPositionResolver.cs | 18 +++++++++--------- .../Property/LbsGsmPositionResolver.cs | 18 +++++++++--------- .../Property/WifiPlus2PositionResolver.cs | 18 +++++++++--------- .../Resolver/Property/WifiPositionResolver.cs | 18 +++++++++--------- 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/GpsCardGatewayPosition.Postion/appsettings.chaos.json b/GpsCardGatewayPosition.Postion/appsettings.chaos.json index 3143991..060d2fb 100644 --- a/GpsCardGatewayPosition.Postion/appsettings.chaos.json +++ b/GpsCardGatewayPosition.Postion/appsettings.chaos.json @@ -1,7 +1,7 @@ { "AllowedHosts": "*", "ServiceConfig": { - "TelpoDataUrl": "http://192.168.12.134:6699", + "TelpoDataUrl": "http://192.168.12.120/data/", "MqServerAddress": "192.168.12.124:9092,192.168.12.125:9092,192.168.12.126:9092" }, "Appsettings": { diff --git a/GpsCardGatewayPosition.Service/Resolver/Property/GpsPositionResolver.cs b/GpsCardGatewayPosition.Service/Resolver/Property/GpsPositionResolver.cs index 0f7e940..b4be6f4 100644 --- a/GpsCardGatewayPosition.Service/Resolver/Property/GpsPositionResolver.cs +++ b/GpsCardGatewayPosition.Service/Resolver/Property/GpsPositionResolver.cs @@ -90,16 +90,16 @@ namespace GpsCardGatewayPosition.Service.Resolver.Property if (propertyValue == null) return; if (propertyValue.Value.Latitude == 0 || propertyValue.Value.Longitude == 0) return; - //var device = await _deviceCacheMgr.GetDeviceBySerialNoAsync(messageId!, serialno!).ConfigureAwait(false); - //if (device == null) - //{ - // _logger.LogError($"非法设备:{serialno}"); - // return; - //} - var device = new GpsDevice() + var device = await _deviceCacheMgr.GetDeviceBySerialNoAsync(messageId!, serialno!).ConfigureAwait(false); + if (device == null) { - DeviceId = serialno, - }; + _logger.LogError($"非法设备:{serialno}"); + return; + } + //var device = new GpsDevice() + //{ + // DeviceId = serialno, + //}; #region 定位解析 decimal[] latLng = GeoConvert.ConvertGoogleBaiduLatLng(propertyValue.Value.Latitude, propertyValue.Value.Longitude); diff --git a/GpsCardGatewayPosition.Service/Resolver/Property/LbsGsmPositionResolver.cs b/GpsCardGatewayPosition.Service/Resolver/Property/LbsGsmPositionResolver.cs index 2e843a0..d5fb091 100644 --- a/GpsCardGatewayPosition.Service/Resolver/Property/LbsGsmPositionResolver.cs +++ b/GpsCardGatewayPosition.Service/Resolver/Property/LbsGsmPositionResolver.cs @@ -93,16 +93,16 @@ namespace GpsCardGatewayPosition.Service.Resolver.Property var messageId = _messageId.Value; var propertyValue = _propertyValue.Value; - //var device = await _deviceCacheMgr.GetDeviceBySerialNoAsync(messageId!, serialno!).ConfigureAwait(false); - //if (device == null) - //{ - // _logger.LogError($"非法设备:{serialno}"); - // return; - //} - var device = new GpsDevice() + var device = await _deviceCacheMgr.GetDeviceBySerialNoAsync(messageId!, serialno!).ConfigureAwait(false); + if (device == null) { - DeviceId = serialno, - }; + _logger.LogError($"非法设备:{serialno}"); + return; + } + //var device = new GpsDevice() + //{ + // DeviceId = serialno, + //}; #region 定位解析 var bts = propertyValue.Value.Bts.Split(','); diff --git a/GpsCardGatewayPosition.Service/Resolver/Property/WifiPlus2PositionResolver.cs b/GpsCardGatewayPosition.Service/Resolver/Property/WifiPlus2PositionResolver.cs index 65e689e..4b592b1 100644 --- a/GpsCardGatewayPosition.Service/Resolver/Property/WifiPlus2PositionResolver.cs +++ b/GpsCardGatewayPosition.Service/Resolver/Property/WifiPlus2PositionResolver.cs @@ -92,16 +92,16 @@ namespace GpsCardGatewayPosition.Service.Resolver.Property var messageId = _messageId.Value; var propertyValue = _propertyValue.Value; - //var device = await _deviceCacheMgr.GetDeviceBySerialNoAsync(messageId!, serialno!).ConfigureAwait(false); - //if (device == null) - //{ - // _logger.LogError($"非法设备:{serialno}"); - // return; - //} - var device = new GpsDevice() + var device = await _deviceCacheMgr.GetDeviceBySerialNoAsync(messageId!, serialno!).ConfigureAwait(false); + if (device == null) { - DeviceId = serialno, - }; + _logger.LogError($"非法设备:{serialno}"); + return; + } + //var device = new GpsDevice() + //{ + // DeviceId = serialno, + //}; diff --git a/GpsCardGatewayPosition.Service/Resolver/Property/WifiPositionResolver.cs b/GpsCardGatewayPosition.Service/Resolver/Property/WifiPositionResolver.cs index 2c9bd16..ae5bf82 100644 --- a/GpsCardGatewayPosition.Service/Resolver/Property/WifiPositionResolver.cs +++ b/GpsCardGatewayPosition.Service/Resolver/Property/WifiPositionResolver.cs @@ -121,16 +121,16 @@ namespace GpsCardGatewayPosition.Service.Resolver.Property var startTwo = TimeSpan.Parse(_configWifiParam.StartTwo); var endTwo = TimeSpan.Parse(_configWifiParam.EndTwo); - //var device = await _deviceCacheMgr.GetDeviceBySerialNoAsync(messageId!, serialno!).ConfigureAwait(false); - //if (device == null) - //{ - // _logger.LogError($"非法设备:{serialno}"); - // return; - //} - var device = new GpsDevice() + var device = await _deviceCacheMgr.GetDeviceBySerialNoAsync(messageId!, serialno!).ConfigureAwait(false); + if (device == null) { - DeviceId = serialno, - }; + _logger.LogError($"非法设备:{serialno}"); + return; + } + //var device = new GpsDevice() + //{ + // DeviceId = serialno, + //};