舱位引入接口参数及返回调整

dev
zhangxiaofeng 1 month ago
parent 11a38b6e22
commit d95e0eb1e4

@ -249,7 +249,7 @@ namespace DS.WMS.Core.Op.Interface
/// </summary>
/// <param name="querySearch">查询条件</param>
/// <returns></returns>
Task<DataResult<List<BookingSlotBaseWithCtnDto>>> GetAvailableBookingSlots(PageRequest querySearch);
Task<DataResult<List<BookingSlotBaseWithCtnDto>>> GetAvailableBookingSlots(PageRequest<string> querySearch);
/// <summary>
/// 引入现舱关联海运出口

@ -2710,7 +2710,7 @@ namespace DS.WMS.Core.Op.Method
//比对装货港
if (model.orderInfo.LoadPortId > 0 && latestSlotList.Any(a => a.PortLoadId.HasValue && a.PortLoadId.Value != model.orderInfo.LoadPortId))
{
return DataResult<string>.FailedData($"引入校验失败,订单装货港【{model.orderInfo.LoadPort}】 与舱位装货港【{latestSlotList.FirstOrDefault(a=>a.PortLoadId.HasValue).PortLoad}】 不一致");
return DataResult<string>.FailedData($"引入校验失败,订单装货港【{model.orderInfo.LoadPort}】 与舱位装货港【{latestSlotList.FirstOrDefault(a => a.PortLoadId.HasValue).PortLoad}】 不一致");
}
//比对卸货港
@ -4176,7 +4176,7 @@ namespace DS.WMS.Core.Op.Method
/// </summary>
/// <param name="querySearch">查询条件</param>
/// <returns></returns>
public async Task<DataResult<List<BookingSlotBaseWithCtnDto>>> GetAvailableBookingSlots(PageRequest querySearch)
public async Task<DataResult<List<BookingSlotBaseWithCtnDto>>> GetAvailableBookingSlots(PageRequest<string> querySearch)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
@ -4209,6 +4209,7 @@ namespace DS.WMS.Core.Op.Method
// 1. 【舱位基础表】与【箱子表】做关联并根据【舱位主键】、【箱型】做分组统计出【总的箱量】作为queryable1
var queryable1 = tenantDb.Queryable<BookingSlotBase>().InnerJoin<BookingSlotCtn>((bas, ctn) => bas.Id == ctn.SlotId)
.Where(whereList)
.WhereIF(!string.IsNullOrWhiteSpace(querySearch.OtherQueryCondition), (bas, ctn) => bas.SlotBookingNo == querySearch.OtherQueryCondition || bas.SlotNo == querySearch.OtherQueryCondition)
.Where(bas => bas.IsCancellation == false)
.WhereIF(ctnCodeArr != null && ctnCodeArr.Count > 0, (a, b) => b != null
&& !string.IsNullOrWhiteSpace(b.CtnCode)
@ -4305,10 +4306,9 @@ namespace DS.WMS.Core.Op.Method
}
}
if (baseList.Count > 0)
return DataResult<List<BookingSlotBaseWithCtnDto>>.Success(baseList);
return DataResult<List<BookingSlotBaseWithCtnDto>>.FailedData(baseList);
//if (baseList.Count > 0)
return DataResult<List<BookingSlotBaseWithCtnDto>>.Success(baseList);
//return DataResult<List<BookingSlotBaseWithCtnDto>>.FailedData(baseList);
}
#endregion
@ -4421,7 +4421,7 @@ namespace DS.WMS.Core.Op.Method
{
long useToVal = long.Parse(currUseTo.UseToVal);
var origList = db.Queryable<SysOrg>().Where(a => a.Status == StatusEnum.Enable && (orderInfo.OrgId == a.Id || useToVal == a.Id)).ToList();
throw new Exception($"舱位用途验证失败,专属公司【{origList.FirstOrDefault(a=>a.Id == useToVal)?.OrgName}】与订单的揽货人【{origList.FirstOrDefault(a=>a.Id == orderInfo.OrgId)?.OrgName}】不一致");
throw new Exception($"舱位用途验证失败,专属公司【{origList.FirstOrDefault(a => a.Id == useToVal)?.OrgName}】与订单的揽货人【{origList.FirstOrDefault(a => a.Id == orderInfo.OrgId)?.OrgName}】不一致");
}
}

@ -398,7 +398,7 @@ namespace DS.WMS.OpApi.Controllers
/// <returns></returns>
[HttpPost]
[Route("GetAvailableBookingSlots")]
public async Task<DataResult<List<BookingSlotBaseWithCtnDto>>> GetAvailableBookingSlots([FromBody] PageRequest querySearch)
public async Task<DataResult<List<BookingSlotBaseWithCtnDto>>> GetAvailableBookingSlots([FromBody] PageRequest<string> querySearch)
{
return await _bookingSlotService.GetAvailableBookingSlots(querySearch);
}

Loading…
Cancel
Save