|
@ -1,11 +1,9 @@ |
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.ComponentModel.DataAnnotations; |
|
|
|
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.Linq.Dynamic.Core; |
|
|
using System.Linq.Dynamic.Core; |
|
|
using Magicodes.ExporterAndImporter.Excel; |
|
|
using Magicodes.ExporterAndImporter.Excel; |
|
|
using Microsoft.AspNetCore.SignalR; |
|
|
using Microsoft.AspNetCore.SignalR; |
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
|
|
using SettleAccount.Domain.BQ; |
|
|
using SettleAccount.Domain.BQ; |
|
|
using SettleAccount.Job.SignalR; |
|
|
using SettleAccount.Job.SignalR; |
|
|
using Shouldly; |
|
|
using Shouldly; |
|
@ -16,8 +14,6 @@ using Volo.Abp.DependencyInjection; |
|
|
using Volo.Abp.ObjectMapping; |
|
|
using Volo.Abp.ObjectMapping; |
|
|
using Win.Sfs.BaseData.ImportExcelCommon; |
|
|
using Win.Sfs.BaseData.ImportExcelCommon; |
|
|
using Win.Sfs.SettleAccount; |
|
|
using Win.Sfs.SettleAccount; |
|
|
using Win.Sfs.SettleAccount.Entities.BQ; |
|
|
|
|
|
using Win.Sfs.SettleAccount.Enums; |
|
|
|
|
|
using Win.Sfs.SettleAccount.Reports; |
|
|
using Win.Sfs.SettleAccount.Reports; |
|
|
|
|
|
|
|
|
namespace SettleAccount.Job.Services.Report |
|
|
namespace SettleAccount.Job.Services.Report |
|
@ -74,22 +70,122 @@ namespace SettleAccount.Job.Services.Report |
|
|
var seEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value; |
|
|
var seEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value; |
|
|
|
|
|
|
|
|
//有EDI的发运数据
|
|
|
//有EDI的发运数据
|
|
|
var haveEidSes = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true); |
|
|
// 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 haveSeEids = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == true && haveEidSes.Select(t => new { t.PN, t.LU }).Contains(new { t.PN, t.LU }));
|
|
|
//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 haveSeEids = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == true).Join(haveEidSes, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (edi, se) => 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()).ToList();
|
|
|
//无EDI的发运数据
|
|
|
|
|
|
var notHaveEidSes = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false); |
|
|
//var haveEidHaveSes = from se in haveEidSesGroup
|
|
|
//无发运的EDI数据
|
|
|
// join edi in haveSeEidsGroup
|
|
|
var notHaveSeEids = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == false); |
|
|
// on new { se.PN, se.LU } equals new { edi.PN, edi.LU }
|
|
|
|
|
|
// select new JisBBACEidSeCompareExport()
|
|
|
//有EDI有发运
|
|
|
// {
|
|
|
var haveEdiHaveSes = haveEidSes.ToList(); |
|
|
// Category = default,
|
|
|
var dsdddd = haveSeEids.ToList(); |
|
|
// WmsBillNum = default,
|
|
|
//有EDI无发运
|
|
|
// CarModeCode = default,
|
|
|
var haveEdiNotHaveSes = notHaveEidSes.ToList(); |
|
|
// LineStationcode = default,
|
|
|
//无EDI有发运
|
|
|
// SequenceNumber = default,
|
|
|
var notHaveEdiHaveSes = notHaveSeEids.ToList(); |
|
|
// 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
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
|
|
////无EDI的发运数据
|
|
|
|
|
|
//var notHaveEidSes = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false);
|
|
|
|
|
|
////无发运的EDI数据
|
|
|
|
|
|
//var notHaveSeEids = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == false);
|
|
|
|
|
|
|
|
|
|
|
|
//var jisBBACEidSeCompareExports = new List<JisBBACEidSeCompareExport>();
|
|
|
|
|
|
////有EDI无发运
|
|
|
|
|
|
//var haveEdiNotHaveSeCompareExports = haveEidHaveSes.ToList();
|
|
|
|
|
|
////无EDI有发运
|
|
|
|
|
|
//var notHaveEdiHaveSeCompareExports = haveEidHaveSes.ToList();
|
|
|
|
|
|
|
|
|
|
|
|
//ExcelExporter excelExporter = new ExcelExporter();
|
|
|
|
|
|
//excelExporter
|
|
|
|
|
|
// .Append(haveEdiNotHaveSeCompareExports, $"BBACEDI数据和发货对比")
|
|
|
|
|
|
// .SeparateBySheet()
|
|
|
|
|
|
// .Append(notHaveEdiHaveSeCompareExports, $"BBAC发货和EDI数据对比")
|
|
|
|
|
|
// .SeparateBySheet();
|
|
|
|
|
|
|
|
|
|
|
|
//var result = excelExporter.ExportAppendDataAsByteArray();
|
|
|
|
|
|
//result.ShouldNotBeNull();
|
|
|
|
|
|
////_fileContainer.SaveAsync(filename, result.Result, true);
|
|
|
|
|
|
|
|
|
|
|
|
//Notify();
|
|
|
|
|
|
return id.ToString(); |
|
|
|
|
|
|
|
|
var ids = id.ToString(); |
|
|
var ids = id.ToString(); |
|
|
|
|
|
|
|
|