Browse Source

备件业务也能正常录入客户零件关系

master
zhouhongjun 4 months ago
parent
commit
d171b8eb5c
  1. 26
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs

26
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;

Loading…
Cancel
Save