修改 起运港未提箱通知任务

master
jianghaiqing 6 months ago
parent bbac49809e
commit 3aec4c5cb0

@ -1206,7 +1206,7 @@ namespace Myshipping.Application
config.ForType<TaskManageOrderPOLContainerNotPickupInfo, TaskPOLContainerNotPickUpInfo>() config.ForType<TaskManageOrderPOLContainerNotPickupInfo, TaskPOLContainerNotPickUpInfo>()
.Map(dest => dest.VESSEL, src => src.Vessel) .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.CARRIER, src => src.Carrier)
.Map(dest => dest.MBL_NO, src => src.ShipmentNumber) .Map(dest => dest.MBL_NO, src => src.ShipmentNumber)
.Map(dest => dest.BOOKING_CUSTOMER, src => src.BookedByCustomerName) .Map(dest => dest.BOOKING_CUSTOMER, src => src.BookedByCustomerName)

@ -375,7 +375,7 @@ namespace Myshipping.Application
if (opEmailList.Count > 0) if (opEmailList.Count > 0)
opEmail = string.Join(";", opEmailList.Distinct().ToArray()); 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" 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#", ""); 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)) if (!string.IsNullOrWhiteSpace(tenantName))
{ {
baseHtml = baseHtml.Replace("#TenantCompanyName#", tenantName); baseHtml = baseHtml.Replace("#TenantCompanyName#", tenantName);
@ -524,19 +543,13 @@ namespace Myshipping.Application
HtmlDocument html = new HtmlDocument(); HtmlDocument html = new HtmlDocument();
html.LoadHtml(baseHtml); 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; result = html.DocumentNode.OuterHtml;
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogInformation($"生成货物运输计划已变更正文失败,原因:{ex.Message}"); _logger.LogInformation($"生成起运港未提箱正文失败,原因:{ex.Message}");
throw Oops.Bah($"生成货物运输计划已变更正文失败,原因:{ex.Message}"); throw Oops.Bah($"生成起运港未提箱正文失败,原因:{ex.Message}");
} }
return result; return result;

Loading…
Cancel
Save