|
|
|
@ -17,6 +17,8 @@ using Masuit.Tools;
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using NPOI.OpenXmlFormats;
|
|
|
|
|
using NPOI.OpenXmlFormats.Wordprocessing;
|
|
|
|
|
using RazorEngineCore;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
@ -24,18 +26,18 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 业务邮件发送服务
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class MailService : ServiceBase
|
|
|
|
|
public class MailGenerator : ServiceBase
|
|
|
|
|
{
|
|
|
|
|
static readonly ConcurrentDictionary<string, IRazorEngineCompiledTemplate> TemplateCache = new();
|
|
|
|
|
|
|
|
|
|
IConfiguration config;
|
|
|
|
|
ApiFox Api = DefaultActionExecutor.Api;
|
|
|
|
|
readonly IConfiguration config;
|
|
|
|
|
readonly ApiFox Api = DefaultActionExecutor.Api;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 初始化
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="provider"></param>
|
|
|
|
|
public MailService(IServiceProvider provider) : base(provider)
|
|
|
|
|
public MailGenerator(IServiceProvider provider) : base(provider)
|
|
|
|
|
{
|
|
|
|
|
config = provider.GetRequiredService<IConfiguration>();
|
|
|
|
|
TenantDb.QueryFilter.Clear<IOrgId>();
|
|
|
|
@ -82,8 +84,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
|
|
|
|
|
List<Tuple<long, string>> list = [];
|
|
|
|
|
long? forwarderId = null, shipperCNId = null, customerId = null;
|
|
|
|
|
var order = model.Primary as SeaExportRes;
|
|
|
|
|
if (order != null)
|
|
|
|
|
if (model.Primary is SeaExportRes order)
|
|
|
|
|
{
|
|
|
|
|
list.Add(new Tuple<long, string>(order.SaleId, "sale"));
|
|
|
|
|
list.Add(new Tuple<long, string>(order.OperatorId, "op"));
|
|
|
|
@ -96,8 +97,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
IDictionary<string, object>? dic = model.Primary as IDictionary<string, object>;
|
|
|
|
|
if (dic == null)
|
|
|
|
|
if (model.Primary is not IDictionary<string, object> dic)
|
|
|
|
|
return model;
|
|
|
|
|
|
|
|
|
|
if (dic.TryGetValue(nameof(SeaExport.SaleId), out object? sale))
|
|
|
|
@ -157,6 +157,18 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
model.Document = userList.Find(x => x.Id == docId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取箱型价格
|
|
|
|
|
model.CtnPriceList = await TenantDb.Queryable<BusinessCtnPrice>().Where(x => x.BusinessId == model.BusinessId)
|
|
|
|
|
.Select(x => new BusinessCtnPrice
|
|
|
|
|
{
|
|
|
|
|
Ctn = x.Ctn,
|
|
|
|
|
CtnAll = x.CtnAll,
|
|
|
|
|
CtnNum = x.CtnNum,
|
|
|
|
|
QuotePrice = x.QuotePrice,
|
|
|
|
|
GuidePrice = x.GuidePrice,
|
|
|
|
|
FloorPrice = x.FloorPrice
|
|
|
|
|
}).ToListAsync();
|
|
|
|
|
|
|
|
|
|
return model;
|
|
|
|
|
}
|
|
|
|
|
|