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 19c68ef9..1f5da59b 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 @@ -42,6 +42,9 @@ using DS.Module.Core.Data; using LanguageExt.Common; using DS.WMS.Core.Op.Method.TaskInteraction; using DS.WMS.Core.Op.Entity.TaskInteraction; +using DS.WMS.Core.Op.Interface.TaskInteraction; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Logging; namespace DS.WMS.Core.TaskPlat.Method { @@ -53,19 +56,18 @@ namespace DS.WMS.Core.TaskPlat.Method private readonly ITaskLogService _logService; private readonly ITaskMailService _taskMailService; - public TaskPOLContainerNotPickUpService(IUser user, - ILogger logger, + public TaskPOLContainerNotPickUpService(IUser user,ILogger logger, ISaasDbService saasDbService, IServiceProvider serviceProvider, IWebHostEnvironment environment) : base(user, logger, saasDbService, serviceProvider, environment) { - _serviceProvider = serviceProvider; - db = _serviceProvider.GetRequiredService(); - user = _serviceProvider.GetRequiredService(); - saasService = _serviceProvider.GetRequiredService(); - _seaExportService = _serviceProvider.GetRequiredService(); - _configService = _serviceProvider.GetRequiredService(); - _userService = _serviceProvider.GetRequiredService(); + //_serviceProvider = serviceProvider; + //db = serviceProvider.GetRequiredService(); + user = serviceProvider.GetRequiredService(); + //saasService = serviceProvider.GetRequiredService(); + _seaExportService = serviceProvider.GetRequiredService(); + _configService = serviceProvider.GetRequiredService(); + _userService = serviceProvider.GetRequiredService(); } #region 通过任务主键获取起运港未提箱详情 @@ -141,14 +143,14 @@ namespace DS.WMS.Core.TaskPlat.Method BusinessId = taskPKId, BusinessType = BusinessType.OceanShippingExport, AutoCreateNext = true, - TaskTypeName = TaskBaseTypeEnum.POL_CTN_NOT_PICKUP.GetDescription(), + TaskTypeName = TaskBaseTypeEnum.POL_CTN_NOT_PICKUP.ToString(), }, $"未能根据任务配置值获取邮件模板设置"); return DataResult.Failed("未能根据任务配置值获取邮件模板设置"); } - var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId); var entity = tenantDb.Queryable().Filter(null, true).First(a => a.TASK_ID == taskPKId); @@ -162,7 +164,7 @@ namespace DS.WMS.Core.TaskPlat.Method BusinessType = BusinessType.OceanShippingExport, }; - MailService mailService = new MailService(_serviceProvider); + MailService mailService = new MailService(serviceProvider); var result = await mailService.SendAsync(mailConfig, model); if (!result.Succeeded) @@ -172,7 +174,7 @@ namespace DS.WMS.Core.TaskPlat.Method BusinessId = taskPKId, BusinessType = BusinessType.OceanShippingExport, AutoCreateNext = true, - TaskTypeName = TaskBaseTypeEnum.POL_CTN_NOT_PICKUP.GetDescription(), + TaskTypeName = TaskBaseTypeEnum.POL_CTN_NOT_PICKUP.ToString(), }, result.Message); @@ -203,7 +205,7 @@ namespace DS.WMS.Core.TaskPlat.Method BusinessId = taskPKId, BusinessType = BusinessType.OceanShippingExport, AutoCreateNext = true, - TaskTypeName = TaskBaseTypeEnum.POL_CTN_NOT_PICKUP.GetDescription(), + TaskTypeName = TaskBaseTypeEnum.POL_CTN_NOT_PICKUP.ToString(), }, $"缺少参数:{nameof(BusinessTaskMail)}.{nameof(BusinessTaskMail.Id)}"); diff --git a/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManagePOLCtnNotPickUpController.cs b/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManagePOLCtnNotPickUpController.cs index ed04a199..a2c6a28e 100644 --- a/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManagePOLCtnNotPickUpController.cs +++ b/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManagePOLCtnNotPickUpController.cs @@ -47,7 +47,7 @@ namespace DS.WMS.TaskApi.Controllers [Route("SendEmailToCustomer")] public async Task SendEmailToCustomer(long taskPKId) { - return await _taskPOLContainerNotPickUpService.SendEmailToCustomer(taskPKId); + return await _taskPOLContainerNotPickUpService.ManualSendEmailToCustomer(taskPKId); } #endregion }