From 8acddb61ea008bb9dbd16d3126b6283cf651d66e Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Mon, 31 Jul 2023 18:13:51 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8E=BB=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 6 +----- .../Service/DataSync/DataSyncService.cs | 21 ++++++++++--------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 55d8eb2f..b7ebee89 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -7858,11 +7858,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) From b9382322b9bfb8da0963297ae8ef2aaa7c8a02c5 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 1 Aug 2023 08:48:12 +0800 Subject: [PATCH 2/3] 1 --- .../Service/BookingOrder/BookingOrderService.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index b7ebee89..e9784c0b 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -843,9 +843,14 @@ 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; + + } + } From 1b3a43229aea5038aec85aa92b62103eb41d61d7 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 1 Aug 2023 08:57:50 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=88=B9=E6=9C=9F=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index e9784c0b..a83face1 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -850,6 +850,11 @@ namespace Myshipping.Application entity.YgtETD = vess.YgtETD; } + else { + entity.StartETA = null; + entity.ATD = null; + entity.YgtETD = null; + } }