From eed6bfc8f7fd5c7e02a9270a83146c7fe5c72805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E9=9B=B7?= <284428564@QQ.com> Date: Thu, 8 Aug 2024 16:18:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Handlers/WanJiaAnProcess.cs | 55 +++++++++---------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/TelpoPush.WanJiaAn.Worker/Handlers/WanJiaAnProcess.cs b/TelpoPush.WanJiaAn.Worker/Handlers/WanJiaAnProcess.cs index 84646c9..34f8024 100644 --- a/TelpoPush.WanJiaAn.Worker/Handlers/WanJiaAnProcess.cs +++ b/TelpoPush.WanJiaAn.Worker/Handlers/WanJiaAnProcess.cs @@ -56,11 +56,11 @@ namespace TelpoPush.WanJiaAn.Worker.Handlers if (string.IsNullOrEmpty(imei)) { - _logger.LogInformation($"[数据信息不完整] imei信息不存在:{message}"); + _logger.LogInformation($"[数据信息不完整] device_id信息不存在:{message}"); isHandle = false; } - else - await _redis.GetGpsDevice(imei); + //else + // await _redis.GetGpsDevice(imei); } else { @@ -78,24 +78,27 @@ namespace TelpoPush.WanJiaAn.Worker.Handlers { lock (_syncLocker) { + #region 注释 Headers 解析 //Headers 解析 - HeadersDto headersDto = new HeadersDto(); - try - { - foreach (var item in headers) - { - if (item.Key == KafkaHeader.DataType) - headersDto.DataType = BitConverter.ToInt32(item.GetValueBytes(), 0); - else if (item.Key == KafkaHeader.AlarmType) - headersDto.AlarmType = BitConverter.ToInt32(item.GetValueBytes(), 0); - else if (item.Key == KafkaHeader.OperType) - headersDto.OperType = BitConverter.ToInt32(item.GetValueBytes(), 0); - } - } - catch (Exception ex) - { - _logger.LogError($"当前工作线程Headers异常,{ex.Message}|{ex.Source}|{ex.StackTrace}"); - } + //HeadersDto headersDto = new HeadersDto(); + //try + //{ + // foreach (var item in headers) + // { + // if (item.Key == KafkaHeader.DataType) + // headersDto.DataType = BitConverter.ToInt32(item.GetValueBytes(), 0); + // else if (item.Key == KafkaHeader.AlarmType) + // headersDto.AlarmType = BitConverter.ToInt32(item.GetValueBytes(), 0); + // else if (item.Key == KafkaHeader.OperType) + // headersDto.OperType = BitConverter.ToInt32(item.GetValueBytes(), 0); + // } + //} + //catch (Exception ex) + //{ + // _logger.LogError($"当前工作线程Headers异常,{ex.Message}|{ex.Source}|{ex.StackTrace}"); + //} + + #endregion try { #region 注释 @@ -221,18 +224,10 @@ namespace TelpoPush.WanJiaAn.Worker.Handlers // _logger.LogInformation($"数据未处理(历史数据):{JsonConvert.SerializeObject(dataStatus)}"); #endregion - switch (topic) { case "topic.wanjiaan.push.telpo": - switch (headersDto.DataType) - { - case (int)MqDataType.WanJiaAnInfo: //定位消息 - DataServicePusWanJiaAn(model, imei); - break; - default: - break; - } + DataServicePusWanJiaAn(model); break; default: break; @@ -248,7 +243,7 @@ namespace TelpoPush.WanJiaAn.Worker.Handlers } //位置 - public async Task DataServicePusWanJiaAn(BaseModel model,string imei) + public async Task DataServicePusWanJiaAn(BaseModel model) { if (model.data != null) {