From 0782c591e0bc0ffd33925b6b04aa6e5214b7f7c9 Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Thu, 27 Jul 2023 10:32:16 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=8B=E4=B9=A6=E5=B2=9A=EF=BC=9AV.=E5=BC=80?= =?UTF-8?q?=E5=A4=B4=E7=9A=84=E4=B8=8D=E6=9F=A5=E8=AF=A2=E8=88=B9=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/DataSync/DataSyncService.cs | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/Myshipping.Application/Service/DataSync/DataSyncService.cs b/Myshipping.Application/Service/DataSync/DataSyncService.cs index 69801f2a..9a717b88 100644 --- a/Myshipping.Application/Service/DataSync/DataSyncService.cs +++ b/Myshipping.Application/Service/DataSync/DataSyncService.cs @@ -418,7 +418,7 @@ namespace Myshipping.Application var mapcarrier = _mapcarrier.Where(x => x.Module == "HeChuan").ToList(); var userlist = _repUser.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID).ToList(); - var mlist = _vesselinfo.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID&&x.IsDeleted==false).ToList(); + var mlist = _vesselinfo.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false).ToList(); var orderlist = _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false).ToList(); foreach (var item in model) { @@ -458,13 +458,18 @@ 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(); + var e = mlist.Where(x => x.CARRIERID == entity.CARRIERID && x.Vessel == entity.Vessel && x.Voyno == entity.Voyno && x.VoynoInside == entity.VoynoInside).FirstOrDefault(); if (e == null) { + //2023年7月27日,王书岚:航次为V.开头的不查询船期 + if (!string.IsNullOrEmpty(entity.VoynoInside) && entity.VoynoInside.StartsWith("V.")) + { + entity.Sign = true; + } await _vesselinfo.InsertAsync(entity); } - else + else { entity.Id = e.Id; @@ -522,7 +527,7 @@ namespace Myshipping.Application it.LstShipOrderCompareMode }).ExecuteCommandAsync(); await _bookingorderservice.SaveLog(it, old); - await _bookingorderservice.SendBookingOrder(new long[] { it.Id}); + await _bookingorderservice.SendBookingOrder(new long[] { it.Id }); } } } @@ -546,11 +551,11 @@ namespace Myshipping.Application await _vesselinfo.UpdateAsync(x => x.BSNO == item, x => new DjyVesselInfo { IsDeleted = true }); } } - + } - + /// /// 同步订舱批量 没有返回值 @@ -1651,7 +1656,7 @@ namespace Myshipping.Application [SqlSugarUnitOfWork] public async Task SaveSyncVesselDate(List dto) { - var infolist = _vesselinfo.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID&&x.IsDeleted==false).ToList(); + var infolist = _vesselinfo.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false).ToList(); var orderlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false).ToListAsync(); foreach (var item in dto) { @@ -1746,39 +1751,39 @@ namespace Myshipping.Application if (it.ETA != item.ETA) { flag = true; - + it.ETA = item.ETA; } if (it.MiddleETA != item.MiddleETA) { flag = true; - + it.MiddleETA = item.MiddleETA; } if (it.MiddleETD != item.MiddleETD) { flag = true; - + it.MiddleETD = item.MiddleETD; } if (item.MiddleATA != it.MiddleATA) { flag = true; - + it.MiddleATA = item.MiddleATA; } if (item.MiddleATD != it.MiddleATD) { flag = true; - + it.MiddleATD = item.MiddleATD; } if (item.ATA != it.ATA) { flag = true; - + it.ATA = item.ATA; } @@ -2101,7 +2106,7 @@ namespace Myshipping.Application bookingStatusLog.OpTime = item.OpTime; bookingStatusLog.MBLNO = item.MBLNO; await _repStatuslog.InsertAsync(bookingStatusLog); - + if (item.detail != null && item.detail.Count > 0) { @@ -2200,7 +2205,7 @@ namespace Myshipping.Application bookingStatus.StaTime = item.OpTime; bookingStatus.StaCate = "book_sta_cate_billtrace"; await _repBookingStatus.InsertAsync(bookingStatus); - + } } if (item.Status == "MDGETA") @@ -2247,7 +2252,7 @@ namespace Myshipping.Application flag = true; } - + } #endregion #endregion @@ -2263,15 +2268,15 @@ namespace Myshipping.Application o.ATD = item.OpTime; await _rep.UpdateAsync(o); flag = true; - await _bookingorderservice.SaveLog(o,oldorder); + await _bookingorderservice.SaveLog(o, oldorder); } if (!string.IsNullOrEmpty(o.VESSEL) && !string.IsNullOrEmpty(o.VOYNO) && !string.IsNullOrEmpty(o.CARRIERID)) { var order = await _rep.AsQueryable().Filter(null, true).Where(x => x.VOYNO == o.VOYNO && x.VESSEL == o.VESSEL && x.CARRIERID == o.CARRIERID && x.TenantId == o.TenantId && x.IsDeleted == false && x.Id != item.BookingId).ToListAsync(); - + foreach (var it in order) { - var _oldorder= it; + var _oldorder = it; var _oldatd = it.ATD; if (_oldatd != item.OpTime) { @@ -2351,11 +2356,12 @@ namespace Myshipping.Application } #endregion } - if (flag) { + if (flag) + { await _bookingorderservice.SendBookingOrder(new long[] { all[0].BookingId }); } - + } catch (Exception ex) { @@ -2380,7 +2386,7 @@ namespace Myshipping.Application { var list = await _vesselinfo.AsQueryable().Filter(null, true) .Where(x => x.Sign == false && x.ATD == null - &&x.IsDeleted==false + && x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID && (x.Voyno != null && x.Voyno != "") && x.ETD < DateTime.Today.AddDays(15)) //2023年7月19日,根据吴悦蓉反馈,查询3周左右的即可,再远的无效,而且也会产生无效提醒;2023年7月25日,改为2周