田爽 1 yıl önce
ebeveyn
işleme
981dc2f3cb

+ 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);
 		}