|
@@ -303,12 +303,33 @@ namespace Hotline.Api.Controllers
|
|
|
await _telRestRepository.AddAsync(telRest, HttpContext.RequestAborted);
|
|
|
|
|
|
var startWorkflowDto = _mapper.Map<StartWorkflowDto>(dto);
|
|
|
- startWorkflowDto.DefinitionModuleCode = WorkflowModuleConsts.TelRestApply;
|
|
|
+ startWorkflowDto.DefinitionModuleCode = WorkflowModuleConsts.TelRestApplyNew;
|
|
|
startWorkflowDto.Title = dto.Reason;
|
|
|
await _workflowApplication.StartWorkflowAsync(startWorkflowDto, telRest.Id, HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 开始分机休息
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="id"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [Permission(EPermission.Rest)]
|
|
|
+ [HttpGet("begin-rest")]
|
|
|
+ public async Task BeginRest(string id)
|
|
|
+ {
|
|
|
+ if (string.IsNullOrEmpty(id))
|
|
|
+ throw UserFriendlyException.SameMessage("无效分机休息编号");
|
|
|
+ var telRest = await _telRestRepository.GetAsync(id, HttpContext.RequestAborted);
|
|
|
+ if (telRest == null)
|
|
|
+ throw new UserFriendlyException($"无效分机休息编号, telRestId: {id}", "无效分机休息编号");
|
|
|
+
|
|
|
+ telRest.ApplyStatus = ETelRestApplyStatus.Resting;
|
|
|
+ telRest.StartTime = DateTime.Now;
|
|
|
+ await _telRestRepository.UpdateAsync(telRest, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 分机休息
|
|
|
/// </summary>
|