提交 2c343220 编写于 作者: B baoliang

fix bug: error start date and end date in task record

上级 9770d988
......@@ -72,7 +72,7 @@ public class DateUtils {
public static Date parse(String date,String format){
try {
return new SimpleDateFormat(format).parse(date);
} catch (ParseException e) {
} catch (Exception e) {
logger.error("error while parse date:" + date, e);
}
return null;
......
......@@ -17,6 +17,7 @@
package cn.escheduler.dao;
import cn.escheduler.common.Constants;
import cn.escheduler.common.utils.DateUtils;
import cn.escheduler.dao.model.TaskRecord;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
......@@ -201,8 +202,8 @@ public class TaskRecordDao {
taskRecord.setProcId(resultSet.getInt("PROC_ID"));
taskRecord.setProcName(resultSet.getString("PROC_NAME"));
taskRecord.setProcDate(resultSet.getString("PROC_DATE"));
taskRecord.setStartDate(resultSet.getDate("STARTDATE"));
taskRecord.setEndDate(resultSet.getDate("ENDDATE"));
taskRecord.setStartTime(DateUtils.stringToDate(resultSet.getString("STARTDATE")));
taskRecord.setEndTime(DateUtils.stringToDate(resultSet.getString("ENDDATE")));
taskRecord.setResult(resultSet.getString("RESULT"));
taskRecord.setDuration(resultSet.getInt("DURATION"));
taskRecord.setNote(resultSet.getString("NOTE"));
......
......@@ -46,12 +46,12 @@ public class TaskRecord {
/**
* start date
*/
private Date startDate;
private Date startTime;
/**
* end date
*/
private Date endDate;
private Date endTime;
/**
* result
......@@ -136,20 +136,20 @@ public class TaskRecord {
this.procDate = procDate;
}
public Date getStartDate() {
return startDate;
public Date getStartTime() {
return startTime;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndDate() {
return endDate;
public Date getEndTime() {
return endTime;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String getResult() {
......@@ -238,8 +238,8 @@ public class TaskRecord {
+" proc id:" + procId
+ " proc name:" + procName
+ " proc date: " + procDate
+ " start date:" + startDate
+ " end date:" + endDate
+ " start date:" + startTime
+ " end date:" + endTime
+ " result : " + result
+ " duration : " + duration
+ " note : " + note
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册