From 26c9b96fa692d9ba8966cd940ceaa3a2eaac636f Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 23 Jul 2024 14:05:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=B1=E4=BD=8D=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingMSKAPIService.cs | 6 +-- .../Service/BookingSlot/BookingSlotService.cs | 8 ---- .../Interface/ITaskManageBCService.cs | 7 ++++ .../TaskManagePlat/TaskManageBCService.cs | 13 +++++++ .../DjyVesselInfo/DjyVesselInfoService.cs | 39 +++++++++++++++++++ 5 files changed, 62 insertions(+), 11 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs index 166e1c64..391a399c 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingMSKAPIService.cs @@ -128,7 +128,7 @@ namespace Myshipping.Application.Service.BookingOrder userKey = App.Configuration["MSKAPIDjyUserKey"], userSecret = App.Configuration["MSKAPIDjyUserSecret"], operatingEnvironment = App.Configuration["MSKAPIOPEnvironment"], - mskAppKey = webAccountConfig.Account, + mskAppKey = "mVHrpEGxtXykJAo0lDm8FPGGVFUrcsrj",//webAccountConfig.Account, cargoType = model.cargoType, exportServiceMode = model.exportServiceMode, importServiceMode = model.importServiceMode, @@ -330,8 +330,8 @@ namespace Myshipping.Application.Service.BookingOrder MSKAPISPOTScheduleRateResultShowLegsDto leg = new MSKAPISPOTScheduleRateResultShowLegsDto { - vesselName = b.transport.vessel.vesselName, - VoyageNo = b.transport.carrierDepartureVoyageNumber, + vesselName = b.transport.vessel?.vesselName, + VoyageNo = b.transport?.carrierDepartureVoyageNumber, From = new MSKAPISPOTScheduleRateResultShowLegsLocationDto { CityName = b.facilities.startLocation.cityName, diff --git a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs index 3a31635c..b2e5c265 100644 --- a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs @@ -1929,14 +1929,6 @@ namespace Myshipping.Application { ISugarQueryable select = null; - List idList = new List(); - - for (int i = 0; i < 4900; i++) - { - idList.Add(YitIdHelper.NextId()); - } - - // 箱型筛选 string[] ctnCodeArr = null; if (!string.IsNullOrEmpty(input.CTN_STAT)) diff --git a/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageBCService.cs b/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageBCService.cs index fa6966a2..75c55192 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageBCService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageBCService.cs @@ -121,5 +121,12 @@ namespace Myshipping.Application /// 返回回执 Task GetBookingOrder(string taskPkId); + /// + /// 同步更新船期表 + /// + /// BC任务主键 + /// + Task SyncDjyVesselInfo(string taskPKId); + } } diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs index ab10cb8f..6851153a 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs @@ -3828,6 +3828,19 @@ namespace Myshipping.Application } } #endregion + + /// + /// 同步更新船期表 + /// + /// BC任务主键 + /// + public async Task SyncDjyVesselInfo(string taskPKId) + { + /* + 将BC的船名、航次、开船日期、装货港、卸货港写入船期表 + */ + return null; + } } /// diff --git a/Myshipping.Core/Service/DjyVesselInfo/DjyVesselInfoService.cs b/Myshipping.Core/Service/DjyVesselInfo/DjyVesselInfoService.cs index ca54c36c..210e7a84 100644 --- a/Myshipping.Core/Service/DjyVesselInfo/DjyVesselInfoService.cs +++ b/Myshipping.Core/Service/DjyVesselInfo/DjyVesselInfoService.cs @@ -251,5 +251,44 @@ namespace Myshipping.Core.Service return tlist.Union(temp); } } + + + public async Task SyncDjyVesselInfo(DjyVesselInfoDto dto) + { + if (dto == null) + { + throw Oops.Bah("请传入数据!"); + } + if (dto.Id == 0) + { + var entity = dto.Adapt(); + + var e = _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false + && x.CARRIERID == entity.CARRIERID + && x.Vessel == entity.Vessel && x.Voyno == entity.Voyno + && x.VoynoInside == entity.VoynoInside).First(); + if (e == null) + { + await _rep.InsertAsync(entity); + + } + else + { + entity.Id = e.Id; + if (e.ETA != null) + { + entity.ETA = e.ETA; + } + await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); + } + } + else + { + var entity = dto.Adapt(); + + await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); + } + return dto.Id; + } } }