瀏覽代碼

任务新增GLUE更新时间属性;

xueli.xue 8 年之前
父節點
當前提交
f2d2422848

+ 1 - 0
db/tables_xxl_job.sql

@@ -160,6 +160,7 @@ CREATE TABLE `XXL_JOB_QRTZ_TRIGGER_INFO` (
   `glue_switch` int(11) DEFAULT '0' COMMENT 'GLUE模式开关:0-否,1-是',
   `glue_source` text COMMENT 'GLUE源代码',
   `glue_remark` varchar(128) DEFAULT NULL COMMENT 'GLUE备注',
+  `glue_updatetime` datetime DEFAULT NULL COMMENT 'GLUE更新时间',
   `child_jobkey` varchar(255) DEFAULT NULL COMMENT '子任务Key',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

+ 2 - 0
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobCodeController.java

@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.annotation.Resource;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -60,6 +61,7 @@ public class JobCodeController {
 		// update new code
 		exists_jobInfo.setGlueSource(glueSource);
 		exists_jobInfo.setGlueRemark(glueRemark);
+		exists_jobInfo.setGlueUpdatetime(new Date());
 		xxlJobInfoDao.update(exists_jobInfo);
 
 		// remove code backup more than 30

+ 9 - 0
xxl-job-admin/src/main/java/com/xxl/job/admin/core/model/XxlJobInfo.java

@@ -27,6 +27,7 @@ public class XxlJobInfo {
 	private int glueSwitch;		// GLUE模式开关:0-否,1-是
 	private String glueSource;	// GLUE源代码
 	private String glueRemark;	// GLUE备注
+	private Date glueUpdatetime;// GLUE更新时间
 
 	private String childJobKey;		// 子任务Key
 	
@@ -145,6 +146,14 @@ public class XxlJobInfo {
 		this.glueRemark = glueRemark;
 	}
 
+	public Date getGlueUpdatetime() {
+		return glueUpdatetime;
+	}
+
+	public void setGlueUpdatetime(Date glueUpdatetime) {
+		this.glueUpdatetime = glueUpdatetime;
+	}
+
 	public String getChildJobKey() {
 		return childJobKey;
 	}

+ 5 - 0
xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml

@@ -23,6 +23,7 @@
 	    <result column="glue_switch" property="glueSwitch" />
 	    <result column="glue_source" property="glueSource" />
 	    <result column="glue_remark" property="glueRemark" />
+		<result column="glue_updatetime" property="glueUpdatetime" />
 
 		<result column="child_jobkey" property="childJobKey" />
 	</resultMap>
@@ -42,6 +43,7 @@
 		t.glue_switch,
 		t.glue_source,
 		t.glue_remark,
+		t.glue_updatetime,
 		t.child_jobkey
 	</sql>
 	
@@ -88,6 +90,7 @@
 			glue_switch,
 			glue_source,
 			glue_remark,
+			glue_updatetime,
 			child_jobkey
 		) VALUES (
 			#{jobGroup},
@@ -103,6 +106,7 @@
 			#{glueSwitch},
 			#{glueSource},
 			#{glueRemark},
+			NOW(),
 			#{childJobKey}
 		);
 		<!--<selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id">
@@ -131,6 +135,7 @@
 			glue_switch = #{glueSwitch},
 			glue_source = #{glueSource},
 			glue_remark = #{glueRemark},
+			glue_updatetime = #{glueUpdatetime},
 			child_jobkey = #{childJobKey}
 		WHERE id = #{id}
 	</update>