report change
This commit is contained in:
@@ -1951,16 +1951,24 @@ public class ReportRepository : IReportRepository
|
||||
{
|
||||
var contractSigned = workshop.Contracts2.Count(x => x.Signature == "1");
|
||||
var contractCreated = workshop.Contracts2.Count();
|
||||
int contractSignedPercent = 0;
|
||||
if (contractSigned > 0)
|
||||
{
|
||||
contractSignedPercent = workshop.Contracts2.Any(x => x.Signature == "0") ? ((contractSigned * 100) / contractCreated) : 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
contractSignedPercent = 0;
|
||||
}
|
||||
|
||||
var checkoutSignedPercent = workshop.Contracts2.Any(x => x.Signature == "0") ? ((contractSigned * 100) / contractCreated) : 100;
|
||||
if (checkoutSignedPercent < 100 && contractCreated > 0)
|
||||
if (contractSignedPercent < 100 && contractCreated > 0)
|
||||
{
|
||||
|
||||
var employeeNotDone =
|
||||
workshop.Contracts2.Where(x => x.Signature == "0").Select(l => new EmployeeNotDone()
|
||||
{
|
||||
Id = l.EmployeeId,
|
||||
EmployeeFullName = workshop.LeftWorks.FirstOrDefault(x=>x.EmployeeId == l.EmployeeId)!.EmployeeFullName,
|
||||
EmployeeFullName = workshop.LeftWorks.FirstOrDefault(x => x.EmployeeId == l.EmployeeId)!.EmployeeFullName,
|
||||
|
||||
}).ToList();
|
||||
return new workshopSearch()
|
||||
@@ -1968,7 +1976,7 @@ public class ReportRepository : IReportRepository
|
||||
Id = workshop.id,
|
||||
WorkshopFullName = workshop.WorkshopFullName,
|
||||
ArchiveCode = workshop.ArchiveCode,
|
||||
ContractSignPercent = checkoutSignedPercent,
|
||||
ContractSignPercent = contractSignedPercent,
|
||||
EmployeeNotDones = employeeNotDone
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user