From 033689ec4b65045adbc862f1a324d592b1f5e90f Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 3 Jul 2024 16:23:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9MSK=20SPOT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingMSKSPOTAPIService.cs | 6 ++-- .../BookingOrder/Dto/MSKSPOT/MSKAPIMapper.cs | 8 ++--- .../Dto/MSKSPOT/MSKSPOTBookingDto.cs | 4 +-- .../TaskManagePlat/TaskManageService.cs | 8 +++++ ServiceProjectSyncWin/Program.cs | 33 +++++++++++++++++-- .../ServiceProjectSyncWin.csproj | 1 + 6 files changed, 49 insertions(+), 11 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingMSKSPOTAPIService.cs b/Myshipping.Application/Service/BookingOrder/BookingMSKSPOTAPIService.cs index 2eefe900..b68807d9 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingMSKSPOTAPIService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingMSKSPOTAPIService.cs @@ -1324,11 +1324,11 @@ namespace Myshipping.Application.Service.BookingOrder model.placeOfReceiptCountryName = selectedShipSchedule.originCountryName; model.placeOfReceiptRegionName = selectedShipSchedule.originRegionName; - model.placeOfReceiptGeoId = selectedShipSchedule.originGeoId; + model.carrierCollectionOriginGeoID = selectedShipSchedule.originGeoId; - model.placeOfDeliveryRegionName = selectedShipSchedule.destinationCountryName; model.placeOfDeliveryCountryName = selectedShipSchedule.destinationCountryName; - model.placeOfReceiptRegionName = selectedShipSchedule.destinationGeoId; + model.placeOfDeliveryRegionName = selectedShipSchedule.destinationRegionName; + model.carrierDeliveryDestinationGeoID = selectedShipSchedule.destinationGeoId; } if (model.ctns != null && model.ctns.Count > 0) diff --git a/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKAPIMapper.cs b/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKAPIMapper.cs index 2bc2cd1d..892dd559 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKAPIMapper.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKAPIMapper.cs @@ -94,8 +94,8 @@ namespace Myshipping.Application .Map(dest => dest.SHIP_RATE_TOTAL_CURRENCY, src => src.ShipRateTotalCurrency) .Map(dest => dest.SHIP_RATE_PID, src => src.PId) .Map(dest => dest.SHIP_RATE_MD5, src => src.MD5) - .Map(dest => dest.PLACERECEIPT_GEO_ID, src => src.placeOfReceiptGeoId) - .Map(dest => dest.PLACEDELIVERY_GEO_ID, src => src.placeOfDeliveryGeoId); + .Map(dest => dest.PLACERECEIPT_GEO_ID, src => src.carrierCollectionOriginGeoID) + .Map(dest => dest.PLACEDELIVERY_GEO_ID, src => src.carrierDeliveryDestinationGeoID); config.ForType() .Map(dest => dest.id, src => src.Id) @@ -169,8 +169,8 @@ namespace Myshipping.Application .Map(dest => dest.MD5, src => src.SHIP_RATE_MD5) .Map(dest => dest.bookingChannelTypeName, src => src.BOOKING_CHANNEL_TYPE_NAME) .Map(dest => dest.bookingChannelType, src => src.BOOKING_CHANNEL_TYPE) - .Map(dest => dest.placeOfReceiptGeoId, src => src.PLACERECEIPT_GEO_ID) - .Map(dest => dest.placeOfDeliveryGeoId, src => src.PLACEDELIVERY_GEO_ID); + .Map(dest => dest.carrierCollectionOriginGeoID, src => src.PLACERECEIPT_GEO_ID) + .Map(dest => dest.carrierDeliveryDestinationGeoID, src => src.PLACEDELIVERY_GEO_ID); config.ForType() diff --git a/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKSPOTBookingDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKSPOTBookingDto.cs index 2a6eacde..1279bddc 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKSPOTBookingDto.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/MSKSPOT/MSKSPOTBookingDto.cs @@ -404,12 +404,12 @@ namespace Myshipping.Application /// /// 收货地定位ID /// - public string placeOfReceiptGeoId { get; set; } + public string carrierCollectionOriginGeoID { get; set; } /// /// 交货地定位ID /// - public string placeOfDeliveryGeoId { get; set; } + public string carrierDeliveryDestinationGeoID { get; set; } /// /// 选择的船期详情 diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs index 6fc05a68..1c8d969b 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs @@ -1914,6 +1914,14 @@ namespace Myshipping.Application } #endregion + #region 黑名单 + #endregion + + #region 截单补料异常提醒 + #endregion + + #region 启运港箱使费通知 + #endregion if (info.Main.SerialMsgInfo != null) { diff --git a/ServiceProjectSyncWin/Program.cs b/ServiceProjectSyncWin/Program.cs index c30261f2..971e1c9f 100644 --- a/ServiceProjectSyncWin/Program.cs +++ b/ServiceProjectSyncWin/Program.cs @@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; +using MimeKit; using ServiceProjectSyncWin; using ServiceProjectSyncWin.Entities; using SqlSugar; @@ -34,8 +35,8 @@ Console.WriteLine("开始准备同步历史服务状态数据"); var service1 = App.GetService(); //service1.SyncServiceProjectRecord(); -service1.SyncServiceProjectRecord5(); - +//service1.SyncServiceProjectRecord5(); +service1.SyncServiceProjectRecord6(); Console.ReadKey(); public interface ISyncHisRecord @@ -43,6 +44,8 @@ public interface ISyncHisRecord void SyncServiceProjectRecord4(); void SyncServiceProjectRecord5(); + + void SyncServiceProjectRecord6(); //void SyncServiceProjectRecord2(); //void SyncServiceProjectRecord3(); @@ -1270,6 +1273,32 @@ public class SyncHisRecord: ISyncHisRecord,ITransient } } + public void SyncServiceProjectRecord6() + { + string mailFilePath = "C:\\Users\\Administrator\\Desktop\\日志\\For Information - Shipment # 234581255.eml"; + //读取邮件,解析邮件正文 + MimeMessage mimeMsg = MimeMessage.Load(mailFilePath); + + var strBody = mimeMsg.HtmlBody; + HtmlDocument html = new HtmlDocument(); + html.LoadHtml(strBody); + + //获取第一个font节点的内容 + var baseNode = html.DocumentNode.SelectSingleNode("//font"); + + var s = baseNode.InnerText; + + string billNo = string.Empty; + //提取单号 + if(Regex.IsMatch(s,"(?<=订舱号)[a-zA-Z0-9]+")) + { + billNo = Regex.Match(s, "(?<=订舱号)[a-zA-Z0-9]+").Value; + } + + + + } + private List GetChildList(HtmlNode node) { List list = new List(); diff --git a/ServiceProjectSyncWin/ServiceProjectSyncWin.csproj b/ServiceProjectSyncWin/ServiceProjectSyncWin.csproj index 1f09d388..2cbc5e9f 100644 --- a/ServiceProjectSyncWin/ServiceProjectSyncWin.csproj +++ b/ServiceProjectSyncWin/ServiceProjectSyncWin.csproj @@ -10,6 +10,7 @@ +