田爽 1 рік тому
батько
коміт
981dc2f3cb
1 змінених файлів з 4 додано та 0 видалено
  1. 4 0
      src/Hotline.Api/Controllers/SchedulingController.cs

+ 4 - 0
src/Hotline.Api/Controllers/SchedulingController.cs

@@ -303,7 +303,11 @@ namespace Hotline.Api.Controllers
 			var scheduling = await _schedulingRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
 			if (scheduling is null)
 				throw UserFriendlyException.SameMessage("无效排班信息");
+			var shift = await _schedulingShiftRepository.GetAsync(dto.ShiftId, HttpContext.RequestAborted);
+			if (shift == null)
+				throw UserFriendlyException.SameMessage("传入排班班次信息错误");
 			_mapper.Map(dto, scheduling);
+			scheduling.ShiftName = shift.Name;
 			await _schedulingRepository.UpdateAsync(scheduling, HttpContext.RequestAborted);
 		}