/// <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="deleteInfo">删除信息</param>
 /// <returns>执行结果</returns>
 public Result DeleteJobServerHost(DeleteJobServerHostCmdDto deleteInfo)
 {
     using (var businessWork = WorkFactory.Create())
     {
         if (deleteInfo == null || deleteInfo.JobServerHosts.IsNullOrEmpty())
         {
             return(Result.FailedResult("没有指定要删除的信息"));
         }
         List <JobServerHost> serverHosts = deleteInfo.JobServerHosts.Select(c => JobServerHost.CreateJobServerHost(c.Job?.Id, c.Server?.Id)).ToList();
         jobServerHostService.DeleteJobServerHost(serverHosts);
         var commitResult = businessWork.Commit();
         var result       = commitResult.ExecutedSuccess ? Result.SuccessResult("删除成功") : Result.FailedResult("删除失败");
         return(result);
     }
 }