diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs index 1a2a9880..65272734 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs @@ -248,6 +248,15 @@ WHERE a.version='" + version + "'"; _settleAccountDbContext.Database.ExecuteSqlRaw(sql_NOTCAN_SA); _settleAccountDbContext.SaveChanges(); + + var sql_SA = @"UPDATE a +SET a.PartCode=b.RealPartCode +FROM [BQ_SA].[dbo].[Set_BBAC_SA_DETAIL] a +INNER JOIN [BQ_SA].[dbo].[Set_BBAC_SE_DETAIL] b ON a.LU=b.lu and a.PN=b.PN and a.BusinessType=b.BusinessType +WHERE a.PartCode!=b.RealPartCode and a.version='" + version + "'"; + + _settleAccountDbContext.Database.ExecuteSqlRaw(sql_SA); + _settleAccountDbContext.SaveChanges(); } else { @@ -269,6 +278,15 @@ WHERE a.version='" + version + "'"; _settleAccountDbContext.Database.ExecuteSqlRaw(sql_NOTCAN_SA); _settleAccountDbContext.SaveChanges(); + var sql_SA = @"UPDATE a +SET a.PartCode=b.RealPartCode +FROM [BQ_SA].[dbo].[Set_HBPO_SA_DETAIL] a +INNER JOIN [BQ_SA].[dbo].[Set_HBPO_SE_DETAIL] b ON a.LU=b.lu and a.PN=b.PN and a.BusinessType=b.BusinessType +WHERE a.PartCode!=b.RealPartCode and a.version='" + version + "'"; + + _settleAccountDbContext.Database.ExecuteSqlRaw(sql_SA); + _settleAccountDbContext.SaveChanges(); + }