客户端接收订舱数据时,判断已删除单据

master
zhangxiaofeng 4 months ago
parent 9634ab98cd
commit 65f60ddca4

@ -1279,9 +1279,25 @@ namespace Myshipping.Application
var dbOrder = await _repOrder.AsQueryable().Filter(null, true).FirstAsync(x => !x.IsDeleted && x.Id == recModel.Order.Id);
if (dbOrder == null)
{
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)) //提单号不覆盖
{

Loading…
Cancel
Save