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