try
This commit is contained in:
parent
4fb127ed47
commit
f5f9227aeb
@ -1,6 +1,7 @@
|
||||
using DotNetCore.CAP;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||
using SJZY.InterfaceRelay.Application.Contracts;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackPush;
|
||||
@ -306,16 +307,19 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
||||
if (config.IsAllPushWithLatest)
|
||||
{
|
||||
var old = body!.Data
|
||||
.Where(x => x["code"] == cur["code"])
|
||||
.WhereIf(!compareFields.IsNullOrWhiteSpace(), x =>
|
||||
{
|
||||
if (x["extra"] is Dictionary<string, object> extra && extra.TryGetValue(compareFields!, out var value))
|
||||
if (x["extra"] == null || log.Extra == null) return false;
|
||||
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) )
|
||||
{
|
||||
return value ==log.Extra![compareFields!];
|
||||
return value == curValue;
|
||||
}
|
||||
|
||||
return false;
|
||||
})
|
||||
.FirstOrDefault(x => x["code"] == cur["code"]);
|
||||
.FirstOrDefault();
|
||||
if (old != null)
|
||||
{
|
||||
body.Data.Remove(old);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user