From 33027d76681203786ce6b5934536f3f1a1bff0a0 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 23 Jul 2024 16:08:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=80=E6=9C=89=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=BD=AC=E5=8F=91=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=8A=84=E9=80=81=E9=82=AE=E4=BB=B6=E7=BB=99=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=EF=BC=8C=E9=80=9A=E8=BF=87=E5=88=A4=E6=96=AD=E7=A7=9F?= =?UTF-8?q?=E6=88=B7=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskManagePlat/RouteChangeAdvisoryService.cs | 12 +++++++++++- .../Service/TaskManagePlat/TaskManageBCService.cs | 10 ++++++++++ .../TaskManageCutDateChangeService.cs | 13 +++++++++++-- .../TaskManagePlat/TaskManageDRAFTService.cs | 14 +++++++++++++- .../TaskManagePODDischargeGateoutFullService.cs | 14 +++++++++++++- .../TaskManageRollingNominationService.cs | 14 +++++++++++++- .../TaskPOLContainerNotPickUpService.cs | 8 ++++++++ .../TaskTransPlanHasChangeService.cs | 8 ++++++++ 8 files changed, 87 insertions(+), 6 deletions(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/RouteChangeAdvisoryService.cs b/Myshipping.Application/Service/TaskManagePlat/RouteChangeAdvisoryService.cs index 4d0b2884..f0b99b06 100644 --- a/Myshipping.Application/Service/TaskManagePlat/RouteChangeAdvisoryService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/RouteChangeAdvisoryService.cs @@ -49,6 +49,7 @@ namespace Myshipping.Application private readonly SqlSugarRepository _sysUserRepository; private readonly SqlSugarRepository _repPrintTemplate; private readonly SqlSugarRepository _taskFileRepository; + private readonly IDjyTenantParamService _djyTenantParamService; public RouteChangeAdvisoryService(ISysCacheService cache, ILogger logger, SqlSugarRepository taskBaseRepository, @@ -59,7 +60,7 @@ namespace Myshipping.Application SqlSugarRepository sysUserRepository, SqlSugarRepository repPrintTemplate, SqlSugarRepository taskFileRepository, - SqlSugarRepository bookingOrderRepository) + SqlSugarRepository bookingOrderRepository, IDjyTenantParamService djyTenantParamService) { _cache = cache; _logger = logger; @@ -74,6 +75,7 @@ namespace Myshipping.Application _repPrintTemplate = repPrintTemplate; _taskFileRepository = taskFileRepository; + _djyTenantParamService = djyTenantParamService; } #region 获取船舶相关截止时间的通知详情 @@ -558,6 +560,14 @@ namespace Myshipping.Application Attaches = new List() }; + //如果配置了租户参数(AUTO_TRANS_EMAIL_OP_CCTO-自动转发是否默认抄送操作=ENABLE)发送邮件时自动抄送操作 + DjyTenantParamValueOutput paramConfig = _djyTenantParamService.GetParaCodeWithValue(new[] { "AUTO_TRANS_EMAIL_OP_CCTO" }).GetAwaiter().GetResult().FirstOrDefault(); + + if (paramConfig != null && paramConfig.ParaValue.Equals("ENABLE", StringComparison.OrdinalIgnoreCase)) + { + emailApiUserDefinedDto.CCTo = opEmail; + } + _logger.LogInformation($"生成请求邮件参数,结果:{JSON.Serialize(emailApiUserDefinedDto)}"); TaskFileInfo fileInfo = null; diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs index 6851153a..3b1c85c6 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs @@ -1905,6 +1905,7 @@ namespace Myshipping.Application filePath = Path.Combine(dirAbs, fileInfo.FILE_PATH); + EmailApiUserDefinedDto emailApiUserDefinedDto = new EmailApiUserDefinedDto { SendTo = toEmail, @@ -1919,6 +1920,15 @@ namespace Myshipping.Application Attaches = new List() }; + //如果配置了租户参数(AUTO_TRANS_EMAIL_OP_CCTO-自动转发是否默认抄送操作=ENABLE)发送邮件时自动抄送操作 + DjyTenantParamValueOutput paramConfig = _djyTenantParamService.GetParaCodeWithValue(new[] { "AUTO_TRANS_EMAIL_OP_CCTO" }).GetAwaiter().GetResult().FirstOrDefault(); + + if (paramConfig != null && paramConfig.ParaValue.Equals("ENABLE", StringComparison.OrdinalIgnoreCase)) + { + emailApiUserDefinedDto.CCTo = opEmail; + + } + _logger.LogInformation($"生成请求邮件参数,结果:{JSON.Serialize(emailApiUserDefinedDto)}"); diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageCutDateChangeService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageCutDateChangeService.cs index 36c76efb..cefe7fb8 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageCutDateChangeService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageCutDateChangeService.cs @@ -56,7 +56,7 @@ namespace Myshipping.Application private readonly INamedServiceProvider _namedBookingOrderServiceProvider; private readonly SqlSugarRepository _bookingSlotBaseRepository; private readonly INamedServiceProvider _namedTaskCautionNoticeServiceProvider; - + private readonly IDjyTenantParamService _djyTenantParamService; public TaskManageCutDateChangeService(SqlSugarRepository taskCutDateChangeInfoRepository, SqlSugarRepository taskCutDateChangeDetailInfoRepository, @@ -70,7 +70,7 @@ namespace Myshipping.Application INamedServiceProvider namedBookingOrderServiceProvider, INamedServiceProvider namedTaskCautionNoticeServiceProvider, SqlSugarRepository bookingSlotBaseRepository, - SqlSugarRepository bookingOrderRepository) + SqlSugarRepository bookingOrderRepository, IDjyTenantParamService djyTenantParamService) { _taskCutDateChangeInfoRepository = taskCutDateChangeInfoRepository; _taskCutDateChangeDetailInfoRepository = taskCutDateChangeDetailInfoRepository; @@ -83,6 +83,7 @@ namespace Myshipping.Application _namedBookingOrderServiceProvider = namedBookingOrderServiceProvider; _bookingSlotBaseRepository = bookingSlotBaseRepository; _namedTaskCautionNoticeServiceProvider = namedTaskCautionNoticeServiceProvider; + _djyTenantParamService = djyTenantParamService; _logger = logger; _cache = cache; @@ -645,6 +646,14 @@ namespace Myshipping.Application Attaches = new List() }; + //如果配置了租户参数(AUTO_TRANS_EMAIL_OP_CCTO-自动转发是否默认抄送操作=ENABLE)发送邮件时自动抄送操作 + DjyTenantParamValueOutput paramConfig = _djyTenantParamService.GetParaCodeWithValue(new[] { "AUTO_TRANS_EMAIL_OP_CCTO" }).GetAwaiter().GetResult().FirstOrDefault(); + + if (paramConfig != null && paramConfig.ParaValue.Equals("ENABLE", StringComparison.OrdinalIgnoreCase)) + { + emailApiUserDefinedDto.CCTo = opEmail; + } + _logger.LogInformation($"生成请求邮件参数,结果:{JSON.Serialize(emailApiUserDefinedDto)}"); //推送邮件 diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageDRAFTService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageDRAFTService.cs index 3bccc7fa..662e1e9a 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageDRAFTService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageDRAFTService.cs @@ -40,6 +40,7 @@ namespace Myshipping.Application private readonly SqlSugarRepository _bookingOrderRepository; private readonly SqlSugarRepository _sysUserRepository; private readonly IDjyCustomerService _djyCustomerService; + private readonly IDjyTenantParamService _djyTenantParamService; public TaskManageDRAFTService(SqlSugarRepository taskBaseRepository, SqlSugarRepository taskFileRepository, @@ -50,7 +51,8 @@ namespace Myshipping.Application SqlSugarRepository sysUserRepository, IDjyCustomerService djyCustomerService, ISysCacheService cache, - ILogger logger) + ILogger logger, + IDjyTenantParamService djyTenantParamService) { _taskBaseRepository = taskBaseRepository; _taskFileRepository = taskFileRepository; @@ -64,6 +66,7 @@ namespace Myshipping.Application _logger = logger; _cache = cache; + _djyTenantParamService = djyTenantParamService; } #region 获取DRAFT详情 @@ -379,6 +382,15 @@ namespace Myshipping.Application Attaches = new List() }; + //如果配置了租户参数(AUTO_TRANS_EMAIL_OP_CCTO-自动转发是否默认抄送操作=ENABLE)发送邮件时自动抄送操作 + DjyTenantParamValueOutput paramConfig = _djyTenantParamService.GetParaCodeWithValue(new[] { "AUTO_TRANS_EMAIL_OP_CCTO" }).GetAwaiter().GetResult().FirstOrDefault(); + + if (paramConfig != null && paramConfig.ParaValue.Equals("ENABLE", StringComparison.OrdinalIgnoreCase)) + { + emailApiUserDefinedDto.CCTo = opEmail; + + } + _logger.LogInformation($"生成请求邮件参数,结果:{JSON.Serialize(emailApiUserDefinedDto)}"); diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManagePODDischargeGateoutFullService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManagePODDischargeGateoutFullService.cs index c8260db8..55abdf2a 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManagePODDischargeGateoutFullService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManagePODDischargeGateoutFullService.cs @@ -45,6 +45,7 @@ namespace Myshipping.Application private readonly SqlSugarRepository _sysUserRepository; private readonly SqlSugarRepository _repPrintTemplate; private readonly ISysCacheService _cache; + private readonly IDjyTenantParamService _djyTenantParamService; public TaskManagePODDischargeGateoutFullService(ILogger logger, SqlSugarRepository taskPODDischargeGateoutFullInfoRep, @@ -55,7 +56,8 @@ namespace Myshipping.Application SqlSugarRepository sysUserRepository, SqlSugarRepository repPrintTemplate, ISysCacheService cache, - SqlSugarRepository bookingOrderRepository) + SqlSugarRepository bookingOrderRepository, + IDjyTenantParamService djyTenantParamService) { _taskPODDischargeGateoutFullInfoRep = taskPODDischargeGateoutFullInfoRep; _taskBaseRepository = taskBaseRepository; @@ -67,6 +69,7 @@ namespace Myshipping.Application _sysUserRepository = sysUserRepository; _repPrintTemplate = repPrintTemplate; _cache = cache; + _djyTenantParamService = djyTenantParamService; } #region 获取目的港未提货未返箱详情 @@ -571,6 +574,15 @@ namespace Myshipping.Application Attaches = new List() }; + //如果配置了租户参数(AUTO_TRANS_EMAIL_OP_CCTO-自动转发是否默认抄送操作=ENABLE)发送邮件时自动抄送操作 + DjyTenantParamValueOutput paramConfig = _djyTenantParamService.GetParaCodeWithValue(new[] { "AUTO_TRANS_EMAIL_OP_CCTO" }).GetAwaiter().GetResult().FirstOrDefault(); + + if (paramConfig != null && paramConfig.ParaValue.Equals("ENABLE", StringComparison.OrdinalIgnoreCase)) + { + emailApiUserDefinedDto.CCTo = opEmail; + + } + _logger.LogInformation($"生成请求邮件参数,结果:{JSON.Serialize(emailApiUserDefinedDto)}"); //推送邮件 diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs index 8b81ec94..47519864 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs @@ -53,6 +53,7 @@ namespace Myshipping.Application private readonly SqlSugarRepository _sysUserRepository; private readonly SqlSugarRepository _djyUserMailAccount; private readonly SqlSugarRepository _bookingOrderContactRepository; + private readonly IDjyTenantParamService _djyTenantParamService; private readonly INamedServiceProvider _namedServiceProvider; @@ -68,7 +69,8 @@ namespace Myshipping.Application SqlSugarRepository djyUserMailAccount, SqlSugarRepository bookingOrderContactRepository, INamedServiceProvider namedServiceProvider, - SqlSugarRepository bookingCtnRepository, ISysCacheService cache, ILogger logger) + SqlSugarRepository bookingCtnRepository, ISysCacheService cache, ILogger logger, + IDjyTenantParamService djyTenantParamService) { _taskBaseRepository = taskBaseRepository; _taskRollingNominationInfoRepository = taskRollingNominationInfoRepository; @@ -84,6 +86,7 @@ namespace Myshipping.Application _bookingOrderContactRepository = bookingOrderContactRepository; _namedServiceProvider = namedServiceProvider; + _djyTenantParamService = djyTenantParamService; _cache = cache; _logger = logger; @@ -1679,6 +1682,15 @@ namespace Myshipping.Application Attaches = new List() }; + //如果配置了租户参数(AUTO_TRANS_EMAIL_OP_CCTO-自动转发是否默认抄送操作=ENABLE)发送邮件时自动抄送操作 + DjyTenantParamValueOutput paramConfig = _djyTenantParamService.GetParaCodeWithValue(new[] { "AUTO_TRANS_EMAIL_OP_CCTO" }).GetAwaiter().GetResult().FirstOrDefault(); + + if (paramConfig != null && paramConfig.ParaValue.Equals("ENABLE", StringComparison.OrdinalIgnoreCase)) + { + emailApiUserDefinedDto.CCTo = opEmail; + + } + _logger.LogInformation($"生成请求邮件参数,结果:{JSON.Serialize(emailApiUserDefinedDto)}"); string filePath = string.Empty; diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskPOLContainerNotPickUpService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskPOLContainerNotPickUpService.cs index 34f2a98d..6b84eb05 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskPOLContainerNotPickUpService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskPOLContainerNotPickUpService.cs @@ -414,6 +414,14 @@ namespace Myshipping.Application Attaches = new List() }; + DjyTenantParamValueOutput paramConfig = _djyTenantParamService.GetParaCodeWithValue(new[] { "AUTO_TRANS_EMAIL_OP_CCTO" }).GetAwaiter().GetResult().FirstOrDefault(); + + if (paramConfig != null && paramConfig.ParaValue.Equals("ENABLE", StringComparison.OrdinalIgnoreCase)) + { + emailApiUserDefinedDto.CCTo = opEmail; + + } + _logger.LogInformation($"生成请求邮件参数,结果:{JSON.Serialize(emailApiUserDefinedDto)}"); //推送邮件 diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskTransPlanHasChangeService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskTransPlanHasChangeService.cs index 33281d57..54d17d6e 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskTransPlanHasChangeService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskTransPlanHasChangeService.cs @@ -672,6 +672,14 @@ namespace Myshipping.Application Attaches = new List() }; + DjyTenantParamValueOutput paramConfig = _djyTenantParamService.GetParaCodeWithValue(new[] { "AUTO_TRANS_EMAIL_OP_CCTO" }).GetAwaiter().GetResult().FirstOrDefault(); + + if (paramConfig != null && paramConfig.ParaValue.Equals("ENABLE", StringComparison.OrdinalIgnoreCase)) + { + emailApiUserDefinedDto.CCTo = opEmail; + + } + _logger.LogInformation($"生成请求邮件参数,结果:{JSON.Serialize(emailApiUserDefinedDto)}"); //推送邮件