public async Task <object> DeleteTasksQz(int id) { var data = new MessageModel <string>(); if (id > 0) { var model = await _tasksQzSvc.QueryById(id); if (model != null) { model.DeleteTime = DateTime.Now; model.JobStatus = JobStatus.已停止; data.Success = await _tasksQzSvc.Update(model); data.Response = model?.Id.ToString(); data.Message = data.Success ? "更新成功" : "更新失败"; if (data.Success) { var resuleModel = await _schedulerCenter.DeleteScheduleJobAsync(model); data.Success = resuleModel.Success; if (resuleModel.Success) { data.Message = $"{data.Message}=>删除成功=>{resuleModel.Message}"; } else { data.Message = $"{data.Message}=>删除失败=>{resuleModel.Message}"; } } } else { data.Message = "任务不存在"; } } return(data); }