Ver Fonte

git-svn-id: https://192.168.57.71/svn/jsgkj@337 931142cf-59ea-a443-aa0e-51397b428577

xt_yuanxd há 9 anos atrás
pai
commit
81dbef537b

+ 24 - 0
xtdsp/trunk/src/main/java/com/xt/dsp/controller/JobCtl.java

@@ -0,0 +1,24 @@
+package com.xt.dsp.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.xt.dsp.model.JobBean;
+import com.xt.dsp.service.JobService;
+
+@Controller
+@RequestMapping("job")
+public class JobCtl {
+	@Autowired
+	private JobService jobService;
+
+	@RequestMapping("reschedule/{code}")
+	@ResponseBody
+	public int rescheduleJob(@PathVariable String code) {
+		JobBean job = jobService.selectByCode(code);
+		return jobService.rescheduleJob(job);
+	}
+}

+ 10 - 1
xtdsp/trunk/src/main/java/com/xt/dsp/controller/TaskCtl.java

@@ -27,10 +27,19 @@ public class TaskCtl {
 		if (task == null) {
 			result.setSuccess(false);
 			result.setMessage("任务不存在:" + code);
+			return result;
 		}
 
 		if (TaskBean.TYPE_SQL.equals(task.getType())) {
-			int res = taskSqlService.runTask(task, condition);
+			int res = -1;
+			try {
+				res = taskSqlService.runTask(task, condition);
+			} catch (Exception e) {
+				e.printStackTrace();
+				result.setSuccess(false);
+				result.setMessage(e.getMessage());
+				return result;
+			}
 			if (res == 0) {
 				result.setSuccess(true);
 				return result;