optimize
wet 1 year ago
parent a844410174
commit 34ffe0326a

@ -432,20 +432,16 @@ namespace Myshipping.Application
if (string.IsNullOrEmpty(entity.CARRIERID))
{
entity.CARRIERID = mapcarrier.Where(x => x.MapName == item.CARRIER).Select(x => x.Code).FirstOrDefault();
}
if (string.IsNullOrEmpty(entity.CARRIERID))
{
throw Oops.Bah($"未找到{item.CARRIER}对应code,请联系管理员!");
}
}
if (!string.IsNullOrEmpty(item.CreatedUserName))
{
entity.CreatedUserId = CreatedUserId;
}
if (string.IsNullOrEmpty(item.Voyno))
@ -454,6 +450,7 @@ namespace Myshipping.Application
}
if (m == null)
{
//查询是否存在相同船名航次数据
var e = mlist.Where(x => x.CARRIERID == entity.CARRIERID && x.Vessel == entity.Vessel && x.Voyno == entity.Voyno && x.VoynoInside == entity.VoynoInside).FirstOrDefault();
//2023年7月27日王书岚航次为V.开头的不查询船期
if (!string.IsNullOrEmpty(entity.VoynoInside) && entity.VoynoInside.StartsWith("V."))
@ -462,24 +459,25 @@ namespace Myshipping.Application
}
if (e == null)
{
await _vesselinfo.InsertAsync(entity);
}
else
{
entity.Id = e.Id;
if (e.ETA != null)
{
entity.ETA = e.ETA;
}
await _vesselinfo.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
}
else
{
//2023年7月27日王书岚航次为V.开头的不查询船期
if (!string.IsNullOrEmpty(entity.VoynoInside) && entity.VoynoInside.StartsWith("V."))
{
entity.Sign = true;
}
entity.Id = m.Id;
if (m.ETA != null)
{
@ -1666,8 +1664,8 @@ namespace Myshipping.Application
// model.UpdatedTime = DateTime.Now;
// await _vesselinfo.AsUpdateable(model).IgnoreColumns().ExecuteCommandAsync();
//}
await _vesselinfo.UpdateAsync(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false&&
x.Vessel == item.Vessel && x.Voyno == item.Voyno , x => new DjyVesselInfo { ETA = item.ETA, YgtETD= item.ETD , ATD = item.ATD , UpdatedTime = DateTime.Now });
await _vesselinfo.UpdateAsync(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false &&
x.Vessel == item.Vessel && x.Voyno == item.Voyno, x => new DjyVesselInfo { ETA = item.ETA, YgtETD = item.ETD, ATD = item.ATD, UpdatedTime = DateTime.Now });
var order = orderlist.Where(x => x.VESSEL == item.Vessel && x.VOYNO == item.Voyno).ToList();
bool issend = false;
if (order != null)
@ -2105,7 +2103,7 @@ namespace Myshipping.Application
bookingStatusLog.MBLNO = item.MBLNO;
await _repStatuslog.InsertAsync(bookingStatusLog);
if (item.detail != null && item.detail.Count > 0)
{
foreach (var dt in item.detail)
@ -2117,7 +2115,7 @@ namespace Myshipping.Application
BookingStatusLogDetail.OPTime = dt.OPTime;
await _statuslogdetail.InsertAsync(BookingStatusLogDetail);
}
}
@ -2360,9 +2358,9 @@ namespace Myshipping.Application
}
}
}
#endregion
#endregion
}
if (flag)
{

Loading…
Cancel
Save