use of com.tomasio.projects.trainning.dto.TaskDTO in project trainning by fernandotomasio.
the class TasksController method listTasksAjax.
@RequestMapping("/ajax")
@ResponseBody
public List listTasksAjax(Model model, WebRequest request) {
List result = new ArrayList();
String user = request.getParameter("userLogin");
TaskDTO[] tasks = tasksBPMService.findAllTasksByUser(user);
for (TaskDTO task : tasks) {
Map item = new HashMap();
item.put("nome", task.getNome());
item.put("descricao", task.getDescricao());
item.put("id", task.getId());
item.put("turmaId", task.getTurmaId());
result.add(item);
}
return result;
}
use of com.tomasio.projects.trainning.dto.TaskDTO 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";
}
use of com.tomasio.projects.trainning.dto.TaskDTO in project trainning by fernandotomasio.
the class TasksBPMServiceActivitiImpl method findAllTasksByUser.
@Override
public TaskDTO[] findAllTasksByUser(String user) {
List<Task> tasks = taskService.createTaskQuery().taskAssignee(user).list();
TaskDTO[] tasksArray = new TaskDTO[tasks.size()];
for (int i = 0; i < tasksArray.length; i++) {
Task task = tasks.get(i);
TaskDTO taskDTO = new TaskDTO();
String processInstanceId = task.getProcessInstanceId();
taskDTO.setNome(task.getName() + "(" + runtimeService.getVariable(processInstanceId, "instanceDefinition") + ")");
taskDTO.setTurmaId((String) runtimeService.getVariable(processInstanceId, "turmaId"));
taskDTO.setDescricao(task.getDescription());
taskDTO.setId(task.getId());
taskDTO.setFlowURL((String) runtimeService.getVariable(processInstanceId, "flowURL"));
tasksArray[i] = taskDTO;
}
return tasksArray;
}
use of com.tomasio.projects.trainning.dto.TaskDTO in project trainning by fernandotomasio.
the class TasksController method index.
@RequestMapping({ "/", "/index", "" })
public String index(Model model, @ModelAttribute("userLogin") String userLogin, WebRequest request) {
List result = new ArrayList();
TaskDTO[] tasks = tasksBPMService.findAllTasksByUser(userLogin);
for (TaskDTO task : tasks) {
Map item = new HashMap();
item.put("nome", task.getNome());
item.put("descricao", task.getDescricao());
item.put("id", task.getId());
item.put("flow_url", task.getFlowURL());
item.put("turmaId", task.getTurmaId());
result.add(item);
}
model.addAttribute("items", result);
return "tasks";
}
Aggregations