diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs index 528ea414..45347853 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs @@ -369,12 +369,19 @@ namespace SettleAccount.Job.Services.Report //有结算无发运 var haveSaNotHaveSes = saSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe); var keyCodes = haveSaNotHaveSes.Select(t => t.PN + t.CustomerPartCode).ToList(); - var edis = _settleAccountDbContext.Set().Where(t => keyCodes.Contains(t.KeyCode)); - saSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe).ForEach(saSeCompareDiff => + var ediKeyCodes = _settleAccountDbContext.Set() + .Where(t => keyCodes.Contains(t.PN + t.CustomerPartCodeNoSpace)) + .Select(t => t.PN + t.CustomerPartCodeNoSpace) + .Distinct().ToList(); + + if (ediKeyCodes.Any()) { - saSeCompareDiff.Remark = "有Edi"; - }); - return null; + saSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe && ediKeyCodes.Contains(t.PN + t.CustomerPartCode)).ForEach(saSeCompareDiff => + { + saSeCompareDiff.Remark = "有Edi"; + }); + } + return saSeCompareDiffs; } } }