fix:修复删除轨迹引起的订单更新缺失轨迹状态
This commit is contained in:
parent
8c7a1c5fc1
commit
7b692553d2
@ -219,6 +219,7 @@ public class TrackDeleteEventHandler : ITransientDependency, ICapSubscribe
|
||||
x => new OrderEntity
|
||||
{
|
||||
Id = x.Id,
|
||||
LatestTrackStatus = x.LatestTrackStatus,
|
||||
LatestTrackContent = x.LatestTrackContent,
|
||||
LatestTrackEnContent = x.LatestTrackEnContent,
|
||||
LatestTrackPlace = x.LatestTrackPlace,
|
||||
@ -236,7 +237,7 @@ public class TrackDeleteEventHandler : ITransientDependency, ICapSubscribe
|
||||
.FirstOrDefault(x => x.OrderId == order.Id);
|
||||
|
||||
// 删除全部轨迹导致的重置行为
|
||||
if (track == default)
|
||||
if (track == null)
|
||||
{
|
||||
if (order.LatestTrackTime == null) continue;
|
||||
|
||||
@ -247,6 +248,7 @@ public class TrackDeleteEventHandler : ITransientDependency, ICapSubscribe
|
||||
{
|
||||
if (order.LatestTrackContent == track.TrackContent) continue;
|
||||
// 删除引发的回退更新
|
||||
order.LatestTrackStatus = track.TrackStatus;
|
||||
order.LatestTrackContent = track.TrackContent;
|
||||
order.LatestTrackEnContent = track.TrackEnContent;
|
||||
order.LatestTrackPlace = track.TrackPlace;
|
||||
@ -261,6 +263,7 @@ public class TrackDeleteEventHandler : ITransientDependency, ICapSubscribe
|
||||
await _orderRepository.UpdateRangeAsync(orders,
|
||||
x => new
|
||||
{
|
||||
x.LatestTrackStatus,
|
||||
x.LatestTrackContent,
|
||||
x.LatestTrackEnContent,
|
||||
x.LatestTrackPlace,
|
||||
|
||||
@ -213,6 +213,7 @@ public class OrderEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||
public void ResetTrackInfo()
|
||||
{
|
||||
IsCompleted = false;
|
||||
LatestTrackStatus = null;
|
||||
LatestTrackContent = null;
|
||||
LatestTrackEnContent = null;
|
||||
LatestTrackTime = null;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user