4 changed files with 87 additions and 0 deletions
-
13src/Shentun.WebPeis.Application.Contracts/AppointSchedules/AppointScheduleDateDto.cs
-
71src/Shentun.WebPeis.Application/AppointSchedules/AppointScheduleAppService.cs
-
1src/Shentun.WebPeis.Application/Asbitems/AsbitemAppService.cs
-
2src/Shentun.WebPeis.Application/MedicalPackages/MedicalPackageAppservice.cs
@ -0,0 +1,13 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.WebPeis.AppointSchedules |
|||
{ |
|||
public class AppointScheduleDateDto |
|||
{ |
|||
public DateTime AppointDate { get; set; } |
|||
public char IsWork { get; set; } = 'Y'; |
|||
public char IsFull { get; set; } = 'N'; |
|||
} |
|||
} |
|||
@ -0,0 +1,71 @@ |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Shentun.WebPeis.Models; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace Shentun.WebPeis.AppointSchedules |
|||
{ |
|||
[ApiExplorerSettings(GroupName = "Work")] |
|||
[Authorize] |
|||
public class AppointScheduleAppService : ApplicationService |
|||
{ |
|||
private readonly IRepository<AppointSchedule> _repository; |
|||
private readonly CacheService _cacheService; |
|||
|
|||
public AppointScheduleAppService(IRepository<AppointSchedule> repository, |
|||
CacheService cacheService |
|||
) |
|||
{ |
|||
_repository = repository; |
|||
_cacheService = cacheService; |
|||
|
|||
} |
|||
/// <summary>
|
|||
/// 获取预约日期列表
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[HttpPost("api/app/AppointSchedule/GetAppointScheduleDateList")] |
|||
public async Task<List<AppointScheduleDateDto>> GetAppointScheduleDateListAsync() |
|||
{ |
|||
var appointScheduleDateDtos = await GetAppointScheduleDateTestListAsync(); |
|||
return appointScheduleDateDtos; |
|||
|
|||
} |
|||
|
|||
|
|||
private async Task<List<AppointScheduleDateDto>> GetAppointScheduleDateTestListAsync() |
|||
{ |
|||
var appointScheduleDateDtos = new List<AppointScheduleDateDto>(); |
|||
DateTime startDate = DateTime.Now.Date; |
|||
for (var i = 0; i < 60; i++) |
|||
{ |
|||
var appointScheduleDateDto = new AppointScheduleDateDto() |
|||
{ |
|||
AppointDate = startDate.AddDays(i), |
|||
|
|||
}; |
|||
appointScheduleDateDtos.Add(new AppointScheduleDateDto() |
|||
{ |
|||
AppointDate = startDate.AddDays(i), |
|||
|
|||
}); |
|||
if (appointScheduleDateDto.AppointDate.DayOfWeek == DayOfWeek.Sunday) |
|||
{ |
|||
appointScheduleDateDto.IsWork = 'N'; |
|||
} |
|||
else if (appointScheduleDateDto.AppointDate.DayOfWeek == DayOfWeek.Wednesday) |
|||
{ |
|||
appointScheduleDateDto.IsFull = 'Y'; |
|||
} |
|||
} |
|||
|
|||
return appointScheduleDateDtos; |
|||
} |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue