|
|
|
@ -3,7 +3,6 @@ using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core.Data;
|
|
|
|
|
using DS.Module.PrintModule;
|
|
|
|
|
using DS.WMS.Core.Code.Entity;
|
|
|
|
|
using DS.WMS.Core.Info.Entity;
|
|
|
|
|
using DS.WMS.Core.Op.Dtos.TaskInteraction;
|
|
|
|
|
using DS.WMS.Core.Op.Entity;
|
|
|
|
|
using DS.WMS.Core.Op.Entity.TaskInteraction;
|
|
|
|
@ -15,8 +14,6 @@ using Masuit.Tools;
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using NPOI.HPSF;
|
|
|
|
|
using Org.BouncyCastle.Utilities;
|
|
|
|
|
using RazorEngineCore;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
@ -149,24 +146,25 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
ccList = await Db.Queryable<SysUser>().Where(x => ccIds.Contains(x.Id)).Select(x => x.Email).ToListAsync();
|
|
|
|
|
|
|
|
|
|
//设置收件人
|
|
|
|
|
List<long> receiverIds = [];
|
|
|
|
|
List<string> receiverTypes = [];
|
|
|
|
|
if (mailConfig.Receiver.IsCarrier)
|
|
|
|
|
receiverIds.Add(order.CarrierId);
|
|
|
|
|
receiverTypes.Add("carrier");
|
|
|
|
|
|
|
|
|
|
if (mailConfig.Receiver.IsBooking)
|
|
|
|
|
receiverIds.Add(order.ForwarderId);
|
|
|
|
|
receiverTypes.Add("booking");
|
|
|
|
|
|
|
|
|
|
if (mailConfig.Receiver.IsYard)
|
|
|
|
|
receiverIds.Add(order.YardId);
|
|
|
|
|
receiverTypes.Add("yard");
|
|
|
|
|
|
|
|
|
|
if (mailConfig.Receiver.IsTruck)
|
|
|
|
|
receiverIds.Add(order.TruckerId);
|
|
|
|
|
receiverTypes.Add("truck");
|
|
|
|
|
|
|
|
|
|
if (mailConfig.Receiver.IsController)
|
|
|
|
|
receiverIds.Add(order.CustomerId);
|
|
|
|
|
receiverTypes.Add("controller");
|
|
|
|
|
|
|
|
|
|
var receiverList = await TenantDb.Queryable<InfoClient>().Where(x => receiverIds.Contains(x.Id) && x.Email != null && x.Email != string.Empty)
|
|
|
|
|
.Select(x => new { x.ShortName, x.EnShortName, x.Email }).ToListAsync();
|
|
|
|
|
var receiverList = await TenantDb.Queryable<BusinessOrderContact>().Where(x => receiverTypes.Contains(x.CustomerType)
|
|
|
|
|
&& x.Email != null && x.Email != string.Empty && x.BusinessId == templateModel.BusinessId && x.BusinessType == templateModel.BusinessType)
|
|
|
|
|
.Select(x => new { x.Name, x.Email }).ToListAsync();
|
|
|
|
|
|
|
|
|
|
var attachmentList = mailConfig.Attachments == null ? [] : new List<Tuple<string, string>>(mailConfig.Attachments.Count);
|
|
|
|
|
try
|
|
|
|
|