|
@ -68,25 +68,20 @@ namespace SettleAccount.Job.Services.Report |
|
|
var pn = property.Where(p => p.Name == "PN").FirstOrDefault().Value; |
|
|
var pn = property.Where(p => p.Name == "PN").FirstOrDefault().Value; |
|
|
var seStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value; |
|
|
var seStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value; |
|
|
var seEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value; |
|
|
var seEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value; |
|
|
|
|
|
var filename = exportName.FirstOrDefault(); |
|
|
//有EDI的发运数据
|
|
|
//有EDI无发运
|
|
|
// var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t =>
|
|
|
var haveEdiNotHaveSe = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsHaveSeData == false) |
|
|
//t.First().SetQty(t.Sum(q => q.Qty))).ToList();
|
|
|
.GroupBy(t => new { t.LU, t.PN }) |
|
|
var seDetailGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU }).ToList(); |
|
|
.Select(t => new JisBBACEidSeCompareExport() |
|
|
|
|
|
|
|
|
// var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t =>
|
|
|
|
|
|
//t.FirstOrDefault()).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
var dddd = new JisBBACEidSeCompareExport() |
|
|
|
|
|
{ |
|
|
{ |
|
|
Category = default, |
|
|
Category = "JIS", |
|
|
WmsBillNum = default, |
|
|
WmsBillNum = default, |
|
|
CarModeCode = default, |
|
|
CarModeCode = default, |
|
|
LineStationcode = default, |
|
|
LineStationcode = default, |
|
|
SequenceNumber = default, |
|
|
SequenceNumber = default, |
|
|
ParType = default, |
|
|
ParType = default, |
|
|
MESConfigCode = default, |
|
|
MESConfigCode = default, |
|
|
ShippingDate = default, |
|
|
ShippingDate = null, |
|
|
PN = default, |
|
|
PN = default, |
|
|
序列号 = default, |
|
|
序列号 = default, |
|
|
PJIS日顺序号 = default, |
|
|
PJIS日顺序号 = default, |
|
@ -95,14 +90,16 @@ namespace SettleAccount.Job.Services.Report |
|
|
SEQty = default, |
|
|
SEQty = default, |
|
|
EdiQty = default, |
|
|
EdiQty = default, |
|
|
DiffQty = default, |
|
|
DiffQty = default, |
|
|
AssemblyDate = default, |
|
|
AssemblyDate = null, |
|
|
MatchNumber = default, |
|
|
MatchNumber = default, |
|
|
InjectionCode = default, |
|
|
InjectionCode = default, |
|
|
MateType = default, |
|
|
MateType = default, |
|
|
DiffDesc = default |
|
|
DiffDesc = default |
|
|
}; |
|
|
}).ToList(); |
|
|
|
|
|
//无EDI有发运
|
|
|
var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t => new JisBBACEidSeCompareExport() |
|
|
var notHaveEdiHaveSe = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false) |
|
|
|
|
|
.GroupBy(t => new { t.LU, t.PN }) |
|
|
|
|
|
.Select(t => new JisBBACEidSeCompareExport() |
|
|
{ |
|
|
{ |
|
|
Category = default, |
|
|
Category = default, |
|
|
WmsBillNum = default, |
|
|
WmsBillNum = default, |
|
@ -111,7 +108,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
SequenceNumber = default, |
|
|
SequenceNumber = default, |
|
|
ParType = default, |
|
|
ParType = default, |
|
|
MESConfigCode = default, |
|
|
MESConfigCode = default, |
|
|
ShippingDate = default, |
|
|
ShippingDate = null, |
|
|
PN = default, |
|
|
PN = default, |
|
|
序列号 = default, |
|
|
序列号 = default, |
|
|
PJIS日顺序号 = default, |
|
|
PJIS日顺序号 = default, |
|
@ -120,15 +117,74 @@ namespace SettleAccount.Job.Services.Report |
|
|
SEQty = default, |
|
|
SEQty = default, |
|
|
EdiQty = default, |
|
|
EdiQty = default, |
|
|
DiffQty = default, |
|
|
DiffQty = default, |
|
|
AssemblyDate = default, |
|
|
AssemblyDate = null, |
|
|
MatchNumber = default, |
|
|
MatchNumber = default, |
|
|
InjectionCode = default, |
|
|
InjectionCode = default, |
|
|
MateType = default, |
|
|
MateType = default, |
|
|
DiffDesc = default |
|
|
DiffDesc = default |
|
|
}).ToList(); |
|
|
}).ToList(); |
|
|
|
|
|
|
|
|
var haveEidSesGroup22 = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true)?.GroupBy(t => new { t.PN, t.LU }).Select(t => |
|
|
|
|
|
t.FirstOrDefault()).ToList(); |
|
|
// //有EDI的发运数据
|
|
|
|
|
|
// //var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t =>
|
|
|
|
|
|
// //t.First().SetQty(t.Sum(q => q.Qty))).ToList();
|
|
|
|
|
|
// var seDetailGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU }).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
// // var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t =>
|
|
|
|
|
|
// //t.FirstOrDefault()).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
// var dddd = new JisBBACEidSeCompareExport()
|
|
|
|
|
|
// {
|
|
|
|
|
|
// Category = default,
|
|
|
|
|
|
// WmsBillNum = default,
|
|
|
|
|
|
// CarModeCode = default,
|
|
|
|
|
|
// LineStationcode = default,
|
|
|
|
|
|
// SequenceNumber = default,
|
|
|
|
|
|
// ParType = default,
|
|
|
|
|
|
// MESConfigCode = default,
|
|
|
|
|
|
// ShippingDate = default,
|
|
|
|
|
|
// PN = default,
|
|
|
|
|
|
// 序列号 = default,
|
|
|
|
|
|
// PJIS日顺序号 = default,
|
|
|
|
|
|
// MaterialNumber = default,
|
|
|
|
|
|
// MaterialDes = default,
|
|
|
|
|
|
// SEQty = default,
|
|
|
|
|
|
// EdiQty = default,
|
|
|
|
|
|
// DiffQty = default,
|
|
|
|
|
|
// AssemblyDate = default,
|
|
|
|
|
|
// MatchNumber = default,
|
|
|
|
|
|
// InjectionCode = default,
|
|
|
|
|
|
// MateType = default,
|
|
|
|
|
|
// DiffDesc = default
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
|
|
// var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t => new JisBBACEidSeCompareExport()
|
|
|
|
|
|
// {
|
|
|
|
|
|
// Category = default,
|
|
|
|
|
|
// WmsBillNum = default,
|
|
|
|
|
|
// CarModeCode = default,
|
|
|
|
|
|
// LineStationcode = default,
|
|
|
|
|
|
// SequenceNumber = default,
|
|
|
|
|
|
// ParType = default,
|
|
|
|
|
|
// MESConfigCode = default,
|
|
|
|
|
|
// ShippingDate = default,
|
|
|
|
|
|
// PN = default,
|
|
|
|
|
|
// 序列号 = default,
|
|
|
|
|
|
// PJIS日顺序号 = default,
|
|
|
|
|
|
// MaterialNumber = default,
|
|
|
|
|
|
// MaterialDes = default,
|
|
|
|
|
|
// SEQty = default,
|
|
|
|
|
|
// EdiQty = default,
|
|
|
|
|
|
// DiffQty = default,
|
|
|
|
|
|
// AssemblyDate = default,
|
|
|
|
|
|
// MatchNumber = default,
|
|
|
|
|
|
// InjectionCode = default,
|
|
|
|
|
|
// MateType = default,
|
|
|
|
|
|
// DiffDesc = default
|
|
|
|
|
|
// }).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
// var haveEidSesGroup22 = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true)?.GroupBy(t => new { t.PN, t.LU }).Select(t =>
|
|
|
|
|
|
//t.FirstOrDefault()).ToList();
|
|
|
|
|
|
|
|
|
//有发运的EDI数据
|
|
|
//有发运的EDI数据
|
|
|
//var haveSeEidsGroup = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == true).GroupBy(t => new { t.PN, t.LU }).Select(t => t.First().SetQty(t.Sum(q => q.Qty))).ToList();
|
|
|
//var haveSeEidsGroup = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == true).GroupBy(t => new { t.PN, t.LU }).Select(t => t.First().SetQty(t.Sum(q => q.Qty))).ToList();
|
|
@ -173,16 +229,16 @@ t.FirstOrDefault()).ToList(); |
|
|
////无EDI有发运
|
|
|
////无EDI有发运
|
|
|
//var notHaveEdiHaveSeCompareExports = haveEidHaveSes.ToList();
|
|
|
//var notHaveEdiHaveSeCompareExports = haveEidHaveSes.ToList();
|
|
|
|
|
|
|
|
|
//ExcelExporter excelExporter = new ExcelExporter();
|
|
|
ExcelExporter excelExporter = new ExcelExporter(); |
|
|
//excelExporter
|
|
|
excelExporter |
|
|
// .Append(haveEdiNotHaveSeCompareExports, $"BBACEDI数据和发货对比")
|
|
|
.Append(haveEdiNotHaveSe.ToList(), $"BBACEDI数据和发货对比") |
|
|
// .SeparateBySheet()
|
|
|
.SeparateBySheet() |
|
|
// .Append(notHaveEdiHaveSeCompareExports, $"BBAC发货和EDI数据对比")
|
|
|
.Append(notHaveEdiHaveSe.ToList(), $"BBAC发货和EDI数据对比") |
|
|
// .SeparateBySheet();
|
|
|
.SeparateBySheet(); |
|
|
|
|
|
|
|
|
//var result = excelExporter.ExportAppendDataAsByteArray();
|
|
|
var result = excelExporter.ExportAppendDataAsByteArray(); |
|
|
//result.ShouldNotBeNull();
|
|
|
result.ShouldNotBeNull(); |
|
|
////_fileContainer.SaveAsync(filename, result.Result, true);
|
|
|
_fileContainer.SaveAsync(filename, result.Result, true); |
|
|
|
|
|
|
|
|
//Notify();
|
|
|
//Notify();
|
|
|
return id.ToString(); |
|
|
return id.ToString(); |
|
|