|
|
|
@ -3,6 +3,7 @@ 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;
|
|
|
|
|
using DS.WMS.Core.Op.Dtos.TaskInteraction;
|
|
|
|
|
using DS.WMS.Core.Op.Entity;
|
|
|
|
@ -64,7 +65,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
/// <param name="bsId">业务ID</param>
|
|
|
|
|
/// <param name="businessType">业务类型</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<MailTemplateModel> GetTemplateModelAsync(IActionManagerService actionManager,
|
|
|
|
|
public async Task<MailTemplateModel> GetTemplateModelAsync(IActionManagerService actionManager,
|
|
|
|
|
long bsId, BusinessType? businessType = null)
|
|
|
|
|
{
|
|
|
|
|
ArgumentNullException.ThrowIfNull(actionManager, nameof(actionManager));
|
|
|
|
@ -80,7 +81,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
return model;
|
|
|
|
|
|
|
|
|
|
List<Tuple<long, string>> list = [];
|
|
|
|
|
|
|
|
|
|
long? forwarderId = null, shipperCNId = null, customerId = null;
|
|
|
|
|
var order = model.Primary as SeaExportRes;
|
|
|
|
|
if (order != null)
|
|
|
|
|
{
|
|
|
|
@ -88,6 +89,10 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
list.Add(new Tuple<long, string>(order.OperatorId, "op"));
|
|
|
|
|
list.Add(new Tuple<long, string>(order.CustomerService, "cs"));
|
|
|
|
|
list.Add(new Tuple<long, string>(order.Doc, "doc"));
|
|
|
|
|
|
|
|
|
|
forwarderId = order.ForwarderId;
|
|
|
|
|
shipperCNId = order.ShipperCnId;
|
|
|
|
|
customerId = order.CustomerId;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -106,12 +111,28 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
|
|
|
|
|
if (dic.TryGetValue(nameof(SeaExport.Doc), out object? doc))
|
|
|
|
|
list.Add(new Tuple<long, string>((long)doc, nameof(doc)));
|
|
|
|
|
|
|
|
|
|
if (dic.TryGetValue(nameof(SeaExport.ForwarderId), out object? forwarder) && forwarder != null)
|
|
|
|
|
forwarderId = (long)forwarder;
|
|
|
|
|
|
|
|
|
|
if (dic.TryGetValue(nameof(SeaExport.ShipperCnId), out object? shipperCN) && shipperCN != null)
|
|
|
|
|
shipperCNId = (long)shipperCN;
|
|
|
|
|
|
|
|
|
|
if (dic.TryGetValue(nameof(SeaExport.CustomerId), out object? customer) && customer != null)
|
|
|
|
|
customerId = (long)customer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
long?[] custIds = [forwarderId, shipperCNId, customerId];
|
|
|
|
|
var custList = await TenantDb.Queryable<InfoClient>().Where(x => custIds.Contains(x.Id))
|
|
|
|
|
.Select(x => new { x.Id,x.Description }).ToListAsync();
|
|
|
|
|
model.ForwarderName = custList.Find(x => x.Id == forwarderId)?.Description;
|
|
|
|
|
model.DomesticShipperName = custList.Find(x => x.Id == shipperCNId)?.Description;
|
|
|
|
|
model.CustomerName = custList.Find(x => x.Id == customerId)?.Description;
|
|
|
|
|
|
|
|
|
|
if (list.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
var ids = list.Select(x => x.Item1).ToArray();
|
|
|
|
|
var userList = await actionManager.GetUserQueryable(ids).Select(x => new Contact
|
|
|
|
|
var userList = await Db.Queryable<SysUser>().Where(x => ids.Contains(x.Id)).Select(x => new Contact
|
|
|
|
|
{
|
|
|
|
|
Id = x.Id,
|
|
|
|
|
Email = x.Email,
|
|
|
|
|