|
|
@ -13542,5 +13542,92 @@ namespace Myshipping.Application
|
|
|
|
return rlt;
|
|
|
|
return rlt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 检索订单信息
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 检索订单信息(如果当前为拆、合票,内包含分票信息)
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="mblNo">提单号</param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
public async Task<SeaExportOrderExtension> SearchOrderInfo(string mblNo)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SeaExportOrderExtension model = new SeaExportOrderExtension();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
1、先用主提单号检索,如果没有取到结果,再用订舱编号检索。
|
|
|
|
|
|
|
|
2、是拆票的,找到主票和其他分票,并返回当前订单的完整详情。
|
|
|
|
|
|
|
|
3、是合票的,找到主票和其他分票,并返回当前订单的完整详情。
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
var orderList = await _rep.AsQueryable().Filter(null, true)
|
|
|
|
|
|
|
|
.Where(a => (a.MBLNO == mblNo || a.CUSTNO == mblNo) && a.IsDeleted == false).ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var currOrder = orderList.FirstOrDefault(a => a.MBLNO == mblNo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (currOrder != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
model.currOrder = currOrder.Adapt<BookingOrderDto>();
|
|
|
|
|
|
|
|
model.splitOrMergeFlag = currOrder.SPLIT_OR_MERGE_FLAG.HasValue ? currOrder.SPLIT_OR_MERGE_FLAG.Value : 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!currOrder.SPLIT_OR_MERGE_FLAG.HasValue || (currOrder.SPLIT_OR_MERGE_FLAG.HasValue && currOrder.SPLIT_OR_MERGE_FLAG.Value > 0))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//拆票
|
|
|
|
|
|
|
|
if (currOrder.SPLIT_OR_MERGE_FLAG.Value == 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//如果分单号和订舱编号不一致表示分票已经改成正式的提单号
|
|
|
|
|
|
|
|
if (!currOrder.HBLNO.Equals(currOrder.CUSTNO))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
model.finalMBLNo = currOrder.HBLNO;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model.orderNo = currOrder.CUSTNO;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//找到所有相关的分票
|
|
|
|
|
|
|
|
var list = await _rep.AsQueryable().Filter(null, true)
|
|
|
|
|
|
|
|
.Where(a => a.CUSTNO == mblNo && a.IsDeleted == false && a.Id != currOrder.Id).ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model.otherOrderList = list.Select(b => new SeaExportOrderExtensionSubInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Id = b.Id,
|
|
|
|
|
|
|
|
OrderNo = b.CUSTNO,
|
|
|
|
|
|
|
|
MBLNO = b.MBLNO,
|
|
|
|
|
|
|
|
HBLNO = b.HBLNO
|
|
|
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (currOrder.SPLIT_OR_MERGE_FLAG.Value == 2)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//合票
|
|
|
|
|
|
|
|
if (currOrder.CUSTNO.Equals(currOrder.HBLNO))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//如果订舱编号和分单号一致,表示当前为主合票信息
|
|
|
|
|
|
|
|
model.isMaster = true;
|
|
|
|
|
|
|
|
model.masterId = currOrder.Id;
|
|
|
|
|
|
|
|
model.orderNo = currOrder.MBLNO;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//找到所有相关的分票
|
|
|
|
|
|
|
|
var list = await _rep.AsQueryable().Filter(null, true)
|
|
|
|
|
|
|
|
.Where(a => a.HBLNO == currOrder.HBLNO && a.IsDeleted == false && a.Id != currOrder.Id).ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model.otherOrderList = list.Select(b => new SeaExportOrderExtensionSubInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Id = b.Id,
|
|
|
|
|
|
|
|
OrderNo = b.CUSTNO,
|
|
|
|
|
|
|
|
MBLNO = b.MBLNO,
|
|
|
|
|
|
|
|
HBLNO = b.HBLNO
|
|
|
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var masterOrder = model.otherOrderList.FirstOrDefault(x => x.OrderNo == x.HBLNO);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (masterOrder != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
model.masterId = masterOrder.Id;
|
|
|
|
|
|
|
|
model.orderNo = masterOrder.OrderNo;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return model;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|