|
|
@ -2732,11 +2732,13 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
|
|
// 判断是否为拆票的舱位,如果为拆票,提单号需要加上ABCD...
|
|
|
|
// 判断是否为拆票的舱位,如果为拆票,提单号需要加上ABCD...
|
|
|
|
var selectNum = generateModel.CtnList.Sum(x => x.CTNNUM);
|
|
|
|
var selectNum = generateModel.CtnList.Sum(x => x.CTNNUM);
|
|
|
|
|
|
|
|
_logger.LogInformation("根据舱位生成订舱,selectNum:{selectNum}", selectNum);
|
|
|
|
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);
|
|
|
|
|
|
|
|
_logger.LogInformation("根据舱位生成订舱,allNum:{allNum}", allNum);
|
|
|
|
bkModel.IsSplit = selectNum != allNum;
|
|
|
|
bkModel.IsSplit = selectNum != allNum;
|
|
|
|
if (bkModel.IsSplit)
|
|
|
|
if (bkModel.IsSplit)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var sql = _repBookingOrder.AsQueryable().Where(" MBLNO like @mblno ", new { mblno = custNo + '_' }).OrderByDescending(x => x.Id).Select(x => x.MBLNO).ToSqlString();
|
|
|
|
//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 + '_' })
|
|
|
|
var currentMblno = await _repBookingOrder.AsQueryable().Where(" MBLNO like @mblno ", new { mblno = custNo + '_' })
|
|
|
|
.OrderByDescending(x => x.Id)
|
|
|
|
.OrderByDescending(x => x.Id)
|
|
|
|
.Select(x => x.MBLNO)
|
|
|
|
.Select(x => x.MBLNO)
|
|
|
@ -2752,6 +2754,7 @@ namespace Myshipping.Application
|
|
|
|
bkModel.MBLNO = newMblno;
|
|
|
|
bkModel.MBLNO = newMblno;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_logger.LogInformation("根据舱位生成订舱,得到MBLNO:{MBLNO}", bkModel.MBLNO);
|
|
|
|
|
|
|
|
|
|
|
|
var ctnCodeList = _cache.GetAllCodeCtn().GetAwaiter().GetResult().ToList();
|
|
|
|
var ctnCodeList = _cache.GetAllCodeCtn().GetAwaiter().GetResult().ToList();
|
|
|
|
|
|
|
|
|
|
|
@ -2784,7 +2787,10 @@ namespace Myshipping.Application
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var bookingOrderService = _namedBookingOrderServiceProvider.GetService<ITransient>(nameof(BookingOrderService));
|
|
|
|
var bookingOrderService = _namedBookingOrderServiceProvider.GetService<ITransient>(nameof(BookingOrderService));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("根据舱位生成订舱,开始调用Save保存订舱");
|
|
|
|
var bkRlt = await bookingOrderService.Save(bkModel);
|
|
|
|
var bkRlt = await bookingOrderService.Save(bkModel);
|
|
|
|
|
|
|
|
_logger.LogInformation("根据舱位生成订舱,调用Save保存订舱完成,id:{id}", bkRlt.Id);
|
|
|
|
|
|
|
|
|
|
|
|
id = bkRlt.Id;
|
|
|
|
id = bkRlt.Id;
|
|
|
|
|
|
|
|
|
|
|
@ -2794,6 +2800,7 @@ namespace Myshipping.Application
|
|
|
|
{
|
|
|
|
{
|
|
|
|
////对应订舱和舱位关系
|
|
|
|
////对应订舱和舱位关系
|
|
|
|
var allocRlt = await ImportSlots(importSlots, id, false, generateModel);
|
|
|
|
var allocRlt = await ImportSlots(importSlots, id, false, generateModel);
|
|
|
|
|
|
|
|
_logger.LogInformation("根据舱位生成订舱,引入订舱关系完成");
|
|
|
|
|
|
|
|
|
|
|
|
//这里如果指定了委托单位的邮件联系人,则推送订舱联系人
|
|
|
|
//这里如果指定了委托单位的邮件联系人,则推送订舱联系人
|
|
|
|
if (generateModel.CustomerContactList != null && generateModel.CustomerContactList.Count > 0)
|
|
|
|
if (generateModel.CustomerContactList != null && generateModel.CustomerContactList.Count > 0)
|
|
|
|