From 4a759333ca265cd9e0dacdfce2d00f64d0bff5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Wed, 3 Apr 2024 09:13:47 +0800 Subject: [PATCH] =?UTF-8?q?change=EF=BC=9A=E6=8E=A8=E9=80=81=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EventHandlers/TrackPushEventHandler.cs | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/SJZY.Track.Application/EventHandlers/TrackPushEventHandler.cs b/src/SJZY.Track.Application/EventHandlers/TrackPushEventHandler.cs index e95906da..68ad47d4 100644 --- a/src/SJZY.Track.Application/EventHandlers/TrackPushEventHandler.cs +++ b/src/SJZY.Track.Application/EventHandlers/TrackPushEventHandler.cs @@ -39,9 +39,7 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe { x.SubSystemId, x.LatestPushTrackCode, x.QuestionType, x.CustomId }); - if (order == null || order.QuestionType == (int)TrackProblemType.Error) return; // 是否通知? - - TrackPushContentConfigDto? config; + if (order == null) return; var log = new TrackPushRecordIndex { @@ -58,6 +56,8 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe CreateTime = DateTime.Now }; + TrackPushContentConfigDto? config = null; + switch (@event.OptionType) { case OptionType.无: @@ -65,9 +65,12 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe case OptionType.新增: if (@event.OperationMan == null) { - // 推送新增,需要根据上一次的推送 推断 本次推送 是否可行 - config = await _trackPushCacheService.IsValidPushAsync(order.SubSystemId, order.CustomId, - order.LatestPushTrackCode, @event.TrackCode); + if (order.QuestionType != (int)TrackProblemType.Error) + { + // 推送新增,需要根据上一次的推送 推断 本次推送 是否可行 + config = await _trackPushCacheService.IsValidPushAsync(order.SubSystemId, order.CustomId, + order.LatestPushTrackCode, @event.TrackCode); + } } else { @@ -132,12 +135,17 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe // tips:只有新增会影响推送进度? order.LatestPushTrackCode = dto.TrackCode; order.LatestPushTime = DateTime.Now; + await _orderRepository.UpdateColumnAsync(order, x => new + { + x.LatestPushTrackCode, x.LatestPushTime, x.QuestionType, x.LatestPushError + }); + return; } } await _orderRepository.UpdateColumnAsync(order, x => new { - x.LatestPushTrackCode, x.QuestionType, x.LatestPushError, x.LatestPushTime + x.QuestionType, x.LatestPushError }); }