From e9c70f5b561327eb3881af692d48ca5b921f3ed6 Mon Sep 17 00:00:00 2001 From: cjy Date: Fri, 16 Aug 2024 13:44:00 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=A7=94=E6=89=98?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E4=B8=8B=E6=8B=89=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Info/Dtos/ControllerClientRes.cs | 124 +++++ .../Sys/Interface/IClientCommonService.cs | 6 + .../Sys/Method/ClientCommonService.cs | 20 + .../Controllers/ClientCommonController.cs | 475 +++++++++--------- 4 files changed, 393 insertions(+), 232 deletions(-) create mode 100644 ds-wms-service/DS.WMS.Core/Info/Dtos/ControllerClientRes.cs diff --git a/ds-wms-service/DS.WMS.Core/Info/Dtos/ControllerClientRes.cs b/ds-wms-service/DS.WMS.Core/Info/Dtos/ControllerClientRes.cs new file mode 100644 index 00000000..a1d2331e --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Info/Dtos/ControllerClientRes.cs @@ -0,0 +1,124 @@ +using DS.Module.Core.Extensions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Info.Dtos +{ + /// + /// 委托单位下拉返回信息 + /// + public class ControllerClientRes + { + /// + /// 主键Id + /// + public long Id { get; set; } + + + /// + /// Desc:客户代码 + /// + public string CodeName { get; set; } + + /// + /// Desc:客户简称 + /// + public string ShortName { get; set; } + + + /// + /// Desc:英文简称 + /// + public string EnShortName { get; set; } + + /// + /// Desc:提单信息 + /// + public string BLContent { get; set; } + + /// + /// 助记码 + /// + public string PinYinCode { get; set; } + + /// + /// Desc:业务来源Id + /// + public long SourceId { get; set; } + /// + /// Desc:业务来源明细Id + /// + public long SourceDetailId { get; set; } + /// + /// Desc:业务来源名称 + /// + public string SourceName { get; set; } + /// + /// Desc:业务来源明细名称 + /// + public string SourceDetailName { get; set; } + /// + /// Desc:所属揽货人 + /// + public long SaleId { get; set; } + + /// + /// Desc:所属操作人 + /// + public long Op { get; set; } + + /// + /// Desc:所属单证 + /// + public long Doc { get; set; } + + /// + /// Desc: 客服 + /// + public long CustomerService { get; set; } + /// + /// 揽货人名字 + /// + public string SaleName { get; set; } + + /// + /// 操作名字 + /// + public string OpName { get; set; } + + /// + /// 单证名字 + /// + public string DocName { get; set; } + + /// + /// 客服名字 + /// + public string CustomerServiceName { get; set; } + + /// + /// 所属分部值 + /// + [IgnoreDataMember] + public string? SaleOrgId { get; set; } + + /// + /// 所属分部 + /// + public long[] SaleOrgIdList => SaleOrgId.IsNullOrEmpty() ? [] : + SaleOrgId.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray(); + /// + /// 所属集团ID + /// + public long? PcorpId { get; set; } + + /// + /// Desc: 所属集团 + /// + public string PcorpName { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs index 827f89cf..a0e5c699 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs @@ -14,6 +14,12 @@ namespace DS.WMS.Core.Sys.Interface; /// public interface IClientCommonService { + + /// + /// 获取委托单位下拉列表 + /// + /// + public Task>> GetControllerClientList(string queryKey = ""); /// /// 获取船公司下拉列表 /// diff --git a/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs index e7aa734c..9509fa61 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs @@ -47,6 +47,26 @@ public class ClientCommonService : IClientCommonService user = _serviceProvider.GetRequiredService(); saasService = _serviceProvider.GetRequiredService(); } + + /// + /// 获取委托单位下拉列表 + /// + /// + public async Task>> GetControllerClientList(string queryKey = "") + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var data = await tenantDb.Queryable() + .InnerJoin((a, b) => a.Id == b.ClientId) + .Where((a, b) => a.Status == StatusEnum.Enable.ToEnumInt() && b.IsController == true) + .WhereIF(!string.IsNullOrEmpty(queryKey), (a, b) => a.CodeName.Contains(queryKey) || a.ShortName.Contains(queryKey)) + .Select((a, b) => new ControllerClientRes + { + Id = a.Id, + PinYinCode = a.ShortName + "(" + a.CodeName + ")" + },true + ).Take(20).WithCache($"{SqlSugarCacheConst.InfoClient}{user.TenantId}").ToListAsync(); + return await Task.FromResult(DataResult>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess)); + } /// /// 获取船公司下拉列表 /// diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/ClientCommonController.cs b/ds-wms-service/DS.WMS.MainApi/Controllers/ClientCommonController.cs index e945a7f0..3ced5769 100644 --- a/ds-wms-service/DS.WMS.MainApi/Controllers/ClientCommonController.cs +++ b/ds-wms-service/DS.WMS.MainApi/Controllers/ClientCommonController.cs @@ -28,7 +28,18 @@ public class ClientCommonController : ApiController { _invokeService = invokeService; } - + /// + /// 获取委托单位下拉列表-客户端 + /// + /// 委托单位代码或中文名称 + /// + [HttpGet] + [Route("GetControllerClientList")] + public async Task>> GetControllerClientList([FromQuery] string queryKey) + { + var res = await _invokeService.GetControllerClientList(queryKey); + return res; + } /// /// 获取船公司下拉列表-客户端 /// @@ -225,237 +236,237 @@ public class ClientCommonController : ApiController var res = await _invokeService.GetClientListByCode(code, queryKey); return res; } - /// - /// 获取所有往来单位下拉列表 - /// - /// - [HttpGet] - [Route("GetAllClientList")] - public DataResult> GetAllClientList() - { - var res = _invokeService.GetAllClientList(); - return res; - } - /// - /// 获取船公司下拉列表 - /// - /// - [HttpGet] - [Route("GetCarrierClientList")] - public DataResult> GetCarrierClientList() - { - var res = _invokeService.GetCarrierClientList(); - return res; - } - /// - /// 获取场站下拉列表 - /// - /// - [HttpGet] - [Route("GetYardClientList")] - public DataResult> GetYardClientList() - { - var res = _invokeService.GetYardClientList(); - return res; - } - /// - /// 获取订舱公司下拉列表 - /// - /// - [HttpGet] - [Route("GetBookingClientList")] - public DataResult> GetBookingClientList() - { - var res = _invokeService.GetBookingClientList(); - return res; - } - /// - /// 获取车队下拉列表 - /// - /// - [HttpGet] - [Route("GetTruckClientList")] - public DataResult> GetTruckClientList() - { - var res = _invokeService.GetTruckClientList(); - return res; - } - /// - /// 获取委托单位下拉列表 - /// - /// - [HttpGet] - [Route("GetControllerClientList")] - public DataResult> GetControllerClientList() - { - var res = _invokeService.GetControllerClientList(); - return res; - } - /// - /// 获取报关行下拉列表 - /// - /// - [HttpGet] - [Route("GetCustomClientList")] - public DataResult> GetCustomClientList() - { - var res = _invokeService.GetCustomClientList(); - return res; - } - /// - /// 获取代理(国外)下拉列表 - /// - /// - [HttpGet] - [Route("GetAgentClientList")] - public DataResult> GetAgentClientList() - { - var res = _invokeService.GetAgentClientList(); - return res; - } - /// - /// 获取代理(国内)下拉列表 - /// - /// - [HttpGet] - [Route("GetAgentCnClientList")] - public DataResult> GetAgentCnClientList() - { - var res = _invokeService.GetAgentCnClientList(); - return res; - } - /// - /// 获取快递公司下拉列表 - /// - /// - [HttpGet] - [Route("GetExpressClientList")] - public DataResult> GetExpressClientList() - { - var res = _invokeService.GetExpressClientList(); - return res; - } - /// - /// 获取航空公司下拉列表 - /// - /// - [HttpGet] - [Route("GetAirLinesClientList")] - public DataResult> GetAirLinesClientList() - { - var res = _invokeService.GetAirLinesClientList(); - return res; - } - /// - /// 获取发货人下拉列表 - /// - /// - [HttpGet] - [Route("GetShipperClientList")] - public DataResult> GetShipperClientList() - { - var res = _invokeService.GetShipperClientList(); - return res; - } - /// - /// 获取收货人下拉列表 - /// - /// - [HttpGet] - [Route("GetConsigneeClientList")] - public DataResult> GetConsigneeClientList() - { - var res = _invokeService.GetConsigneeClientList(); - return res; - } - /// - /// 获取通知人下拉列表 - /// - /// - [HttpGet] - [Route("GetNotifyPartyClientList")] - public DataResult> GetNotifyPartyClientList() - { - var res = _invokeService.GetNotifyPartyClientList(); - return res; - } - /// - /// 获取仓库下拉列表 - /// - /// - [HttpGet] - [Route("GetWareHouseClientList")] - public DataResult> GetWareHouseClientList() - { - var res = _invokeService.GetWareHouseClientList(); - return res; - } - /// - /// 获取保险公司下拉列表 - /// - /// - [HttpGet] - [Route("GetInsurerClientList")] - public DataResult> GetInsurerClientList() - { - var res = _invokeService.GetInsurerClientList(); - return res; - } - /// - /// 获取租箱公司下拉列表 - /// - /// - [HttpGet] - [Route("GetLeasingClientList")] - public DataResult> GetLeasingClientList() - { - var res = _invokeService.GetLeasingClientList(); - return res; - } - /// - /// 获取贸易代理下拉列表 - /// - /// - [HttpGet] - [Route("GetTradingAgencyClientList")] - public DataResult> GetTradingAgencyClientList() - { - var res = _invokeService.GetTradingAgencyClientList(); - return res; - } - /// - /// 获取船代下拉列表 - /// - /// - [HttpGet] - [Route("GetShipAgencyClientList")] - public DataResult> GetShipAgencyClientList() - { - var res = _invokeService.GetShipAgencyClientList(); - return res; - } - /// - /// 获取经营单位下拉列表 - /// - /// - [HttpGet] - [Route("GetEnterpriseClientList")] - public DataResult> GetEnterpriseClientList() - { - var res = _invokeService.GetEnterpriseClientList(); - return res; - } - /// - /// 获取码头下拉列表 - /// - /// - [HttpGet] - [Route("GetWharfClientList")] - public DataResult> GetWharfClientList() - { - var res = _invokeService.GetWharfClientList(); - return res; - } + ///// + ///// 获取所有往来单位下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetAllClientList")] + //public DataResult> GetAllClientList() + //{ + // var res = _invokeService.GetAllClientList(); + // return res; + //} + ///// + ///// 获取船公司下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetCarrierClientList")] + //public DataResult> GetCarrierClientList() + //{ + // var res = _invokeService.GetCarrierClientList(); + // return res; + //} + ///// + ///// 获取场站下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetYardClientList")] + //public DataResult> GetYardClientList() + //{ + // var res = _invokeService.GetYardClientList(); + // return res; + //} + ///// + ///// 获取订舱公司下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetBookingClientList")] + //public DataResult> GetBookingClientList() + //{ + // var res = _invokeService.GetBookingClientList(); + // return res; + //} + ///// + ///// 获取车队下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetTruckClientList")] + //public DataResult> GetTruckClientList() + //{ + // var res = _invokeService.GetTruckClientList(); + // return res; + //} + ///// + ///// 获取委托单位下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetControllerClientList")] + //public DataResult> GetControllerClientList() + //{ + // var res = _invokeService.GetControllerClientList(); + // return res; + //} + ///// + ///// 获取报关行下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetCustomClientList")] + //public DataResult> GetCustomClientList() + //{ + // var res = _invokeService.GetCustomClientList(); + // return res; + //} + ///// + ///// 获取代理(国外)下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetAgentClientList")] + //public DataResult> GetAgentClientList() + //{ + // var res = _invokeService.GetAgentClientList(); + // return res; + //} + ///// + ///// 获取代理(国内)下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetAgentCnClientList")] + //public DataResult> GetAgentCnClientList() + //{ + // var res = _invokeService.GetAgentCnClientList(); + // return res; + //} + ///// + ///// 获取快递公司下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetExpressClientList")] + //public DataResult> GetExpressClientList() + //{ + // var res = _invokeService.GetExpressClientList(); + // return res; + //} + ///// + ///// 获取航空公司下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetAirLinesClientList")] + //public DataResult> GetAirLinesClientList() + //{ + // var res = _invokeService.GetAirLinesClientList(); + // return res; + //} + ///// + ///// 获取发货人下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetShipperClientList")] + //public DataResult> GetShipperClientList() + //{ + // var res = _invokeService.GetShipperClientList(); + // return res; + //} + ///// + ///// 获取收货人下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetConsigneeClientList")] + //public DataResult> GetConsigneeClientList() + //{ + // var res = _invokeService.GetConsigneeClientList(); + // return res; + //} + ///// + ///// 获取通知人下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetNotifyPartyClientList")] + //public DataResult> GetNotifyPartyClientList() + //{ + // var res = _invokeService.GetNotifyPartyClientList(); + // return res; + //} + ///// + ///// 获取仓库下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetWareHouseClientList")] + //public DataResult> GetWareHouseClientList() + //{ + // var res = _invokeService.GetWareHouseClientList(); + // return res; + //} + ///// + ///// 获取保险公司下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetInsurerClientList")] + //public DataResult> GetInsurerClientList() + //{ + // var res = _invokeService.GetInsurerClientList(); + // return res; + //} + ///// + ///// 获取租箱公司下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetLeasingClientList")] + //public DataResult> GetLeasingClientList() + //{ + // var res = _invokeService.GetLeasingClientList(); + // return res; + //} + ///// + ///// 获取贸易代理下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetTradingAgencyClientList")] + //public DataResult> GetTradingAgencyClientList() + //{ + // var res = _invokeService.GetTradingAgencyClientList(); + // return res; + //} + ///// + ///// 获取船代下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetShipAgencyClientList")] + //public DataResult> GetShipAgencyClientList() + //{ + // var res = _invokeService.GetShipAgencyClientList(); + // return res; + //} + ///// + ///// 获取经营单位下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetEnterpriseClientList")] + //public DataResult> GetEnterpriseClientList() + //{ + // var res = _invokeService.GetEnterpriseClientList(); + // return res; + //} + ///// + ///// 获取码头下拉列表 + ///// + ///// + //[HttpGet] + //[Route("GetWharfClientList")] + //public DataResult> GetWharfClientList() + //{ + // var res = _invokeService.GetWharfClientList(); + // return res; + //} /// /// 获取部门列表 /// From 08b4d5c57885cd4c59b46bf67da1da5305d122ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Fri, 16 Aug 2024 13:56:22 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=94=BE=E8=88=B1=E9=80=9A=E9=81=93?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=A2=9E=E5=8A=A0=E5=BE=80=E6=9D=A5=E5=8D=95?= =?UTF-8?q?=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.WMS.AdminApi.csproj.user | 2 +- .../SpaceReleaseActionExecutor.cs | 42 +++++++---- .../Op/Method/TaskInteraction/TaskService.cs | 2 +- .../DS.WMS.Core/Sys/Entity/SysReleaseType.cs | 16 +++- .../Sys/Interface/IReleaseTypeService.cs | 9 +++ .../Sys/Method/ReleaseTypeService.cs | 73 ++++++++++++++++++- .../Controllers/ReleaseTypeController.cs | 3 + 7 files changed, 124 insertions(+), 23 deletions(-) diff --git a/ds-wms-service/DS.WMS.AdminApi/DS.WMS.AdminApi.csproj.user b/ds-wms-service/DS.WMS.AdminApi/DS.WMS.AdminApi.csproj.user index 93bef62e..4341ebc7 100644 --- a/ds-wms-service/DS.WMS.AdminApi/DS.WMS.AdminApi.csproj.user +++ b/ds-wms-service/DS.WMS.AdminApi/DS.WMS.AdminApi.csproj.user @@ -2,7 +2,7 @@ http - D:\Code\DS\ds8-solution-pro\ds-wms-service\DS.WMS.AdminApi\Properties\PublishProfiles\FolderProfile.pubxml + D:\Source\Repos\DS8\ds-wms-service\DS.WMS.AdminApi\Properties\PublishProfiles\FolderProfile.pubxml ProjectDebugger diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/SpaceRelease/SpaceReleaseActionExecutor.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/SpaceRelease/SpaceReleaseActionExecutor.cs index 7676c1ab..bb488c0b 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/SpaceRelease/SpaceReleaseActionExecutor.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/SpaceRelease/SpaceReleaseActionExecutor.cs @@ -7,6 +7,9 @@ using DS.WMS.Core.Op.Interface; using DS.WMS.Core.Op.Interface.TaskInteraction; using Masuit.Tools.Systems; using Microsoft.Extensions.DependencyInjection; +using DS.WMS.Core.Sys.Interface; +using DS.Module.UserModule; +using DS.WMS.Core.Sys.Entity; namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.SpaceRelease { @@ -15,29 +18,36 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.SpaceRelease /// public class SpaceReleaseActionExecutor : DefaultActionExecutor { - /// - /// 任务服务 - /// - protected ISeaExportService OpService; + ///// + ///// 任务服务 + ///// + //protected ISeaExportService OpService; /// /// 日志服务 /// protected ITaskLogService LogService; - /// - /// 客户参数服务 - /// - protected IClientParamService ClientParamService; - public override async Task ExecuteAsync(ActionExecutionContext context) { - OpService = context.ServiceProvider.GetRequiredService(); + //OpService = context.ServiceProvider.GetRequiredService(); LogService = context.ServiceProvider.GetRequiredService(); - ClientParamService = context.ServiceProvider.GetRequiredService(); - + var releaseTypeService = context.ServiceProvider.GetRequiredService(); + var typeValue = await releaseTypeService.GetReleaseTypeAsync(context.TaskInfo.BusinessId, context.TaskInfo.BusinessType); + switch (typeValue) + { + case SpaceReleaseType.RelayBC: + await RelayBCAsync(context); + break; + case SpaceReleaseType.IncomingNotification: + await SendIncomingNotificationAsync(context); + break; + } - var param2 = await ClientParamService.GetParamAsync(context.TaskInfo.BusinessId, "SendXHZ", (x, y) => x.CustomerId == y.YardId); + var clientParamService = context.ServiceProvider.GetRequiredService(); + var param = await clientParamService.GetParamAsync(context.TaskInfo.BusinessId, "SendXHZ", (x, y) => x.CustomerId == y.YardId); + if (param.Value.GetValueOrDefault()) + await SendShippingOrderAsync(context); } //入货通知 @@ -93,9 +103,9 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.SpaceRelease } //转发BC - async Task RelayBCAsync(ActionExecutionContext context) + async Task RelayBCAsync(ActionExecutionContext context) { - + } //下货纸 @@ -114,5 +124,5 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.SpaceRelease } - + } diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskService.cs index 0dc5dad8..98ee11ab 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskService.cs @@ -527,7 +527,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction if (useTransaction) await TenantDb.Ado.CommitTranAsync(); - //ActionService.Value.TriggerActionAsync(task); + ActionService.TriggerActionAsync(task); return DataResult.Success(task.TaskStatus == TaskStatusEnum.Complete ? await GetNextTypeAsync(task) : null); } catch (Exception ex) diff --git a/ds-wms-service/DS.WMS.Core/Sys/Entity/SysReleaseType.cs b/ds-wms-service/DS.WMS.Core/Sys/Entity/SysReleaseType.cs index 0e4118ab..93aa7ef3 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Entity/SysReleaseType.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Entity/SysReleaseType.cs @@ -11,11 +11,23 @@ namespace DS.WMS.Core.Sys.Entity [SugarTable("sys_release_type")] public class SysReleaseType : BaseModelV2 { + /// + /// 委托单位ID + /// + [SugarColumn(ColumnDescription = "委托单位ID", IsNullable = true)] + public long? CustomerId { get; set; } + + /// + /// 委托单位名称 + /// + [SugarColumn(IsIgnore = true)] + public string? CustomerName { get; set; } + /// /// 承运商(船公司/航空公司) /// - [SugarColumn(ColumnDescription = "承运商(船公司/航空公司)", Length = 50, IsNullable = false)] - public string Carrier { get; set; } = string.Empty; + [SugarColumn(ColumnDescription = "承运商(船公司/航空公司)", Length = 50, IsNullable = true)] + public string? Carrier { get; set; } /// /// 起运港代码 diff --git a/ds-wms-service/DS.WMS.Core/Sys/Interface/IReleaseTypeService.cs b/ds-wms-service/DS.WMS.Core/Sys/Interface/IReleaseTypeService.cs index 95637dca..ac53108e 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Interface/IReleaseTypeService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Interface/IReleaseTypeService.cs @@ -1,4 +1,5 @@ using DS.Module.Core; +using DS.WMS.Core.Op.Entity; using DS.WMS.Core.Sys.Entity; namespace DS.WMS.Core.Sys.Interface @@ -16,6 +17,14 @@ namespace DS.WMS.Core.Sys.Interface /// Task>> GetListAsync(PageRequest request, bool isAdmin = false); + /// + /// 根据业务数据匹配放舱方式 + /// + /// 业务ID + /// 业务类型 + /// + Task GetReleaseTypeAsync(long businessId, BusinessType businessType); + /// /// 详情 /// diff --git a/ds-wms-service/DS.WMS.Core/Sys/Method/ReleaseTypeService.cs b/ds-wms-service/DS.WMS.Core/Sys/Method/ReleaseTypeService.cs index f4d8a75e..b94f9ab3 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Method/ReleaseTypeService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Method/ReleaseTypeService.cs @@ -1,5 +1,9 @@ using DS.Module.Core; +using DS.Module.Core.Data; using DS.Module.Core.Extensions; +using DS.WMS.Core.Code.Entity; +using DS.WMS.Core.Info.Entity; +using DS.WMS.Core.Op.Entity; using DS.WMS.Core.Sys.Entity; using DS.WMS.Core.Sys.Interface; @@ -16,6 +20,7 @@ namespace DS.WMS.Core.Sys.Method /// public ReleaseTypeService(IServiceProvider provider) : base(provider) { + TenantDb.QueryFilter.Clear(); } /// @@ -28,12 +33,73 @@ namespace DS.WMS.Core.Sys.Method { var whereList = request.GetConditionalModels(Db); var tenantId = long.Parse(User.TenantId); - var data = await Db.Queryable().Where(whereList) - .WhereIF(!isAdmin, x => x.TenantId == tenantId) + var data = await Db.Queryable() + .Where(whereList).WhereIF(!isAdmin, x => x.TenantId == tenantId) .ToQueryPageAsync(request.PageCondition); + + if (data.Data?.Count > 0) + { + var ids = data.Data.Where(x => x.CustomerId.HasValue).Select(x => x.CustomerId.Value); + var list = await TenantDb.Queryable().Where(x => ids.Contains(x.Id)).Select(x => new { x.Id, x.ShortName }).ToListAsync(); + foreach (var item in data.Data) + item.CustomerName = list.Find(x => x.Id == item.CustomerId)?.ShortName; + } + return data; } + /// + /// 根据业务数据匹配放舱方式 + /// + /// 业务ID + /// 业务类型 + /// + public async Task GetReleaseTypeAsync(long businessId, BusinessType businessType) + { + SpaceReleaseType? releaseType = null; + switch (businessType) + { + case BusinessType.OceanShippingExport: + var order1 = await TenantDb.Queryable().Where(x => x.Id == businessId) + .LeftJoin((x, y) => x.CarrierId == y.Id) + .Select((x, y) => new + { + x.CustomerId, + x.LoadPortCode, + CarrierCode = y.Code + }).FirstAsync(); + if (order1 == null) + return null; + + long tid = long.Parse(User.TenantId); + var list = await Db.Queryable().Where(x => x.TenantId == tid && x.CustomerId == order1.CustomerId && x.LoadingPort == order1.LoadPortCode) + .Select(x => new { x.Carrier, x.ReleaseType }).ToListAsync(); + var clientItem = list.Find(x => x.Carrier == order1.CarrierCode); + if (clientItem != null) + return clientItem.ReleaseType; + + if (list.Count > 0) //返回默认船公司的配置 + return list[0].ReleaseType; + + //租户端无匹配的设置,需要从管理端获取全局参数 + var list2 = await Db.Queryable().Where(x => x.TenantId == null && x.LoadingPort == order1.LoadPortCode) + .Select(x => new { x.Carrier, x.ReleaseType }).ToListAsync(); + var adminItem = list2.Find(x => x.Carrier == order1.CarrierCode); + if (adminItem != null) + return adminItem.ReleaseType; + + if (list2.Count > 0) + return list[0].ReleaseType; + + break; + + case BusinessType.OceanShippingImport: + break; + } + + return releaseType; + } + /// /// 详情 /// @@ -61,9 +127,10 @@ namespace DS.WMS.Core.Sys.Method { rows = await Db.Updateable(entity).UpdateColumns(x => new { + x.CustomerId, x.Carrier, x.LoadingPort, - x.ReleaseType, + x.ReleaseType }).ExecuteCommandAsync(); } diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/ReleaseTypeController.cs b/ds-wms-service/DS.WMS.MainApi/Controllers/ReleaseTypeController.cs index a9b92111..06456293 100644 --- a/ds-wms-service/DS.WMS.MainApi/Controllers/ReleaseTypeController.cs +++ b/ds-wms-service/DS.WMS.MainApi/Controllers/ReleaseTypeController.cs @@ -59,6 +59,9 @@ namespace DS.WMS.MainApi.Controllers if (entity == null) return DataResult.FailedWithDesc(nameof(MultiLanguageConst.IllegalRequest)); + if (entity.CustomerId == null) + return DataResult.FailedWithDesc(nameof(MultiLanguageConst.IllegalRequest) + " " + nameof(entity.CustomerId)); + entity.TenantId = long.Parse(user.TenantId); entity.TenantName = user.TenantName; From f92da75d5b38110bc19b5a201fec2053cf59e049 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 16 Aug 2024 14:27:16 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=96=B0=E5=A2=9EBC=E7=9A=84=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E6=96=B9=E6=B3=95=20=E6=96=B0=E5=A2=9E=E5=8F=98?= =?UTF-8?q?=E6=9B=B4BC=E6=96=87=E4=BB=B6=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Op/Dtos/BookingSlot/ParserBCInfoDto.cs | 30 --- .../TaskPlat/Dtos/BC/BCReadResultDto.cs | 69 +++++++ .../Interface/ITaskManageBCService.cs | 16 ++ .../TaskPlat/Method/TaskManageBCService.cs | 180 ++++++++++++++++++ .../Controllers/TaskManageBCController.cs | 28 +++ .../DS.WMS.TaskApi/appsettings.json | 5 +- 6 files changed, 297 insertions(+), 31 deletions(-) create mode 100644 ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/BC/BCReadResultDto.cs diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/ParserBCInfoDto.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/ParserBCInfoDto.cs index 2568640a..0d14e657 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/ParserBCInfoDto.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/ParserBCInfoDto.cs @@ -490,35 +490,5 @@ namespace DS.WMS.Core.Op.Dtos /// 还箱场站 /// public string ReturnCTNYard { get; set; } - - /// - /// 温度单位 - /// - public string TempUnit{ get; set; } - - /// - /// 设置温度 - /// - public string TempSet { get; set; } - - /// - /// 最低温度 - /// - public string TempMin { get; set; } - - /// - /// 最高温度 - /// - public string TempMax { get; set; } - - /// - /// 湿度 - /// - public string Humidity { get; set; } - - /// - /// 冷藏通风量 - /// - public string Reeferf { get; set; } } } diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/BC/BCReadResultDto.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/BC/BCReadResultDto.cs new file mode 100644 index 00000000..dcaedaa5 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Dtos/BC/BCReadResultDto.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.TaskPlat +{ + /// + /// + /// + public class BCReadResultDto + { + /// + /// 是否成功 true=成功 false=失败 + /// + public bool succ { get; set; } = false; + + /// + /// 状态 0-成功 + /// + public int status { get; set; } = 0; + + /// + /// 返回消息 + /// + public string msg { get; set; } + + /// + /// 总记录数 + /// + public int total { get; set; } + + /// + /// 当前页列表数据 + /// + public object rows { get; set; } + + /// + /// 合计信息 + /// + public object summary { get; set; } + + /// + /// 扩展信息 + /// + public object extra { get; set; } + + /// + /// 扩展信息2 + /// + public object extra2 { get; set; } + + /// + /// 扩展信息场站统计 + /// + public object yardStatInfo { get; set; } + + /// + /// 是否异常 + /// + public bool exceptionflag { get; set; } + + /// + /// 生成HTML + /// + public string ResultHtml { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageBCService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageBCService.cs index 26282cab..42610deb 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageBCService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageBCService.cs @@ -48,5 +48,21 @@ namespace DS.WMS.Core.TaskPlat.Interface /// 对比BC与海运出口订单 /// Task)>> CompareBcWithSeaExportTask(TaskFlowDataContext dataContext); + + /// + /// 读取BC详情 + /// + /// 船公司代码 + /// BC文件 + /// 返回解析详情 + Task> GetReadBC(string carrierCode, IFormFile file); + + /// + /// 读取BC擦写后文件流 + /// + /// 船公司代码 + /// BC文件 + /// 返回解析详情 + Task> GetModifyBCFile(string carrierCode, IFormFile file); } } diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs index 42015045..dbf4a411 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs @@ -25,11 +25,22 @@ using DS.WMS.Core.TaskPlat.Interface; using HtmlAgilityPack; using Mapster; using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Newtonsoft.Json; using NLog; using SqlSugar; +using System.Collections.Specialized; +using System.IO; +using System.Text; +using System.Web; +using System.Net.Http.Headers; +using DS.WMS.Core.Invoice.Dtos; +using NPOI.SS.Formula.Functions; +using LanguageExt.Common; +using Microsoft.AspNet.SignalR.Hosting; +using Masuit.Tools; namespace DS.WMS.Core.TaskPlat.Method { @@ -49,6 +60,11 @@ namespace DS.WMS.Core.TaskPlat.Method private readonly IWebHostEnvironment _environment; private readonly ISqlSugarClient db; + private readonly string bcCompareUrl; + private readonly string bcMSKReadUrl; + private readonly string bcMSKModifyFileUrl; + private readonly string bcCMAReadUrl; + // 按需构建 private Lazy bookingSlotService; private Lazy seaExportService; @@ -64,6 +80,7 @@ namespace DS.WMS.Core.TaskPlat.Method //自动转发是否默认抄送操作 const string CONST_AUTO_TRANS_EMAIL_OP_CCTO = "AUTO_TRANS_EMAIL_OP_CCTO"; + public TaskManageBCService(IUser user, ILogger logger, @@ -96,6 +113,11 @@ namespace DS.WMS.Core.TaskPlat.Method tenantDb = saasDbService.GetBizDbScopeById(user.TenantId); tenantDb.QueryFilter.Clear(); + + bcCompareUrl = AppSetting.app(new string[] { "BCCompare", "Url" }); + bcMSKReadUrl = AppSetting.app(new string[] { "BCCompare", "MSKBCReadUrl" }); + bcMSKModifyFileUrl = AppSetting.app(new string[] { "BCCompare", "MSKBCModifyFileUrl" }); + bcCMAReadUrl = AppSetting.app(new string[] { "BCCompare", "CMABCReadUrl" }); } /// @@ -2231,5 +2253,163 @@ namespace DS.WMS.Core.TaskPlat.Method return await SyncBookingSlotChange(taskBaseId.Value); } + + #region 读取BC详情 + /// + /// 读取BC详情 + /// + /// 船公司代码 + /// BC文件 + /// 返回解析详情 + public async Task> GetReadBC(string carrierCode, IFormFile file) + { + + DateTime nowDate = DateTime.Now; + string msg = string.Empty; + + var messageInfo = new + { + Head = new + { + GID = SnowFlakeSingle.Instance.NextId().ToString(), + MessageType = "BOOKING_GAMENDMENT", + SenderId = AppSetting.app(new string[] { "ExcuteRuleService", "RulesEngineSender" }), + SenderName = AppSetting.app(new string[] { "ExcuteRuleService", "RulesEngineSenderName" }), + ReceiverId = "RulesEngine", + ReceiverName = "大简云规则引擎", + Version = "1.0", + RequestDate = nowDate.ToString("yyyy-MM-dd HH:mm:ss"), + RequestAction = "ReadFile", + }, + Main = new + { + TenantId = user.TenantId.ToString() + } + }; + + using (var httpClient = new HttpClient()) + { + try + { + using (var reduceAttach = new MultipartFormDataContent()) + { + var dataContent = new ByteArrayContent(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(messageInfo))); + + dataContent.Headers.ContentDisposition = new ContentDispositionHeaderValue($"form-data") + { + Name = "jsonData" + }; + + reduceAttach.Add(dataContent); + + #region 文件参数 + if (file != null) + { + var Content = new ByteArrayContent(file.ToByteArray()); + + Content.Headers.Add("Content-Type", "application/json"); + + reduceAttach.Add(Content, "file", HttpUtility.UrlEncode(file.FileName)); + } + #endregion + + var url = string.Empty; + + if (carrierCode.Equals("MSK", StringComparison.OrdinalIgnoreCase)) + url = bcMSKReadUrl; + + if (carrierCode.Equals("CMA", StringComparison.OrdinalIgnoreCase)) + url = bcCMAReadUrl; + //请求 + var response = httpClient.PostAsync(url, reduceAttach).Result; + string result = response.Content.ReadAsStringAsync().Result; + + var model = JsonConvert.DeserializeObject(result); + + if(model != null && model.succ) + { + var bcInfo = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(model.extra)); + + return DataResult.Success(bcInfo); + } + else + { + msg = model.msg; + } + } + } + catch (Exception ex) + { + Logger.Log(NLog.LogLevel.Info, "请求BC读取详情异常,原因:{error}", ex.Message); + + msg = $"请求BC读取详情异常,原因:{ex.Message}"; + + } + + + return DataResult.Failed(msg); + } + } + #endregion + + #region 读取BC擦写后文件流 + /// + /// 读取BC擦写后文件流 + /// + /// 船公司代码 + /// BC文件 + /// 返回解析详情 + public async Task> GetModifyBCFile(string carrierCode, IFormFile file) + { + byte[] bytes; + + var result = string.Empty; + + using (var httpClient = new HttpClient()) + { + try + { + using (var reduceAttach = new MultipartFormDataContent()) + { + var dataContent = new ByteArrayContent(Encoding.UTF8.GetBytes("")); + + dataContent.Headers.ContentDisposition = new ContentDispositionHeaderValue($"form-data") + { + Name = "jsonData" + }; + + reduceAttach.Add(dataContent); + + #region 文件参数 + if (file != null) + { + var Content = new ByteArrayContent(file.ToByteArray()); + + Content.Headers.Add("Content-Type", "application/json"); + + reduceAttach.Add(Content, "file", HttpUtility.UrlEncode(file.FileName)); + } + #endregion + + //请求 + var response = httpClient.PostAsync(bcMSKModifyFileUrl, reduceAttach).Result; + bytes = response.Content.ReadAsByteArrayAsync().GetAwaiter().GetResult(); + + return DataResult.Success(bytes); + } + } + catch (Exception ex) + { + Logger.Log(NLog.LogLevel.Info, "请求自动变更文件内容异常,原因:{error}", ex.Message); + + result = $"请求自动变更文件内容异常,原因:{ex.Message}"; + + } + + } + + return DataResult.Failed(result); + } + #endregion } } diff --git a/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManageBCController.cs b/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManageBCController.cs index 01c99e63..8a3159ce 100644 --- a/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManageBCController.cs +++ b/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManageBCController.cs @@ -68,5 +68,33 @@ namespace DS.WMS.TaskApi.Controllers return await _taskManageBCService.SyncBookingSlotChange(taskPKId); } #endregion + + #region 读取BC详情 + /// + /// 读取BC详情 + /// + /// 船公司代码 + /// BC文件 + /// 返回解析详情 + [HttpPost("GetReadBC")] + public async Task> GetReadBC(string carrierCode, IFormFile file) + { + return await _taskManageBCService.GetReadBC(carrierCode, file); + } + #endregion + + #region 读取BC擦写后文件流 + /// + /// 读取BC擦写后文件流 + /// + /// 船公司代码 + /// BC文件 + /// 返回解析详情 + [HttpPost("GetModifyBCFile")] + public async Task> GetModifyBCFile(string carrierCode, IFormFile file) + { + return await _taskManageBCService.GetModifyBCFile(carrierCode, file); + } + #endregion } } diff --git a/ds-wms-service/DS.WMS.TaskApi/appsettings.json b/ds-wms-service/DS.WMS.TaskApi/appsettings.json index e0abbc7a..48c463f4 100644 --- a/ds-wms-service/DS.WMS.TaskApi/appsettings.json +++ b/ds-wms-service/DS.WMS.TaskApi/appsettings.json @@ -66,7 +66,10 @@ "FileType": [ ".xls", ".xlsx", ".pdf", ".txt", ".pms" ] }, "BCCompare": { - "Url": "http://localhost:5110/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentCompare" + "Url": "http://localhost:5110/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentCompare", + "MSKBCReadUrl": "http://47.104.73.97:7115/api/TaskBCParser/ExcuteBCFileRead", + "MSKBCModifyFileUrl": "http://47.104.73.97:7115/api/TaskBCParser/ModifyBCFile", + "CMABCReadUrl": "http://47.104.73.97:7115/api/TaskBCCMAParser/ExcuteBCFileRead" }, "ShippingOrderCompare": { "Url": "http://47.104.73.97:7115/api/TaskShippingOrderCompare/ExcuteShippingOrderCompare", From c3e0db53d00716667ffd7d17ecd0d967da2f3674 Mon Sep 17 00:00:00 2001 From: cjy Date: Fri, 16 Aug 2024 14:33:22 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E3=80=81=E6=B5=B7=E8=BF=90=E5=87=BA=E5=8F=A3=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=88=AA=E7=BA=BF=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.WMS.Core/Op/Dtos/SeaExportReq.cs | 10 + .../DS.WMS.Core/Op/Dtos/SeaExportRes.cs | 11 + .../DS.WMS.Core/Op/Entity/SeaExport.cs | 14 + .../DS.WMS.Core/Sys/Dtos/UserReq.cs | 5 +- .../DS.WMS.Core/Sys/Dtos/UserViewModel.cs | 5 + .../DS.WMS.Core/Sys/Entity/SysUser.cs | 6 +- .../Sys/Interface/IClientCommonService.cs | 6 +- .../Sys/Method/ClientCommonService.cs | 16 +- .../Controllers/ClientCommonController.cs | 475 +++++++++--------- 9 files changed, 313 insertions(+), 235 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs index b76d5626..b49b8349 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs @@ -1220,6 +1220,16 @@ public class SeaExportReq /// Desc:业务来源明细名称 /// public string SourceDetailName { get; set; } + + /// + /// 航线人员Id + /// + public long? LanerId { get; set; } + + /// + /// 航线人员名称 + /// + public string Laner { get; set; } } /// diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs index 027398dd..d02ea83e 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs @@ -1417,4 +1417,15 @@ public class SeaExportRes /// Desc:运踪状态 虚值 /// public string BookStatus { get; set; } + + + /// + /// 航线人员Id + /// + public long? LanerId { get; set; } + + /// + /// 航线人员名称 + /// + public string Laner { get; set; } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExport.cs b/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExport.cs index f8031801..42f44bff 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExport.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExport.cs @@ -1599,4 +1599,18 @@ public class SeaExport : BaseOrgModel /// [SugarColumn(ColumnDescription = "业务来源明细名称", Length = 100, IsNullable = true)] public string SourceDetailName { get; set; } + + + + /// + /// 航线人员Id + /// + [SugarColumn(ColumnDescription = "航线人员Id", IsNullable = true)] + public long? LanerId { get; set; } + + /// + /// 航线人员名称 + /// + [SugarColumn(ColumnDescription = "航线人员名称", IsNullable = true, Length = 100)] + public string Laner { get; set; } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserReq.cs b/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserReq.cs index ed8920a3..7c37552c 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserReq.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserReq.cs @@ -164,7 +164,10 @@ public class UserReq /// 用戶航线 /// public long?[] LaneIds { get; set; } - + /// + /// 是否航线操作人员 + /// + public bool IsLaner { get; set; } = false; /// /// 业务来源Id /// diff --git a/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserViewModel.cs b/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserViewModel.cs index 408bb4da..2fa03142 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserViewModel.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserViewModel.cs @@ -199,4 +199,9 @@ public class UserViewModel /// 邮件签名 /// public string SignatureHtml { get; set; } = ""; + + /// + /// 是否航线操作人员 + /// + public bool IsLaner { get; set; } = false; } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Sys/Entity/SysUser.cs b/ds-wms-service/DS.WMS.Core/Sys/Entity/SysUser.cs index 109542e8..f4ced2ae 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Entity/SysUser.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Entity/SysUser.cs @@ -206,7 +206,11 @@ public class SysUser : UserTenantModel /// [Description("是否派车调度人员")] public bool IsDispatcher { get; set; } = false; - + /// + /// 是否航线操作人员 + /// + [Description("是否航线操作人员")] + public bool IsLaner { get; set; } = false; /// /// 签名图片 /// diff --git a/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs index a0e5c699..8ccf3414 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs @@ -14,7 +14,11 @@ namespace DS.WMS.Core.Sys.Interface; /// public interface IClientCommonService { - + /// + /// 获取航线操作员列表 + /// + /// + public Task>> GetLaneUserList(string queryKey = ""); /// /// 获取委托单位下拉列表 /// diff --git a/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs index 9509fa61..5d59f155 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs @@ -47,7 +47,21 @@ public class ClientCommonService : IClientCommonService user = _serviceProvider.GetRequiredService(); saasService = _serviceProvider.GetRequiredService(); } - + /// + /// 获取航线操作员列表 + /// + /// + public async Task>> GetLaneUserList(string queryKey = "") + { + var data = await db.Queryable() + .Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsLaner == true) + .WhereIF(!string.IsNullOrEmpty(queryKey), a => a.UserCode.Contains(queryKey) || a.UserName.Contains(queryKey)) + .Select() + .Take(20) + .WithCache($"{SqlSugarCacheConst.User}{user.TenantId}") + .ToListAsync(); + return await Task.FromResult(DataResult>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess)); + } /// /// 获取委托单位下拉列表 /// diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/ClientCommonController.cs b/ds-wms-service/DS.WMS.MainApi/Controllers/ClientCommonController.cs index 3ced5769..f4369528 100644 --- a/ds-wms-service/DS.WMS.MainApi/Controllers/ClientCommonController.cs +++ b/ds-wms-service/DS.WMS.MainApi/Controllers/ClientCommonController.cs @@ -28,6 +28,19 @@ public class ClientCommonController : ApiController { _invokeService = invokeService; } + + /// + /// 获取航线操作员列表-客户端 + /// + /// 用户代码或中文名称 + /// + [HttpGet] + [Route("GetLaneUserList")] + public async Task>> GetLaneUserList([FromQuery] string queryKey) + { + var res = await _invokeService.GetLaneUserList(queryKey); + return res; + } /// /// 获取委托单位下拉列表-客户端 /// @@ -236,237 +249,237 @@ public class ClientCommonController : ApiController var res = await _invokeService.GetClientListByCode(code, queryKey); return res; } - ///// - ///// 获取所有往来单位下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetAllClientList")] - //public DataResult> GetAllClientList() - //{ - // var res = _invokeService.GetAllClientList(); - // return res; - //} - ///// - ///// 获取船公司下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetCarrierClientList")] - //public DataResult> GetCarrierClientList() - //{ - // var res = _invokeService.GetCarrierClientList(); - // return res; - //} - ///// - ///// 获取场站下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetYardClientList")] - //public DataResult> GetYardClientList() - //{ - // var res = _invokeService.GetYardClientList(); - // return res; - //} - ///// - ///// 获取订舱公司下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetBookingClientList")] - //public DataResult> GetBookingClientList() - //{ - // var res = _invokeService.GetBookingClientList(); - // return res; - //} - ///// - ///// 获取车队下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetTruckClientList")] - //public DataResult> GetTruckClientList() - //{ - // var res = _invokeService.GetTruckClientList(); - // return res; - //} - ///// - ///// 获取委托单位下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetControllerClientList")] - //public DataResult> GetControllerClientList() - //{ - // var res = _invokeService.GetControllerClientList(); - // return res; - //} - ///// - ///// 获取报关行下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetCustomClientList")] - //public DataResult> GetCustomClientList() - //{ - // var res = _invokeService.GetCustomClientList(); - // return res; - //} - ///// - ///// 获取代理(国外)下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetAgentClientList")] - //public DataResult> GetAgentClientList() - //{ - // var res = _invokeService.GetAgentClientList(); - // return res; - //} - ///// - ///// 获取代理(国内)下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetAgentCnClientList")] - //public DataResult> GetAgentCnClientList() - //{ - // var res = _invokeService.GetAgentCnClientList(); - // return res; - //} - ///// - ///// 获取快递公司下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetExpressClientList")] - //public DataResult> GetExpressClientList() - //{ - // var res = _invokeService.GetExpressClientList(); - // return res; - //} - ///// - ///// 获取航空公司下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetAirLinesClientList")] - //public DataResult> GetAirLinesClientList() - //{ - // var res = _invokeService.GetAirLinesClientList(); - // return res; - //} - ///// - ///// 获取发货人下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetShipperClientList")] - //public DataResult> GetShipperClientList() - //{ - // var res = _invokeService.GetShipperClientList(); - // return res; - //} - ///// - ///// 获取收货人下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetConsigneeClientList")] - //public DataResult> GetConsigneeClientList() - //{ - // var res = _invokeService.GetConsigneeClientList(); - // return res; - //} - ///// - ///// 获取通知人下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetNotifyPartyClientList")] - //public DataResult> GetNotifyPartyClientList() - //{ - // var res = _invokeService.GetNotifyPartyClientList(); - // return res; - //} - ///// - ///// 获取仓库下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetWareHouseClientList")] - //public DataResult> GetWareHouseClientList() - //{ - // var res = _invokeService.GetWareHouseClientList(); - // return res; - //} - ///// - ///// 获取保险公司下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetInsurerClientList")] - //public DataResult> GetInsurerClientList() - //{ - // var res = _invokeService.GetInsurerClientList(); - // return res; - //} - ///// - ///// 获取租箱公司下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetLeasingClientList")] - //public DataResult> GetLeasingClientList() - //{ - // var res = _invokeService.GetLeasingClientList(); - // return res; - //} - ///// - ///// 获取贸易代理下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetTradingAgencyClientList")] - //public DataResult> GetTradingAgencyClientList() - //{ - // var res = _invokeService.GetTradingAgencyClientList(); - // return res; - //} - ///// - ///// 获取船代下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetShipAgencyClientList")] - //public DataResult> GetShipAgencyClientList() - //{ - // var res = _invokeService.GetShipAgencyClientList(); - // return res; - //} - ///// - ///// 获取经营单位下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetEnterpriseClientList")] - //public DataResult> GetEnterpriseClientList() - //{ - // var res = _invokeService.GetEnterpriseClientList(); - // return res; - //} - ///// - ///// 获取码头下拉列表 - ///// - ///// - //[HttpGet] - //[Route("GetWharfClientList")] - //public DataResult> GetWharfClientList() - //{ - // var res = _invokeService.GetWharfClientList(); - // return res; - //} + /// + /// 获取所有往来单位下拉列表 + /// + /// + [HttpGet] + [Route("GetAllClientList")] + public DataResult> GetAllClientList() + { + var res = _invokeService.GetAllClientList(); + return res; + } + /// + /// 获取船公司下拉列表 + /// + /// + [HttpGet] + [Route("GetCarrierClientList")] + public DataResult> GetCarrierClientList() + { + var res = _invokeService.GetCarrierClientList(); + return res; + } + /// + /// 获取场站下拉列表 + /// + /// + [HttpGet] + [Route("GetYardClientList")] + public DataResult> GetYardClientList() + { + var res = _invokeService.GetYardClientList(); + return res; + } + /// + /// 获取订舱公司下拉列表 + /// + /// + [HttpGet] + [Route("GetBookingClientList")] + public DataResult> GetBookingClientList() + { + var res = _invokeService.GetBookingClientList(); + return res; + } + /// + /// 获取车队下拉列表 + /// + /// + [HttpGet] + [Route("GetTruckClientList")] + public DataResult> GetTruckClientList() + { + var res = _invokeService.GetTruckClientList(); + return res; + } + /// + /// 获取委托单位下拉列表 + /// + /// + [HttpGet] + [Route("GetControllerClientList")] + public DataResult> GetControllerClientList() + { + var res = _invokeService.GetControllerClientList(); + return res; + } + /// + /// 获取报关行下拉列表 + /// + /// + [HttpGet] + [Route("GetCustomClientList")] + public DataResult> GetCustomClientList() + { + var res = _invokeService.GetCustomClientList(); + return res; + } + /// + /// 获取代理(国外)下拉列表 + /// + /// + [HttpGet] + [Route("GetAgentClientList")] + public DataResult> GetAgentClientList() + { + var res = _invokeService.GetAgentClientList(); + return res; + } + /// + /// 获取代理(国内)下拉列表 + /// + /// + [HttpGet] + [Route("GetAgentCnClientList")] + public DataResult> GetAgentCnClientList() + { + var res = _invokeService.GetAgentCnClientList(); + return res; + } + /// + /// 获取快递公司下拉列表 + /// + /// + [HttpGet] + [Route("GetExpressClientList")] + public DataResult> GetExpressClientList() + { + var res = _invokeService.GetExpressClientList(); + return res; + } + /// + /// 获取航空公司下拉列表 + /// + /// + [HttpGet] + [Route("GetAirLinesClientList")] + public DataResult> GetAirLinesClientList() + { + var res = _invokeService.GetAirLinesClientList(); + return res; + } + /// + /// 获取发货人下拉列表 + /// + /// + [HttpGet] + [Route("GetShipperClientList")] + public DataResult> GetShipperClientList() + { + var res = _invokeService.GetShipperClientList(); + return res; + } + /// + /// 获取收货人下拉列表 + /// + /// + [HttpGet] + [Route("GetConsigneeClientList")] + public DataResult> GetConsigneeClientList() + { + var res = _invokeService.GetConsigneeClientList(); + return res; + } + /// + /// 获取通知人下拉列表 + /// + /// + [HttpGet] + [Route("GetNotifyPartyClientList")] + public DataResult> GetNotifyPartyClientList() + { + var res = _invokeService.GetNotifyPartyClientList(); + return res; + } + /// + /// 获取仓库下拉列表 + /// + /// + [HttpGet] + [Route("GetWareHouseClientList")] + public DataResult> GetWareHouseClientList() + { + var res = _invokeService.GetWareHouseClientList(); + return res; + } + /// + /// 获取保险公司下拉列表 + /// + /// + [HttpGet] + [Route("GetInsurerClientList")] + public DataResult> GetInsurerClientList() + { + var res = _invokeService.GetInsurerClientList(); + return res; + } + /// + /// 获取租箱公司下拉列表 + /// + /// + [HttpGet] + [Route("GetLeasingClientList")] + public DataResult> GetLeasingClientList() + { + var res = _invokeService.GetLeasingClientList(); + return res; + } + /// + /// 获取贸易代理下拉列表 + /// + /// + [HttpGet] + [Route("GetTradingAgencyClientList")] + public DataResult> GetTradingAgencyClientList() + { + var res = _invokeService.GetTradingAgencyClientList(); + return res; + } + /// + /// 获取船代下拉列表 + /// + /// + [HttpGet] + [Route("GetShipAgencyClientList")] + public DataResult> GetShipAgencyClientList() + { + var res = _invokeService.GetShipAgencyClientList(); + return res; + } + /// + /// 获取经营单位下拉列表 + /// + /// + [HttpGet] + [Route("GetEnterpriseClientList")] + public DataResult> GetEnterpriseClientList() + { + var res = _invokeService.GetEnterpriseClientList(); + return res; + } + /// + /// 获取码头下拉列表 + /// + /// + [HttpGet] + [Route("GetWharfClientList")] + public DataResult> GetWharfClientList() + { + var res = _invokeService.GetWharfClientList(); + return res; + } /// /// 获取部门列表 /// From ada97388db947ca4c9affa18a656916d4f6b53fc Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 16 Aug 2024 14:37:51 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs index 19f87268..fa981b49 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs @@ -31,6 +31,10 @@ using Microsoft.Extensions.Logging; using Newtonsoft.Json; using NLog; using SqlSugar; +using System.Web; +using System.Net.Http.Headers; +using System.Text.RegularExpressions; +using System.Text; namespace DS.WMS.Core.TaskPlat.Method { From 0069a77364d836f3cb25a6e508c30b79129ac085 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 16 Aug 2024 14:40:03 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskPlat/Interface/ITaskManageBCService.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageBCService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageBCService.cs index 26282cab..42610deb 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageBCService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageBCService.cs @@ -48,5 +48,21 @@ namespace DS.WMS.Core.TaskPlat.Interface /// 对比BC与海运出口订单 /// Task)>> CompareBcWithSeaExportTask(TaskFlowDataContext dataContext); + + /// + /// 读取BC详情 + /// + /// 船公司代码 + /// BC文件 + /// 返回解析详情 + Task> GetReadBC(string carrierCode, IFormFile file); + + /// + /// 读取BC擦写后文件流 + /// + /// 船公司代码 + /// BC文件 + /// 返回解析详情 + Task> GetModifyBCFile(string carrierCode, IFormFile file); } } From 80080c9d8fe36aae0f2fb5697233c6468f47177f Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 16 Aug 2024 14:44:43 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Constants/TaskFlowDataNameConst.cs | 4 +-- .../TaskPlat/Method/TaskManageBCService.cs | 30 +++++++------------ 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/ds-wms-service/DS.Module.Core/Constants/TaskFlowDataNameConst.cs b/ds-wms-service/DS.Module.Core/Constants/TaskFlowDataNameConst.cs index b2a4e7c8..543faac8 100644 --- a/ds-wms-service/DS.Module.Core/Constants/TaskFlowDataNameConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/TaskFlowDataNameConst.cs @@ -40,8 +40,8 @@ namespace DS.Module.Core /// /// BC对比订单后是否存在差异 /// - /// 类型:CompareResultInfo - public const string BcCompareWithSeaExportResult = "BcCompareWithSeaExportResult"; + /// 类型: + public const string BcCompareBcWithSeaExportIsExistsDiff = "BcCompareBcWithSeaExportIsExistsDiff"; /// /// BC文件 diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs index fa981b49..9fae4037 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs @@ -1136,12 +1136,12 @@ namespace DS.WMS.Core.TaskPlat.Method /// /// 对比BC与海运出口订单(任务台使用) /// - public async Task> CompareBcWithSeaExportTask(TaskFlowDataContext dataContext) + public async Task)>> CompareBcWithSeaExportTask(TaskFlowDataContext dataContext) { var taskBcInfo = dataContext.Get(TaskFlowDataNameConst.TaskBCInfo) ?? throw new ArgumentException($"缺少参数:{nameof(TaskFlowDataNameConst.TaskBCInfo)}"); var taskBcCtnList = dataContext.Get?>(TaskFlowDataNameConst.TaskBCCtnList) ?? throw new ArgumentException($"缺少参数:{nameof(TaskFlowDataNameConst.TaskBCCtnList)}"); - var seaExport = await tenantDb.Queryable().Where(x => x.ParentId == 0 && taskBcInfo.MBL_NO == x.MBLNO).Select(x => new SeaExport() + var seaExport = await tenantDb.Queryable().Where(x => x.Id == taskBcInfo.BOOKING_ORDER_ID).Select(x => new SeaExport() { Id = x.Id, MBLNO = x.MBLNO, @@ -1174,19 +1174,18 @@ namespace DS.WMS.Core.TaskPlat.Method SeaExport = seaExport, OpCtnList = seaExportCtnList }; - var result = await CompareBcWithSeaExport(compareDto); + (bool isExistsDiff, List) result = await CompareBcWithSeaExport(compareDto); - dataContext.Set(TaskFlowDataNameConst.BcCompareWithSeaExportResult, result); + dataContext.Set(TaskFlowDataNameConst.BcCompareBcWithSeaExportIsExistsDiff, result.isExistsDiff); - return DataResult.Success(result); + return DataResult<(bool isExistsDiff, List)>.Success(result); } /// /// 对比BC与海运出口订单 /// - public async Task CompareBcWithSeaExport(CompareBcWithSeaExportDto compareDto) + public async Task<(bool isExistsDiff, List)> CompareBcWithSeaExport(CompareBcWithSeaExportDto compareDto) { - var taskBcInfo = compareDto.TaskBCInfo; var taskBcCtnList = compareDto.TaskBCCtnList; var seaExport = compareDto.SeaExport; @@ -1258,7 +1257,7 @@ namespace DS.WMS.Core.TaskPlat.Method logger.LogInformation($"批次={batchNo} taskBcInfo.id={taskBcInfo.Id} seaExport.id={seaExport.Id} 请求BC对比订单结果完成,耗时:{timeDiff}ms,是否成功:{(compareResult?.succ == true ? "成功" : "失败")} "); - if (compareResult != null && compareResult?.succ == true) + if (compareResult != null) { logger.LogInformation($"批次={batchNo} BC对比订单结果={JsonConvert.SerializeObject(compareResult)}"); DateTime nowDate = DateTime.Now; @@ -1304,22 +1303,13 @@ namespace DS.WMS.Core.TaskPlat.Method it.UpdateUserName }).ExecuteCommandAsync(); } - return new CompareResultInfo() - { - IsExistsDiff = compareResult.extra.IsExistsDiff, - ShowDetailList = compareResult.extra.ShowDetailList, - DetailList = compareResult.extra.DetailList, - IsSuccess = true - }; - //return (compareResult.extra.IsExistsDiff, compareResult.extra.ShowDetailList); + + return (compareResult.extra.IsExistsDiff, compareResult.extra.ShowDetailList); } else { logger.LogError($"批次={batchNo} BC对比订单结果为空"); - return new CompareResultInfo() - { - IsSuccess = false - }; + throw new Exception($"批次={batchNo} BC对比订单结果为空"); } } #region 生成并推送邮件 From 227c3ade1b15a5fd4a09de13cf2b851e7c054e9b Mon Sep 17 00:00:00 2001 From: cjy Date: Fri, 16 Aug 2024 14:46:09 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E4=BA=94=E5=AD=97?= =?UTF-8?q?=E7=A0=81=E8=8E=B7=E5=8F=96=E6=B8=AF=E5=8F=A3=E4=BF=A1=E6=81=AF?= =?UTF-8?q?-=E5=AE=A2=E6=88=B7=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.WMS.Core/Code/Dtos/CodePortInfoRes.cs | 77 +++++++++++++++++++ .../Sys/Interface/IClientCommonService.cs | 5 ++ .../Sys/Method/ClientCommonService.cs | 14 ++++ .../Controllers/ClientCommonController.cs | 13 +++- 4 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 ds-wms-service/DS.WMS.Core/Code/Dtos/CodePortInfoRes.cs diff --git a/ds-wms-service/DS.WMS.Core/Code/Dtos/CodePortInfoRes.cs b/ds-wms-service/DS.WMS.Core/Code/Dtos/CodePortInfoRes.cs new file mode 100644 index 00000000..f1a5d421 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Code/Dtos/CodePortInfoRes.cs @@ -0,0 +1,77 @@ +using DS.Module.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Code.Dtos +{ + /// + /// 港口信息 + /// + public class CodePortInfoRes + { + /// + /// 主键Id + /// + public long Id { get; set; } + /// + /// 港口英文名称 + /// + public string PortName { get; set; } = ""; + /// + /// 港口中文名称 + /// + public string CnName { get; set; } = ""; + /// + /// 国家名称 + /// + public string CountryName { get; set; } = ""; + /// + /// 所在大洲 + /// + public string Chau { get; set; } = ""; + /// + /// 说明 + /// + public string Explain { get; set; } = ""; + /// + /// 港口类型 + /// + public string PortType { get; set; } = ""; + + /// + /// 国家Id + /// + public long CountryId { get; set; } = 0; + /// + /// 航线Id + /// + public long LaneId { get; set; } = 0; + /// + /// 航线代码 + /// + public string LaneCode { get; set; } + /// + /// 航线 + /// + public string Lane { get; set; } + /// + /// EDI代码 + /// + public string EdiCode { get; set; } = ""; + /// + /// 状态 0 启用 1 禁用 + /// + public StatusEnum? Status { get; set; } = StatusEnum.Enable; + /// + /// 备注 + /// + public string Note { get; set; } = ""; + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs index 8ccf3414..66cd0d7f 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs @@ -14,6 +14,11 @@ namespace DS.WMS.Core.Sys.Interface; /// public interface IClientCommonService { + /// + /// 根据五字码获取港口信息-客户端 + /// + /// + public Task> GetClientPortSelectList(string queryKey = ""); /// /// 获取航线操作员列表 /// diff --git a/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs index 5d59f155..f7442eb3 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs @@ -47,6 +47,20 @@ public class ClientCommonService : IClientCommonService user = _serviceProvider.GetRequiredService(); saasService = _serviceProvider.GetRequiredService(); } + + /// + /// 根据五字码获取港口信息-客户端 + /// + /// + public async Task> GetClientPortSelectList(string queryKey = "") + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var data = await tenantDb.Queryable() + .Where(x => x.Status == StatusEnum.Enable && x.EdiCode == queryKey.Trim()) + .Select() + .FirstAsync(); + return await Task.FromResult(DataResult.Success("获取数据成功!", data)); + } /// /// 获取航线操作员列表 /// diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/ClientCommonController.cs b/ds-wms-service/DS.WMS.MainApi/Controllers/ClientCommonController.cs index f4369528..7dcdba93 100644 --- a/ds-wms-service/DS.WMS.MainApi/Controllers/ClientCommonController.cs +++ b/ds-wms-service/DS.WMS.MainApi/Controllers/ClientCommonController.cs @@ -28,7 +28,18 @@ public class ClientCommonController : ApiController { _invokeService = invokeService; } - + /// + /// 根据五字码获取港口信息-客户端 + /// + /// 港口五字码 + /// + [HttpGet] + [Route("GetClientPortSelectList")] + public async Task> GetClientPortSelectList([FromQuery] string queryKey) + { + var res = await _invokeService.GetClientPortSelectList(queryKey); + return res; + } /// /// 获取航线操作员列表-客户端 ///