diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 2fef92f1..97d7c6c0 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -844,9 +844,19 @@ namespace Myshipping.Application { var vess = await _vesselInfo.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID && x.CARRIERID == entity.CARRIERID && x.Vessel == entity.VESSEL && x.Voyno == entity.VOYNO).FirstAsync(); - entity.StartETA = vess.ETA; - entity.ATD = vess.ATD; - entity.YgtETD = vess.YgtETD; + if (vess != null) + { + entity.StartETA = vess.ETA; + entity.ATD = vess.ATD; + entity.YgtETD = vess.YgtETD; + + } + else { + entity.StartETA = null; + entity.ATD = null; + entity.YgtETD = null; + } + } @@ -7859,11 +7869,7 @@ namespace Myshipping.Application config.RemoveAll(x => x.ConfigId == item.ConfigId); } - - - - allData.GoodsStatus = GoodsStatus.Union(config).OrderBy(x => x.Sort).ToList(); - + allData.GoodsStatus = GoodsStatus.Union(config).OrderBy(x => x.Sort).DistinctBy(x => x.StatusName).ToList(); if (traceTime) { var et = DateTime.Now - ticks; diff --git a/Myshipping.Application/Service/DataSync/DataSyncService.cs b/Myshipping.Application/Service/DataSync/DataSyncService.cs index d870bea4..b145c7b4 100644 --- a/Myshipping.Application/Service/DataSync/DataSyncService.cs +++ b/Myshipping.Application/Service/DataSync/DataSyncService.cs @@ -1655,16 +1655,17 @@ namespace Myshipping.Application var orderlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false).ToListAsync(); foreach (var item in dto) { - var model = infolist.Where(x => x.Vessel == item.Vessel && x.Voyno == item.Voyno).FirstOrDefault(); - if (model != null) - { - model.ETA = item.ETA; - model.YgtETD = item.ETD; - model.ATD = item.ATD; - model.UpdatedTime = DateTime.Now; - await _vesselinfo.AsUpdateable(model).IgnoreColumns().ExecuteCommandAsync(); - } - + //var model = infolist.Where(x => x.Vessel == item.Vessel && x.Voyno == item.Voyno).FirstOrDefault(); + //if (model != null) + //{ + // model.ETA = item.ETA; + // model.YgtETD = item.ETD; + // model.ATD = item.ATD; + // 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 }); var order = orderlist.Where(x => x.VESSEL == item.Vessel && x.VOYNO == item.Voyno).ToList(); bool issend = false; if (order != null)