Create checkou bug fixed

This commit is contained in:
SamSys
2025-06-16 13:22:14 +03:30
parent 6c8385061e
commit 7f98cf8f12

View File

@@ -125,7 +125,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, 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<long, RollCall>, 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<long, RollCall>, IRoll
EndDate = shift2EndGr,
ShiftSpan = (shift2EndGr - shift2StartGr),
ShiftDate = shift1?.ShiftDate ?? shift2EndGr,
ShiftEndWithoutRest = shift2EndGr,
});
}
else
@@ -2349,7 +2350,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, 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<long, RollCall>, 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<long, RollCall>, 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<long, RollCall>, IRoll
EndDate = hourseLeaveTypeResult.StartLeaveGr,
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift2StartGr),
ShiftDate = shift1?.EndDate ?? shift2EndGr,
});
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr,
});
}