From d171b8eb5cfea00ec1f92531e1d6e8b7c28cb288 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Thu, 11 Jul 2024 17:16:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=B6=E4=B8=9A=E5=8A=A1=E4=B9=9F?= =?UTF-8?q?=E8=83=BD=E6=AD=A3=E5=B8=B8=E5=BD=95=E5=85=A5=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E9=9B=B6=E4=BB=B6=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Syncs/JitSeSyncAppService.cs | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs index dcc402b3..ec00c68e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs @@ -120,16 +120,24 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs var businessType = SeSyncConfigInfo.BusinessType; if (seDetails.Any()) { - if (businessType != EnumBusinessType.BeiJian) + //if (businessType != EnumBusinessType.BeiJian) + //{ + // //备件以外其他业务添加客户零件号与厂内零件号关系 + // //客户零件号和厂内零件号 + // var luRePartCodes = seDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); + // if (luRePartCodes.Any()) + // { + // var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.FactoryPartCode, "", t.LU, businessType)); + // await _syncExtendManager.AddNewMaterialRelationshipsAsync(materialRelationships).ConfigureAwait(false); + // } + //} + + //客户零件号和厂内零件号 + var luRePartCodes = seDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); + if (luRePartCodes.Any()) { - //备件以外其他业务添加客户零件号与厂内零件号关系 - //客户零件号和厂内零件号 - var luRePartCodes = seDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); - if (luRePartCodes.Any()) - { - var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.FactoryPartCode, "", t.LU, businessType)); - await _syncExtendManager.AddNewMaterialRelationshipsAsync(materialRelationships).ConfigureAwait(false); - } + var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.FactoryPartCode, "", t.LU, businessType)); + await _syncExtendManager.AddNewMaterialRelationshipsAsync(materialRelationships).ConfigureAwait(false); } var dateTimeNow = DateTime.Now;