package com.pqs9900.pojo.DataInfo;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class TranslateState {
    private String guid;
    private Date dateTime;
    private Date impTime;
    private String imptime;
    private String time;
    private String gdName;
    private String bdName;
    private String pointName;
    private String fileName;
    private Integer state;
    private String describe;
    private Integer allCount;
    private Integer realCount;
    private Integer lineindex;
    private String filePath;
    private Date startTime;
    private Date endTime;

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getGuid() {
        return guid;
    }

    public void setGuid(String guid) {
        this.guid = guid;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public Integer getLineindex() {
        return lineindex;
    }

    public void setLineindex(Integer lineindex) {
        this.lineindex = lineindex;
    }

    public Date getImpTime() {
        return impTime;
    }

    public void setImpTime(Date impTime) {
        this.impTime = impTime;
        try {
        DateFormat bf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        this.imptime = bf.format(this.impTime);
        }catch (Exception e){
            this.imptime = null;
        }
    }

    public String getImptime() {
        return imptime;
    }

    public void setImptime(String imptime) {
        this.imptime = imptime;
    }

    public Integer getAllCount() {
        return allCount == null ? 0 : allCount;
    }

    public void setAllCount(Integer allCount) {
        this.allCount = allCount;
    }

    public Integer getRealCount() {
        return realCount == null ? 0 : realCount;
    }

    public void setRealCount(Integer realCount) {
        this.realCount = realCount;
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    public Date getDateTime() {
        return dateTime;
    }

    public void setDateTime(Date dateTime) {
        this.dateTime = dateTime;

        try {
            DateFormat bf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            this.time = bf.format(this.dateTime);
        }catch (Exception e){
            this.time = null;
        }
    }

    public String getTime() {
        return time == null ? "/" : time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getGdName() {
        return gdName;
    }

    public void setGdName(String gdName) {
        this.gdName = gdName;
    }

    public String getBdName() {
        return bdName;
    }

    public void setBdName(String bdName) {
        this.bdName = bdName;
    }

    public String getPointName() {
        return pointName;
    }

    public void setPointName(String pointName) {
        this.pointName = pointName;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;

        switch (state.intValue()) {
            case 0:
                this.describe = "未解析";
                break;
            case 1:
                this.describe = "解析成功";
                break;
            case 2:
                this.describe = "解析失败";
                break;
            case 3:
                this.describe = "服务器文件不存在";
                break;
            case 4:
                this.describe = "解析中";
                break;
            case 5:
                this.describe = "文件格式不正确";
                break;
        }
    }
}
