package com.rjconsultores.ventaboletos.vo.exportacao;

import com.rjconsultores.ventaboletos.utilerias.StringHelper;

public class QdmpDerLinhaVo {
	
	private Integer codEmp;
	private String linha;
	private String secao;
	private Integer digVer;
	private Integer idaOrd;
	private Integer volOrd;
	private Integer idaMul;
	private Integer volMul;
	private Integer idaRft;
	private Integer volRft;
	private Integer idaRfp;
	private Integer volRfp;
	private Integer viagRfp;
	private Integer totMov1;
	private Integer totMov2;
	private Integer totMov3;
	private String codOper;
	
	public QdmpDerLinhaVo(Object[] obj) {
		this.codEmp 	= obj[0]==null?0:(Integer)obj[0];
		this.linha 		= obj[1]==null?"":(String)obj[1];
		this.secao 		= obj[2]==null?"":(String)obj[2];
		this.totMov1 	= obj[3]==null?0:(Integer)obj[3];
		this.totMov1   += obj[4]==null?0:(Integer)obj[4];
		this.idaOrd 	= obj[5]==null?0:(Integer)obj[5];
		this.volOrd 	= obj[6]==null?0:(Integer)obj[6];
		this.idaRft		= obj[7]==null?0:(Integer)obj[7];
		this.viagRfp	= obj[8]==null?0:(Integer)obj[8];
		this.idaRfp	    = obj[9]==null?0:(Integer)obj[9];
		this.volRfp     = obj[10]==null?0:(Integer)obj[10];
		this.viagRfp    = obj[11]==null?0:(Integer)obj[11];
		this.totMov2    = 0;
		this.totMov3    = 0;
		this.digVer     = 0;
		this.codOper    = "I";

	}
	
	public Integer getCodEmp() {
		return codEmp;
	}
	public void setCodEmp(Integer codEmp) {
		this.codEmp = codEmp;
	}
	public String getLinha() {
		return linha;
	}
	public void setLinha(String linha) {
		this.linha = linha;
	}
	public String getSecao() {
		return secao;
	}
	public void setSecao(String secao) {
		this.secao = secao;
	}
	public Integer getDigVer() {
		return digVer;
	}
	public void setDigVer(Integer digVer) {
		this.digVer = digVer;
	}
	public Integer getIdaOrd() {
		return idaOrd;
	}
	public void setIdaOrd(Integer idaOrd) {
		this.idaOrd = idaOrd;
	}
	public Integer getVolOrd() {
		return volOrd;
	}
	public void setVolOrd(Integer volOrd) {
		this.volOrd = volOrd;
	}
	public Integer getIdaMul() {
		return idaMul;
	}
	public void setIdaMul(Integer idaMul) {
		this.idaMul = idaMul;
	}
	public Integer getVolMul() {
		return volMul;
	}
	public void setVolMul(Integer volMul) {
		this.volMul = volMul;
	}
	public Integer getIdaRft() {
		return idaRft;
	}
	public void setIdaRft(Integer idaRft) {
		this.idaRft = idaRft;
	}
	public Integer getVolRft() {
		return volRft;
	}
	public void setVolRft(Integer volRft) {
		this.volRft = volRft;
	}
	public Integer getViagRfp() {
		return viagRfp;
	}
	public void setViagRfp(Integer viagRfp) {
		this.viagRfp = viagRfp;
	}
	public Integer getIdaRftPar() {
		return idaRfp;
	}
	public void setIdaRftPar(Integer idaRftPar) {
		this.idaRfp = idaRftPar;
	}
	public Integer getVolRftPar() {
		return volRfp;
	}
	public void setVolRftPar(Integer volRftPar) {
		this.volRfp = volRftPar;
	}
	public Integer getTotMov1() {
		return totMov1;
	}
	public void setTotMov1(Integer totMov1) {
		this.totMov1 = totMov1;
	}
	public Integer getTotMov2() {
		return totMov2;
	}
	public void setTotMov2(Integer totMov2) {
		this.totMov2 = totMov2;
	}
	public Integer getTotMov3() {
		return totMov3;
	}
	public void setTotMov3(Integer totMov3) {
		this.totMov3 = totMov3;
	}
	public String getCodOper() {
		return codOper;
	}
	public void setCodOper(String codOper) {
		this.codOper = codOper;
	}
	
	@Override
	public String toString() {
		StringBuilder retorno = new StringBuilder();
		retorno.append("P")
		.append(codEmp)
		.append(StringHelper.preencherStringEspacoEsquerda(linha, 10))
		.append(secao)
		.append(digVer)
		.append( StringHelper.preencherZeroEsquerda(idaOrd, 6) )
		.append( StringHelper.preencherZeroEsquerda(volOrd, 6) )
		.append( StringHelper.preencherZeroEsquerda(idaMul, 6) )
		.append( StringHelper.preencherZeroEsquerda(volMul, 6) )
		.append( StringHelper.preencherZeroEsquerda(idaRft, 6) )
		.append( StringHelper.preencherZeroEsquerda(volRft, 6) )		
		.append( StringHelper.preencherZeroEsquerda(idaRfp, 6) )
		.append( StringHelper.preencherZeroEsquerda(volRfp, 6) )
		.append( StringHelper.preencherZeroEsquerda(viagRfp, 5) )
		.append( StringHelper.preencherZeroEsquerda(totMov1, 7) )
		.append( StringHelper.preencherZeroEsquerda(totMov2, 7) )
		.append( StringHelper.preencherZeroEsquerda(totMov3, 7) ) 	
		.append(codOper);
		
		return retorno.toString();
	}

}
