package com.engine.kq.timer;

import com.engine.kq.wfset.bean.SplitBean;

public class KQTaskBean {

  private String requestId;

  private String resourceId;

  /**
   * 所属日期
   */
  private String taskDate;

  /**
   * 加班开始日期
   */
  private String signDate;

  /**
   * 加班结束日期
   */
  private String signEndDate;

  /**
   * 计算加班的结束时间
   */
  private String taskSignTime;

  private String lastWorkTime;

  /**
   * 对于非工作时间来说，最后的签退时间，即加班的开始时间
   */
  private String signInTime4Out;

  /**
   * 工作时长
   */
  private int workmins;

  /**
   * 针对打卡 上班前还是下班后
   * before/after
   */
  private String timesource;
  /**
   * 调休id
   */
  private String tiaoxiuId;

  /**
   * 流程生成加班的時候 流程数据的bean
   */
  private SplitBean splitBean;

  /**
   * 采用新的加班逻辑计算，统计加班的开始日期
   */
  private String overtime_fromdate;
  /**
   * 采用新的加班逻辑计算，统计加班的结束日期
   */
  private String overtime_todate;

  /**
   * 加班来源类型 是来自由打卡还是考勤同步
   */
  private String tasktype;

  public KQTaskBean() {
    this.requestId = "";
    this.resourceId = "";
    this.taskDate = "";
    this.signDate = "";
    this.signEndDate = "";
    this.taskSignTime = "";
    this.lastWorkTime = "";
    this.signInTime4Out = "";
    this.timesource = "";
    this.tiaoxiuId = "";
    this.overtime_fromdate = "";
    this.overtime_todate = "";
    this.tasktype = "";
  }

  public String getRequestId() {
    return requestId;
  }

  public void setRequestId(String requestId) {
    this.requestId = requestId;
  }

  public String getResourceId() {
    return resourceId;
  }

  public void setResourceId(String resourceId) {
    this.resourceId = resourceId;
  }

  public String getTaskDate() {
    return taskDate;
  }

  public void setTaskDate(String taskDate) {
    this.taskDate = taskDate;
  }

  public String getTaskSignTime() {
    return taskSignTime;
  }

  public void setTaskSignTime(String taskSignTime) {
    this.taskSignTime = taskSignTime;
  }

  public String getLastWorkTime() {
    return lastWorkTime;
  }

  public void setLastWorkTime(String lastWorkTime) {
    this.lastWorkTime = lastWorkTime;
  }

  public int getWorkmins() {
    return workmins;
  }

  public void setWorkmins(int workmins) {
    this.workmins = workmins;
  }

  public String getSignInTime4Out() {
    return signInTime4Out;
  }

  public void setSignInTime4Out(String signInTime4Out) {
    this.signInTime4Out = signInTime4Out;
  }

  public String getSignDate() {
    return signDate;
  }

  public void setSignDate(String signDate) {
    this.signDate = signDate;
  }

  public SplitBean getSplitBean() {
    return splitBean;
  }

  public void setSplitBean(SplitBean splitBean) {
    this.splitBean = splitBean;
  }

  public String getTimesource() {
    return timesource;
  }

  public void setTimesource(String timesource) {
    this.timesource = timesource;
  }

  public String getSignEndDate() {
    return signEndDate;
  }

  public void setSignEndDate(String signEndDate) {
    this.signEndDate = signEndDate;
  }

  @Override
  public boolean equals(Object obj) {
    String cur_requestid = getRequestId();
    String obj_requestid = ((KQTaskBean)obj).getRequestId();
    boolean isEqual = toString().equals(obj.toString());
//    if(isEqual){
//      if(!cur_requestid.equalsIgnoreCase(obj_requestid)){
//        String all_requestid = cur_requestid+","+obj_requestid;
//        setRequestId(all_requestid);
//        ((KQTaskBean) obj).setRequestId(all_requestid);
//      }
//    }
    return isEqual;
  }

  public String getTiaoxiuId() {
    return tiaoxiuId;
  }

  public void setTiaoxiuId(String tiaoxiuId) {
    this.tiaoxiuId = tiaoxiuId;
  }

  public String getOvertime_fromdate() {
    return overtime_fromdate;
  }

  public void setOvertime_fromdate(String overtime_fromdate) {
    this.overtime_fromdate = overtime_fromdate;
  }

  public String getOvertime_todate() {
    return overtime_todate;
  }

  public void setOvertime_todate(String overtime_todate) {
    this.overtime_todate = overtime_todate;
  }

  public String getTasktype() {
    return this.tasktype;
  }

  public void setTasktype(final String tasktype) {
    this.tasktype = tasktype;
  }

  @Override
  public String toString() {
    return getResourceId()+"_"+getTaskDate()+"_"+
        getSignDate()+"_"+getSignEndDate()+"_"+getTaskSignTime()+"_"+
        getLastWorkTime()+"_"+getSignInTime4Out()+getTimesource();
  }
}
