Search in sources :

Example 16 with OrganizationalService

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

the class EXC001IReport method makeReport.

@Override
public void makeReport() {
    AtividadesEnsinoService service = (AtividadesEnsinoService) services.get("atividadesEnsinoService");
    OrganizationalService organizationalService = (OrganizationalService) services.get("organizationalService");
    document = documentManager.getDocumentPortrait();
    os = documentManager.prepareDocument(document);
    writer = documentManager.getWritter();
    document.open();
    Long turmaId = (Long) params.get("turmaId");
    TurmaDTO turma = service.findTurmaEfetiva(turmaId);
    IndicacaoDTO[] indicacoes = service.findAllIndicacoesAlunos(turmaId);
    try {
        Paragraph p = null;
        p = new Paragraph(ReportUtil.convertEncode(turma.getCurso().getCodigo()) + " - " + ReportUtil.convertEncode(turma.getCurso().getDescricao()), fontManager.getH1Font());
        p.setAlignment(Element.ALIGN_LEFT);
        document.add(p);
        PdfPTable tableIndicacoes = new PdfPTable(4);
        tableIndicacoes.addCell(tableManager.getHeaderCell("Nome"));
        tableIndicacoes.addCell(tableManager.getHeaderCell("Nome de Guerra"));
        tableIndicacoes.addCell(tableManager.getHeaderCell("SARAM"));
        tableIndicacoes.addCell(tableManager.getHeaderCell("CPF"));
        tableIndicacoes.addCell(tableManager.getHeaderCell("Organização"));
        for (IndicacaoDTO indicacao : indicacoes) {
            PessoaDTO pessoa = organizationalService.findPessoa(indicacao.getPessoa().getId());
            String nomeGuerra = pessoa.getNomeGuerra();
            if (nomeGuerra == null) {
                nomeGuerra = "";
            }
            tableIndicacoes.addCell(tableManager.getPhraseCellLeft(pessoa.getTargetaCompleta()));
            tableIndicacoes.addCell(tableManager.getPhraseCellCenter(nomeGuerra));
            tableIndicacoes.addCell(tableManager.getPhraseCellCenter(pessoa.getSaram()));
            tableIndicacoes.addCell(tableManager.getPhraseCellCenter(pessoa.getCpf()));
            OrganizacaoDTO organizacao = organizationalService.findOrganizacao(indicacao.getOrganizacao().getId());
            tableIndicacoes.addCell(tableManager.getPhraseCellCenter(organizacao.getSigla()));
        }
        document.add(tableIndicacoes);
    } catch (DocumentException ex) {
        Logger.getLogger(EXC001IReport.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
        document.close();
    }
}
Also used : TurmaDTO(com.tomasio.projects.trainning.dto.TurmaDTO) IndicacaoDTO(com.tomasio.projects.trainning.dto.IndicacaoDTO) Paragraph(com.itextpdf.text.Paragraph) PdfPTable(com.itextpdf.text.pdf.PdfPTable) PessoaDTO(com.tomasio.projects.trainning.dto.PessoaDTO) OrganizationalService(com.tomasio.projects.trainning.interfaces.OrganizationalService) DocumentException(com.itextpdf.text.DocumentException) OrganizacaoDTO(com.tomasio.projects.trainning.dto.OrganizacaoDTO) AtividadesEnsinoService(com.tomasio.projects.trainning.interfaces.AtividadesEnsinoService)

Example 17 with OrganizationalService

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

the class EXC002CSV method makeReport.

@Override
public void makeReport() {
    AtividadesEnsinoService service = (AtividadesEnsinoService) services.get("atividadesEnsinoService");
    OrganizationalService organizationalService = (OrganizationalService) services.get("organizationalService");
    Writer writter = null;
    try {
        writter = new OutputStreamWriter(os, "UTF-8");
    } catch (UnsupportedEncodingException ex) {
        Logger.getLogger(EXC002CSV.class.getName()).log(Level.SEVERE, null, ex);
    }
    BufferedWriter bufferedWriter = new BufferedWriter(writter);
    // recuperar paramentro turmaId
    Long turmaId = (Long) params.get("turmaId");
    TurmaDTO turma = service.findTurmaEfetiva(turmaId);
    // Recuperar parametro sobre filtro por status da indicação
    String statusIndicacao = "";
    statusIndicacao += (String) params.get("status");
    if ("CONC".equals(statusIndicacao)) {
        // mostrar conclusoes
        List<ConclusaoDTO> conclusoes = new ArrayList<ConclusaoDTO>();
        ConclusaoDTO[] concluidosComComparecimento = service.findAllConcluidosByTurma(turmaId, true);
        conclusoes.addAll(Arrays.asList(concluidosComComparecimento));
        ConclusaoDTO[] concluidosSemComparecimento = service.findAllConcluidosByTurma(turmaId, false);
        conclusoes.addAll(Arrays.asList(concluidosSemComparecimento));
        for (ConclusaoDTO conclusao : conclusoes) {
            try {
                MatriculaDTO matricula = service.findMatricula(conclusao.getMatricula().getId());
                PessoaDTO pessoa = organizationalService.findPessoa(matricula.getPessoa().getId());
                /*
                     if (apresentacao instanceof ApresentacaoDTO) {
                     bufferedWriter.write("ALUNO");
                     } else {
                     bufferedWriter.write("INSTRUTOR");
                     }
                     */
                bufferedWriter.write("ALUNO");
                bufferedWriter.write(",");
                if (turma != null) {
                    bufferedWriter.write(turma.getCurso().getCodigo() + "-" + turma.getNumeroTurma());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getPessoa().getPosto() != null) {
                    bufferedWriter.write(matricula.getPessoa().getPosto());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getPessoa().getQuadro() != null) {
                    bufferedWriter.write(matricula.getPessoa().getQuadro());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getPessoa().getEspecialidade() != null) {
                    bufferedWriter.write(matricula.getPessoa().getEspecialidade());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getPessoa().getNome() != null) {
                    bufferedWriter.write(matricula.getPessoa().getNome());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getPessoa().getNomeGuerra() != null) {
                    bufferedWriter.write(matricula.getPessoa().getNomeGuerra());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getOrganizacao() != null && pessoa.getOrganizacao().getSigla() != null) {
                    bufferedWriter.write(pessoa.getOrganizacao().getSigla());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getIndicacao().getEmail() != null) {
                    bufferedWriter.write(matricula.getIndicacao().getEmail());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getIndicacao().getTelefone() != null) {
                    bufferedWriter.write(matricula.getIndicacao().getTelefone());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getIndicacao().getTelefoneCelular() != null) {
                    bufferedWriter.write(matricula.getIndicacao().getTelefoneCelular());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getPessoa().getSaram() != null) {
                    bufferedWriter.write(matricula.getPessoa().getSaram());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getPessoa().getCpf() != null) {
                    bufferedWriter.write(matricula.getPessoa().getCpf());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (conclusao.isComAproveitamento()) {
                    bufferedWriter.write("CONCLUIU COM APROVEITAMENTO");
                } else {
                    bufferedWriter.write("NÃO CONCLUIU");
                }
                bufferedWriter.write(",");
                // obs
                if (conclusao.getObservacao() != null) {
                    bufferedWriter.write(conclusao.getObservacao());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                // parecer
                if (conclusao.getParecer() != null) {
                    bufferedWriter.write(conclusao.getParecer());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                bufferedWriter.write(",");
                // solicitação da Seção de Avaliação do ILA
                if (matricula.getIndicacao().getChefia() != null) {
                    bufferedWriter.write(matricula.getIndicacao().getChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getIndicacao().getEmailChefia() != null) {
                    bufferedWriter.write(matricula.getIndicacao().getEmailChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getIndicacao().getTelefoneChefia() != null) {
                    bufferedWriter.write(matricula.getIndicacao().getTelefoneChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                // não está retornando
                if (matricula.getIndicacao().getTelefoneOM() != null) {
                    bufferedWriter.write(matricula.getIndicacao().getTelefoneOM());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.newLine();
            } catch (IOException ex) {
                Logger.getLogger(EXC002CSV.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        try {
            bufferedWriter.flush();
            bufferedWriter.close();
        } catch (IOException ex) {
            Logger.getLogger(EXC002CSV.class.getName()).log(Level.SEVERE, null, ex);
        }
    } else if ("APRE".equals(statusIndicacao)) {
        // mostrar apenas os apresentados
        List<ApresentacaoDTO> apresentacoes = new ArrayList<ApresentacaoDTO>();
        // IndicacaoDTO[] indicacoesInstrutores = service.findAllIndicacoesInstrutoresSelecionados(turmaId);
        // indicacoes.addAll(Arrays.asList(indicacoesInstrutores));
        ApresentacaoDTO[] indicacoesAlunosApresentados = service.findAllApresentadosByTurmaId(turmaId);
        apresentacoes.addAll(Arrays.asList(indicacoesAlunosApresentados));
        ApresentacaoDTO[] indicacoesAlunosNaoApresentados = service.findAllNaoApresentadosByTurma(turmaId);
        apresentacoes.addAll(Arrays.asList(indicacoesAlunosNaoApresentados));
        for (ApresentacaoDTO apresentacao : apresentacoes) {
            try {
                PessoaDTO pessoa = organizationalService.findPessoa(apresentacao.getMatricula().getPessoa().getId());
                /*
                     if (apresentacao instanceof ApresentacaoDTO) {
                     bufferedWriter.write("ALUNO");
                     } else {
                     bufferedWriter.write("INSTRUTOR");
                     }
                     */
                bufferedWriter.write("ALUNO");
                bufferedWriter.write(",");
                if (turma != null) {
                    bufferedWriter.write(turma.getCurso().getCodigo() + "-" + turma.getNumeroTurma());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (apresentacao.getMatricula().getPessoa().getPosto() != null) {
                    bufferedWriter.write(apresentacao.getMatricula().getPessoa().getPosto());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (apresentacao.getMatricula().getPessoa().getQuadro() != null) {
                    bufferedWriter.write(apresentacao.getMatricula().getPessoa().getQuadro());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (apresentacao.getMatricula().getPessoa().getEspecialidade() != null) {
                    bufferedWriter.write(apresentacao.getMatricula().getPessoa().getEspecialidade());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (apresentacao.getMatricula().getPessoa().getNome() != null) {
                    bufferedWriter.write(apresentacao.getMatricula().getPessoa().getNome());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (apresentacao.getMatricula().getPessoa().getNomeGuerra() != null) {
                    bufferedWriter.write(apresentacao.getMatricula().getPessoa().getNomeGuerra());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getOrganizacao() != null && pessoa.getOrganizacao().getSigla() != null) {
                    bufferedWriter.write(pessoa.getOrganizacao().getSigla());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (apresentacao.getMatricula().getIndicacao().getEmail() != null) {
                    bufferedWriter.write(apresentacao.getMatricula().getIndicacao().getEmail());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (apresentacao.getMatricula().getIndicacao().getTelefone() != null) {
                    bufferedWriter.write(apresentacao.getMatricula().getIndicacao().getTelefone());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (apresentacao.getMatricula().getIndicacao().getTelefoneCelular() != null) {
                    bufferedWriter.write(apresentacao.getMatricula().getIndicacao().getTelefoneCelular());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (apresentacao.getMatricula().getPessoa().getSaram() != null) {
                    bufferedWriter.write(apresentacao.getMatricula().getPessoa().getSaram());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (apresentacao.getMatricula().getPessoa().getCpf() != null) {
                    bufferedWriter.write(apresentacao.getMatricula().getPessoa().getCpf());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (apresentacao.isComparecimento()) {
                    bufferedWriter.write("COMPARECEU");
                } else {
                    bufferedWriter.write("NÃO COMPARECEU");
                }
                bufferedWriter.write(",");
                // obs
                if (apresentacao.getObservacao() != null) {
                    bufferedWriter.write(apresentacao.getObservacao());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                bufferedWriter.write(",");
                // solicitação da Seção de Avaliação do ILA
                if (apresentacao.getMatricula().getIndicacao().getChefia() != null) {
                    bufferedWriter.write(apresentacao.getMatricula().getIndicacao().getChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (apresentacao.getMatricula().getIndicacao().getEmailChefia() != null) {
                    bufferedWriter.write(apresentacao.getMatricula().getIndicacao().getEmailChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (apresentacao.getMatricula().getIndicacao().getTelefoneChefia() != null) {
                    bufferedWriter.write(apresentacao.getMatricula().getIndicacao().getTelefoneChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                // não está retornando
                if (apresentacao.getMatricula().getIndicacao().getTelefoneOM() != null) {
                    bufferedWriter.write(apresentacao.getMatricula().getIndicacao().getTelefoneOM());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.newLine();
            } catch (IOException ex) {
                Logger.getLogger(EXC002CSV.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        try {
            bufferedWriter.flush();
            bufferedWriter.close();
        } catch (IOException ex) {
            Logger.getLogger(EXC002CSV.class.getName()).log(Level.SEVERE, null, ex);
        }
    } else if ("MTCL".equals(statusIndicacao)) {
        // mostrar apenas os matriculados
        List<MatriculaDTO> matriculas = new ArrayList<MatriculaDTO>();
        MatriculaDTO[] matriculasInstrutores = service.findAllMatriculasInstrutores(turmaId);
        matriculas.addAll(Arrays.asList(matriculasInstrutores));
        MatriculaDTO[] matriculasAlunos = service.findAllMatriculasAlunos(turmaId);
        matriculas.addAll(Arrays.asList(matriculasAlunos));
        for (MatriculaDTO matricula : matriculas) {
            try {
                PessoaDTO pessoa = organizationalService.findPessoa(matricula.getPessoa().getId());
                if (matricula instanceof MatriculaAlunoDTO) {
                    bufferedWriter.write("ALUNO");
                } else {
                    bufferedWriter.write("INSTRUTOR");
                }
                bufferedWriter.write(",");
                if (turma != null) {
                    bufferedWriter.write(turma.getCurso().getCodigo() + "-" + turma.getNumeroTurma());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getPessoa().getPosto() != null) {
                    bufferedWriter.write(matricula.getPessoa().getPosto());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getPessoa().getQuadro() != null) {
                    bufferedWriter.write(matricula.getPessoa().getQuadro());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getPessoa().getEspecialidade() != null) {
                    bufferedWriter.write(matricula.getPessoa().getEspecialidade());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getPessoa().getNome() != null) {
                    bufferedWriter.write(matricula.getPessoa().getNome());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getPessoa().getNomeGuerra() != null) {
                    bufferedWriter.write(matricula.getPessoa().getNomeGuerra());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getOrganizacao() != null && pessoa.getOrganizacao().getSigla() != null) {
                    bufferedWriter.write(pessoa.getOrganizacao().getSigla());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getIndicacao().getEmail() != null) {
                    bufferedWriter.write(matricula.getIndicacao().getEmail());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getIndicacao().getTelefone() != null) {
                    bufferedWriter.write(matricula.getIndicacao().getTelefone());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getIndicacao().getTelefoneCelular() != null) {
                    bufferedWriter.write(matricula.getIndicacao().getTelefoneCelular());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getPessoa().getSaram() != null) {
                    bufferedWriter.write(matricula.getPessoa().getSaram());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getPessoa().getCpf() != null) {
                    bufferedWriter.write(matricula.getPessoa().getCpf());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                // não está retornando
                if (matricula.getIndicacao().getStatus() != null) {
                    bufferedWriter.write(matricula.getIndicacao().getStatus());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                CancelamentoMatriculaDTO cancelamento = new CancelamentoMatriculaDTO();
                if (matricula.isCancelada()) {
                    bufferedWriter.write("MATRICULA CANCELADA");
                    // buscar cancelamento
                    cancelamento = service.findCancelamentoMatriculaByMatricula(matricula.getId());
                } else {
                    bufferedWriter.write("MATRICULADO NO CURSO ");
                }
                bufferedWriter.write(",");
                // data cancelameno
                if (matricula.isCancelada()) {
                    SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
                    bufferedWriter.write(df.format(cancelamento.getDataCancelamento()));
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                // obs cancelamento
                if (matricula.isCancelada()) {
                    bufferedWriter.write(cancelamento.getObservacao());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                bufferedWriter.write(",");
                // solicitação da Seção de Avaliação do ILA
                if (matricula.getIndicacao().getChefia() != null) {
                    bufferedWriter.write(matricula.getIndicacao().getChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getIndicacao().getEmailChefia() != null) {
                    bufferedWriter.write(matricula.getIndicacao().getEmailChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (matricula.getIndicacao().getTelefoneChefia() != null) {
                    bufferedWriter.write(matricula.getIndicacao().getTelefoneChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                // não está retornando
                if (matricula.getIndicacao().getTelefoneOM() != null) {
                    bufferedWriter.write(matricula.getIndicacao().getTelefoneOM());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.newLine();
            } catch (IOException ex) {
                Logger.getLogger(EXC002CSV.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        try {
            bufferedWriter.flush();
            bufferedWriter.close();
        } catch (IOException ex) {
            Logger.getLogger(EXC002CSV.class.getName()).log(Level.SEVERE, null, ex);
        }
    } else if ("PRE MTCL".equals(statusIndicacao)) {
        // mostrar apenas os PRE matriculados
        // listar instrutores
        PreMatriculaDTO[] preMatriculasInstrutores = service.findAllPreMatriculasInstrutores(turmaId);
        for (PreMatriculaDTO preMatricula : preMatriculasInstrutores) {
            try {
                PessoaDTO pessoa = organizationalService.findPessoa(preMatricula.getPessoa().getId());
                bufferedWriter.write("INSTRUTOR");
                bufferedWriter.write(",");
                if (turma != null) {
                    bufferedWriter.write(turma.getCurso().getCodigo() + "-" + turma.getNumeroTurma());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getPessoa().getPosto() != null) {
                    bufferedWriter.write(preMatricula.getPessoa().getPosto());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getPessoa().getQuadro() != null) {
                    bufferedWriter.write(preMatricula.getPessoa().getQuadro());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getPessoa().getEspecialidade() != null) {
                    bufferedWriter.write(preMatricula.getPessoa().getEspecialidade());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getPessoa().getNome() != null) {
                    bufferedWriter.write(preMatricula.getPessoa().getNome());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getPessoa().getNomeGuerra() != null) {
                    bufferedWriter.write(preMatricula.getPessoa().getNomeGuerra());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getOrganizacao() != null && pessoa.getOrganizacao().getSigla() != null) {
                    bufferedWriter.write(pessoa.getOrganizacao().getSigla());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getIndicacao().getEmail() != null) {
                    bufferedWriter.write(preMatricula.getIndicacao().getEmail());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getIndicacao().getTelefone() != null) {
                    bufferedWriter.write(preMatricula.getIndicacao().getTelefone());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getIndicacao().getTelefoneCelular() != null) {
                    bufferedWriter.write(preMatricula.getIndicacao().getTelefoneCelular());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getPessoa().getSaram() != null) {
                    bufferedWriter.write(preMatricula.getPessoa().getSaram());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getPessoa().getCpf() != null) {
                    bufferedWriter.write(preMatricula.getPessoa().getCpf());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getIndicacao().getStatus() != null) {
                    bufferedWriter.write(preMatricula.getIndicacao().getStatus());
                } else {
                    bufferedWriter.write("PRE MTCL");
                }
                bufferedWriter.write(",");
                // solicitação da Seção de Avaliação do ILA
                if (preMatricula.getIndicacao().getChefia() != null) {
                    bufferedWriter.write(preMatricula.getIndicacao().getChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getIndicacao().getEmailChefia() != null) {
                    bufferedWriter.write(preMatricula.getIndicacao().getEmailChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getIndicacao().getTelefoneChefia() != null) {
                    bufferedWriter.write(preMatricula.getIndicacao().getTelefoneChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getIndicacao().getTelefoneOM() != null) {
                    bufferedWriter.write(preMatricula.getIndicacao().getTelefoneOM());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.newLine();
            } catch (IOException ex) {
                Logger.getLogger(EXC002CSV.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        // listar alunos
        PreMatriculaDTO[] preMatriculasAlunos = service.findAllPreMatriculasAlunos(turmaId);
        for (PreMatriculaDTO preMatricula : preMatriculasAlunos) {
            try {
                PessoaDTO pessoa = organizationalService.findPessoa(preMatricula.getPessoa().getId());
                bufferedWriter.write("ALUNO");
                bufferedWriter.write(",");
                if (turma != null) {
                    bufferedWriter.write(turma.getCurso().getCodigo() + "-" + turma.getNumeroTurma());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getPessoa().getPosto() != null) {
                    bufferedWriter.write(preMatricula.getPessoa().getPosto());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getPessoa().getQuadro() != null) {
                    bufferedWriter.write(preMatricula.getPessoa().getQuadro());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getPessoa().getEspecialidade() != null) {
                    bufferedWriter.write(preMatricula.getPessoa().getEspecialidade());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getPessoa().getNome() != null) {
                    bufferedWriter.write(preMatricula.getPessoa().getNome());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getPessoa().getNomeGuerra() != null) {
                    bufferedWriter.write(preMatricula.getPessoa().getNomeGuerra());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getOrganizacao() != null && pessoa.getOrganizacao().getSigla() != null) {
                    bufferedWriter.write(pessoa.getOrganizacao().getSigla());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getIndicacao().getEmail() != null) {
                    bufferedWriter.write(preMatricula.getIndicacao().getEmail());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getIndicacao().getTelefone() != null) {
                    bufferedWriter.write(preMatricula.getIndicacao().getTelefone());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getIndicacao().getTelefoneCelular() != null) {
                    bufferedWriter.write(preMatricula.getIndicacao().getTelefoneCelular());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getPessoa().getSaram() != null) {
                    bufferedWriter.write(preMatricula.getPessoa().getSaram());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getPessoa().getCpf() != null) {
                    bufferedWriter.write(preMatricula.getPessoa().getCpf());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                // não está retornando
                if (preMatricula.getIndicacao().getStatus() != null) {
                    bufferedWriter.write(preMatricula.getIndicacao().getStatus());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                // solicitação da Seção de Avaliação do ILA
                if (preMatricula.getIndicacao().getChefia() != null) {
                    bufferedWriter.write(preMatricula.getIndicacao().getChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getIndicacao().getEmailChefia() != null) {
                    bufferedWriter.write(preMatricula.getIndicacao().getEmailChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (preMatricula.getIndicacao().getTelefoneChefia() != null) {
                    bufferedWriter.write(preMatricula.getIndicacao().getTelefoneChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                // não está retornando
                if (preMatricula.getIndicacao().getTelefoneOM() != null) {
                    bufferedWriter.write(preMatricula.getIndicacao().getTelefoneOM());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.newLine();
            } catch (IOException ex) {
                Logger.getLogger(EXC002CSV.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        try {
            bufferedWriter.flush();
            bufferedWriter.close();
        } catch (IOException ex) {
            Logger.getLogger(EXC002CSV.class.getName()).log(Level.SEVERE, null, ex);
        }
    } else if ("SLC".equals(statusIndicacao)) {
        // mostrar apenas os selecionados
        List<IndicacaoDTO> indicacoes = new ArrayList<IndicacaoDTO>();
        IndicacaoDTO[] indicacoesInstrutores = service.findAllIndicacoesInstrutoresSelecionados(turmaId);
        indicacoes.addAll(Arrays.asList(indicacoesInstrutores));
        IndicacaoDTO[] indicacoesAlunos = service.findAllIndicacoesAlunosSelecionadosForOrdemMatricula(turmaId);
        indicacoes.addAll(Arrays.asList(indicacoesAlunos));
        for (IndicacaoDTO indicacao : indicacoes) {
            try {
                PessoaDTO pessoa = organizationalService.findPessoa(indicacao.getPessoa().getId());
                if (indicacao instanceof IndicacaoAlunoDTO) {
                    bufferedWriter.write("ALUNO");
                } else {
                    bufferedWriter.write("INSTRUTOR");
                }
                bufferedWriter.write(",");
                if (turma != null) {
                    bufferedWriter.write(turma.getCurso().getCodigo() + "-" + turma.getNumeroTurma());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getPosto() != null) {
                    bufferedWriter.write(pessoa.getPosto());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getQuadro() != null) {
                    bufferedWriter.write(pessoa.getQuadro());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getEspecialidade() != null) {
                    bufferedWriter.write(pessoa.getEspecialidade());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getNome() != null) {
                    bufferedWriter.write(pessoa.getNome());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getNomeGuerra() != null) {
                    bufferedWriter.write(pessoa.getNomeGuerra());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getOrganizacao() != null && pessoa.getOrganizacao().getSigla() != null) {
                    bufferedWriter.write(pessoa.getOrganizacao().getSigla());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (indicacao.getEmail() != null) {
                    bufferedWriter.write(indicacao.getEmail());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (indicacao.getTelefone() != null) {
                    bufferedWriter.write(indicacao.getTelefone());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (indicacao.getTelefoneCelular() != null) {
                    bufferedWriter.write(indicacao.getTelefoneCelular());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getSaram() != null) {
                    bufferedWriter.write(pessoa.getSaram());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getCpf() != null) {
                    bufferedWriter.write(pessoa.getCpf());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (indicacao.getStatus() != null) {
                    bufferedWriter.write(indicacao.getStatus());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                // solicitação da Seção de Avaliação do ILA
                if (indicacao.getChefia() != null) {
                    bufferedWriter.write(indicacao.getChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (indicacao.getEmailChefia() != null) {
                    bufferedWriter.write(indicacao.getEmailChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (indicacao.getTelefoneChefia() != null) {
                    bufferedWriter.write(indicacao.getTelefoneChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                // não está retornando
                if (indicacao.getTelefoneOM() != null) {
                    bufferedWriter.write(indicacao.getTelefoneOM());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.newLine();
            } catch (IOException ex) {
                Logger.getLogger(EXC002CSV.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        try {
            bufferedWriter.flush();
            bufferedWriter.close();
        } catch (IOException ex) {
            Logger.getLogger(EXC002CSV.class.getName()).log(Level.SEVERE, null, ex);
        }
    } else {
        // mostrar indicados em geral
        List<IndicacaoDTO> indicacoes = new ArrayList<IndicacaoDTO>();
        IndicacaoDTO[] indicacoesInstrutores = service.findAllIndicacoesInstrutores(turmaId);
        indicacoes.addAll(Arrays.asList(indicacoesInstrutores));
        IndicacaoDTO[] indicacoesAlunos = service.findAllIndicacoesAlunos(turmaId);
        indicacoes.addAll(Arrays.asList(indicacoesAlunos));
        for (IndicacaoDTO indicacao : indicacoes) {
            try {
                PessoaDTO pessoa = organizationalService.findPessoa(indicacao.getPessoa().getId());
                if (indicacao instanceof IndicacaoAlunoDTO) {
                    bufferedWriter.write("ALUNO");
                } else {
                    bufferedWriter.write("INSTRUTOR");
                }
                bufferedWriter.write(",");
                if (turma != null) {
                    bufferedWriter.write(turma.getCurso().getCodigo() + "-" + turma.getNumeroTurma());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getPosto() != null) {
                    bufferedWriter.write(pessoa.getPosto());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getQuadro() != null) {
                    bufferedWriter.write(pessoa.getQuadro());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getEspecialidade() != null) {
                    bufferedWriter.write(pessoa.getEspecialidade());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getNome() != null) {
                    bufferedWriter.write(pessoa.getNome());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getNomeGuerra() != null) {
                    bufferedWriter.write(pessoa.getNomeGuerra());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getOrganizacao() != null && pessoa.getOrganizacao().getSigla() != null) {
                    bufferedWriter.write(pessoa.getOrganizacao().getSigla());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (indicacao.getEmail() != null) {
                    bufferedWriter.write(indicacao.getEmail());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (indicacao.getTelefone() != null) {
                    bufferedWriter.write(indicacao.getTelefone());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (indicacao.getTelefoneCelular() != null) {
                    bufferedWriter.write(indicacao.getTelefoneCelular());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getSaram() != null) {
                    bufferedWriter.write(pessoa.getSaram());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (pessoa.getCpf() != null) {
                    bufferedWriter.write(pessoa.getCpf());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (indicacao.getStatus() != null) {
                    bufferedWriter.write(indicacao.getStatus());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                // solicitação da Seção de Avaliação do ILA
                if (indicacao.getChefia() != null) {
                    bufferedWriter.write(indicacao.getChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (indicacao.getEmailChefia() != null) {
                    bufferedWriter.write(indicacao.getEmailChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                if (indicacao.getTelefoneChefia() != null) {
                    bufferedWriter.write(indicacao.getTelefoneChefia());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.write(",");
                // não está retornando
                if (indicacao.getTelefoneOM() != null) {
                    bufferedWriter.write(indicacao.getTelefoneOM());
                } else {
                    bufferedWriter.write("");
                }
                bufferedWriter.newLine();
            } catch (IOException ex) {
                Logger.getLogger(EXC002CSV.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        try {
            bufferedWriter.flush();
            bufferedWriter.close();
        } catch (IOException ex) {
            Logger.getLogger(EXC002CSV.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
// fim do if de filtro dos indicados pelo STATUS
}
Also used : CancelamentoMatriculaDTO(com.tomasio.projects.trainning.dto.CancelamentoMatriculaDTO) ArrayList(java.util.ArrayList) TurmaDTO(com.tomasio.projects.trainning.dto.TurmaDTO) BufferedWriter(java.io.BufferedWriter) IndicacaoDTO(com.tomasio.projects.trainning.dto.IndicacaoDTO) MatriculaAlunoDTO(com.tomasio.projects.trainning.dto.MatriculaAlunoDTO) IndicacaoAlunoDTO(com.tomasio.projects.trainning.dto.IndicacaoAlunoDTO) ArrayList(java.util.ArrayList) List(java.util.List) ApresentacaoDTO(com.tomasio.projects.trainning.dto.ApresentacaoDTO) PreMatriculaDTO(com.tomasio.projects.trainning.dto.PreMatriculaDTO) CancelamentoMatriculaDTO(com.tomasio.projects.trainning.dto.CancelamentoMatriculaDTO) MatriculaDTO(com.tomasio.projects.trainning.dto.MatriculaDTO) ConclusaoDTO(com.tomasio.projects.trainning.dto.ConclusaoDTO) UnsupportedEncodingException(java.io.UnsupportedEncodingException) IOException(java.io.IOException) PreMatriculaDTO(com.tomasio.projects.trainning.dto.PreMatriculaDTO) PessoaDTO(com.tomasio.projects.trainning.dto.PessoaDTO) OrganizationalService(com.tomasio.projects.trainning.interfaces.OrganizationalService) OutputStreamWriter(java.io.OutputStreamWriter) SimpleDateFormat(java.text.SimpleDateFormat) BufferedWriter(java.io.BufferedWriter) Writer(java.io.Writer) OutputStreamWriter(java.io.OutputStreamWriter) AtividadesEnsinoService(com.tomasio.projects.trainning.interfaces.AtividadesEnsinoService)

Example 18 with OrganizationalService

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

the class EXC003CSV method makeReport.

@Override
public void makeReport() {
    AtividadesEnsinoService service = (AtividadesEnsinoService) services.get("atividadesEnsinoService");
    OrganizationalService organizationalService = (OrganizationalService) services.get("organizationalService");
    Writer writter = new OutputStreamWriter(os);
    BufferedWriter bufferedWriter = new BufferedWriter(writter);
    Long turmaId = (Long) params.get("turmaId");
    IndicacaoDTO[] indicacoes = service.findAllIndicacoesAlunos(turmaId);
    for (IndicacaoDTO indicacao : indicacoes) {
        try {
            PessoaDTO pessoa = organizationalService.findPessoa(indicacao.getPessoa().getId());
            if (pessoa.getPosto() != null) {
                bufferedWriter.write(pessoa.getPosto());
            }
            bufferedWriter.write(",");
            if (pessoa.getQuadro() != null) {
                bufferedWriter.write(pessoa.getQuadro());
            }
            bufferedWriter.write(",");
            if (pessoa.getEspecialidade() != null) {
                bufferedWriter.write(pessoa.getEspecialidade());
            }
            bufferedWriter.write(",");
            if (pessoa.getNome() != null) {
                bufferedWriter.write(pessoa.getNome());
            }
            bufferedWriter.write(",");
            if (pessoa.getNomeGuerra() != null) {
                bufferedWriter.write(pessoa.getNomeGuerra());
            }
            bufferedWriter.write(",");
            if (pessoa.getOrganizacao() != null && pessoa.getOrganizacao().getSigla() != null) {
                bufferedWriter.write(pessoa.getOrganizacao().getSigla());
            }
            bufferedWriter.write(",");
            if (indicacao.getEmail() != null) {
                bufferedWriter.write(indicacao.getEmail());
            }
            bufferedWriter.write(",");
            if (indicacao.getTelefone() != null) {
                bufferedWriter.write(indicacao.getTelefone());
            }
            bufferedWriter.write(",");
            if (pessoa.getSaram() != null) {
                bufferedWriter.write(pessoa.getSaram());
            }
            bufferedWriter.newLine();
        } catch (IOException ex) {
            Logger.getLogger(EXC003CSV.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    try {
        bufferedWriter.flush();
        bufferedWriter.close();
    } catch (IOException ex) {
        Logger.getLogger(EXC003CSV.class.getName()).log(Level.SEVERE, null, ex);
    }
}
Also used : PessoaDTO(com.tomasio.projects.trainning.dto.PessoaDTO) OrganizationalService(com.tomasio.projects.trainning.interfaces.OrganizationalService) OutputStreamWriter(java.io.OutputStreamWriter) IOException(java.io.IOException) BufferedWriter(java.io.BufferedWriter) Writer(java.io.Writer) OutputStreamWriter(java.io.OutputStreamWriter) AtividadesEnsinoService(com.tomasio.projects.trainning.interfaces.AtividadesEnsinoService) BufferedWriter(java.io.BufferedWriter) IndicacaoDTO(com.tomasio.projects.trainning.dto.IndicacaoDTO)

Example 19 with OrganizationalService

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

the class EXC018ODF method makeReport.

@Override
public void makeReport() {
    AtividadesEnsinoService atividadesEnsinoService = (AtividadesEnsinoService) services.get("atividadesEnsinoService");
    OrganizationalService organizationalService = (OrganizationalService) services.get("organizationalService");
    Long turmaId = (Long) params.get("turmaId");
    TurmaDTO turma = atividadesEnsinoService.findTurmaEfetiva(turmaId);
    System.out.println(turma.getCurso().getCodigo() + " - " + TEMPLATE_PATH);
    try {
        ClassLoader classLoader = getClass().getClassLoader();
        File file = new File(classLoader.getResource(TEMPLATE_PATH).getFile());
        odt = OdfTextDocument.loadDocument(file);
        TextNavigation slot = new TextNavigation("_NOME_", odt);
        while (slot.hasNext()) {
            TextSelection item = (TextSelection) slot.getCurrentItem();
            item.replaceWith("FERNANDO DE OLIVEIRA TOMASIO");
        }
        odt.save(os);
    } catch (Exception ex) {
        Logger.getLogger(EXC018ODF.class.getName()).log(Level.SEVERE, null, ex);
    }
}
Also used : OrganizationalService(com.tomasio.projects.trainning.interfaces.OrganizationalService) TextSelection(org.odftoolkit.odfdom.incubator.search.TextSelection) TextNavigation(org.odftoolkit.odfdom.incubator.search.TextNavigation) TurmaDTO(com.tomasio.projects.trainning.dto.TurmaDTO) File(java.io.File) AtividadesEnsinoService(com.tomasio.projects.trainning.interfaces.AtividadesEnsinoService)

Example 20 with OrganizationalService

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

the class EXC004CSV method makeReport.

@Override
public void makeReport() {
    AtividadesEnsinoService service = (AtividadesEnsinoService) services.get("atividadesEnsinoService");
    OrganizationalService organizationalService = (OrganizationalService) services.get("organizationalService");
    Writer writter = new OutputStreamWriter(os);
    BufferedWriter bufferedWriter = new BufferedWriter(writter);
    Long turmaId = (Long) params.get("turmaId");
    IndicacaoDTO[] indicacoes = service.findAllIndicacoesAlunos(turmaId);
    for (IndicacaoDTO indicacao : indicacoes) {
        try {
            PessoaDTO pessoa = organizationalService.findPessoa(indicacao.getPessoa().getId());
            if (pessoa.getPosto() != null) {
                bufferedWriter.write(pessoa.getPosto());
            }
            bufferedWriter.write(",");
            if (pessoa.getQuadro() != null) {
                bufferedWriter.write(pessoa.getQuadro());
            }
            bufferedWriter.write(",");
            if (pessoa.getEspecialidade() != null) {
                bufferedWriter.write(pessoa.getEspecialidade());
            }
            bufferedWriter.write(",");
            if (pessoa.getNome() != null) {
                bufferedWriter.write(pessoa.getNome());
            }
            bufferedWriter.write(",");
            if (pessoa.getNomeGuerra() != null) {
                bufferedWriter.write(pessoa.getNomeGuerra());
            }
            bufferedWriter.write(",");
            if (pessoa.getOrganizacao() != null && pessoa.getOrganizacao().getSigla() != null) {
                bufferedWriter.write(pessoa.getOrganizacao().getSigla());
            }
            bufferedWriter.write(",");
            if (indicacao.getEmail() != null) {
                bufferedWriter.write(indicacao.getEmail());
            }
            bufferedWriter.write(",");
            if (indicacao.getTelefone() != null) {
                bufferedWriter.write(indicacao.getTelefone());
            }
            bufferedWriter.write(",");
            if (pessoa.getSaram() != null) {
                bufferedWriter.write(pessoa.getSaram());
            }
            bufferedWriter.newLine();
        } catch (IOException ex) {
            Logger.getLogger(EXC004CSV.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    try {
        bufferedWriter.flush();
        bufferedWriter.close();
    } catch (IOException ex) {
        Logger.getLogger(EXC004CSV.class.getName()).log(Level.SEVERE, null, ex);
    }
}
Also used : PessoaDTO(com.tomasio.projects.trainning.dto.PessoaDTO) OrganizationalService(com.tomasio.projects.trainning.interfaces.OrganizationalService) OutputStreamWriter(java.io.OutputStreamWriter) IOException(java.io.IOException) BufferedWriter(java.io.BufferedWriter) Writer(java.io.Writer) OutputStreamWriter(java.io.OutputStreamWriter) AtividadesEnsinoService(com.tomasio.projects.trainning.interfaces.AtividadesEnsinoService) BufferedWriter(java.io.BufferedWriter) IndicacaoDTO(com.tomasio.projects.trainning.dto.IndicacaoDTO)

Aggregations

AtividadesEnsinoService (com.tomasio.projects.trainning.interfaces.AtividadesEnsinoService)20 OrganizationalService (com.tomasio.projects.trainning.interfaces.OrganizationalService)20 PessoaDTO (com.tomasio.projects.trainning.dto.PessoaDTO)12 IndicacaoDTO (com.tomasio.projects.trainning.dto.IndicacaoDTO)11 OrganizacaoDTO (com.tomasio.projects.trainning.dto.OrganizacaoDTO)11 TurmaEfetivaDTO (com.tomasio.projects.trainning.dto.TurmaEfetivaDTO)8 IOException (java.io.IOException)8 TurmaDTO (com.tomasio.projects.trainning.dto.TurmaDTO)7 BufferedWriter (java.io.BufferedWriter)7 OutputStreamWriter (java.io.OutputStreamWriter)7 Writer (java.io.Writer)7 ArrayList (java.util.ArrayList)6 FaseDTO (com.tomasio.projects.trainning.dto.FaseDTO)4 IndicacaoInstrutorDTO (com.tomasio.projects.trainning.dto.IndicacaoInstrutorDTO)4 MatriculaDTO (com.tomasio.projects.trainning.dto.MatriculaDTO)4 HashSet (java.util.HashSet)4 OdfTable (org.odftoolkit.odfdom.doc.table.OdfTable)4 OdfTableCell (org.odftoolkit.odfdom.doc.table.OdfTableCell)4 ConclusaoDTO (com.tomasio.projects.trainning.dto.ConclusaoDTO)3 UnsupportedEncodingException (java.io.UnsupportedEncodingException)3