From 7f98cf8f1292909b595e269f15d1643c899b1056 Mon Sep 17 00:00:00 2001 From: SamSys Date: Mon, 16 Jun 2025 13:22:14 +0330 Subject: [PATCH] Create checkou bug fixed --- .../Repository/RollCallMandatoryRepository.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs b/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs index 1198cfb7..75e98903 100644 --- a/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs +++ b/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs @@ -125,7 +125,7 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll groupedRollCall = rollCallResult.GroupBy(x => x.ShiftDate.Date).Select(x => new GroupedRollCalls() { CreationDate = x.Key, - ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value,EndWithOutResTime = s.ShiftEndWithoutRest.Value}).ToList(), + ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value,EndWithOutResTime = s.ShiftEndWithoutRest.Value != null ? s.ShiftEndWithoutRest.Value : new DateTime()}).ToList(), HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)), SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)), @@ -162,7 +162,7 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll return new GroupedRollCalls() { CreationDate = x.Key, - ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value, EndWithOutResTime = s.EndDate.Value }) + ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value, EndWithOutResTime = s.EndDate!.Value }) .ToList(), HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || @@ -2334,6 +2334,7 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll EndDate = shift2EndGr, ShiftSpan = (shift2EndGr - shift2StartGr), ShiftDate = shift1?.ShiftDate ?? shift2EndGr, + ShiftEndWithoutRest = shift2EndGr, }); } else @@ -2349,7 +2350,8 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll EndDate = shift2EndGr, ShiftSpan = (shift2EndGr - hourseLeaveTypeResult.EndLeaveGr), ShiftDate = shift1?.EndDate ?? shift2EndGr, - }); + ShiftEndWithoutRest = shift2EndGr, + }); } else if (hourseLeaveTypeResult.StartLeaveGr > shift2StartGr && hourseLeaveTypeResult.EndLeaveGr < shift2EndGr) { @@ -2361,7 +2363,8 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll EndDate = hourseLeaveTypeResult.StartLeaveGr, ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift2StartGr), ShiftDate = shift1?.EndDate ?? shift2EndGr, - }); + ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr, + }); result.Add(new RollCallViewModel() { @@ -2369,7 +2372,8 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll EndDate = shift2EndGr, ShiftSpan = (shift2EndGr - hourseLeaveTypeResult.EndLeaveGr), ShiftDate = shift1?.EndDate ?? shift2EndGr, - }); + ShiftEndWithoutRest = shift2EndGr, + }); } else if (hourseLeaveTypeResult.StartLeaveGr > shift2StartGr && hourseLeaveTypeResult.EndLeaveGr >= shift2EndGr) { @@ -2382,7 +2386,8 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll EndDate = hourseLeaveTypeResult.StartLeaveGr, ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift2StartGr), ShiftDate = shift1?.EndDate ?? shift2EndGr, - }); + ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr, + }); }