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

This commit is contained in:
baoliang 2019-04-15 17:29:55 +08:00
parent 9770d988fe
commit 2c34322061
3 changed files with 16 additions and 15 deletions

View File

@ -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;

View File

@ -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"));

View File

@ -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