|
@@ -292,25 +292,25 @@ namespace Hotline.Api.Controllers
|
|
await _schedulingRepository.UpdateAsync(scheduling, HttpContext.RequestAborted);
|
|
await _schedulingRepository.UpdateAsync(scheduling, HttpContext.RequestAborted);
|
|
}
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
|
- /// 批量更新排班管理
|
|
|
|
- /// </summary>
|
|
|
|
- /// <param name="dto"></param>
|
|
|
|
- /// <returns></returns>
|
|
|
|
- [HttpPut("batch")]
|
|
|
|
- public async Task Update([FromBody] List<UpdateDto> dto)
|
|
|
|
- {
|
|
|
|
- List<Scheduling> schedulings = new List<Scheduling>();
|
|
|
|
- foreach (var item in dto)
|
|
|
|
- {
|
|
|
|
- var scheduling = await _schedulingRepository.GetAsync(item.Id, HttpContext.RequestAborted);
|
|
|
|
- if (scheduling is null)
|
|
|
|
- throw UserFriendlyException.SameMessage("无效排班信息");
|
|
|
|
- _mapper.Map(dto, scheduling);
|
|
|
|
- schedulings.Add(scheduling);
|
|
|
|
- }
|
|
|
|
- await _schedulingRepository.UpdateRangeAsync(schedulings, HttpContext.RequestAborted);
|
|
|
|
- }
|
|
|
|
|
|
+ ///// <summary>
|
|
|
|
+ ///// 批量更新排班管理
|
|
|
|
+ ///// </summary>
|
|
|
|
+ ///// <param name="dto"></param>
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
+ //[HttpPut("batch")]
|
|
|
|
+ //public async Task Update([FromBody] List<UpdateDto> dto)
|
|
|
|
+ //{
|
|
|
|
+ // List<Scheduling> schedulings = new List<Scheduling>();
|
|
|
|
+ // foreach (var item in dto)
|
|
|
|
+ // {
|
|
|
|
+ // var scheduling = await _schedulingRepository.GetAsync(item.Id, HttpContext.RequestAborted);
|
|
|
|
+ // if (scheduling is null)
|
|
|
|
+ // throw UserFriendlyException.SameMessage("无效排班信息");
|
|
|
|
+ // _mapper.Map(dto, scheduling);
|
|
|
|
+ // schedulings.Add(scheduling);
|
|
|
|
+ // }
|
|
|
|
+ // await _schedulingRepository.UpdateRangeAsync(schedulings, HttpContext.RequestAborted);
|
|
|
|
+ //}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|