|
|
|
@ -1971,19 +1971,20 @@ namespace Myshipping.Application
|
|
|
|
|
var selectNum = generateModel.CtnList.Sum(x => x.CTNNUM);
|
|
|
|
|
var allNum = await _repCtn.AsQueryable().Where(x => x.SLOT_ID == generateModel.SlotId).SumAsync(x => x.CTNNUM);
|
|
|
|
|
bkModel.IsSplit = selectNum != allNum;
|
|
|
|
|
if (bkModel.IsSplit == true)
|
|
|
|
|
if (bkModel.IsSplit)
|
|
|
|
|
{
|
|
|
|
|
var sql = _repBookingOrder.AsQueryable().Where(" MBLNO like @mblno+'_' ", new { mblno = custNo }).ToSqlString();
|
|
|
|
|
var currentOrder = await _repBookingOrder.AsQueryable().Where(" MBLNO like @mblno+'_' ", new { mblno = custNo })
|
|
|
|
|
var sql = _repBookingOrder.AsQueryable().Where(" MBLNO like @mblno ", new { mblno = custNo + '_' }).OrderByDescending(x => x.Id).Select(x => x.MBLNO).ToSqlString();
|
|
|
|
|
var currentMblno = await _repBookingOrder.AsQueryable().Where(" MBLNO like @mblno ", new { mblno = custNo + '_' })
|
|
|
|
|
.OrderByDescending(x => x.Id)
|
|
|
|
|
.Select(x => x.MBLNO)
|
|
|
|
|
.FirstAsync();
|
|
|
|
|
if (currentOrder == null)
|
|
|
|
|
if (currentMblno == null)
|
|
|
|
|
{
|
|
|
|
|
bkModel.MBLNO = custNo + "A";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var lastLetter = currentOrder.MBLNO.Substring(currentOrder.MBLNO.Length - 1, 1)[0];
|
|
|
|
|
var lastLetter = currentMblno.Substring(currentMblno.Length - 1, 1)[0];
|
|
|
|
|
var newMblno = custNo + LetterIndexUtil.GetNextLetter(lastLetter);
|
|
|
|
|
bkModel.MBLNO = newMblno;
|
|
|
|
|
}
|
|
|
|
|