舱位导入调整

master
zhangxiaofeng 6 months ago
parent ab1094a022
commit 200ee9739e

@ -2073,10 +2073,18 @@ namespace Myshipping.Application
.Select(x => x.SLOT_BOOKING_NO) .Select(x => x.SLOT_BOOKING_NO)
.ToListAsync(); .ToListAsync();
List<object> list = new List<object>();
result.ext = list;
foreach (var item in data) foreach (var item in data)
{ {
if (existsNoList.Contains(item.Key.SLOT_BOOKING_NO)) if (existsNoList.Contains(item.Key.SLOT_BOOKING_NO))
{ {
list.Add(new
{
IsSuccess = false,
FailReason = "此订舱编号已存在",
SlotBookingNo = item.Key.SLOT_BOOKING_NO
});
continue; continue;
} }
@ -2090,15 +2098,15 @@ namespace Myshipping.Application
}); });
await _repCtn.InsertAsync(item.Value); await _repCtn.InsertAsync(item.Value);
} }
list.Add(new
{
IsSuccess = true,
SlotBookingNo = item.Key.SLOT_BOOKING_NO
});
} }
result.succ = true; result.succ = true;
result.msg = $"导入成功,共导入{data.Count}条舱位信息";
if (existsNoList.Any())
{
result.msg += $";其中下列订舱编号因已在系统中已存在所以未导入:{string.Join("", existsNoList)}";
}
} }
catch (Exception ex) catch (Exception ex)
{ {

Loading…
Cancel
Save