From 5f50087d220636c5fb0894b241041c1903f52747 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 17 Jul 2024 13:58:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A2=84=E8=AE=A2=E8=88=B1?= =?UTF-8?q?=E7=9A=84=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ISpaceBookingMSKAPIService.cs | 6 +++++ .../SpaceBooking/SpaceBookingMSKAPIService.cs | 25 +++++++++++++++++++ .../DS.WMS.Core/Sys/Method/ConfigService.cs | 5 +++- .../SpaceBookingMSKAPIController.cs | 11 ++++++++ .../DS.WMS.OpApi/Logs/internal-nlog.txt | 7 ++++++ 5 files changed, 53 insertions(+), 1 deletion(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Interface/SpaceBooking/ISpaceBookingMSKAPIService.cs b/ds-wms-service/DS.WMS.Core/Op/Interface/SpaceBooking/ISpaceBookingMSKAPIService.cs index 3369c19e..7e12e935 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Interface/SpaceBooking/ISpaceBookingMSKAPIService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Interface/SpaceBooking/ISpaceBookingMSKAPIService.cs @@ -112,5 +112,11 @@ namespace DS.WMS.Core.Op.Interface /// 返回详情 Task> GetInitInfo(); + + /// + /// 获取预订舱途径选择 + /// + /// 返回回执 + Task>> GetBookingChannelSelectShow(); } } diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs index 42af80c9..8c4dbc0a 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs @@ -30,6 +30,8 @@ using System.Text.Json.Nodes; using LanguageExt.Pipes; using DS.WMS.Core.Op.Interface; using DS.WMS.Core.Map.Method; +using Microsoft.Owin.Security.Provider; +using LanguageExt; namespace DS.WMS.Core.Op.Method { @@ -54,6 +56,7 @@ namespace DS.WMS.Core.Op.Method const string CONST_MSK_API_COMMODITY_URL = "MSKApiCommodity"; const string CONST_MSK_API_MAPPING_MODULE = "BOOK_MSK_API"; + const string CONST_MSK_API_CHANNEL_SHOW = "BOOKING_CHANNEL_SELECT_SHOW"; const long CONST_ADMIN_TENANTID = 1288018625843826688; @@ -2166,5 +2169,27 @@ namespace DS.WMS.Core.Op.Method return data; } #endregion + + #region 获取预订舱途径选择 + /// + /// 获取预订舱途径选择 + /// + /// 返回回执 + public async Task>> GetBookingChannelSelectShow() + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + + var rlt = await configService.GetConfig(CONST_MSK_API_CHANNEL_SHOW, long.Parse(user.TenantId), false); + + if (rlt.Succeeded) + { + var list = rlt.Data.Value.Split(new char[] { ',' }).ToList(); + + return DataResult>.Success(list); + } + + return DataResult>.FailedData(new List()); + } + #endregion } } diff --git a/ds-wms-service/DS.WMS.Core/Sys/Method/ConfigService.cs b/ds-wms-service/DS.WMS.Core/Sys/Method/ConfigService.cs index 9aba9c27..5f264bab 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Method/ConfigService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Method/ConfigService.cs @@ -106,7 +106,10 @@ public class ConfigService : IConfigService var data = await db.Queryable().Filter(null, true) .Where(x => x.Code == code && x.TenantId == tenantId).Select().FirstAsync(); - return DataResult.Success(data); + if(data != null) + DataResult.Success(data); + + return DataResult.FailedData(data); } #endregion } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.OpApi/Controllers/SpaceBookingMSKAPIController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/SpaceBookingMSKAPIController.cs index 156f7e92..4e68b41c 100644 --- a/ds-wms-service/DS.WMS.OpApi/Controllers/SpaceBookingMSKAPIController.cs +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/SpaceBookingMSKAPIController.cs @@ -214,6 +214,17 @@ namespace DS.WMS.OpApi.Controllers return await _spaceBookingMSKAPIService.GetInitInfo(); } #endregion + + /// + /// 获取预订舱途径选择 + /// + /// 返回结果 + [HttpGet] + [Route("ChannelSelectShow")] + public async Task>> GetBookingChannelSelectShow() + { + return await _spaceBookingMSKAPIService.GetBookingChannelSelectShow(); + } } } diff --git a/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt b/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt index a47325e5..e6e74efb 100644 --- a/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt +++ b/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt @@ -341,3 +341,10 @@ 2024-07-17 13:35:24.6552 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config 2024-07-17 13:35:24.6552 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile 2024-07-17 13:35:24.6678 Info Configuration initialized. +2024-07-17 13:36:20.7200 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-17 13:36:20.7312 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-17 13:36:20.7312 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-17 13:36:20.7429 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-17 13:36:20.7429 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-17 13:36:20.7429 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-17 13:36:20.7553 Info Configuration initialized.