|
|
@ -76,19 +76,25 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
|
|
|
|
HandleSaSeEdiCompareDiffList(saSeEdiCompareDiffs); |
|
|
|
|
|
|
|
//var sa1 = saSeEdiCompareDiffs.FindAll(t => t.PN == "3819841").ToList();
|
|
|
|
//var sa2 = sa1.FindAll(t => t.SaCustomerPartCode == "A2068808405").ToList();
|
|
|
|
|
|
|
|
//saSeEdiCompareDiffs = saSeEdiCompareDiffs.FindAll(t => t.PN == "3819841").ToList();
|
|
|
|
|
|
|
|
|
|
|
|
#region 二次对比
|
|
|
|
//二次匹配上的记录
|
|
|
|
var secondMatchHaveSaHaveSes = HandleSecondCompare(saSeEdiCompareDiffs, businessType); |
|
|
|
if (secondMatchHaveSaHaveSes.Any()) |
|
|
|
{ |
|
|
|
//二次匹配 匹配上的厂内零件号、PN
|
|
|
|
var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN }); |
|
|
|
saSeEdiCompareDiffs.RemoveAll<SaSeEdiCompareDiff>(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN })); |
|
|
|
saSeEdiCompareDiffs.AddRange(secondMatchHaveSaHaveSes); |
|
|
|
//二次对比比对上的数据入库
|
|
|
|
var seCDetailEntitys = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<BBAC_SEC_DETAIL>>(secondMatchHaveSaHaveSes); |
|
|
|
_settleAccountDbContext.Set<BBAC_SEC_DETAIL>().AddRange(seCDetailEntitys); |
|
|
|
} |
|
|
|
//var secondMatchHaveSaHaveSes = HandleSecondCompare(saSeEdiCompareDiffs, businessType);
|
|
|
|
//if (secondMatchHaveSaHaveSes.Any())
|
|
|
|
//{
|
|
|
|
// //二次匹配 匹配上的厂内零件号、PN
|
|
|
|
// var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN });
|
|
|
|
// saSeEdiCompareDiffs.RemoveAll<SaSeEdiCompareDiff>(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN }));
|
|
|
|
// saSeEdiCompareDiffs.AddRange(secondMatchHaveSaHaveSes);
|
|
|
|
// //二次对比比对上的数据入库
|
|
|
|
// var seCDetailEntitys = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<BBAC_SEC_DETAIL>>(secondMatchHaveSaHaveSes);
|
|
|
|
// _settleAccountDbContext.Set<BBAC_SEC_DETAIL>().AddRange(seCDetailEntitys);
|
|
|
|
//}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 结算数据处理
|
|
|
@ -155,7 +161,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
// Site = groupItem.Max(t => t.Site),
|
|
|
|
// Price = groupItem.Max(t => t.Price),
|
|
|
|
// };
|
|
|
|
var saGroup = from sa in _settleAccountDbContext.Set<BBAC_SA_DETAIL>() |
|
|
|
var saGroup = from sa in _settleAccountDbContext.Set<BBAC_SA_DETAIL>() |
|
|
|
where sa.BusinessType == businessType |
|
|
|
group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem |
|
|
|
select new |
|
|
@ -186,8 +192,8 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
// ToLoc = groupItem.Max(t => t.ToLoc),
|
|
|
|
// ErpToLoc = groupItem.Max(t => t.ErpToLoc)
|
|
|
|
// }).Where(t => t.Qty != 0M);
|
|
|
|
var seGroup = (from se in _settleAccountDbContext.Set<BBAC_SE_DETAIL>() |
|
|
|
where se.BusinessType == businessType |
|
|
|
var seGroup = (from se in _settleAccountDbContext.Set<BBAC_SE_DETAIL>() |
|
|
|
where se.BusinessType == businessType |
|
|
|
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem |
|
|
|
select new |
|
|
|
{ |
|
|
@ -200,7 +206,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
FactoryPartCode = groupItem.Max(t => t.FactoryPartCode), |
|
|
|
ToLoc = groupItem.Max(t => t.ToLoc), |
|
|
|
ErpToLoc = groupItem.Max(t => t.ErpToLoc) |
|
|
|
}).Where(t => t.Qty != 0M); |
|
|
|
}).Where(t => t.Qty > 0M); |
|
|
|
//Edi
|
|
|
|
//var ediGroup = from edi in _settleAccountDbContext.Set<BBAC_SE_EDI>()
|
|
|
|
// where edi.IsDeleted == false && edi.IsHaveSeData == true && edi.State == 0
|
|
|
|