修改马士基API订舱

修改BC转发模板
master
jianghaiqing 9 months ago
parent e2c1f90717
commit c652956b75

@ -36,11 +36,21 @@ namespace Myshipping.Application.Entity
/// </summary>
public string CARRIER { get; set; }
/// <summary>
/// 合约号主键
/// </summary>
public Nullable<long> PRICE_REFERENCE_ID { get; set; }
/// <summary>
/// 合约号
/// </summary>
public string PRICE_REFERENCE { get; set; }
/// <summary>
/// 合约号名称
/// </summary>
public string PRICE_REFERENCE_NAME { get; set; }
/// <summary>
/// 产品类型
/// </summary>
@ -387,6 +397,11 @@ namespace Myshipping.Application.Entity
/// </summary>
public string STATUS { get; set; }
/// <summary>
/// 状态名称 SUCC-成功FAILURE-失败
/// </summary>
public string STATUS_NAME { get; set; }
/// <summary>
/// 发送备注
/// </summary>

@ -367,6 +367,11 @@ namespace Myshipping.Application
/// </summary>
public string status { get; set; }
/// <summary>
/// 状态名称 SUCC-成功FAILURE-失败
/// </summary>
public string statusName { get; set; }
/// <summary>
/// 发送备注
/// </summary>
@ -387,6 +392,16 @@ namespace Myshipping.Application
/// </summary>
public Nullable<DateTime> jobTime { get; set; }
/// <summary>
/// 合约号主键
/// </summary>
public Nullable<long> priceReferenceId { get; set; }
/// <summary>
/// 合约号名称
/// </summary>
public string priceReferenceName { get; set; }
/// <summary>
/// 集装箱
/// </summary>

@ -349,6 +349,12 @@ namespace Myshipping.Application
/// </summary>
public string status { get; set; }
/// <summary>
/// 状态名称 SUCC-成功FAILURE-失败
/// </summary>
public string statusName { get; set; }
/// <summary>
/// 发送备注
/// </summary>
@ -368,5 +374,15 @@ namespace Myshipping.Application
/// 定时时间
/// </summary>
public Nullable<DateTime> jobTime { get; set; }
/// <summary>
/// 合约号主键
/// </summary>
public Nullable<long> priceReferenceId { get; set; }
/// <summary>
/// 合约号名称
/// </summary>
public string priceReferenceName { get; set; }
}
}

@ -199,8 +199,10 @@ namespace Myshipping.Application
.Map(dest => dest.cargoType, src => src.CARGO_TYPE)
.Map(dest => dest.placeOfReceiptCountryCode, src => src.PLACERECEIPT_COUNTRY_CODE)
.Map(dest => dest.placeOfDeliveryCountryCode, src => src.PLACEDELIVERY_COUNTRY_CODE)
.Map(dest => dest.EstSailingDays, src => src.EST_SAILING_DAYS);
.Map(dest => dest.EstSailingDays, src => src.EST_SAILING_DAYS)
.Map(dest => dest.priceReferenceId, src => src.PRICE_REFERENCE_ID)
.Map(dest => dest.priceReferenceName, src => src.PRICE_REFERENCE_NAME)
.Map(dest => dest.statusName, src => src.STATUS_NAME);
config.ForType<BookingDeliveryRecord, BookingDeliveryRecordPageDto>()
.Map(dest => dest.id, src => src.Id)
@ -258,7 +260,10 @@ namespace Myshipping.Application
.Map(dest => dest.ctnStat, src => src.CTN_STAT)
.Map(dest => dest.weekAt, src => src.WEEK_AT)
.Map(dest => dest.sendTime, src => src.SEND_TIME)
.Map(dest => dest.cargoType, src => src.CARGO_TYPE);
.Map(dest => dest.cargoType, src => src.CARGO_TYPE)
.Map(dest => dest.priceReferenceId, src => src.PRICE_REFERENCE_ID)
.Map(dest => dest.priceReferenceName, src => src.PRICE_REFERENCE_NAME)
.Map(dest => dest.statusName, src => src.STATUS_NAME);
}
}

@ -241,6 +241,16 @@ namespace Myshipping.Application
/// </summary>
public Nullable<int> EstSailingDays { get; set; }
/// <summary>
/// 合约号主键
/// </summary>
public Nullable<long> priceReferenceId { get; set; }
/// <summary>
/// 合约号名称
/// </summary>
public string priceReferenceName { get; set; }
/// <summary>
/// 箱型箱量列表
/// </summary>

@ -32,6 +32,7 @@ using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Security.Principal;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Web;
using System.Xml;
@ -1456,8 +1457,12 @@ namespace Myshipping.Application
string filePath = string.Empty;
SysUser opUserInfo = null;
if(!string.IsNullOrWhiteSpace(bookingOrderEntity.OPID) && Regex.IsMatch(bookingOrderEntity.OPID,"[0-9]+"))
opUserInfo = _sysUserRepository.AsQueryable().First(u => u.Id == long.Parse(bookingOrderEntity.OPID));
//读取邮件模板并填充数据
string emailHtml = GenerateSendEmailHtml(taskBCInfo, UserManager.TENANT_NAME).GetAwaiter().GetResult();
string emailHtml = GenerateSendEmailHtml(taskBCInfo, opUserInfo,UserManager.TENANT_NAME).GetAwaiter().GetResult();
_logger.LogInformation($"生成邮件BODY结果{emailHtml}");
@ -1522,9 +1527,10 @@ namespace Myshipping.Application
/// 通过邮件模板生成HTML
/// </summary>
/// <param name="taskBCInfo">BC任务详情</param>
/// <param name="opUserInfo">订舱OP详情</param>
/// <param name="tenantName">当前租户全称</param>
/// <returns>返回生成的HTML</returns>
public async Task<string> GenerateSendEmailHtml(TaskBCInfo taskBCInfo,string tenantName)
public async Task<string> GenerateSendEmailHtml(TaskBCInfo taskBCInfo, SysUser opUserInfo, string tenantName)
{
string result = string.Empty;
@ -1550,6 +1556,33 @@ namespace Myshipping.Application
if (string.IsNullOrWhiteSpace(baseHtml))
throw Oops.Oh($"读取邮件模板失败");
if(opUserInfo != null && !string.IsNullOrWhiteSpace(opUserInfo.Name))
{
baseHtml = baseHtml.Replace("#opname#", opUserInfo.Name);
}
else
{
baseHtml = baseHtml.Replace("#opname#", "");
}
if (opUserInfo != null && !string.IsNullOrWhiteSpace(opUserInfo.Email))
{
baseHtml = baseHtml.Replace("#opmail#", opUserInfo.Email);
}
else
{
baseHtml = baseHtml.Replace("#opmail#", "");
}
if (opUserInfo != null && !string.IsNullOrWhiteSpace(opUserInfo.Tel))
{
baseHtml = baseHtml.Replace("#optel#", opUserInfo.Tel);
}
else
{
baseHtml = baseHtml.Replace("#optel#", "");
}
HtmlDocument html = new HtmlDocument();
html.LoadHtml(baseHtml);

@ -8,7 +8,7 @@
<title class="head-title">邮件模板</title>
</head>
<body style="margin: 0; padding: 0;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#EDF9F5" style="font-size: 14px;font-family: Arial;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#EDF9F5" style="font-size: 12px;font-family: Arial;">
<tr>
<td height="30"></td>
</tr>
@ -57,7 +57,8 @@
<tr class="email-noreply">
<td>
<p class="notice1-val">请您按照更新的ETD在免箱期内用箱以免产生超期箱使费谢谢</p>
<p class="notice2-val">请不要回复此邮箱(自动发送邮箱无人处理邮件),如有疑问,请联系操作(邮箱,电话),谢谢!</p>
<p class="notice2-val">请不要回复此邮箱(自动发送邮箱无人处理邮件),如有疑问,请联系操作#opname#(邮箱#opemail#,电话#optel#),谢谢!</p>
<p>货物到港后,贵司保证目的港收货人及时提取货物。因货物提取不及时/弃货产生的滞箱费、堆存费、港口费、货物处理费等概由贵司或者目的港收货人承担。如果我司对外承担了上述费用,则贵司应当无条件支付给我司,如果因此给我司造成了经济损失,则贵司还应当赔偿我司所有经济损失,包括但不限于律师费、诉讼费等等。一旦此票提箱出运就视为同意此条款,谢谢配合!</p>
<p class="notice-comp-val"></p>
</td>
</tr>

Loading…
Cancel
Save