From 1b11d51c21ce7254aac7c92aacf4777ef8bd73b8 Mon Sep 17 00:00:00 2001 From: wanghaomei <86whm@163.com> Date: Tue, 23 Jul 2024 09:00:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AE=A2=E8=88=B1=E6=89=A3=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingCustomerOrderService.cs | 22 ++++++++++++++++++- .../Service/DataSync/DataSyncService.cs | 1 + 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs index e0ba07f5..cb214317 100644 --- a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs +++ b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs @@ -2766,6 +2766,25 @@ namespace Myshipping.Application return; } + //扣费时记录订舱编号 + var bookingNO = ""; + if (!string.IsNullOrEmpty(model.ExtendData)) + { + var extObj = JObject.Parse(model.ExtendData); + if (model.CARRIERID == "COSCO") + { + bookingNO = extObj.GetStringValue("CustNO"); + } + else if (model.CARRIERID == "EMC") + { + var custNOArr = extObj.GetJArrayValue("CustNO"); + if (custNOArr != null && custNOArr.Count > 0) + { + bookingNO = string.Join(",", custNOArr.Select(x => x.ToString())); + } + } + } + //扣费dto var seconds = DateTime.Now.ToTimeStamp(); var runId = Guid.NewGuid().ToString(); @@ -2791,7 +2810,8 @@ namespace Myshipping.Application VESSEL = model.VESSEL, VOYNO = model.VOYNO, ETD = model.ETD, - CARRIER = model.CARRIER + CARRIER = model.CARRIER, + BEIZHU2 = bookingNO } }; diff --git a/Myshipping.Application/Service/DataSync/DataSyncService.cs b/Myshipping.Application/Service/DataSync/DataSyncService.cs index 55a1b49a..94611dbc 100644 --- a/Myshipping.Application/Service/DataSync/DataSyncService.cs +++ b/Myshipping.Application/Service/DataSync/DataSyncService.cs @@ -2478,6 +2478,7 @@ namespace Myshipping.Application bookingStatus.StaTime = item.OpTime; bookingStatus.StaCate = "book_sta_cate_billtrace"; await _repBookingStatus.InsertAsync(bookingStatus); + sendDsList.Add(item.BookingId); } } From 9e122aa76eb08c95c6707f75541b9d00e0b25f34 Mon Sep 17 00:00:00 2001 From: wanghaomei <86whm@163.com> Date: Tue, 23 Jul 2024 17:30:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=89=A3=E8=B4=B9=E5=A4=87=E6=B3=A8=20?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=92=8C=E8=AE=A2=E8=88=B1=E4=BB=A3=E7=90=86?= =?UTF-8?q?ID=E5=AF=B9=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingCustomerOrderService.cs | 2 +- .../Service/DataSync/DataSyncService.cs | 35 ++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs index cb214317..929ba81a 100644 --- a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs +++ b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs @@ -2811,7 +2811,7 @@ namespace Myshipping.Application VOYNO = model.VOYNO, ETD = model.ETD, CARRIER = model.CARRIER, - BEIZHU2 = bookingNO + BEIZHU = bookingNO } }; diff --git a/Myshipping.Application/Service/DataSync/DataSyncService.cs b/Myshipping.Application/Service/DataSync/DataSyncService.cs index 167a16ae..a906e9e2 100644 --- a/Myshipping.Application/Service/DataSync/DataSyncService.cs +++ b/Myshipping.Application/Service/DataSync/DataSyncService.cs @@ -42,6 +42,7 @@ using Furion.JsonSerialization; using Microsoft.AspNetCore.SignalR; using Furion.EventBus; using Myshipping.Core.Const; +using NPOI.Util; namespace Myshipping.Application { @@ -2807,8 +2808,10 @@ namespace Myshipping.Application saveDto.ChangedFields = changeFileds; } - #region 处理操作、单证等人员ID + #region 处理操作、单证、客户、订舱代理等ID var sysUserList = await _repUser.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID).ToListAsync(); + var customerList = await _djycustomer.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID).ToListAsync(); + var carrList = await _cache.GetAllCodeCarrier(); //销售 if (!string.IsNullOrEmpty(saveDto.SALE)) @@ -2869,6 +2872,36 @@ namespace Myshipping.Application saveDto.LineManageID = lineManageUser.Id.ToString(); } } + + //委托单位 + if (!string.IsNullOrEmpty(saveDto.CUSTOMERNAME)) + { + var customer = customerList.FirstOrDefault(x => x.ShortName == saveDto.CUSTOMERNAME); + if (customer != null) + { + saveDto.CUSTOMERID = customer.Id; + } + } + + //订舱代理 + if (!string.IsNullOrEmpty(saveDto.FORWARDER)) + { + var forwarder = customerList.FirstOrDefault(x => x.ShortName == saveDto.FORWARDER); + if (forwarder != null) + { + saveDto.FORWARDERID = forwarder.CodeName; + } + } + + //船司 + if (!string.IsNullOrEmpty(saveDto.CARRIER)) + { + var carrier = carrList.FirstOrDefault(x => x.EnName == saveDto.CARRIER || x.CnName == saveDto.CARRIER); + if (carrier != null) + { + saveDto.CARRIERID = carrier.Code; + } + } #endregion await _bookingorderservice.Save(saveDto);