Browse Source

买点件、备件、印度件、直供件都按lu和pn更新发运数据零件号和库位

master
zhouhongjun 3 months ago
parent
commit
7c3c9557d1
  1. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs
  2. 16
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
  3. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs

3
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs

@ -239,6 +239,7 @@ namespace SettleAccount.Job.Services.Report
Version = sa.Version, Version = sa.Version,
CustomerOfflineTime = sa.SettleDate, CustomerOfflineTime = sa.SettleDate,
PN = sa.PN, PN = sa.PN,
LU = sa.LU,
SAQty = sa.Qty, SAQty = sa.Qty,
SaCustomerPartCode = sa.CustomerPartCodeNoSpace, SaCustomerPartCode = sa.CustomerPartCodeNoSpace,
SaFactoryPartCode = sa.PartCode, SaFactoryPartCode = sa.PartCode,
@ -259,6 +260,7 @@ namespace SettleAccount.Job.Services.Report
WmsBillNum = se.WmsBillNum, WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,
PN = se.PN, PN = se.PN,
LU = se.LU,
SEQty = se.Qty, SEQty = se.Qty,
ToLocCode = se.ToLocCode, ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode, ToErpLocCode = se.ToErpLocCode,
@ -281,6 +283,7 @@ namespace SettleAccount.Job.Services.Report
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate, CustomerOfflineTime = sa.SettleDate,
PN = sa.PN, PN = sa.PN,
LU = sa.LU,
SAQty = sa.Qty, SAQty = sa.Qty,
SEQty = se.Qty, SEQty = se.Qty,
ToLocCode = se.ToLocCode, ToLocCode = se.ToLocCode,

16
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs

@ -279,6 +279,7 @@ namespace SettleAccount.Job.Services.Report
Version = sa.Version, Version = sa.Version,
CustomerOfflineTime = sa.SettleDate, CustomerOfflineTime = sa.SettleDate,
PN = sa.PN, PN = sa.PN,
LU = sa.LU,
SAQty = sa.Qty, SAQty = sa.Qty,
SaCustomerPartCode = sa.CustomerPartCodeNoSpace, SaCustomerPartCode = sa.CustomerPartCodeNoSpace,
SaFactoryPartCode = sa.PartCode, SaFactoryPartCode = sa.PartCode,
@ -298,6 +299,7 @@ namespace SettleAccount.Job.Services.Report
WmsBillNum = se.WmsBillNum, WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,
PN = se.PN, PN = se.PN,
LU = se.LU,
SEQty = se.Qty, SEQty = se.Qty,
ToLocCode = se.ToLocCode, ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode, ToErpLocCode = se.ToErpLocCode,
@ -319,6 +321,7 @@ namespace SettleAccount.Job.Services.Report
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate, CustomerOfflineTime = sa.SettleDate,
PN = sa.PN, PN = sa.PN,
LU = sa.LU,
SAQty = sa.Qty, SAQty = sa.Qty,
SEQty = se.Qty, SEQty = se.Qty,
ToLocCode = se.ToLocCode, ToLocCode = se.ToLocCode,
@ -351,6 +354,7 @@ namespace SettleAccount.Job.Services.Report
groupItem.Key.CustomerPartCodeNoSpace, groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty), Qty = groupItem.Sum(t => t.Qty),
Version = groupItem.Max(t => t.Version), Version = groupItem.Max(t => t.Version),
PN = groupItem.Max(t => t.PN),
LU = groupItem.Max(t => t.LU), LU = groupItem.Max(t => t.LU),
SettleDate = groupItem.Max(t => t.SettleDate), SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode), PartCode = groupItem.Max(t => t.PartCode),
@ -365,6 +369,7 @@ namespace SettleAccount.Job.Services.Report
groupItem.Key.CustomerPartCodeNoSpace, groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty), Qty = groupItem.Sum(t => t.Qty),
Version = groupItem.Max(t => t.Version), Version = groupItem.Max(t => t.Version),
PN = groupItem.Max(t => t.PN),
LU = groupItem.Max(t => t.LU), LU = groupItem.Max(t => t.LU),
SettleDate = groupItem.Max(t => t.SettleDate), SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode), PartCode = groupItem.Max(t => t.PartCode),
@ -379,6 +384,7 @@ namespace SettleAccount.Job.Services.Report
groupItem.Key.CustomerPartCodeNoSpace, groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty), Qty = groupItem.Sum(t => t.Qty),
Version = groupItem.Max(t => t.Version), Version = groupItem.Max(t => t.Version),
PN = groupItem.Max(t => t.PN),
LU = groupItem.Max(t => t.LU), LU = groupItem.Max(t => t.LU),
SettleDate = groupItem.Max(t => t.SettleDate), SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode), PartCode = groupItem.Max(t => t.PartCode),
@ -393,6 +399,7 @@ namespace SettleAccount.Job.Services.Report
{ {
groupItem.Key.CustomerPartCodeNoSpace, groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty), Qty = groupItem.Sum(t => t.Qty),
PN = groupItem.Max(t => t.PN),
LU = groupItem.Max(t => t.LU), LU = groupItem.Max(t => t.LU),
WmsBillNum = groupItem.Max(t => t.WmsBillNum), WmsBillNum = groupItem.Max(t => t.WmsBillNum),
ShippingDate = groupItem.Max(t => t.ShippingDate), ShippingDate = groupItem.Max(t => t.ShippingDate),
@ -413,6 +420,8 @@ namespace SettleAccount.Job.Services.Report
Version = sa.Version, Version = sa.Version,
CustomerOfflineTime = sa.SettleDate, CustomerOfflineTime = sa.SettleDate,
SAQty = sa.Qty, SAQty = sa.Qty,
PN = sa.PN,
LU = sa.LU,
SaCustomerPartCode = sa.CustomerPartCodeNoSpace, SaCustomerPartCode = sa.CustomerPartCodeNoSpace,
SaFactoryPartCode = sa.PartCode, SaFactoryPartCode = sa.PartCode,
CustomerPartCode = sa.LU, CustomerPartCode = sa.LU,
@ -431,6 +440,8 @@ namespace SettleAccount.Job.Services.Report
WmsBillNum = se.WmsBillNum, WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,
SEQty = se.Qty, SEQty = se.Qty,
PN = se.PN,
LU = se.LU,
ToLocCode = se.ToLocCode, ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode, ToErpLocCode = se.ToErpLocCode,
SeCustomerPartCode = se.CustomerPartCodeNoSpace, SeCustomerPartCode = se.CustomerPartCodeNoSpace,
@ -451,6 +462,8 @@ namespace SettleAccount.Job.Services.Report
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate, CustomerOfflineTime = sa.SettleDate,
SAQty = sa.Qty, SAQty = sa.Qty,
PN = sa.PN,
LU = sa.LU,
SEQty = se.Qty, SEQty = se.Qty,
ToLocCode = se.ToLocCode, ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode, ToErpLocCode = se.ToErpLocCode,
@ -544,6 +557,7 @@ namespace SettleAccount.Job.Services.Report
Version = sa.Version, Version = sa.Version,
CustomerOfflineTime = sa.SettleDate, CustomerOfflineTime = sa.SettleDate,
PN = sa.PN, PN = sa.PN,
LU = sa.LU,
SAQty = sa.Qty, SAQty = sa.Qty,
SaCustomerPartCode = sa.LU, SaCustomerPartCode = sa.LU,
SaFactoryPartCode = sa.FactoryPartCode, SaFactoryPartCode = sa.FactoryPartCode,
@ -563,6 +577,7 @@ namespace SettleAccount.Job.Services.Report
WmsBillNum = se.WmsBillNum, WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,
PN = se.PN, PN = se.PN,
LU = se.LU,
SEQty = se.Qty, SEQty = se.Qty,
ToLocCode = se.ToLocCode, ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode, ToErpLocCode = se.ToErpLocCode,
@ -584,6 +599,7 @@ namespace SettleAccount.Job.Services.Report
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate, CustomerOfflineTime = sa.SettleDate,
PN = sa.PN, PN = sa.PN,
LU = sa.LU,
SAQty = sa.Qty, SAQty = sa.Qty,
SEQty = se.Qty, SEQty = se.Qty,
ToLocCode = se.ToLocCode, ToLocCode = se.ToLocCode,

15
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs

@ -122,6 +122,7 @@ namespace SettleAccount.Job.Services.Report
Version = sa.Version, Version = sa.Version,
CustomerOfflineTime = sa.SettleDate, CustomerOfflineTime = sa.SettleDate,
PN = sa.PN, PN = sa.PN,
LU = sa.LU,
SAQty = sa.Qty, SAQty = sa.Qty,
SaCustomerPartCode = sa.CustomerPartCodeNoSpace, SaCustomerPartCode = sa.CustomerPartCodeNoSpace,
SaFactoryPartCode = sa.PartCode, SaFactoryPartCode = sa.PartCode,
@ -141,6 +142,7 @@ namespace SettleAccount.Job.Services.Report
WmsBillNum = se.WmsBillNum, WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,
PN = se.PN, PN = se.PN,
LU = se.LU,
SEQty = se.Qty, SEQty = se.Qty,
ToLocCode = se.ToLocCode, ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode, ToErpLocCode = se.ToErpLocCode,
@ -162,6 +164,7 @@ namespace SettleAccount.Job.Services.Report
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate, CustomerOfflineTime = sa.SettleDate,
PN = sa.PN, PN = sa.PN,
LU = sa.LU,
SAQty = sa.Qty, SAQty = sa.Qty,
SEQty = se.Qty, SEQty = se.Qty,
ToLocCode = se.ToLocCode, ToLocCode = se.ToLocCode,
@ -200,8 +203,8 @@ namespace SettleAccount.Job.Services.Report
break; break;
case EnumPubSaSeCompareCategory.HaveSaHaveSe: case EnumPubSaSeCompareCategory.HaveSaHaveSe:
{ {
p.FactoryPartCode = p.SaFactoryPartCode; p.FactoryPartCode = p.SeFactoryPartCode;
p.ReplaceFactoryPartCode = p.SaFactoryPartCode; p.ReplaceFactoryPartCode = p.SeFactoryPartCode;
} }
break; break;
case EnumPubSaSeCompareCategory.HaveSaNotHaveSe: case EnumPubSaSeCompareCategory.HaveSaNotHaveSe:
@ -339,10 +342,12 @@ namespace SettleAccount.Job.Services.Report
select sa).ToList(); select sa).ToList();
if (canSaDetails.Any()) if (canSaDetails.Any())
{ {
var canSaDetailsUpdate = canSaDetails.Join(haveSaHaveSes, o => new { o.PN, o.PartCode }, i => new { i.PN, PartCode = i.FactoryPartCode }, (o, i) => //var canSaDetailsUpdate = canSaDetails.Join(haveSaHaveSes, o => new { o.PN, o.PartCode }, i => new { i.PN, PartCode = i.FactoryPartCode }, (o, i) =>
var canSaDetailsUpdate = canSaDetails.Join(haveSaHaveSes, o => new { o.PN, o.LU }, i => new { i.PN, i.LU }, (o, i) =>
{ {
o.ErpLoc = i.ToErpLocCode; o.ErpLoc = i.ToErpLocCode;
o.RealPartCode = i.ReplaceFactoryPartCode; o.RealPartCode = i.ReplaceFactoryPartCode;
o.PartCode = i.ReplaceFactoryPartCode;
return o; return o;
}).ToList(); }).ToList();
_settleAccountDbContext.BulkUpdate(canSaDetailsUpdate); _settleAccountDbContext.BulkUpdate(canSaDetailsUpdate);
@ -354,10 +359,12 @@ namespace SettleAccount.Job.Services.Report
select sa).ToList(); select sa).ToList();
if (notSaDetails.Any()) if (notSaDetails.Any())
{ {
var notSaDetailsUpdate = notSaDetails.Join(haveSaHaveSes, o => new { o.PN, o.PartCode }, i => new { i.PN, PartCode = i.FactoryPartCode }, (o, i) => //var notSaDetailsUpdate = notSaDetails.Join(haveSaHaveSes, o => new { o.PN, o.PartCode }, i => new { i.PN, PartCode = i.FactoryPartCode }, (o, i) =>
var notSaDetailsUpdate = notSaDetails.Join(haveSaHaveSes, o => new { o.PN, o.LU }, i => new { i.PN, i.LU }, (o, i) =>
{ {
o.ErpLoc = i.ToErpLocCode; o.ErpLoc = i.ToErpLocCode;
o.RealPartCode = i.ReplaceFactoryPartCode; o.RealPartCode = i.ReplaceFactoryPartCode;
o.PartCode = i.ReplaceFactoryPartCode;
return o; return o;
}).ToList(); }).ToList();
_settleAccountDbContext.BulkUpdate(notSaDetailsUpdate); _settleAccountDbContext.BulkUpdate(notSaDetailsUpdate);

Loading…
Cancel
Save