From ed19e5e9837073fff51108aa66a1d0bcaaf8023c Mon Sep 17 00:00:00 2001 From: wanghaomei <86whm@163.com> Date: Fri, 12 Jul 2024 09:58:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9C=E8=83=9C=E5=B0=81=E8=B4=A6=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingCustomerOrderService.cs | 6 +++-- .../Service/DataSync/DataSyncService.cs | 24 +++++++++++++++++-- .../Service/DataSync/Dto/BookingOrderLock.cs | 5 ++++ 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs index 49a08ddf..db8daf36 100644 --- a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs +++ b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs @@ -2396,7 +2396,8 @@ namespace Myshipping.Application _logger.LogInformation($"回写订舱编号:{custNO},系统编号:{model.BOOKINGNO}"); bkOrder.CUSTNO = custNO; - await _repOrder.AsUpdateable(bkOrder).UpdateColumns(x => new { x.CUSTNO }).ExecuteCommandAsync(); + bkOrder.BSSTATUS = "已订舱"; + await _repOrder.AsUpdateable(bkOrder).UpdateColumns(x => new { x.CUSTNO, x.BSSTATUS }).ExecuteCommandAsync(); CustomerBookingSyncHelper.SendCustomerBookingSync(bkOrder.Id, BookingOrderSyncTypeEnum.CC.ToString()); _logger.LogInformation($"回写订舱号并回推客户端:{bkOrder.Id} {custNO}"); } @@ -2410,7 +2411,8 @@ namespace Myshipping.Application _logger.LogInformation($"回写订舱编号:{custNO},系统编号:{model.BOOKINGNO}"); bkOrder.CUSTNO = custNO; - await _repOrder.AsUpdateable(bkOrder).UpdateColumns(x => new { x.CUSTNO }).ExecuteCommandAsync(); + bkOrder.BSSTATUS = "已订舱"; + await _repOrder.AsUpdateable(bkOrder).UpdateColumns(x => new { x.CUSTNO, x.BSSTATUS }).ExecuteCommandAsync(); CustomerBookingSyncHelper.SendCustomerBookingSync(bkOrder.Id, BookingOrderSyncTypeEnum.CC.ToString()); _logger.LogInformation($"回写订舱号并回推客户端:{bkOrder.Id} {bkOrder.CUSTNO}"); diff --git a/Myshipping.Application/Service/DataSync/DataSyncService.cs b/Myshipping.Application/Service/DataSync/DataSyncService.cs index 0d1cc8f4..49f17bb2 100644 --- a/Myshipping.Application/Service/DataSync/DataSyncService.cs +++ b/Myshipping.Application/Service/DataSync/DataSyncService.cs @@ -2995,9 +2995,8 @@ namespace Myshipping.Application } foreach (var item in dto) { - var extends = _bookingextstate.FirstOrDefault(x => x.bookingId == item.BookingId); - + var oldSta = ""; if (extends == null) { extends = new BookingExtendState(); @@ -3005,12 +3004,33 @@ namespace Myshipping.Application extends.bookingId = item.BookingId; extends.IsLockBooking = item.LockStatus; await _bookingextstate.InsertAsync(extends); + + oldSta = "未封账"; } else { + oldSta = extends.IsLockBooking ? "已封账" : "未封账"; extends.IsLockBooking = item.LockStatus; await _bookingextstate.AsUpdateable(extends).IgnoreColumns().ExecuteCommandAsync(); } + + ////添加booking日志 + var bid = await _bookinglog.InsertReturnSnowflakeIdAsync(new BookingLog + { + Type = "Edit", + BookingId = item.BookingId, + TenantId = Convert.ToInt64(UserManager.TENANT_ID), + CreatedTime = DateTime.Now, + CreatedUserId = 0, + CreatedUserName = string.IsNullOrEmpty(item.UserName) ? UserManager.Name : item.UserName, + }); + await _bookinglogdetail.InsertReturnSnowflakeIdAsync(new BookingLogDetail + { + PId = bid, + Field = "封账状态", + OldValue = oldSta, + NewValue = extends.IsLockBooking ? "已封账" : "未封账" + }); } } diff --git a/Myshipping.Application/Service/DataSync/Dto/BookingOrderLock.cs b/Myshipping.Application/Service/DataSync/Dto/BookingOrderLock.cs index f7fe0865..5eba24b4 100644 --- a/Myshipping.Application/Service/DataSync/Dto/BookingOrderLock.cs +++ b/Myshipping.Application/Service/DataSync/Dto/BookingOrderLock.cs @@ -19,5 +19,10 @@ namespace Myshipping.Application.Service.DataSync.Dto /// 锁定状态 false 解锁 true 锁定 /// public bool LockStatus { get; set; } + + /// + /// 操作用户名称 + /// + public string UserName { get; set; } } }