|
|
@ -674,38 +674,26 @@ namespace Myshipping.Application.Service.BookingOrder
|
|
|
|
/// <returns>返回台账列表</returns>
|
|
|
|
/// <returns>返回台账列表</returns>
|
|
|
|
public async Task<SqlSugarPagedList<BookingDeliveryRecordPageDto>> GetPageAsync([FromBody] QueryBookingDeliveryRecordDto QuerySearch)
|
|
|
|
public async Task<SqlSugarPagedList<BookingDeliveryRecordPageDto>> GetPageAsync([FromBody] QueryBookingDeliveryRecordDto QuerySearch)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
|
|
|
|
List<string> contaList = new List<string>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.ContaNo))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (Regex.IsMatch(QuerySearch.ContaNo, "(\\t|\\n\\r|\\n)"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
contaList = Regex.Replace(QuerySearch.ContaNo, "(\\t |\\n\\r |\\n)", "#").Split(new char[] { '#' }).Select(t => t?.Trim()).ToList();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
contaList.Add(QuerySearch.ContaNo.Trim());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//制单日期
|
|
|
|
//制单日期
|
|
|
|
DateTime createBegin = DateTime.MinValue;
|
|
|
|
DateTime createBegin = DateTime.MinValue;
|
|
|
|
DateTime createEnd = DateTime.MinValue;
|
|
|
|
DateTime createEnd = DateTime.MinValue;
|
|
|
|
//派车日期
|
|
|
|
//更新日期
|
|
|
|
DateTime truckDateBegin = DateTime.MinValue;
|
|
|
|
DateTime updateBegin = DateTime.MinValue;
|
|
|
|
DateTime truckDateEnd = DateTime.MinValue;
|
|
|
|
DateTime updateEnd = DateTime.MinValue;
|
|
|
|
//截单日期
|
|
|
|
//预计离港日期
|
|
|
|
DateTime closeDateBegin = DateTime.MinValue;
|
|
|
|
DateTime edepartureBegin = DateTime.MinValue;
|
|
|
|
DateTime closeDateEnd = DateTime.MinValue;
|
|
|
|
DateTime edepartureEnd = DateTime.MinValue;
|
|
|
|
//提货日期
|
|
|
|
//ETD日期
|
|
|
|
DateTime pickUpTimeBegin = DateTime.MinValue;
|
|
|
|
DateTime etdBegin = DateTime.MinValue;
|
|
|
|
DateTime pickUpTimeEnd = DateTime.MinValue;
|
|
|
|
DateTime etdEnd = DateTime.MinValue;
|
|
|
|
//返场时间
|
|
|
|
//ETA时间
|
|
|
|
DateTime returnTimeBegin = DateTime.MinValue;
|
|
|
|
DateTime etaBegin = DateTime.MinValue;
|
|
|
|
DateTime returnTimeEnd = DateTime.MinValue;
|
|
|
|
DateTime etaEnd = DateTime.MinValue;
|
|
|
|
//要求到达时间
|
|
|
|
|
|
|
|
DateTime needArriveTimeBegin = DateTime.MinValue;
|
|
|
|
//定时
|
|
|
|
DateTime needArriveTimeEnd = DateTime.MinValue;
|
|
|
|
DateTime jobBegin = DateTime.MinValue;
|
|
|
|
|
|
|
|
DateTime jobEnd = DateTime.MinValue;
|
|
|
|
|
|
|
|
|
|
|
|
#region 查询条件
|
|
|
|
#region 查询条件
|
|
|
|
|
|
|
|
|
|
|
@ -723,75 +711,77 @@ namespace Myshipping.Application.Service.BookingOrder
|
|
|
|
|
|
|
|
|
|
|
|
createEnd = createEnd.AddDays(1);
|
|
|
|
createEnd = createEnd.AddDays(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//派车日期
|
|
|
|
//更新日期
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.TruckTimeBegin))
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.UpdateBegin))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!DateTime.TryParse(QuerySearch.TruckTimeBegin, out truckDateBegin))
|
|
|
|
if (!DateTime.TryParse(QuerySearch.UpdateBegin, out updateBegin))
|
|
|
|
throw Oops.Oh($"派车起始日期格式错误,{QuerySearch.TruckTimeBegin}");
|
|
|
|
throw Oops.Oh($"更新起始日期开始格式错误,{QuerySearch.UpdateBegin}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.TruckTimeEnd))
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.UpdateEnd))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!DateTime.TryParse(QuerySearch.TruckTimeEnd, out truckDateEnd))
|
|
|
|
if (!DateTime.TryParse(QuerySearch.UpdateEnd, out updateEnd))
|
|
|
|
throw Oops.Oh($"派车结束日期格式错误,{QuerySearch.TruckTimeEnd}");
|
|
|
|
throw Oops.Oh($"更新结束日期格式错误,{QuerySearch.UpdateEnd}");
|
|
|
|
|
|
|
|
|
|
|
|
truckDateEnd = truckDateEnd.AddDays(1);
|
|
|
|
updateEnd = updateEnd.AddDays(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//截单日期
|
|
|
|
//预计离港日期
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.ClosingTimeBegin))
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.EDepartureBegin))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!DateTime.TryParse(QuerySearch.ClosingTimeBegin, out closeDateBegin))
|
|
|
|
if (!DateTime.TryParse(QuerySearch.EDepartureBegin, out edepartureBegin))
|
|
|
|
throw Oops.Oh($"截单起始日期格式错误,{QuerySearch.ClosingTimeBegin}");
|
|
|
|
throw Oops.Oh($"预计离港日期起始格式错误,{QuerySearch.EDepartureBegin}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.ClosingTimeEnd))
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.EDepartureEnd))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!DateTime.TryParse(QuerySearch.ClosingTimeEnd, out closeDateEnd))
|
|
|
|
if (!DateTime.TryParse(QuerySearch.EDepartureEnd, out edepartureEnd))
|
|
|
|
throw Oops.Oh($"截单结束日期格式错误,{QuerySearch.ClosingTimeEnd}");
|
|
|
|
throw Oops.Oh($"预计离港日期结束格式错误,{QuerySearch.EDepartureEnd}");
|
|
|
|
|
|
|
|
|
|
|
|
closeDateEnd = closeDateEnd.AddDays(1);
|
|
|
|
edepartureEnd = edepartureEnd.AddDays(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//提货日期
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.PickUpTimeBegin))
|
|
|
|
//ETD
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.ETDBegin))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!DateTime.TryParse(QuerySearch.PickUpTimeBegin, out pickUpTimeBegin))
|
|
|
|
if (!DateTime.TryParse(QuerySearch.ETDBegin, out etdBegin))
|
|
|
|
throw Oops.Oh($"提货起始日期格式错误,{QuerySearch.PickUpTimeBegin}");
|
|
|
|
throw Oops.Oh($"ETD起始日期格式错误,{QuerySearch.ETDBegin}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.PickUpTimeEnd))
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.ETDEnd))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!DateTime.TryParse(QuerySearch.ClosingTimeEnd, out pickUpTimeEnd))
|
|
|
|
if (!DateTime.TryParse(QuerySearch.ETDEnd, out etdEnd))
|
|
|
|
throw Oops.Oh($"提货结束日期格式错误,{QuerySearch.PickUpTimeEnd}");
|
|
|
|
throw Oops.Oh($"ETD结束日期格式错误,{QuerySearch.ETDEnd}");
|
|
|
|
|
|
|
|
|
|
|
|
pickUpTimeEnd = pickUpTimeEnd.AddDays(1);
|
|
|
|
etdEnd = etdEnd.AddDays(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//返场时间
|
|
|
|
//ETA
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.ReturnTimeBegin))
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.ETDBegin))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!DateTime.TryParse(QuerySearch.ReturnTimeBegin, out returnTimeBegin))
|
|
|
|
if (!DateTime.TryParse(QuerySearch.ETDBegin, out etaBegin))
|
|
|
|
throw Oops.Oh($"返场起始日期格式错误,{QuerySearch.ReturnTimeBegin}");
|
|
|
|
throw Oops.Oh($"ETA起始日期格式错误,{QuerySearch.ETDBegin}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.ReturnTimeEnd))
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.ETAEnd))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!DateTime.TryParse(QuerySearch.ReturnTimeEnd, out returnTimeEnd))
|
|
|
|
if (!DateTime.TryParse(QuerySearch.ETAEnd, out etaEnd))
|
|
|
|
throw Oops.Oh($"返场结束日期格式错误,{QuerySearch.ReturnTimeEnd}");
|
|
|
|
throw Oops.Oh($"ETA结束日期格式错误,{QuerySearch.ETAEnd}");
|
|
|
|
|
|
|
|
|
|
|
|
returnTimeEnd = returnTimeEnd.AddDays(1);
|
|
|
|
etaEnd = etaEnd.AddDays(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//要求到达时间
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.NeedArriveTimeBegin))
|
|
|
|
//定时
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.JOBBegin))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!DateTime.TryParse(QuerySearch.NeedArriveTimeBegin, out needArriveTimeBegin))
|
|
|
|
if (!DateTime.TryParse(QuerySearch.JOBBegin, out jobBegin))
|
|
|
|
throw Oops.Oh($"返场起始日期格式错误,{QuerySearch.NeedArriveTimeBegin}");
|
|
|
|
throw Oops.Oh($"返场起始日期格式错误,{QuerySearch.JOBBegin}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.NeedArriveTimeEnd))
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.JOBEnd))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!DateTime.TryParse(QuerySearch.NeedArriveTimeEnd, out needArriveTimeEnd))
|
|
|
|
if (!DateTime.TryParse(QuerySearch.JOBEnd, out jobEnd))
|
|
|
|
throw Oops.Oh($"返场结束日期格式错误,{QuerySearch.NeedArriveTimeEnd}");
|
|
|
|
throw Oops.Oh($"返场结束日期格式错误,{QuerySearch.JOBEnd}");
|
|
|
|
|
|
|
|
|
|
|
|
needArriveTimeEnd = needArriveTimeEnd.AddDays(1);
|
|
|
|
jobEnd = jobEnd.AddDays(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
@ -799,32 +789,28 @@ namespace Myshipping.Application.Service.BookingOrder
|
|
|
|
|
|
|
|
|
|
|
|
//这里因为返回给前端的台账数据是DTO,所以这里排序时候需要转换成Entity对应的字段
|
|
|
|
//这里因为返回给前端的台账数据是DTO,所以这里排序时候需要转换成Entity对应的字段
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.SortField))
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.SortField))
|
|
|
|
entityOrderCol = MapsterExtHelper.GetAdaptProperty<BookingTruckDto, BookingTruck>(QuerySearch.SortField);
|
|
|
|
entityOrderCol = MapsterExtHelper.GetAdaptProperty<BookingDeliveryRecordDto, BookingDeliveryRecord>(QuerySearch.SortField);
|
|
|
|
|
|
|
|
|
|
|
|
var entities = await _bookingTruckRepository.AsQueryable()
|
|
|
|
var entities = await _bookingDeliveryRecordRep.AsQueryable()
|
|
|
|
.WhereIF(createBegin != DateTime.MinValue, t => t.CreatedTime.HasValue && t.CreatedTime.Value >= createBegin)
|
|
|
|
.WhereIF(createBegin != DateTime.MinValue, t => t.CreatedTime.HasValue && t.CreatedTime.Value >= createBegin)
|
|
|
|
.WhereIF(createEnd != DateTime.MinValue, t => t.CreatedTime.HasValue && t.CreatedTime.Value < createEnd)
|
|
|
|
.WhereIF(createEnd != DateTime.MinValue, t => t.CreatedTime.HasValue && t.CreatedTime.Value < createEnd)
|
|
|
|
.WhereIF(truckDateBegin != DateTime.MinValue, t => t.TruckTime.HasValue && t.TruckTime.Value >= truckDateBegin)
|
|
|
|
.WhereIF(updateBegin != DateTime.MinValue, t => t.UpdatedTime.HasValue && t.UpdatedTime.Value >= updateBegin)
|
|
|
|
.WhereIF(truckDateEnd != DateTime.MinValue, t => t.TruckTime.HasValue && t.TruckTime.Value < truckDateEnd)
|
|
|
|
.WhereIF(updateEnd != DateTime.MinValue, t => t.UpdatedTime.HasValue && t.UpdatedTime.Value < updateEnd)
|
|
|
|
.WhereIF(closeDateBegin != DateTime.MinValue, t => t.ClosingTime.HasValue && t.ClosingTime.Value >= closeDateBegin)
|
|
|
|
.WhereIF(edepartureBegin != DateTime.MinValue, t => t.EARLIEST_DEPARTURE_DATE.HasValue && t.EARLIEST_DEPARTURE_DATE.Value >= edepartureBegin)
|
|
|
|
.WhereIF(closeDateEnd != DateTime.MinValue, t => t.ClosingTime.HasValue && t.ClosingTime.Value < closeDateEnd)
|
|
|
|
.WhereIF(edepartureEnd != DateTime.MinValue, t => t.EARLIEST_DEPARTURE_DATE.HasValue && t.EARLIEST_DEPARTURE_DATE.Value < edepartureEnd)
|
|
|
|
.WhereIF(pickUpTimeBegin != DateTime.MinValue, t => t.PickUpTime.HasValue && t.PickUpTime.Value >= pickUpTimeBegin)
|
|
|
|
.WhereIF(etdBegin != DateTime.MinValue, t => t.ETD.HasValue && t.ETD.Value >= etdBegin)
|
|
|
|
.WhereIF(pickUpTimeEnd != DateTime.MinValue, t => t.PickUpTime.HasValue && t.PickUpTime.Value < pickUpTimeEnd)
|
|
|
|
.WhereIF(etdEnd != DateTime.MinValue, t => t.ETD.HasValue && t.ETA.Value < etdEnd)
|
|
|
|
.WhereIF(returnTimeBegin != DateTime.MinValue, t => t.ReturnTime.HasValue && t.ReturnTime.Value >= returnTimeBegin)
|
|
|
|
.WhereIF(etaBegin != DateTime.MinValue, t => t.ETA.HasValue && t.ETA.Value >= etaBegin)
|
|
|
|
.WhereIF(returnTimeEnd != DateTime.MinValue, t => t.ReturnTime.HasValue && t.ReturnTime.Value < returnTimeEnd)
|
|
|
|
.WhereIF(etaEnd != DateTime.MinValue, t => t.ETA.HasValue && t.ETA.Value < etaEnd)
|
|
|
|
.WhereIF(needArriveTimeBegin != DateTime.MinValue, t => t.NeedArriveTime.HasValue && t.NeedArriveTime.Value >= needArriveTimeBegin)
|
|
|
|
.WhereIF(jobBegin != DateTime.MinValue, t => t.JOB_TIME.HasValue && t.JOB_TIME.Value >= jobBegin)
|
|
|
|
.WhereIF(needArriveTimeEnd != DateTime.MinValue, t => t.NeedArriveTime.HasValue && t.NeedArriveTime.Value < needArriveTimeEnd)
|
|
|
|
.WhereIF(jobEnd != DateTime.MinValue, t => t.JOB_TIME.HasValue && t.JOB_TIME.Value < jobEnd)
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.Yard), t => t.YARDID.Contains(QuerySearch.Yard) || t.YARD.Contains(QuerySearch.Yard))
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PriceReference), t => t.PRICE_REFERENCE.Contains(QuerySearch.PriceReference))
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.InYard), t => t.InYardID.Contains(QuerySearch.Yard) || t.InYard.Contains(QuerySearch.Yard))
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.BookedByCompanyName), t => t.BOOKEDBY_COMPANY_NAME.Contains(QuerySearch.BookedByCompanyName))
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.Status), t => t.Status == QuerySearch.Status)
|
|
|
|
|
|
|
|
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " asc " : " desc "))
|
|
|
|
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " asc " : " desc "))
|
|
|
|
.ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
|
|
|
|
.ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return entities.Adapt<SqlSugarPagedList<BookingTruckPageDto>>();
|
|
|
|
return entities.Adapt<SqlSugarPagedList<BookingDeliveryRecordPageDto>>();
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|