package com.inspect.access.base.domain;

import com.inspect.base.core.utils.DateUtils;

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

public class InfraredFileNameGenerator implements Serializable {
    private static final long serialVersionUID = -7545318238298020694L;
    private String stationCode;
    private String taskCode;
    private String patrolpointCode;
    private String patroldeviceCode;
    private String FIR = "FIR";
    private Date now = new Date();
    private String suffix = ".jpg";

    public InfraredFileNameGenerator() {
    }

    public InfraredFileNameGenerator(String stationCode, String taskCode, String patrolpointCode, String patroldeviceCode) {
        this.stationCode = stationCode;
        this.taskCode = taskCode;
        this.patrolpointCode = patrolpointCode;
        this.patroldeviceCode = patroldeviceCode;
    }

    public String getStationCode() {
        return this.stationCode;
    }

    public void setStationCode(String stationCode) {
        this.stationCode = stationCode;
    }

    public String getTaskCode() {
        return this.taskCode;
    }

    public void setTaskCode(String taskCode) {
        this.taskCode = taskCode;
    }

    public String getPatrolpointCode() {
        return this.patrolpointCode;
    }

    public void setPatrolpointCode(String patrolpointCode) {
        this.patrolpointCode = patrolpointCode;
    }

    public String getPatroldeviceCode() {
        return this.patroldeviceCode;
    }

    public void setPatroldeviceCode(String patroldeviceCode) {
        this.patroldeviceCode = patroldeviceCode;
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(this.toStringNoSuffix()).append(this.suffix);
        return sb.toString();
    }

    public String toStringNoSuffix() {
        StringBuilder sb = new StringBuilder();
        sb.append(this.stationCode).append("/").append(DateUtils.parseDateToStr("YYYY", this.now)).append("/").append(DateUtils.parseDateToStr("MM", this.now)).append("/").append(DateUtils.parseDateToStr("dd", this.now)).append("/").append(this.taskCode).append("/").append(this.FIR).append("/").append(this.patrolpointCode).append("_").append(this.patroldeviceCode).append("_");
        return sb.toString();
    }
}
