Browse Source

调整

master
杨雷 3 months ago
parent
commit
eed6bfc8f7
1 changed files with 25 additions and 30 deletions
  1. +25
    -30
      TelpoPush.WanJiaAn.Worker/Handlers/WanJiaAnProcess.cs

+ 25
- 30
TelpoPush.WanJiaAn.Worker/Handlers/WanJiaAnProcess.cs View File

@@ -56,11 +56,11 @@ namespace TelpoPush.WanJiaAn.Worker.Handlers
if (string.IsNullOrEmpty(imei)) if (string.IsNullOrEmpty(imei))
{ {
_logger.LogInformation($"[数据信息不完整] imei信息不存在:{message}");
_logger.LogInformation($"[数据信息不完整] device_id信息不存在:{message}");
isHandle = false; isHandle = false;
} }
else
await _redis.GetGpsDevice(imei);
//else
// await _redis.GetGpsDevice(imei);
} }
else else
{ {
@@ -78,24 +78,27 @@ namespace TelpoPush.WanJiaAn.Worker.Handlers
{ {
lock (_syncLocker) lock (_syncLocker)
{ {
#region 注释 Headers 解析
//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 try
{ {
#region 注释 #region 注释
@@ -221,18 +224,10 @@ namespace TelpoPush.WanJiaAn.Worker.Handlers
// _logger.LogInformation($"数据未处理(历史数据):{JsonConvert.SerializeObject(dataStatus)}"); // _logger.LogInformation($"数据未处理(历史数据):{JsonConvert.SerializeObject(dataStatus)}");


#endregion #endregion

switch (topic) switch (topic)
{ {
case "topic.wanjiaan.push.telpo": case "topic.wanjiaan.push.telpo":
switch (headersDto.DataType)
{
case (int)MqDataType.WanJiaAnInfo: //定位消息
DataServicePusWanJiaAn(model, imei);
break;
default:
break;
}
DataServicePusWanJiaAn(model);
break; break;
default: default:
break; 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) if (model.data != null)
{ {


Loading…
Cancel
Save