From 01c450315821167d1c99ff53b0c02382f3761357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=BE=99=20=E7=8E=8B?= Date: Wed, 4 Dec 2024 09:46:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E5=90=8E=E4=B8=BB=E8=AE=A2=E5=8D=95=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9B=B4=E6=96=B0=E5=BC=82=E5=B8=B8=20fix:=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BD=A8=E8=BF=B9=E6=96=B0=E5=A2=9E/?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=B6=E7=BC=BA=E5=A4=B1=E7=9A=84=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=EF=BC=9A=E9=A2=84=E8=AE=A1=E5=88=B0=E8=BE=BE=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CAP/EventHandlers/TrackDeleteEventHandler.cs | 8 +++++++- .../Services/ProvideServices/TrackService.cs | 4 ++-- .../Aggregates/OrderAggregate/OrderEntity.cs | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/SJZY.Track.Application/CAP/EventHandlers/TrackDeleteEventHandler.cs b/src/SJZY.Track.Application/CAP/EventHandlers/TrackDeleteEventHandler.cs index 08e079d6..230a456c 100644 --- a/src/SJZY.Track.Application/CAP/EventHandlers/TrackDeleteEventHandler.cs +++ b/src/SJZY.Track.Application/CAP/EventHandlers/TrackDeleteEventHandler.cs @@ -232,6 +232,8 @@ public class TrackDeleteEventHandler : ITransientDependency, ICapSubscribe LatestTrackPlace = x.LatestTrackPlace, LatestTrackTime = x.LatestTrackTime, LatestTrackTimeZone = x.LatestTrackTimeZone, + EstimatedDeliveryDate = x.EstimatedDeliveryDate, + DestinationTimeZone = x.DestinationTimeZone }); if (orders.Count == 0) return tracks; @@ -258,6 +260,8 @@ public class TrackDeleteEventHandler : ITransientDependency, ICapSubscribe order.LatestTrackPlace = track.TrackPlace; order.LatestTrackTime = track.TrackTime; order.LatestTrackTimeZone = track.TrackTimeZone; + order.EstimatedDeliveryDate = track.EstimatedDeliveryDate; + order.DestinationTimeZone = track.DestinationTimeZone; } @@ -281,7 +285,9 @@ public class TrackDeleteEventHandler : ITransientDependency, ICapSubscribe x.LatestTrackEnContent, x.LatestTrackPlace, x.LatestTrackTime, - x.LatestTrackTimeZone + x.LatestTrackTimeZone, + x.EstimatedDeliveryDate, + x.DestinationTimeZone }); return tracks; diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs index b1afaa30..4e90f379 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs @@ -62,7 +62,7 @@ public partial class TrackService : ApplicationService, ITrackService //要求时间在当前时间的前后100年之间内 bool ValidateTrackTime(DateTime? d) => (d != null && d < DateTime.Now.AddYears(-100) || d > DateTime.Now.AddYears(100)); - if (ValidateTrackTime(input.TrackTime) || ValidateTrackTime(input.NewTrackTime)) + if (ValidateTrackTime(input.TrackTime) || ValidateTrackTime(input.NewTrackTime) || ValidateTrackTime(input.EstimatedDeliveryDate)) { throw new BusinessException(message: "轨迹时间不合法"); } @@ -330,7 +330,7 @@ public partial class TrackService : ApplicationService, ITrackService //要求时间在当前时间的前后100年之间内 bool ValidateTrackTime(DateTime? d) => (d != null && d < DateTime.Now.AddYears(-100) || d > DateTime.Now.AddYears(100)); - if (ValidateTrackTime(input.TrackTime) || ValidateTrackTime(input.NewTrackTime)) + if (ValidateTrackTime(input.TrackTime) || ValidateTrackTime(input.NewTrackTime) || ValidateTrackTime(input.EstimatedDeliveryDate)) { throw new BusinessException(message: "轨迹时间不合法"); } diff --git a/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderEntity.cs b/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderEntity.cs index 762c1324..eaf3ca71 100644 --- a/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderEntity.cs +++ b/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderEntity.cs @@ -201,5 +201,7 @@ public class OrderEntity : IFullAuditedBasicEntitys, IAggregateRoot LatestTrackTime = null; LatestTrackPlace = null; LatestTrackTimeZone = null; + EstimatedDeliveryDate = null; + DestinationTimeZone = null; } }