/// <summary> /// 保存任务执行计划 /// </summary> /// <param name="saveInfo">保存信息</param> /// <returns>执行结果</returns> public Result <TriggerDto> SaveTrigger(SaveTriggerCmdDto saveInfo) { using (var businessWork = WorkFactory.Create()) { if (saveInfo == null || saveInfo.Trigger == null) { return(Result <TriggerDto> .FailedResult("保存信息为空")); } Result <TriggerDto> result = null; var trigger = saveInfo.Trigger.MapTo <Trigger>(); triggerService.SaveTrigger(trigger);//保存执行计划 var commitResult = businessWork.Commit(); if (commitResult.ExecutedSuccess) { result = Result <TriggerDto> .SuccessResult("保存成功"); result.Data = trigger.MapTo <TriggerDto>(); } else { result = Result <TriggerDto> .FailedResult("保存失败"); } return(result); } }