fix 逻辑问题处理

This commit is contained in:
2025-12-18 09:40:58 +08:00
parent 0fb0cb1038
commit 4d1dbd1985

View File

@@ -380,11 +380,8 @@ public class AppointmentService : IAppointmentService
.Select(x => new .Select(x => new
{ {
x.Type, x.Type,
Period = new DatePeriod x.Start,
{ x.End
Start = x.Start,
End = x.End
}
}) })
.ToListAsync(); .ToListAsync();
@@ -419,7 +416,7 @@ public class AppointmentService : IAppointmentService
//date.DayOfWeek //date.DayOfWeek
foreach (var holiday in holidaies) foreach (var holiday in holidaies)
{ {
var isPresent = date >= holiday.Period.Start && date <= holiday.Period.Start; var isPresent = date >= holiday.Start && date <= holiday.Start;
if (isPresent) if (isPresent)
{ {
if (holiday.Type == HolidayEnumType.Rest) if (holiday.Type == HolidayEnumType.Rest)
@@ -427,13 +424,10 @@ public class AppointmentService : IAppointmentService
days--; days--;
} }
} }
else }
{ if (weekends.Contains(date.DayOfWeek))
if (weekends.Contains(date.DayOfWeek)) {
{ days--;
days--;
}
}
} }
} }