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";
}
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";
}
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";
}
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";
}
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";
}
Aggregations