修改目的港未提箱或未返空任务邮件转发

master
jianghaiqing 5 months ago
parent ea1229051e
commit 1a20acb3f0

@ -1,4 +1,5 @@
using System; using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -53,5 +54,12 @@ namespace Myshipping.Application.Service.TaskManagePlat.Interface
/// <param name="taskPKId">目的港未提货未返箱任务主键</param> /// <param name="taskPKId">目的港未提货未返箱任务主键</param>
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SendEmailToCustomer(string taskPKId); Task<TaskManageOrderResultDto> SendEmailToCustomer(string taskPKId);
/// <summary>
/// 自动转发目的港未提货未返箱
/// </summary>
/// <param name="taskPKId">目的港未提货未返箱任务主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> AutoTransferNotice(string taskPKId);
} }
} }

@ -1,4 +1,5 @@
using Furion; using Furion;
using Furion.DependencyInjection;
using Furion.DynamicApiController; using Furion.DynamicApiController;
using Furion.FriendlyException; using Furion.FriendlyException;
using Furion.JsonSerialization; using Furion.JsonSerialization;
@ -32,7 +33,7 @@ namespace Myshipping.Application
/// 任务目的港未提货未返箱 /// 任务目的港未提货未返箱
/// </summary> /// </summary>
[ApiDescriptionSettings("Application", Name = "PODDischargeGateoutFull", Order = 10)] [ApiDescriptionSettings("Application", Name = "PODDischargeGateoutFull", Order = 10)]
public class TaskManagePODDischargeGateoutFullService: ITaskManagePODDischargeGateoutFullService, IDynamicApiController public class TaskManagePODDischargeGateoutFullService: ITaskManagePODDischargeGateoutFullService, IDynamicApiController, ITransient
{ {
private readonly SqlSugarRepository<TaskPODDischargeGateoutFullInfo> _taskPODDischargeGateoutFullInfoRep; private readonly SqlSugarRepository<TaskPODDischargeGateoutFullInfo> _taskPODDischargeGateoutFullInfoRep;
private readonly SqlSugarRepository<TaskPODDischargeGateoutFullDetailInfo> _taskPODDischargeGateoutFullDetailInfoRep; private readonly SqlSugarRepository<TaskPODDischargeGateoutFullDetailInfo> _taskPODDischargeGateoutFullDetailInfoRep;
@ -521,7 +522,12 @@ namespace Myshipping.Application
if (opEmailList.Count > 0) if (opEmailList.Count > 0)
opEmail = string.Join(";", opEmailList.Distinct().ToArray()); opEmail = string.Join(";", opEmailList.Distinct().ToArray());
string emailTitle = $"{model.MBL_NO}-/ 目的港未提箱"; string emailTitle = $"{model.MBL_NO}-/ 卸船未提货";
if(model.NOTICE_TYPE == "GATEOUT_FULL")
{
emailTitle = $"{model.MBL_NO}-/ 提箱未返空箱";
}
//提取当前公共邮箱的配置 //提取当前公共邮箱的配置
DjyUserMailAccount publicMailAccount = _djyUserMailAccount.AsQueryable().Filter(null, true).First(x => x.TenantId == UserManager.TENANT_ID && x.ShowName == "PublicSend" DjyUserMailAccount publicMailAccount = _djyUserMailAccount.AsQueryable().Filter(null, true).First(x => x.TenantId == UserManager.TENANT_ID && x.ShowName == "PublicSend"
@ -765,5 +771,43 @@ namespace Myshipping.Application
return result; return result;
} }
#endregion #endregion
#region 自动转发目的港未提货未返箱
/// <summary>
/// 自动转发目的港未提货未返箱
/// </summary>
/// <param name="taskPKId">目的港未提货未返箱任务主键</param>
/// <returns>返回回执</returns>
[HttpGet("/PODDischargeGateoutFull/AutoTransferNotice")]
public async Task<TaskManageOrderResultDto> AutoTransferNotice(string taskPKId)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
var queryRlt = QueryBookingOrder(taskPKId);
_logger.LogInformation($"taskPKId={taskPKId} 检索对应的订舱记录完成,结果:{JSON.Serialize(queryRlt)}");
//_logger.LogInformation($"taskPKId={taskPKId} 当前租户未开启货物运输计划已变更是否同批次同客户合并邮件通知,按照单票推送邮件处理");
//如果没有配置批量,则按单票发送邮件
var rlt = SendEmailToCustomer(taskPKId);
_logger.LogInformation($"taskPKId={taskPKId} 推送邮件完成,结果:{JSON.Serialize(rlt)}");
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"自动转发目的港未提货未返箱失败,原因:{ex.Message}";
_logger.LogInformation($"taskPKId={taskPKId} 自动转发目的港未提货未返箱失败,原因:{ex.Message}");
}
return result;
}
#endregion
} }
} }

@ -155,6 +155,7 @@ namespace Myshipping.Application
private readonly INamedServiceProvider<ITaskManageCutDateChangeService> _namedTaskManageCutDateChangeServiceProvider; private readonly INamedServiceProvider<ITaskManageCutDateChangeService> _namedTaskManageCutDateChangeServiceProvider;
private readonly INamedServiceProvider<IRouteChangeAdvisoryService> _namedRouteChangeAdvisoryServiceServiceProvider; private readonly INamedServiceProvider<IRouteChangeAdvisoryService> _namedRouteChangeAdvisoryServiceServiceProvider;
private readonly INamedServiceProvider<IBookingLabelService> _namedBookingLabelServiceServiceProvider; private readonly INamedServiceProvider<IBookingLabelService> _namedBookingLabelServiceServiceProvider;
private readonly INamedServiceProvider<ITaskManagePODDischargeGateoutFullService> _namedPODDischargeGateoutFullProvider;
private readonly IBookingValueAddedService _bookingValueAddedService; private readonly IBookingValueAddedService _bookingValueAddedService;
@ -229,6 +230,7 @@ namespace Myshipping.Application
INamedServiceProvider<ITaskManageCutDateChangeService> namedTaskManageCutDateChangeServiceProvider, INamedServiceProvider<ITaskManageCutDateChangeService> namedTaskManageCutDateChangeServiceProvider,
INamedServiceProvider<IRouteChangeAdvisoryService> namedRouteChangeAdvisoryServiceServiceProvider, INamedServiceProvider<IRouteChangeAdvisoryService> namedRouteChangeAdvisoryServiceServiceProvider,
INamedServiceProvider<IBookingLabelService> namedBookingLabelServiceServiceProvider, INamedServiceProvider<IBookingLabelService> namedBookingLabelServiceServiceProvider,
INamedServiceProvider<ITaskManagePODDischargeGateoutFullService> namedPODDischargeGateoutFullProvider,
ILogger<BookingOrderService> logger, BookingOrderAutoService bookingOrderAuto, ILogger<BookingOrderService> logger, BookingOrderAutoService bookingOrderAuto,
SqlSugarRepository<TaskFlowTenant> taskFlowTenant) SqlSugarRepository<TaskFlowTenant> taskFlowTenant)
{ {
@ -303,6 +305,7 @@ namespace Myshipping.Application
_taskFlowTenant = taskFlowTenant; _taskFlowTenant = taskFlowTenant;
_namedBookingLabelServiceServiceProvider = namedBookingLabelServiceServiceProvider; _namedBookingLabelServiceServiceProvider = namedBookingLabelServiceServiceProvider;
_namedPODDischargeGateoutFullProvider = namedPODDischargeGateoutFullProvider;
} }
#region 创建任务 #region 创建任务
@ -1521,6 +1524,12 @@ namespace Myshipping.Application
await _taskPODDischargeGateoutFullDetailInfoRepository.InsertAsync(detailInfo); await _taskPODDischargeGateoutFullDetailInfoRepository.InsertAsync(detailInfo);
}); });
} }
//触发推送消息
var name = _namedPODDischargeGateoutFullProvider
.GetService<ITransient>(nameof(TaskManagePODDischargeGateoutFullService));
await name.AutoTransferNotice(taskInfo.PK_ID);
} }
#endregion #endregion

@ -10,6 +10,7 @@ using MySqlX.XDevAPI.Common;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection.Metadata.Ecma335;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -210,8 +211,17 @@ namespace Myshipping.Application
[HttpGet("/TaskManageVGM/SendVGMMissingNotice")] [HttpGet("/TaskManageVGM/SendVGMMissingNotice")]
public async Task<TaskManageOrderResultDto> SendVGMMissingNotice(string taskPkId) public async Task<TaskManageOrderResultDto> SendVGMMissingNotice(string taskPkId)
{ {
/*
*/
//查询所有 //查询所有
return null; return null;
} }
public async Task<TaskManageOrderResultDto> SyncBookingOrder()
{
return null;
}
} }
} }

File diff suppressed because it is too large Load Diff

@ -9,6 +9,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Furion" Version="4.8.8.40" /> <PackageReference Include="Furion" Version="4.8.8.40" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.54" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.102" /> <PackageReference Include="SqlSugarCore" Version="5.1.4.102" />
</ItemGroup> </ItemGroup>

Loading…
Cancel
Save