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; } } }