jianghaiqing 8 months ago
commit 0280c9e571

@ -357,11 +357,11 @@ namespace Myshipping.Application
var seaeList = await _seaeedi.AsQueryable()
.Filter(null, true)
.Where(x => x.BookingId == bookingId)
.Where(x => x.BookingId == bookingId && x.IsDeleted == false)
.ToListAsync();
var seaeCtnList = await _seaeedictn.AsQueryable()
.Filter(null, true)
.Where(x => seaeList.Select(x => x.Id).Contains(x.PId))
.Where(x => seaeList.Select(x => x.Id).Contains(x.PId) && x.IsDeleted == false)
.ToListAsync();
var bkOrder = await _repBookingOrder.AsQueryable()
.Filter(null, true)

@ -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()

Loading…
Cancel
Save