working excel report
This commit is contained in:
parent
496d4a0f77
commit
37facf0620
@ -52,18 +52,19 @@ namespace ProjectPublishing.Reports
|
||||
CountOut = (int?)null
|
||||
})
|
||||
.Union(
|
||||
_orderRepository
|
||||
.ReadOrders() // тут где-то
|
||||
.Where(x => x.OrderDate >= startDate && x.OrderDate <= endDate && x.Materials.Any(y => y.MaterialsId == materialId))
|
||||
.SelectMany(order => order.Materials
|
||||
.Where(m => m.MaterialsId == materialId)
|
||||
.Select(m => new {
|
||||
MaterialId = m.MaterialsId,
|
||||
Date = order.OrderDate,
|
||||
CountIn = (int?)null,
|
||||
CountOut = (int?)m.Amount
|
||||
})))
|
||||
.OrderBy(x => x.Date);
|
||||
_orderRepository
|
||||
.ReadOrders() // тут где-то
|
||||
.Where(x => x.OrderDate >= startDate && x.OrderDate <= endDate.AddDays(1) && x.Materials.Any(y => y.MaterialsId == materialId))
|
||||
.SelectMany(order => order.Materials
|
||||
.Where(m => m.MaterialsId == materialId)
|
||||
.Select(m => new
|
||||
{
|
||||
MaterialId = m.MaterialsId,
|
||||
Date = order.OrderDate,
|
||||
CountIn = (int?)null,
|
||||
CountOut = (int?)m.Amount
|
||||
})))
|
||||
.OrderBy(x => x.Date);
|
||||
_logger.LogDebug("Объединенные данные в отчет: {json}", JsonConvert.SerializeObject(data));
|
||||
return new List<string[]> { item }
|
||||
.Union(
|
||||
|
@ -87,7 +87,9 @@ WHERE Id=@id";
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
|
||||
var querySelect = @"
|
||||
SELECT o.*, ma.MaterialId
|
||||
SELECT o.*,
|
||||
ma.MaterialId as MaterialsId,
|
||||
ma.Amount as MaterialsAmount
|
||||
FROM PrintingOrder o
|
||||
LEFT JOIN OrderMaterials ma ON o.Id = ma.OrderId
|
||||
"; // возможно сюда фикс
|
||||
|
Loading…
x
Reference in New Issue
Block a user