|
@@ -72,6 +72,9 @@ public class SnapshotOrderApplication : IOrderSnapshotApplication, IScopeDepende
|
|
|
public async Task<string> AddOrderPublishAsync(AddSnapshotOrderPublishInDto dto, CancellationToken cancellation)
|
|
|
{
|
|
|
dto.ValidateObject();
|
|
|
+ var oldPublish = await _snapshotOrderPublishRepository.Queryable().Where(m => m.OrderId == dto.OrderId).FirstAsync(cancellation);
|
|
|
+ if (oldPublish != null)
|
|
|
+ await _snapshotOrderPublishRepository.RemoveAsync(oldPublish,cancellationToken: cancellation);
|
|
|
var snapshotOrder = await _orderSnapshotRepository.GetAsync(dto.OrderId)
|
|
|
?? throw UserFriendlyException.SameMessage("工单不存在");
|
|
|
var order = await _orderRepository.Queryable()
|