From bac918c157deb44a6773e12a792699f07c83ddab Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 1 Jul 2024 15:25:55 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9MSK=20SPOT=E8=AE=A2?= =?UTF-8?q?=E8=88=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingMSKSPOTAPIService.cs | 162 +++++++++- .../MSKAPISPOTSearchScheduleRateResultDto.cs | 278 +++++++++++++++++- .../BookingOrder/IBookingMSKSPOTAPIService.cs | 2 +- .../Service/BookingSlot/BookingSlotService.cs | 22 +- 4 files changed, 432 insertions(+), 32 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingMSKSPOTAPIService.cs b/Myshipping.Application/Service/BookingOrder/BookingMSKSPOTAPIService.cs index b88de866..d71f5239 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingMSKSPOTAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingMSKSPOTAPIService.cs @@ -157,9 +157,9 @@ namespace Myshipping.Application.Service.BookingOrder /// 请求船期详情 /// 返回船期结果 [HttpPost("/BookingMSKSPOTAPI/SearchShipSailingSchedule")] - public async Task> SearchShipSailingSchedule(QueryMSKSPOTShipSailingScheduleDto model) + public async Task> SearchShipSailingSchedule(QueryMSKSPOTShipSailingScheduleDto model) { - List list = new List(); + List list = new List(); /* MSKApiSailingSchedulePoint2Point @@ -285,12 +285,158 @@ namespace Myshipping.Application.Service.BookingOrder if (resultInfo != null && resultInfo.code == 200 && resultInfo.data != null && resultInfo.data.Count > 0) { - list = resultInfo.data; - - foreach (var scheduleModel in list) + foreach (var scheduleModel in resultInfo.data) { - await CacheShipSailingSchedule(scheduleModel); + CacheShipSailingSchedule(scheduleModel).GetAwaiter().GetResult(); } + + list = resultInfo.data.Select(a => + { + MSKAPISPOTScheduleRateResultShowDto showDto = new MSKAPISPOTScheduleRateResultShowDto + { + priceID = a.priceID, + PId = a.PId, + MD5 = a.MD5, + totalAmount = a.totalAmount.HasValue ? (decimal)a.totalAmount.Value : 0, + TotalCurrency = a.totalCurrency, + orignCarrierCityGeoID = a.originGeoId, + orignUNLocationCode = a.originUnLocCode, + orignCityName = a.originCityName, + originRegionName = a.originRegionName, + originCountryName = a.originCountryName, + + deliveryCarrierCityGeoID = a.destinationGeoId, + deliveryUNLocationCode = a.destinationUnLocCode, + deliveryCityName = a.destinationCityName, + deliveryRegionName = a.destinationRegionName, + deliveryCountryName = a.destinationCountryName, + + vesselName = a.vesselName, + carrierDepartureVoyageNumber = a.voyageNumber, + + Legs = new List() + }; + + //ETD + if (!string.IsNullOrWhiteSpace(a.departureDate)) + { + DateTime currDate = DateTime.MinValue; + + if (DateTime.TryParse(a.departureDate, out currDate)) + { + showDto.ETD = currDate; + } + else + { + throw Oops.Bah($"查询船期错误,priceID={a.priceID} pid={a.PId} 预计离港日期departureDate={a.departureDate} 格式解析错误"); + } + } + + //ETA + if (!string.IsNullOrWhiteSpace(a.arrivalDate)) + { + DateTime currDate = DateTime.MinValue; + + if (DateTime.TryParse(a.arrivalDate, out currDate)) + { + showDto.ETA = currDate; + } + else + { + throw Oops.Bah($"查询船期错误,priceID={a.priceID} pid={a.PId} 预计到达日期 arrivalDate={a.arrivalDate} 格式解析错误"); + } + } + + //计算预计天数 + if (showDto.ETD.HasValue && showDto.ETA.HasValue) + { + TimeSpan ts = showDto.ETD.Value.Subtract(showDto.ETA.Value); + var timeDiff = ts.TotalHours; + + showDto.days = (int)Math.Ceiling(timeDiff / 24.0); + } + + if (a.isTransfer.Equals("true", StringComparison.OrdinalIgnoreCase)) + showDto.isTransfer = true; + + //Legs + if (a.scheduleDetails != null && a.scheduleDetails.Count > 0) + { + var legs = a.scheduleDetails.Select(b => + { + MSKAPISPOTScheduleRateResultShowLegsDto leg = new MSKAPISPOTScheduleRateResultShowLegsDto + { + vesselName = b.transport.vessel.longName, + VoyageNo = b.transport.voyageNumber, + From = new MSKAPISPOTScheduleRateResultShowLegsLocationDto { + CityGeoId = b.fromLocation.cityGeoId, + CityName = b.fromLocation.cityName, + CountryCode = b.fromLocation.countryCode, + CountryName = b.fromLocation.countryName, + rkstCode = b.fromLocation.rkstCode, + SiteGeoId = b.fromLocation.siteGeoId, + LocationType = "From", + RegionName = b.fromLocation.regionName, + SiteName = b.fromLocation.siteName, + UnLocCode = b.fromLocation.unLocCode, + }, + To = new MSKAPISPOTScheduleRateResultShowLegsLocationDto { + CityGeoId = b.toLocation.cityGeoId, + CityName = b.toLocation.cityName, + CountryCode = b.toLocation.countryCode, + CountryName = b.toLocation.countryName, + rkstCode = b.toLocation.rkstCode, + SiteGeoId = b.toLocation.siteGeoId, + LocationType = "To", + RegionName = b.toLocation.regionName, + SiteName = b.toLocation.siteName, + UnLocCode = b.toLocation.unLocCode, + } + }; + + //ETD + if (!string.IsNullOrWhiteSpace(b.fromLocation.date)) + { + DateTime currDate = DateTime.MinValue; + + if (DateTime.TryParse($"{b.fromLocation.date} {b.fromLocation.time}", out currDate)) + { + leg.ETD = currDate; + } + else + { + throw Oops.Bah($"查询船期错误,航程明细 priceID={a.priceID} pid={a.PId} 预计离港日期fromLocation.date={b.fromLocation.date} {b.fromLocation.time} 格式解析错误"); + } + } + + //ETA + if (!string.IsNullOrWhiteSpace(b.toLocation.date)) + { + DateTime currDate = DateTime.MinValue; + + if (DateTime.TryParse(a.arrivalDate, out currDate)) + { + leg.ETD = currDate; + } + else + { + throw Oops.Bah($"查询船期错误,航程明细 priceID={a.priceID} pid={a.PId} 预计到达日期 toLocation.date={b.toLocation.date} {b.toLocation.time} 格式解析错误"); + } + } + + return leg; + }).ToList(); + showDto.Legs = legs.OrderBy(t=>t.ETD).Select((t,idx)=> { + t.SortNo = idx + 1; + return t; + }).ToList(); + } + + return showDto; + }).ToList(); + + + } else { @@ -315,7 +461,7 @@ namespace Myshipping.Application.Service.BookingOrder /// 船期查询结果明细 /// 船期类型 MSKSPOT-马士基即期 /// 返回主键ID - private async Task CacheShipSailingSchedule(MSKAPISPOTSearchScheduleRateResultDataDto model,string busiType = "MSKSPOT") + private async Task CacheShipSailingSchedule(MSKAPISPOTSearchScheduleRateResultDataDto model,string busiType = "MSKSPOT") { /* 1、按照船期明细缓存,并把ID作为缓存的KEY @@ -344,8 +490,6 @@ namespace Myshipping.Application.Service.BookingOrder { await _cache.SetTimeoutAsync(shareKey, Newtonsoft.Json.JsonConvert.SerializeObject(model), expireTimeSpan); } - - return model.PId; } #endregion diff --git a/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKAPISPOTSearchScheduleRateResultDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKAPISPOTSearchScheduleRateResultDto.cs index 9b65691b..696f9674 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKAPISPOTSearchScheduleRateResultDto.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKAPISPOTSearchScheduleRateResultDto.cs @@ -40,6 +40,282 @@ namespace Myshipping.Application public long PId { get; set; } } + public class MSKAPISPOTScheduleRateResultShowDto + { + /// + /// 主键ID + /// + public long PId { get; set; } + + /// + /// 船期MD5 + /// + public string MD5 { get; set; } + + /// + /// 价格id, 可进一步通过API进行其他操作 + /// + public string priceID { get; set; } + + /// + /// 币别 + /// + public string TotalCurrency { get; set; } + + /// + /// 金额 + /// + public decimal totalAmount { get; set; } + + /// + /// 是否中转 + /// + public bool isTransfer { get; set; } + + /// + /// ETD + /// + public Nullable ETD { get; set; } + + /// + /// ETA + /// + public Nullable ETA { get; set; } + + /// + /// 城市名(始发地) + /// + public string orignCityName { get; set; } + + /// + /// 地点的GEO ID(始发地) + /// + public string orignCarrierSiteGeoID { get; set; } + + /// + /// 地点的CITY GEO ID(始发地) + /// + public string orignCarrierCityGeoID { get; set; } + + /// + /// 地点的名称(始发地) + /// + public string orignLocationName { get; set; } + + /// + /// 省 + /// + public string originRegionName { get; set; } + + /// + /// 国家代码(始发地) + /// + public string orignCountryCode { get; set; } + + /// + ///国家名称(始发地) + /// + public string originCountryName { get; set; } + + /// + /// 位置类型(始发地) + /// + public string orignLocationType { get; set; } + + /// + /// 五字码(始发地) + /// + public string orignUNLocationCode { get; set; } + + /// + /// 区代码(始发地) + /// + public string orignUNRegionCode { get; set; } + + /// + /// 城市名(目的地) + /// + public string deliveryCityName { get; set; } + + /// + /// 地点的GEO ID(目的地) + /// + public string deliveryCarrierSiteGeoID { get; set; } + + /// + /// 地点的CITY GEO ID(目的地) + /// + public string deliveryCarrierCityGeoID { get; set; } + + /// + /// 地点的名称(目的地) + /// + public string deliveryLocationName { get; set; } + + /// + /// 省 + /// + public string deliveryRegionName { get; set; } + + /// + /// 国家代码(目的地) + /// + public string deliveryCountryCode { get; set; } + + /// + /// 国家名称(目的地) + /// + public string deliveryCountryName { get; set; } + + /// + /// 位置类型(目的地) + /// + public string deliveryLocationType { get; set; } + + /// + /// 五字码(目的地) + /// + public string deliveryUNLocationCode { get; set; } + + /// + /// 区代码(目的地) + /// + public string deliveryUNRegionCode { get; set; } + + + /// + /// IMO + /// + public string vesselIMONumber { get; set; } + + /// + /// 航次号 + /// + public string carrierVesselCode { get; set; } + + /// + /// 运输方式 + /// + public string transportMode { get; set; } + + /// + /// 船名 + /// + public string vesselName { get; set; } + + /// + /// 航次代码 + /// + public string carrierDepartureVoyageNumber { get; set; } + + /// + /// 承运人代码(MAEU, SEAU, SEJJ, MCPU, MAEI) + /// + public string vesselOperatorCarrierCode { get; set; } + + /// + /// 行程天数 + /// + public int days { get; set; } + + /// + /// 航程明细 + /// + public List Legs { get; set; } + } + + public class MSKAPISPOTScheduleRateResultShowLegsDto + { + /// + /// 排序值 + /// + public int SortNo { get; set; } + + /// + /// 船名 + /// + public string vesselName { get; set; } + + /// + /// 航次 + /// + public string VoyageNo { get; set; } + + /// + /// ETD + /// + public Nullable ETD { get; set; } + + /// + /// ATD + /// + public Nullable ETA { get; set; } + + /// + /// 起始地 + /// + public MSKAPISPOTScheduleRateResultShowLegsLocationDto From { get; set; } + + /// + /// 目的地 + /// + public MSKAPISPOTScheduleRateResultShowLegsLocationDto To { get; set; } + + } + + public class MSKAPISPOTScheduleRateResultShowLegsLocationDto + { + /// + /// 定位类型 From-起始地 To-目的地 + /// + public string LocationType { get; set; } + /// + /// 码头定位ID + /// + public string SiteGeoId { get; set; } + + /// + /// 城市定位ID + /// + public string CityGeoId { get; set; } + + /// + /// + /// + public string rkstCode { get; set; } + + /// + /// 城市定位ID + /// + public string UnLocCode { get; set; } + + /// + /// 码头全称 + /// + public string SiteName { get; set; } + + /// + /// 城市名 + /// + public string CityName { get; set; } + + /// + /// 省 + /// + public string RegionName { get; set; } + + /// + /// 特别行政区或国家代码 + /// + public string CountryCode { get; set; } + + /// + /// 特别行政区或国家名称 + /// + public string CountryName { get; set; } + } + + /// /// 马士基即期船期查询结果 /// @@ -146,7 +422,7 @@ namespace Myshipping.Application public string voyageNumber { get; set; } /// - /// 航次 + /// 海运费 /// public Nullable oceanFreight { get; set; } diff --git a/Myshipping.Application/Service/BookingOrder/IBookingMSKSPOTAPIService.cs b/Myshipping.Application/Service/BookingOrder/IBookingMSKSPOTAPIService.cs index 1c00f7f1..208dab2a 100644 --- a/Myshipping.Application/Service/BookingOrder/IBookingMSKSPOTAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/IBookingMSKSPOTAPIService.cs @@ -26,7 +26,7 @@ namespace Myshipping.Application.Service.BookingOrder /// /// 请求船期详情 /// 返回船期结果 - Task> SearchShipSailingSchedule(QueryMSKSPOTShipSailingScheduleDto model); + Task> SearchShipSailingSchedule(QueryMSKSPOTShipSailingScheduleDto model); /// /// 发送马士基订舱请求 diff --git a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs index 7b3130b0..c95b40e3 100644 --- a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs @@ -3784,7 +3784,7 @@ namespace Myshipping.Application cautionNoticeTaskWholeShipDto.VoynoNewVal = bcTargetDto.VoyNo; cautionNoticeTaskWholeShipDto.IsVesselChange = true; - //isNeedWholeShip = true; + isNeedWholeShip = true; } else { @@ -3860,26 +3860,6 @@ namespace Myshipping.Application _logger.LogInformation($"触发整船提醒完成,结果={JSON.Serialize(wholeShipRlt)}"); } - else - { - if (cautionNoticeTaskWholeShipDto.IsVesselChange) - { - if (bookingSlotAllocList.Count > 0) - { - bookingSlotAllocList.ForEach(async ca => - { - var bookingInfo = _repBookingOrder.AsQueryable().Filter(null, true).First(x => x.Id == ca.Alloc.BOOKING_ID && x.IsDeleted == false - && x.TenantId == UserManager.TENANT_ID); - - CreateTask(CautionNoticeTaskEnum.ChangeVesselVoyno, bcSrcDto, userList, bookingInfo, slotInfo, srcVesselVoyno, targetVesselVoyno, $"提单号:{bcSrcDto.MBLNo} \r\n船名航次变更了 \r\n原:{srcVesselVoyno} \r\n新:{targetVesselVoyno}", true); - }); - } - else if (slotInfo != null) - { - CreateTask(CautionNoticeTaskEnum.ChangeVesselVoyno, bcSrcDto, userList, null, slotInfo, srcVesselVoyno, targetVesselVoyno, $"提单号:{bcSrcDto.MBLNo} \r\n船名航次变更了 \r\n原:{srcVesselVoyno} \r\n新:{targetVesselVoyno}", true); - } - } - } } } From 1514573453c46f6ca714e169723ca836dd3d5f79 Mon Sep 17 00:00:00 2001 From: wanghaomei <86whm@163.com> Date: Mon, 1 Jul 2024 17:26:23 +0800 Subject: [PATCH 2/3] ccto --- .../BookingOrder/BookingOrderService.cs | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index b3fde9ef..d544a043 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -7982,6 +7982,7 @@ namespace Myshipping.Application SendTo = dto.SendTo, Title = dto.Title, Body = dto.Body, + CCTo= dto.CCTo, SmtpConfig = "", Account=userMail.MailAccount, Password=userMail.Password, @@ -10405,7 +10406,7 @@ namespace Myshipping.Application } //提箱返场 - var statusloglist = _repStatuslog.AsQueryable().Filter(null, true).Where(x => x.BookingId == item.Id && x.IsDeleted == false).ToList(); + var statusloglist = _repStatuslog.AsQueryable().Filter(null, true).Where(x => x.BookingId == item.Id && x.IsDeleted == false && x.Category == "yunzong").ToList(); var statuslogId = statusloglist.Select(x => x.Id).ToList(); //运踪状态详情 var statuslogdetaillist = _statuslogdetail.AsQueryable().Where(x => statuslogId.Contains(x.PId)).ToList(); @@ -11606,7 +11607,7 @@ namespace Myshipping.Application _logger.LogInformation("批次={no}提取订单信息完成", batchNo); - if (!order.CARRIERID.Equals("VOL", StringComparison.OrdinalIgnoreCase) && !order.CARRIERID.Equals("FCS", StringComparison.OrdinalIgnoreCase) + if (!order.CARRIERID.Equals("VOL", StringComparison.OrdinalIgnoreCase) && !order.CARRIERID.Equals("FCS", StringComparison.OrdinalIgnoreCase) && !order.CARRIERID.Equals("SLS", StringComparison.OrdinalIgnoreCase)) { throw Oops.Bah("当前订单的船公司不是VOL(沃尔塔航运)不能发送VOLTA截单EDI"); @@ -11682,9 +11683,9 @@ namespace Myshipping.Application if (!string.IsNullOrWhiteSpace(order.BLFRT)) { - var currFrtInfo = ediFrtList.FirstOrDefault(t => t.Code.Equals(baseFrtInfo.Code, StringComparison.OrdinalIgnoreCase)); + var currFrtInfo = ediFrtList.FirstOrDefault(t => t.Code.Equals(baseFrtInfo.Code, StringComparison.OrdinalIgnoreCase)); - if(currFrtInfo != null) + if (currFrtInfo != null) { voltaModel.BLFRT = currFrtInfo.MapCode?.Trim(); } @@ -11723,7 +11724,7 @@ namespace Myshipping.Application { s2 = voltaModel.HSCode.Substring(4, 2); } - + if (voltaModel.HSCode.Length >= 8) { s3 = voltaModel.HSCode.Substring(6, 2); @@ -11744,7 +11745,7 @@ namespace Myshipping.Application } } - + //还需要翻译箱明细的包装 if (voltaModel.ContaList != null && voltaModel.ContaList.Count > 0) { @@ -11798,7 +11799,7 @@ namespace Myshipping.Application x.EdiPkgs = ediPkgs.MapCode?.Trim(); } - if(!string.IsNullOrWhiteSpace(x.CtnType)) + if (!string.IsNullOrWhiteSpace(x.CtnType)) { var ediCtn = seaLeadediCTNList.FirstOrDefault(t => t.Code.Equals(x.CtnType, StringComparison.OrdinalIgnoreCase)); @@ -11808,7 +11809,7 @@ namespace Myshipping.Application x.CtnType = string.Empty; } - + if (ediCtn != null) { @@ -11820,7 +11821,7 @@ namespace Myshipping.Application pkgsBuilder.AppendLine($"集装箱型未填写"); x.CtnType = string.Empty; - } + } x.WTUnit = "KG"; } @@ -11841,7 +11842,7 @@ namespace Myshipping.Application if (string.IsNullOrWhiteSpace(x.EdiPkgs)) x.EdiPkgs = string.Empty; - + startNo++; }); From d631229b66d1a0804861cd2da89d4891904674b3 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 1 Jul 2024 18:09:31 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A9=AC=E5=A3=AB?= =?UTF-8?q?=E5=9F=BA=20SPOT=E8=AE=A2=E8=88=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingMSKSPOTAPIService.cs | 45 +++++++++++++------ .../Dto/MSKSPOT/MSKAPISPOTBookingCopyDto.cs | 31 +++++++++++++ .../Dto/MSKSPOT/MSKSPOTBookingDto.cs | 3 ++ .../Dto/MSKSPOT/MSKSPOTBookingInitDto.cs | 44 ++++++++++++++++++ .../BookingOrder/IBookingMSKSPOTAPIService.cs | 17 ++++--- 5 files changed, 122 insertions(+), 18 deletions(-) create mode 100644 Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKAPISPOTBookingCopyDto.cs create mode 100644 Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKSPOTBookingInitDto.cs diff --git a/Myshipping.Application/Service/BookingOrder/BookingMSKSPOTAPIService.cs b/Myshipping.Application/Service/BookingOrder/BookingMSKSPOTAPIService.cs index d71f5239..8d571746 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingMSKSPOTAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingMSKSPOTAPIService.cs @@ -34,15 +34,20 @@ namespace Myshipping.Application.Service.BookingOrder private readonly IDjyWebsiteAccountConfigService _webAccountConfig; private readonly ILogger _logger; private readonly ISysDataUserMenu _sysDataUserMenuService; + private readonly IDjyTenantParamService _djyTenantParamService; const string CONST_MSK_API_COMMODITY_URL = "MSKApiCommodity"; const string CONST_MSK_API_BOOKING_URL = "MSKApiBooking"; const string CONST_MSK_SPOT_API_QUERY_SCHEDULE_RATE_URL = "MSKSPOTScheduleRate"; const string CONST_MSK_SPOT_API_LOCATION_URL = "MSKSPOTApilocation"; + //租户MSK SPOT的备案注册信息 + const string CONST_MSK_SPOT_COMPANY_INFO = "MSK_SPOT_API_COMPANY_INFO"; + public BookingMSKSPOTAPIService(ILogger logger, ISysCacheService cache, IDjyWebsiteAccountConfigService webAccountConfig, SqlSugarRepository bookingDeliveryRecordRep, ISysDataUserMenu sysDataUserMenuService, + IDjyTenantParamService djyTenantParamService, SqlSugarRepository bookingDeliveryRecordCtnRep) { _logger = logger; @@ -51,6 +56,7 @@ namespace Myshipping.Application.Service.BookingOrder _bookingDeliveryRecordRep = bookingDeliveryRecordRep; _bookingDeliveryRecordCtnRep = bookingDeliveryRecordCtnRep; _sysDataUserMenuService = sysDataUserMenuService; + _djyTenantParamService = djyTenantParamService; } #region 检索始发地、目的港口信息 @@ -434,9 +440,6 @@ namespace Myshipping.Application.Service.BookingOrder return showDto; }).ToList(); - - - } else { @@ -500,7 +503,7 @@ namespace Myshipping.Application.Service.BookingOrder /// 请求订舱详情 /// [HttpPost("/BookingMSKSPOTAPI/SendMSKBooking")] - public async Task SendMSKBooking(MSKBookingDto model) + public async Task SendMSKBooking(MSKSPOTBookingDto model) { MSKBookingResultDto result = await InnerSendMSKBooking(model, 0); return result; @@ -515,7 +518,7 @@ namespace Myshipping.Application.Service.BookingOrder /// 当前马士基订舱主键 /// 是否默认保存 /// - private async Task InnerSendMSKBooking(MSKBookingDto model, long currId, bool isDefaultSave = true) + private async Task InnerSendMSKBooking(MSKSPOTBookingDto model, long currId, bool isDefaultSave = true) { MSKBookingResultDto result = new MSKBookingResultDto(); @@ -830,7 +833,7 @@ namespace Myshipping.Application.Service.BookingOrder /// 校验马士基API订舱必填项 /// /// - private void ValidateMSKAPIData(MSKBookingDto model) + private void ValidateMSKAPIData(MSKSPOTBookingDto model) { /* 马士基API订舱内容校验 @@ -1071,9 +1074,9 @@ namespace Myshipping.Application.Service.BookingOrder /// 马士基API订舱ID /// 返回详情 [HttpGet("/BookingMSKSPOTAPI/GetInfo")] - public async Task GetInfo(long id) + public async Task GetInfo(long id) { - MSKBookingDto model = null; + MSKSPOTBookingDto model = null; var entity = await _bookingDeliveryRecordRep.AsQueryable() .FirstAsync(a => a.Id == id); @@ -1081,7 +1084,7 @@ namespace Myshipping.Application.Service.BookingOrder if (entity == null) throw Oops.Oh($"获取马士基API订舱详情失败,不存在或已作废"); - model = entity.Adapt(); + model = entity.Adapt(); var ctnList = _bookingDeliveryRecordCtnRep.AsQueryable() .Where(a => a.RECORD_ID == id && a.IsDeleted == false).ToList(); @@ -1112,7 +1115,7 @@ namespace Myshipping.Application.Service.BookingOrder /// 请求订舱详情 /// 返回ID [HttpPost("/BookingMSKSPOTAPI/Save")] - public async Task Save([FromBody] MSKBookingDto model) + public async Task Save([FromBody] MSKSPOTBookingDto model) { return await InnerSave(model); } @@ -1125,7 +1128,7 @@ namespace Myshipping.Application.Service.BookingOrder /// API订舱详情 /// 是否发送API,true-发送需要校验状态;false-不校验状态 /// - private async Task InnerSave(MSKBookingDto model, bool isSendApi = false) + private async Task InnerSave(MSKSPOTBookingDto model, bool isSendApi = false) { DateTime nowDate = DateTime.Now; @@ -1400,7 +1403,7 @@ namespace Myshipping.Application.Service.BookingOrder /// 马士基API批量复制指定数据 /// 返回执行结果消息 [HttpPost("/BookingMSKSPOTAPI/BatchCopy")] - public async Task BatchCopy(MSKAPIBookingCopyDto model) + public async Task BatchCopy(MSKAPISPOTBookingCopyDto model) { @@ -1594,7 +1597,7 @@ namespace Myshipping.Application.Service.BookingOrder /// 马士基API批量复制指定数据 /// 返回提示信息 [HttpPost("/BookingMSKSPOTAPI/CheckWarningBatchCopy")] - public async Task CheckWarningBatchCopy(MSKAPIBookingCopyDto model) + public async Task CheckWarningBatchCopy(MSKAPISPOTBookingCopyDto model) { /* 主要校验内容 @@ -1678,5 +1681,21 @@ namespace Myshipping.Application.Service.BookingOrder return "校验成功"; } #endregion + + #region 获取初始化页面默认值 + /// + /// 获取初始化页面默认值 + /// + /// 返回详情 + + public async Task GetInitInfo() + { + return null; + //var paramList = _djyTenantParamService.GetParaCodeWithValue(new[] { CONST_AMENDMENT_DEFAULT_PARAM, + // CONST_CANCELLATION_DEFAULT_PARAM, + // CONST_AMENDMENT_DING_DEFAULT_PARAM, + // CONST_CANCELLATION_DING_DEFAULT_PARAM }).GetAwaiter().GetResult(); + } + #endregion } } diff --git a/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKAPISPOTBookingCopyDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKAPISPOTBookingCopyDto.cs new file mode 100644 index 00000000..39087b93 --- /dev/null +++ b/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKAPISPOTBookingCopyDto.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + public class MSKAPISPOTBookingCopyDto + { + /// + /// 被复制马士基API订舱主键 + /// + public long originalId { get; set; } + + /// + /// 操作类型 only_copy-只单票复制;copy_edit-复制使用提交的编辑信息 + /// + public string opType { get; set; } + + /// + /// 编辑详情(弹出编辑框后修改的详情内容) + /// + public MSKBookingDto bookingDto { get; set; } + + /// + /// 复制数量 + /// + public int copyNum { get; set; } = 1; + } +} diff --git a/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKSPOTBookingDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKSPOTBookingDto.cs index 7e40baea..11cf4ebe 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKSPOTBookingDto.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKSPOTBookingDto.cs @@ -7,6 +7,9 @@ using System.Threading.Tasks; namespace Myshipping.Application { + /// + /// 马士基SPOT订舱保存 + /// public class MSKSPOTBookingDto { /// diff --git a/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKSPOTBookingInitDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKSPOTBookingInitDto.cs new file mode 100644 index 00000000..48965737 --- /dev/null +++ b/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKSPOTBookingInitDto.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + /// + /// MSK SPOT 订舱初始加载详情 + /// + public class MSKSPOTBookingInitDto + { + /// + /// 订舱方备案编号(马士基) + /// + public string bookedByMaerskPartyCode { get; set; } + + /// + /// 订舱方备案全称(马士基) + /// + public string bookedByCompanyName { get; set; } + + /// + /// 订舱方联系人(马士基) + /// + public string bookedByPartyContactName { get; set; } + + /// + /// 订舱方联系邮箱(马士基) + /// + public string bookedByPartyContactEmail { get; set; } + + /// + /// 持约方备案代码(马士基) + /// + public string priceOwnerMaerskPartyCode { get; set; } + + /// + /// 持约方备案全称(马士基) + /// + public string priceOwnerCompanyName { get; set; } + } +} diff --git a/Myshipping.Application/Service/BookingOrder/IBookingMSKSPOTAPIService.cs b/Myshipping.Application/Service/BookingOrder/IBookingMSKSPOTAPIService.cs index 208dab2a..a329e0be 100644 --- a/Myshipping.Application/Service/BookingOrder/IBookingMSKSPOTAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/IBookingMSKSPOTAPIService.cs @@ -33,7 +33,7 @@ namespace Myshipping.Application.Service.BookingOrder /// /// 请求订舱详情 /// 返回检索结果 - Task SendMSKBooking(MSKBookingDto model); + Task SendMSKBooking(MSKSPOTBookingDto model); /// /// 检索商品名称 @@ -47,14 +47,14 @@ namespace Myshipping.Application.Service.BookingOrder /// /// 马士基API订舱ID /// 返回详情 - Task GetInfo(long id); + Task GetInfo(long id); /// /// 保存 /// /// 请求订舱详情 /// 返回ID - Task Save(MSKBookingDto model); + Task Save(MSKSPOTBookingDto model); /// /// 删除 @@ -82,14 +82,14 @@ namespace Myshipping.Application.Service.BookingOrder /// /// 马士基API批量复制指定数据 /// 返回提示信息 - Task CheckWarningBatchCopy(MSKAPIBookingCopyDto model); + Task CheckWarningBatchCopy(MSKAPISPOTBookingCopyDto model); /// /// 批量复制 /// /// 马士基API批量复制指定数据 /// 返回执行结果消息 - Task BatchCopy(MSKAPIBookingCopyDto model); + Task BatchCopy(MSKAPISPOTBookingCopyDto model); /// /// 同步BC状态(BC,Cancellation) @@ -99,5 +99,12 @@ namespace Myshipping.Application.Service.BookingOrder /// 操作类型 BC-同步BC状态 Cancellation-同步取消状态 /// 返回回执 Task SyncBCInfo(string mblno, long tenantId, string opTypeName = "BookingConfirmation"); + + /// + /// 获取初始化页面默认值 + /// + /// 返回详情 + + Task GetInitInfo(); } }