From 3aec4c5cb04ea8e675f5da725e843983ed3d47f3 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 5 Jun 2024 17:42:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E8=B5=B7=E8=BF=90?= =?UTF-8?q?=E6=B8=AF=E6=9C=AA=E6=8F=90=E7=AE=B1=E9=80=9A=E7=9F=A5=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskManagePlat/Dtos/TaskManageMapper.cs | 2 +- .../TaskPOLContainerNotPickUpService.cs | 31 +++++++++++++------ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs index 019e2bc1..fafa4f61 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs @@ -1206,7 +1206,7 @@ namespace Myshipping.Application config.ForType() .Map(dest => dest.VESSEL, src => src.Vessel) - .Map(dest => dest.MBL_NO, src => src.Voyno) + .Map(dest => dest.VOYNO, src => src.Voyno) .Map(dest => dest.CARRIER, src => src.Carrier) .Map(dest => dest.MBL_NO, src => src.ShipmentNumber) .Map(dest => dest.BOOKING_CUSTOMER, src => src.BookedByCustomerName) diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskPOLContainerNotPickUpService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskPOLContainerNotPickUpService.cs index 0b496aa9..4e3ac5a7 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskPOLContainerNotPickUpService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskPOLContainerNotPickUpService.cs @@ -375,7 +375,7 @@ namespace Myshipping.Application if (opEmailList.Count > 0) opEmail = string.Join(";", opEmailList.Distinct().ToArray()); - string emailTitle = $"Action Required - Container not picked up/{model.VESSEL}/{model.VOYNO}/ 未提箱订舱取消确认:{model.MBL_NO}"; + string emailTitle = $"{model.MBL_NO}-{model.VESSEL}/{model.VOYNO}/ 未提箱订舱取消确认"; //提取当前公共邮箱的配置 DjyUserMailAccount publicMailAccount = _djyUserMailAccount.AsQueryable().Filter(null, true).First(x => x.TenantId == UserManager.TENANT_ID && x.ShowName == "PublicSend" @@ -512,6 +512,25 @@ namespace Myshipping.Application baseHtml = baseHtml.Replace("#optel#", ""); } + if (!string.IsNullOrWhiteSpace(model.MBL_NO)) + { + baseHtml = baseHtml.Replace("#BillNo#", model.MBL_NO); + } + else + { + baseHtml = baseHtml.Replace("#BillNo#", ""); + } + + if (!string.IsNullOrWhiteSpace(model.VESSEL)) + { + string s = $"{model.VESSEL}/{model.VOYNO}"; + baseHtml = baseHtml.Replace("#VesselVoyno#", s); + } + else + { + baseHtml = baseHtml.Replace("#VesselVoyno#", ""); + } + if (!string.IsNullOrWhiteSpace(tenantName)) { baseHtml = baseHtml.Replace("#TenantCompanyName#", tenantName); @@ -524,19 +543,13 @@ namespace Myshipping.Application HtmlDocument html = new HtmlDocument(); html.LoadHtml(baseHtml); - //From Port Start - HtmlNode tdPortNode = html.DocumentNode.SelectSingleNode("//td[@id='FromPort']"); - - if (tdPortNode == null) - throw Oops.Oh($"读取邮件模板格式错误,定位id='FromPort'失败"); - result = html.DocumentNode.OuterHtml; } catch (Exception ex) { - _logger.LogInformation($"生成货物运输计划已变更正文失败,原因:{ex.Message}"); + _logger.LogInformation($"生成起运港未提箱正文失败,原因:{ex.Message}"); - throw Oops.Bah($"生成货物运输计划已变更正文失败,原因:{ex.Message}"); + throw Oops.Bah($"生成起运港未提箱正文失败,原因:{ex.Message}"); } return result;