|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922 |
- using AutoMapper.Internal;
- using GpsCardGatewayPosition.Common;
- using GpsCardGatewayPosition.Common.Helper;
- using GpsCardGatewayPosition.Model.Config;
- using GpsCardGatewayPosition.Model.Context;
- using GpsCardGatewayPosition.Model.Enum;
- using GpsCardGatewayPosition.Model.IoT;
- using GpsCardGatewayPosition.Model.Templates;
- using GpsCardGatewayPosition.Service.Biz;
- using GpsCardGatewayPosition.Service.Biz.Health;
- using GpsCardGatewayPosition.Service.Biz.Location;
- using GpsCardGatewayPosition.Service.Biz.Location.Dto;
- using GpsCardGatewayPosition.Service.Biz.Location.Dto.Gaode;
- using GpsCardGatewayPosition.Service.Biz.Location.Dto.Wayz;
- using GpsCardGatewayPosition.Service.Biz.Pay;
- using GpsCardGatewayPosition.Service.Biz.Sos;
- using GpsCardGatewayPosition.Service.Cache;
- using GpsCardGatewayPosition.Service.MqProducer;
- using GpsCardGatewayPosition.Service.MqProducer.Model;
- using GpsCardGatewayPosition.Service.Resolver.Interface;
- using GpsCardGatewayPosition.Service.Resolver.Property.Dto;
- using Microsoft.Extensions.Logging;
- using Microsoft.Extensions.Options;
- using Newtonsoft.Json;
- using Newtonsoft.Json.Linq;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using TelpoDataService.Util.Entities.GpsCard;
- using TelpoDataService.Util.Entities.GpsLocationHistory;
- using static GpsCardGatewayPosition.Service.Biz.Location.Dto.Wayz.WayzRequest;
-
- namespace GpsCardGatewayPosition.Service.Resolver.Property
- {
- public class WifiPlus2PositionResolver : IPropertyResolver
- {
- private readonly ILogger<WifiPlus2PositionResolver> _logger;
- private readonly WifiParamConfig _configWifiParam;
-
- private readonly DeviceCacheManager _deviceCacheMgr;
- private readonly GaodeService _serviceGaode;
- private readonly WayzService _serviceWayz;
-
- private readonly MqProcessLogic _serviceMqProcess;
- private readonly GlobalService _serviceGlobal;
- private readonly PayLogic _servicePay;
- private readonly SosLogic _serviceSos;
- private readonly HealthLogic _serviceHealth;
- private readonly LocationLogic _serviceLocation;
-
-
- private AsyncLocal<string> _messageId = new AsyncLocal<string>();
- private AsyncLocal<PropertyModel> _package = new AsyncLocal<PropertyModel>();
- private AsyncLocal<PropertyItemModel<List<EachWifiPlus2Model>>> _propertyValue = new AsyncLocal<PropertyItemModel<List<EachWifiPlus2Model>>>();
- private AsyncLocal<PackageMsgModel> _packageMsgModel = new AsyncLocal<PackageMsgModel>();
-
- public WifiPlus2PositionResolver(ILogger<WifiPlus2PositionResolver> logger, IOptions<WifiParamConfig> optConfigWifiParam,
- MqProcessLogic serviceMqProcess, GlobalService serviceGlobal, PayLogic servicePay, HealthLogic serviceHealth, LocationLogic serviceLocation,
- WayzService serviceWayz, SosLogic serviceSos, GaodeService serviceGaode, DeviceCacheManager deviceCacheMgr
- )
- {
- _serviceGlobal = serviceGlobal;
- _servicePay = servicePay;
- _serviceHealth = serviceHealth;
- _serviceLocation = serviceLocation;
- _serviceSos = serviceSos;
- _serviceMqProcess = serviceMqProcess;
-
- _serviceGaode = serviceGaode;
- _serviceWayz = serviceWayz;
- _deviceCacheMgr = deviceCacheMgr;
- _logger = logger;
- _configWifiParam = optConfigWifiParam.Value;
- }
-
- public void SetResolveInfo(PackageMsgModel msg)
- {
- _messageId.Value = msg.MessageId;
- _package.Value = ((JToken)msg.TopicInfo).ToObject<PropertyModel>()!;
- _propertyValue.Value = ((JToken)msg.DetailData).ToObject<PropertyItemModel<List<EachWifiPlus2Model>>>()!;
- }
- public override string ToString()
- {
- return $"{nameof(WifiPlus2PositionResolver)}[{_messageId.Value}]";
- }
- public async Task ExecuteMessageAsync()
- {
- var package = _package.Value;
- var serialno = package?.DeviceName;
- var messageId = _messageId.Value;
- var propertyValue = _propertyValue.Value;
-
-
-
-
-
-
-
- var device = new GpsDevice()
- {
- DeviceId = serialno,
- };
-
-
-
- DateTime now = DateTime.Now;
- LocationType type = LocationType.LBS;
- foreach (var item in propertyValue!.Value)
- {
- try
- {
- var datetime = Utils.ConvertToLocalDateTime(item.Datetime);
- var mmac = item.Mmac;
- var macs = item.Macs;
- var imei = item.Imei;
- var smac = item.Smac;
- var imsi = item.Imsi;
- var nearbts = item.NearBts;
- var network = item.Network;
- var cdma = item.Cdma;
- var bts = item.Bts;
- var IDType = item.IdType;
- var IDNumber = item.IdNumber;
- var steps = SafeType.SafeInt(item.Steps);
- bool isRedressed = false;
-
- if (imei.Contains("unkonw") || bts.Length == 0)
- {
- continue;
- }
-
- string cityCode = null;
- string addr = null;
- string province = null;
- string city = null;
- string district = null;
- decimal olat = 0;
- decimal olng = 0;
- decimal baiduLat = 0;
- decimal baiduLng = 0;
- decimal gaodeLat = 0;
- decimal gaodeLng = 0;
- int radius = 0;
- decimal[] latLngWifi = new decimal[4];
- decimal[] latLngLbs = new decimal[4];
- string hashParam = Guid.NewGuid().ToString();
-
-
- var WayzFullAddress = string.Empty;
-
- #region 定位解析
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #region 维智地图请求
-
- var wifiWayzItems = new List<WayzRequest.WifiItem>();
-
- if (mmac.Split(',').Length > 2)
- {
- wifiWayzItems.Add(new WifiItem
- {
- Connected = true,
- SignalStrength = Math.Abs(int.Parse(mmac.Split(',')[1])),
- MacAddress = mmac.Split(',')[0]
- });
- }
-
-
- if (macs.Split('|').Length > 1)
- {
- macs.Split('|').ForAll(mac =>
- {
- wifiWayzItems.Add(new WifiItem
- {
- Connected = false,
- SignalStrength = Math.Abs(int.Parse(mac.Split(',')[1])),
- MacAddress = mac.Split(',')[0]
- });
- });
- }
- var wifiWayzRequest = new WayzWifiRequest
- {
- Location = new LocationDetail
- {
- Wifis = wifiWayzItems
- },
- Asset = new AssetDevice
- {
- Id = serialno,
- ImeiMd5 = serialno,
- UniqueId = device.DeviceId
- }
- };
-
-
-
-
-
- var joWayzWifi = await _serviceWayz.GetWayzWifiAddressAsync(serialno, wifiWayzRequest).ConfigureAwait(false);
-
-
- var cellularWayzItems = new List<CellularItem>();
-
- if (cdma == 0)
- {
- var mcc = bts.Split(',')[0];
- var mnc = bts.Split(',')[1];
- var lac = bts.Split(',')[2];
- var cellId = bts.Split(',')[3];
- cellularWayzItems.Add(new CellularItem
- {
- CellId = int.Parse(cellId),
- RadioType = network,
- MobileCountryCode = int.Parse(mcc),
- MobileNetworkCode = int.Parse(mnc),
- LocationAreaCode = int.Parse(lac),
- });
-
- }
-
- else
- {
-
- var mnc = bts.Split(',')[0];
-
- var cellId = bts.Split(',')[2];
-
- var lac = bts.Split(',')[1];
-
- cellularWayzItems.Add(new CellularItem
- {
- CellId = int.Parse(cellId),
- RadioType = network,
-
- MobileNetworkCode = int.Parse(mnc),
- LocationAreaCode = int.Parse(lac),
- });
-
- }
-
- var lbsWayzRequest = new WayzLbsRequest
- {
- Location = new LocationDetail
- {
- Cellulars = cellularWayzItems
- },
- Asset = new AssetDevice
- {
- Id = serialno,
- ImeiMd5 = serialno,
- UniqueId = device.DeviceId
- }
-
- };
-
-
-
-
-
- var joWayzLbs = await _serviceWayz.GetWayzLbsAddressAsync(serialno, lbsWayzRequest).ConfigureAwait(false);
-
- #endregion
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if (joWayzLbs.Flag)
- {
- cityCode = joWayzLbs.AdCode;
- addr = joWayzLbs.Address;
- province = joWayzLbs.Province;
- city = joWayzLbs.City;
- district = joWayzLbs.District;
- radius = joWayzLbs.Accuracy;
-
-
- latLngLbs = GeoConvert.ConvertGoogleBaiduLatLng(joWayzLbs.Lat, joWayzLbs.Lon);
- olat = joWayzLbs.Lat;
- olng = joWayzLbs.Lon;
- baiduLng = latLngLbs[3];
- baiduLat = latLngLbs[2];
- gaodeLng = latLngLbs[1];
- gaodeLat = latLngLbs[0];
- hashParam = joWayzLbs.HashParam;
- WayzFullAddress = joWayzLbs.FullAddress;
- }
-
-
- if (joWayzWifi.Flag)
- {
-
- latLngWifi = GeoConvert.ConvertGoogleBaiduLatLng(joWayzWifi.Lat, joWayzWifi.Lon);
-
-
-
- double distance_1st = 0;
-
- var distance = distance_1st = joWayzLbs.Flag ? GeoUtils.GetDistance2((double)joWayzWifi.Lon, (double)joWayzWifi.Lat, (double)joWayzLbs.Lon, (double)joWayzLbs.Lat) : 0;
- if (distance >= 1 * 10000)
- {
- _logger.LogWarning($"lbs漂移较大 [{joWayzLbs.AdCode}] [{joWayzLbs.Address}]");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
-
-
-
- if (distance < 1 * 10000)
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #region 2022/11/11 增加判断wifi解析的地址是为空或null,就采用LBS的地址解析信息,否则用wifi解析的地址信息
-
-
-
- if (!string.IsNullOrEmpty(joWayzWifi.Address))
- {
- cityCode = joWayzWifi.AdCode;
- addr = joWayzWifi.Address;
- province = joWayzWifi.Province;
- city = joWayzWifi.City;
- district = joWayzWifi.District;
- radius = joWayzWifi.Accuracy;
-
- olat = joWayzWifi.Lat;
- olng = joWayzWifi.Lon;
- baiduLng = latLngWifi[3];
- baiduLat = latLngWifi[2];
- gaodeLng = latLngWifi[1];
- gaodeLat = latLngWifi[0];
-
- type = LocationType.WIFI;
- hashParam = joWayzWifi.HashParam;
- WayzFullAddress = joWayzWifi.FullAddress;
- }
-
- else if (!string.IsNullOrEmpty(joWayzLbs.Address))
- {
- cityCode = joWayzLbs.AdCode;
- addr = joWayzLbs.Address;
- province = joWayzLbs.Province;
- city = joWayzLbs.City;
- district = joWayzLbs.District;
- radius = joWayzLbs.Accuracy;
-
- olat = joWayzLbs.Lat;
- olng = joWayzLbs.Lon;
- baiduLng = latLngLbs[3];
- baiduLat = latLngLbs[2];
- gaodeLng = latLngLbs[1];
- gaodeLat = latLngLbs[0];
-
- type = LocationType.LBS;
- hashParam = joWayzLbs.HashParam;
- WayzFullAddress = joWayzLbs.FullAddress;
-
- }
-
- else
- {
- return;
- }
- #endregion
-
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
-
- else
- {
- _logger.LogInformation($"维智服务不能解析wifi数据,将采用高德服务解析");
- var wifiGaodeRequest = new GaodeWifiRequest
- {
-
- Macs = macs,
- Mmac = mmac
- };
- var joGaodeWifi = await _serviceGaode.GetGaodeWifiAddressAsync(serialno, wifiGaodeRequest);
- if (joGaodeWifi.Flag)
- {
- _logger.LogInformation($"高德服务解析解析wifi定位数据");
- cityCode = joGaodeWifi.AdCode;
- addr = joGaodeWifi.Address;
- province = joGaodeWifi.Province;
- city = joGaodeWifi.City;
- district = joGaodeWifi.District;
- radius = joGaodeWifi.Accuracy;
-
- olat = joGaodeWifi.Lat;
- olng = joGaodeWifi.Lon;
-
- latLngWifi = GeoConvert.ConvertGoogleBaiduLatLng(joGaodeWifi.Lat, joGaodeWifi.Lon);
-
- baiduLng = latLngWifi[3];
- baiduLat = latLngWifi[2];
- gaodeLng = latLngWifi[1];
- gaodeLat = latLngWifi[0];
-
- type = LocationType.WIFI;
- hashParam = joGaodeWifi.HashParam;
-
- WayzFullAddress = string.Format("{0}|{1}", "_Gaode", joGaodeWifi.Address);
-
-
-
-
-
- }
- else
- {
- _logger.LogInformation($"维智服务和高德服务解析都不能解析wifi定位数据");
- }
-
- }
-
-
- var positionStatus = await _deviceCacheMgr.GetPositionStatusCacheAsync(imei).ConfigureAwait(false);
- var eachParam = mmac.Split(',');
- var signal = Convert.ToInt32(eachParam[1]);
-
- if (positionStatus?.LastPosition != null)
- {
- if (!joWayzLbs.Flag && !joWayzWifi.Flag)
- {
- if (joWayzLbs.CanRetry || joWayzWifi.CanRetry)
- {
- await _serviceWayz.SendRealtimeLocationAsync(serialno, Utils.ConvertToLocalDateTime(propertyValue.Time), RealtimeLocationTypeFlag.All);
- }
-
-
- _logger.LogInformation($"设备{serialno},{nameof(WifiPlus2PositionResolver)} 解析不了地址,丢弃不入库,但写日志");
- return;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #endregion
-
- #region 保存历史轨迹
- var loc = new LocationInfo
- {
- LocationId = Guid.NewGuid().ToString("D"),
- Address = addr,
- BaiduLat = baiduLat,
- BaiduLng = baiduLng,
- OLat = olat,
- OLng = olng,
- GLat = gaodeLat,
- GLng = gaodeLng,
- Course = 0,
- DeviceId = device.DeviceId,
- DeviceStatus = radius.ToString(),
- IsStop = false,
- LastUpdate = Utils.ConvertToLocalDateTime(propertyValue.Time),
- UtcDate = Utils.ConvertToUtcDateTime(propertyValue.Time),
- LocationType = (int)type,
- Remarks = cityCode,
- SerialNo = serialno,
- Speed = 0,
- Postcode = cityCode,
- IsRedressed = isRedressed,
- HashParam = hashParam,
- Province = province,
- City = city,
- District = district
- };
- loc.Remarks = string.Format("Wayz_WifiPlus2|{0}", WayzFullAddress);
-
-
- var requestPositionData = new object();
- if (loc.LocationType == 2)
- {
- var requestLbsPositionData = new RequestLocationInfo<WayzLbsRequest>
- {
- MapSource = 2,
- RequestLocationType = loc.LocationType,
- RequestData = lbsWayzRequest
- };
- requestPositionData = requestLbsPositionData;
- }
-
- if (loc.LocationType == 3)
- {
- var requestWifiPositionData = new RequestLocationInfo<WayzWifiRequest>
- {
- MapSource = 2,
- RequestLocationType = loc.LocationType,
- RequestData = wifiWayzRequest
- };
- requestPositionData = requestWifiPositionData;
- }
-
-
-
-
- var result = await _serviceLocation.AddLocationAsync(messageId, loc, positionStatus, propertyValue.Time, cityCode, steps, requestPositionData).ConfigureAwait(false);
- if (!result.IsSuccess)
- {
- _logger.LogError($"{result.Message}");
- return;
- }
- #endregion
-
- if (radius <= Consts.RadiusThreshold)
- {
- #region 处理围栏
-
- if (!result.IsHistoryLocation)
- {
- _serviceLocation.ProcessGeofence(loc, messageId);
- }
- else
- {
- _logger.LogInformation($"设备{serialno},收到历史定位");
- }
- #endregion
- }
-
- #region 保存最后位置信息
- var context = "online=1";
- var deviceStatus = await _deviceCacheMgr.GetDeviceStatusBySerialNoAsync(messageId, serialno).ConfigureAwait(false);
- var statusContext = new DeviceStatus();
- if (deviceStatus != null)
- {
- statusContext.Deserlize(deviceStatus.DeviceStatus);
- }
- statusContext.Deserlize(context);
-
-
- deviceStatus = new GpsDeviceStatus
- {
- Address = addr,
- IsStop = (bool)loc.IsStop,
- BaiduLat = baiduLat,
- BaiduLng = baiduLng,
- Olat = olat,
- Olng = olng,
- Glat = gaodeLat,
- Glng = gaodeLng,
- Course = loc.Course,
- DeviceId = loc.DeviceId,
- DeviceStatus = statusContext.ToString(),
- DeviceUtcTime = loc.UtcDate,
- LastUpdate = loc.LastUpdate,
- LocationType = loc.LocationType,
- Remarks = loc.LocationId,
- Serialno = loc.SerialNo,
-
- Speed = SafeType.SafeInt(loc.DeviceStatus)
- };
-
- var updateOper = await _serviceLocation.UpdateDeviceStatusAsync(messageId, deviceStatus).ConfigureAwait(false);
- if (!updateOper.IsSuccess)
- {
- _logger.LogError($"{updateOper.Message}");
- return;
- }
-
-
- var positionData = new LocationDatas()
- {
- imei = loc.SerialNo,
- altitude = 0,
- address = loc.Address,
- baiduLatitude = loc.BaiduLat,
- baiduLongitude = loc.BaiduLng,
- gaodeLatitude = loc.GLat,
- gaodeLongitude = loc.GLng,
- originalLatitude = loc.OLat,
- originalLongitude = loc.OLng,
- locationType = loc.LocationType,
- postcode = loc.Postcode,
- hashParam = loc.HashParam,
- radius = radius,
- province = province,
- city = city,
- district = district
- };
-
- await _serviceMqProcess.ProcessPositionAsync(messageId, positionData, loc.LastUpdate.Value.ToString("yyyy-MM-dd HH:mm:ss"), $"{mmac}|{macs}");
- #endregion
-
- #region 更新Alarm
- if (IDType == (int)IdType.Sos && !string.IsNullOrWhiteSpace(IDNumber))
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var sosId = IDNumber;
-
- await _serviceSos.HandleSosAddressAsync(messageId, sosId, propertyValue.Time, () => new HisGpsAlarm
- {
- DeviceId = device.DeviceId,
- MessageId = sosId,
- Serialno = serialno,
- TypeId = (int)AlarmType.SosAlarm,
- CreateTime = DateTime.Now,
- DeviceUtcTime = Utils.ConvertToUtcDateTime(propertyValue.Time),
-
- Olat = loc.OLat,
- Olng = loc.OLng,
- BaiduLat = loc.BaiduLat,
- BaiduLng = loc.BaiduLng,
- Glat = loc.GLat,
- Glng = loc.GLng
- },
- a =>
- {
- a.Olat = loc.OLat;
- a.Olng = loc.OLng;
- a.BaiduLat = loc.BaiduLat;
- a.BaiduLng = loc.BaiduLng;
- a.Glat = loc.GLat;
- a.Glng = loc.GLng;
- return a;
- },
- async () => {
- var SOSAlarm = new SoSTemplates()
- {
- imei = serialno,
- sosId = IDNumber,
- address = loc.Address,
- info = "您的宝贝在求救",
- baiduLatitude = loc.BaiduLat,
- baiduLongitude = loc.BaiduLng,
- gaodeLatitude = loc.GLat,
- gaodeLongitude = loc.GLng,
- originalLatitude = loc.OLat,
- originalLongitude = loc.OLng,
- };
- await _serviceMqProcess.ProcessAlarmSosAsync(messageId, SOSAlarm, loc.LastUpdate.Value.ToString("yyyy-MM-dd HH:mm:ss"));
- });
- }
- else if (IDType == (int)IdType.PayLog && !string.IsNullOrWhiteSpace(IDNumber))
- {
- var payId = IDNumber;
- var pay = await _servicePay.GetPayLogAsync(messageId, $"{serialno}-{payId}").ConfigureAwait(false);
-
- if (pay == null)
- {
- pay = new GpsPayLog
- {
- Serialno = serialno,
- Payid = $"{serialno}-{payId}",
- DeviceId = device.DeviceId,
-
- Olat = loc.OLat,
- Olng = loc.OLng,
- BaiduLat = loc.BaiduLat,
- BaiduLng = loc.BaiduLng,
- Glat = loc.GLat,
- Glng = loc.GLng
- };
- await _servicePay.AddPayLogAsync(messageId, pay).ConfigureAwait(false);
- }
- else
- {
- pay.Olat = loc.OLat;
- pay.Olng = loc.OLng;
- pay.BaiduLat = loc.BaiduLat;
- pay.BaiduLng = loc.BaiduLng;
- pay.Glat = loc.GLat;
- pay.Glng = loc.GLng;
- await _servicePay.UpdatePayLogAsync(messageId, pay).ConfigureAwait(false);
- }
- }
- else if (IDType == (int)IdType.Temperature && !string.IsNullOrWhiteSpace(IDNumber))
- {
- var tempId = IDNumber;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- await _serviceHealth.HandleTemperatureAddressAsync(messageId, $"{serialno}-{tempId}", () => new HisGpsTemperature
- {
- TemperatureId = $"{serialno}-{tempId}",
- Serialno = serialno,
- Address = addr,
- Province = province,
- City = city,
- District = district,
- LastUpdate = Utils.ConvertToLocalDateTime(propertyValue.Time),
- TempId = tempId
- },
- a =>
- {
- a.Address = addr;
- a.Province = province;
- a.City = city;
- a.District = district;
- return a;
- },
-
- null,
- type
- );
- }
- #endregion
-
-
- await _serviceGlobal.PushLocationDataAsync(serialno, olat, olng);
-
- }
- catch (Exception ex)
- {
-
- _logger.LogError($"ProcessWifiPlus2Info[异常], Item: {JsonConvert.SerializeObject(item)}\n {ex.Message}, {ex.StackTrace}");
- }
- }
- }
-
-
- }
- }
|