Browse Source

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

pull/2/head
baoliang 6 years ago
parent
commit
2c34322061
  1. 2
      escheduler-common/src/main/java/cn/escheduler/common/utils/DateUtils.java
  2. 5
      escheduler-dao/src/main/java/cn/escheduler/dao/TaskRecordDao.java
  3. 24
      escheduler-dao/src/main/java/cn/escheduler/dao/model/TaskRecord.java

2
escheduler-common/src/main/java/cn/escheduler/common/utils/DateUtils.java

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

5
escheduler-dao/src/main/java/cn/escheduler/dao/TaskRecordDao.java

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

24
escheduler-dao/src/main/java/cn/escheduler/dao/model/TaskRecord.java

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

Loading…
Cancel
Save