9 changed files with 254 additions and 5 deletions
-
39src/Shentun.WebPeis.Application.Contracts/AppointScheduleTimes/AppointScheduleTimeDto.cs
-
34src/Shentun.WebPeis.Application.Contracts/AppointSchedules/AppointScheduleDto.cs
-
14src/Shentun.WebPeis.Application.Contracts/AppointSchedules/AppointScheduleIdInputDto.cs
-
14src/Shentun.WebPeis.Application.Contracts/AppointSchedules/DeleteAppointScheduleInputDto.cs
-
5src/Shentun.WebPeis.Application.Contracts/AppointSchedules/UpdateAppointScheduleNumberLimitInputDto.cs
-
63src/Shentun.WebPeis.Application/AppointScheduleTimes/AppointScheduleTimeAppService.cs
-
64src/Shentun.WebPeis.Application/AppointSchedules/AppointScheduleAppService.cs
-
22src/Shentun.WebPeis.Domain/AppointSchedules/AppointScheduleManager.cs
-
2src/Shentun.WebPeis.Domain/DataHelper.cs
@ -0,0 +1,39 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace Shentun.WebPeis.AppointScheduleTimes |
||||
|
{ |
||||
|
public class AppointScheduleTimeDto: AuditedEntityDtoName |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 主键
|
||||
|
/// </summary>
|
||||
|
public Guid AppointScheduleTimeId { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 开始时间
|
||||
|
/// </summary>
|
||||
|
|
||||
|
public string StartTime { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 结束时间
|
||||
|
/// </summary>
|
||||
|
|
||||
|
public string StopTime { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 数量限制
|
||||
|
/// </summary>
|
||||
|
|
||||
|
public int NumberLimit { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 已预约数
|
||||
|
/// </summary>
|
||||
|
|
||||
|
public int AppointNumber { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
public Guid AppointScheduleId { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace Shentun.WebPeis.AppointSchedules |
||||
|
{ |
||||
|
public class AppointScheduleDto: AuditedEntityDtoName |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 预约日期
|
||||
|
/// </summary>
|
||||
|
public string AppointDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 上午数量限制
|
||||
|
/// </summary>
|
||||
|
public int AmNumberLimit { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 下午数量限制
|
||||
|
/// </summary>
|
||||
|
public int PmNumberLimit { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 个人体检数量限制
|
||||
|
/// </summary>
|
||||
|
|
||||
|
public int SingleNumberLimit { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 主键
|
||||
|
/// </summary>
|
||||
|
|
||||
|
public Guid AppointScheduleId { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace Shentun.WebPeis.AppointSchedules |
||||
|
{ |
||||
|
public class AppointScheduleIdInputDto |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 预约计划主表ID
|
||||
|
/// </summary>
|
||||
|
public Guid AppointScheduleId { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace Shentun.WebPeis.AppointSchedules |
||||
|
{ |
||||
|
public class DeleteAppointScheduleInputDto |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// ID集合
|
||||
|
/// </summary>
|
||||
|
public List<Guid> AppointScheduleIds { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,63 @@ |
|||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Shentun.WebPeis.AppointSchedules; |
||||
|
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.AppointScheduleTimes |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 预约计划明细
|
||||
|
/// </summary>
|
||||
|
[ApiExplorerSettings(GroupName = "Work")] |
||||
|
[Authorize] |
||||
|
public class AppointScheduleTimeAppService : ApplicationService |
||||
|
{ |
||||
|
|
||||
|
private readonly IRepository<AppointScheduleTime> _appointScheduleTimeRepository; |
||||
|
private readonly CacheService _cacheService; |
||||
|
|
||||
|
public AppointScheduleTimeAppService( |
||||
|
IRepository<AppointScheduleTime> appointScheduleTimeRepository, |
||||
|
CacheService cacheService |
||||
|
) |
||||
|
{ |
||||
|
_appointScheduleTimeRepository = appointScheduleTimeRepository; |
||||
|
_cacheService = cacheService; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取预约计划明细
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("api/app/AppointScheduleTime/GetAppointScheduleTimeListByAppointScheduleId")] |
||||
|
public async Task<List<AppointScheduleTimeDto>> GetAppointScheduleTimeListByAppointScheduleIdAsync(AppointScheduleIdInputDto input) |
||||
|
{ |
||||
|
var entList = (await _appointScheduleTimeRepository.GetQueryableAsync()) |
||||
|
.Where(m => m.AppointScheduleId == input.AppointScheduleId) |
||||
|
.OrderBy(o => o.StartTime); |
||||
|
var entListDto = entList.Select(s => new AppointScheduleTimeDto |
||||
|
{ |
||||
|
AppointScheduleId = s.AppointScheduleId, |
||||
|
CreationTime = s.CreationTime, |
||||
|
CreatorId = s.CreatorId, |
||||
|
LastModificationTime = s.LastModificationTime, |
||||
|
LastModifierId = s.LastModifierId, |
||||
|
CreatorName = _cacheService.GetSurnameAsync(s.CreatorId).Result, |
||||
|
LastModifierName = _cacheService.GetSurnameAsync(s.LastModifierId).Result, |
||||
|
AppointNumber = s.AppointNumber, |
||||
|
AppointScheduleTimeId = s.AppointScheduleTimeId, |
||||
|
NumberLimit = s.NumberLimit, |
||||
|
StartTime = DataHelper.ConvertTimeOnlyToString(s.StartTime), |
||||
|
StopTime = DataHelper.ConvertTimeOnlyToString(s.StopTime) |
||||
|
}).ToList(); |
||||
|
return entListDto; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue