/// <summary> /// 保存工作承载节点 /// </summary> /// <param name="saveInfo">保存信息</param> /// <returns>执行结果</returns> public Result SaveJobServerHost(SaveJobServerHostCmdDto saveInfo) { using (var businessWork = WorkFactory.Create()) { if (saveInfo == null || saveInfo.JobServerHosts.IsNullOrEmpty()) { return(Result.FailedResult("工作承载保存信息为空")); } List <JobServerHost> jobServerHostList = saveInfo.JobServerHosts.Select(c => { var jobServer = JobServerHost.CreateJobServerHost(c.Job?.Id, c.Server?.Id); jobServer.RunStatus = c.RunStatus; return(jobServer); }).ToList(); jobServerHostService.SaveJobServerHost(jobServerHostList); var commitResult = businessWork.Commit(); var result = commitResult.ExecutedSuccess ? Result.SuccessResult("保存成功") : Result.FailedResult("保存失败"); return(result); } }
/// <summary> /// 保存工作承载节点 /// </summary> /// <param name="saveInfo">保存信息</param> /// <returns>执行结果</returns> public Result SaveJobServerHost(SaveJobServerHostCmdDto saveInfo) { return(jobServerHostBusiness.SaveJobServerHost(saveInfo)); }