|
|
@ -5,6 +5,7 @@ using EFCore.BulkExtensions; |
|
|
|
using Magicodes.ExporterAndImporter.Core.Extension; |
|
|
|
using Magicodes.ExporterAndImporter.Excel; |
|
|
|
using Microsoft.AspNetCore.SignalR; |
|
|
|
using Microsoft.CodeAnalysis.CSharp.Syntax; |
|
|
|
using SettleAccount.Bases; |
|
|
|
using SettleAccount.Domain.BQ; |
|
|
|
using SettleAccount.Job.SignalR; |
|
|
@ -44,7 +45,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
{ |
|
|
|
//结算
|
|
|
|
var saGroup = from sa in _settleAccountDbContext.Set<TSaDetail>() |
|
|
|
where sa.BusinessType == businessType |
|
|
|
where sa.BusinessType == businessType && sa.MappingType == EnumMappingType.None |
|
|
|
group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem |
|
|
|
select new |
|
|
|
{ |
|
|
@ -71,6 +72,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
}; |
|
|
|
//发运
|
|
|
|
var seGroup = from se in _settleAccountDbContext.Set<TSeDetail>() |
|
|
|
where se.BusinessType == businessType |
|
|
|
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem |
|
|
|
select new |
|
|
|
{ |
|
|
@ -211,32 +213,64 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
//获取二次比对上的数据
|
|
|
|
secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes |
|
|
|
join haveSaNotHaveSe in haveSaNotHaveSes |
|
|
|
on new { notHaveSaHaveSe.PN, notHaveSaHaveSe.ReplaceFactoryPartCode } equals new { haveSaNotHaveSe.PN, haveSaNotHaveSe.ReplaceFactoryPartCode } |
|
|
|
select new SaSeCompareDiff() |
|
|
|
{ |
|
|
|
WmsBillNum = notHaveSaHaveSe.WmsBillNum, |
|
|
|
ShippingDate = notHaveSaHaveSe.ShippingDate, |
|
|
|
SeqNumber = notHaveSaHaveSe.SeqNumber, |
|
|
|
PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber, |
|
|
|
CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime, |
|
|
|
SAQty = haveSaNotHaveSe.SAQty, |
|
|
|
SEQty = notHaveSaHaveSe.SEQty, |
|
|
|
PN = haveSaNotHaveSe.PN, |
|
|
|
ToLocCode = notHaveSaHaveSe.ToLocCode, |
|
|
|
ToErpLocCode = notHaveSaHaveSe.ToErpLocCode, |
|
|
|
Category = EnumPubSaSeCompareCategory.HaveSaHaveSe, |
|
|
|
SeCustomerPartCode = notHaveSaHaveSe.SeCustomerPartCode, |
|
|
|
SeFactoryPartCode = notHaveSaHaveSe.SeFactoryPartCode, |
|
|
|
SaCustomerPartCode = haveSaNotHaveSe.SaCustomerPartCode, |
|
|
|
SaFactoryPartCode = haveSaNotHaveSe.SaFactoryPartCode, |
|
|
|
CustomerPartCode = haveSaNotHaveSe.CustomerPartCode, |
|
|
|
PartCodeDesc = haveSaNotHaveSe.PartCodeDesc, |
|
|
|
FactoryPartCode = haveSaNotHaveSe.FactoryPartCode, |
|
|
|
ReplaceFactoryPartCode = haveSaNotHaveSe.ReplaceFactoryPartCode |
|
|
|
}).ToList(); |
|
|
|
if (businessType != EnumBusinessType.YinDuJian) |
|
|
|
{ |
|
|
|
//获取二次比对上的数据
|
|
|
|
secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes |
|
|
|
join haveSaNotHaveSe in haveSaNotHaveSes |
|
|
|
on new { notHaveSaHaveSe.PN, notHaveSaHaveSe.ReplaceFactoryPartCode } equals new { haveSaNotHaveSe.PN, haveSaNotHaveSe.ReplaceFactoryPartCode } |
|
|
|
select new SaSeCompareDiff() |
|
|
|
{ |
|
|
|
WmsBillNum = notHaveSaHaveSe.WmsBillNum, |
|
|
|
ShippingDate = notHaveSaHaveSe.ShippingDate, |
|
|
|
SeqNumber = notHaveSaHaveSe.SeqNumber, |
|
|
|
PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber, |
|
|
|
CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime, |
|
|
|
SAQty = haveSaNotHaveSe.SAQty, |
|
|
|
SEQty = notHaveSaHaveSe.SEQty, |
|
|
|
PN = haveSaNotHaveSe.PN, |
|
|
|
ToLocCode = notHaveSaHaveSe.ToLocCode, |
|
|
|
ToErpLocCode = notHaveSaHaveSe.ToErpLocCode, |
|
|
|
Category = EnumPubSaSeCompareCategory.HaveSaHaveSe, |
|
|
|
SeCustomerPartCode = notHaveSaHaveSe.SeCustomerPartCode, |
|
|
|
SeFactoryPartCode = notHaveSaHaveSe.SeFactoryPartCode, |
|
|
|
SaCustomerPartCode = haveSaNotHaveSe.SaCustomerPartCode, |
|
|
|
SaFactoryPartCode = haveSaNotHaveSe.SaFactoryPartCode, |
|
|
|
CustomerPartCode = haveSaNotHaveSe.CustomerPartCode, |
|
|
|
PartCodeDesc = haveSaNotHaveSe.PartCodeDesc, |
|
|
|
FactoryPartCode = haveSaNotHaveSe.FactoryPartCode, |
|
|
|
ReplaceFactoryPartCode = haveSaNotHaveSe.ReplaceFactoryPartCode |
|
|
|
}).ToList(); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
//获取二次比对上的数据
|
|
|
|
secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes |
|
|
|
join haveSaNotHaveSe in haveSaNotHaveSes |
|
|
|
on new { notHaveSaHaveSe.ReplaceFactoryPartCode } equals new { haveSaNotHaveSe.ReplaceFactoryPartCode } |
|
|
|
select new SaSeCompareDiff() |
|
|
|
{ |
|
|
|
WmsBillNum = notHaveSaHaveSe.WmsBillNum, |
|
|
|
ShippingDate = notHaveSaHaveSe.ShippingDate, |
|
|
|
SeqNumber = notHaveSaHaveSe.SeqNumber, |
|
|
|
PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber, |
|
|
|
CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime, |
|
|
|
SAQty = haveSaNotHaveSe.SAQty, |
|
|
|
SEQty = notHaveSaHaveSe.SEQty, |
|
|
|
PN = haveSaNotHaveSe.PN, |
|
|
|
ToLocCode = notHaveSaHaveSe.ToLocCode, |
|
|
|
ToErpLocCode = notHaveSaHaveSe.ToErpLocCode, |
|
|
|
Category = EnumPubSaSeCompareCategory.HaveSaHaveSe, |
|
|
|
SeCustomerPartCode = notHaveSaHaveSe.SeCustomerPartCode, |
|
|
|
SeFactoryPartCode = notHaveSaHaveSe.SeFactoryPartCode, |
|
|
|
SaCustomerPartCode = haveSaNotHaveSe.SaCustomerPartCode, |
|
|
|
SaFactoryPartCode = haveSaNotHaveSe.SaFactoryPartCode, |
|
|
|
CustomerPartCode = haveSaNotHaveSe.CustomerPartCode, |
|
|
|
PartCodeDesc = haveSaNotHaveSe.PartCodeDesc, |
|
|
|
FactoryPartCode = haveSaNotHaveSe.FactoryPartCode, |
|
|
|
ReplaceFactoryPartCode = haveSaNotHaveSe.ReplaceFactoryPartCode |
|
|
|
}).ToList(); |
|
|
|
} |
|
|
|
return secondMatchHaveSaHaveSes; |
|
|
|
} |
|
|
|
|
|
|
|