修改海领截单导出功能

master
jianghaiqing 5 months ago
parent e19f7184f1
commit bee9c13db1

@ -5,6 +5,7 @@ using NPOI.HPSF;
using NPOI.HSSF.UserModel;
using NPOI.OpenXmlFormats.Wordprocessing;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using StackExchange.Profiling.Internal;
using System;
using System.Collections.Generic;
@ -46,7 +47,7 @@ namespace Myshipping.Application.EDI.SeaLead
//读取文件
var file = new FileStream(fileAbsPath, FileMode.Open);
var excelwork = new HSSFWorkbook(file);
var excelwork = new XSSFWorkbook(file);
//截单主信息
var sheetBase = excelwork.GetSheetAt(0);
@ -55,7 +56,7 @@ namespace Myshipping.Application.EDI.SeaLead
throw Oops.Bah("读取模板Sheet Header data失败");
var lstLabelRow = sheetBase.GetRow(sheetBase.LastRowNum);
var lstLabelRow = sheetBase.GetRow(sheetBase.LastRowNum - 1);
Dictionary<int, string> baseColsDict = lstLabelRow.Cells.Select((p, idx) =>
{
@ -65,7 +66,7 @@ namespace Myshipping.Application.EDI.SeaLead
return new { Name = "", Idx = idx };
}).Where(p => !string.IsNullOrWhiteSpace(p.Name)).ToDictionary(a => a.Idx, b => b.Name);
var newRow = sheetBase.CreateRow(sheetBase.LastRowNum + 1);
var newRow = sheetBase.CreateRow(sheetBase.LastRowNum);
for (int i = 0; i < lstLabelRow.Cells.Count; i++)
{
@ -281,7 +282,7 @@ namespace Myshipping.Application.EDI.SeaLead
ctnStartNo++;
}
var fileName = $"{model.BookingId}_SLS_{DateTime.Now.Ticks.ToString()}.xls";//名称
var fileName = $"{model.BookingId}_SLS_{DateTime.Now.Ticks.ToString()}.xlsx";//名称
var excelFileName = Path.Combine(model.FilePath, fileName);

@ -1284,7 +1284,7 @@ public class SyncHisRecord: ISyncHisRecord,ITransient
html.LoadHtml(strBody);
//获取第一个font节点的内容
var baseNode = html.DocumentNode.SelectSingleNode("//font");
var baseNode = html.DocumentNode.SelectSingleNode("//font[1]");
var s = baseNode.InnerText;
@ -1295,8 +1295,21 @@ public class SyncHisRecord: ISyncHisRecord,ITransient
billNo = Regex.Match(s, "(?<=订舱号)[a-zA-Z0-9]+").Value;
}
var baseNodes = baseNode.SelectNodes("./b");
}
public class ForInformationShipmentNotice
{
/// <summary>
/// 提单号
/// </summary>
public string BillNo { get; set; }
/// <summary>
/// 通知内容
/// </summary>
public string Notice { get; set; }
}
private List<TransPlanHasChangeDto> GetChildList(HtmlNode node)

Loading…
Cancel
Save