|
|
@ -13,6 +13,8 @@ using NLog.Web;
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
using Logger = NLog.Logger;
|
|
|
|
using Logger = NLog.Logger;
|
|
|
|
using Mapster;
|
|
|
|
using Mapster;
|
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Identity;
|
|
|
|
|
|
|
|
using DS.Module.Core.Constants;
|
|
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Op.Method
|
|
|
|
namespace DS.WMS.Core.Op.Method
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -317,6 +319,123 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 船舶动态:ATD ETD ATA ETA MDGETA MDGATA
|
|
|
|
|
|
|
|
if (item.Status == "ATD" || item.Status == "ETD" || item.Status == "ATA" || item.Status == "ETA" || item.Status == "MDGETA" || item.Status == "MDGATA")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var config = await tenantDb.Queryable<SysConfig>().FirstAsync(x => x.Code == TenantParamCode.ENABLE_STATUS_TO_SAILING_DATE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (config.IsNotNull() && config.Value == "YES")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var order = await tenantDb.Queryable<SeaExport>().Where(x => x.Id == businessId && x.MBLNO == item.MBLNO).FirstAsync();
|
|
|
|
|
|
|
|
if (item.Status == "ATD")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//2023-8-31,排查单号为177GZHZHQ5711V的数据,原来录入的船已开船,运踪港前不再查询,而因订阅港后数据会继续回推数据,所以导致ATD被改
|
|
|
|
|
|
|
|
//因此,暂时取消运踪回推时写入ATD,还是以船期表查询为准
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 2024-4-8 因为港捷需要,重新开启,并通过租户参数判断
|
|
|
|
|
|
|
|
//变更ATD
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (order != null && item.OpTime != null && order.ATD != item.OpTime)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
order.ATD = item.OpTime;
|
|
|
|
|
|
|
|
await tenantDb.Updateable(order).UpdateColumns(x => new
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
x.ATD
|
|
|
|
|
|
|
|
}).EnableDiffLogEvent().ExecuteCommandAsync();
|
|
|
|
|
|
|
|
//sendDsList.Add(item.BookingId);
|
|
|
|
|
|
|
|
//await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
* 2023年8月24日改,取消运踪回推ATD的批量更新功能
|
|
|
|
|
|
|
|
* 和川操作经常修改提单号和船名航次,但修改时间会差好几天,导致运踪根据提单号查询的数据,回写回来之后,再根据船名航次去批量更新数据时,错误的把其他数据修改了
|
|
|
|
|
|
|
|
* 因此,不能根据船名航次去批量修改数据,因为操作写的船名航次可能是错误的,导致把他人的数据修改错误
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
////批量变更相同船期
|
|
|
|
|
|
|
|
//if (!string.IsNullOrEmpty(o.VESSEL) && !string.IsNullOrEmpty(o.VOYNO) && !string.IsNullOrEmpty(o.CARRIERID))
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// var order = await _rep.AsQueryable().Filter(null, true).Where(x => x.VOYNO == o.VOYNO && x.VESSEL == o.VESSEL && x.CARRIERID == o.CARRIERID && x.TenantId == o.TenantId && x.IsDeleted == false && x.Id != item.BookingId).ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// foreach (var it in order)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var _oldorder = it;
|
|
|
|
|
|
|
|
// var _oldatd = it.ATD;
|
|
|
|
|
|
|
|
// if (_oldatd != item.OpTime)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// it.ATD = item.OpTime;
|
|
|
|
|
|
|
|
// await _rep.UpdateAsync(it);
|
|
|
|
|
|
|
|
// await _bookingorderservice.SaveLog(it, _oldorder);
|
|
|
|
|
|
|
|
// await _bookingorderservice.SendBookingOrder(new long[] { it.Id });
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//else if (item.Status == "ETD")
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// if (order != null && item.OpTime != null && order.YgtETD != item.OpTime)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// order.YgtETD = item.OpTime;
|
|
|
|
|
|
|
|
// await tenantDb.Updateable(order).UpdateColumns(x => new
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// x.YgtETD
|
|
|
|
|
|
|
|
// }).EnableDiffLogEvent().ExecuteCommandAsync();
|
|
|
|
|
|
|
|
// //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
//else if (item.Status == "ATA")
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// if (order != null && item.OpTime != null && order.StartATA != item.OpTime)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// order.StartATA = item.OpTime;
|
|
|
|
|
|
|
|
// await tenantDb.Updateable(order).UpdateColumns(x => new
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// x.StartATA
|
|
|
|
|
|
|
|
// }).EnableDiffLogEvent().ExecuteCommandAsync();
|
|
|
|
|
|
|
|
// //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
//else if (item.Status == "ETA")
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// if (order != null && item.OpTime != null && order.StartETA != item.OpTime)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// order.StartETA = item.OpTime;
|
|
|
|
|
|
|
|
// await tenantDb.Updateable(order).UpdateColumns(x => new
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// x.StartETA
|
|
|
|
|
|
|
|
// }).EnableDiffLogEvent().ExecuteCommandAsync();
|
|
|
|
|
|
|
|
// //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
else if (item.Status == "MDGETA")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (order != null && item.OpTime != null && order.ETA != item.OpTime)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
order.ETA = item.OpTime;
|
|
|
|
|
|
|
|
await tenantDb.Updateable(order).UpdateColumns(x => new
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
x.ETA
|
|
|
|
|
|
|
|
}).EnableDiffLogEvent().ExecuteCommandAsync();
|
|
|
|
|
|
|
|
//await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (item.Status == "MDGATA")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (order != null && item.OpTime != null && order.ATA != item.OpTime)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
order.ATA = item.OpTime;
|
|
|
|
|
|
|
|
await tenantDb.Updateable(order).UpdateColumns(x => new
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
x.ATA
|
|
|
|
|
|
|
|
}).EnableDiffLogEvent().ExecuteCommandAsync();
|
|
|
|
|
|
|
|
//await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|