|
|
|
@ -1099,12 +1099,16 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
#region 舱位引入
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询可用的舱位及箱子
|
|
|
|
|
/// 分页查询可用的舱位及箱子列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="input">可选:舱位查询条件</param>
|
|
|
|
|
/// <param name="pageInfo">可选:分页信息</param>
|
|
|
|
|
[HttpGet("/BookingSlot/getAvailableSlots")]
|
|
|
|
|
public async Task<SqlSugarPagedList<BookingSlotBaseWithCtnDto>> GetAvailableSlots([FromQuery] BookingSlotBaseDto input, [FromQuery] PageWithTotal pageInfo)
|
|
|
|
|
public async Task<SqlSugarPagedList<BookingSlotBaseWithCtnDto>> GetAvailableSlots([FromQuery] BookingSlotBaseDto input,
|
|
|
|
|
[FromQuery] PageWithTotal pageInfo)
|
|
|
|
|
{
|
|
|
|
|
var result = await GetAvailableSlots(input, null, pageInfo);
|
|
|
|
|
|
|
|
|
|
SqlSugarPagedList<BookingSlotBaseWithCtnDto> pageResult = new()
|
|
|
|
|
{
|
|
|
|
|
PageIndex = pageInfo.PageNo,
|
|
|
|
@ -1163,6 +1167,7 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
// 2. 【已引入舱位表】与【已使用的箱子表】做关联,并根据【舱位主键】、【箱型】做分组,统计出【已使用的箱量】,作为queryable2
|
|
|
|
|
var queryable2 = _repBase.Context.Queryable<BookingSlotAllocation, BookingSlotAllocationCtn>((alc, ctn) => alc.Id == ctn.SLOT_ALLOC_ID)
|
|
|
|
|
.WhereIF(slotIdListInput.Any(), (alc, ctn) => slotIdListInput.Contains(alc.BOOKING_SLOT_ID))
|
|
|
|
|
.GroupBy((alc, ctn) => new
|
|
|
|
|
{
|
|
|
|
|
alc.BOOKING_SLOT_ID,
|
|
|
|
@ -1225,6 +1230,78 @@ namespace Myshipping.Application
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询指定舱位可用的箱子列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="slotId">舱位主键</param>
|
|
|
|
|
/// <returns>可用的箱子列表</returns>
|
|
|
|
|
[HttpGet("/BookingSlot/getAvailableCtnsBySlot")]
|
|
|
|
|
public async Task<List<BookingSlotCtnDto>> GetAvailableCtnsBySlot(long slotId)
|
|
|
|
|
{
|
|
|
|
|
if (await _repBase.IsExistsAsync(x => x.Id == slotId && x.IS_CANCELLATION == false) == false)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Oh($"获取舱位失败,舱位不存在或已作废");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 1. 【舱位基础表】与【箱子表】做关联,并根据【舱位主键】、【箱型】做分组,统计出【总的箱量】,作为queryable1
|
|
|
|
|
var queryable1 = _repBase.Context.Queryable<BookingSlotBase, BookingSlotCtn>((bas, ctn) => bas.Id == ctn.SLOT_ID)
|
|
|
|
|
.Where(bas => bas.IS_CANCELLATION == false && bas.Id == slotId)
|
|
|
|
|
.GroupBy((bas, ctn) => new
|
|
|
|
|
{
|
|
|
|
|
bas.Id,
|
|
|
|
|
ctn.CTNCODE
|
|
|
|
|
})
|
|
|
|
|
.Select((bas, ctn) => new
|
|
|
|
|
{
|
|
|
|
|
id = bas.Id,
|
|
|
|
|
ctnCode = ctn.CTNCODE,
|
|
|
|
|
numAll = SqlFunc.AggregateSum(ctn.CTNNUM)
|
|
|
|
|
})
|
|
|
|
|
.MergeTable();
|
|
|
|
|
|
|
|
|
|
// 2. 【已引入舱位表】与【已使用的箱子表】做关联,并根据【舱位主键】、【箱型】做分组,统计出【已使用的箱量】,作为queryable2
|
|
|
|
|
var queryable2 = _repBase.Context.Queryable<BookingSlotAllocation, BookingSlotAllocationCtn>((alc, ctn) => alc.Id == ctn.SLOT_ALLOC_ID)
|
|
|
|
|
.Where((alc, ctn) => alc.BOOKING_SLOT_ID == slotId)
|
|
|
|
|
.GroupBy((alc, ctn) => new
|
|
|
|
|
{
|
|
|
|
|
alc.BOOKING_SLOT_ID,
|
|
|
|
|
ctn.CTNCODE
|
|
|
|
|
})
|
|
|
|
|
.Select((alc, ctn) => new
|
|
|
|
|
{
|
|
|
|
|
id = alc.BOOKING_SLOT_ID,
|
|
|
|
|
ctnCode = ctn.CTNCODE,
|
|
|
|
|
numUse = SqlFunc.AggregateSum(ctn.CTNNUM)
|
|
|
|
|
})
|
|
|
|
|
.MergeTable();
|
|
|
|
|
|
|
|
|
|
// 3. 将queryable1 左连接 queryable2,使用【总的箱量】减去【已使用的箱量】,得到【剩余的箱量】,添加【剩余的箱量】> 0 的条件,作为queryable3
|
|
|
|
|
var queryable3 = queryable1.LeftJoin(queryable2, (q1, q2) => q1.id == q2.id && q1.ctnCode == q2.ctnCode)
|
|
|
|
|
.Select((q1, q2) => new
|
|
|
|
|
{
|
|
|
|
|
q1.id,
|
|
|
|
|
q1.ctnCode,
|
|
|
|
|
numResidue = SqlFunc.IsNull(q1.numAll - q2.numUse, q1.numAll)
|
|
|
|
|
})
|
|
|
|
|
.MergeTable()
|
|
|
|
|
.Where(r => r.numResidue > 0);
|
|
|
|
|
|
|
|
|
|
// 4. 执行ToList(),得到可用的【舱位主键】、【箱型】、【箱量】列表
|
|
|
|
|
var canUselist = await queryable3.ToListAsync();
|
|
|
|
|
|
|
|
|
|
List<Core.Entity.CodeCtn> ctnCodeCache = await _cache.GetAllCodeCtn();
|
|
|
|
|
|
|
|
|
|
List<BookingSlotCtnDto> result = canUselist.Select(c => new BookingSlotCtnDto()
|
|
|
|
|
{
|
|
|
|
|
CTNCODE = c.ctnCode,
|
|
|
|
|
CTNNUM = c.numResidue,
|
|
|
|
|
CTNALL = ctnCodeCache.FirstOrDefault(e => e.Code == c.ctnCode)?.Name ?? throw new Exception($"舱位信息中存在未收录的箱型:{c.ctnCode},需要在箱型字典中补充"),
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 检查指定订舱记录,是否可以引入舱位列表
|
|
|
|
|
/// </summary>
|
|
|
|
@ -1281,9 +1358,13 @@ namespace Myshipping.Application
|
|
|
|
|
/// <param name="slots">待引入的舱位列表</param>
|
|
|
|
|
/// <param name="bookingOrderId">待关联的订舱记录</param>
|
|
|
|
|
/// <param name="isCheck">是否进行剩余量检查</param>
|
|
|
|
|
/// <param name="generateModel">额外的用于生成管理记录的信息</param>
|
|
|
|
|
/// <returns>isSuccess:检查(余量及已引用检查)是否成功通过,message:提示信息</returns>
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<(bool isSuccess, string message)> ImportSlots(List<BookingSlotBaseWithCtnDto> slots, long bookingOrderId, bool isCheck)
|
|
|
|
|
public async Task<(bool isSuccess, string message)> ImportSlots(List<BookingSlotBaseWithCtnDto> slots,
|
|
|
|
|
long bookingOrderId,
|
|
|
|
|
bool isCheck,
|
|
|
|
|
BookingGenerateDto generateModel = null)
|
|
|
|
|
{
|
|
|
|
|
slots ??= new List<BookingSlotBaseWithCtnDto>();
|
|
|
|
|
|
|
|
|
@ -1304,6 +1385,7 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
var latestSlot = latestSlotList.First(b => b.Id == inSlotItem.Id);
|
|
|
|
|
|
|
|
|
|
// 保存关联信息
|
|
|
|
|
var config = new TypeAdapterConfig();
|
|
|
|
|
config.ForType<BookingSlotBase, BookingSlotAllocation>()
|
|
|
|
|
.Ignore(dest => dest.CreatedTime)
|
|
|
|
@ -1321,8 +1403,24 @@ namespace Myshipping.Application
|
|
|
|
|
newSlotAllocation.BOOKING_ID = bookingOrderId;
|
|
|
|
|
newSlotAllocation.ALLO_BILL_NO = latestSlot.SLOT_BOOKING_NO;
|
|
|
|
|
newSlotAllocation.FINAL_BILL_NO = latestSlot.SLOT_BOOKING_NO;
|
|
|
|
|
|
|
|
|
|
if (generateModel != null)
|
|
|
|
|
{
|
|
|
|
|
newSlotAllocation.CUSTOMERID = generateModel.CustomerId;
|
|
|
|
|
newSlotAllocation.CUSTOMERNAME = generateModel.CustomerName;
|
|
|
|
|
newSlotAllocation.CUSTSERVICEID = generateModel.CustServiceId?.ToString();
|
|
|
|
|
newSlotAllocation.CUSTSERVICE = generateModel.CustServiceName;
|
|
|
|
|
newSlotAllocation.SALEID = generateModel.SaleId?.ToString();
|
|
|
|
|
newSlotAllocation.SALE = generateModel.SaleName;
|
|
|
|
|
newSlotAllocation.SALE_TIME = generateModel.SALE_TIME;
|
|
|
|
|
newSlotAllocation.SHIPPER = generateModel.SHIPPER;
|
|
|
|
|
newSlotAllocation.GOODSNAME = generateModel.GOODSNAME;
|
|
|
|
|
newSlotAllocation.SELLING_PRICE = generateModel.SELLING_PRICE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await _repAllocation.InsertAsync(newSlotAllocation);
|
|
|
|
|
|
|
|
|
|
// 保存关联的箱信息
|
|
|
|
|
var insertCtnList = inSlotItem.CtnList.Select(c => new BookingSlotAllocationCtn()
|
|
|
|
|
{
|
|
|
|
|
SLOT_ALLOC_ID = newSlotAllocation.Id,
|
|
|
|
@ -1332,6 +1430,18 @@ namespace Myshipping.Application
|
|
|
|
|
});
|
|
|
|
|
await _repAllocationCtn.InsertAsync(insertCtnList);
|
|
|
|
|
|
|
|
|
|
// 为订舱保存附件信息
|
|
|
|
|
var lastestBcFile = await _bookingfile.Where(x => (x.TypeCode == "bc" || x.TypeCode == "bc_notice") && x.BookingId == latestSlot.Id)
|
|
|
|
|
.OrderByDescending(x => x.Id)
|
|
|
|
|
.FirstAsync();
|
|
|
|
|
if (lastestBcFile != null)
|
|
|
|
|
{
|
|
|
|
|
var file = lastestBcFile.Adapt<BookingFile>();
|
|
|
|
|
file.Id = 0;
|
|
|
|
|
file.BookingId = bookingOrderId;
|
|
|
|
|
await _bookingfile.InsertAsync(file);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 更新库存
|
|
|
|
|
await _publisher.PublishAsync(new ChannelEventSource("BookingSlotStock:Update", new Event.BookingSlotStockUpdateModel
|
|
|
|
|
{
|
|
|
|
@ -1431,7 +1541,7 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
//var sql = select.OrderByDescending(u => u.CreatedTime).ToSqlString();
|
|
|
|
|
|
|
|
|
|
var entities = await select.OrderByDescending(u => u.CreatedTime)
|
|
|
|
|
var entities = await select.OrderByDescending(u => u.Id)
|
|
|
|
|
.ToPagedListAsync(input.PageNo, input.PageSize);
|
|
|
|
|
|
|
|
|
|
var result = entities.Adapt<SqlSugarPagedList<BookingSlotBaseListOutput>>();
|
|
|
|
@ -1779,19 +1889,19 @@ namespace Myshipping.Application
|
|
|
|
|
throw Oops.Oh($"舱位信息不存在或已作废");
|
|
|
|
|
|
|
|
|
|
// 判断是否已存在引用关系
|
|
|
|
|
if (_repAllocation.IsExists(a => a.BOOKING_SLOT_ID == slotInfo.Id
|
|
|
|
|
&& a.BOOKING_ID > 0 && a.IsDeleted == false))
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Oh($"舱位已有对应的订舱订单,不能重复执行");
|
|
|
|
|
}
|
|
|
|
|
//if (_repAllocation.IsExists(a => a.BOOKING_SLOT_ID == slotInfo.Id
|
|
|
|
|
// && a.BOOKING_ID > 0 && a.IsDeleted == false))
|
|
|
|
|
//{
|
|
|
|
|
// throw Oops.Oh($"舱位已有对应的订舱订单,不能重复执行");
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
var ctnList = _repCtn.AsQueryable().Where(a => a.SLOT_ID == slotInfo.Id && a.IsDeleted == false)
|
|
|
|
|
.ToList();
|
|
|
|
|
//var ctnList = _repCtn.AsQueryable().Where(a => a.SLOT_ID == slotInfo.Id && a.IsDeleted == false)
|
|
|
|
|
// .ToList();
|
|
|
|
|
|
|
|
|
|
var fileList = await _bookingfile.AsQueryable().Filter(null, true)
|
|
|
|
|
.Where(u => u.BookingId == slotInfo.Id && u.Moudle == "BookingSlot").ToListAsync();
|
|
|
|
|
|
|
|
|
|
var bookingOrderId = await GenerateBookingOrder(slotInfo, ctnList, fileList, model);
|
|
|
|
|
var bookingOrderId = await GenerateBookingOrder(slotInfo, fileList, model);
|
|
|
|
|
|
|
|
|
|
result.succ = true;
|
|
|
|
|
result.msg = "成功";
|
|
|
|
@ -1806,11 +1916,10 @@ namespace Myshipping.Application
|
|
|
|
|
/// 生成订舱
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="bookingSlotBase">舱位详情</param>
|
|
|
|
|
/// <param name="bookingSlotCtnList">舱位集装箱列表</param>
|
|
|
|
|
/// <param name="bookingSlotFileList">舱位附件列表</param>
|
|
|
|
|
/// <param name="generateModel">订舱请求详情</param>
|
|
|
|
|
/// <returns>返回订舱ID</returns>
|
|
|
|
|
private async Task<long> GenerateBookingOrder(BookingSlotBase bookingSlotBase, List<BookingSlotCtn> bookingSlotCtnList,
|
|
|
|
|
private async Task<long> GenerateBookingOrder(BookingSlotBase bookingSlotBase,
|
|
|
|
|
List<BookingFile> bookingSlotFileList,
|
|
|
|
|
BookingGenerateDto generateModel)
|
|
|
|
|
{
|
|
|
|
@ -1829,13 +1938,16 @@ namespace Myshipping.Application
|
|
|
|
|
|| t.EnName.Equals(bookingSlotBase.CARRIERID, StringComparison.OrdinalIgnoreCase)
|
|
|
|
|
|| t.CnName.Equals(bookingSlotBase.CARRIERID, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
var custNo = bookingSlotBase.SLOT_BOOKING_NO.Trim();
|
|
|
|
|
|
|
|
|
|
SaveBookingOrderInput bkModel = new SaveBookingOrderInput
|
|
|
|
|
{
|
|
|
|
|
CUSTOMERID = generateModel.CustomerId,
|
|
|
|
|
CUSTOMERNAME = generateModel.CustomerName,
|
|
|
|
|
CARRIERID = carrierInfo.Code?.Trim(),
|
|
|
|
|
CARRIER = carrierInfo.CnName?.Trim(),
|
|
|
|
|
MBLNO = bookingSlotBase.SLOT_BOOKING_NO.Trim(),
|
|
|
|
|
CUSTNO = custNo,
|
|
|
|
|
//MBLNO = bookingSlotBase.SLOT_BOOKING_NO.Trim(),
|
|
|
|
|
CONTRACTNO = !string.IsNullOrWhiteSpace(bookingSlotBase.CONTRACT_NO) ? bookingSlotBase.CONTRACT_NO : "",
|
|
|
|
|
VESSEL = bookingSlotBase.VESSEL.ToUpper().Trim(),
|
|
|
|
|
VOYNO = bookingSlotBase.VOYNO.ToUpper().Trim(),
|
|
|
|
@ -1862,11 +1974,33 @@ namespace Myshipping.Application
|
|
|
|
|
ctnInputs = new List<BookingCtnDto>()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 判断是否为拆票的舱位,如果为拆票,提单号需要加上ABCD...
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
var sql = _repBookingOrder.AsQueryable().Where(" MBLNO like @mblno+'_' ", new { mblno = custNo }).ToSqlString();
|
|
|
|
|
var currentOrder = await _repBookingOrder.AsQueryable().Where(" MBLNO like @mblno+'_' ", new { mblno = custNo })
|
|
|
|
|
.OrderByDescending(x => x.Id)
|
|
|
|
|
.FirstAsync();
|
|
|
|
|
if (currentOrder == null)
|
|
|
|
|
{
|
|
|
|
|
bkModel.MBLNO = custNo + "A";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var lastLetter = currentOrder.MBLNO.Substring(currentOrder.MBLNO.Length - 1, 1)[0];
|
|
|
|
|
var newMblno = custNo + LetterIndexUtil.GetNextLetter(lastLetter);
|
|
|
|
|
bkModel.MBLNO = newMblno;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var ctnCodeList = _cache.GetAllCodeCtn().GetAwaiter().GetResult().ToList();
|
|
|
|
|
|
|
|
|
|
if (bookingSlotCtnList.Count > 0)
|
|
|
|
|
if (generateModel.CtnList != null && generateModel.CtnList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
bookingSlotCtnList.ForEach(t =>
|
|
|
|
|
generateModel.CtnList.ForEach(t =>
|
|
|
|
|
{
|
|
|
|
|
var ctnCode = ctnCodeList.FirstOrDefault(a => !string.IsNullOrWhiteSpace(a.Name) &&
|
|
|
|
|
a.Name.Equals(t.CTNALL, StringComparison.OrdinalIgnoreCase));
|
|
|
|
@ -1882,6 +2016,16 @@ namespace Myshipping.Application
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 验证舱位是否可用
|
|
|
|
|
var slotInfo = bookingSlotBase.Adapt<BookingSlotBaseWithCtnDto>();
|
|
|
|
|
slotInfo.CtnList = generateModel.CtnList;
|
|
|
|
|
var importSlots = new List<BookingSlotBaseWithCtnDto>() { slotInfo };
|
|
|
|
|
var checkResult = await CheckImportSlots(importSlots, 0);
|
|
|
|
|
if (!checkResult.isEnough)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Oh(checkResult.message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var bookingOrderService = _namedBookingOrderServiceProvider.GetService<ITransient>(nameof(BookingOrderService));
|
|
|
|
|
var bkRlt = await bookingOrderService.Save(bkModel);
|
|
|
|
|
|
|
|
|
@ -1891,19 +2035,8 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
if (id > 0)
|
|
|
|
|
{
|
|
|
|
|
List<BookingSlotBaseWithCtnDto> slots = new List<BookingSlotBaseWithCtnDto>();
|
|
|
|
|
|
|
|
|
|
//检索舱位信息
|
|
|
|
|
var slotInfo = Detail(bookingSlotBase.Id).GetAwaiter().GetResult();
|
|
|
|
|
|
|
|
|
|
BookingSlotBaseWithCtnDto baseInfo = slotInfo.Adapt<BookingSlotBaseWithCtnDto>();
|
|
|
|
|
baseInfo.Id = bookingSlotBase.Id;
|
|
|
|
|
baseInfo.CtnList = slotInfo.CtnList.Adapt<List<BookingSlotCtnDto>>();
|
|
|
|
|
|
|
|
|
|
slots.Add(baseInfo);
|
|
|
|
|
|
|
|
|
|
//对应订舱和舱位关系
|
|
|
|
|
var allocRlt = await ImportSlots(slots, id, false);
|
|
|
|
|
////对应订舱和舱位关系
|
|
|
|
|
var allocRlt = await ImportSlots(importSlots, id, false, generateModel);
|
|
|
|
|
|
|
|
|
|
//这里如果指定了委托单位的邮件联系人,则推送订舱联系人
|
|
|
|
|
if (generateModel.CustomerContactList != null && generateModel.CustomerContactList.Count > 0)
|
|
|
|
@ -2034,6 +2167,7 @@ namespace Myshipping.Application
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError($"MBLNO:{bookingSlotBase.SLOT_BOOKING_NO} 生成订舱订单异常,原因:{ex.Message}");
|
|
|
|
|
throw;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2116,27 +2250,23 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 校验是否可以生成订舱订单
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">舱位主键</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/BookingSlot/ValidateCreateBookingOrder")]
|
|
|
|
|
public async Task<TaskManageOrderResultDto> ValidateCreateBookingOrder(long id)
|
|
|
|
|
{
|
|
|
|
|
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
|
|
|
|
|
|
|
|
|
|
var slotInfo = await _repBase.AsQueryable().FirstAsync(a => a.Id == id);
|
|
|
|
|
|
|
|
|
|
if (slotInfo == null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Oh($"获取舱位失败,舱位不存在或已作废");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//if(so)
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
///// <summary>
|
|
|
|
|
///// 校验是否可以生成订舱订单
|
|
|
|
|
///// </summary>
|
|
|
|
|
///// <param name="id">舱位主键</param>
|
|
|
|
|
///// <returns></returns>
|
|
|
|
|
//[HttpGet("/BookingSlot/ValidateCreateBookingOrder")]
|
|
|
|
|
//public async Task<TaskManageOrderResultDto> ValidateCreateBookingOrder(long id)
|
|
|
|
|
//{
|
|
|
|
|
// TaskManageOrderResultDto result = new TaskManageOrderResultDto();
|
|
|
|
|
// var slotInfo = await _repBase.AsQueryable().FirstAsync(a => a.Id == id);
|
|
|
|
|
// if (slotInfo == null)
|
|
|
|
|
// {
|
|
|
|
|
// throw Oops.Oh($"获取舱位失败,舱位不存在或已作废");
|
|
|
|
|
// }
|
|
|
|
|
// //if(so)
|
|
|
|
|
// return result;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 批量发送邮件提醒(发送客户)
|
|
|
|
|