package com.pqs9300.pojo.report;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.njcn.utils.AppConfig;
import com.pqs9300.util.TransformTime;

public class Condition implements Serializable {
    private Date start; //查询开始时间
    private Date end; //查询结束时间
    private List<TransformTime> exceptTime; //查询排除时间
    private Integer pointIndex; //监测点ID
    private Double count; //CP95使用
    private Double pltCount; //pltCP95使用
    private Double pstCount; //pstCP95使用
    private Boolean b; //判断时间是否超过7天 >7返回false  大于7天查day表小于7天查总表
    private AppConfig appConfig;
    private String mode; //接线方式
    private Integer times;//谐波次数

    public AppConfig getAppConfig() {
        return appConfig;
    }

    public void setAppConfig(AppConfig appConfig) {
        this.appConfig = appConfig;
    }

    public Integer getTimes() {
        return times;
    }

    public void setTimes(Integer times) {
        this.times = times;
    }

    public String getMode() {
        return mode;
    }

    public void setMode(String mode) {
        this.mode = mode;
    }

    public Condition(AppConfig appConfig) {
        super();
        exceptTime = new ArrayList<>();
        this.appConfig = appConfig;
    }

    public Condition() {
        super();
        exceptTime = new ArrayList<>();
    }

    public Double getCount() {
        return count;
    }

    public void setCount(Double count) {
        this.count = count;
    }

    public Integer getPointIndex() {
        return pointIndex;
    }

    public void setPointIndex(Integer pointIndex) {
        this.pointIndex = pointIndex;
    }

    public Date getStart() {
        return start;
    }

    public void setStart(Date start) {
        this.start = start;
    }

    public Date getEnd() {
        return end;
    }

    public void setEnd(Date end) {
        this.end = end;
    }

    public List<TransformTime> getExceptTime() {
        return exceptTime;
    }

    public void setExceptTime(List<TransformTime> exceptTime) {
        this.exceptTime = exceptTime;
    }

    public Boolean getB() {
        return b;
    }

    public Double getPltCount() {
        return pltCount;
    }

    public void setPltCount(Double pltCount) {
        this.pltCount = pltCount;
    }

    public void setB(Boolean b) {
        this.b = b;
    }

    public Double getPstCount() {
        return pstCount;
    }

    public void setPstCount(Double pstCount) {
        this.pstCount = pstCount;
    }

    public void setB() {
        /*int days = (int) ((this.end.getTime() - this.start.getTime()) / (1000 * 3600 * 24));
        this.b = (days > 7) ? new Boolean(false) : new Boolean(true);*/
        //this.b = false;
        int day = appConfig.getReportday();
        int days = (int) ((this.end.getTime() - this.start.getTime()) / (1000 * 3600 * 24));
        this.b = (days > day) ? new Boolean(false) : new Boolean(true);
    }
}
