review push event handler
This commit is contained in:
parent
cc84be2d84
commit
2d6b239b8f
@ -91,6 +91,7 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
||||
|
||||
private async Task DoPushAsync(TrackPushEvent @event)
|
||||
{
|
||||
// todo: 轨迹中台推送逻辑致使的未推送,也需要广播到mq,告知业务系统缘故
|
||||
var items = new List<TrackPushInput>();
|
||||
TrackPushContentConfigDto? config;
|
||||
var isSystemPush = @event.OperationMan == null;
|
||||
@ -99,12 +100,8 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
||||
foreach (var order in _orders)
|
||||
{
|
||||
if (order.QuestionType == (int) TrackProblemType.Error) continue; // 系统不推异常单,只能人工操作
|
||||
// 强制推送只需直接查出配置
|
||||
if (@event.ForcedPush)
|
||||
config = _pushConfigs.FirstOrDefault(x => x.TrackCode == @event.TrackCode);
|
||||
// 推送新增,需要根据上一次的推送 推断 本次推送 是否可行,为了约束顺序
|
||||
else
|
||||
config = GetValidPushConfigAsync(_pushConfigs, order.LatestPushTrackCode, @event.TrackCode);
|
||||
config = GetValidPushConfigAsync(_pushConfigs, order.LatestPushTrackCode, @event.TrackCode);
|
||||
if (config == null) continue;
|
||||
// 是否自动推送
|
||||
if (!config.IsAutoPush) continue;
|
||||
@ -311,6 +308,7 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
||||
.WhereIf(!compareFields.IsNullOrWhiteSpace(), x =>
|
||||
{
|
||||
if (x["extra"] == null || log.Extra == null) return false;
|
||||
// todo:这里也改成统一使用system txt json,不用newtonsoft了
|
||||
var extra = JObject.FromObject(x["extra"]!);
|
||||
var curExtra = JObject.FromObject(log.Extra!);
|
||||
if (extra.TryGetValue(compareFields!, out var value) && curExtra.TryGetValue(compareFields!, out var curValue) )
|
||||
|
||||
Loading…
Reference in New Issue
Block a user