|
|
|
@ -593,10 +593,20 @@ namespace Myshipping.Application
|
|
|
|
|
await _vesselinfo.AsUpdateable(entity).IgnoreColumns(x => x.TenantId).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
// 根据旧的船期数据,查找订舱数据,批量更新为新的海关航次
|
|
|
|
|
// 3.25 12:16 前端保存台账时,如果航次里面有1NC或者1MA,会去掉;所以这里进行查询时,也去掉,保持一致,这样才能查询到
|
|
|
|
|
string voyno = null;
|
|
|
|
|
if (!string.IsNullOrEmpty(oldByBsno.Voyno))
|
|
|
|
|
{
|
|
|
|
|
voyno = oldByBsno.Voyno.Replace("1NC", "").Replace("1MA", "");
|
|
|
|
|
}
|
|
|
|
|
var orderList = await _rep.AsQueryable()
|
|
|
|
|
.Filter(null, true)
|
|
|
|
|
.Where(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false
|
|
|
|
|
&& x.CARRIERID == oldByBsno.CARRIERID && x.VESSEL == oldByBsno.Vessel && x.VOYNO == oldByBsno.Voyno && x.VOYNOINNER == oldByBsno.VoynoInside)
|
|
|
|
|
.Where(x => x.TenantId == UserManager.TENANT_ID
|
|
|
|
|
&& x.IsDeleted == false
|
|
|
|
|
&& x.CARRIERID == oldByBsno.CARRIERID
|
|
|
|
|
&& x.VESSEL == oldByBsno.Vessel
|
|
|
|
|
&& x.VOYNO == voyno
|
|
|
|
|
&& x.VOYNOINNER == oldByBsno.VoynoInside)
|
|
|
|
|
.Distinct()
|
|
|
|
|
.ToListAsync();
|
|
|
|
|
|
|
|
|
@ -604,18 +614,26 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
var oldOrder = order.Adapt<BookingOrder>();
|
|
|
|
|
|
|
|
|
|
if (order.VOYNO != entity.Voyno)
|
|
|
|
|
var oldVoyno = order.VOYNO?.Replace("1NC", "").Replace("1MA", "");
|
|
|
|
|
var newVoyno = entity.Voyno?.Replace("1NC", "").Replace("1MA", "");
|
|
|
|
|
if (oldVoyno != newVoyno)
|
|
|
|
|
{
|
|
|
|
|
order.VOYNO = entity.Voyno;
|
|
|
|
|
order.UpdatedTime = DateTime.Now;
|
|
|
|
|
await _rep.Context.Updateable(order).UpdateColumns(o => new { o.VOYNO, o.UpdatedTime }).ExecuteCommandAsync();
|
|
|
|
|
order.VOYNO = newVoyno;
|
|
|
|
|
await _rep.Context.Updateable(order).UpdateColumns(o => new
|
|
|
|
|
{
|
|
|
|
|
o.VOYNO,
|
|
|
|
|
o.UpdatedTime,
|
|
|
|
|
o.UpdatedUserId,
|
|
|
|
|
o.UpdatedUserName
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
await _bookingorderservice.SaveLog(order, oldOrder, "东胜同步船期");
|
|
|
|
|
|
|
|
|
|
await _bookingorderservice.SendBookingOrder(new long[] { order.Id });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
////根据船公司船名航次更新船期信息
|
|
|
|
|
|
|
|
|
|
//根据船公司船名航次更新船期信息
|
|
|
|
|
if (!string.IsNullOrEmpty(item.CARRIER) && !string.IsNullOrEmpty(item.Vessel) && (!string.IsNullOrEmpty(item.Voyno) || !string.IsNullOrWhiteSpace(item.VoynoInside)))
|
|
|
|
|
{
|
|
|
|
|
var order = await _rep.AsQueryable()
|
|
|
|
|