Search in sources :

Example 1 with OrganizacaoDTO

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

the class PlanosController method showIndex.

@RequestMapping({ "/", "/index", "" })
public String showIndex(Model model, WebRequest request) {
    PlanoDTO[] planos = trainningService.findAllPlanos();
    model.addAttribute("total", planos.length);
    // model.addAttribute("planos", planos);
    List dataList = new ArrayList();
    for (PlanoDTO plano : planos) {
        Map item = new HashMap();
        item.put("id", plano.getId());
        item.put("sigla", plano.getSigla());
        item.put("descricao", plano.getDescricao());
        Long omId = plano.getOMResponsavelId();
        if (omId != null) {
            OrganizacaoDTO om = organizationalService.findOrganizacao(omId);
            if (om != null) {
                item.put("omsigla", om.getSigla());
            } else {
                item.put("omsigla", "não informada");
            }
        } else {
            item.put("omsigla", "não informada");
        }
        dataList.add(item);
    }
    model.addAttribute("planos", dataList);
    return "plano_cadastro";
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) OrganizacaoDTO(com.tomasio.projects.trainning.dto.OrganizacaoDTO) HashMap(java.util.HashMap) Map(java.util.Map) PlanoDTO(com.tomasio.projects.trainning.dto.PlanoDTO) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with OrganizacaoDTO

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

the class PlanosController method showDetails.

@RequestMapping("/detail")
public String showDetails(Model model, WebRequest request) {
    String planoId = request.getParameter("planoId");
    PlanoDTO plano = trainningService.findPlano(Long.parseLong(planoId));
    // List dataList = new ArrayList();
    // dataList.add(data)
    Long omId = plano.getOMResponsavelId();
    Map item = new HashMap();
    item.put("id", plano.getId());
    if (omId != null) {
        OrganizacaoDTO om = organizationalService.findOrganizacao(omId);
        item.put("omsigla", om.getSigla());
    }
    item.put("sigla", plano.getSigla());
    item.put("descricao", plano.getDescricao());
    model.addAttribute("item", item);
    return "plano_cadastro/detail";
}
Also used : HashMap(java.util.HashMap) OrganizacaoDTO(com.tomasio.projects.trainning.dto.OrganizacaoDTO) HashMap(java.util.HashMap) Map(java.util.Map) PlanoDTO(com.tomasio.projects.trainning.dto.PlanoDTO) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with OrganizacaoDTO

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

the class PlanejamentosController method editSolicitacao.

@RequestMapping("/edit_planejamento")
public String editSolicitacao(Model model, WebRequest request) {
    SimpleDateFormat df = new SimpleDateFormat("yyyy");
    PlanejamentoDTO dto = planningService.findPlanejamento(Long.parseLong(request.getParameter("planejamentoId")));
    OrganizacaoDTO[] organizacoes = organizationalService.findAllOrganizacoes();
    PlanejamentoForm form = new PlanejamentoForm();
    form.setDescricao(dto.getDescricao());
    form.setId(dto.getId());
    form.setOrganizacaoId(dto.getOrganizacao().getId());
    form.setExercicio(df.format(dto.getExercicio()));
    form.setOpenned(dto.isOpenned());
    model.addAttribute(form);
    model.addAttribute("organizacoes", organizacoes);
    return "form_planejamento";
}
Also used : OrganizacaoDTO(com.tomasio.projects.trainning.dto.OrganizacaoDTO) SimpleDateFormat(java.text.SimpleDateFormat) PlanejamentoForm(com.tomasio.projects.trainning.form.PlanejamentoForm) PlanejamentoDTO(com.tomasio.projects.trainning.dto.PlanejamentoDTO) ItemPlanejamentoDTO(com.tomasio.projects.trainning.dto.ItemPlanejamentoDTO) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 4 with OrganizacaoDTO

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

the class PlanejamentosController method detailSolicitacao.

@RequestMapping("/detail_planejamento")
public String detailSolicitacao(Model model, WebRequest request) {
    PlanejamentoDTO planejamento = planningService.findPlanejamento(Long.parseLong(request.getParameter("planejamentoId")));
    CursoDTO[] cursos = trainningService.findAllCursos(null, null, null, null);
    AreaDTO[] areas = trainningService.findAllAreas();
    OrganizacaoDTO[] organizacoes = organizationalService.findAllOrganizacoes();
    model.addAttribute("planejamento", planejamento);
    model.addAttribute("areas", areas);
    model.addAttribute("organizacoes", organizacoes);
    model.addAttribute("cursos", cursos);
    return "detail_planejamento";
}
Also used : CursoDTO(com.tomasio.projects.trainning.dto.CursoDTO) AreaDTO(com.tomasio.projects.trainning.dto.AreaDTO) ResponsavelAreaDTO(com.tomasio.projects.trainning.dto.ResponsavelAreaDTO) OrganizacaoDTO(com.tomasio.projects.trainning.dto.OrganizacaoDTO) PlanejamentoDTO(com.tomasio.projects.trainning.dto.PlanejamentoDTO) ItemPlanejamentoDTO(com.tomasio.projects.trainning.dto.ItemPlanejamentoDTO) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 5 with OrganizacaoDTO

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

the class TurmasEfetivasController method detailTurma.

@RequestMapping("/detail")
public String detailTurma(Model model, WebRequest request) {
    SimpleDateFormat dfYear = new SimpleDateFormat("yyyy");
    String turmaId = request.getParameter("turmaId");
    TurmaEfetivaDTO turma = atividadesEnsinoService.findTurmaEfetiva(Long.parseLong(turmaId));
    Map data = new HashMap();
    data.put("codigo", turma.getCurso().getCodigo());
    data.put("descricao", turma.getCurso().getDescricao());
    data.put("numero", turma.getNumeroTurma() + " / " + dfYear.format(turma.getExercicio()));
    OrganizacaoDTO responsavel = organizationalService.findOrganizacao(turma.getResponsavelId());
    data.put("responsavel", responsavel.getSigla());
    data.put("vagas", turma.getQuantidadeVagas());
    // turma.getOrganizacaoGestoraId()
    if (turma.getPeriodoIndicacao() != null) {
        data.put("inicioIndicacoes", turma.getPeriodoIndicacao().getDataInicioFormated());
        data.put("terminoIndicacoes", turma.getPeriodoIndicacao().getDataTerminoFormated());
    }
    data.put("processId", turma.getProcessId());
    data.put("taskId", null);
    TaskDTO[] tasks = tasksBPMService.findAllTasksByUser("fernandofot");
    for (TaskDTO task : tasks) {
        Long taskTurmaId = Long.parseLong(task.getTurmaId());
        if (taskTurmaId.equals(turma.getId())) {
            data.put("taskId", task.getId());
            break;
        }
    }
    data.put("dataInicio", turma.getDataInicioFormatted());
    data.put("dataTermino", turma.getDataTerminoFormatted());
    data.put("dataAtivacao", turma.getDataAtivacaoFormatted());
    data.put("local", turma.getLocal());
    // inserção de campos para exibição na tela
    data.put("extra", turma.isExtra());
    data.put("cancelado", turma.isCancelado());
    data.put("adiado", turma.isAdiado());
    data.put("restrictedIndicacoes", turma.isRestrictedIndicacoes());
    data.put("privatedIndicacoes", turma.isPrivatedIndicacoes());
    // responsabilidades
    OrganizacaoDTO resp = organizationalService.findOrganizacao(turma.getResponsavelId());
    data.put("responsavelSigla", resp.getSigla());
    OrganizacaoDTO respApre = organizationalService.findOrganizacao(turma.getResponsavelApresentacaoId());
    data.put("responsavelApresentacaoSigla", respApre.getSigla());
    OrganizacaoDTO respConc = organizationalService.findOrganizacao(turma.getResponsavelConclusaoId());
    data.put("responsavelConclusaoSigla", respConc.getSigla());
    OrganizacaoDTO respMat = organizationalService.findOrganizacao(turma.getResponsavelMatriculaId());
    data.put("responsavelMatriculaSigla", respMat.getSigla());
    OrganizacaoDTO respPreMat = organizationalService.findOrganizacao(turma.getResponsavelPreMatriculaId());
    data.put("responsavelPreMatriculaSigla", respPreMat.getSigla());
    OrganizacaoDTO respSel = organizationalService.findOrganizacao(turma.getResponsavelSelecaoId());
    data.put("responsavelSelecaoSigla", respSel.getSigla());
    data.put("bcaAtivacao", turma.getBCAAtivacao());
    data.put("bcaEncerramento", turma.getBCAEncerramento());
    data.put("dataBCAAtivacao", turma.getDataBCAAtivacaoFormatted());
    data.put("dataBCAEncerramento", turma.getDataBCAEncerramentoFormatted());
    model.addAttribute("data", data);
    model.addAttribute("turma", turma);
    model.addAttribute("tab", "detail");
    return "turmas_efetivas/detail";
}
Also used : TurmaEfetivaDTO(com.tomasio.projects.trainning.dto.TurmaEfetivaDTO) HashMap(java.util.HashMap) OrganizacaoDTO(com.tomasio.projects.trainning.dto.OrganizacaoDTO) SimpleDateFormat(java.text.SimpleDateFormat) Map(java.util.Map) HashMap(java.util.HashMap) TaskDTO(com.tomasio.projects.trainning.dto.TaskDTO) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

OrganizacaoDTO (com.tomasio.projects.trainning.dto.OrganizacaoDTO)150 CoreException (com.tomasio.projects.trainning.exeption.CoreException)54 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)52 ArrayList (java.util.ArrayList)41 HashMap (java.util.HashMap)39 TurmaEfetivaDTO (com.tomasio.projects.trainning.dto.TurmaEfetivaDTO)37 DAOException (com.tomasio.projects.trainning.exception.DAOException)37 Organizacao (com.tomasio.projects.trainning.model.Organizacao)35 Map (java.util.Map)35 Transactional (org.springframework.transaction.annotation.Transactional)35 PessoaDTO (com.tomasio.projects.trainning.dto.PessoaDTO)33 Date (java.util.Date)23 SimpleDateFormat (java.text.SimpleDateFormat)21 List (java.util.List)18 IndicacaoAlunoDTO (com.tomasio.projects.trainning.dto.IndicacaoAlunoDTO)17 FaseDTO (com.tomasio.projects.trainning.dto.FaseDTO)14 MatriculaDTO (com.tomasio.projects.trainning.dto.MatriculaDTO)14 CancelamentoMatriculaDTO (com.tomasio.projects.trainning.dto.CancelamentoMatriculaDTO)12 CustoDTO (com.tomasio.projects.trainning.dto.CustoDTO)12 IndicacaoDTO (com.tomasio.projects.trainning.dto.IndicacaoDTO)12