Browse Source

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

xueli.xue 8 years ago
parent
commit
f2d2422848

+ 1 - 0
db/tables_xxl_job.sql View File

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

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

11
 import org.springframework.web.bind.annotation.ResponseBody;
11
 import org.springframework.web.bind.annotation.ResponseBody;
12
 
12
 
13
 import javax.annotation.Resource;
13
 import javax.annotation.Resource;
14
+import java.util.Date;
14
 import java.util.List;
15
 import java.util.List;
15
 
16
 
16
 /**
17
 /**
60
 		// update new code
61
 		// update new code
61
 		exists_jobInfo.setGlueSource(glueSource);
62
 		exists_jobInfo.setGlueSource(glueSource);
62
 		exists_jobInfo.setGlueRemark(glueRemark);
63
 		exists_jobInfo.setGlueRemark(glueRemark);
64
+		exists_jobInfo.setGlueUpdatetime(new Date());
63
 		xxlJobInfoDao.update(exists_jobInfo);
65
 		xxlJobInfoDao.update(exists_jobInfo);
64
 
66
 
65
 		// remove code backup more than 30
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
 	private int glueSwitch;		// GLUE模式开关:0-否,1-是
27
 	private int glueSwitch;		// GLUE模式开关:0-否,1-是
28
 	private String glueSource;	// GLUE源代码
28
 	private String glueSource;	// GLUE源代码
29
 	private String glueRemark;	// GLUE备注
29
 	private String glueRemark;	// GLUE备注
30
+	private Date glueUpdatetime;// GLUE更新时间
30
 
31
 
31
 	private String childJobKey;		// 子任务Key
32
 	private String childJobKey;		// 子任务Key
32
 	
33
 	
145
 		this.glueRemark = glueRemark;
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
 	public String getChildJobKey() {
157
 	public String getChildJobKey() {
149
 		return childJobKey;
158
 		return childJobKey;
150
 	}
159
 	}

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

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