аааааааа
This commit is contained in:
parent
4b5d089fe1
commit
49a6924def
@ -94,43 +94,41 @@ namespace FactoryBusinessLogic.OfficePackage
|
|||||||
Style = "Normal",
|
Style = "Normal",
|
||||||
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||||
});
|
});
|
||||||
CreateTable(new List<string> { "3cm", "5cm", "5cm" });
|
CreateTable(new List<string> { "3cm", "5cm" });
|
||||||
|
foreach (var report in info.Workpieces)
|
||||||
|
{
|
||||||
CreateRow(new PdfRowParameters
|
CreateRow(new PdfRowParameters
|
||||||
{
|
{
|
||||||
Texts = new List<string> { "Название изделия", "Этапы выполнения", "Станки" },
|
Texts = new List<string> { "Заготовка", "Станок" },
|
||||||
Style = "NormalTitle",
|
Style = "NormalTitle",
|
||||||
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||||
});
|
});
|
||||||
foreach (var workpiece in info.Workpieces)
|
|
||||||
{
|
|
||||||
CreateRow(new PdfRowParameters
|
CreateRow(new PdfRowParameters
|
||||||
{
|
{
|
||||||
Texts = new List<string>
|
Texts = new List<string> { report.WorkpieceName, "" },
|
||||||
{
|
|
||||||
workpiece.WorkpieceName,
|
|
||||||
string.Empty,
|
|
||||||
string.Empty,
|
|
||||||
},
|
|
||||||
Style = "Normal",
|
Style = "Normal",
|
||||||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||||||
});
|
});
|
||||||
|
foreach (var machinee in report.Machines)
|
||||||
|
|
||||||
var tupleList = machineNames.Zip(phaseNames, Tuple.Create);
|
|
||||||
foreach (var tuple in tupleList)
|
|
||||||
{
|
|
||||||
CreateRow(new PdfRowParameters
|
CreateRow(new PdfRowParameters
|
||||||
{
|
{
|
||||||
Texts = new List<string>
|
Texts = new List<string> { "", machinee },
|
||||||
{
|
Style = "Normal",
|
||||||
string.Empty,
|
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||||||
tuple.Item1,
|
});
|
||||||
tuple.Item2,
|
CreateRow(new PdfRowParameters
|
||||||
},
|
{
|
||||||
|
Texts = new List<string> { "", "Этап выполнения" },
|
||||||
|
Style = "NormalTitle",
|
||||||
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||||
|
});
|
||||||
|
foreach (var phase in report.ExecutionPhases)
|
||||||
|
CreateRow(new PdfRowParameters
|
||||||
|
{
|
||||||
|
Texts = new List<string> { "", phase },
|
||||||
Style = "Normal",
|
Style = "Normal",
|
||||||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
SaveWorkerPdf(info);
|
SaveWorkerPdf(info);
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
{
|
{
|
||||||
public int? Id { get; set; }
|
public int? Id { get; set; }
|
||||||
public string? MachineName { get; set; }
|
public string? MachineName { get; set; }
|
||||||
public int WorkpieceId { get; set; }
|
public int? WorkpieceId { get; set; }
|
||||||
public int ClientId { get; set; }
|
public int ClientId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ using FactoryContracts.StoragesContracts;
|
|||||||
using FactoryContracts.ViewModels;
|
using FactoryContracts.ViewModels;
|
||||||
using FactoryDatabaseImplement.Models;
|
using FactoryDatabaseImplement.Models;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace FactoryDatabaseImplement.Implements
|
namespace FactoryDatabaseImplement.Implements
|
||||||
{
|
{
|
||||||
@ -23,9 +24,6 @@ namespace FactoryDatabaseImplement.Implements
|
|||||||
public List<MachineViewModel> GetFilteredList(MachineSearchModel model)
|
public List<MachineViewModel> GetFilteredList(MachineSearchModel model)
|
||||||
{
|
{
|
||||||
using var context = new FactoryDatabase();
|
using var context = new FactoryDatabase();
|
||||||
if (model.WorkpieceId.HasValue)
|
|
||||||
return context.Machines.Include(x => x.PlanProductions).Where(x => x.PlanProduction.Workpieces.FirstOrDefault(y => y.WorkpieceId == model.WorkpieceId) != null).Select(x => x.GetViewModel).ToList();
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(model.MachineName))
|
if (!string.IsNullOrEmpty(model.MachineName))
|
||||||
{
|
{
|
||||||
return context.Machines
|
return context.Machines
|
||||||
|
@ -277,7 +277,7 @@ namespace FactoryWorkerApp.Controllers
|
|||||||
HttpContext.Session.SetString("StartDate", startDate.ToString());
|
HttpContext.Session.SetString("StartDate", startDate.ToString());
|
||||||
HttpContext.Session.SetString("EndDate", endDate.ToString());
|
HttpContext.Session.SetString("EndDate", endDate.ToString());
|
||||||
|
|
||||||
return RedirectToAction("WorkpieceTimeReport");
|
return RedirectToAction("WorkpieceDateReport");
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
@ -55,6 +55,7 @@ app.UseHttpsRedirection();
|
|||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
app.UseSession();
|
||||||
|
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|
||||||
|
@ -6,6 +6,6 @@
|
|||||||
<h1 class="display-4">Выберите тип отчета</h1>
|
<h1 class="display-4">Выберите тип отчета</h1>
|
||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="GetByPlans">Отчет изделий по производствам</a>
|
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="GetByPlans">Отчет изделий по производствам</a>
|
||||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="WorkpieceDateReport">Отчет по заготовкам по датам</a>
|
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="WorkpieceTimeChoose">Отчет по заготовкам по датам</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -114,28 +114,5 @@ namespace FactoryWorkerApp
|
|||||||
{
|
{
|
||||||
return _productLogic.ReadList(null);
|
return _productLogic.ReadList(null);
|
||||||
}
|
}
|
||||||
public List<WorkpieceTimeReportViewModel>? GetWorkpieceTime(DateTime? startDate, DateTime? endDate, int ClientId)
|
|
||||||
{
|
|
||||||
var workpieces = _workpieceLogic.ReadList(new() { DateFrom = startDate, DateTo = endDate, ClientId = ClientId });
|
|
||||||
if (workpieces == null)
|
|
||||||
return new();
|
|
||||||
List<WorkpieceTimeReportViewModel> detailTimeReports = new List<WorkpieceTimeReportViewModel>();
|
|
||||||
foreach (var i in workpieces)
|
|
||||||
{
|
|
||||||
WorkpieceTimeReportViewModel report = new();
|
|
||||||
var workpiece = _workpieceLogic.ReadElement(new() { Id = i.Id });
|
|
||||||
report.WorkpieceName = workpiece!.WorkpieceName;
|
|
||||||
var phases = _executionPhaseLogic.ReadList(new() { WorkpieceId = i.Id });
|
|
||||||
if (phases != null)
|
|
||||||
report.ExecutionPhases = phases.Select(w => w.ExecutionPhaseName).ToList();
|
|
||||||
var machines = _machineLogic.ReadList(new() { WorkpieceId = i.Id });
|
|
||||||
if (machines != null)
|
|
||||||
report.Machines = machines.Select(w => w.MachineName).ToList();
|
|
||||||
detailTimeReports.Add(report);
|
|
||||||
}
|
|
||||||
return detailTimeReports;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user