cjy 3 months ago
commit 8e065174c9

@ -1,6 +1,6 @@
using System.Dynamic;
namespace DS.Module.Core.Data
namespace DS.WMS.Core.Op.Entity
{
/// <summary>
/// 邮件模板模型
@ -12,6 +12,11 @@ namespace DS.Module.Core.Data
/// </summary>
public long BusinessId { get; set; }
/// <summary>
/// 业务ID
/// </summary>
public BusinessType BusinessType { get; set; } = BusinessType.OceanShippingExport;
/// <summary>
/// 发送附件
/// </summary>

@ -1,6 +1,6 @@
using DS.Module.Core.Data;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Dtos.TaskInteraction;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.Op.Interface.TaskInteraction;

@ -1,6 +1,6 @@
using DS.Module.Core.Data;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Dtos.TaskInteraction;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.Op.Interface.TaskInteraction;

@ -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

Loading…
Cancel
Save