修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
ec945b4b39
commit
5e889b1529
|
@ -1310,6 +1310,13 @@
|
|||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.VacationService.GetIsVacation(IRaCIS.Application.Contracts.GetIsVacationInDto)">
|
||||
<summary>
|
||||
获取是否休假
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Service.TrialEmailNoticeConfigService">
|
||||
<summary>
|
||||
TrialEmailNoticeConfigService
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue