Search in sources :

Example 1 with TurmaDTO

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

the class ChartsController method initializeSelectableCursos.

public Map initializeSelectableCursos(Long organizacaoGestoraId) {
    Map result = new HashMap();
    TurmaDTO[] turmas = atividadesEnsinoService.findAllTurmasEfetivas(null, null, null, null, organizacaoGestoraId, null);
    result.put(0, "Todos");
    for (TurmaDTO turma : turmas) {
        result.put(turma.getCurso().getId(), turma.getCurso().getCodigo() + " - " + turma.getCurso().getDescricao());
    }
    return result;
}
Also used : HashMap(java.util.HashMap) TurmaDTO(com.tomasio.projects.trainning.dto.TurmaDTO) HashMap(java.util.HashMap) Map(java.util.Map)

Example 2 with TurmaDTO

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

the class CommonsController method initializeSelectableTurmas.

public List initializeSelectableTurmas(Map<Object, Object> cursoMap, String exercicio) {
    List result = new ArrayList();
    SimpleDateFormat dfYear = new SimpleDateFormat("yyyy");
    Date exercicioDate = null;
    try {
        exercicioDate = dfYear.parse(exercicio);
    } catch (ParseException ex) {
        Logger.getLogger(CommonsController.class.getName()).log(Level.SEVERE, null, ex);
    }
    Long cursoId = (Long) cursoMap.get("id");
    // Map<Object, Object> result = new HashMap<>();
    TurmaDTO[] turmas = atividadesEnsinoService.findAllTurmasEfetivas(exercicioDate, null, cursoId, null, null, null);
    for (TurmaDTO turma : turmas) {
        Map item = new HashMap();
        // result.put(turma.getId(), turma.getCurso().getCodigo() + " - " + turma.getNumeroTurma() + " (" + turma.getPeriodoFormatted() + ")");
        item.put("turmaId", turma.getId());
        item.put("cursoCodigo", turma.getCurso().getCodigo());
        item.put("numeroTurma", turma.getNumeroTurma());
        item.put("periodoTurma", turma.getPeriodoFormatted());
        result.add(item);
    }
    return result;
}
Also used : ParseException(java.text.ParseException) TurmaDTO(com.tomasio.projects.trainning.dto.TurmaDTO) SimpleDateFormat(java.text.SimpleDateFormat)

Example 3 with TurmaDTO

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

the class CommonsController method listEvents.

@RequestMapping("/events")
@ResponseBody
public List listEvents(WebRequest request) {
    String pessoaIdParam = request.getParameter("pessoaId");
    Long pessoaId = Long.parseLong(pessoaIdParam);
    SimpleDateFormat dfDay = new SimpleDateFormat("d");
    SimpleDateFormat dfMonth = new SimpleDateFormat("M");
    SimpleDateFormat dfYear = new SimpleDateFormat("yyyy");
    List result = new ArrayList();
    ItemConviteInstrutorIndividualDTO[] itensConvite = atividadesEnsinoService.findAllItensConviteInstrutorIndividualByPessoaId(pessoaId);
    for (ItemConviteInstrutorIndividualDTO item : itensConvite) {
        ConviteInstrutorIndividualDTO convite = item.getConviteInstrutorIndividual();
        TurmaDTO turma = atividadesEnsinoService.findTurmaEfetiva(convite.getTurma().getId());
        Map map = new HashMap();
        map.put("title", "Convite Instrutor " + turma.getCurso().getCodigo() + "-" + turma.getNumeroTurma() + " (" + turma.getLocal() + ")");
        map.put("className", "label-warning");
        map.put("startDay", dfDay.format(item.getPeriodo().getDataInicio()));
        map.put("startMonth", dfMonth.format(item.getPeriodo().getDataInicio()));
        map.put("startYear", dfYear.format(item.getPeriodo().getDataInicio()));
        map.put("endDay", dfDay.format(item.getPeriodo().getDataTermino()));
        map.put("endMonth", dfMonth.format(item.getPeriodo().getDataTermino()));
        map.put("endYear", dfYear.format(item.getPeriodo().getDataTermino()));
        result.add(map);
    }
    ConfirmacaoConviteInstrutorDTO[] confirmacoes = atividadesEnsinoService.findAllConfirmacoesConvitesInstrutoresByPessoaId(pessoaId);
    for (ConfirmacaoConviteInstrutorDTO confirmacao : confirmacoes) {
        ConviteInstrutorDTO convite = atividadesEnsinoService.findConviteInstrutor(confirmacao.getConviteInstrutor().getId());
        TurmaDTO turma = atividadesEnsinoService.findTurmaEfetiva(convite.getTurma().getId());
        Map map = new HashMap();
        map.put("title", "Convite Instrutor " + turma.getCurso().getCodigo() + "-" + turma.getNumeroTurma() + " (" + turma.getLocal() + ")");
        map.put("className", "label-important");
        map.put("startDay", dfDay.format(confirmacao.getPeriodo().getDataInicio()));
        map.put("startMonth", dfMonth.format(confirmacao.getPeriodo().getDataInicio()));
        map.put("startYear", dfYear.format(confirmacao.getPeriodo().getDataInicio()));
        map.put("endDay", dfDay.format(confirmacao.getPeriodo().getDataTermino()));
        map.put("endMonth", dfMonth.format(confirmacao.getPeriodo().getDataTermino()));
        map.put("endYear", dfYear.format(confirmacao.getPeriodo().getDataTermino()));
        result.add(map);
    }
    IndicacaoDTO[] indicacoesInstrutor = atividadesEnsinoService.findAllIndicacoesInstrutorByPessoaId(new Date(), pessoaId);
    for (IndicacaoDTO indicacao : indicacoesInstrutor) {
        IndicacaoInstrutorDTO indicacaoInstrutor = (IndicacaoInstrutorDTO) indicacao;
        TurmaDTO turma = atividadesEnsinoService.findTurmaEfetiva(indicacao.getTurma().getId());
        Map map = new HashMap();
        map.put("title", "Indicação Instrutor " + turma.getCurso().getCodigo() + "-" + turma.getNumeroTurma() + " (" + turma.getLocal() + ")");
        map.put("className", "label-purple");
        map.put("startDay", dfDay.format(indicacaoInstrutor.getPeriodo().getDataInicio()));
        map.put("startMonth", dfMonth.format(indicacaoInstrutor.getPeriodo().getDataInicio()));
        map.put("startYear", dfYear.format(indicacaoInstrutor.getPeriodo().getDataInicio()));
        map.put("endDay", dfDay.format(indicacaoInstrutor.getPeriodo().getDataTermino()));
        map.put("endMonth", dfMonth.format(indicacaoInstrutor.getPeriodo().getDataTermino()));
        map.put("endYear", dfYear.format(indicacaoInstrutor.getPeriodo().getDataTermino()));
        result.add(map);
    }
    IndicacaoDTO[] indicacoesAluno = atividadesEnsinoService.findAllIndicacoesAlunoByPessoaId(new Date(), pessoaId);
    for (IndicacaoDTO indicacao : indicacoesAluno) {
        IndicacaoAlunoDTO indicacaoInstrutor = (IndicacaoAlunoDTO) indicacao;
        TurmaDTO turma = atividadesEnsinoService.findTurmaEfetiva(indicacao.getTurma().getId());
        Map map = new HashMap();
        map.put("title", "Indicação Aluno " + turma.getCurso().getCodigo() + "-" + turma.getNumeroTurma() + " (" + turma.getLocal() + ")");
        map.put("className", "label-success");
        map.put("startDay", dfDay.format(turma.getDataInicio()));
        map.put("startMonth", dfMonth.format(turma.getDataInicio()));
        map.put("startYear", dfYear.format(turma.getDataInicio()));
        map.put("endDay", dfDay.format(turma.getDataTermino()));
        map.put("endMonth", dfMonth.format(turma.getDataTermino()));
        map.put("endYear", dfYear.format(turma.getDataTermino()));
        result.add(map);
    }
    MatriculaDTO[] matriculasInstrutor = atividadesEnsinoService.findAllMatriculasInstrutoresByPessoaId(pessoaId);
    for (MatriculaDTO matricula : matriculasInstrutor) {
        MatriculaInstrutorDTO matriculaInstrutor = (MatriculaInstrutorDTO) matricula;
        TurmaDTO turma = atividadesEnsinoService.findTurmaEfetiva(matriculaInstrutor.getTurma().getId());
        Map map = new HashMap();
        map.put("title", "Matricula Instrutor " + turma.getCurso().getCodigo() + "-" + turma.getNumeroTurma() + " (" + turma.getLocal() + ")");
        map.put("className", "label-info");
        IndicacaoInstrutorDTO indicacao = (IndicacaoInstrutorDTO) matriculaInstrutor.getIndicacao();
        map.put("startDay", dfDay.format(indicacao.getPeriodo().getDataInicio()));
        map.put("startMonth", dfMonth.format(indicacao.getPeriodo().getDataInicio()));
        map.put("startYear", dfYear.format(indicacao.getPeriodo().getDataInicio()));
        map.put("endDay", dfDay.format(indicacao.getPeriodo().getDataTermino()));
        map.put("endMonth", dfMonth.format(indicacao.getPeriodo().getDataTermino()));
        map.put("endYear", dfYear.format(indicacao.getPeriodo().getDataTermino()));
        result.add(map);
    }
    MatriculaDTO[] matriculasAluno = atividadesEnsinoService.findAllMatriculasInstrutoresByPessoaId(pessoaId);
    for (MatriculaDTO matricula : matriculasAluno) {
        MatriculaInstrutorDTO matriculaInstrutor = (MatriculaInstrutorDTO) matricula;
        TurmaDTO turma = atividadesEnsinoService.findTurmaEfetiva(matriculaInstrutor.getTurma().getId());
        Map map = new HashMap();
        map.put("title", "Matricula Aluno " + turma.getCurso().getCodigo() + "-" + turma.getNumeroTurma() + " (" + turma.getLocal() + ")");
        map.put("className", "label-pink");
        map.put("startDay", dfDay.format(turma.getDataInicio()));
        map.put("startMonth", dfMonth.format(turma.getDataInicio()));
        map.put("startYear", dfYear.format(turma.getDataInicio()));
        map.put("endDay", dfDay.format(turma.getDataTermino()));
        map.put("endMonth", dfMonth.format(turma.getDataTermino()));
        map.put("endYear", dfYear.format(turma.getDataTermino()));
        result.add(map);
    }
    Map map2 = new HashMap();
    map2.put("title", "Curso ATM003");
    map2.put("className", "label-inverse");
    map2.put("startDay", dfDay.format(new Date()));
    map2.put("startMonth", dfMonth.format(new Date()));
    map2.put("startYear", dfYear.format(new Date()));
    result.add(map2);
    return result;
}
Also used : MatriculaDTO(com.tomasio.projects.trainning.dto.MatriculaDTO) ItemConviteInstrutorIndividualDTO(com.tomasio.projects.trainning.dto.ItemConviteInstrutorIndividualDTO) ConfirmacaoConviteInstrutorDTO(com.tomasio.projects.trainning.dto.ConfirmacaoConviteInstrutorDTO) ConviteInstrutorDTO(com.tomasio.projects.trainning.dto.ConviteInstrutorDTO) TurmaDTO(com.tomasio.projects.trainning.dto.TurmaDTO) MatriculaInstrutorDTO(com.tomasio.projects.trainning.dto.MatriculaInstrutorDTO) IndicacaoDTO(com.tomasio.projects.trainning.dto.IndicacaoDTO) IndicacaoAlunoDTO(com.tomasio.projects.trainning.dto.IndicacaoAlunoDTO) ConfirmacaoConviteInstrutorDTO(com.tomasio.projects.trainning.dto.ConfirmacaoConviteInstrutorDTO) ItemConviteInstrutorIndividualDTO(com.tomasio.projects.trainning.dto.ItemConviteInstrutorIndividualDTO) ConviteInstrutorIndividualDTO(com.tomasio.projects.trainning.dto.ConviteInstrutorIndividualDTO) SimpleDateFormat(java.text.SimpleDateFormat) IndicacaoInstrutorDTO(com.tomasio.projects.trainning.dto.IndicacaoInstrutorDTO) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 4 with TurmaDTO

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

the class InstrutoresController method initializeInstrucoesInstrutorDataList.

public List initializeInstrucoesInstrutorDataList(Long pessoaId) {
    List result = new ArrayList();
    MatriculaDTO[] instrucoes = atividadesEnsinoService.findAllMatriculasInstrutoresByPessoaId(pessoaId);
    for (MatriculaDTO matricula : instrucoes) {
        Map item = new HashMap();
        // CursoDTO curso = trainningService.findCurso(conclusao.getCapacitacao().getId());
        TurmaDTO turma = atividadesEnsinoService.findTurmaEfetiva(matricula.getTurma().getId());
        item.put("codigoCurso", turma.getCurso().getCodigo());
        item.put("numeroTurma", turma.getNumeroTurma());
        item.put("local", turma.getLocal());
        item.put("dataInicio", turma.getDataInicioFormatted());
        item.put("dataTermino", turma.getDataTerminoFormatted());
        if (turma.getDataTermino() != null) {
            item.put("dataTermino", turma.getDataTerminoFormatted());
        }
        result.add(item);
    }
    return result;
}
Also used : MatriculaDTO(com.tomasio.projects.trainning.dto.MatriculaDTO) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) TurmaDTO(com.tomasio.projects.trainning.dto.TurmaDTO) HashMap(java.util.HashMap) Map(java.util.Map)

Example 5 with TurmaDTO

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

the class HomeController method listListIndicacoes.

@RequestMapping("/list_indicacoes_ajax")
@ResponseBody
public Object listListIndicacoes(Model model, @ModelAttribute("userOrganization") OrganizacaoDTO userOrganization, WebRequest request) {
    Map<Object, Object> result = new HashMap<Object, Object>();
    List<Map<Object, Object>> dataList = new ArrayList<Map<Object, Object>>();
    Set<Long> turmasIds = new HashSet<Long>();
    IndicacaoDTO[] indicacoes = atividadesEnsinoService.findAllIndicacoesAlunos(null, userOrganization.getId(), null, new Date());
    for (IndicacaoDTO indicacao : indicacoes) {
        turmasIds.add(indicacao.getTurma().getId());
    }
    Long[] turmasIdsArray = new Long[turmasIds.size()];
    int i = 0;
    for (Long id : turmasIds) {
        turmasIdsArray[i] = id;
        i++;
    }
    Map<Long, TurmaDTO> turmasMap = new HashMap<Long, TurmaDTO>();
    TurmaDTO[] turmas = atividadesEnsinoService.findAllTurmas(turmasIdsArray);
    for (TurmaDTO turmaDTO : turmas) {
        turmasMap.put(turmaDTO.getId(), turmaDTO);
    }
    for (IndicacaoDTO indicacao : indicacoes) {
        Map<Object, Object> item = new HashMap<Object, Object>();
        PessoaDTO pessoa = organizationalService.findPessoa(indicacao.getPessoa().getId());
        // TurmaDTO turma = atividadesEnsinoService.findTurmaEfetiva(indicacao.getTurma().getId());
        item.put("pessoa", pessoa.getTargetaCompletaOM());
        TurmaDTO turma = turmasMap.get(indicacao.getTurma().getId());
        item.put("turma", turma.getCurso().getCodigo() + "-" + turma.getNumeroTurma() + " (" + turma.getPeriodoFormatted() + ")");
        item.put("status", indicacao.getStatus());
        dataList.add(item);
    }
    result.put("data", dataList);
    return result;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) TurmaDTO(com.tomasio.projects.trainning.dto.TurmaDTO) Date(java.util.Date) IndicacaoDTO(com.tomasio.projects.trainning.dto.IndicacaoDTO) PessoaDTO(com.tomasio.projects.trainning.dto.PessoaDTO) HashMap(java.util.HashMap) Map(java.util.Map) HashSet(java.util.HashSet) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

TurmaDTO (com.tomasio.projects.trainning.dto.TurmaDTO)23 IndicacaoDTO (com.tomasio.projects.trainning.dto.IndicacaoDTO)8 HashMap (java.util.HashMap)8 PessoaDTO (com.tomasio.projects.trainning.dto.PessoaDTO)7 AtividadesEnsinoService (com.tomasio.projects.trainning.interfaces.AtividadesEnsinoService)7 OrganizationalService (com.tomasio.projects.trainning.interfaces.OrganizationalService)7 ArrayList (java.util.ArrayList)6 List (java.util.List)6 FaseDTO (com.tomasio.projects.trainning.dto.FaseDTO)5 OrganizacaoDTO (com.tomasio.projects.trainning.dto.OrganizacaoDTO)5 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 AnotacaoDTO (com.tomasio.projects.trainning.dto.AnotacaoDTO)3 CursoDTO (com.tomasio.projects.trainning.dto.CursoDTO)3 FolhaRostoDTO (com.tomasio.projects.trainning.dto.FolhaRostoDTO)3 IndicacaoAlunoDTO (com.tomasio.projects.trainning.dto.IndicacaoAlunoDTO)3 IndicacaoInstrutorDTO (com.tomasio.projects.trainning.dto.IndicacaoInstrutorDTO)3 MatriculaDTO (com.tomasio.projects.trainning.dto.MatriculaDTO)3 TurmaPlanejadaDTO (com.tomasio.projects.trainning.dto.TurmaPlanejadaDTO)3 IOException (java.io.IOException)3 SimpleDateFormat (java.text.SimpleDateFormat)3