修改舱位管理

usertest
jianghaiqing 4 months ago
parent 22c00c10a2
commit f6f53fe8d9

@ -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
{
/// <summary>
/// 舱位库存
/// </summary>
public class BookingSlotStockDto
{
/// <summary>
/// 船名
/// </summary>
public string Vessel { get; set; }
/// <summary>
/// 航次号
/// </summary>
public string Voyno { get; set; }
/// <summary>
/// 合约号
/// </summary>
public string ContractNo { get; set; }
/// <summary>
/// 订舱方式 CONTRACT_ORDER-合约订舱SPOT_ORDER-SPOT订舱
/// </summary>
public string BookingSlotType { get; set; }
/// <summary>
/// 订舱方式名称 CONTRACT_ORDER-合约订舱SPOT_ORDER-SPOT订舱
/// </summary>
public string BookingSlotTypeName { get; set; }
/// <summary>
/// 订舱抬头
/// </summary>
public string BookingParty { get; set; }
/// <summary>
/// 船公司主键
/// </summary>
public long CarrierId { get; set; }
/// <summary>
/// 船公司代号
/// </summary>
public string CarrierCode { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 预计开船日期
/// </summary>
public Nullable<DateTime> ETD { get; set; }
/// <summary>
/// 预计到港日期
/// </summary>
public Nullable<DateTime> ETA { get; set; }
/// <summary>
/// 收货地
/// </summary>
public string PlaceReceipt { get; set; }
/// <summary>
/// 交货地
/// </summary>
public string PlaceDelivery { get; set; }
/// <summary>
/// 装货港代码
/// </summary>
public string PortLoadId { get; set; }
/// <summary>
/// 装货港
/// </summary>
public string PortLoad { get; set; }
/// <summary>
/// 卸货港代码
/// </summary>
public string PortDischargeId { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string PortDischarge { get; set; }
/// <summary>
/// 卸货港国家代码
/// </summary>
public string PortDischargeCountryCode { get; set; }
/// <summary>
/// 卸货港国家名称
/// </summary>
public string PortDischargeCountry { get; set; }
/// <summary>
/// 航线代码(船公司)
/// </summary>
public string LaneCode { get; set; }
/// <summary>
/// 航线名称(船公司)
/// </summary>
public string LaneName { get; set; }
/// <summary>
/// 所在周数
/// </summary>
public Nullable<int> WeekAt { get; set; }
/// <summary>
/// 箱型箱量
/// </summary>
public string CtnStat { get; set; }
/// <summary>
/// 使用箱型箱量
/// </summary>
public string UseCtnStat { get; set; }
/// <summary>
/// 剩余箱型箱量
/// </summary>
public string RemainCtnStat { get; set; }
/// <summary>
/// 总舱位数
/// </summary>
public int TotalOrders { get; set; }
/// <summary>
/// 使用舱位数
/// </summary>
public int UseNum { get; set; }
/// <summary>
/// 取消舱位数
/// </summary>
public int CancelNum { get; set; }
/// <summary>
/// 总箱数
/// </summary>
public int TotalCtns { get; set; }
/// <summary>
/// 使用箱数
/// </summary>
public int UseCtnsNum { get; set; }
/// <summary>
/// 剩余箱数
/// </summary>
public int RemainCtnsNum { get; set; }
}
}

@ -60,18 +60,18 @@ namespace DS.WMS.Core.Op.Interface
Task<(bool isSuccess, string message)> ImportSlots(List<BookingSlotBaseWithCtnDto> slots, long bookingOrderId, bool isCheck, BookingGenerateDto generateModel = null); Task<(bool isSuccess, string message)> ImportSlots(List<BookingSlotBaseWithCtnDto> slots, long bookingOrderId, bool isCheck, BookingGenerateDto generateModel = null);
/// <summary> /// <summary>
/// /// 库存台账查询
/// </summary> /// </summary>
/// <param name="input"></param> /// <param name="input">查询条件</param>
/// <returns></returns> /// <returns></returns>
Task<dynamic> PageStock(BookingSlotStockPageInput input); Task<DataResult<List<BookingSlotStockDto>>> GetPageStockAsync(PageRequest querySearch);
/// <summary> /// <summary>
/// /// 刷新库存
/// </summary> /// </summary>
/// <param name="input"></param> /// <param name="input">请求参数</param>
/// <returns></returns> /// <returns>返回回执</returns>
Task RefreshStock(BookingSlotStockUpdateModel input); Task<DataResult<string>> RefreshStock(BookingSlotStockUpdateModel input);
/// <summary> /// <summary>
/// 保存舱位 /// 保存舱位
@ -132,7 +132,7 @@ namespace DS.WMS.Core.Op.Interface
/// <param name="id"></param> /// <param name="id"></param>
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
Task<BookingSlotWithOrderDto> SearchBookingSlotWithOrderById(long id); Task<DataResult<BookingSlotWithOrderDto>> SearchBookingSlotWithOrderById(long id);
/// <summary> /// <summary>
/// 检索舱位对应的订舱订单(BY 订舱编号) /// 检索舱位对应的订舱订单(BY 订舱编号)

@ -46,6 +46,7 @@ using DS.WMS.Core.Map.Interface;
using DS.WMS.Core.Code.Interface; using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Code.Method; using DS.WMS.Core.Code.Method;
using DS.WMS.Core.Map.Method; using DS.WMS.Core.Map.Method;
using DS.Module.Core.Extensions;
namespace DS.WMS.Core.Op.Method namespace DS.WMS.Core.Op.Method
{ {
@ -2539,28 +2540,55 @@ namespace DS.WMS.Core.Op.Method
return (true, "引入成功"); return (true, "引入成功");
} }
#region 检索舱位对应的订舱订单(BY 舱位主键)
/// <summary> /// <summary>
/// 检索舱位对应的订舱订单(BY 舱位主键) /// 检索舱位对应的订舱订单(BY 舱位主键)
/// </summary> /// </summary>
/// <param name="id">舱位ID</param> /// <param name="id">舱位ID</param>
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
public async Task<BookingSlotWithOrderDto> SearchBookingSlotWithOrderById(long id) public async Task<DataResult<BookingSlotWithOrderDto>> SearchBookingSlotWithOrderById(long id)
{ {
return null; BookingSlotWithOrderDto dto = null;
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var slotInfo = await tenantDb.Queryable<BookingSlotBase>().FirstAsync(a => a.Id == id);
if (slotInfo == null)
{
Logger.Log(NLog.LogLevel.Info, $"id={id} 获取舱位失败,舱位不存在或已作废");
return DataResult<BookingSlotWithOrderDto>.FailedData(dto);
} }
var list = tenantDb.Queryable<BookingSlotAllocation>().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<BookingSlotWithOrderDto>.Success(dto);
}
#endregion
#region 刷新库存
/// <summary> /// <summary>
/// 刷新库存 /// 刷新库存
/// </summary> /// </summary>
/// <param name="input"></param> /// <param name="input">请求参数</param>
/// <returns></returns> /// <returns>返回回执</returns>
public async Task RefreshStock(BookingSlotStockUpdateModel input) public async Task<DataResult<string>> RefreshStock(BookingSlotStockUpdateModel input)
{ {
//input.TenantId = UserManager.TENANT_ID; return await _bookingSlotStockService.BookingSlotStock(input);
//更新库存
//await _publisher.PublishAsync(new ChannelEventSource("BookingSlotStock:Update", input));
} }
#endregion
#region 订舱编号检索舱位信息 #region 订舱编号检索舱位信息
/// <summary> /// <summary>
@ -2593,15 +2621,27 @@ namespace DS.WMS.Core.Op.Method
} }
#endregion #endregion
#region 库存台账查询
/// <summary> /// <summary>
/// 库存查询 /// 库存台账查询
/// </summary> /// </summary>
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
public async Task<dynamic> PageStock(BookingSlotStockPageInput input) public async Task<DataResult<List<BookingSlotStockDto>>> GetPageStockAsync(PageRequest querySearch)
{ {
return null; var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(querySearch.QueryCondition);
var result = tenantDb.Queryable<BookingSlotStock>()
.Select<BookingSlotStockDto>()
.Where(whereList);
var list = result.ToList();
return await result.ToQueryPageAsync(querySearch.PageCondition);
} }
#endregion
/// <summary> /// <summary>
/// 生成合票订舱订单 /// 生成合票订舱订单

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<NameOfLastUsedPublishProfile>D:\Code\DS\ds8-solution-pro\ds-wms-service\DS.WMS.MainApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.MainApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

@ -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: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.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-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.

@ -15,6 +15,7 @@ using DS.Module.UserModule;
using DS.WMS.MainApi; using DS.WMS.MainApi;
using NLog.Web; using NLog.Web;
using Swashbuckle.AspNetCore.SwaggerUI; using Swashbuckle.AspNetCore.SwaggerUI;
using DS.Module.RedisModule;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
var environment = builder.Environment.EnvironmentName; var environment = builder.Environment.EnvironmentName;
@ -43,6 +44,7 @@ builder.Services.AddSaasDbInstall();//分库服务
builder.Services.AddMultiLanguageInstall();//多语言服务 builder.Services.AddMultiLanguageInstall();//多语言服务
builder.Services.AddExcelModuleInstall();//Excel服务 builder.Services.AddExcelModuleInstall();//Excel服务
builder.Services.AddPrintModuleInstall();//Print服务 builder.Services.AddPrintModuleInstall();//Print服务
builder.Services.AddRedisModuleInstall();//redis
// builder.Services.AddEndpointsApiExplorer(); // builder.Services.AddEndpointsApiExplorer();
// builder.Services.AddSwaggerGen(); // builder.Services.AddSwaggerGen();

@ -6,7 +6,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<_PublishTargetUrl>D:\Code\PublishCopy\ds8-mainapi</_PublishTargetUrl> <_PublishTargetUrl>D:\Code\PublishCopy\ds8-mainapi</_PublishTargetUrl>
<History>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||;</History> <History>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||;</History>
<LastFailureDetails /> <LastFailureDetails />
</PropertyGroup> </PropertyGroup>
</Project> </Project>

@ -113,9 +113,9 @@ namespace DS.WMS.OpApi.Controllers
/// <returns>返回列表</returns> /// <returns>返回列表</returns>
[HttpPost] [HttpPost]
[Route("PageStock")] [Route("PageStock")]
public async Task<DataResult> PageStock([FromBody] BookingSlotStockPageInput input) public async Task<DataResult<List<BookingSlotStockDto>>> PageStock([FromBody] PageRequest querySearch)
{ {
return await _bookingSlotService.PageStock(input); return await _bookingSlotService.GetPageStockAsync(querySearch);
} }
#endregion #endregion
@ -127,11 +127,9 @@ namespace DS.WMS.OpApi.Controllers
/// <returns>返回列表</returns> /// <returns>返回列表</returns>
[HttpPost] [HttpPost]
[Route("RefreshStock")] [Route("RefreshStock")]
public async Task<DataResult> RefreshStock([FromBody] BookingSlotStockUpdateModel input) public async Task<DataResult<string>> RefreshStock([FromBody] BookingSlotStockUpdateModel input)
{ {
await _bookingSlotService.RefreshStock(input); return await _bookingSlotService.RefreshStock(input);
return null;
} }
#endregion #endregion
@ -247,7 +245,7 @@ namespace DS.WMS.OpApi.Controllers
[Route("SearchBookingSlotWithOrderById")] [Route("SearchBookingSlotWithOrderById")]
public async Task<DataResult<BookingSlotWithOrderDto>> SearchBookingSlotWithOrderById([FromQuery] long id) public async Task<DataResult<BookingSlotWithOrderDto>> SearchBookingSlotWithOrderById([FromQuery] long id)
{ {
return null; //await _bookingSlotService.SearchBookingSlotWithOrderById(id); return await _bookingSlotService.SearchBookingSlotWithOrderById(id);
} }
#endregion #endregion

@ -6,7 +6,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<_PublishTargetUrl>D:\Code\PublishCopy\ds8-opapi</_PublishTargetUrl> <_PublishTargetUrl>D:\Code\PublishCopy\ds8-opapi</_PublishTargetUrl>
<History>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||;</History> <History>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||;</History>
<LastFailureDetails /> <LastFailureDetails />
</PropertyGroup> </PropertyGroup>
</Project> </Project>
Loading…
Cancel
Save