From 1a1a1ba653cf80991293d0b0330b61b9f5224415 Mon Sep 17 00:00:00 2001 From: wanghaomei <86whm@163.com> Date: Fri, 7 Jun 2024 16:08:18 +0800 Subject: [PATCH] =?UTF-8?q?EMC=E8=AE=A2=E8=88=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingCustomerOrderService.cs | 70 ++++++++++++------- 1 file changed, 46 insertions(+), 24 deletions(-) diff --git a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs index 3e6f01f5..e6adc241 100644 --- a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs +++ b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs @@ -194,6 +194,13 @@ namespace Myshipping.Application entity.BSSTATUS = "已录入"; entity.BOOKINGNO = $"BK{YitIdHelper.NextId()}"; + + //EMC需要把收发通拼接起来 + if (input.CARRIERID == "EMC") + { + ContactSFT(entity); + } + await _rep.InsertAsync(entity); } @@ -212,6 +219,12 @@ namespace Myshipping.Application entity = input.Adapt(entity); + //EMC需要把收发通拼接起来 + if (input.CARRIERID == "EMC") + { + ContactSFT(entity); + } + await _rep.UpdateAsync(entity); await _repCtn.DeleteAsync(x => x.BILLID == input.Id); @@ -898,7 +911,7 @@ namespace Myshipping.Application //目的地 var mapDestination = mappingPort.FirstOrDefault(x => x.Module == "DjyCustBooking" && x.CarrierCode == "EMC" && x.Code == custOrder.DESTINATIONCODE); - if (mapPort == null) + if (mapDestination == null) { throw Oops.Bah($"未找到目的地映射信息:{custOrder.DESTINATIONCODE}"); } @@ -2761,29 +2774,7 @@ namespace Myshipping.Application custOrder.BLFRT = frt.EnName; //2024年4月19日,将分拆的收发通拼接到大文本的收发通中 - if (string.IsNullOrEmpty(custOrder.SHIPPER) && !string.IsNullOrEmpty(custOrder.ShipperName)) - { - custOrder.SHIPPER = @$"{custOrder.ShipperName} -{custOrder.ShipperAddress} -{custOrder.ShipperCountry} {custOrder.ShipperProvince} {custOrder.ShipperCity} {custOrder.ShipperCounty} {custOrder.ShipperPostCode} -{custOrder.ShipperLastName} {custOrder.ShipperFirstName} {custOrder.ShipperPhoneCountryCode} {custOrder.ShipperPhoneCode} {custOrder.ShipperPhone}".ToUpper(); - } - - if (string.IsNullOrEmpty(custOrder.CONSIGNEE) && !string.IsNullOrEmpty(custOrder.ConsigneeName)) - { - custOrder.CONSIGNEE = @$"{custOrder.ConsigneeName} -{custOrder.ConsigneeAddress} -{custOrder.ConsigneeCountry} {custOrder.ConsigneeProvince} {custOrder.ConsigneeCity} {custOrder.ConsigneeCounty} {custOrder.ConsigneePostCode} -{custOrder.ConsigneeLastName} {custOrder.ConsigneeFirstName} {custOrder.ConsigneePhoneCountryCode} {custOrder.ConsigneePhoneCode} {custOrder.ConsigneePhone}".ToUpper(); - } - - if (string.IsNullOrEmpty(custOrder.NOTIFYPARTY) && !string.IsNullOrEmpty(custOrder.NotifypartName)) - { - custOrder.NOTIFYPARTY = @$"{custOrder.NotifypartName} -{custOrder.NotifypartAddress} -{custOrder.NotifypartCountry} {custOrder.NotifypartProvince} {custOrder.NotifypartCity} {custOrder.NotifypartCounty} {custOrder.NotifypartPostCode} -{custOrder.NotifypartLastName} {custOrder.NotifypartFirstName} {custOrder.NotifypartPhoneCountryCode} {custOrder.NotifypartPhoneCode} {custOrder.NotifypartPhone}".ToUpper(); - } + ContactSFT(custOrder); var ctns = input.CtnList.Adapt>(); @@ -2857,6 +2848,37 @@ namespace Myshipping.Application await Submit(new List { custOrder.Id }); } + + /// + /// 拼接收发通 + /// + /// + private void ContactSFT(BookingCustomerOrder custOrder) + { + if (string.IsNullOrEmpty(custOrder.SHIPPER) && !string.IsNullOrEmpty(custOrder.ShipperName)) + { + custOrder.SHIPPER = @$"{custOrder.ShipperName} +{custOrder.ShipperAddress} +{custOrder.ShipperCountry} {custOrder.ShipperProvince} {custOrder.ShipperCity} {custOrder.ShipperCounty} {custOrder.ShipperPostCode} +{custOrder.ShipperLastName} {custOrder.ShipperFirstName} {custOrder.ShipperPhoneCountryCode} {custOrder.ShipperPhoneCode} {custOrder.ShipperPhone}".ToUpper(); + } + + if (string.IsNullOrEmpty(custOrder.CONSIGNEE) && !string.IsNullOrEmpty(custOrder.ConsigneeName)) + { + custOrder.CONSIGNEE = @$"{custOrder.ConsigneeName} +{custOrder.ConsigneeAddress} +{custOrder.ConsigneeCountry} {custOrder.ConsigneeProvince} {custOrder.ConsigneeCity} {custOrder.ConsigneeCounty} {custOrder.ConsigneePostCode} +{custOrder.ConsigneeLastName} {custOrder.ConsigneeFirstName} {custOrder.ConsigneePhoneCountryCode} {custOrder.ConsigneePhoneCode} {custOrder.ConsigneePhone}".ToUpper(); + } + + if (string.IsNullOrEmpty(custOrder.NOTIFYPARTY) && !string.IsNullOrEmpty(custOrder.NotifypartName)) + { + custOrder.NOTIFYPARTY = @$"{custOrder.NotifypartName} +{custOrder.NotifypartAddress} +{custOrder.NotifypartCountry} {custOrder.NotifypartProvince} {custOrder.NotifypartCity} {custOrder.NotifypartCounty} {custOrder.NotifypartPostCode} +{custOrder.NotifypartLastName} {custOrder.NotifypartFirstName} {custOrder.NotifypartPhoneCountryCode} {custOrder.NotifypartPhoneCode} {custOrder.NotifypartPhone}".ToUpper(); + } + } #endregion #region 发送订舱