|
|
@ -1087,9 +1087,17 @@ namespace Myshipping.Application
|
|
|
|
/// 查询可用的舱位及箱子
|
|
|
|
/// 查询可用的舱位及箱子
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpGet("/BookingSlot/getAvailableSlots")]
|
|
|
|
[HttpGet("/BookingSlot/getAvailableSlots")]
|
|
|
|
public async Task<List<BookingSlotBaseWithCtnDto>> GetAvailableSlots([FromQuery] BookingSlotBaseDto input)
|
|
|
|
public async Task<SqlSugarPagedList<BookingSlotBaseWithCtnDto>> GetAvailableSlots([FromQuery] BookingSlotBaseDto input, [FromQuery] PageWithTotal pageInfo)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await GetAvailableSlots(input, null);
|
|
|
|
var result = await GetAvailableSlots(input, null, pageInfo);
|
|
|
|
|
|
|
|
SqlSugarPagedList<BookingSlotBaseWithCtnDto> pageResult = new()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
PageIndex = pageInfo.PageNo,
|
|
|
|
|
|
|
|
PageSize = pageInfo.PageSize,
|
|
|
|
|
|
|
|
TotalCount = pageInfo.Total,
|
|
|
|
|
|
|
|
Items = result,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
return pageResult;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -1097,9 +1105,12 @@ namespace Myshipping.Application
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="slotInput">筛选条件1:舱位信息、箱型</param>
|
|
|
|
/// <param name="slotInput">筛选条件1:舱位信息、箱型</param>
|
|
|
|
/// <param name="slotIdListInput">筛选条件2:舱位主键列表</param>
|
|
|
|
/// <param name="slotIdListInput">筛选条件2:舱位主键列表</param>
|
|
|
|
|
|
|
|
/// <param name="pageInfo">筛选条件3:分页</param>
|
|
|
|
/// <returns>可用的舱位列表(含可用的箱子列表)</returns>
|
|
|
|
/// <returns>可用的舱位列表(含可用的箱子列表)</returns>
|
|
|
|
[NonAction]
|
|
|
|
[NonAction]
|
|
|
|
public async Task<List<BookingSlotBaseWithCtnDto>> GetAvailableSlots(BookingSlotBaseDto slotInput = null, List<long> slotIdListInput = null)
|
|
|
|
public async Task<List<BookingSlotBaseWithCtnDto>> GetAvailableSlots(BookingSlotBaseDto slotInput = null,
|
|
|
|
|
|
|
|
List<long> slotIdListInput = null,
|
|
|
|
|
|
|
|
PageWithTotal pageInfo = null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
slotInput ??= new();
|
|
|
|
slotInput ??= new();
|
|
|
|
slotIdListInput ??= new();
|
|
|
|
slotIdListInput ??= new();
|
|
|
@ -1113,6 +1124,7 @@ namespace Myshipping.Application
|
|
|
|
// 1. 【舱位基础表】与【箱子表】做关联,并根据【舱位主键】、【箱型】做分组,统计出【总的箱量】,作为queryable1
|
|
|
|
// 1. 【舱位基础表】与【箱子表】做关联,并根据【舱位主键】、【箱型】做分组,统计出【总的箱量】,作为queryable1
|
|
|
|
var queryable1 = _repBase.Context.Queryable<BookingSlotBase, BookingSlotCtn>((bas, ctn) => bas.Id == ctn.SLOT_ID)
|
|
|
|
var queryable1 = _repBase.Context.Queryable<BookingSlotBase, BookingSlotCtn>((bas, ctn) => bas.Id == ctn.SLOT_ID)
|
|
|
|
.Where(bas => bas.IS_CANCELLATION == false)
|
|
|
|
.Where(bas => bas.IS_CANCELLATION == false)
|
|
|
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(slotInput.SLOT_BOOKING_NO), bas => bas.SLOT_BOOKING_NO == slotInput.SLOT_BOOKING_NO)
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(slotInput.PORTLOAD), bas => bas.PORTLOAD.Contains(slotInput.PORTLOAD))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(slotInput.PORTLOAD), bas => bas.PORTLOAD.Contains(slotInput.PORTLOAD))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(slotInput.PORTDISCHARGE), bas => bas.PORTLOAD.Contains(slotInput.PORTLOAD))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(slotInput.PORTDISCHARGE), bas => bas.PORTLOAD.Contains(slotInput.PORTLOAD))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(slotInput.VESSEL), bas => bas.VESSEL.Contains(slotInput.VESSEL))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(slotInput.VESSEL), bas => bas.VESSEL.Contains(slotInput.VESSEL))
|
|
|
@ -1161,7 +1173,15 @@ namespace Myshipping.Application
|
|
|
|
.Where(r => r.numResidue > 0);
|
|
|
|
.Where(r => r.numResidue > 0);
|
|
|
|
|
|
|
|
|
|
|
|
// 4. 执行ToList(),得到可用的【舱位主键】、【箱型】、【箱量】列表
|
|
|
|
// 4. 执行ToList(),得到可用的【舱位主键】、【箱型】、【箱量】列表
|
|
|
|
var canUselist = await queryable3.ToListAsync();
|
|
|
|
RefAsync<int> total = 0;
|
|
|
|
|
|
|
|
var canUselist = pageInfo == null
|
|
|
|
|
|
|
|
? await queryable3.ToListAsync()
|
|
|
|
|
|
|
|
: await queryable3.ToPageListAsync(pageInfo.PageNo, pageInfo.PageSize, total);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pageInfo != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
pageInfo.Total = total;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 查询舱位列表
|
|
|
|
// 查询舱位列表
|
|
|
|
var baseIdList = canUselist.Select(c => c.id);
|
|
|
|
var baseIdList = canUselist.Select(c => c.id);
|
|
|
@ -1340,8 +1360,6 @@ namespace Myshipping.Application
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 分页查询订舱舱位
|
|
|
|
/// 分页查询订舱舱位
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[HttpPost("/BookingSlot/page")]
|
|
|
|
[HttpPost("/BookingSlot/page")]
|
|
|
|
public async Task<dynamic> Page(BookingSlotBasePageInput input)
|
|
|
|
public async Task<dynamic> Page(BookingSlotBasePageInput input)
|
|
|
|
{
|
|
|
|
{
|
|
|
|