Search in sources :

Example 6 with DisciplinaDTO

use of com.tomasio.projects.trainning.dto.DisciplinaDTO in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method findAllDisciplinasByCurriculoMinimo.

@Override
@Transactional(readOnly = true)
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public DisciplinaDTO[] findAllDisciplinasByCurriculoMinimo(Long curriculoMinimoId) {
    DisciplinaDAO dao = factory.getDisciplinaDAO();
    DisciplinaDTO[] disciplinasArray = null;
    try {
        List<Disciplina> disciplinas = dao.findAllByCurriculoMinimo(curriculoMinimoId);
        disciplinasArray = new DisciplinaDTO[disciplinas.size()];
        for (int i = 0; i < disciplinasArray.length; i++) {
            disciplinasArray[i] = disciplinas.get(i).createDTO();
        }
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    } catch (Exception ex) {
        throw new CoreException("Erro de sistema: " + ex.toString());
    }
    return disciplinasArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) Disciplina(com.tomasio.projects.trainning.model.Disciplina) ObjetivoDisciplina(com.tomasio.projects.trainning.model.ObjetivoDisciplina) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DisciplinaDTO(com.tomasio.projects.trainning.dto.DisciplinaDTO) ObjetivoDisciplinaDTO(com.tomasio.projects.trainning.dto.ObjetivoDisciplinaDTO) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 7 with DisciplinaDTO

use of com.tomasio.projects.trainning.dto.DisciplinaDTO in project trainning by fernandotomasio.

the class ConvitesInstrutoresController method initializeDisciplinasDataList.

public List initializeDisciplinasDataList() {
    List result = new ArrayList();
    DisciplinaDTO[] disciplinas = teachingDocumentsService.findAllDisciplinasByCurriculoMinimo(458325L);
    for (DisciplinaDTO disciplina : disciplinas) {
        Map item = new HashMap();
        item.put("id", disciplina.getId());
        item.put("numero", disciplina.getNumeroGeral());
        item.put("descricao", disciplina.getDescricao());
        result.add(item);
    }
    return result;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) DisciplinaDTO(com.tomasio.projects.trainning.dto.DisciplinaDTO) List(java.util.List) ArrayList(java.util.ArrayList) Map(java.util.Map) HashMap(java.util.HashMap)

Example 8 with DisciplinaDTO

use of com.tomasio.projects.trainning.dto.DisciplinaDTO in project trainning by fernandotomasio.

the class ConvitesInstrutoresController method initializeConviteInstrutorData.

public Map initializeConviteInstrutorData(Long conviteId) {
    Map conviteMap = new HashMap();
    ConviteInstrutorDTO convite = atividadesEnsinoService.findConviteInstrutor(conviteId);
    conviteMap.put("id", convite.getId());
    conviteMap.put("prazo", convite.getPrazo());
    conviteMap.put("data", convite.getData());
    conviteMap.put("observacao", convite.getObservacao());
    conviteMap.put("documento", convite.getDocumento());
    conviteMap.put("solucao", convite.getSolucao());
    TurmaEfetivaDTO turma = atividadesEnsinoService.findTurmaEfetiva(convite.getTurma().getId());
    conviteMap.put("turma", turma.getCurso().getCodigo() + " - " + turma.getNumeroTurma() + " (" + turma.getPeriodoFormatted() + ")");
    if (convite.getDataFinalizacao() != null) {
        conviteMap.put("finalizado", true);
    } else {
        conviteMap.put("finalizado", false);
    }
    if (convite instanceof ConviteInstrutorIndividualDTO) {
        conviteMap.put("tipo", "INDIVIDUAL");
    } else {
        conviteMap.put("tipo", "PERFIL");
        String destinatarios = "";
        Long[] destinatariosIds = ((ConviteInstrutorPerfilDTO) convite).getDestinatariosIds();
        for (Long destinatariosId : destinatariosIds) {
            OrganizacaoDTO organizacao = organizationalService.findOrganizacao(destinatariosId);
            destinatarios += organizacao.getSigla();
            destinatarios += " ";
        }
        conviteMap.put("destinatarios", destinatarios);
    }
    List instrutoresConvidados = new ArrayList();
    if (convite instanceof ConviteInstrutorIndividualDTO) {
        ItemConviteInstrutorIndividualDTO[] itens = atividadesEnsinoService.findAllItensConviteInstrutorIndividualByConviteInstrutorIndividualId(conviteId);
        for (ItemConviteInstrutorIndividualDTO item : itens) {
            Map mapItem = new HashMap();
            mapItem.put("instrutor", item.getPessoa().getTargetaCompleta());
            mapItem.put("dataInicio", item.getPeriodo().getDataInicioFormated());
            mapItem.put("dataTermino", item.getPeriodo().getDataTerminoFormated());
            mapItem.put("observacao", item.getObservacao());
            instrutoresConvidados.add(mapItem);
        }
    }
    conviteMap.put("instrutoresConvidados", instrutoresConvidados);
    List instrutoresConfirmados = new ArrayList();
    ConfirmacaoConviteInstrutorDTO[] confirmacoes = atividadesEnsinoService.findAllConfirmacoesConvitesInstrutoresByConviteInstrutorId(conviteId);
    for (ConfirmacaoConviteInstrutorDTO confirmacao : confirmacoes) {
        Map mapItem = new HashMap();
        mapItem.put("instrutor", confirmacao.getPessoa().getTargetaCompleta());
        mapItem.put("dataInicio", confirmacao.getPeriodo().getDataInicioFormated());
        mapItem.put("dataTermino", confirmacao.getPeriodo().getDataTerminoFormated());
        mapItem.put("observacao", confirmacao.getObservacao());
        mapItem.put("dataConfirmacao", confirmacao.getData());
        mapItem.put("documento", confirmacao.getDocumento());
        instrutoresConfirmados.add(mapItem);
    }
    conviteMap.put("instrutoresConfirmados", instrutoresConfirmados);
    List perfis = new ArrayList();
    if (convite instanceof ConviteInstrutorPerfilDTO) {
        ItemConviteInstrutorPerfilDTO[] itens = atividadesEnsinoService.findAllItensConviteInstrutorPerfilByConviteInstrutorPerfilId(conviteId);
        for (ItemConviteInstrutorPerfilDTO item : itens) {
            Map mapItem = new HashMap();
            mapItem.put("dataInicio", item.getPeriodo().getDataInicioFormated());
            mapItem.put("dataTermino", item.getPeriodo().getDataTerminoFormated());
            mapItem.put("quantidade", item.getQuantidade());
            Long[] disciplinasIds = item.getDisciplinasIds();
            List disciplinas = new ArrayList();
            for (Long disciplinaId : disciplinasIds) {
                Map disciplinaMapItem = new HashMap();
                DisciplinaDTO disciplina = teachingDocumentsService.findDisciplina(disciplinaId);
                disciplinaMapItem.put("id", disciplina.getId());
                disciplinaMapItem.put("numero", disciplina.getNumeroGeral());
                disciplinaMapItem.put("descricao", disciplina.getDescricao());
                disciplinas.add(disciplinaMapItem);
            }
            mapItem.put("disciplinas", disciplinas);
            perfis.add(mapItem);
        }
    }
    conviteMap.put("perfis", perfis);
    return conviteMap;
}
Also used : ItemConviteInstrutorIndividualDTO(com.tomasio.projects.trainning.dto.ItemConviteInstrutorIndividualDTO) HashMap(java.util.HashMap) ConfirmacaoConviteInstrutorDTO(com.tomasio.projects.trainning.dto.ConfirmacaoConviteInstrutorDTO) ConviteInstrutorDTO(com.tomasio.projects.trainning.dto.ConviteInstrutorDTO) ConviteInstrutorPerfilDTO(com.tomasio.projects.trainning.dto.ConviteInstrutorPerfilDTO) ItemConviteInstrutorPerfilDTO(com.tomasio.projects.trainning.dto.ItemConviteInstrutorPerfilDTO) ArrayList(java.util.ArrayList) ConfirmacaoConviteInstrutorDTO(com.tomasio.projects.trainning.dto.ConfirmacaoConviteInstrutorDTO) TurmaEfetivaDTO(com.tomasio.projects.trainning.dto.TurmaEfetivaDTO) ItemConviteInstrutorIndividualDTO(com.tomasio.projects.trainning.dto.ItemConviteInstrutorIndividualDTO) ConviteInstrutorIndividualDTO(com.tomasio.projects.trainning.dto.ConviteInstrutorIndividualDTO) DisciplinaDTO(com.tomasio.projects.trainning.dto.DisciplinaDTO) List(java.util.List) ArrayList(java.util.ArrayList) OrganizacaoDTO(com.tomasio.projects.trainning.dto.OrganizacaoDTO) Map(java.util.Map) HashMap(java.util.HashMap) ItemConviteInstrutorPerfilDTO(com.tomasio.projects.trainning.dto.ItemConviteInstrutorPerfilDTO)

Example 9 with DisciplinaDTO

use of com.tomasio.projects.trainning.dto.DisciplinaDTO in project trainning by fernandotomasio.

the class DOC001PDF method countDiciplinasOnArea.

private int countDiciplinasOnArea(Map areas, Long areaId) {
    int countDisciplinasOnArea = 0;
    for (Object y : areas.values()) {
        @SuppressWarnings("rawtypes") Map area = (Map) y;
        ArrayList disciplinasList = (ArrayList) area.get("disciplinas");
        for (Object object : disciplinasList) {
            DisciplinaDTO disciplina = (DisciplinaDTO) object;
            if (disciplina.getAreaEnsino().getId().equals(areaId)) {
                countDisciplinasOnArea++;
            }
        }
    }
    return countDisciplinasOnArea;
}
Also used : ArrayList(java.util.ArrayList) DisciplinaDTO(com.tomasio.projects.trainning.dto.DisciplinaDTO) ObjetivoDisciplinaDTO(com.tomasio.projects.trainning.dto.ObjetivoDisciplinaDTO) HashMap(java.util.HashMap) Map(java.util.Map)

Example 10 with DisciplinaDTO

use of com.tomasio.projects.trainning.dto.DisciplinaDTO in project trainning by fernandotomasio.

the class DOC001PDF method buildTableQuadroGeral.

private PdfPTable buildTableQuadroGeral(Long curriculoId) throws DocumentException {
    DisciplinaDTO[] disciplinas = teachingDocumentsService.findAllDisciplinasByCurriculoMinimo(curriculoId);
    PdfPTable table = new PdfPTable(6);
    table.setWidths(new int[] { 1, 2, 3, 1, 1, 1 });
    table.setWidthPercentage(100);
    // for (DisciplinaDTO disciplina : disciplinas) {
    // System.out.print(disciplina.getDescricao());
    // System.out.print("-");
    // System.out.print(disciplina.getCampo().getDescricao());
    // System.out.print("-");
    // System.out.println(disciplina.getAreaEnsino().getNome());
    // }
    @SuppressWarnings("rawtypes") Map mapaGeral = new HashMap();
    for (DisciplinaDTO disciplina : disciplinas) {
        Map mapaCampo = (Map) mapaGeral.get(disciplina.getCampo().getId());
        if (mapaCampo != null) {
            Map mapAreas = (Map) mapaCampo.get("areas");
            if (mapAreas != null) {
                Map mapArea = (Map) mapAreas.get(disciplina.getAreaEnsino().getId());
                if (mapArea != null) {
                    ArrayList disciplinasList = (ArrayList) mapArea.get("disciplinas");
                    if (disciplinasList != null) {
                        disciplinasList.add(disciplina);
                    } else {
                        ArrayList newDisciplinasList = new ArrayList();
                        newDisciplinasList.add(disciplina);
                        mapArea.put("disciplinas", newDisciplinasList);
                    }
                } else {
                    Map newMapArea = new HashMap();
                    newMapArea.put("nome", disciplina.getAreaEnsino().getNome());
                    newMapArea.put("id", disciplina.getAreaEnsino().getId());
                    ArrayList newDisciplinasList = new ArrayList();
                    newDisciplinasList.add(disciplina);
                    newMapArea.put("disciplinas", newDisciplinasList);
                    mapAreas.put(disciplina.getAreaEnsino().getId(), newMapArea);
                }
            } else {
                Map newMapAreas = new HashMap();
                Map newMapArea = new HashMap();
                newMapArea.put("nome", disciplina.getAreaEnsino().getNome());
                newMapArea.put("id", disciplina.getAreaEnsino().getId());
                ArrayList newDisciplinasList = new ArrayList();
                newDisciplinasList.add(disciplina);
                newMapArea.put("disciplinas", newDisciplinasList);
                newMapAreas.put(disciplina.getAreaEnsino().getId(), newMapArea);
                mapaCampo.put("areas", newMapAreas);
            }
        } else {
            Map newMapaCampo = new HashMap();
            newMapaCampo.put("nome", disciplina.getCampo().getDescricao());
            newMapaCampo.put("id", disciplina.getCampo().getId());
            Map newMapAreas = new HashMap();
            Map newMapArea = new HashMap();
            newMapArea.put("nome", disciplina.getAreaEnsino().getNome());
            newMapArea.put("id", disciplina.getAreaEnsino().getId());
            ArrayList newDisciplinasList = new ArrayList();
            newDisciplinasList.add(disciplina);
            newMapArea.put("disciplinas", newDisciplinasList);
            newMapAreas.put(disciplina.getAreaEnsino().getId(), newMapArea);
            newMapaCampo.put("areas", newMapAreas);
            mapaGeral.put(disciplina.getCampo().getId(), newMapaCampo);
        }
    }
    PdfPCell campoHeadCell = new PdfPCell(new Phrase("CAMPO", fontManager.getMiniBoldFont()));
    campoHeadCell.setPadding(10);
    PdfPCell areaHeadCell = new PdfPCell(new Phrase("ÁREA", fontManager.getSmallBoldFont()));
    areaHeadCell.setPadding(10);
    PdfPCell disciplinasHeadCell = new PdfPCell(new Phrase("DISCIPLINAS", fontManager.getSmallBoldFont()));
    disciplinasHeadCell.setPadding(10);
    PdfPCell CHInstrucaoHeadCell = new PdfPCell(new Phrase("CH INSTR.", fontManager.getSmallBoldFont()));
    CHInstrucaoHeadCell.setPadding(10);
    PdfPCell CHAvaliacaoHeadCell = new PdfPCell(new Phrase("CH AV.", fontManager.getSmallBoldFont()));
    CHAvaliacaoHeadCell.setPadding(10);
    PdfPCell CHTotalHeadCell = new PdfPCell(new Phrase("CH", fontManager.getSmallBoldFont()));
    CHTotalHeadCell.setPadding(10);
    table.addCell(campoHeadCell);
    table.addCell(areaHeadCell);
    table.addCell(disciplinasHeadCell);
    table.addCell(CHInstrucaoHeadCell);
    table.addCell(CHAvaliacaoHeadCell);
    table.addCell(CHTotalHeadCell);
    Collection campos = mapaGeral.values();
    for (Object x : campos) {
        Map campo = (Map) x;
        String nomeCampo = (String) campo.get("nome");
        PdfPCell campoCell = new PdfPCell(new Phrase(nomeCampo.toUpperCase(), fontManager.getSmallFont()));
        campoCell.setRotation(90);
        campoCell.setHorizontalAlignment(Element.ALIGN_CENTER);
        Long campoId = (Long) campo.get("id");
        int countDisciplinasOnCampo = countDiciplinasOnCampo(mapaGeral, campoId);
        if (countDisciplinasOnCampo > 1) {
            campoCell.setRowspan(countDisciplinasOnCampo);
        }
        campoCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        campoCell.setHorizontalAlignment(Element.ALIGN_CENTER);
        campoCell.setPadding(10);
        table.addCell(campoCell);
        Map areas = (Map) campo.get("areas");
        Collection listAreas = areas.values();
        for (Object y : listAreas) {
            Map area = (Map) y;
            String nomeArea = (String) area.get("nome");
            PdfPCell areaCell = new PdfPCell(new Phrase(nomeArea.toUpperCase(), fontManager.getSmallFont()));
            Long areaId = (Long) area.get("id");
            int countDisciplinasOnArea = countDiciplinasOnArea(areas, areaId);
            if (countDisciplinasOnArea > 1) {
                areaCell.setRowspan(countDisciplinasOnArea);
            }
            areaCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            areaCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            areaCell.setPadding(10);
            table.addCell(areaCell);
            ArrayList disciplinasList = (ArrayList) area.get("disciplinas");
            for (Object object : disciplinasList) {
                DisciplinaDTO disciplina = (DisciplinaDTO) object;
                PdfPCell disciplinaCell = new PdfPCell(new Phrase(disciplina.getDescricao().toUpperCase(), fontManager.getSmallFont()));
                disciplinaCell.setPadding(10);
                disciplinaCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                PdfPCell CHInstrucaoCell = new PdfPCell(new Phrase(String.valueOf(disciplina.getQuantidadeTemposAula()), fontManager.getSmallFont()));
                CHInstrucaoCell.setPadding(10);
                CHInstrucaoCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                CHInstrucaoCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                PdfPCell CHAvaliacaoCell = new PdfPCell(new Phrase(String.valueOf(disciplina.getQuantidadeTemposAvaliacao()), fontManager.getSmallFont()));
                CHAvaliacaoCell.setPadding(10);
                CHAvaliacaoCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                CHAvaliacaoCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                int total = disciplina.getQuantidadeTemposAula() + disciplina.getQuantidadeTemposAvaliacao();
                PdfPCell CHTotalCell = new PdfPCell(new Phrase(String.valueOf(total), fontManager.getSmallFont()));
                CHTotalCell.setPadding(10);
                CHTotalCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                CHTotalCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                table.addCell(disciplinaCell);
                table.addCell(CHInstrucaoCell);
                table.addCell(CHAvaliacaoCell);
                table.addCell(CHTotalCell);
            }
        }
    }
    for (Object x : campos) {
        Map campo = (Map) x;
        String nomeCampo = (String) campo.get("nome");
        PdfPCell sumCampoCell = new PdfPCell(new Phrase("TOTAL " + nomeCampo, fontManager.getSmallBoldFont()));
        sumCampoCell.setHorizontalAlignment(Element.ALIGN_CENTER);
        Long campoId = (Long) campo.get("id");
        sumCampoCell.setColspan(3);
        sumCampoCell.setPadding(10);
        PdfPCell sumCampoCHInstrucaoCell = new PdfPCell(new Phrase("", fontManager.getSmallFont()));
        sumCampoCHInstrucaoCell.setPadding(10);
        PdfPCell sumCampoCHAvaliacaoCell = new PdfPCell(new Phrase("", fontManager.getSmallFont()));
        sumCampoCHAvaliacaoCell.setPadding(10);
        PdfPCell sumCampoCHTotalCell = new PdfPCell(new Phrase(String.valueOf(sumCHDiciplinasOnCampo(mapaGeral, campoId)), fontManager.getSmallFont()));
        sumCampoCHTotalCell.setHorizontalAlignment(Element.ALIGN_CENTER);
        sumCampoCHTotalCell.setPadding(10);
        table.addCell(sumCampoCell);
        table.addCell(sumCampoCHInstrucaoCell);
        table.addCell(sumCampoCHAvaliacaoCell);
        table.addCell(sumCampoCHTotalCell);
    }
    PdfPCell CFRealCell = new PdfPCell(new Phrase("CARGA HORÁRIA REAL", fontManager.getSmallFont()));
    CFRealCell.setHorizontalAlignment(Element.ALIGN_CENTER);
    CFRealCell.setColspan(3);
    CFRealCell.setPadding(10);
    CFRealCell.setHorizontalAlignment(Element.ALIGN_CENTER);
    PdfPCell CFRealCHInstrucaoCell = new PdfPCell(new Phrase("", fontManager.getSmallFont()));
    CFRealCHInstrucaoCell.setPadding(10);
    CFRealCHInstrucaoCell.setHorizontalAlignment(Element.ALIGN_CENTER);
    PdfPCell CFRealCHAvaliacaoCell = new PdfPCell(new Phrase("", fontManager.getSmallFont()));
    CFRealCHAvaliacaoCell.setPadding(10);
    CFRealCHAvaliacaoCell.setHorizontalAlignment(Element.ALIGN_CENTER);
    int sumChTotal = 0;
    int sumCHReal = sumCHReal(mapaGeral);
    sumChTotal += sumCHReal;
    PdfPCell CFRealCHTotalCell = new PdfPCell(new Phrase(String.valueOf(sumCHReal), fontManager.getSmallFont()));
    CFRealCHTotalCell.setPadding(10);
    CFRealCHTotalCell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(CFRealCell);
    table.addCell(CFRealCHInstrucaoCell);
    table.addCell(CFRealCHAvaliacaoCell);
    table.addCell(CFRealCHTotalCell);
    int sumComplementacao = 0;
    ComplementacaoInstrucaoDTO[] complementacoes = teachingDocumentsService.findAllComplementacoesInstrucaoByPUD(curriculoId);
    for (ComplementacaoInstrucaoDTO complementacao : complementacoes) {
        sumComplementacao += complementacao.getQuantidadeTemposAula();
    }
    sumChTotal += sumComplementacao;
    if (sumComplementacao > 0) {
        PdfPCell sumComplementacaoCell = new PdfPCell(new Phrase("COMPLEMENTAÇÃO DA INSTRUÇÃO", fontManager.getSmallFont()));
        sumComplementacaoCell.setHorizontalAlignment(Element.ALIGN_CENTER);
        sumComplementacaoCell.setColspan(3);
        sumComplementacaoCell.setPadding(10);
        PdfPCell sumComplementacaoCHInstrucaoCell = new PdfPCell(new Phrase("", fontManager.getSmallFont()));
        sumComplementacaoCHInstrucaoCell.setPadding(10);
        sumComplementacaoCHInstrucaoCell.setHorizontalAlignment(Element.ALIGN_CENTER);
        sumComplementacaoCHInstrucaoCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        PdfPCell sumComplementacaoCHAvaliacaoCell = new PdfPCell(new Phrase("", fontManager.getSmallFont()));
        sumComplementacaoCHAvaliacaoCell.setPadding(10);
        sumComplementacaoCHAvaliacaoCell.setHorizontalAlignment(Element.ALIGN_CENTER);
        sumComplementacaoCHAvaliacaoCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        PdfPCell sumComplementacaoCHTotalCell = new PdfPCell(new Phrase(String.valueOf(sumComplementacao), fontManager.getSmallFont()));
        sumComplementacaoCHTotalCell.setPadding(10);
        sumComplementacaoCHTotalCell.setHorizontalAlignment(Element.ALIGN_CENTER);
        sumComplementacaoCHTotalCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        table.addCell(sumComplementacaoCell);
        table.addCell(sumComplementacaoCHInstrucaoCell);
        table.addCell(sumComplementacaoCHAvaliacaoCell);
        table.addCell(sumComplementacaoCHTotalCell);
    }
    int sumAtividades = 0;
    AtividadeAdministrativaDTO[] atividades = teachingDocumentsService.findAllAtividadesAdministrativasByPUD(curriculoId);
    for (AtividadeAdministrativaDTO atividade : atividades) {
        sumAtividades += atividade.getQuantidadeTemposAula();
    }
    sumChTotal += sumAtividades;
    if (sumAtividades > 0) {
        PdfPCell sumAtividadeAdministrativaCell = new PdfPCell(new Phrase("ATIVIDADES ADMINISTRATIVAS", fontManager.getSmallFont()));
        sumAtividadeAdministrativaCell.setHorizontalAlignment(Element.ALIGN_CENTER);
        sumAtividadeAdministrativaCell.setColspan(3);
        sumAtividadeAdministrativaCell.setPadding(10);
        PdfPCell sumAtividadeAdministrativaCHInstrucaoCell = new PdfPCell(new Phrase("", fontManager.getSmallFont()));
        sumAtividadeAdministrativaCHInstrucaoCell.setPadding(10);
        sumAtividadeAdministrativaCHInstrucaoCell.setHorizontalAlignment(Element.ALIGN_CENTER);
        sumAtividadeAdministrativaCHInstrucaoCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        PdfPCell sumAtividadeAdministrativaCHAvaliacaoCell = new PdfPCell(new Phrase("", fontManager.getSmallFont()));
        sumAtividadeAdministrativaCHAvaliacaoCell.setPadding(10);
        sumAtividadeAdministrativaCHAvaliacaoCell.setHorizontalAlignment(Element.ALIGN_CENTER);
        sumAtividadeAdministrativaCHAvaliacaoCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        PdfPCell sumAtividadeAdministrativaCHTotalCell = new PdfPCell(new Phrase(String.valueOf(sumAtividades), fontManager.getSmallFont()));
        sumAtividadeAdministrativaCHTotalCell.setPadding(10);
        sumAtividadeAdministrativaCHTotalCell.setHorizontalAlignment(Element.ALIGN_CENTER);
        sumAtividadeAdministrativaCHTotalCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        table.addCell(sumAtividadeAdministrativaCell);
        table.addCell(sumAtividadeAdministrativaCHInstrucaoCell);
        table.addCell(sumAtividadeAdministrativaCHAvaliacaoCell);
        table.addCell(sumAtividadeAdministrativaCHTotalCell);
    }
    // PdfPCell sumAtividadeAvaliativaCell = new PdfPCell(new Phrase("ATIVIDADES AVALIATIVAS", fontManager.getSmallFont()));
    // sumAtividadeAvaliativaCell.setHorizontalAlignment(Element.ALIGN_CENTER);
    // 
    // sumAtividadeAvaliativaCell.setColspan(3);
    // sumAtividadeAvaliativaCell.setPadding(10);
    // PdfPCell sumAtividadeAvaliativaCHInstrucaoCell = new PdfPCell(new Phrase("", fontManager.getSmallFont()));
    // sumAtividadeAvaliativaCHInstrucaoCell.setPadding(10);
    // PdfPCell sumAtividadeAvaliativaCHAvaliacaoCell = new PdfPCell(new Phrase("", fontManager.getSmallFont()));
    // sumAtividadeAvaliativaCHAvaliacaoCell.setPadding(10);
    // PdfPCell sumAtividadeAvaliativaCHTotalCell = new PdfPCell(new Phrase("", fontManager.getSmallFont()));
    // sumAtividadeAvaliativaCHTotalCell.setPadding(10);
    // 
    // table.addCell(sumAtividadeAvaliativaCell);
    // table.addCell(sumAtividadeAvaliativaCHInstrucaoCell);
    // table.addCell(sumAtividadeAvaliativaCHAvaliacaoCell);
    // table.addCell(sumAtividadeAvaliativaCHTotalCell);
    int sumFlexibilidade = 0;
    FlexibilidadeProgramacaoDTO[] flexibilidades = teachingDocumentsService.findAllFlexibilidadesProgramacaoByPUD(curriculoId);
    for (FlexibilidadeProgramacaoDTO flexibilidade : flexibilidades) {
        sumFlexibilidade += flexibilidade.getQuantidadeTemposAula();
    }
    sumChTotal += sumFlexibilidade;
    if (sumFlexibilidade > 0) {
        PdfPCell sumFlexibilidadeCell = new PdfPCell(new Phrase("FLEXIBILIDADE DA PROGRAMAÇÃO", fontManager.getSmallFont()));
        sumFlexibilidadeCell.setHorizontalAlignment(Element.ALIGN_CENTER);
        sumFlexibilidadeCell.setColspan(3);
        sumFlexibilidadeCell.setPadding(10);
        PdfPCell sumFlexibilidadeCHInstrucaoCell = new PdfPCell(new Phrase("", fontManager.getSmallFont()));
        sumFlexibilidadeCHInstrucaoCell.setPadding(10);
        sumFlexibilidadeCHInstrucaoCell.setHorizontalAlignment(Element.ALIGN_CENTER);
        sumFlexibilidadeCHInstrucaoCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        PdfPCell sumFlexibilidadeCHAvaliacaoCell = new PdfPCell(new Phrase("", fontManager.getSmallFont()));
        sumFlexibilidadeCHAvaliacaoCell.setPadding(10);
        sumFlexibilidadeCHAvaliacaoCell.setHorizontalAlignment(Element.ALIGN_CENTER);
        sumFlexibilidadeCHAvaliacaoCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        PdfPCell sumFlexibilidadeCHTotalCell = new PdfPCell(new Phrase(String.valueOf(sumFlexibilidade), fontManager.getSmallFont()));
        sumFlexibilidadeCHTotalCell.setPadding(10);
        sumFlexibilidadeCHTotalCell.setHorizontalAlignment(Element.ALIGN_CENTER);
        sumFlexibilidadeCHTotalCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        table.addCell(sumFlexibilidadeCell);
        table.addCell(sumFlexibilidadeCHInstrucaoCell);
        table.addCell(sumFlexibilidadeCHAvaliacaoCell);
        table.addCell(sumFlexibilidadeCHTotalCell);
    }
    PdfPCell sumCHTotalCell = new PdfPCell(new Phrase("CARGA HORÁRIA TOTAL", fontManager.getSmallFont()));
    sumCHTotalCell.setHorizontalAlignment(Element.ALIGN_CENTER);
    sumCHTotalCell.setColspan(3);
    sumCHTotalCell.setPadding(10);
    PdfPCell sumCHTotalCHInstrucaoCell = new PdfPCell(new Phrase("", fontManager.getSmallFont()));
    sumCHTotalCHInstrucaoCell.setPadding(10);
    sumCHTotalCHInstrucaoCell.setHorizontalAlignment(Element.ALIGN_CENTER);
    sumCHTotalCHInstrucaoCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell sumCHTotalCHAvaliacaoCell = new PdfPCell(new Phrase("", fontManager.getSmallFont()));
    sumCHTotalCHAvaliacaoCell.setPadding(10);
    sumCHTotalCHAvaliacaoCell.setHorizontalAlignment(Element.ALIGN_CENTER);
    sumCHTotalCHAvaliacaoCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell sumCHTotalCHTotalCell = new PdfPCell(new Phrase(String.valueOf(sumChTotal), fontManager.getSmallFont()));
    sumCHTotalCHTotalCell.setPadding(10);
    sumCHTotalCHTotalCell.setHorizontalAlignment(Element.ALIGN_CENTER);
    sumCHTotalCHTotalCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    table.addCell(sumCHTotalCell);
    table.addCell(sumCHTotalCHInstrucaoCell);
    table.addCell(sumCHTotalCHAvaliacaoCell);
    table.addCell(sumCHTotalCHTotalCell);
    return table;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Phrase(com.itextpdf.text.Phrase) AtividadeAdministrativaDTO(com.tomasio.projects.trainning.dto.AtividadeAdministrativaDTO) ComplementacaoInstrucaoDTO(com.tomasio.projects.trainning.dto.ComplementacaoInstrucaoDTO) DisciplinaDTO(com.tomasio.projects.trainning.dto.DisciplinaDTO) ObjetivoDisciplinaDTO(com.tomasio.projects.trainning.dto.ObjetivoDisciplinaDTO) Collection(java.util.Collection) HashMap(java.util.HashMap) Map(java.util.Map) FlexibilidadeProgramacaoDTO(com.tomasio.projects.trainning.dto.FlexibilidadeProgramacaoDTO)

Aggregations

DisciplinaDTO (com.tomasio.projects.trainning.dto.DisciplinaDTO)27 ObjetivoDisciplinaDTO (com.tomasio.projects.trainning.dto.ObjetivoDisciplinaDTO)19 ArrayList (java.util.ArrayList)10 HashMap (java.util.HashMap)8 Map (java.util.Map)8 RequestContext (org.springframework.webflow.execution.RequestContext)7 UnidadeDidaticaDTO (com.tomasio.projects.trainning.dto.UnidadeDidaticaDTO)6 CurriculoMinimoDTO (com.tomasio.projects.trainning.dto.CurriculoMinimoDTO)5 DisciplinaPUDForm (com.tomasio.projects.trainning.form.pud.DisciplinaPUDForm)5 DisciplinaCMForm (com.tomasio.projects.trainning.form.cm.DisciplinaCMForm)4 Collection (java.util.Collection)4 Paragraph (com.itextpdf.text.Paragraph)3 AtividadeAdministrativaDTO (com.tomasio.projects.trainning.dto.AtividadeAdministrativaDTO)3 ComplementacaoInstrucaoDTO (com.tomasio.projects.trainning.dto.ComplementacaoInstrucaoDTO)3 FlexibilidadeProgramacaoDTO (com.tomasio.projects.trainning.dto.FlexibilidadeProgramacaoDTO)3 ObjetivoUnidadeDidaticaDTO (com.tomasio.projects.trainning.dto.ObjetivoUnidadeDidaticaDTO)3 CoreException (com.tomasio.projects.trainning.exeption.CoreException)3 Chapter (com.itextpdf.text.Chapter)2 Phrase (com.itextpdf.text.Phrase)2 Section (com.itextpdf.text.Section)2