From 20965ef1eca4178c62956aa1e064efd32a7790c6 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 21 Aug 2024 14:14:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B5=B7=E8=BF=90=E6=B8=AF?= =?UTF-8?q?=E6=9C=AA=E6=8F=90=E7=AE=B1=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj | 1 - .../ITaskPOLContainerNotPickUpService.cs | 38 ++++++ .../TaskPOLContainerNotPickUpService.cs | 125 ++++++++++++++++++ 3 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 ds-wms-service/DS.WMS.Core/TaskPlat/Interface/POLContainerNotPickUp/ITaskPOLContainerNotPickUpService.cs create mode 100644 ds-wms-service/DS.WMS.Core/TaskPlat/Method/POLContainerNotPickUp/TaskPOLContainerNotPickUpService.cs diff --git a/ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj b/ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj index a7dc4b05..4c4c4b73 100644 --- a/ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj +++ b/ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj @@ -42,7 +42,6 @@ - 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 new file mode 100644 index 00000000..6e676746 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/POLContainerNotPickUp/ITaskPOLContainerNotPickUpService.cs @@ -0,0 +1,38 @@ +using DS.Module.Core; +using DS.WMS.Core.Op.Dtos; +using DS.WMS.Core.TaskPlat.Dtos; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.TaskPlat.Interface +{ + /// + /// 起运港未提箱通知服务 + /// + public interface ITaskPOLContainerNotPickUpService + { + /// + /// 通过任务主键获取起运港未提箱详情 + /// + /// 起运港未提箱任务主键 + /// 返回回执 + Task>> GetInfoByTaskId(long taskPKId); + + /// + /// 检索对应的订舱订单并保存订舱ID + /// + /// 起运港未提箱任务主键 + /// 返回回执 + Task> SearchAndMarkBookingOrder(long taskPKId); + + /// + /// 发送邮件通知给客户 + /// + /// 起运港未提箱主键 + /// 返回回执 + Task SendEmailToCustomer(long taskPKId); + } +} 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 new file mode 100644 index 00000000..411c3aef --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/POLContainerNotPickUp/TaskPOLContainerNotPickUpService.cs @@ -0,0 +1,125 @@ +using DS.Module.Core; +using DS.Module.RedisModule; +using DS.Module.SqlSugar; +using DS.Module.UserModule; +using DS.WMS.Core.Code.Interface; +using DS.WMS.Core.Code.Method; +using DS.WMS.Core.Map.Interface; +using DS.WMS.Core.Map.Method; +using DS.WMS.Core.Sys.Interface; +using DS.WMS.Core.Sys.Method; +using DS.WMS.Core.TaskPlat.Dtos; +using DS.WMS.Core.TaskPlat.Entity; +using DS.WMS.Core.TaskPlat.Interface; +using Microsoft.Extensions.DependencyInjection; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Mapster; +using DS.Module.DjyServiceStatus; +using Microsoft.AspNetCore.Identity; +using DS.WMS.Core.Op.Interface; +using Masuit.Tools; +using DS.WMS.Core.Op.Dtos; +using DS.WMS.Core.Sys.Entity; +using HtmlAgilityPack; +using Microsoft.AspNetCore.Mvc; +using Amazon.Runtime.Internal.Util; +using Newtonsoft.Json; +using NLog; +using DS.Module.Core.Helpers; +using System.Text.Json.Nodes; +using LanguageExt.Pipes; +using DS.WMS.Core.Op.Entity; +using Org.BouncyCastle.Asn1.X9; +using DS.WMS.Core.Op.EDI; +using DS.WMS.Core.Sys.Dtos; +using DS.WMS.Core.Code.Dtos; +using DS.Module.Core.Data; + +namespace DS.WMS.Core.TaskPlat.Method +{ + public class TaskPOLContainerNotPickUpService : ITaskPOLContainerNotPickUpService + { + private readonly IServiceProvider _serviceProvider; + private readonly ISqlSugarClient db; + private readonly IUser user; + private readonly ISaasDbService saasService; + private readonly ISeaExportService _seaExportService; + private readonly IConfigService _configService; + private readonly IUserService _userService; + + private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); + + public TaskPOLContainerNotPickUpService(IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + db = _serviceProvider.GetRequiredService(); + user = _serviceProvider.GetRequiredService(); + saasService = _serviceProvider.GetRequiredService(); + _seaExportService = _serviceProvider.GetRequiredService(); + _configService = _serviceProvider.GetRequiredService(); + _userService = _serviceProvider.GetRequiredService(); + } + + #region 通过任务主键获取起运港未提箱详情 + /// + /// 通过任务主键获取起运港未提箱详情 + /// + /// 起运港未提箱任务主键 + /// 返回回执 + public async Task>> GetInfoByTaskId(long taskPKId) + { + List list = new List(); + + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + //任务不考虑OrgId,这里去掉 + tenantDb.QueryFilter.Clear(); + + var queryList = await tenantDb.Queryable() + .InnerJoin((a, b) => a.Id == b.TASK_ID) + .Where((a, b) => a.Id == taskPKId) + .Select((a, b) => new { Base = a, Pol = b }) + .ToListAsync(); + + //任务主键{taskPkId}无法获取业务信息 + if (queryList.Count == 0) + throw new Exception(string.Format(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.TaskBaseInfoFromTaskIdNull)), taskPKId)); + + if (queryList.Count > 0) + { + list = queryList.Select(a => a.Pol.Adapt()).ToList(); + } + + return DataResult>.Success(list); + } + #endregion + + #region 检索对应的订舱订单并保存订舱ID + /// + /// 检索对应的订舱订单并保存订舱ID + /// + /// 起运港未提箱任务主键 + /// 返回回执 + public async Task> SearchAndMarkBookingOrder(long taskPKId) + { + return null; + } + #endregion + + #region 发送邮件通知给客户 + /// + /// 发送邮件通知给客户 + /// + /// 起运港未提箱主键 + /// 返回回执 + public async Task SendEmailToCustomer(long taskPKId) + { + return null; + } + #endregion + } +}