|
|
@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Mvc;
|
|
|
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
|
|
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
|
|
using MimeKit;
|
|
|
|
using ServiceProjectSyncWin;
|
|
|
|
using ServiceProjectSyncWin;
|
|
|
|
using ServiceProjectSyncWin.Entities;
|
|
|
|
using ServiceProjectSyncWin.Entities;
|
|
|
|
using SqlSugar;
|
|
|
|
using SqlSugar;
|
|
|
@ -34,8 +35,8 @@ Console.WriteLine("开始准备同步历史服务状态数据");
|
|
|
|
|
|
|
|
|
|
|
|
var service1 = App.GetService<ISyncHisRecord>();
|
|
|
|
var service1 = App.GetService<ISyncHisRecord>();
|
|
|
|
//service1.SyncServiceProjectRecord();
|
|
|
|
//service1.SyncServiceProjectRecord();
|
|
|
|
service1.SyncServiceProjectRecord5();
|
|
|
|
//service1.SyncServiceProjectRecord5();
|
|
|
|
|
|
|
|
service1.SyncServiceProjectRecord6();
|
|
|
|
Console.ReadKey();
|
|
|
|
Console.ReadKey();
|
|
|
|
|
|
|
|
|
|
|
|
public interface ISyncHisRecord
|
|
|
|
public interface ISyncHisRecord
|
|
|
@ -43,6 +44,8 @@ public interface ISyncHisRecord
|
|
|
|
void SyncServiceProjectRecord4();
|
|
|
|
void SyncServiceProjectRecord4();
|
|
|
|
|
|
|
|
|
|
|
|
void SyncServiceProjectRecord5();
|
|
|
|
void SyncServiceProjectRecord5();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SyncServiceProjectRecord6();
|
|
|
|
//void SyncServiceProjectRecord2();
|
|
|
|
//void SyncServiceProjectRecord2();
|
|
|
|
|
|
|
|
|
|
|
|
//void SyncServiceProjectRecord3();
|
|
|
|
//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<TransPlanHasChangeDto> GetChildList(HtmlNode node)
|
|
|
|
private List<TransPlanHasChangeDto> GetChildList(HtmlNode node)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<TransPlanHasChangeDto> list = new List<TransPlanHasChangeDto>();
|
|
|
|
List<TransPlanHasChangeDto> list = new List<TransPlanHasChangeDto>();
|
|
|
|