Warehouses #1

Merged
trent merged 159 commits from Warehouses into master 2026-01-10 20:24:17 +00:00
2 changed files with 18 additions and 3 deletions
Showing only changes of commit 9f38998135 - Show all commits

View File

@@ -6,7 +6,7 @@ public class ProductDto : DtoBase
public int RecipientID { get; set; } public int RecipientID { get; set; }
public string RecipientIdx { get; set; } public string RecipientIdx { get; set; }
public string FaIdx { get; set; } public string FaIdx { get; set; }
public string RecipientName => Recipient.RecipientDesc; public string RecipientName { get; set; }
public RecipientDto Recipient { get; set; } public RecipientDto Recipient { get; set; }
} }

View File

@@ -20,9 +20,24 @@ public class ProductService : ServiceBase<ProductDto>, IProductService
public async Task<IEnumerable<ProductDto?>> GetEntitiesToFix(string indexName) public async Task<IEnumerable<ProductDto?>> GetEntitiesToFix(string indexName)
{ {
IList<RecipientDto> recipients =
(await Context.Recipients.ToListAsync()).Select(x => Mapper.Map<RecipientDto>(x)).ToList();
IList<ProductDto> products = (await GetAll()).ToList(); IList<ProductDto> products = (await GetAll()).ToList();
return products.Where(x => x?.FaIdx == indexName); IEnumerable<ProductDto> productDtos = products.Where(x => x?.FaIdx == indexName);
foreach (ProductDto productDto in productDtos)
{
RecipientDto? recipient = recipients.FirstOrDefault(x => x.ID == productDto.RecipientID);
if (recipient != null)
{
productDto.Recipient = recipient;
productDto.RecipientName = recipient.RecipientDesc;
}
}
return productDtos;
} }
public async Task UpdateEntity(ProductDto entity) public async Task UpdateEntity(ProductDto entity)