@@ -8,4 +8,15 @@
|
||||
public DateTime EndDate { get; set; }
|
||||
public int Status { get; set; } = 1;
|
||||
}
|
||||
|
||||
public class GetIsVacationInDto
|
||||
{
|
||||
public Guid DoctorId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class GetIsVacationOutDto
|
||||
{
|
||||
public bool IsVacation { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,6 +70,36 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取是否休假
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<GetIsVacationOutDto> GetIsVacation(GetIsVacationInDto inDto)
|
||||
{
|
||||
var query = await _vacationRepository.Where(u => u.DoctorId == inDto.DoctorId).ToListAsync();
|
||||
|
||||
bool isVacation = false;
|
||||
|
||||
var now = DateTime.Now;
|
||||
foreach (var item in query)
|
||||
{
|
||||
if (item.StartDate <= now && now <= item.EndDate)
|
||||
{
|
||||
isVacation = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return new GetIsVacationOutDto() {
|
||||
|
||||
IsVacation= isVacation
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
[NonDynamicMethod]
|
||||
public async Task<IResponseOutput> OnVacation(Guid doctorId)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user