Browse Source

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

xueli.xue 8 years ago
parent
commit
f2d2422848

+ 1 - 0
db/tables_xxl_job.sql View File

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

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

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

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

@@ -27,6 +27,7 @@ public class XxlJobInfo {
27 27
 	private int glueSwitch;		// GLUE模式开关:0-否,1-是
28 28
 	private String glueSource;	// GLUE源代码
29 29
 	private String glueRemark;	// GLUE备注
30
+	private Date glueUpdatetime;// GLUE更新时间
30 31
 
31 32
 	private String childJobKey;		// 子任务Key
32 33
 	
@@ -145,6 +146,14 @@ public class XxlJobInfo {
145 146
 		this.glueRemark = glueRemark;
146 147
 	}
147 148
 
149
+	public Date getGlueUpdatetime() {
150
+		return glueUpdatetime;
151
+	}
152
+
153
+	public void setGlueUpdatetime(Date glueUpdatetime) {
154
+		this.glueUpdatetime = glueUpdatetime;
155
+	}
156
+
148 157
 	public String getChildJobKey() {
149 158
 		return childJobKey;
150 159
 	}

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

@@ -23,6 +23,7 @@
23 23
 	    <result column="glue_switch" property="glueSwitch" />
24 24
 	    <result column="glue_source" property="glueSource" />
25 25
 	    <result column="glue_remark" property="glueRemark" />
26
+		<result column="glue_updatetime" property="glueUpdatetime" />
26 27
 
27 28
 		<result column="child_jobkey" property="childJobKey" />
28 29
 	</resultMap>
@@ -42,6 +43,7 @@
42 43
 		t.glue_switch,
43 44
 		t.glue_source,
44 45
 		t.glue_remark,
46
+		t.glue_updatetime,
45 47
 		t.child_jobkey
46 48
 	</sql>
47 49
 	
@@ -88,6 +90,7 @@
88 90
 			glue_switch,
89 91
 			glue_source,
90 92
 			glue_remark,
93
+			glue_updatetime,
91 94
 			child_jobkey
92 95
 		) VALUES (
93 96
 			#{jobGroup},
@@ -103,6 +106,7 @@
103 106
 			#{glueSwitch},
104 107
 			#{glueSource},
105 108
 			#{glueRemark},
109
+			NOW(),
106 110
 			#{childJobKey}
107 111
 		);
108 112
 		<!--<selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id">
@@ -131,6 +135,7 @@
131 135
 			glue_switch = #{glueSwitch},
132 136
 			glue_source = #{glueSource},
133 137
 			glue_remark = #{glueRemark},
138
+			glue_updatetime = #{glueUpdatetime},
134 139
 			child_jobkey = #{childJobKey}
135 140
 		WHERE id = #{id}
136 141
 	</update>