|
|
|
@ -63,6 +63,7 @@ using System.ComponentModel;
|
|
|
|
|
using Masuit.Tools.Systems;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using NPOI.OpenXmlFormats.Wordprocessing;
|
|
|
|
|
using DS.WMS.Core.Invoice.Dtos;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Op.Method
|
|
|
|
|
{
|
|
|
|
@ -4864,7 +4865,81 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 同步
|
|
|
|
|
#region 同步订单更新舱位
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 同步订单更新舱位
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="req">同步订单更新舱位请求</param>
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
public async Task<DataResult> SyncBookingOrderToSlot(BookingOrderToSlotDto req)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
1、检索出所有订单相关的舱位。
|
|
|
|
|
2、将订单信息更新到舱位
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
var allocList = await tenantDb.Queryable<BookingSlotAllocation>().Where(a => a.BookingId == req.BookingId && a.Deleted == false).ToListAsync();
|
|
|
|
|
|
|
|
|
|
if (allocList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var alloc in allocList)
|
|
|
|
|
{
|
|
|
|
|
alloc.CustomerId = req.CustomerId;
|
|
|
|
|
|
|
|
|
|
alloc.CustomerName = req.CustomerName;
|
|
|
|
|
|
|
|
|
|
if (req.SaleId.HasValue)
|
|
|
|
|
alloc.SaleId = req.SaleId.Value.ToString();
|
|
|
|
|
|
|
|
|
|
alloc.Sale = req.SaleName;
|
|
|
|
|
|
|
|
|
|
if (req.OpId.HasValue)
|
|
|
|
|
alloc.OpId = req.OpId.Value.ToString();
|
|
|
|
|
|
|
|
|
|
alloc.Op = req.OpName;
|
|
|
|
|
|
|
|
|
|
if (req.DocId.HasValue)
|
|
|
|
|
alloc.DocId = req.DocId.Value.ToString();
|
|
|
|
|
|
|
|
|
|
alloc.Doc = req.DocName;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<BookingSlotAllocation>(alloc).UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.CustomerId,
|
|
|
|
|
x.CustomerName,
|
|
|
|
|
x.SaleId,
|
|
|
|
|
x.Sale,
|
|
|
|
|
x.OpId,
|
|
|
|
|
x.Op,
|
|
|
|
|
x.DocId,
|
|
|
|
|
x.Doc
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
var slot = await tenantDb.Queryable<BookingSlotBase>().FirstAsync(b => b.Id == alloc.BookingSlotId);
|
|
|
|
|
|
|
|
|
|
if (slot != null)
|
|
|
|
|
{
|
|
|
|
|
slot.CustomerNo = req.CustomerNo;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<BookingSlotBase>(slot).UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.CustomerNo,
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return await Task.FromResult(DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess));
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|