mahao
1 year ago
17 changed files with 6246 additions and 628 deletions
@ -1,148 +0,0 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Magicodes.ExporterAndImporter.Core; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Reports; |
|||
|
|||
/// <summary>
|
|||
/// JisBBAC Edi与发运对比
|
|||
/// </summary>
|
|||
public class JisBBACEidSeCompareReport |
|||
{ |
|||
} |
|||
|
|||
public class JisBBACEidSeCompareExport |
|||
{ |
|||
/// <summary>
|
|||
/// 类别
|
|||
/// </summary>
|
|||
[Display(Name = "类别")] |
|||
[ExporterHeader(DisplayName = "类别")] |
|||
public string Category { get; set; } |
|||
/// <summary>
|
|||
/// 车型
|
|||
/// </summary>
|
|||
[Display(Name = "车型")] |
|||
[ExporterHeader(DisplayName = "车型")] |
|||
public string CarModeCode { get; set; } |
|||
/// <summary>
|
|||
/// 生产线
|
|||
/// </summary>
|
|||
[Display(Name = "生产线")] |
|||
[ExporterHeader(DisplayName = "生产线")] |
|||
public string LineStationcode { get; set; } |
|||
/// <summary>
|
|||
/// 生产码序列号日期
|
|||
/// </summary>
|
|||
[Display(Name = "生产码序列号日期")] |
|||
[ExporterHeader(DisplayName = "生产码序列号日期")] |
|||
public string SequenceNumber { get; set; } |
|||
/// <summary>
|
|||
/// 生产码
|
|||
/// </summary>
|
|||
[Display(Name = "生产码")] |
|||
[ExporterHeader(DisplayName = "生产码")] |
|||
public string PN { get; set; } |
|||
/// <summary>
|
|||
/// 物料号
|
|||
/// </summary>
|
|||
[Display(Name = "物料号")] |
|||
[ExporterHeader(DisplayName = "物料号")] |
|||
public string MaterialNumber { get; set; } |
|||
/// <summary>
|
|||
/// 物料描述
|
|||
/// </summary>
|
|||
[Display(Name = "物料描述")] |
|||
[ExporterHeader(DisplayName = "物料描述")] |
|||
public string MaterialDes { get; set; } |
|||
/// <summary>
|
|||
/// WMS发货数量
|
|||
/// </summary>
|
|||
[Display(Name = "WMS发货数量")] |
|||
[ExporterHeader(DisplayName = "WMS发货数量")] |
|||
public decimal SEQty { get; set; } |
|||
/// <summary>
|
|||
/// EDI数量
|
|||
/// </summary>
|
|||
[Display(Name = "EDI数量")] |
|||
[ExporterHeader(DisplayName = "EDI数量")] |
|||
public decimal EdiQty { get; set; } |
|||
/// <summary>
|
|||
/// WMS发货与EDI数量差
|
|||
/// </summary>
|
|||
[Display(Name = "WMS发货与EDI数量差")] |
|||
[ExporterHeader(DisplayName = "WMS发货与EDI数量差")] |
|||
public decimal DiffQty => SEQty - EdiQty; |
|||
/// <summary>
|
|||
/// 交货单号
|
|||
/// </summary>
|
|||
[Display(Name = "交货单号")] |
|||
[ExporterHeader(DisplayName = "交货单号")] |
|||
public string WmsBillNum { get; set; } |
|||
/// <summary>
|
|||
/// ParType
|
|||
/// </summary>
|
|||
[Display(Name = "ParType")] |
|||
[ExporterHeader(DisplayName = "ParType")] |
|||
public string ParType { get; set; } |
|||
/// <summary>
|
|||
/// 配置码
|
|||
/// </summary>
|
|||
[Display(Name = "配置码")] |
|||
[ExporterHeader(DisplayName = "配置码")] |
|||
public string MESConfigCode { get; set; } |
|||
/// <summary>
|
|||
/// 发货日期
|
|||
/// </summary>
|
|||
[Display(Name = "发货日期")] |
|||
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] |
|||
public DateTime? ShippingDate { get; set; } |
|||
/// <summary>
|
|||
/// 序列号
|
|||
/// </summary>
|
|||
[Display(Name = "序列号")] |
|||
[ExporterHeader(DisplayName = "序列号")] |
|||
public string Seq { get; set; } |
|||
/// <summary>
|
|||
/// PJIS日顺序号
|
|||
/// </summary>
|
|||
[Display(Name = "PJIS日顺序号")] |
|||
[ExporterHeader(DisplayName = "PJIS日顺序号")] |
|||
public string PjsNum { get; set; } |
|||
/// <summary>
|
|||
/// 客户下线时间
|
|||
/// </summary>
|
|||
[Display(Name = "客户下线时间")] |
|||
[ExporterHeader(DisplayName = "客户下线时间")] |
|||
public DateTime? AssemblyDate { get; set; } |
|||
/// <summary>
|
|||
/// 小总成号
|
|||
/// </summary>
|
|||
[Display(Name = "小总成号")] |
|||
[ExporterHeader(DisplayName = "小总成号")] |
|||
public string MatchNumber { get; set; } |
|||
/// <summary>
|
|||
/// 注塑码
|
|||
/// </summary>
|
|||
[Display(Name = "注塑码")] |
|||
[ExporterHeader(DisplayName = "注塑码")] |
|||
public string InjectionCode { get; set; } |
|||
/// <summary>
|
|||
/// 是否完全匹配
|
|||
/// </summary>
|
|||
[Display(Name = "是否完全匹配")] |
|||
[ExporterHeader(DisplayName = "是否完全匹配")] |
|||
public string MateType { get; set; } |
|||
/// <summary>
|
|||
/// 差异说明
|
|||
/// </summary>
|
|||
[Display(Name = "差异说明")] |
|||
[ExporterHeader(DisplayName = "差异说明")] |
|||
public string DiffDesc { get; set; } |
|||
/// <summary>
|
|||
/// 备注
|
|||
/// </summary>
|
|||
[Display(Name = "备注")] |
|||
[ExporterHeader(DisplayName = "备注")] |
|||
public string Remark { get; set; } |
|||
} |
@ -0,0 +1,11 @@ |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Reports; |
|||
|
|||
/// <summary>
|
|||
/// JisBBAC 发运、Edi与对比导出
|
|||
/// </summary>
|
|||
[ExcelExporter(MaxRowNumberOnASheet = 500_000)] |
|||
public class JisBBACSeEidCompareReport : SeEidCompareReport |
|||
{ |
|||
} |
@ -0,0 +1,11 @@ |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Reports; |
|||
|
|||
/// <summary>
|
|||
/// JisHBPO 发运、Edi与对比报告
|
|||
/// </summary>
|
|||
[ExcelExporter(MaxRowNumberOnASheet = 500_000)] |
|||
public class JisHBPOSeEidCompareReport : SeEidCompareReport |
|||
{ |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,179 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Migrations |
|||
{ |
|||
public partial class _202309081 : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AddColumn<string>( |
|||
name: "LineStationCode", |
|||
table: "Set_HBPO_SE_EDI", |
|||
type: "nvarchar(50)", |
|||
maxLength: 50, |
|||
nullable: true); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"), |
|||
column: "ConcurrencyStamp", |
|||
value: "47fe18e0c4174614b1fcf60db5a35627"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"), |
|||
column: "ConcurrencyStamp", |
|||
value: "7ef18156df8f444b97ea9c14d54dbd42"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"), |
|||
column: "ConcurrencyStamp", |
|||
value: "12c345ad1a5146f993350fef54c3c6a7"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"), |
|||
column: "ConcurrencyStamp", |
|||
value: "015197fa7217489f87d3f2aa90b88c9f"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"), |
|||
column: "ConcurrencyStamp", |
|||
value: "0add991c7b55439d831a4df9d8073ea2"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"), |
|||
column: "ConcurrencyStamp", |
|||
value: "81771ab92b504c57bf3e240e41174522"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"), |
|||
column: "ConcurrencyStamp", |
|||
value: "02504a27952b462b8e294ff5886cb884"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"), |
|||
column: "ConcurrencyStamp", |
|||
value: "4962eff9d1874befaef668e046480d92"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"), |
|||
column: "ConcurrencyStamp", |
|||
value: "ac058682bcfd43a4922543012c542b0c"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"), |
|||
column: "ConcurrencyStamp", |
|||
value: "be930d1502d742a8ae7d784c1a05ff60"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"), |
|||
column: "ConcurrencyStamp", |
|||
value: "e32d05eeb3ba41148010a47c05753298"); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "LineStationCode", |
|||
table: "Set_HBPO_SE_EDI"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"), |
|||
column: "ConcurrencyStamp", |
|||
value: "540d27f55bd9415bae51a264d888b256"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"), |
|||
column: "ConcurrencyStamp", |
|||
value: "f311bbe27f2d4dd088690d28c4dd8495"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"), |
|||
column: "ConcurrencyStamp", |
|||
value: "a641ae00f7db4b3cbf58dc098442c08b"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"), |
|||
column: "ConcurrencyStamp", |
|||
value: "fc2fa51cd9124e2593e457241b79bc2b"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"), |
|||
column: "ConcurrencyStamp", |
|||
value: "610f376ade18446f87589b9b99b16c6a"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"), |
|||
column: "ConcurrencyStamp", |
|||
value: "272db8024ec645dc837afb433687572f"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"), |
|||
column: "ConcurrencyStamp", |
|||
value: "54a845290661424dbd6600f40a77ec27"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"), |
|||
column: "ConcurrencyStamp", |
|||
value: "8c5c164e5abc471a97ec8dada4195a53"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"), |
|||
column: "ConcurrencyStamp", |
|||
value: "9072cbd6edd74b80821d92e9d98d8d61"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"), |
|||
column: "ConcurrencyStamp", |
|||
value: "090f151b1c6e418299e23b7b2397a0cb"); |
|||
|
|||
migrationBuilder.UpdateData( |
|||
table: "Set_JobItem", |
|||
keyColumn: "Id", |
|||
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"), |
|||
column: "ConcurrencyStamp", |
|||
value: "dcd7451cfe3d4472b8eca39f7e890038"); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,200 @@ |
|||
using System; |
|||
using System.Linq; |
|||
using Magicodes.ExporterAndImporter.Core.Extension; |
|||
using Magicodes.ExporterAndImporter.Excel; |
|||
using Microsoft.AspNetCore.SignalR; |
|||
using SettleAccount.Bases; |
|||
using SettleAccount.Domain.BQ; |
|||
using SettleAccount.Job.SignalR; |
|||
using Win.Sfs.SettleAccount; |
|||
using Win.Sfs.SettleAccount.Consts; |
|||
using Win.Sfs.SettleAccount.Reports; |
|||
|
|||
namespace SettleAccount.Job.Services.Report |
|||
{ |
|||
/// <summary>
|
|||
/// 发运、Edi对比服务
|
|||
/// </summary>
|
|||
public class SeEdiCompareExportBaseService |
|||
{ |
|||
/// <summary>
|
|||
/// DbContext
|
|||
/// </summary>
|
|||
private readonly SettleAccountDbContext _settleAccountDbContext; |
|||
/// <summary>
|
|||
/// HubContext
|
|||
/// </summary>
|
|||
private readonly IHubContext<PageHub> _hubContext; |
|||
|
|||
public SeEdiCompareExportBaseService(SettleAccountDbContext settleAccountDbContext, IHubContext<PageHub> hubContext) |
|||
{ |
|||
_settleAccountDbContext = settleAccountDbContext; |
|||
_hubContext = hubContext; |
|||
} |
|||
|
|||
#region 方法
|
|||
/// <summary>
|
|||
/// 获取发运、Eid比对数据
|
|||
/// </summary>
|
|||
public ExcelExporter GetSeEdiCompareData<TSe, TEdi, TCompareReport>(DateTime seStartDateTime, DateTime seEndDateTime, string businessTypeDisplayName) |
|||
where TSe : JisSeBase |
|||
where TEdi : SE_EDI |
|||
where TCompareReport : SeEidCompareReport, new() |
|||
{ |
|||
// Sheet行数
|
|||
var maxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet; |
|||
var excelExporterAttribute = typeof(TCompareReport).GetAttribute<ExcelExporterAttribute>(inherit: true); |
|||
if (excelExporterAttribute != null) |
|||
{ |
|||
maxRowNumberOnASheet = excelExporterAttribute.MaxRowNumberOnASheet > 0 ? excelExporterAttribute.MaxRowNumberOnASheet : maxRowNumberOnASheet; |
|||
} |
|||
//有EDI无发运
|
|||
var haveEdiNotHaveSeList = _settleAccountDbContext.Set<TEdi>().Where(t => t.IsHaveSeData == false) |
|||
.GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) |
|||
.Select(t => new TCompareReport() |
|||
{ |
|||
Category = "JIS", |
|||
CarModeCode = t.Max(t => t.Extend4), |
|||
LineStationcode = t.Max(t => t.LineStationCode), |
|||
SequenceNumber = t.Max(t => t.Extend3), |
|||
ParType = t.Max(t => t.Extend2), |
|||
PN = t.Key.PN, |
|||
MaterialNumber = t.Max(t => t.LU), |
|||
EdiQty = t.Sum(t => t.Qty), |
|||
AssemblyDate = default, |
|||
MatchNumber = default, |
|||
MateType = "否", |
|||
DiffDesc = "WMS漏发货EDI有订单" |
|||
}).ToList(); |
|||
haveEdiNotHaveSeList.ForEach(t => |
|||
{ |
|||
t.SequenceNumber = GetSequenceNumberDate(t.SequenceNumber); |
|||
t.Remark = string.IsNullOrEmpty(t.SequenceNumber) ? "PJIS出单,AJIS未上" : ""; |
|||
}); |
|||
//无EDI有发运
|
|||
var notHaveEdiHaveSeList = _settleAccountDbContext.Set<TSe>().Where(t => t.IsHaveEdiData == false) |
|||
.GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) |
|||
.Select(t => new TCompareReport() |
|||
{ |
|||
Category = "JIS", |
|||
WmsBillNum = t.Max(t => t.BillNum), |
|||
MESConfigCode = t.Max(t => t.MESConfigCode), |
|||
ShippingDate = t.Max(t => t.BillTime), |
|||
PN = t.Max(t => t.PN), |
|||
Seq = t.Max(t => t.Seq), |
|||
PjsNum = t.Max(t => t.PjsNum), |
|||
ToLoc = t.Max(t => t.ToLoc), |
|||
ErpToLoc = t.Max(t => t.ErpToLoc), |
|||
MaterialNumber = t.Max(t => t.CustPartCode), |
|||
MaterialDes = t.Max(t => t.PartDesc), |
|||
SEQty = t.Sum(t => t.Qty), |
|||
InjectionCode = t.Max(t => t.InjectionCode), |
|||
MateType = "否", |
|||
DiffDesc = "WMS有发货EDI无订单" |
|||
}).ToList(); |
|||
//有EDI有发运
|
|||
var ediGroup = from edi in _settleAccountDbContext.Set<TEdi>() |
|||
where edi.IsDeleted == false && edi.IsHaveSeData == true |
|||
group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem |
|||
select new |
|||
{ |
|||
groupItem.Key.PN, |
|||
groupItem.Key.CustomerPartCodeNoSpace, |
|||
Qty = groupItem.Sum(t => t.Qty), |
|||
Extend2 = groupItem.Max(t => t.Extend2), |
|||
Extend3 = groupItem.Max(t => t.Extend3), |
|||
Extend4 = groupItem.Max(t => t.Extend4), |
|||
LineStationCode = groupItem.Max(t => t.LineStationCode) |
|||
}; |
|||
var seGroup = from se in _settleAccountDbContext.Set<TSe>() |
|||
where se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime |
|||
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem |
|||
select new |
|||
{ |
|||
groupItem.Key.PN, |
|||
groupItem.Key.CustomerPartCodeNoSpace, |
|||
Qty = groupItem.Sum(t => t.Qty), |
|||
LU = groupItem.Max(t => t.LU), |
|||
BillNum = groupItem.Max(t => t.BillNum), |
|||
MESConfigCode = groupItem.Max(t => t.MESConfigCode), |
|||
BillTime = groupItem.Max(t => t.BillTime), |
|||
Seq = groupItem.Max(t => t.Seq), |
|||
PjsNum = groupItem.Max(t => t.PjsNum), |
|||
ToLoc = groupItem.Max(t => t.ToLoc), |
|||
ErpToLoc = groupItem.Max(t => t.ErpToLoc), |
|||
CustPartCode = groupItem.Max(t => t.CustPartCode), |
|||
PartDesc = groupItem.Max(t => t.PartDesc), |
|||
InjectionCode = groupItem.Max(t => t.InjectionCode) |
|||
}; |
|||
var haveEdiHaveSeList = (from edi in ediGroup |
|||
join se in seGroup |
|||
on new { edi.PN, edi.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace } |
|||
select new TCompareReport() |
|||
{ |
|||
Category = "JIS", |
|||
WmsBillNum = se.BillNum, |
|||
CarModeCode = edi.Extend4, |
|||
LineStationcode = edi.LineStationCode, |
|||
SequenceNumber = edi.Extend3, |
|||
ParType = edi.Extend2, |
|||
MESConfigCode = se.MESConfigCode, |
|||
ShippingDate = se.BillTime, |
|||
PN = se.PN, |
|||
Seq = se.Seq, |
|||
PjsNum = se.PjsNum, |
|||
ToLoc = se.ToLoc, |
|||
ErpToLoc = se.ErpToLoc, |
|||
MaterialNumber = se.CustPartCode, |
|||
MaterialDes = se.PartDesc, |
|||
SEQty = se.Qty, |
|||
EdiQty = edi.Qty, |
|||
AssemblyDate = default, |
|||
MatchNumber = default, |
|||
InjectionCode = se.InjectionCode, |
|||
MateType = se.Qty == edi.Qty ? "是" : "否", |
|||
DiffDesc = "WMS有发货EDI有订单" |
|||
}).ToList(); |
|||
haveEdiHaveSeList.ForEach(t => t.SequenceNumber = GetSequenceNumberDate(t.SequenceNumber)); |
|||
|
|||
haveEdiNotHaveSeList.AddRange(haveEdiHaveSeList); |
|||
haveEdiNotHaveSeList.Reverse(); |
|||
notHaveEdiHaveSeList.AddRange(haveEdiHaveSeList); |
|||
notHaveEdiHaveSeList.Reverse(); |
|||
|
|||
var excelExporter = new ExcelExporter(); |
|||
// EDI数据和发货对比
|
|||
excelExporter.Append(haveEdiNotHaveSeList.Take(maxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}EDI数据和发货对比"); |
|||
for (var i = 1; i < haveEdiNotHaveSeList.Count / maxRowNumberOnASheet + ((haveEdiNotHaveSeList.Count % maxRowNumberOnASheet) > 0 ? 1 : 0); i++) |
|||
{ |
|||
var sheetDataItems = haveEdiNotHaveSeList.Skip(i * maxRowNumberOnASheet).Take(maxRowNumberOnASheet).ToList(); |
|||
excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}EDI数据和发货对比-{i}"); |
|||
} |
|||
// 发货和EDI数据对比
|
|||
excelExporter.Append(notHaveEdiHaveSeList.Take(maxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}发货和EDI数据对比"); |
|||
for (var i = 1; i < notHaveEdiHaveSeList.Count / maxRowNumberOnASheet + ((haveEdiNotHaveSeList.Count % maxRowNumberOnASheet) > 0 ? 1 : 0); i++) |
|||
{ |
|||
var sheetDataItems = notHaveEdiHaveSeList.Skip(i * maxRowNumberOnASheet).Take(maxRowNumberOnASheet).ToList(); |
|||
excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}发货和EDI数据对比-{i}"); |
|||
} |
|||
return excelExporter; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 通知
|
|||
/// </summary>
|
|||
public void Notify() |
|||
{ |
|||
_hubContext.Clients.All.ServerToClient("SaSeCompare", "refresh", ""); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取生产码日期
|
|||
/// </summary>
|
|||
public string GetSequenceNumberDate(string sequenceNumber) |
|||
{ |
|||
var sequenceNumberDate = sequenceNumber != null && sequenceNumber.Length >= 12 ? sequenceNumber[^12..^4] : sequenceNumber; |
|||
return sequenceNumberDate; |
|||
} |
|||
#endregion
|
|||
} |
|||
} |
Loading…
Reference in new issue