修改任务台

master
jianghaiqing 9 months ago
parent 9316b71be2
commit c62c84aee3

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

@ -8,5 +8,365 @@ namespace Myshipping.Application
{
public class BookingDeliveryRecordPageDto
{
/// <summary>
/// ID
/// </summary>
public long id { get; set; }
/// <summary>
/// 订舱ID
/// </summary>
public long bookingId { get; set; }
/// <summary>
/// 船公司代号
/// </summary>
public string carrierId { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string carrier { get; set; }
/// <summary>
/// 合约号
/// </summary>
public string priceReference { get; set; }
/// <summary>
/// 产品类型
/// </summary>
public string productCode { get; set; }
/// <summary>
/// 请求类别
/// </summary>
public string sender { get; set; }
/// <summary>
/// 订舱公司名称(英文全称)
/// </summary>
public string bookedByCompanyName { get; set; }
/// <summary>
/// 订舱公司代码
/// </summary>
public string bookedByCompanyPartyCode { get; set; }
/// <summary>
/// 订舱公司联系人名称
/// </summary>
public string bookedByCompanyContact { get; set; }
/// <summary>
/// 订舱公司联系人邮箱
/// </summary>
public string bookedByCompanyEmail { get; set; }
/// <summary>
/// 当前订舱公司是否也是合约方 1-标识合约信息跟订舱公司一致0-标识有单独的合约方
/// </summary>
public bool isbookingPartOwnPrice { get; set; }
/// <summary>
/// 价格所有者公司名称
/// </summary>
public string priceOwnerCompanyName { get; set; }
/// <summary>
/// 价格所有者代码
/// </summary>
public string priceOwnerCompanyPartyCode { get; set; }
/// <summary>
/// 价格所有者公司联系人名称
/// </summary>
public string priceOwnerCompanyContact { get; set; }
/// <summary>
/// 价格所有者公司联系人邮箱
/// </summary>
public string priceOwnerCompanyContactEmail { get; set; }
/// <summary>
/// 承运人代码
/// </summary>
public string carrierCode { get; set; }
/// <summary>
/// 最早起运日期
/// </summary>
public Nullable<DateTime> earliestDepartureDate { get; set; }
/// <summary>
/// 出口服务类型
/// </summary>
public string exportServiceMode { get; set; }
/// <summary>
/// 进口服务类型
/// </summary>
public string importServiceMode { get; set; }
/// <summary>
/// 收货地城市英文名称
/// </summary>
public string placeReceiptCity { get; set; }
/// <summary>
/// 收货地UN地点代码
/// </summary>
public string placeReceiptUnlocCode { get; set; }
/// <summary>
/// 收货地代码
/// </summary>
public string placeReceiptId { get; set; }
/// <summary>
/// 收货地
/// </summary>
public string placeReceipt { get; set; }
/// <summary>
/// 交货地城市英文名称
/// </summary>
public string placeDeliveryCity { get; set; }
/// <summary>
/// 交货地UN地点代码
/// </summary>
public string placeDeliveryUnlocCode { get; set; }
/// <summary>
/// 预计开船日期
/// </summary>
public Nullable<DateTime> etd { get; set; }
/// <summary>
/// 预计到港日期
/// </summary>
public Nullable<DateTime> atd { get; set; }
/// <summary>
/// 船名
/// </summary>
public string vessel { get; set; }
/// <summary>
/// 船名代码
/// </summary>
public string vesselCode { get; set; }
/// <summary>
/// 航次号
/// </summary>
public string voyno { get; set; }
/// <summary>
/// 运输方式
/// </summary>
public string transportMode { get; set; }
/// <summary>
/// 重量
/// </summary>
public Nullable<int> totalCargoWeight { get; set; }
/// <summary>
/// 是否冷冻处理 1-是0-否
/// </summary>
public bool isReefer { get; set; }
/// <summary>
/// 温度探头的数量
/// </summary>
public Nullable<int> noOfProbes { get; set; }
/// <summary>
/// 设置温度
/// </summary>
public string tempSet { get; set; }
/// <summary>
/// 温度单位
/// </summary>
public string tempId { get; set; }
/// <summary>
/// 通风度
/// </summary>
public Nullable<int> vent { get; set; }
/// <summary>
/// 湿度
/// </summary>
public Nullable<int> humidity { get; set; }
/// <summary>
/// 货物标识
/// </summary>
public string cargoId { get; set; }
/// <summary>
/// 货物代码类型
/// </summary>
public string commodityCodeType { get; set; }
/// <summary>
/// 品名代码
/// </summary>
public string goodsCode { get; set; }
/// <summary>
/// 品名
/// </summary>
public string goodsName { get; set; }
/// <summary>
/// 货物类型
/// </summary>
public string cargoType { get; set; }
/// <summary>
/// 交货地代码
/// </summary>
public string placeDeliveryId { 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 laneCode { get; set; }
/// <summary>
/// 航线名称(船公司)
/// </summary>
public string laneName { get; set; }
/// <summary>
/// 承运方式 DIRECT_SHIP-直达TRANSFER_SHIP-中转
/// </summary>
public string carriageType { get; set; }
/// <summary>
/// 承运方式名称 CONTRACT_ORDER-合约订舱SPOT_ORDER-SPOT订舱
/// </summary>
public string carriageTypeName { 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>
/// 签单方式 ORIGINAL-正本TELEX-电放SEAWAY BILL-海运单;
/// </summary>
public string issueType { get; set; }
/// <summary>
/// 箱型箱量
/// </summary>
public string ctnStat { get; set; }
/// <summary>
/// 所在周数
/// </summary>
public string weekAt { get; set; }
/// <summary>
/// 危险品类别
/// </summary>
public string dClass { get; set; }
/// <summary>
/// 危险品编号
/// </summary>
public string duNo { get; set; }
/// <summary>
/// 危险品页号
/// </summary>
public string dPage { get; set; }
/// <summary>
/// 危险品标签
/// </summary>
public string dLabel { get; set; }
/// <summary>
/// 危险品联系人
/// </summary>
public string linkMan { get; set; }
/// <summary>
/// 预计运输天数
/// </summary>
public Nullable<int> transportEstDay { get; set; }
/// <summary>
/// 订舱回执ID
/// </summary>
public string requestAcknowledgementId { get; set; }
/// <summary>
/// 订舱回执预定号
/// </summary>
public string bookingReference { get; set; }
/// <summary>
/// 状态 SUCC-成功FAILURE-失败
/// </summary>
public string status { get; set; }
/// <summary>
/// 发送备注
/// </summary>
public string notes { get; set; }
/// <summary>
/// 发送时间
/// </summary>
public Nullable<DateTime> sendTime { get; set; }
/// <summary>
/// 是否定时任务
/// </summary>
public bool isJob { get; set; }
/// <summary>
/// 定时时间
/// </summary>
public Nullable<DateTime> jobTime { get; set; }
}
}

@ -6,7 +6,131 @@ using System.Threading.Tasks;
namespace Myshipping.Application
{
public class QueryBookingDeliveryRecordDto
public class QueryBookingDeliveryRecordDto: QueryTaskManageBaseDto
{
/// <summary>
/// 创建日期起始
/// </summary>
/// <example></example>
public string CreateBegin { get; set; }
/// <summary>
/// 创建日期结束
/// </summary>
/// <example></example>
public string CreateEnd { get; set; }
/// <summary>
/// 更新日期起始
/// </summary>
/// <example></example>
public string UpdateBegin { get; set; }
/// <summary>
/// 更新日期结束
/// </summary>
/// <example></example>
public string UpdateEnd { get; set; }
/// <summary>
/// ETD日期起始
/// </summary>
/// <example></example>
public string ETDBegin { get; set; }
/// <summary>
/// ETD日期结束
/// </summary>
/// <example></example>
public string ETDEnd { get; set; }
/// <summary>
/// ETA日期起始
/// </summary>
/// <example></example>
public string ETABegin { get; set; }
/// <summary>
/// ETA日期结束
/// </summary>
/// <example></example>
public string ETAEnd { get; set; }
/// <summary>
/// 定时日期起始
/// </summary>
/// <example></example>
public string JOBBegin { get; set; }
/// <summary>
/// 定时日期结束
/// </summary>
/// <example></example>
public string JOBEnd { get; set; }
/// <summary>
/// 预计离港日期起始
/// </summary>
/// <example></example>
public string EDepartureBegin { get; set; }
/// <summary>
/// 预计离港日期结束
/// </summary>
/// <example></example>
public string EDepartureEnd { get; set; }
/// <summary>
/// 合约号
/// </summary>
public string PriceReference { get; set; }
/// <summary>
/// 订舱公司名称(英文全称)
/// </summary>
public string BookedByCompanyName { get; set; }
/// <summary>
/// 订舱公司代码
/// </summary>
public string BookedByCompanyPartyCode { get; set; }
/// <summary>
/// 船名
/// </summary>
public string Vessel { get; set; }
/// <summary>
/// 航次号
/// </summary>
public string Voyno { get; set; }
/// <summary>
/// 是否冷冻处理 1-是0-否
/// </summary>
public bool isReefer { get; set; }
/// <summary>
/// 货物代码类型
/// </summary>
public string CommodityCodeType { get; set; }
/// <summary>
/// 当前订舱公司是否也是合约方 true-标识合约信息跟订舱公司一致false-标识有单独的合约方
/// </summary>
public bool IsbookingPartOwnPrice { get; set; }
/// <summary>
/// 价格所有者公司名称
/// </summary>
public string PriceOwnerCompanyName { get; set; }
/// <summary>
/// 价格所有者代码
/// </summary>
public string PriceOwnerCompanyPartyCode { get; set; }
}
}

Loading…
Cancel
Save