diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackPushService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackPushService.cs index ec3289a3..ca74ebe4 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackPushService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackPushService.cs @@ -104,7 +104,7 @@ public class TrackPushService : ApplicationService, ITrackPushService throw new BusinessException(message: $"当前轨迹不存在扩展信息,无法利用扩展字段:{input.CompareFields}"); } - var extraDict = GetExtraDictForTextJson(x.Extra); + var extraDict = TextJsonHelper.DeserializeToDictionary(x.Extra); if (extraDict == null || !extraDict.TryGetValue(input.CompareFields, out var compareValue)) { throw new BusinessException(message: $"请检查拓展字段,为什么找不到比较字段:{input.CompareFields}"); @@ -148,24 +148,6 @@ public class TrackPushService : ApplicationService, ITrackPushService await _capPublisher.PublishAsync(GlobalConst.TrackManualPushSubscribe, trackPushEvent); } - - // foreach (var group in orders.GroupBy(x => x.CustomId)) - // { - // var trackPushEvent = new TrackPushEvent - // { - // OptionType = OptionType.新增, - // SubSystemId = input.SubSystemId, - // SubSystemCode = subSystemCode, - // CustomId = group.Key, - // OrderIds = group.Select(x => x.Id).ToArray(), - // TrackCode = input.TrackCode, - // OperationMan = name, - // SystemPushInfo = new SystemPushStruct() - // }; - // - // await _capPublisher.PublishAsync(GlobalConst.TrackManualPushSubscribe, trackPushEvent); - // } - return new UnifyResultDto(true, $"即将推送轨迹代码{input.TrackCode}给{orders.Length}个订单"); } @@ -210,10 +192,5 @@ public class TrackPushService : ApplicationService, ITrackPushService return new UnifyResultDto>(true, res, "操作成功"); } - private Dictionary? GetExtraDictForTextJson(string? extraStr) - { - return string.IsNullOrWhiteSpace(extraStr) - ? null - : System.Text.Json.JsonSerializer.Deserialize>(extraStr); - } + }