/// <summary> /// 恢复指定作业 /// </summary> /// <param name="id"></param> /// <returns></returns> public PMS.Model.Message.IBaseResponse ResumeJob(int id) { //1 根据id查询实体 var job_temp = this.GetListBy(j => j.JID == id).FirstOrDefault(); // Model.Message.IBaseResponse response = new Model.Message.BaseResponse(); if (job_temp != null) { //2 暂停 response = client_quartzProxy.ResumeTargetJob(job_temp); //return response; // return response.Success; } if (response.Success) { job_temp.JobState = (int)(PMS.Model.Enum.JobState_Enum.running); base.Update(job_temp); return response; } return new PMS.Model.Message.BaseResponse() { Success = false, Message = "执行恢复作业操作失败" }; }
/// <summary> /// 终止指定作业 /// </summary> /// <param name="id"></param> /// <returns></returns> public PMS.Model.Message.IBaseResponse RemoveJob(int id) { //1 根据id查询实体 var job_temp = this.GetListBy(j => j.JID == id).FirstOrDefault(); // Model.Message.IBaseResponse response = new Model.Message.BaseResponse(); if (job_temp != null) { //2 暂停 response = client_quartzProxy.RemovceJob(job_temp); //软删除 this.DelJobInfo(id); //return response; } if (response.Success) { job_temp.JobState = (int)(PMS.Model.Enum.JobState_Enum.STOP); base.Update(job_temp); return response; } return new PMS.Model.Message.BaseResponse() { Success = false, Message = "不存在指定作业" }; }