From a0efae3abc1c79faec5b8383709f54114b3381da Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 23 Jul 2024 11:43:10 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=B1=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Constants/MultiLanguageConst.cs | 14 ++ .../BookingSlot/BookingSlotBaseSaveOutput.cs | 59 +++++ .../BookingSlot/IBookingSlotService.cs | 10 +- .../Method/BookingSlot/BookingSlotService.cs | 206 +++++++++++------- .../DS.WMS.OpApi/Logs/internal-nlog.txt | 7 + .../PublishProfiles/FolderProfile.pubxml.user | 2 +- 6 files changed, 212 insertions(+), 86 deletions(-) diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs index ed02d193..2924c376 100644 --- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs @@ -1344,5 +1344,19 @@ public static class MultiLanguageConst /// [Description("预订舱数据已发送成功,不能修改")] public const string SpaceBookingBeSendNotModify = "SpaceBooking_BeSend_NotModify"; + + /// + /// 舱位变更比对结果不存在 + /// + [Description("舱位变更比对结果不存在")] + public const string SpaceBookingCompareResultNull = "SpaceBooking_CompareResultNull"; + + /// + /// 获取舱位变更比对结果错误,比对内容不存在 + /// + [Description("获取舱位变更比对结果错误,比对内容不存在")] + public const string SpaceBookingCompareResultJSONNull = "SpaceBooking_CompareResult_JSONNull"; + + #endregion } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/BookingSlotBaseSaveOutput.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/BookingSlotBaseSaveOutput.cs index b47afb0e..be64001d 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/BookingSlotBaseSaveOutput.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/BookingSlotBaseSaveOutput.cs @@ -34,6 +34,11 @@ namespace DS.WMS.Core.Op.Dtos /// public class BookingSlotBaseDto { + /// + /// Id + /// + public long Id { get; set; } + /// /// 舱位提单号 /// @@ -313,6 +318,60 @@ namespace DS.WMS.Core.Op.Dtos /// [Description("舱保类型名称")] public string LoadGuaranteeFlagName { get; set; } + + /// + /// 备注 + /// + public string Note { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 创建人 + /// + public long CreateBy { get; set; } + + /// + /// 创建人名称 + /// + public string CreateUserName { get; set; } + + /// + /// 修改人 + /// + public long UpdateBy { get; set; } + + /// + /// 修改人名称 + /// + public string UpdateUserName { get; set; } + + /// + /// 更新时间 + /// + public DateTime UpdateTime { get; set; } + + /// + /// 删除 + /// + public bool Deleted { get; set; } = false; + /// + /// 删除人名称 + /// + public string DeleteUserName { get; set; } + + /// + /// 删除时间 + /// + public DateTime DeleteTime { get; set; } + + /// + /// 删除人 + /// + public long DeleteBy { get; set; } } /// diff --git a/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs b/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs index c62b246a..50146028 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs @@ -98,7 +98,7 @@ namespace DS.WMS.Core.Op.Interface /// /// /// - Task InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file = null, DynameFileInfo modifyFile = null); + Task> InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file = null, DynameFileInfo modifyFile = null); /// /// 获取舱位变更比对结果 @@ -106,7 +106,7 @@ namespace DS.WMS.Core.Op.Interface /// 舱位主键 /// 批次号 /// 返回舱位变更比对结果 - Task> GetSlotCompareResult(long id, string batchNo); + Task>> GetSlotCompareResult(long id, string batchNo); /// /// 导入舱位 @@ -120,7 +120,7 @@ namespace DS.WMS.Core.Op.Interface /// /// 生成订舱订单请求 /// 返回回执 - Task CreateBookingOrder(BookingGenerateDto model); + Task> CreateBookingOrder(BookingGenerateDto model); /// /// 检索舱位对应的订舱订单(BY 舱位主键) @@ -145,7 +145,7 @@ namespace DS.WMS.Core.Op.Interface /// BC详情 /// BC变更后详情 /// 返回回执 - Task ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto); + Task> ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto); /// /// 推送BC变更比对 @@ -179,7 +179,7 @@ namespace DS.WMS.Core.Op.Interface /// /// 舱位ID组 /// 返回舱位详情 - Task> GetSlotList(long[] ids); + Task>> GetSlotList(long[] ids); /// /// 获取合票详情(生成合票需要先调此方法) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs index c4796052..af61fd83 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs @@ -48,6 +48,7 @@ using DS.WMS.Core.Code.Method; using DS.WMS.Core.Map.Method; using DS.Module.Core.Extensions; using DS.Module.Core.Constants; +using Microsoft.Owin.Security.Provider; namespace DS.WMS.Core.Op.Method { @@ -1465,7 +1466,8 @@ namespace DS.WMS.Core.Op.Method Logger.Log(NLog.LogLevel.Info, $"批次={batchNo} slotId={slotId} 开始请求比对结果"); - var compareResult = await ExcuteCompare(bcSrcDto, bcTargetDto); + var rlt = await ExcuteCompare(bcSrcDto, bcTargetDto); + var compareResult = rlt.Data; Logger.Log(NLog.LogLevel.Info, $"批次={batchNo} slotId={slotId} 请求比对结果完成,结果={JsonConvert.SerializeObject(compareResult)}"); @@ -1536,71 +1538,6 @@ namespace DS.WMS.Core.Op.Method } #endregion - #region 请求BC比对 - /// - /// 请求BC比对 - /// - /// BC详情 - /// BC变更后详情 - /// 返回回执 - [NonAction] - public async Task ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto) - { - TaskManageExcuteResultDto model = null; - /* - 1、读取配置文件中的规则引擎URL - 2、填充请求的类,并生成JSON报文 - 3、POST请求接口,并记录回执。 - 4、返回信息。 - */ - - var url = bcCompareUrl; //App.Configuration["BCCompareUrl"]; - - using (var httpClient = new HttpClient()) - { - try - { - using (var reduceAttach = new MultipartFormDataContent()) - { - var dataContent = new ByteArrayContent(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bcSrcDto))); - - dataContent.Headers.ContentDisposition = new ContentDispositionHeaderValue($"form-data") - { - Name = "srcJson" - }; - - reduceAttach.Add(dataContent); - - var dataContent2 = new ByteArrayContent(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bcTargetDto))); - - dataContent2.Headers.ContentDisposition = new ContentDispositionHeaderValue($"form-data") - { - Name = "destJson" - }; - - reduceAttach.Add(dataContent2); - - //请求 - var response = httpClient.PostAsync(url, reduceAttach).Result; - - var result = response.Content.ReadAsStringAsync().Result; - - model = JsonConvert.DeserializeObject(result); - - Logger.Log(NLog.LogLevel.Info, $"推送BC比返回结果:{JsonConvert.SerializeObject(model)}"); - } - } - catch (Exception ex) - { - Logger.Log(NLog.LogLevel.Error, "推送BC比对异常,原因:{error}", ex.Message); - - // throw Oops.Oh($"推送BC比对异常,原因:{ex.Message}"); - } - } - - return model; - } - #endregion #region 获取合票详情(生成合票需要先调此方法) /// @@ -2705,30 +2642,139 @@ namespace DS.WMS.Core.Op.Method return data; } - Task IBookingSlotService.InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file, DynameFileInfo modifyFile) + + #region 获取舱位变更比对结果 + /// + /// 获取舱位变更比对结果 + /// + /// 舱位主键 + /// 批次号 + /// 返回舱位变更比对结果 + public async Task>> GetSlotCompareResult(long id, string batchNo) { - throw new NotImplementedException(); - } + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); - Task> IBookingSlotService.GetSlotCompareResult(long id, string batchNo) - { - throw new NotImplementedException(); - } + var compareInfo = await tenantDb.Queryable() + .FirstAsync(t => t.SlotId == id && t.CompareBatchNo == batchNo); - Task IBookingSlotService.CreateBookingOrder(BookingGenerateDto model) - { - throw new NotImplementedException(); + if (compareInfo == null) + { + //舱位变更比对结果不存在 + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingCompareResultNull))); + } + + if (string.IsNullOrWhiteSpace(compareInfo.CompareRlt)) + { + //获取舱位变更比对结果错误,比对内容不存在 + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingCompareResultJSONNull))); + } + + if (!string.IsNullOrWhiteSpace(compareInfo.CompareRlt)) + { + var json = JsonConvert.DeserializeObject>(compareInfo.CompareRlt); + + if (json != null) + { + return DataResult>.Success(json); + } + + return DataResult>.FailedData(json); + } + + return DataResult>.FailedData(new List()); } + #endregion - Task IBookingSlotService.ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto) + #region 获取舱位详情列表 + /// + /// 获取舱位详情列表 + /// + /// 舱位ID组 + /// 返回舱位详情 + public async Task>> GetSlotList(long[] ids) { - throw new NotImplementedException(); + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + + var slotList = await tenantDb.Queryable().Where(u => ids.Contains(u.Id) && u.Deleted == false).ToListAsync(); + if (slotList.Count == 0) + { + //未查询到此舱位信息,可能已被删除,请重新查询后重试 + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotBaseInfoNull))); + } + + var data = slotList.Select(a => a.Adapt()).ToList(); + + if (data != null) + return DataResult>.Success(data); + + return DataResult>.FailedData(data); } + #endregion - Task> IBookingSlotService.GetSlotList(long[] ids) + #region 请求BC比对 + /// + /// 请求BC比对 + /// + /// BC详情 + /// BC变更后详情 + /// 返回回执 + public async Task> ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto) { - throw new NotImplementedException(); + TaskManageExcuteResultDto model = null; + /* + 1、读取配置文件中的规则引擎URL + 2、填充请求的类,并生成JSON报文 + 3、POST请求接口,并记录回执。 + 4、返回信息。 + */ + using (var httpClient = new HttpClient()) + { + try + { + using (var reduceAttach = new MultipartFormDataContent()) + { + var dataContent = new ByteArrayContent(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bcSrcDto))); + + dataContent.Headers.ContentDisposition = new ContentDispositionHeaderValue($"form-data") + { + Name = "srcJson" + }; + + reduceAttach.Add(dataContent); + + var dataContent2 = new ByteArrayContent(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bcTargetDto))); + + dataContent2.Headers.ContentDisposition = new ContentDispositionHeaderValue($"form-data") + { + Name = "destJson" + }; + + reduceAttach.Add(dataContent2); + + //请求 + var response = httpClient.PostAsync(bcCompareUrl, reduceAttach).Result; + + var result = response.Content.ReadAsStringAsync().Result; + + model = JsonConvert.DeserializeObject(result); + + Logger.Log(NLog.LogLevel.Info, $"推送BC比返回结果:{JsonConvert.SerializeObject(model)}"); + } + } + catch (Exception ex) + { + Logger.Log(NLog.LogLevel.Info, "推送BC比对异常,原因:{error}", ex.Message); + + // throw Oops.Oh($"推送BC比对异常,原因:{ex.Message}"); + } + } + + if (model != null) + return DataResult.Success(model); + + return DataResult.FailedData(model); } + #endregion } public static class LetterIndexUtil 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 8cfac7ae..c9012700 100644 --- a/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt +++ b/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt @@ -705,3 +705,10 @@ 2024-07-22 18:36:53.5029 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-22 18:36:53.5029 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile 2024-07-22 18:36:53.5029 Info Configuration initialized. +2024-07-23 11:25:15.5508 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-23 11:25:15.5655 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-23 11:25:15.5655 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-23 11:25:15.5804 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-23 11:25:15.5871 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-23 11:25:15.5871 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-23 11:25:15.5871 Info Configuration initialized. diff --git a/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user b/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user index f07afe67..4c69aa02 100644 --- a/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -6,7 +6,7 @@ <_PublishTargetUrl>D:\Code\PublishCopy\ds8-opapi - True|2024-07-22T08:42:12.1933090Z||;True|2024-07-19T18:28:29.1420269+08:00||;True|2024-07-19T15:45:49.1068004+08:00||;True|2024-07-19T15:33:45.3242155+08:00||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||; + True|2024-07-22T10:48:00.9436699Z||;True|2024-07-22T18:38:58.5618888+08:00||;True|2024-07-22T16:42:12.1933090+08:00||;True|2024-07-19T18:28:29.1420269+08:00||;True|2024-07-19T15:45:49.1068004+08:00||;True|2024-07-19T15:33:45.3242155+08:00||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||; \ No newline at end of file From d4d7957e7871f854709459ad72bdee5ccfaca3d5 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 23 Jul 2024 11:46:11 +0800 Subject: [PATCH 2/4] =?UTF-8?q?Revert=20"=E4=BF=AE=E6=94=B9=E8=88=B1?= =?UTF-8?q?=E4=BD=8D"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a0efae3abc1c79faec5b8383709f54114b3381da. --- .../Constants/MultiLanguageConst.cs | 14 -- .../BookingSlot/BookingSlotBaseSaveOutput.cs | 59 ----- .../BookingSlot/IBookingSlotService.cs | 10 +- .../Method/BookingSlot/BookingSlotService.cs | 206 +++++++----------- .../DS.WMS.OpApi/Logs/internal-nlog.txt | 7 - .../PublishProfiles/FolderProfile.pubxml.user | 2 +- 6 files changed, 86 insertions(+), 212 deletions(-) diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs index 2924c376..ed02d193 100644 --- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs @@ -1344,19 +1344,5 @@ public static class MultiLanguageConst /// [Description("预订舱数据已发送成功,不能修改")] public const string SpaceBookingBeSendNotModify = "SpaceBooking_BeSend_NotModify"; - - /// - /// 舱位变更比对结果不存在 - /// - [Description("舱位变更比对结果不存在")] - public const string SpaceBookingCompareResultNull = "SpaceBooking_CompareResultNull"; - - /// - /// 获取舱位变更比对结果错误,比对内容不存在 - /// - [Description("获取舱位变更比对结果错误,比对内容不存在")] - public const string SpaceBookingCompareResultJSONNull = "SpaceBooking_CompareResult_JSONNull"; - - #endregion } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/BookingSlotBaseSaveOutput.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/BookingSlotBaseSaveOutput.cs index be64001d..b47afb0e 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/BookingSlotBaseSaveOutput.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/BookingSlotBaseSaveOutput.cs @@ -34,11 +34,6 @@ namespace DS.WMS.Core.Op.Dtos /// public class BookingSlotBaseDto { - /// - /// Id - /// - public long Id { get; set; } - /// /// 舱位提单号 /// @@ -318,60 +313,6 @@ namespace DS.WMS.Core.Op.Dtos /// [Description("舱保类型名称")] public string LoadGuaranteeFlagName { get; set; } - - /// - /// 备注 - /// - public string Note { get; set; } - - /// - /// 创建时间 - /// - public DateTime CreateTime { get; set; } - - /// - /// 创建人 - /// - public long CreateBy { get; set; } - - /// - /// 创建人名称 - /// - public string CreateUserName { get; set; } - - /// - /// 修改人 - /// - public long UpdateBy { get; set; } - - /// - /// 修改人名称 - /// - public string UpdateUserName { get; set; } - - /// - /// 更新时间 - /// - public DateTime UpdateTime { get; set; } - - /// - /// 删除 - /// - public bool Deleted { get; set; } = false; - /// - /// 删除人名称 - /// - public string DeleteUserName { get; set; } - - /// - /// 删除时间 - /// - public DateTime DeleteTime { get; set; } - - /// - /// 删除人 - /// - public long DeleteBy { get; set; } } /// diff --git a/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs b/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs index 50146028..c62b246a 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs @@ -98,7 +98,7 @@ namespace DS.WMS.Core.Op.Interface /// /// /// - Task> InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file = null, DynameFileInfo modifyFile = null); + Task InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file = null, DynameFileInfo modifyFile = null); /// /// 获取舱位变更比对结果 @@ -106,7 +106,7 @@ namespace DS.WMS.Core.Op.Interface /// 舱位主键 /// 批次号 /// 返回舱位变更比对结果 - Task>> GetSlotCompareResult(long id, string batchNo); + Task> GetSlotCompareResult(long id, string batchNo); /// /// 导入舱位 @@ -120,7 +120,7 @@ namespace DS.WMS.Core.Op.Interface /// /// 生成订舱订单请求 /// 返回回执 - Task> CreateBookingOrder(BookingGenerateDto model); + Task CreateBookingOrder(BookingGenerateDto model); /// /// 检索舱位对应的订舱订单(BY 舱位主键) @@ -145,7 +145,7 @@ namespace DS.WMS.Core.Op.Interface /// BC详情 /// BC变更后详情 /// 返回回执 - Task> ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto); + Task ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto); /// /// 推送BC变更比对 @@ -179,7 +179,7 @@ namespace DS.WMS.Core.Op.Interface /// /// 舱位ID组 /// 返回舱位详情 - Task>> GetSlotList(long[] ids); + Task> GetSlotList(long[] ids); /// /// 获取合票详情(生成合票需要先调此方法) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs index af61fd83..c4796052 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs @@ -48,7 +48,6 @@ using DS.WMS.Core.Code.Method; using DS.WMS.Core.Map.Method; using DS.Module.Core.Extensions; using DS.Module.Core.Constants; -using Microsoft.Owin.Security.Provider; namespace DS.WMS.Core.Op.Method { @@ -1466,8 +1465,7 @@ namespace DS.WMS.Core.Op.Method Logger.Log(NLog.LogLevel.Info, $"批次={batchNo} slotId={slotId} 开始请求比对结果"); - var rlt = await ExcuteCompare(bcSrcDto, bcTargetDto); - var compareResult = rlt.Data; + var compareResult = await ExcuteCompare(bcSrcDto, bcTargetDto); Logger.Log(NLog.LogLevel.Info, $"批次={batchNo} slotId={slotId} 请求比对结果完成,结果={JsonConvert.SerializeObject(compareResult)}"); @@ -1538,6 +1536,71 @@ namespace DS.WMS.Core.Op.Method } #endregion + #region 请求BC比对 + /// + /// 请求BC比对 + /// + /// BC详情 + /// BC变更后详情 + /// 返回回执 + [NonAction] + public async Task ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto) + { + TaskManageExcuteResultDto model = null; + /* + 1、读取配置文件中的规则引擎URL + 2、填充请求的类,并生成JSON报文 + 3、POST请求接口,并记录回执。 + 4、返回信息。 + */ + + var url = bcCompareUrl; //App.Configuration["BCCompareUrl"]; + + using (var httpClient = new HttpClient()) + { + try + { + using (var reduceAttach = new MultipartFormDataContent()) + { + var dataContent = new ByteArrayContent(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bcSrcDto))); + + dataContent.Headers.ContentDisposition = new ContentDispositionHeaderValue($"form-data") + { + Name = "srcJson" + }; + + reduceAttach.Add(dataContent); + + var dataContent2 = new ByteArrayContent(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bcTargetDto))); + + dataContent2.Headers.ContentDisposition = new ContentDispositionHeaderValue($"form-data") + { + Name = "destJson" + }; + + reduceAttach.Add(dataContent2); + + //请求 + var response = httpClient.PostAsync(url, reduceAttach).Result; + + var result = response.Content.ReadAsStringAsync().Result; + + model = JsonConvert.DeserializeObject(result); + + Logger.Log(NLog.LogLevel.Info, $"推送BC比返回结果:{JsonConvert.SerializeObject(model)}"); + } + } + catch (Exception ex) + { + Logger.Log(NLog.LogLevel.Error, "推送BC比对异常,原因:{error}", ex.Message); + + // throw Oops.Oh($"推送BC比对异常,原因:{ex.Message}"); + } + } + + return model; + } + #endregion #region 获取合票详情(生成合票需要先调此方法) /// @@ -2642,139 +2705,30 @@ namespace DS.WMS.Core.Op.Method return data; } - - #region 获取舱位变更比对结果 - /// - /// 获取舱位变更比对结果 - /// - /// 舱位主键 - /// 批次号 - /// 返回舱位变更比对结果 - public async Task>> GetSlotCompareResult(long id, string batchNo) + Task IBookingSlotService.InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file, DynameFileInfo modifyFile) { - var tenantDb = saasService.GetBizDbScopeById(user.TenantId); - - var compareInfo = await tenantDb.Queryable() - .FirstAsync(t => t.SlotId == id && t.CompareBatchNo == batchNo); - - if (compareInfo == null) - { - //舱位变更比对结果不存在 - throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingCompareResultNull))); - } - - if (string.IsNullOrWhiteSpace(compareInfo.CompareRlt)) - { - //获取舱位变更比对结果错误,比对内容不存在 - throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingCompareResultJSONNull))); - } - - if (!string.IsNullOrWhiteSpace(compareInfo.CompareRlt)) - { - var json = JsonConvert.DeserializeObject>(compareInfo.CompareRlt); - - if (json != null) - { - return DataResult>.Success(json); - } - - return DataResult>.FailedData(json); - } - - return DataResult>.FailedData(new List()); + throw new NotImplementedException(); } - #endregion - #region 获取舱位详情列表 - /// - /// 获取舱位详情列表 - /// - /// 舱位ID组 - /// 返回舱位详情 - public async Task>> GetSlotList(long[] ids) + Task> IBookingSlotService.GetSlotCompareResult(long id, string batchNo) { - var tenantDb = saasService.GetBizDbScopeById(user.TenantId); - - var slotList = await tenantDb.Queryable().Where(u => ids.Contains(u.Id) && u.Deleted == false).ToListAsync(); - if (slotList.Count == 0) - { - //未查询到此舱位信息,可能已被删除,请重新查询后重试 - throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotBaseInfoNull))); - } - - var data = slotList.Select(a => a.Adapt()).ToList(); - - if (data != null) - return DataResult>.Success(data); - - return DataResult>.FailedData(data); + throw new NotImplementedException(); } - #endregion - #region 请求BC比对 - /// - /// 请求BC比对 - /// - /// BC详情 - /// BC变更后详情 - /// 返回回执 - public async Task> ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto) + Task IBookingSlotService.CreateBookingOrder(BookingGenerateDto model) { - TaskManageExcuteResultDto model = null; - /* - 1、读取配置文件中的规则引擎URL - 2、填充请求的类,并生成JSON报文 - 3、POST请求接口,并记录回执。 - 4、返回信息。 - */ - using (var httpClient = new HttpClient()) - { - try - { - using (var reduceAttach = new MultipartFormDataContent()) - { - var dataContent = new ByteArrayContent(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bcSrcDto))); - - dataContent.Headers.ContentDisposition = new ContentDispositionHeaderValue($"form-data") - { - Name = "srcJson" - }; - - reduceAttach.Add(dataContent); - - var dataContent2 = new ByteArrayContent(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bcTargetDto))); - - dataContent2.Headers.ContentDisposition = new ContentDispositionHeaderValue($"form-data") - { - Name = "destJson" - }; - - reduceAttach.Add(dataContent2); - - //请求 - var response = httpClient.PostAsync(bcCompareUrl, reduceAttach).Result; - - var result = response.Content.ReadAsStringAsync().Result; - - model = JsonConvert.DeserializeObject(result); - - Logger.Log(NLog.LogLevel.Info, $"推送BC比返回结果:{JsonConvert.SerializeObject(model)}"); - } - } - catch (Exception ex) - { - Logger.Log(NLog.LogLevel.Info, "推送BC比对异常,原因:{error}", ex.Message); - - // throw Oops.Oh($"推送BC比对异常,原因:{ex.Message}"); - } - } + throw new NotImplementedException(); + } - if (model != null) - return DataResult.Success(model); + Task IBookingSlotService.ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto) + { + throw new NotImplementedException(); + } - return DataResult.FailedData(model); + Task> IBookingSlotService.GetSlotList(long[] ids) + { + throw new NotImplementedException(); } - #endregion } public static class LetterIndexUtil 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 c9012700..8cfac7ae 100644 --- a/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt +++ b/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt @@ -705,10 +705,3 @@ 2024-07-22 18:36:53.5029 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-22 18:36:53.5029 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile 2024-07-22 18:36:53.5029 Info Configuration initialized. -2024-07-23 11:25:15.5508 Info Registered target NLog.Targets.FileTarget(Name=allfile) -2024-07-23 11:25:15.5655 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) -2024-07-23 11:25:15.5655 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) -2024-07-23 11:25:15.5804 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-23 11:25:15.5871 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-23 11:25:15.5871 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile -2024-07-23 11:25:15.5871 Info Configuration initialized. diff --git a/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user b/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user index 4c69aa02..f07afe67 100644 --- a/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -6,7 +6,7 @@ <_PublishTargetUrl>D:\Code\PublishCopy\ds8-opapi - True|2024-07-22T10:48:00.9436699Z||;True|2024-07-22T18:38:58.5618888+08:00||;True|2024-07-22T16:42:12.1933090+08:00||;True|2024-07-19T18:28:29.1420269+08:00||;True|2024-07-19T15:45:49.1068004+08:00||;True|2024-07-19T15:33:45.3242155+08:00||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||; + True|2024-07-22T08:42:12.1933090Z||;True|2024-07-19T18:28:29.1420269+08:00||;True|2024-07-19T15:45:49.1068004+08:00||;True|2024-07-19T15:33:45.3242155+08:00||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||; \ No newline at end of file From 051d2aeff8aa25e744c4b66c9bece107b6666caf Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 23 Jul 2024 11:54:41 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=B1=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingSlot/IBookingSlotService.cs | 4 +-- .../Method/BookingSlot/BookingSlotService.cs | 29 +++++++------------ 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs b/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs index 8b823b6d..c407ebc7 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs @@ -127,7 +127,7 @@ namespace DS.WMS.Core.Op.Interface /// /// 生成订舱订单请求 /// 返回回执 - Task CreateBookingOrder(BookingGenerateDto model); + Task> CreateBookingOrder(BookingGenerateDto model); /// /// 检索舱位对应的订舱订单(BY 舱位主键) @@ -152,7 +152,7 @@ namespace DS.WMS.Core.Op.Interface /// BC详情 /// BC变更后详情 /// 返回回执 - Task ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto); + Task> ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto); /// /// 推送BC变更比对 diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs index 02dd0364..ddd0fbc8 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs @@ -1582,7 +1582,8 @@ namespace DS.WMS.Core.Op.Method Logger.Log(NLog.LogLevel.Info, $"批次={batchNo} slotId={slotId} 开始请求比对结果"); - var compareResult = await ExcuteCompare(bcSrcDto, bcTargetDto); + var rlt = await ExcuteCompare(bcSrcDto, bcTargetDto); + var compareResult = rlt.Data; Logger.Log(NLog.LogLevel.Info, $"批次={batchNo} slotId={slotId} 请求比对结果完成,结果={JsonConvert.SerializeObject(compareResult)}"); @@ -1611,9 +1612,9 @@ namespace DS.WMS.Core.Op.Method CreateTime = nowDate, UpdateTime = nowDate, CreateBy = long.Parse(user.UserId), - //CreatedUserName = UserManager.Name, + CreateUserName = user.UserName, UpdateBy = long.Parse(user.UserId), - //UpdatedUserName = UserManager.Name, + UpdateUserName = user.UserName, CompareType = "BC_MODIFY", CompareRlt = JsonConvert.SerializeObject(compareResult.extra.ShowDetailList), }; @@ -1625,7 +1626,7 @@ namespace DS.WMS.Core.Op.Method hisInfo.CompareDiffNum = compareResult.extra.IsExistsDiff ? compareResult.extra.ShowDetailList.Count : 0; hisInfo.UpdateTime = nowDate; hisInfo.UpdateBy = long.Parse(user.UserId); - //hisInfo.UpdatedUserName = user.UserName; + hisInfo.UpdateUserName = user.UserName; hisInfo.CompareRlt = JsonConvert.SerializeObject(compareResult.extra.ShowDetailList); @@ -1636,7 +1637,7 @@ namespace DS.WMS.Core.Op.Method it.CompareRlt, it.UpdateTime, it.UpdateBy, - //it.UpdatedUserName + it.UpdateUserName }).ExecuteCommandAsync(); } //throw Oops.Oh($"舱位主键{slotId}请求BC比对失败,返回为空"); @@ -1660,8 +1661,7 @@ namespace DS.WMS.Core.Op.Method /// BC详情 /// BC变更后详情 /// 返回回执 - [NonAction] - public async Task ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto) + public async Task> ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto) { TaskManageExcuteResultDto model = null; /* @@ -1715,7 +1715,10 @@ namespace DS.WMS.Core.Op.Method } } - return model; + if (model != null) + return DataResult.Success(model); + + return DataResult.FailedData(model); ; } #endregion @@ -2833,16 +2836,6 @@ namespace DS.WMS.Core.Op.Method throw new NotImplementedException(); } - Task IBookingSlotService.CreateBookingOrder(BookingGenerateDto model) - { - throw new NotImplementedException(); - } - - Task IBookingSlotService.ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto) - { - throw new NotImplementedException(); - } - Task> IBookingSlotService.GetSlotList(long[] ids) { throw new NotImplementedException(); From e271ed539b52f21c654ce493ff1fd0ac4b3cb3f2 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 23 Jul 2024 13:32:55 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=B1=E4=BD=8D?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingSlot/IBookingSlotService.cs | 2 +- .../Method/BookingSlot/BookingSlotService.cs | 25 +++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs b/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs index c407ebc7..948d11d4 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs @@ -186,7 +186,7 @@ namespace DS.WMS.Core.Op.Interface /// /// 舱位ID组 /// 返回舱位详情 - Task> GetSlotList(long[] ids); + Task>> GetSlotList(long[] ids); /// /// 获取合票详情(生成合票需要先调此方法) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs index ddd0fbc8..4c29d7e2 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs @@ -2836,10 +2836,31 @@ namespace DS.WMS.Core.Op.Method throw new NotImplementedException(); } - Task> IBookingSlotService.GetSlotList(long[] ids) + #region 获取舱位详情列表 + /// + /// 获取舱位详情列表 + /// + /// 舱位ID组 + /// 返回舱位详情 + public async Task>> GetSlotList(long[] ids) { - throw new NotImplementedException(); + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + + var slotList = await tenantDb.Queryable().Where(u => ids.Contains(u.Id) && u.Deleted == false).ToListAsync(); + if (slotList.Count == 0) + { + //未查询到此舱位信息,可能已被删除,请重新查询后重试 + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotBaseInfoNull))); + } + + var data = slotList.Select(a => a.Adapt()).ToList(); + + if (data.Count > 0) + return DataResult>.Success(data); + + return DataResult>.FailedData(data); } + #endregion } public static class LetterIndexUtil