diff --git a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs index 87c9742f..f8d96b62 100644 --- a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs +++ b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs @@ -1280,7 +1280,23 @@ namespace Myshipping.Application var dbOrder = await _repOrder.AsQueryable().Filter(null, true).FirstAsync(x => !x.IsDeleted && x.Id == recModel.Order.Id); if (dbOrder == null) { - throw Oops.Bah($"未找到id为{recModel.Order.Id}的数据"); + if (syncType == BookingOrderSyncTypeEnum.BC.ToString()) + { + dbOrder = await _repOrder.AsQueryable().Filter(null, true).FirstAsync(x => x.IsDeleted && x.Id == recModel.Order.Id); + if (dbOrder == null) + { + throw Oops.Bah($"未找到id为{recModel.Order.Id}的数据"); + } + else + { + dbOrder.IsDeleted = false; + _logger.LogInformation($"从已删除订单中找到:{recModel.Order.Id},恢复为未删除"); + } + } + else + { + throw Oops.Bah($"未找到id为{recModel.Order.Id}的数据"); + } } if (!string.IsNullOrEmpty(dbOrder.MBLNO)) //提单号不覆盖