diff --git a/ds-wms-service/DS.Module.Core/Constants/TaskFlowDataNameConst.cs b/ds-wms-service/DS.Module.Core/Constants/TaskFlowDataNameConst.cs index b65e312c..1efeb19b 100644 --- a/ds-wms-service/DS.Module.Core/Constants/TaskFlowDataNameConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/TaskFlowDataNameConst.cs @@ -78,5 +78,12 @@ namespace DS.Module.Core /// /// 类型:Param{T} public const string ClientParam = "ClientParam"; + + /// + /// 任务主键 + /// + /// 类型:Param{T} + public const string TaskPKId = "TaskPKId"; + } } diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/POLContainerNotPickUp/ITaskPOLContainerNotPickUpService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/POLContainerNotPickUp/ITaskPOLContainerNotPickUpService.cs index 6e676746..bf476844 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/POLContainerNotPickUp/ITaskPOLContainerNotPickUpService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/POLContainerNotPickUp/ITaskPOLContainerNotPickUpService.cs @@ -1,4 +1,5 @@ using DS.Module.Core; +using DS.Module.Core.Data; using DS.WMS.Core.Op.Dtos; using DS.WMS.Core.TaskPlat.Dtos; using System; @@ -34,5 +35,12 @@ namespace DS.WMS.Core.TaskPlat.Interface /// 起运港未提箱主键 /// 返回回执 Task SendEmailToCustomer(long taskPKId); + + /// + /// 发送邮件通知给客户(任务自动机调取) + /// + /// 数据上下文 + /// 返回回执 + Task SendEmailToCustomerTask(TaskFlowDataContext dataContext); } } diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/POLContainerNotPickUp/TaskPOLContainerNotPickUpService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/POLContainerNotPickUp/TaskPOLContainerNotPickUpService.cs index 2f6d81d7..eb9b7311 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/POLContainerNotPickUp/TaskPOLContainerNotPickUpService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/POLContainerNotPickUp/TaskPOLContainerNotPickUpService.cs @@ -97,6 +97,13 @@ namespace DS.WMS.Core.TaskPlat.Method list = queryList.Select(a => a.Pol.Adapt()).ToList(); } + List noList = new List(); + + for (int i = 0; i < 2000; i++) + { + noList.Add(SnowFlakeSingle.Instance.NextId()); + } + return DataResult>.Success(list); } #endregion @@ -109,7 +116,13 @@ namespace DS.WMS.Core.TaskPlat.Method /// 返回回执 public async Task> SearchAndMarkBookingOrder(long taskPKId) { - return null; + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + + + + var entity = tenantDb.Queryable().Filter(null, true).First(a => a.TASK_ID == taskPKId); + + return await _seaExportService.SearchOrderInfo(entity.MBL_NO); } #endregion @@ -121,6 +134,10 @@ namespace DS.WMS.Core.TaskPlat.Method /// 返回回执 public async Task SendEmailToCustomer(long taskPKId) { + //先匹配订单记录(这里可能关联的是拆票或者合票订单,如果是拆票需要所有拆票记录都要发邮件通知) + var searchInfo = SearchAndMarkBookingOrder(taskPKId).GetAwaiter().GetResult().Data; + + //BusinessTaskMail? mailConfig = null; //if (context.AdditionalData.TryGetValue(nameof(BusinessTaskMail) + "." + nameof(BusinessTaskMail.Id), out var id)) //{ @@ -147,8 +164,38 @@ namespace DS.WMS.Core.TaskPlat.Method // //return; //} + //var model = new MailTemplateModel(order) + //{ + // BusinessId = context.TaskInfo.BusinessId, + // BusinessType = context.TaskInfo.BusinessType, + //}; + //MailService mailService = new MailService(context.ServiceProvider); + //var result3 = await mailService.SendAsync(mailConfig, model); + //if (!result3.Succeeded) + //{ + // await LogService.WriteLogAsync(context.TaskInfo, result.Message); + // return; + //} + + //await SetTaskCompleteAsync(context.TaskInfo, + // context.ServiceProvider.GetRequiredService(), LogService); + return null; } #endregion + + #region 发送邮件通知给客户(任务自动机调取) + /// + /// 发送邮件通知给客户(任务自动机调取) + /// + /// 数据上下文 + /// 返回回执 + public async Task SendEmailToCustomerTask(TaskFlowDataContext dataContext) + { + var taskPKId = dataContext.Get>(TaskFlowDataNameConst.TaskPKId) ?? throw new ArgumentException($"缺少参数:{nameof(TaskFlowDataNameConst.TaskPKId)}"); + + return await SendEmailToCustomer(taskPKId); + } + #endregion } } diff --git a/ds-wms-service/DS.WMS.OpApi/DS.WMS.OpApi.csproj.user b/ds-wms-service/DS.WMS.OpApi/DS.WMS.OpApi.csproj.user index fb7be066..da141c5a 100644 --- a/ds-wms-service/DS.WMS.OpApi/DS.WMS.OpApi.csproj.user +++ b/ds-wms-service/DS.WMS.OpApi/DS.WMS.OpApi.csproj.user @@ -1,7 +1,7 @@  - D:\Source\Repos\DS8\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml + E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml MvcControllerEmptyScaffolder root/Common/MVC/Controller diff --git a/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManagePOLCtnNotPickUpController.cs b/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManagePOLCtnNotPickUpController.cs new file mode 100644 index 00000000..ed04a199 --- /dev/null +++ b/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManagePOLCtnNotPickUpController.cs @@ -0,0 +1,54 @@ +using DS.Module.Core; +using DS.WMS.Core.TaskPlat.Dtos; +using DS.WMS.Core.TaskPlat.Interface; +using DS.WMS.Core.TaskPlat.Method; +using Microsoft.AspNetCore.Mvc; + +namespace DS.WMS.TaskApi.Controllers +{ + /// + /// 起运港未提箱 + /// + public class TaskManagePOLCtnNotPickUpController : ApiController + { + private readonly ITaskPOLContainerNotPickUpService _taskPOLContainerNotPickUpService; + + /// + /// + /// + /// + public TaskManagePOLCtnNotPickUpController(ITaskPOLContainerNotPickUpService taskPOLContainerNotPickUpService) + { + _taskPOLContainerNotPickUpService = taskPOLContainerNotPickUpService; + } + + #region 通过任务主键获取起运港未提箱详情 + /// + /// 通过任务主键获取起运港未提箱详情 + /// + /// 起运港未提箱任务主键 + /// 返回回执 + [HttpGet] + [Route("GetInfoByTaskId")] + public async Task>> GetInfoByTaskId([FromQuery] long taskPKId) + { + return await _taskPOLContainerNotPickUpService.GetInfoByTaskId(taskPKId); + } + #endregion + + + #region 发送邮件通知给客户 + /// + /// 发送邮件通知给客户 + /// + /// 起运港未提箱主键 + /// 返回回执 + [HttpGet] + [Route("SendEmailToCustomer")] + public async Task SendEmailToCustomer(long taskPKId) + { + return await _taskPOLContainerNotPickUpService.SendEmailToCustomer(taskPKId); + } + #endregion + } +}