Convert checkoutPrintOne to CheckoutPrintAll for best performance

This commit is contained in:
2025-06-03 19:38:18 +03:30
parent a410d0c216
commit 87b0d248a3
3 changed files with 7 additions and 7 deletions

View File

@@ -329,9 +329,9 @@ public class CheckoutApplication : ICheckoutApplication
if (x.HasRollCall)
{
totalWorking = new TimeSpan(x.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks));
totalWorking = new TimeSpan(x.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks)) - x.TotalHourlyLeave;
totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
totalPresent = totalWorking + totalBreakTime - x.TotalHourlyLeave;
totalPresent = totalWorking + totalBreakTime ;
}
else
{
@@ -373,9 +373,9 @@ public class CheckoutApplication : ICheckoutApplication
TimeSpan totalHoursLeave;
if (result.HasRollCall)
{
totalWorking = new TimeSpan(result.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks));
totalWorking = new TimeSpan(result.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks)) - result.TotalHourlyLeave;
totalBreakTime = new TimeSpan(result.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
totalPresent = totalWorking + totalBreakTime - result.TotalHourlyLeave;
totalPresent = totalWorking + totalBreakTime ;
}
else
{

View File

@@ -1013,7 +1013,7 @@ public class IndexModel : PageModel
public IActionResult OnGetPrintOne(long id)
{
var res = _checkoutApplication.PrintOne(id);
var res = _checkoutApplication.PrintAll([id]).FirstOrDefault();
//var res = _contractApplication.PrintAll(ids);
if (res.HasRollCall) return Partial("PrintDetailsRollCall", res);

View File

@@ -233,7 +233,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.Checkouts
public IActionResult OnGetPrintOne(long id)
{
var res = _checkoutApplication.PrintOne(id);
var res = _checkoutApplication.PrintAll([id]).FirstOrDefault();
if (res.HasRollCall)
return Partial("PrintOneRollCall", res);
@@ -246,7 +246,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.Checkouts
public IActionResult OnGetPrintOneMobile(long id)
{
var res = _checkoutApplication.PrintOne(id);
var res = _checkoutApplication.PrintAll([id]).FirstOrDefault();
if (res.HasRollCall)
return Partial("PrintOneRollCall", res);