diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/BookingSlotStockDto.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/BookingSlotStockDto.cs
new file mode 100644
index 00000000..e794f1f1
--- /dev/null
+++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/BookingSlotStockDto.cs
@@ -0,0 +1,169 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DS.WMS.Core.Op.Dtos
+{
+ ///
+ /// 舱位库存
+ ///
+ public class BookingSlotStockDto
+ {
+ ///
+ /// 船名
+ ///
+ public string Vessel { get; set; }
+
+ ///
+ /// 航次号
+ ///
+ public string Voyno { get; set; }
+
+ ///
+ /// 合约号
+ ///
+ public string ContractNo { get; set; }
+
+ ///
+ /// 订舱方式 CONTRACT_ORDER-合约订舱;SPOT_ORDER-SPOT订舱
+ ///
+ public string BookingSlotType { get; set; }
+
+ ///
+ /// 订舱方式名称 CONTRACT_ORDER-合约订舱;SPOT_ORDER-SPOT订舱
+ ///
+ public string BookingSlotTypeName { get; set; }
+
+ ///
+ /// 订舱抬头
+ ///
+ public string BookingParty { get; set; }
+
+ ///
+ /// 船公司主键
+ ///
+ public long CarrierId { get; set; }
+
+ ///
+ /// 船公司代号
+ ///
+ public string CarrierCode { get; set; }
+
+ ///
+ /// 船公司
+ ///
+ public string Carrier { get; set; }
+
+ ///
+ /// 预计开船日期
+ ///
+ public Nullable ETD { get; set; }
+
+ ///
+ /// 预计到港日期
+ ///
+ public Nullable ETA { get; set; }
+
+ ///
+ /// 收货地
+ ///
+ public string PlaceReceipt { get; set; }
+
+ ///
+ /// 交货地
+ ///
+ public string PlaceDelivery { get; set; }
+
+ ///
+ /// 装货港代码
+ ///
+ public string PortLoadId { get; set; }
+
+ ///
+ /// 装货港
+ ///
+ public string PortLoad { get; set; }
+
+ ///
+ /// 卸货港代码
+ ///
+ public string PortDischargeId { get; set; }
+
+ ///
+ /// 卸货港
+ ///
+ public string PortDischarge { get; set; }
+
+ ///
+ /// 卸货港国家代码
+ ///
+ public string PortDischargeCountryCode { get; set; }
+
+ ///
+ /// 卸货港国家名称
+ ///
+ public string PortDischargeCountry { get; set; }
+
+ ///
+ /// 航线代码(船公司)
+ ///
+ public string LaneCode { get; set; }
+
+ ///
+ /// 航线名称(船公司)
+ ///
+ public string LaneName { get; set; }
+
+ ///
+ /// 所在周数
+ ///
+ public Nullable WeekAt { get; set; }
+
+ ///
+ /// 箱型箱量
+ ///
+ public string CtnStat { get; set; }
+
+ ///
+ /// 使用箱型箱量
+ ///
+ public string UseCtnStat { get; set; }
+
+ ///
+ /// 剩余箱型箱量
+ ///
+ public string RemainCtnStat { get; set; }
+
+ ///
+ /// 总舱位数
+ ///
+ public int TotalOrders { get; set; }
+
+ ///
+ /// 使用舱位数
+ ///
+ public int UseNum { get; set; }
+
+ ///
+ /// 取消舱位数
+ ///
+ public int CancelNum { get; set; }
+
+ ///
+ /// 总箱数
+ ///
+ public int TotalCtns { get; set; }
+
+ ///
+ /// 使用箱数
+ ///
+ public int UseCtnsNum { get; set; }
+
+ ///
+ /// 剩余箱数
+ ///
+ public int RemainCtnsNum { 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 7b331d2e..2e94ddfe 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
@@ -60,18 +60,18 @@ namespace DS.WMS.Core.Op.Interface
Task<(bool isSuccess, string message)> ImportSlots(List slots, long bookingOrderId, bool isCheck, BookingGenerateDto generateModel = null);
///
- ///
+ /// 库存台账查询
///
- ///
+ /// 查询条件
///
- Task PageStock(BookingSlotStockPageInput input);
-
+ Task>> GetPageStockAsync(PageRequest querySearch);
+
///
- ///
+ /// 刷新库存
///
- ///
- ///
- Task RefreshStock(BookingSlotStockUpdateModel input);
+ /// 请求参数
+ /// 返回回执
+ Task> RefreshStock(BookingSlotStockUpdateModel input);
///
/// 保存舱位
@@ -132,7 +132,7 @@ namespace DS.WMS.Core.Op.Interface
///
/// 返回回执
- Task SearchBookingSlotWithOrderById(long id);
+ Task> SearchBookingSlotWithOrderById(long id);
///
/// 检索舱位对应的订舱订单(BY 订舱编号)
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 e159fe25..132dc6b1 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
@@ -46,6 +46,7 @@ using DS.WMS.Core.Map.Interface;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Code.Method;
using DS.WMS.Core.Map.Method;
+using DS.Module.Core.Extensions;
namespace DS.WMS.Core.Op.Method
{
@@ -2539,28 +2540,55 @@ namespace DS.WMS.Core.Op.Method
return (true, "引入成功");
}
-
+ #region 检索舱位对应的订舱订单(BY 舱位主键)
///
/// 检索舱位对应的订舱订单(BY 舱位主键)
///
/// 舱位ID
/// 返回回执
- public async Task SearchBookingSlotWithOrderById(long id)
+ public async Task> SearchBookingSlotWithOrderById(long id)
{
- return null;
+ BookingSlotWithOrderDto dto = null;
+
+ var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
+
+ var slotInfo = await tenantDb.Queryable().FirstAsync(a => a.Id == id);
+
+ if (slotInfo == null)
+ {
+ Logger.Log(NLog.LogLevel.Info, $"id={id} 获取舱位失败,舱位不存在或已作废");
+
+ return DataResult.FailedData(dto);
+ }
+
+ var list = tenantDb.Queryable().Where(a => a.BookingSlotId == id).ToList();
+
+ dto = new BookingSlotWithOrderDto
+ {
+ BookingSlotId = slotInfo.Id,
+ };
+
+ if (list.Count > 0)
+ {
+ dto.HasBookingOrder = true;
+ dto.BookingOrderList = list.Select(x => x.Id).ToList();
+ }
+
+ return DataResult.Success(dto);
}
+ #endregion
+ #region 刷新库存
///
/// 刷新库存
///
- ///
- ///
- public async Task RefreshStock(BookingSlotStockUpdateModel input)
+ /// 请求参数
+ /// 返回回执
+ public async Task> RefreshStock(BookingSlotStockUpdateModel input)
{
- //input.TenantId = UserManager.TENANT_ID;
- //更新库存
- //await _publisher.PublishAsync(new ChannelEventSource("BookingSlotStock:Update", input));
+ return await _bookingSlotStockService.BookingSlotStock(input);
}
+ #endregion
#region 订舱编号检索舱位信息
///
@@ -2593,15 +2621,27 @@ namespace DS.WMS.Core.Op.Method
}
#endregion
+ #region 库存台账查询
///
- /// 库存查询
+ /// 库存台账查询
///
///
///
- public async Task PageStock(BookingSlotStockPageInput input)
+ public async Task>> GetPageStockAsync(PageRequest querySearch)
{
- return null;
+ var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
+
+ //序列化查询条件
+ var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(querySearch.QueryCondition);
+ var result = tenantDb.Queryable()
+ .Select()
+ .Where(whereList);
+
+ var list = result.ToList();
+
+ return await result.ToQueryPageAsync(querySearch.PageCondition);
}
+ #endregion
///
/// 生成合票订舱订单
diff --git a/ds-wms-service/DS.WMS.MainApi/DS.WMS.MainApi.csproj.user b/ds-wms-service/DS.WMS.MainApi/DS.WMS.MainApi.csproj.user
index 996c16b7..166ab595 100644
--- a/ds-wms-service/DS.WMS.MainApi/DS.WMS.MainApi.csproj.user
+++ b/ds-wms-service/DS.WMS.MainApi/DS.WMS.MainApi.csproj.user
@@ -1,6 +1,6 @@
- D:\Code\DS\ds8-solution-pro\ds-wms-service\DS.WMS.MainApi\Properties\PublishProfiles\FolderProfile.pubxml
+ E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.MainApi\Properties\PublishProfiles\FolderProfile.pubxml
\ No newline at end of file
diff --git a/ds-wms-service/DS.WMS.MainApi/Logs/internal-nlog.txt b/ds-wms-service/DS.WMS.MainApi/Logs/internal-nlog.txt
index 33ed69a4..84ca6158 100644
--- a/ds-wms-service/DS.WMS.MainApi/Logs/internal-nlog.txt
+++ b/ds-wms-service/DS.WMS.MainApi/Logs/internal-nlog.txt
@@ -2180,3 +2180,10 @@
2024-06-19 15:34:37.9942 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-06-19 15:34:38.0255 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-06-19 15:34:38.1065 Info Configuration initialized.
+2024-07-19 11:54:08.6118 Info Registered target NLog.Targets.FileTarget(Name=allfile)
+2024-07-19 11:54:08.6244 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
+2024-07-19 11:54:08.6244 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
+2024-07-19 11:54:08.6244 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-19 11:54:08.6430 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
+2024-07-19 11:54:08.6430 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
+2024-07-19 11:54:08.6430 Info Configuration initialized.
diff --git a/ds-wms-service/DS.WMS.MainApi/Program.cs b/ds-wms-service/DS.WMS.MainApi/Program.cs
index 3ea65722..c4d6d31f 100644
--- a/ds-wms-service/DS.WMS.MainApi/Program.cs
+++ b/ds-wms-service/DS.WMS.MainApi/Program.cs
@@ -15,6 +15,7 @@ using DS.Module.UserModule;
using DS.WMS.MainApi;
using NLog.Web;
using Swashbuckle.AspNetCore.SwaggerUI;
+using DS.Module.RedisModule;
var builder = WebApplication.CreateBuilder(args);
var environment = builder.Environment.EnvironmentName;
@@ -43,6 +44,7 @@ builder.Services.AddSaasDbInstall();//分库服务
builder.Services.AddMultiLanguageInstall();//多语言服务
builder.Services.AddExcelModuleInstall();//Excel服务
builder.Services.AddPrintModuleInstall();//Print服务
+builder.Services.AddRedisModuleInstall();//redis
// builder.Services.AddEndpointsApiExplorer();
// builder.Services.AddSwaggerGen();
diff --git a/ds-wms-service/DS.WMS.MainApi/Properties/PublishProfiles/FolderProfile.pubxml.user b/ds-wms-service/DS.WMS.MainApi/Properties/PublishProfiles/FolderProfile.pubxml.user
index 4b3ff8ce..86d400ca 100644
--- a/ds-wms-service/DS.WMS.MainApi/Properties/PublishProfiles/FolderProfile.pubxml.user
+++ b/ds-wms-service/DS.WMS.MainApi/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -6,7 +6,7 @@
<_PublishTargetUrl>D:\Code\PublishCopy\ds8-mainapi
- True|2024-07-18T07:59:36.7010783Z||;True|2024-07-16T18:17:43.9220347+08:00||;True|2024-06-18T17:36:34.9035076+08:00||;True|2024-06-18T16:25:54.2461596+08:00||;True|2024-06-18T10:09:37.3872162+08:00||;True|2024-06-18T10:00:43.4402179+08:00||;True|2024-06-18T08:55:07.3014083+08:00||;True|2024-06-18T08:40:51.6182342+08:00||;True|2024-06-13T19:48:34.0429148+08:00||;True|2024-06-13T19:09:39.6804400+08:00||;True|2024-06-13T15:41:56.9502735+08:00||;True|2024-06-13T15:23:59.4555910+08:00||;True|2024-06-13T15:12:55.6093356+08:00||;True|2024-06-11T17:08:01.8930314+08:00||;True|2024-06-07T15:23:11.1389680+08:00||;True|2024-06-07T10:23:59.6079620+08:00||;True|2024-06-06T17:42:56.1843783+08:00||;True|2024-06-04T14:20:46.7742295+08:00||;True|2024-05-31T17:57:35.6858600+08:00||;True|2024-05-31T15:25:20.8503086+08:00||;True|2024-05-30T17:22:52.2563382+08:00||;True|2024-05-30T17:05:35.7504154+08:00||;True|2024-05-29T17:17:39.6966826+08:00||;
+ True|2024-07-19T04:03:03.1399057Z||;True|2024-07-19T11:47:36.2698405+08:00||;True|2024-07-18T15:59:36.7010783+08:00||;True|2024-07-16T18:17:43.9220347+08:00||;True|2024-06-18T17:36:34.9035076+08:00||;True|2024-06-18T16:25:54.2461596+08:00||;True|2024-06-18T10:09:37.3872162+08:00||;True|2024-06-18T10:00:43.4402179+08:00||;True|2024-06-18T08:55:07.3014083+08:00||;True|2024-06-18T08:40:51.6182342+08:00||;True|2024-06-13T19:48:34.0429148+08:00||;True|2024-06-13T19:09:39.6804400+08:00||;True|2024-06-13T15:41:56.9502735+08:00||;True|2024-06-13T15:23:59.4555910+08:00||;True|2024-06-13T15:12:55.6093356+08:00||;True|2024-06-11T17:08:01.8930314+08:00||;True|2024-06-07T15:23:11.1389680+08:00||;True|2024-06-07T10:23:59.6079620+08:00||;True|2024-06-06T17:42:56.1843783+08:00||;True|2024-06-04T14:20:46.7742295+08:00||;True|2024-05-31T17:57:35.6858600+08:00||;True|2024-05-31T15:25:20.8503086+08:00||;True|2024-05-30T17:22:52.2563382+08:00||;True|2024-05-30T17:05:35.7504154+08:00||;True|2024-05-29T17:17:39.6966826+08:00||;
\ No newline at end of file
diff --git a/ds-wms-service/DS.WMS.OpApi/Controllers/BookingSlotServiceController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/BookingSlotServiceController.cs
index f1588170..38a308d0 100644
--- a/ds-wms-service/DS.WMS.OpApi/Controllers/BookingSlotServiceController.cs
+++ b/ds-wms-service/DS.WMS.OpApi/Controllers/BookingSlotServiceController.cs
@@ -113,9 +113,9 @@ namespace DS.WMS.OpApi.Controllers
/// 返回列表
[HttpPost]
[Route("PageStock")]
- public async Task PageStock([FromBody] BookingSlotStockPageInput input)
+ public async Task>> PageStock([FromBody] PageRequest querySearch)
{
- return await _bookingSlotService.PageStock(input);
+ return await _bookingSlotService.GetPageStockAsync(querySearch);
}
#endregion
@@ -127,11 +127,9 @@ namespace DS.WMS.OpApi.Controllers
/// 返回列表
[HttpPost]
[Route("RefreshStock")]
- public async Task RefreshStock([FromBody] BookingSlotStockUpdateModel input)
+ public async Task> RefreshStock([FromBody] BookingSlotStockUpdateModel input)
{
- await _bookingSlotService.RefreshStock(input);
-
- return null;
+ return await _bookingSlotService.RefreshStock(input);
}
#endregion
@@ -247,7 +245,7 @@ namespace DS.WMS.OpApi.Controllers
[Route("SearchBookingSlotWithOrderById")]
public async Task> SearchBookingSlotWithOrderById([FromQuery] long id)
{
- return null; //await _bookingSlotService.SearchBookingSlotWithOrderById(id);
+ return await _bookingSlotService.SearchBookingSlotWithOrderById(id);
}
#endregion
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 77b70dd8..9a4fd0d9 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-19T00:46:28.8014836Z||;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-19T05:48:27.9722093Z||;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