From 200ee9739eb4425aee1c0ada0961f29a430e423d Mon Sep 17 00:00:00 2001 From: zhangxiaofeng <1939543722@qq.com> Date: Wed, 22 May 2024 16:50:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=88=B1=E4=BD=8D=E5=AF=BC=E5=85=A5=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingSlot/BookingSlotService.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs index 6c66ac27..86bf4aac 100644 --- a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs @@ -2073,10 +2073,18 @@ namespace Myshipping.Application .Select(x => x.SLOT_BOOKING_NO) .ToListAsync(); + List list = new List(); + result.ext = list; foreach (var item in data) { if (existsNoList.Contains(item.Key.SLOT_BOOKING_NO)) { + list.Add(new + { + IsSuccess = false, + FailReason = "此订舱编号已存在", + SlotBookingNo = item.Key.SLOT_BOOKING_NO + }); continue; } @@ -2090,15 +2098,15 @@ namespace Myshipping.Application }); await _repCtn.InsertAsync(item.Value); } + list.Add(new + { + IsSuccess = true, + SlotBookingNo = item.Key.SLOT_BOOKING_NO + }); } result.succ = true; - result.msg = $"导入成功,共导入{data.Count}条舱位信息"; - if (existsNoList.Any()) - { - result.msg += $";其中下列订舱编号因已在系统中已存在所以未导入:{string.Join("、", existsNoList)}"; - } } catch (Exception ex) {