Search in sources :

Example 1 with PlanningService

use of com.tomasio.projects.trainning.interfaces.PlanningService in project trainning by fernandotomasio.

the class ImportTurmasEfetivasFromPlanejamento method main.

public static void main(String[] args) {
    Long planejamentoId = 714644L;
    ApplicationContext context = new ClassPathXmlApplicationContext("service-context.xml");
    AtividadesEnsinoService atividadesService = (AtividadesEnsinoService) context.getBean("atividadesEnsinoService");
    TrainningService trainningService = (TrainningService) context.getBean("trainningService");
    PlanningService planningService = (PlanningService) context.getBean("planningService");
    try {
        PlanejamentoDTO planejamento = planningService.findPlanejamento(planejamentoId);
        TurmaPlanejadaDTO[] turmasPlanejadas = planningService.findAllTurmasPlanejadas(planejamentoId, null, null, null);
        for (TurmaPlanejadaDTO turmaPlanejadaDTO : turmasPlanejadas) {
            TurmaEfetivaDTO turmaEfetiva = new TurmaEfetivaDTO();
            turmaEfetiva.setCurso(trainningService.findCurso(turmaPlanejadaDTO.getCurso().getId()));
            turmaEfetiva.setResponsavelId(turmaPlanejadaDTO.getResponsavelId());
            turmaEfetiva.setOrganizacaoGestoraId(planejamento.getOrganizacao().getId());
            turmaEfetiva.setResponsavelMatriculaId(planejamento.getOrganizacao().getId());
            turmaEfetiva.setResponsavelConclusaoId(turmaPlanejadaDTO.getResponsavelId());
            turmaEfetiva.setResponsavelPreMatriculaId(planejamento.getOrganizacao().getId());
            turmaEfetiva.setResponsavelSelecaoId(planejamento.getOrganizacao().getId());
            turmaEfetiva.setResponsavelApresentacaoId(turmaPlanejadaDTO.getResponsavelId());
            turmaEfetiva.setNumeroTurma(turmaPlanejadaDTO.getNumeroTurma());
            Set<FaseDTO> fasesDTO = new HashSet<FaseDTO>(Arrays.asList(turmaPlanejadaDTO.getFases()));
            FaseDTO[] fasesArray = new FaseDTO[fasesDTO.size()];
            int i = 0;
            for (FaseDTO faseDTO : fasesDTO) {
                fasesArray[i] = faseDTO;
                i++;
            }
            turmaEfetiva.setFases(fasesArray);
            turmaEfetiva.setTurmaPlanejadaId(turmaPlanejadaDTO.getId());
            turmaEfetiva.setNumeroTurma(turmaPlanejadaDTO.getNumeroTurma());
            turmaEfetiva.setQuantidadeVagas(turmaPlanejadaDTO.getQuantidadeVagas());
            Calendar calendar = Calendar.getInstance();
            SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
            Date dataInicio = turmaPlanejadaDTO.getDataInicio();
            Date startIndicacoes = null;
            Date endIndicacoes = null;
            if (dataInicio != null) {
                calendar.setTime(dataInicio);
                try {
                    startIndicacoes = df.parse("01/02/2017");
                    calendar.add(Calendar.DATE, -20);
                    endIndicacoes = df.parse(df.format(calendar.getTime()));
                } catch (ParseException ex) {
                    Logger.getLogger(ImportTurmasEfetivasFromPlanejamento.class.getName()).log(Level.SEVERE, null, ex);
                }
            } else {
                try {
                    startIndicacoes = df.parse("01/02/2017");
                    endIndicacoes = df.parse("31/12/2017");
                } catch (ParseException ex) {
                    Logger.getLogger(ImportTurmasEfetivasFromPlanejamento.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
            PeriodoDTO periodoIndicacoes = new PeriodoDTO();
            periodoIndicacoes.setDataInicio(startIndicacoes);
            periodoIndicacoes.setDataTermino(endIndicacoes);
            turmaEfetiva.setPeriodoIndicacao(periodoIndicacoes);
            // TODO: QuantidadeVagas?
            // TODO: periodoIndicacao?
            // TreinamentoPlanejadoDTO [] treinamentosPlanejados = turmaPlanejadaDTO.getTreinamentosPlanejados();
            // for (TreinamentoPlanejadoDTO treinamentoPlanejadoDTO : treinamentosPlanejados) {
            // DistribuicaoDTO distribuicao = new DistribuicaoDTO();
            // distribuicao.setOrganizacao(treinamentoPlanejadoDTO.getOrganizacao());
            // distribuicao.setQuantidadeVagas(treinamentoPlanejadoDTO.getQuantidade());
            // distribuicao.setReserva(false);
            // //turmaEfetiva.getDistribuicoes().add(distribuicao);
            // 
            // }
            Date exercicio = planejamento.getExercicio();
            turmaEfetiva.setExercicio(exercicio);
            Long turmaId = atividadesService.createTurmaEfetiva(turmaEfetiva);
            System.out.println("Criada Turma " + turmaId);
            // Distribuição de Vagas
            DistribuicaoDTO[] distribuicoes = planningService.findAllDistribuicoes(turmaPlanejadaDTO.getId());
            for (DistribuicaoDTO distribuicaoPlanejada : distribuicoes) {
                DistribuicaoDTO distribuicaoEfetiva = new DistribuicaoDTO();
                distribuicaoEfetiva.setOrganizacao(distribuicaoPlanejada.getOrganizacao());
                distribuicaoEfetiva.setPrioridade(distribuicaoPlanejada.getPrioridade());
                distribuicaoEfetiva.setQuantidadeVagas(distribuicaoPlanejada.getQuantidadeVagas());
                distribuicaoEfetiva.setReserva(distribuicaoPlanejada.isReserva());
                distribuicaoEfetiva.setTurma(atividadesService.findTurmaEfetiva(turmaId));
                atividadesService.createDistribuicao(distribuicaoEfetiva);
            }
        }
        System.out.println("Finalizado");
    } catch (Exception e) {
    }
}
Also used : PlanningService(com.tomasio.projects.trainning.interfaces.PlanningService) Calendar(java.util.Calendar) Date(java.util.Date) ParseException(java.text.ParseException) PlanejamentoDTO(com.tomasio.projects.trainning.dto.PlanejamentoDTO) FaseDTO(com.tomasio.projects.trainning.dto.FaseDTO) DistribuicaoDTO(com.tomasio.projects.trainning.dto.DistribuicaoDTO) ApplicationContext(org.springframework.context.ApplicationContext) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) TurmaEfetivaDTO(com.tomasio.projects.trainning.dto.TurmaEfetivaDTO) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) TrainningService(com.tomasio.projects.trainning.interfaces.TrainningService) PeriodoDTO(com.tomasio.projects.trainning.dto.PeriodoDTO) ParseException(java.text.ParseException) SimpleDateFormat(java.text.SimpleDateFormat) AtividadesEnsinoService(com.tomasio.projects.trainning.interfaces.AtividadesEnsinoService) TurmaPlanejadaDTO(com.tomasio.projects.trainning.dto.TurmaPlanejadaDTO) HashSet(java.util.HashSet)

Example 2 with PlanningService

use of com.tomasio.projects.trainning.interfaces.PlanningService in project trainning by fernandotomasio.

the class PLN001CSV method makeReport.

@Override
public void makeReport() {
    PlanningService planningService = (PlanningService) services.get("planningService");
    Writer writter = new OutputStreamWriter(os);
    BufferedWriter bufferedWriter = new BufferedWriter(writter);
    SolicitacaoPlamensDTO[] solicitacoes = planningService.findAllSolicitacoesPlamens(0, null, null);
    for (SolicitacaoPlamensDTO dto : solicitacoes) {
        try {
            bufferedWriter.write("1");
            bufferedWriter.write(";");
            if (dto.getOrganizacaoProponente() != null) {
                bufferedWriter.write(dto.getOrganizacaoProponente().getSigla().replace(";", ",").replaceAll("\\r\\n|\\r|\\n", " "));
            } else {
                bufferedWriter.write("");
            }
            bufferedWriter.write(";");
            bufferedWriter.write(dto.getAno());
            bufferedWriter.write(";");
            bufferedWriter.write(dto.getCurso().replace(";", ","));
            bufferedWriter.write(";");
            bufferedWriter.write(dto.getLocal().replace(";", ","));
            bufferedWriter.write(";");
            bufferedWriter.write(dto.getCidade().replace(";", ","));
            bufferedWriter.write(";");
            bufferedWriter.write(dto.getEstado().replace(";", ","));
            bufferedWriter.write(";");
            bufferedWriter.write(dto.getPais().replace(";", ","));
            bufferedWriter.write(";");
            if (dto.getDataInicio() != null) {
                bufferedWriter.write(dto.getDataInicioFormatted().replace(";", ",").replaceAll("\\r\\n|\\r|\\n", " "));
            } else {
                bufferedWriter.write("");
            }
            bufferedWriter.write(";");
            if (dto.getDataTermino() != null) {
                bufferedWriter.write(dto.getDataTerminoFormatted());
            } else {
                bufferedWriter.write("");
            }
            bufferedWriter.write(";");
            // duracao
            bufferedWriter.write(30);
            bufferedWriter.write(";");
            if (dto.getOrganizacaoSolicitante() != null) {
                bufferedWriter.write(dto.getOrganizacaoSolicitante().getSigla());
            } else {
                bufferedWriter.write("");
            }
            bufferedWriter.write(";");
            bufferedWriter.write(dto.getQuantidadeVagas());
            bufferedWriter.write(";");
            bufferedWriter.write(dto.getPostoIndicados().replace(";", ",").replaceAll("\\r\\n|\\r|\\n", " "));
            bufferedWriter.write(";");
            bufferedWriter.write(dto.getDestinoAposMissao().replace(";", ",").replaceAll("\\r\\n|\\r|\\n", " "));
            bufferedWriter.write(";");
            bufferedWriter.write(dto.getFuncaoAposMissao().replace(";", ",").replaceAll("\\r\\n|\\r|\\n", " "));
            bufferedWriter.write(";");
            bufferedWriter.write(dto.getQuantidadeCursos());
            bufferedWriter.write(";");
            bufferedWriter.write(String.valueOf(dto.getAjudaCusto()));
            bufferedWriter.write(";");
            bufferedWriter.write(String.valueOf(dto.getDiarias()));
            bufferedWriter.write(";");
            bufferedWriter.write(String.valueOf(dto.getCustoCurso()));
            bufferedWriter.write(";");
            bufferedWriter.write(String.valueOf(dto.getTransportePessoal()));
            bufferedWriter.write(";");
            bufferedWriter.write(String.valueOf(dto.getBagagem()));
            bufferedWriter.write(";");
            bufferedWriter.write(String.valueOf(dto.getOutros()));
            bufferedWriter.write(";");
            bufferedWriter.write(String.valueOf(dto.getCustoTotal()));
            bufferedWriter.write(";");
            bufferedWriter.write(dto.getAnoTomadaPrecos());
            bufferedWriter.write(";");
            bufferedWriter.write(dto.getPreRequisitos().replace(";", ",").replaceAll("\\r\\n|\\r|\\n", " "));
            bufferedWriter.write(";");
            bufferedWriter.write(dto.getJustificativa().replace(";", ",").replaceAll("\\r\\n|\\r|\\n", " "));
            bufferedWriter.write(";");
            bufferedWriter.write(dto.getSistema().replace(";", ",").replaceAll("\\r\\n|\\r|\\n", " "));
            bufferedWriter.write(";");
            bufferedWriter.write(dto.getPlanoTransmissao().replace(";", ",").replaceAll("\\r\\n|\\r|\\n", " "));
            bufferedWriter.newLine();
        } catch (IOException ex) {
            Logger.getLogger(PLN001CSV.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
Also used : SolicitacaoPlamensDTO(com.tomasio.projects.trainning.dto.SolicitacaoPlamensDTO) PlanningService(com.tomasio.projects.trainning.interfaces.PlanningService) OutputStreamWriter(java.io.OutputStreamWriter) IOException(java.io.IOException) BufferedWriter(java.io.BufferedWriter) Writer(java.io.Writer) OutputStreamWriter(java.io.OutputStreamWriter) BufferedWriter(java.io.BufferedWriter)

Example 3 with PlanningService

use of com.tomasio.projects.trainning.interfaces.PlanningService in project trainning by fernandotomasio.

the class PLN002XLS method makeReport.

@Override
public void makeReport() {
    PlanningService planningService = (PlanningService) services.get("planningService");
    int ano = (Integer) params.get("ano");
    try {
        WritableWorkbook workbook = Workbook.createWorkbook(os);
        WritableSheet sheet = workbook.createSheet("PLAMENS", 0);
        SolicitacaoPacespDTO[] solicitacoes = planningService.findAllSolicitacoesPacesp(ano, null, null);
        int i = 0;
        for (SolicitacaoPacespDTO dto : solicitacoes) {
            Label numeroMissaoLabel = new Label(0, i, "XX");
            sheet.addCell(numeroMissaoLabel);
            Label organizacaoProponenteLabel = null;
            if (dto.getOrganizacaoProponente() != null) {
                organizacaoProponenteLabel = new Label(1, i, dto.getOrganizacaoProponente().getSigla());
            } else {
                organizacaoProponenteLabel = new Label(1, i, "");
            }
            sheet.addCell(organizacaoProponenteLabel);
            Label anoLabel = new Label(2, i, Integer.toString(dto.getAno()));
            sheet.addCell(anoLabel);
            Label cursoLabel = new Label(3, i, dto.getCurso());
            sheet.addCell(cursoLabel);
            Label localLabel = new Label(4, i, dto.getLocal());
            sheet.addCell(localLabel);
            Label cidadeLabel = new Label(5, i, dto.getCidade());
            sheet.addCell(cidadeLabel);
            Label estadoLabel = new Label(6, i, dto.getEstado());
            sheet.addCell(estadoLabel);
            Label paisLabel = new Label(7, i, "");
            sheet.addCell(paisLabel);
            Label dataInicioLabel = null;
            dataInicioLabel = new Label(8, i, "");
            sheet.addCell(dataInicioLabel);
            Label dataTerminoLabel = null;
            dataTerminoLabel = new Label(9, i, "");
            sheet.addCell(dataTerminoLabel);
            Label duracaoLabel = new Label(10, i, String.valueOf(dto.getDuracao()));
            sheet.addCell(duracaoLabel);
            Label organizacaoSolicitanteLabel = null;
            if (dto.getOrganizacaoSolicitante() != null) {
                organizacaoSolicitanteLabel = new Label(11, i, dto.getOrganizacaoSolicitante().getSigla());
            } else {
                organizacaoSolicitanteLabel = new Label(11, i, "");
            }
            sheet.addCell(organizacaoSolicitanteLabel);
            Label quantidadeVagasLabel = new Label(12, i, String.valueOf(dto.getQuantidadeVagasCivil() + dto.getQuantidadeVagasMilitar()));
            sheet.addCell(quantidadeVagasLabel);
            Label postoIndicadosLabel = new Label(13, i, "");
            sheet.addCell(postoIndicadosLabel);
            Label destinoAposMissaoLabel = new Label(14, i, "");
            sheet.addCell(destinoAposMissaoLabel);
            Label funcaoAposMissaoLabel = new Label(15, i, "");
            sheet.addCell(funcaoAposMissaoLabel);
            Label quantidadeCursosLabel = new Label(16, i, "");
            sheet.addCell(quantidadeCursosLabel);
            Label ajudaCursoLabel = new Label(17, i, "");
            sheet.addCell(ajudaCursoLabel);
            Label diariasLabel = new Label(18, i, "");
            sheet.addCell(diariasLabel);
            Label custoCursoLabel = new Label(19, i, dto.getCustoTotalFormatted());
            sheet.addCell(custoCursoLabel);
            Label transportePessoaLabel = new Label(20, i, "");
            sheet.addCell(transportePessoaLabel);
            Label bagagemLabel = new Label(21, i, "");
            sheet.addCell(bagagemLabel);
            Label outrosLabel = new Label(22, i, "");
            sheet.addCell(outrosLabel);
            Label custoTotalLabel = new Label(23, i, dto.getCustoTotalFormatted());
            sheet.addCell(custoTotalLabel);
            Label anoTomadaPrecosLabel = new Label(24, i, "");
            sheet.addCell(anoTomadaPrecosLabel);
            Label preRequisitosLabel = new Label(25, i, "");
            sheet.addCell(preRequisitosLabel);
            Label justificativaLabel = new Label(26, i, dto.getJustificativa().toUpperCase());
            sheet.addCell(justificativaLabel);
            Label sistemaLabel = new Label(27, i, "");
            sheet.addCell(sistemaLabel);
            Label planoTransmissaoLabel = new Label(28, i, "");
            sheet.addCell(planoTransmissaoLabel);
            Label observacaoLabel = null;
            if (dto.getObservacao() != null) {
                observacaoLabel = new Label(29, i, dto.getObservacao().toUpperCase());
            } else {
                observacaoLabel = new Label(29, i, "");
            }
            sheet.addCell(observacaoLabel);
            Label tipoLabel = new Label(30, i, "");
            sheet.addCell(tipoLabel);
            i++;
        }
        workbook.write();
        workbook.close();
    } catch (RowsExceededException ex) {
        Logger.getLogger(PLN002XLS.class.getName()).log(Level.SEVERE, null, ex);
    } catch (WriteException ex) {
        Logger.getLogger(PLN002XLS.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(PLN002XLS.class.getName()).log(Level.SEVERE, null, ex);
    }
}
Also used : WritableWorkbook(jxl.write.WritableWorkbook) WriteException(jxl.write.WriteException) SolicitacaoPacespDTO(com.tomasio.projects.trainning.dto.SolicitacaoPacespDTO) PlanningService(com.tomasio.projects.trainning.interfaces.PlanningService) Label(jxl.write.Label) WritableSheet(jxl.write.WritableSheet) IOException(java.io.IOException) RowsExceededException(jxl.write.biff.RowsExceededException)

Example 4 with PlanningService

use of com.tomasio.projects.trainning.interfaces.PlanningService in project trainning by fernandotomasio.

the class PLN006ODF method makeReport.

@Override
public void makeReport() {
    try {
        PlanningService service = (PlanningService) services.get("planningService");
        Long solicitacaoId = (Long) params.get("solicitacaoId");
        SolicitacaoPlamensDTO solicitacao = service.findSolicitacaoPlamens(solicitacaoId);
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        // String path = classLoader.getResource("fic.odt").getPath();
        // 
        odt = OdfTextDocument.loadDocument(classLoader.getResourceAsStream("fic.odt"));
        TextNavigation tipoBrasil;
        tipoBrasil = new TextNavigation("VAR_BR", odt);
        if (tipoBrasil.hasNext()) {
            TextSelection item = (TextSelection) tipoBrasil.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL")) {
                item.replaceWith(" X ");
            } else {
                item.replaceWith("   ");
            }
        }
        TextNavigation tipoExterior;
        tipoExterior = new TextNavigation("VAR_EXT", odt);
        if (tipoExterior.hasNext()) {
            TextSelection item = (TextSelection) tipoExterior.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR")) {
                item.replaceWith(" X ");
            } else {
                item.replaceWith("   ");
            }
        }
        TextNavigation ano;
        ano = new TextNavigation("VARIAVEL_ANO", odt);
        if (ano.hasNext()) {
            TextSelection item = (TextSelection) ano.getCurrentItem();
            item.replaceWith(String.valueOf(solicitacao.getAno()));
        }
        TextNavigation solicitante;
        solicitante = new TextNavigation("VARIAVEL_SOLICITANTE", odt);
        if (solicitante.hasNext()) {
            TextSelection item = (TextSelection) solicitante.getCurrentItem();
            if (solicitacao.getOrganizacaoSolicitante().getSigla() != null) {
                item.replaceWith(solicitacao.getOrganizacaoSolicitante().getSigla().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation proponente;
        proponente = new TextNavigation("VARIAVEL_PROPONENTE", odt);
        if (proponente.hasNext()) {
            TextSelection item = (TextSelection) proponente.getCurrentItem();
            if (solicitacao.getOrganizacaoProponente() != null) {
                item.replaceWith(solicitacao.getOrganizacaoProponente().getSigla().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation titulo;
        titulo = new TextNavigation("VARIAVEL_TITULO", odt);
        if (titulo.hasNext()) {
            TextSelection item = (TextSelection) titulo.getCurrentItem();
            if (solicitacao.getCurso() != null) {
                item.replaceWith(solicitacao.getCurso().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation local;
        local = new TextNavigation("VARIAVEL_LOCAL", odt);
        if (local.hasNext()) {
            TextSelection item = (TextSelection) local.getCurrentItem();
            if (solicitacao.getLocal() != null) {
                item.replaceWith(solicitacao.getLocal().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation cidade;
        cidade = new TextNavigation("VARIAVEL_CIDADE", odt);
        if (cidade.hasNext()) {
            TextSelection item = (TextSelection) cidade.getCurrentItem();
            if (solicitacao.getCidade() != null) {
                item.replaceWith(solicitacao.getCidade().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation estado;
        estado = new TextNavigation("VARIAVEL_ESTADO", odt);
        if (estado.hasNext()) {
            TextSelection item = (TextSelection) estado.getCurrentItem();
            if (solicitacao.getEstado() != null) {
                item.replaceWith(solicitacao.getEstado().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation pais;
        pais = new TextNavigation("VARIAVEL_PAIS", odt);
        if (pais.hasNext()) {
            TextSelection item = (TextSelection) pais.getCurrentItem();
            if (solicitacao.getPais() != null) {
                item.replaceWith(solicitacao.getPais().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        // odt.save(os);
        TextNavigation dataInicio;
        dataInicio = new TextNavigation("VARIAVEL_DATA_INICIO", odt);
        String dataInicioField = "NÃO DEFINIDA";
        if (solicitacao.getDataInicioFormatted() != null) {
            dataInicioField = solicitacao.getDataInicioFormatted().toUpperCase();
        }
        if (dataInicio.hasNext()) {
            TextSelection item = (TextSelection) dataInicio.getCurrentItem();
            item.replaceWith(dataInicioField);
        }
        String dataTerminoField = "NÃO DEFINIDA";
        if (solicitacao.getDataTerminoFormatted() != null) {
            dataTerminoField = solicitacao.getDataTerminoFormatted().toUpperCase();
        }
        TextNavigation dataTermino;
        dataTermino = new TextNavigation("VARIAVEL_DATA_TERMINO", odt);
        if (dataTermino.hasNext()) {
            TextSelection item = (TextSelection) dataTermino.getCurrentItem();
            item.replaceWith(dataTerminoField);
        }
        TextNavigation duracao;
        duracao = new TextNavigation("VARIAVEL_DURACAO", odt);
        if (duracao.hasNext()) {
            TextSelection item = (TextSelection) duracao.getCurrentItem();
            item.replaceWith(String.valueOf(solicitacao.getDuracao()) + " dia(s)");
        }
        TextNavigation cargaHoraria;
        cargaHoraria = new TextNavigation("VARIAVEL_CARGA_HORARIA", odt);
        if (cargaHoraria.hasNext()) {
            TextSelection item = (TextSelection) cargaHoraria.getCurrentItem();
            if (solicitacao.getCargaHoraria() != null) {
                item.replaceWith(solicitacao.getCargaHoraria().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation objetivos;
        objetivos = new TextNavigation("VARIAVEL_OBJETIVOS", odt);
        if (objetivos.hasNext()) {
            TextSelection item = (TextSelection) objetivos.getCurrentItem();
            if (solicitacao.getObjetivos() != null) {
                item.replaceWith(solicitacao.getObjetivos().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation linhaPesquisa;
        linhaPesquisa = new TextNavigation("VARIAVEL_LINHA_PESQUISA", odt);
        if (linhaPesquisa.hasNext()) {
            TextSelection item = (TextSelection) linhaPesquisa.getCurrentItem();
            if (solicitacao.getAreaPesquisa() != null) {
                item.replaceWith(solicitacao.getAreaPesquisa().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation existsSimilarSim;
        existsSimilarSim = new TextNavigation("VAR_SS", odt);
        if (existsSimilarSim.hasNext()) {
            TextSelection item = (TextSelection) existsSimilarSim.getCurrentItem();
            if (solicitacao.isExistenteSimilar()) {
                item.replaceWith(" X ");
            } else {
                item.replaceWith("   ");
            }
        }
        TextNavigation existsSimilarNao;
        existsSimilarNao = new TextNavigation("VAR_SN", odt);
        if (existsSimilarNao.hasNext()) {
            TextSelection item = (TextSelection) existsSimilarNao.getCurrentItem();
            if (solicitacao.isExistenteSimilar()) {
                item.replaceWith("   ");
            } else {
                item.replaceWith(" X ");
            }
        }
        TextNavigation similarDescricao;
        similarDescricao = new TextNavigation("VARIAVEL_SIMILAR_DESCRICAO", odt);
        if (similarDescricao.hasNext()) {
            TextSelection item = (TextSelection) similarDescricao.getCurrentItem();
            if (solicitacao.getDescricaoSimilar() != null) {
                item.replaceWith(solicitacao.getDescricaoSimilar().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation assuntosMinistrados;
        assuntosMinistrados = new TextNavigation("VARIAVEL_ASSUNTOS_MINISTRADOS", odt);
        if (assuntosMinistrados.hasNext()) {
            TextSelection item = (TextSelection) assuntosMinistrados.getCurrentItem();
            if (solicitacao.getAssuntosMinistrados() != null) {
                item.replaceWith(solicitacao.getAssuntosMinistrados().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation missoesRealizadas;
        missoesRealizadas = new TextNavigation("VARIAVEL_MISSOES_REALIZADAS", odt);
        if (missoesRealizadas.hasNext()) {
            TextSelection item = (TextSelection) missoesRealizadas.getCurrentItem();
            if (solicitacao.getQuantidadeMissoesSemelhantes() != null) {
                item.replaceWith(solicitacao.getQuantidadeMissoesSemelhantes().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation grauImportanciaImprescindivel;
        grauImportanciaImprescindivel = new TextNavigation("VAR_IMP_I", odt);
        if (grauImportanciaImprescindivel.hasNext()) {
            TextSelection item = (TextSelection) grauImportanciaImprescindivel.getCurrentItem();
            if (solicitacao.getGrauImportancia().equals("IMPRESCINDÍVEL")) {
                item.replaceWith(" X ");
            } else {
                item.replaceWith("   ");
            }
        }
        TextNavigation grauImportanciaNecessario;
        grauImportanciaNecessario = new TextNavigation("VAR_IMP_N", odt);
        if (grauImportanciaNecessario.hasNext()) {
            TextSelection item = (TextSelection) grauImportanciaNecessario.getCurrentItem();
            if (solicitacao.getGrauImportancia().equals("NECESSÁRIO")) {
                item.replaceWith(" X ");
            } else {
                item.replaceWith("   ");
            }
        }
        TextNavigation grauImpotanciaDesejavel;
        grauImpotanciaDesejavel = new TextNavigation("VAR_IMP_D", odt);
        if (grauImpotanciaDesejavel.hasNext()) {
            TextSelection item = (TextSelection) grauImpotanciaDesejavel.getCurrentItem();
            if (solicitacao.getGrauImportancia().equals("DESEJÁVEL")) {
                item.replaceWith(" X ");
            } else {
                item.replaceWith("   ");
            }
        }
        TextNavigation grauImportanciaDescricao;
        grauImportanciaDescricao = new TextNavigation("VARIAVEL_GRAU_IMPORTANCIA", odt);
        if (grauImportanciaDescricao.hasNext()) {
            TextSelection item = (TextSelection) grauImportanciaDescricao.getCurrentItem();
            if (solicitacao.getGrauImportanciaDescricao() != null) {
                item.replaceWith(solicitacao.getGrauImportanciaDescricao().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation preRequisitos;
        preRequisitos = new TextNavigation("VARIAVEL_PRE_REQUISITOS", odt);
        if (preRequisitos.hasNext()) {
            TextSelection item = (TextSelection) preRequisitos.getCurrentItem();
            if (solicitacao.getPreRequisitos() != null) {
                item.replaceWith(solicitacao.getPreRequisitos().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation posto;
        posto = new TextNavigation("VARIAVEL_POSTO", odt);
        if (posto.hasNext()) {
            TextSelection item = (TextSelection) posto.getCurrentItem();
            if (solicitacao.getPostoIndicados() != null) {
                item.replaceWith(solicitacao.getPostoIndicados().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation vagas;
        vagas = new TextNavigation("VARIAVEL_VAGAS", odt);
        if (vagas.hasNext()) {
            TextSelection item = (TextSelection) vagas.getCurrentItem();
            if (solicitacao.getQuantidadeVagas() != null) {
                item.replaceWith(solicitacao.getQuantidadeVagas().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation destino;
        destino = new TextNavigation("VARIAVEL_DESTINO", odt);
        if (destino.hasNext()) {
            TextSelection item = (TextSelection) destino.getCurrentItem();
            if (solicitacao.getDestinoAposMissao() != null) {
                item.replaceWith(solicitacao.getDestinoAposMissao().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation funcao;
        funcao = new TextNavigation("VARIAVEL_FUNCAO", odt);
        if (funcao.hasNext()) {
            TextSelection item = (TextSelection) funcao.getCurrentItem();
            if (solicitacao.getFuncaoAposMissao() != null) {
                item.replaceWith(solicitacao.getFuncaoAposMissao().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation capacitacao;
        capacitacao = new TextNavigation("VARIAVEL_CAPACITACAO", odt);
        if (capacitacao.hasNext()) {
            TextSelection item = (TextSelection) capacitacao.getCurrentItem();
            if (solicitacao.getCapacitacaoDesejada() != null) {
                item.replaceWith(solicitacao.getCapacitacaoDesejada().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation plano;
        plano = new TextNavigation("VARIAVEL_PLANO_APLICACAO", odt);
        if (plano.hasNext()) {
            TextSelection item = (TextSelection) plano.getCurrentItem();
            if (solicitacao.getPlanoAplicacao() != null) {
                item.replaceWith(solicitacao.getPlanoAplicacao().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation justificativa;
        justificativa = new TextNavigation("VARIAVEL_JUSTIFICATIVA", odt);
        if (justificativa.hasNext()) {
            TextSelection item = (TextSelection) justificativa.getCurrentItem();
            if (solicitacao.getJustificativa() != null) {
                item.replaceWith(solicitacao.getJustificativa().toUpperCase());
            } else {
                item.replaceWith("");
            }
        }
        // AJUDA DE CUSTO
        TextNavigation ajdBR3;
        ajdBR3 = new TextNavigation("VAR_R_AJD3", odt);
        if (ajdBR3.hasNext()) {
            TextSelection item = (TextSelection) ajdBR3.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getAjudaCusto3Formatted() != null) {
                item.replaceWith(solicitacao.getAjudaCusto3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation adjUS3;
        adjUS3 = new TextNavigation("VAR_U_AJD3", odt);
        if (adjUS3.hasNext()) {
            TextSelection item = (TextSelection) adjUS3.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getAjudaCusto3Formatted() != null) {
                item.replaceWith(solicitacao.getAjudaCusto3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation ajdBR2;
        ajdBR2 = new TextNavigation("VAR_R_AJD2", odt);
        if (ajdBR2.hasNext()) {
            TextSelection item = (TextSelection) ajdBR2.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getAjudaCusto2Formatted() != null) {
                item.replaceWith(solicitacao.getAjudaCusto2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation adjUS2;
        adjUS2 = new TextNavigation("VAR_U_AJD2", odt);
        if (adjUS2.hasNext()) {
            TextSelection item = (TextSelection) adjUS2.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getAjudaCusto2Formatted() != null) {
                item.replaceWith(solicitacao.getAjudaCusto2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation ajdBR1;
        ajdBR1 = new TextNavigation("VAR_R_AJD1", odt);
        if (ajdBR1.hasNext()) {
            TextSelection item = (TextSelection) ajdBR1.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getAjudaCusto1Formatted() != null) {
                item.replaceWith(solicitacao.getAjudaCusto1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation adjUS1;
        adjUS1 = new TextNavigation("VAR_U_AJD1", odt);
        if (adjUS1.hasNext()) {
            TextSelection item = (TextSelection) adjUS1.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getAjudaCusto1Formatted() != null) {
                item.replaceWith(solicitacao.getAjudaCusto1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation ajdBR;
        ajdBR = new TextNavigation("VAR_R_AJD", odt);
        if (ajdBR.hasNext()) {
            TextSelection item = (TextSelection) ajdBR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getAjudaCustoFormatted() != null) {
                item.replaceWith(solicitacao.getAjudaCustoFormatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation adjUS;
        adjUS = new TextNavigation("VAR_U_AJD", odt);
        if (adjUS.hasNext()) {
            TextSelection item = (TextSelection) adjUS.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getAjudaCustoFormatted() != null) {
                item.replaceWith(solicitacao.getAjudaCustoFormatted());
            } else {
                item.replaceWith("");
            }
        }
        // SALARIO
        TextNavigation salario3BR;
        salario3BR = new TextNavigation("VAR_R_SAL3", odt);
        if (salario3BR.hasNext()) {
            TextSelection item = (TextSelection) salario3BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getSalario3Formatted() != null) {
                item.replaceWith(solicitacao.getSalario3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation salarioUS3;
        salarioUS3 = new TextNavigation("VAR_U_SAL3", odt);
        if (salarioUS3.hasNext()) {
            TextSelection item = (TextSelection) salarioUS3.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getSalario3Formatted() != null) {
                item.replaceWith(solicitacao.getSalario3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation salario2BR;
        salario2BR = new TextNavigation("VAR_R_SAL2", odt);
        if (salario2BR.hasNext()) {
            TextSelection item = (TextSelection) salario2BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getSalario2Formatted() != null) {
                item.replaceWith(solicitacao.getSalario2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation salarioUS2;
        salarioUS2 = new TextNavigation("VAR_U_SAL2" + "", odt);
        if (salarioUS2.hasNext()) {
            TextSelection item = (TextSelection) salarioUS2.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getSalario2Formatted() != null) {
                item.replaceWith(solicitacao.getSalario2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation salario1BR;
        salario1BR = new TextNavigation("VAR_R_SAL1", odt);
        if (salario1BR.hasNext()) {
            TextSelection item = (TextSelection) salario1BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getSalario1Formatted() != null) {
                item.replaceWith(solicitacao.getSalario1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation salarioUS1;
        salarioUS1 = new TextNavigation("VAR_U_SAL1", odt);
        if (salarioUS1.hasNext()) {
            TextSelection item = (TextSelection) salarioUS1.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getSalario1Formatted() != null) {
                item.replaceWith(solicitacao.getSalario1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation salarioBR;
        salarioBR = new TextNavigation("VAR_R_SAL", odt);
        if (salarioBR.hasNext()) {
            TextSelection item = (TextSelection) salarioBR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getSalarioFormatted() != null) {
                item.replaceWith(solicitacao.getSalarioFormatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation salarioUS;
        salarioUS = new TextNavigation("VAR_U_SAL", odt);
        if (salarioUS.hasNext()) {
            TextSelection item = (TextSelection) salarioUS.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getSalarioFormatted() != null) {
                item.replaceWith(solicitacao.getSalarioFormatted());
            } else {
                item.replaceWith("");
            }
        }
        // MORADIA
        TextNavigation moradia3BR;
        moradia3BR = new TextNavigation("VAR_R_MOR3", odt);
        if (moradia3BR.hasNext()) {
            TextSelection item = (TextSelection) moradia3BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getAuxilioMoradia3Formatted() != null) {
                item.replaceWith(solicitacao.getAuxilioMoradia3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation moradiaUS3;
        moradiaUS3 = new TextNavigation("VAR_U_MOR3", odt);
        if (moradiaUS3.hasNext()) {
            TextSelection item = (TextSelection) moradiaUS3.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getAuxilioMoradia3Formatted() != null) {
                item.replaceWith(solicitacao.getAuxilioMoradia3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation moradia2BR;
        moradia2BR = new TextNavigation("VAR_R_MOR2", odt);
        if (moradia2BR.hasNext()) {
            TextSelection item = (TextSelection) moradia2BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getAuxilioMoradia2Formatted() != null) {
                item.replaceWith(solicitacao.getAuxilioMoradia2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation moradiaUS2;
        moradiaUS2 = new TextNavigation("VAR_U_MOR2" + "", odt);
        if (moradiaUS2.hasNext()) {
            TextSelection item = (TextSelection) moradiaUS2.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getAuxilioMoradia2Formatted() != null) {
                item.replaceWith(solicitacao.getAuxilioMoradia2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation moradia1BR;
        moradia1BR = new TextNavigation("VAR_R_MOR1", odt);
        if (moradia1BR.hasNext()) {
            TextSelection item = (TextSelection) moradia1BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getAuxilioMoradia1Formatted() != null) {
                item.replaceWith(solicitacao.getAuxilioMoradia1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation moradiaUS1;
        moradiaUS1 = new TextNavigation("VAR_U_MOR1", odt);
        if (moradiaUS1.hasNext()) {
            TextSelection item = (TextSelection) moradiaUS1.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getAuxilioMoradia1Formatted() != null) {
                item.replaceWith(solicitacao.getAuxilioMoradia1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation moradiaBR;
        moradiaBR = new TextNavigation("VAR_R_MOR", odt);
        if (moradiaBR.hasNext()) {
            TextSelection item = (TextSelection) moradiaBR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getAuxilioMoradiaFormatted() != null) {
                item.replaceWith(solicitacao.getAuxilioMoradiaFormatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation moradiaUS;
        moradiaUS = new TextNavigation("VAR_U_MOR", odt);
        if (moradiaUS.hasNext()) {
            TextSelection item = (TextSelection) moradiaUS.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getAuxilioMoradiaFormatted() != null) {
                item.replaceWith(solicitacao.getAuxilioMoradiaFormatted());
            } else {
                item.replaceWith("");
            }
        }
        // BAGAGEM
        TextNavigation bagagem3BR;
        bagagem3BR = new TextNavigation("VAR_R_BAG3", odt);
        if (bagagem3BR.hasNext()) {
            TextSelection item = (TextSelection) bagagem3BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getBagagem3Formatted() != null) {
                item.replaceWith(solicitacao.getBagagem3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation bagagemUS3;
        bagagemUS3 = new TextNavigation("VAR_U_BAG3", odt);
        if (bagagemUS3.hasNext()) {
            TextSelection item = (TextSelection) bagagemUS3.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getBagagem3Formatted() != null) {
                item.replaceWith(solicitacao.getBagagem3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation bagagem2BR;
        bagagem2BR = new TextNavigation("VAR_R_BAG2", odt);
        if (bagagem2BR.hasNext()) {
            TextSelection item = (TextSelection) bagagem2BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getBagagem2Formatted() != null) {
                item.replaceWith(solicitacao.getBagagem2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation bagagemUS2;
        bagagemUS2 = new TextNavigation("VAR_U_BAG2" + "", odt);
        if (bagagemUS2.hasNext()) {
            TextSelection item = (TextSelection) bagagemUS2.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getBagagem2Formatted() != null) {
                item.replaceWith(solicitacao.getBagagem2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation bagagem1BR;
        bagagem1BR = new TextNavigation("VAR_R_BAG1", odt);
        if (bagagem1BR.hasNext()) {
            TextSelection item = (TextSelection) bagagem1BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getBagagem1Formatted() != null) {
                item.replaceWith(solicitacao.getBagagem1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation bagagemUS1;
        bagagemUS1 = new TextNavigation("VAR_U_BAG1", odt);
        if (bagagemUS1.hasNext()) {
            TextSelection item = (TextSelection) bagagemUS1.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getBagagem1Formatted() != null) {
                item.replaceWith(solicitacao.getBagagem1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation bagagemBR;
        bagagemBR = new TextNavigation("VAR_R_BAG", odt);
        if (bagagemBR.hasNext()) {
            TextSelection item = (TextSelection) bagagemBR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getBagagemFormatted() != null) {
                item.replaceWith(solicitacao.getBagagemFormatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation bagagemUS;
        bagagemUS = new TextNavigation("VAR_U_BAG", odt);
        if (bagagemUS.hasNext()) {
            TextSelection item = (TextSelection) bagagemUS.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getBagagemFormatted() != null) {
                item.replaceWith(solicitacao.getBagagemFormatted());
            } else {
                item.replaceWith("");
            }
        }
        // DIÁRIAS
        TextNavigation diarias3BR;
        diarias3BR = new TextNavigation("VAR_R_DRI3", odt);
        if (diarias3BR.hasNext()) {
            TextSelection item = (TextSelection) diarias3BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getDiarias3Formatted() != null) {
                item.replaceWith(solicitacao.getDiarias3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation diariasUS3;
        diariasUS3 = new TextNavigation("VAR_U_DRI3", odt);
        if (diariasUS3.hasNext()) {
            TextSelection item = (TextSelection) diariasUS3.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getDiarias3Formatted() != null) {
                item.replaceWith(solicitacao.getDiarias3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation diarias2BR;
        diarias2BR = new TextNavigation("VAR_R_DRI2", odt);
        if (diarias2BR.hasNext()) {
            TextSelection item = (TextSelection) diarias2BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getDiarias2Formatted() != null) {
                item.replaceWith(solicitacao.getDiarias2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation diariasUS2;
        diariasUS2 = new TextNavigation("VAR_U_DRI2" + "", odt);
        if (diariasUS2.hasNext()) {
            TextSelection item = (TextSelection) diariasUS2.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getDiarias2Formatted() != null) {
                item.replaceWith(solicitacao.getDiarias2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation diarias1BR;
        diarias1BR = new TextNavigation("VAR_R_DRI1", odt);
        if (diarias1BR.hasNext()) {
            TextSelection item = (TextSelection) diarias1BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getDiarias1Formatted() != null) {
                item.replaceWith(solicitacao.getDiarias1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation diariasUS1;
        diariasUS1 = new TextNavigation("VAR_U_DRI1", odt);
        if (diariasUS1.hasNext()) {
            TextSelection item = (TextSelection) diariasUS1.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getDiarias1Formatted() != null) {
                item.replaceWith(solicitacao.getDiarias1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation diariasBR;
        diariasBR = new TextNavigation("VAR_R_DRI", odt);
        if (diariasBR.hasNext()) {
            TextSelection item = (TextSelection) diariasBR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getDiariasFormatted() != null) {
                item.replaceWith(solicitacao.getDiariasFormatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation diariasUS;
        diariasUS = new TextNavigation("VAR_U_DRI", odt);
        if (diariasUS.hasNext()) {
            TextSelection item = (TextSelection) diariasUS.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getDiariasFormatted() != null) {
                item.replaceWith(solicitacao.getDiariasFormatted());
            } else {
                item.replaceWith("");
            }
        }
        // TRANSPORTE PESSOAL
        TextNavigation transporte3BR;
        transporte3BR = new TextNavigation("VAR_R_TRP3", odt);
        if (transporte3BR.hasNext()) {
            TextSelection item = (TextSelection) transporte3BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getTransportePessoal3Formatted() != null) {
                item.replaceWith(solicitacao.getTransportePessoal3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation transporteUS3;
        transporteUS3 = new TextNavigation("VAR_U_TRP3", odt);
        if (transporteUS3.hasNext()) {
            TextSelection item = (TextSelection) transporteUS3.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getTransportePessoal3Formatted() != null) {
                item.replaceWith(solicitacao.getTransportePessoal3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation transporte2BR;
        transporte2BR = new TextNavigation("VAR_R_TRP2", odt);
        if (transporte2BR.hasNext()) {
            TextSelection item = (TextSelection) transporte2BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getTransportePessoal2Formatted() != null) {
                item.replaceWith(solicitacao.getTransportePessoal2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation transporteUS2;
        transporteUS2 = new TextNavigation("VAR_U_TRP2" + "", odt);
        if (transporteUS2.hasNext()) {
            TextSelection item = (TextSelection) transporteUS2.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getTransportePessoal2Formatted() != null) {
                item.replaceWith(solicitacao.getTransportePessoal2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation tranporte1BR;
        tranporte1BR = new TextNavigation("VAR_R_TRP1", odt);
        if (tranporte1BR.hasNext()) {
            TextSelection item = (TextSelection) tranporte1BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getTransportePessoal1Formatted() != null) {
                item.replaceWith(solicitacao.getTransportePessoal1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation transporteUS1;
        transporteUS1 = new TextNavigation("VAR_U_TRP1", odt);
        if (transporteUS1.hasNext()) {
            TextSelection item = (TextSelection) transporteUS1.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getTransportePessoal1Formatted() != null) {
                item.replaceWith(solicitacao.getTransportePessoal1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation transporteBR;
        transporteBR = new TextNavigation("VAR_R_TRP", odt);
        if (transporteBR.hasNext()) {
            TextSelection item = (TextSelection) transporteBR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getTransportePessoalFormatted() != null) {
                item.replaceWith(solicitacao.getTransportePessoalFormatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation transporteUS;
        transporteUS = new TextNavigation("VAR_U_TRP", odt);
        if (transporteUS.hasNext()) {
            TextSelection item = (TextSelection) transporteUS.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getTransportePessoalFormatted() != null) {
                item.replaceWith(solicitacao.getTransportePessoalFormatted());
            } else {
                item.replaceWith("");
            }
        }
        // TRANSPORTE PESSOAL - OUTRAS FONTES
        TextNavigation transporteOutra3BR;
        transporteOutra3BR = new TextNavigation("VAR_R_TRO3", odt);
        if (transporteOutra3BR.hasNext()) {
            TextSelection item = (TextSelection) transporteOutra3BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getTransportePessoalOutraFonte3Formatted() != null) {
                item.replaceWith(solicitacao.getTransportePessoalOutraFonte3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation transporteOutraUS3;
        transporteOutraUS3 = new TextNavigation("VAR_U_TRO3", odt);
        if (transporteOutraUS3.hasNext()) {
            TextSelection item = (TextSelection) transporteOutraUS3.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getTransportePessoalOutraFonte3Formatted() != null) {
                item.replaceWith(solicitacao.getTransportePessoalOutraFonte3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation transporteOutra2BR;
        transporteOutra2BR = new TextNavigation("VAR_R_TRO2", odt);
        if (transporteOutra2BR.hasNext()) {
            TextSelection item = (TextSelection) transporteOutra2BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getTransportePessoalOutraFonte2Formatted() != null) {
                item.replaceWith(solicitacao.getTransportePessoalOutraFonte2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation transporteOutraUS2;
        transporteOutraUS2 = new TextNavigation("VAR_U_TRO2" + "", odt);
        if (transporteOutraUS2.hasNext()) {
            TextSelection item = (TextSelection) transporteOutraUS2.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getTransportePessoalOutraFonte2Formatted() != null) {
                item.replaceWith(solicitacao.getTransportePessoalOutraFonte2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation tranporteOutra1BR;
        tranporteOutra1BR = new TextNavigation("VAR_R_TRO1", odt);
        if (tranporteOutra1BR.hasNext()) {
            TextSelection item = (TextSelection) tranporteOutra1BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getTransportePessoalOutraFonte1Formatted() != null) {
                item.replaceWith(solicitacao.getTransportePessoalOutraFonte1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation transporteOutraUS1;
        transporteOutraUS1 = new TextNavigation("VAR_U_TRO1", odt);
        if (transporteOutraUS1.hasNext()) {
            TextSelection item = (TextSelection) transporteOutraUS1.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getTransportePessoalOutraFonte1Formatted() != null) {
                item.replaceWith(solicitacao.getTransportePessoalOutraFonte1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation transporteOutraBR;
        transporteOutraBR = new TextNavigation("VAR_R_TRO", odt);
        if (transporteOutraBR.hasNext()) {
            TextSelection item = (TextSelection) transporteOutraBR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getTransportePessoalOutraFonteFormatted() != null) {
                item.replaceWith(solicitacao.getTransportePessoalOutraFonteFormatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation transporteOutraUS;
        transporteOutraUS = new TextNavigation("VAR_U_TRO", odt);
        if (transporteOutraUS.hasNext()) {
            TextSelection item = (TextSelection) transporteOutraUS.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getTransportePessoalOutraFonteFormatted() != null) {
                item.replaceWith(solicitacao.getTransportePessoalOutraFonteFormatted());
            } else {
                item.replaceWith("");
            }
        }
        // CUSTO
        TextNavigation custos3BR;
        custos3BR = new TextNavigation("VAR_R_CUS3", odt);
        if (custos3BR.hasNext()) {
            TextSelection item = (TextSelection) custos3BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getCustoCurso3Formatted() != null) {
                item.replaceWith(solicitacao.getCustoCurso3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation custosUS3;
        custosUS3 = new TextNavigation("VAR_U_CUS3", odt);
        if (custosUS3.hasNext()) {
            TextSelection item = (TextSelection) custosUS3.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getCustoCurso3Formatted() != null) {
                item.replaceWith(solicitacao.getCustoCurso3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation custos2BR;
        custos2BR = new TextNavigation("VAR_R_CUS2", odt);
        if (custos2BR.hasNext()) {
            TextSelection item = (TextSelection) custos2BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getCustoCurso2Formatted() != null) {
                item.replaceWith(solicitacao.getCustoCurso2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation custosUS2;
        custosUS2 = new TextNavigation("VAR_U_CUS2" + "", odt);
        if (custosUS2.hasNext()) {
            TextSelection item = (TextSelection) custosUS2.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getCustoCurso2Formatted() != null) {
                item.replaceWith(solicitacao.getCustoCurso2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation custos1BR;
        custos1BR = new TextNavigation("VAR_R_CUS1", odt);
        if (custos1BR.hasNext()) {
            TextSelection item = (TextSelection) custos1BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getCustoCurso1Formatted() != null) {
                item.replaceWith(solicitacao.getCustoCurso1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation custosUS1;
        custosUS1 = new TextNavigation("VAR_U_CUS1", odt);
        if (custosUS1.hasNext()) {
            TextSelection item = (TextSelection) custosUS1.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getCustoCurso1Formatted() != null) {
                item.replaceWith(solicitacao.getCustoCurso1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation custosBR;
        custosBR = new TextNavigation("VAR_R_CUS", odt);
        if (custosBR.hasNext()) {
            TextSelection item = (TextSelection) custosBR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getCustoCursoFormatted() != null) {
                item.replaceWith(solicitacao.getCustoCursoFormatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation custosUS;
        custosUS = new TextNavigation("VAR_U_CUS", odt);
        if (custosUS.hasNext()) {
            TextSelection item = (TextSelection) custosUS.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getCustoCursoFormatted() != null) {
                item.replaceWith(solicitacao.getCustoCursoFormatted());
            } else {
                item.replaceWith("");
            }
        }
        // CUSTO TOTAL
        TextNavigation totalAnual3BR;
        totalAnual3BR = new TextNavigation("VAR_R_TTA3", odt);
        if (totalAnual3BR.hasNext()) {
            TextSelection item = (TextSelection) totalAnual3BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getCustoTotal3Formatted() != null) {
                item.replaceWith(solicitacao.getCustoTotal3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation totalAnualUS3;
        totalAnualUS3 = new TextNavigation("VAR_U_TTA3", odt);
        if (totalAnualUS3.hasNext()) {
            TextSelection item = (TextSelection) totalAnualUS3.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getCustoTotal3Formatted() != null) {
                item.replaceWith(solicitacao.getCustoTotal3Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation totalAnual2BR;
        totalAnual2BR = new TextNavigation("VAR_R_TTA2", odt);
        if (totalAnual2BR.hasNext()) {
            TextSelection item = (TextSelection) totalAnual2BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getCustoTotal2Formatted() != null) {
                item.replaceWith(solicitacao.getCustoTotal2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation totalAnualUS2;
        totalAnualUS2 = new TextNavigation("VAR_U_TTA2" + "", odt);
        if (totalAnualUS2.hasNext()) {
            TextSelection item = (TextSelection) totalAnualUS2.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getCustoTotal2Formatted() != null) {
                item.replaceWith(solicitacao.getCustoTotal2Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation totalAnual1BR;
        totalAnual1BR = new TextNavigation("VAR_R_TTA1", odt);
        if (totalAnual1BR.hasNext()) {
            TextSelection item = (TextSelection) totalAnual1BR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getCustoTotal1Formatted() != null) {
                item.replaceWith(solicitacao.getCustoTotal1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation totalAnualUS1;
        totalAnualUS1 = new TextNavigation("VAR_U_TTA1", odt);
        if (totalAnualUS1.hasNext()) {
            TextSelection item = (TextSelection) totalAnualUS1.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getCustoTotal1Formatted() != null) {
                item.replaceWith(solicitacao.getCustoTotal1Formatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation totalAnualBR;
        totalAnualBR = new TextNavigation("VAR_R_TTA", odt);
        if (totalAnualBR.hasNext()) {
            TextSelection item = (TextSelection) totalAnualBR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getCustoTotalFormatted() != null) {
                item.replaceWith(solicitacao.getCustoTotalFormatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation totalAnualUS;
        totalAnualUS = new TextNavigation("VAR_U_TTA", odt);
        if (totalAnualUS.hasNext()) {
            TextSelection item = (TextSelection) totalAnualUS.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getCustoTotalFormatted() != null) {
                item.replaceWith(solicitacao.getCustoTotalFormatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation somatorioBR;
        somatorioBR = new TextNavigation("VAR_R_STT", odt);
        if (somatorioBR.hasNext()) {
            TextSelection item = (TextSelection) somatorioBR.getCurrentItem();
            if (solicitacao.getTipo().equals("BRASIL") && solicitacao.getSomatorioGeralFormatted() != null) {
                item.replaceWith(solicitacao.getSomatorioGeralFormatted());
            } else {
                item.replaceWith("");
            }
        }
        TextNavigation somatorioUS;
        somatorioUS = new TextNavigation("VAR_U_STT", odt);
        if (somatorioUS.hasNext()) {
            TextSelection item = (TextSelection) somatorioUS.getCurrentItem();
            if (solicitacao.getTipo().equals("EXTERIOR") && solicitacao.getSomatorioGeralFormatted() != null) {
                item.replaceWith(solicitacao.getSomatorioGeralFormatted());
            } else {
                item.replaceWith("");
            }
        }
        odt.save(os);
    } catch (Exception ex) {
        Logger.getLogger(PLN006ODF.class.getName()).log(Level.SEVERE, null, ex);
    }
}
Also used : SolicitacaoPlamensDTO(com.tomasio.projects.trainning.dto.SolicitacaoPlamensDTO) PlanningService(com.tomasio.projects.trainning.interfaces.PlanningService) TextSelection(org.odftoolkit.odfdom.incubator.search.TextSelection) TextNavigation(org.odftoolkit.odfdom.incubator.search.TextNavigation)

Example 5 with PlanningService

use of com.tomasio.projects.trainning.interfaces.PlanningService in project trainning by fernandotomasio.

the class PLN003XLS method makeReport.

@Override
public void makeReport() {
    PlanningService planningService = (PlanningService) services.get("planningService");
    try {
        WritableWorkbook workbook = Workbook.createWorkbook(os);
        WritableSheet sheet = workbook.createSheet("PLAMENS", 0);
        SolicitacaoPlamensDTO[] solicitacoes = planningService.findAllSolicitacoesPlamens(0, null, null);
        int i = 0;
        for (SolicitacaoPlamensDTO dto : solicitacoes) {
            Label numeroMissaoLabel = new Label(0, i, "XX");
            sheet.addCell(numeroMissaoLabel);
            Label organizacaoProponenteLabel = null;
            if (dto.getOrganizacaoProponente() != null) {
                organizacaoProponenteLabel = new Label(1, i, dto.getOrganizacaoProponente().getSigla());
            } else {
                organizacaoProponenteLabel = new Label(1, i, "");
            }
            sheet.addCell(organizacaoProponenteLabel);
            Label anoLabel = new Label(2, i, Integer.toString(dto.getAno()));
            sheet.addCell(anoLabel);
            Label cursoLabel = new Label(3, i, dto.getCurso());
            sheet.addCell(cursoLabel);
            Label localLabel = new Label(4, i, dto.getLocal());
            sheet.addCell(localLabel);
            Label cidadeLabel = new Label(5, i, dto.getCidade());
            sheet.addCell(cidadeLabel);
            Label estadoLabel = new Label(6, i, dto.getEstado());
            sheet.addCell(estadoLabel);
            Label paisLabel = new Label(7, i, dto.getPais());
            sheet.addCell(paisLabel);
            Label dataInicioLabel = null;
            if (dto.getDataInicio() != null) {
                dataInicioLabel = new Label(8, i, dto.getDataInicioFormatted());
            } else {
                dataInicioLabel = new Label(8, i, "");
            }
            sheet.addCell(dataInicioLabel);
            Label dataTerminoLabel = null;
            if (dto.getDataTermino() != null) {
                dataTerminoLabel = new Label(9, i, dto.getDataTerminoFormatted());
            } else {
                dataTerminoLabel = new Label(9, i, "");
            }
            sheet.addCell(dataTerminoLabel);
            Label duracaoLabel = new Label(10, i, String.valueOf(dto.getDuracao()));
            sheet.addCell(duracaoLabel);
            Label organizacaoSolicitanteLabel = null;
            if (dto.getOrganizacaoSolicitante() != null) {
                organizacaoSolicitanteLabel = new Label(11, i, dto.getOrganizacaoSolicitante().getSigla());
            } else {
                organizacaoSolicitanteLabel = new Label(11, i, "");
            }
            sheet.addCell(organizacaoSolicitanteLabel);
            Label quantidadeVagasLabel = new Label(12, i, dto.getQuantidadeVagas());
            sheet.addCell(quantidadeVagasLabel);
            Label postoIndicadosLabel = new Label(13, i, dto.getPostoIndicados());
            sheet.addCell(postoIndicadosLabel);
            Label destinoAposMissaoLabel = new Label(14, i, dto.getDestinoAposMissao());
            sheet.addCell(destinoAposMissaoLabel);
            Label funcaoAposMissaoLabel = new Label(15, i, dto.getFuncaoAposMissao());
            sheet.addCell(funcaoAposMissaoLabel);
            Label quantidadeCursosLabel = new Label(16, i, Integer.toString(dto.getQuantidadeCursos()));
            sheet.addCell(quantidadeCursosLabel);
            Label ajudaCursoLabel = new Label(17, i, dto.getAjudaCustoFormatted());
            sheet.addCell(ajudaCursoLabel);
            Label salarioLabel = new Label(18, i, dto.getSalarioFormatted());
            sheet.addCell(salarioLabel);
            Label bagagemLabel = new Label(19, i, dto.getBagagemFormatted());
            sheet.addCell(bagagemLabel);
            Label diariasLabel = new Label(20, i, dto.getDiariasFormatted());
            sheet.addCell(diariasLabel);
            Label transportePessoaLabel = new Label(21, i, dto.getTransportePessoalFormatted());
            sheet.addCell(transportePessoaLabel);
            Label custoCursoLabel = new Label(22, i, dto.getCustoCursoFormatted());
            sheet.addCell(custoCursoLabel);
            Label outrosLabel = new Label(23, i, dto.getOutrosFormatted());
            sheet.addCell(outrosLabel);
            Label custoTotalLabel = new Label(24, i, dto.getCustoTotalFormatted());
            sheet.addCell(custoTotalLabel);
            Label anoTomadaPrecosLabel = new Label(25, i, Integer.toString(dto.getAnoTomadaPrecos()));
            sheet.addCell(anoTomadaPrecosLabel);
            Label taxaCambioLabel = new Label(26, i, "1,87");
            sheet.addCell(taxaCambioLabel);
            Label preRequisitosLabel = new Label(27, i, dto.getPreRequisitos().toUpperCase());
            sheet.addCell(preRequisitosLabel);
            Label justificativaLabel = new Label(28, i, dto.getJustificativa().toUpperCase());
            sheet.addCell(justificativaLabel);
            Label disciplinasLabel = null;
            if (dto.getDisciplinas() != null) {
                disciplinasLabel = new Label(29, i, dto.getDisciplinas().toUpperCase());
            } else {
                disciplinasLabel = new Label(29, i, "");
            }
            sheet.addCell(disciplinasLabel);
            Label planoTransmissaoLabel = new Label(30, i, dto.getPlanoTransmissao().toUpperCase());
            sheet.addCell(planoTransmissaoLabel);
            Label observacaoLabel = null;
            if (dto.getObservacao() != null) {
                observacaoLabel = new Label(31, i, dto.getObservacao().toUpperCase());
            } else {
                observacaoLabel = new Label(31, i, "");
            }
            sheet.addCell(observacaoLabel);
            Label tipoLabel = new Label(32, i, dto.getTipo());
            sheet.addCell(tipoLabel);
            i++;
        }
        workbook.write();
        workbook.close();
    } catch (RowsExceededException ex) {
        Logger.getLogger(PLN003XLS.class.getName()).log(Level.SEVERE, null, ex);
    } catch (WriteException ex) {
        Logger.getLogger(PLN003XLS.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(PLN003XLS.class.getName()).log(Level.SEVERE, null, ex);
    }
}
Also used : WritableWorkbook(jxl.write.WritableWorkbook) WriteException(jxl.write.WriteException) SolicitacaoPlamensDTO(com.tomasio.projects.trainning.dto.SolicitacaoPlamensDTO) PlanningService(com.tomasio.projects.trainning.interfaces.PlanningService) Label(jxl.write.Label) WritableSheet(jxl.write.WritableSheet) IOException(java.io.IOException) RowsExceededException(jxl.write.biff.RowsExceededException)

Aggregations

PlanningService (com.tomasio.projects.trainning.interfaces.PlanningService)7 PlanejamentoDTO (com.tomasio.projects.trainning.dto.PlanejamentoDTO)3 SolicitacaoPlamensDTO (com.tomasio.projects.trainning.dto.SolicitacaoPlamensDTO)3 TrainningService (com.tomasio.projects.trainning.interfaces.TrainningService)3 IOException (java.io.IOException)3 DistribuicaoDTO (com.tomasio.projects.trainning.dto.DistribuicaoDTO)2 FaseDTO (com.tomasio.projects.trainning.dto.FaseDTO)2 PeriodoDTO (com.tomasio.projects.trainning.dto.PeriodoDTO)2 TurmaEfetivaDTO (com.tomasio.projects.trainning.dto.TurmaEfetivaDTO)2 TurmaPlanejadaDTO (com.tomasio.projects.trainning.dto.TurmaPlanejadaDTO)2 AtividadesEnsinoService (com.tomasio.projects.trainning.interfaces.AtividadesEnsinoService)2 ParseException (java.text.ParseException)2 SimpleDateFormat (java.text.SimpleDateFormat)2 Calendar (java.util.Calendar)2 Date (java.util.Date)2 HashSet (java.util.HashSet)2 Label (jxl.write.Label)2 WritableSheet (jxl.write.WritableSheet)2 WritableWorkbook (jxl.write.WritableWorkbook)2 WriteException (jxl.write.WriteException)2