Browse Source

Merge remote-tracking branch 'upstream/dev-20190415' into dev-20190415

pull/2/head
baoliang 6 years ago
parent
commit
62209a251b
  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){ public static Date parse(String date,String format){
try { try {
return new SimpleDateFormat(format).parse(date); return new SimpleDateFormat(format).parse(date);
} catch (ParseException e) { } catch (Exception e) {
logger.error("error while parse date:" + date, e); logger.error("error while parse date:" + date, e);
} }
return null; return null;

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

@ -17,6 +17,7 @@
package cn.escheduler.dao; package cn.escheduler.dao;
import cn.escheduler.common.Constants; import cn.escheduler.common.Constants;
import cn.escheduler.common.utils.DateUtils;
import cn.escheduler.dao.model.TaskRecord; import cn.escheduler.dao.model.TaskRecord;
import org.apache.commons.configuration.Configuration; import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.ConfigurationException;
@ -201,8 +202,8 @@ public class TaskRecordDao {
taskRecord.setProcId(resultSet.getInt("PROC_ID")); taskRecord.setProcId(resultSet.getInt("PROC_ID"));
taskRecord.setProcName(resultSet.getString("PROC_NAME")); taskRecord.setProcName(resultSet.getString("PROC_NAME"));
taskRecord.setProcDate(resultSet.getString("PROC_DATE")); taskRecord.setProcDate(resultSet.getString("PROC_DATE"));
taskRecord.setStartDate(resultSet.getDate("STARTDATE")); taskRecord.setStartTime(DateUtils.stringToDate(resultSet.getString("STARTDATE")));
taskRecord.setEndDate(resultSet.getDate("ENDDATE")); taskRecord.setEndTime(DateUtils.stringToDate(resultSet.getString("ENDDATE")));
taskRecord.setResult(resultSet.getString("RESULT")); taskRecord.setResult(resultSet.getString("RESULT"));
taskRecord.setDuration(resultSet.getInt("DURATION")); taskRecord.setDuration(resultSet.getInt("DURATION"));
taskRecord.setNote(resultSet.getString("NOTE")); 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 * start date
*/ */
private Date startDate; private Date startTime;
/** /**
* end date * end date
*/ */
private Date endDate; private Date endTime;
/** /**
* result * result
@ -136,20 +136,20 @@ public class TaskRecord {
this.procDate = procDate; this.procDate = procDate;
} }
public Date getStartDate() { public Date getStartTime() {
return startDate; return startTime;
} }
public void setStartDate(Date startDate) { public void setStartTime(Date startTime) {
this.startDate = startDate; this.startTime = startTime;
} }
public Date getEndDate() { public Date getEndTime() {
return endDate; return endTime;
} }
public void setEndDate(Date endDate) { public void setEndTime(Date endTime) {
this.endDate = endDate; this.endTime = endTime;
} }
public String getResult() { public String getResult() {
@ -238,8 +238,8 @@ public class TaskRecord {
+" proc id:" + procId +" proc id:" + procId
+ " proc name:" + procName + " proc name:" + procName
+ " proc date: " + procDate + " proc date: " + procDate
+ " start date:" + startDate + " start date:" + startTime
+ " end date:" + endDate + " end date:" + endTime
+ " result : " + result + " result : " + result
+ " duration : " + duration + " duration : " + duration
+ " note : " + note + " note : " + note

Loading…
Cancel
Save