From 10ae83cc8668671744912903316853c62723d316 Mon Sep 17 00:00:00 2001 From: wanghaomei <86whm@163.com> Date: Thu, 4 Jul 2024 14:04:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E8=81=94id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Event/BookingSyncSubscriber.cs | 9 ++++++--- .../BookingCustomerOrderService.cs | 16 ++++++++++------ .../Service/BookingCustomerOrder/Dto/Dtos.cs | 1 + 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Myshipping.Application/Event/BookingSyncSubscriber.cs b/Myshipping.Application/Event/BookingSyncSubscriber.cs index 309f3347..adc989b9 100644 --- a/Myshipping.Application/Event/BookingSyncSubscriber.cs +++ b/Myshipping.Application/Event/BookingSyncSubscriber.cs @@ -518,11 +518,14 @@ namespace Myshipping.Application.Event _logger.LogInformation($"根据客户订舱反馈数据 {custOrder.BSNO} 生成了相同的数据 {custOrder.Id}"); //插入订舱台账 - var ordId = await servCustOrder.CustomerToOrder(custOrder); - custOrder.BookingId = ordId; + var ord = await servCustOrder.CustomerToOrder(custOrder); + custOrder.BookingId = ord.Id; await repoCutomerOrder.AsUpdateable(custOrder).UpdateColumns(x => new { x.BookingId }).ExecuteCommandAsync(); - _logger.LogInformation($"生成了订舱台账数据 {ordId}"); + ord.BSNO = item.GetStringValue("OrderId"); + await repoOrder.AsUpdateable(ord).UpdateColumns(x => new { x.BSNO }).ExecuteCommandAsync(); + + _logger.LogInformation($"生成了订舱台账数据 {ord.Id}"); } } diff --git a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs index 310ba26b..a6eb8c1d 100644 --- a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs +++ b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs @@ -1180,7 +1180,8 @@ namespace Myshipping.Application //进入客户订舱系统的订舱台账 if (recModel.Accept) { - bookingId = await CustomerToOrder(model); + var ord = await CustomerToOrder(model); + bookingId = ord.Id; model.BookingId = bookingId; //客户订舱数据与订舱台账数据关联 await _rep.UpdateAsync(model); @@ -1673,10 +1674,13 @@ namespace Myshipping.Application _logger.LogInformation($"根据客户订舱 {recModel.Id} 生成了相同的数据 {model.Id}"); //插入订舱台账 - var ordId = await CustomerToOrder(model); - respDtO.OrderId = ordId; + var ord = await CustomerToOrder(model); + model.BookingId = ord.Id; + await _rep.AsUpdateable(model).UpdateColumns(x => new { x.BookingId }).ExecuteCommandAsync(); - _logger.LogInformation($"生成了订舱台账数据 {ordId}"); + respDtO.OrderId = ord.Id; + + _logger.LogInformation($"生成了订舱台账数据 {ord.Id}"); } @@ -1693,7 +1697,7 @@ namespace Myshipping.Application /// /// [NonAction] - public async Task CustomerToOrder(BookingCustomerOrder custOrd) + public async Task CustomerToOrder(BookingCustomerOrder custOrd) { var bkOrder = custOrd.Adapt(); bkOrder.Id = YitIdHelper.NextId(); @@ -1738,7 +1742,7 @@ namespace Myshipping.Application await _repFile.InsertAsync(file); } - return bkOrder.Id; + return bkOrder; } /// diff --git a/Myshipping.Application/Service/BookingCustomerOrder/Dto/Dtos.cs b/Myshipping.Application/Service/BookingCustomerOrder/Dto/Dtos.cs index 116db433..0acd53b1 100644 --- a/Myshipping.Application/Service/BookingCustomerOrder/Dto/Dtos.cs +++ b/Myshipping.Application/Service/BookingCustomerOrder/Dto/Dtos.cs @@ -534,6 +534,7 @@ namespace Myshipping.Application /// /// 通知人联系人姓 /// + public string NotifypartLastName { get; set; } /// /// 通知人电话国家代码