Browse Source

[CI SKIP] 印度件价格单过滤客户编码为1041

印度件结算导入使用印度件价格单数据匹配价格
master
mahao 1 year ago
parent
commit
daa41783a1
  1. 24
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  2. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceYinDu.cs

24
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs

@ -68,6 +68,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// </summary>
private readonly INormalEfCoreRepository<PriceListBJ, Guid> _priceBjListRepository;
/// <summary>
/// 印度价格仓储
/// </summary>
private readonly INormalEfCoreRepository<PriceListYinDu, Guid> _priceYinDuListRepository;
/// <summary>
/// 客户零件关系仓储
/// </summary>
private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _materialRelationshipRepository;
@ -87,6 +91,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> pubNotSaDetailRepository,
INormalEfCoreRepository<PriceList, Guid> priceListRepository,
INormalEfCoreRepository<PriceListBJ, Guid> priceBjListRepository,
INormalEfCoreRepository<PriceListYinDu, Guid> priceYinDuListRepository,
INormalEfCoreRepository<MaterialRelationship, Guid> materialRelationshipRepository,
INormalEfCoreRepository<TB_RePartsRelationship, Guid> tbRePartsRelationshipRepository,
IDistributedCache<PUB_SA> cache,
@ -103,6 +108,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
_pubNotSaDetailRepository = pubNotSaDetailRepository;
_priceListRepository = priceListRepository;
_priceBjListRepository = priceBjListRepository;
_priceYinDuListRepository = priceYinDuListRepository;
_materialRelationshipRepository = materialRelationshipRepository;
_tbRePartsRelationshipRepository = tbRePartsRelationshipRepository;
}
@ -550,6 +556,24 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
importPubSaDetail.Price = priceListEntity?.Price ?? 0;
});
}
else if(businessType == EnumBusinessType.YinDuJian)
{
//印度销售价格
var priceListEntitys = _priceYinDuListRepository.Where(t => t.IsCancel == false)
.Where(t => t.ClientCode == clientCode)
.Where(t => lus.Contains(t.LU)).ToList();
pubSaDetails.ForEach(importPubSaDetail =>
{
//根据物料号、结算日期获取价格
var priceListEntity = priceListEntitys
.Where(t => t.LU == importPubSaDetail.LU)
.Where(t => importPubSaDetail.SettleDate >= t.BeginDate && importPubSaDetail.SettleDate <= t.EndDate)
.OrderByDescending(t => t.Date)
.ThenByDescending(t => t.CreationTime)
.FirstOrDefault();
importPubSaDetail.Price = priceListEntity?.Price ?? 0;
});
}
else
{
//销售价格

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceYinDu.cs

@ -62,7 +62,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
var result = await _exportImporter.UploadExcelImportByHeadDesc<PriceListYinDuImportDto>(files, _excelImportService).ConfigureAwait(false);
var filter = new List<string>
{
"1049"
"1041"
};
result = result.Where(p => filter.Contains(p.Plant)).ToList();
result.FindAll(t => !string.IsNullOrEmpty(t.ES1) || !string.IsNullOrEmpty(t.ES2)).ForEach(t => t.PartNo = t.PartNo + new string(' ', 6) + t.ES1 + t.ES2);

Loading…
Cancel
Save