Commit 02710518de9a512227934b57e918c7bdbce8329a
1 parent
cdc1627c
Exists in
master
[Ajustes] Relatório de Validação de 17/11/2014
git-svn-id: https://svn.bento.ifrs.edu.br/default/ASES/e-selo@9974 c2178572-b5ca-4887-91d2-9e3a90c7d55b
Showing
3 changed files
with
145 additions
and
1 deletions
Show diff stats
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/parametroCalculo/errosAtivacao.jsp
0 → 100644
@@ -0,0 +1,114 @@ | @@ -0,0 +1,114 @@ | ||
1 | +<html> | ||
2 | +<bodY> | ||
3 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | ||
4 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | ||
5 | +<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%> | ||
6 | +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> | ||
7 | + | ||
8 | +<tiles:insertTemplate template="/WEB-INF/jsp/template/template.jsp"> | ||
9 | + <tiles:putAttribute name="body"> | ||
10 | + <a href="<c:url value="/parametrosCalculo"/>"><strong><span class="glyphicon glyphicon-check"></span> Parametros de Cálculo</strong></a> | ||
11 | + | ||
12 | + <hr /> | ||
13 | + | ||
14 | + <div class="row"> | ||
15 | + <div class="col-xs-12"> | ||
16 | + <div class="text-center"> | ||
17 | + <i class="fa fa-search-plus pull-left icon"></i> | ||
18 | + <h1>${parametroCalculo.descricao}</h1> | ||
19 | + </div> | ||
20 | + | ||
21 | + <hr /> | ||
22 | + </div> | ||
23 | + </div> | ||
24 | + | ||
25 | + <br/> | ||
26 | + <c:forEach var="error" items="${errors}"> | ||
27 | + <div class="alert alert-success alert-dismissable"> | ||
28 | + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | ||
29 | + ${error.message} | ||
30 | + </div> | ||
31 | + </c:forEach> | ||
32 | + | ||
33 | + <c:if test="${not empty mensagem}"> | ||
34 | + <div class="alert alert-success alert-dismissable"> | ||
35 | + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | ||
36 | + ${mensagem} | ||
37 | + </div> | ||
38 | + </c:if> | ||
39 | + | ||
40 | + | ||
41 | + <div class="row"> | ||
42 | + <div class="col-md-12"> | ||
43 | + <div class="panel panel-default"> | ||
44 | + <div class="panel-heading"> | ||
45 | + <h2 class="text-center">RECOMENDAÇÕES, CRITÉRIOS E FAIXAS</h2> | ||
46 | + </div> | ||
47 | + | ||
48 | + <div class="panel-body"> | ||
49 | + <c:choose> | ||
50 | + <c:when test="${empty recomendacaoList}"> | ||
51 | + <div class="table-responsive"> | ||
52 | + <table class="table table-condensed table-hover"> | ||
53 | + <tr> | ||
54 | + <td colspan="3"> | ||
55 | + <table id="criteriosTable" pagesize="10" class="table table-condensed table-hover"> | ||
56 | + <thead> | ||
57 | + <tr> | ||
58 | + <th class="text-left" colspan="6"> | ||
59 | + <div > | ||
60 | + <h3>Nenhuma recomendação cadastrada</h3> | ||
61 | + <a id="add-recomendacao" href="<c:url value="/recomendacao/novo/${parametroCalculo.id}" />" class="btn btn-default" onclick="return gravadoParametroCalculo();"><span class="glyphicon glyphicon-plus" ></span> Incluir Recomendação</a> | ||
62 | + </div> | ||
63 | + </th> | ||
64 | + </tr> | ||
65 | + </thead> | ||
66 | + <tbody> | ||
67 | + </tbody> | ||
68 | + </table> | ||
69 | + </td> | ||
70 | + </tr> | ||
71 | + </table> | ||
72 | + </div> | ||
73 | + | ||
74 | + </c:when> | ||
75 | + <c:when test="${not empty recomendacaoList}"> | ||
76 | + <c:forEach items="${recomendacaoList}" var="recomendacao"> | ||
77 | + <fieldset> | ||
78 | + <h3>Recomendação ${recomendacao.numeroRecomendacao}: ${recomendacao.descricao}</h3> | ||
79 | + <c:choose> | ||
80 | + <c:when test="${empty recomendacao.criterios}"> | ||
81 | + <div > | ||
82 | + <b>ERRO:</b> Nenhum critério cadastrado | ||
83 | + <a id="add-criterios" href="<c:url value="/criterio/novo/${recomendacao.id}" />" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-plus"></span> Incluir Critério</a> | ||
84 | + </div> | ||
85 | + </c:when> | ||
86 | + </c:choose> | ||
87 | + <c:choose> | ||
88 | + <c:when test="${not empty recomendacao.criterios}"> | ||
89 | + <ul> | ||
90 | + <c:forEach items="${recomendacao.criterios}" var="criterio"> | ||
91 | + <li> | ||
92 | + <div>Critério ${criterio.numeroCriterio}: ${criterio.descricao} (TIPO DECRESCENTE) | ||
93 | + <br/><b>ERRO:</b> Nenhuma faixa cadastrada | ||
94 | + <a id="add-criterios" href="<c:url value="/faixas/gerarForm/${criterio.id}/1" />" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-plus"></span> Incluir Faixas</a></div> | ||
95 | + <br/> | ||
96 | + </li> | ||
97 | + </c:forEach> | ||
98 | + </ul> | ||
99 | + </c:when> | ||
100 | + </c:choose> | ||
101 | + <hr /> | ||
102 | + </fieldset> | ||
103 | + </c:forEach> | ||
104 | + </c:when> | ||
105 | + </c:choose> | ||
106 | + </div> | ||
107 | + </div> | ||
108 | + </div> | ||
109 | + </div> | ||
110 | + | ||
111 | + </tiles:putAttribute> | ||
112 | +</tiles:insertTemplate> | ||
113 | +</bodY> | ||
114 | +</html> |
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/controller/ParametroCalculoController.java
@@ -161,7 +161,7 @@ public class ParametroCalculoController { | @@ -161,7 +161,7 @@ public class ParametroCalculoController { | ||
161 | ativarParametroCalculo(id); | 161 | ativarParametroCalculo(id); |
162 | result.redirectTo(ParametroCalculoController.class).lista(); | 162 | result.redirectTo(ParametroCalculoController.class).lista(); |
163 | }else{ | 163 | }else{ |
164 | - result.redirectTo(ParametroCalculoController.class).relatorio(id); | 164 | + result.redirectTo(ParametroCalculoController.class).errosAtivacao(id); |
165 | } | 165 | } |
166 | } | 166 | } |
167 | 167 | ||
@@ -349,6 +349,36 @@ public class ParametroCalculoController { | @@ -349,6 +349,36 @@ public class ParametroCalculoController { | ||
349 | return parametroCalculo; | 349 | return parametroCalculo; |
350 | } | 350 | } |
351 | 351 | ||
352 | + @Get("/parametrosCalculo/errosAtivacao/{id}") | ||
353 | + @Restrito(descricao = "PARAMETRO_CALCULO_RELATORIO") | ||
354 | + public ParametroCalculo errosAtivacao(Long id) { | ||
355 | + ParametroCalculo parametroCalculo = this.dao.load(id); | ||
356 | + result.include("usuarioList", dao.getAllUsuarios()); | ||
357 | + | ||
358 | + List<Recomendacao> recomendacaoList = new RecomendacaoDAO(dao.getSession()).listAllAtivas(parametroCalculo); | ||
359 | + List<Recomendacao> recomendacaoListErros = new ArrayList<Recomendacao>(); | ||
360 | + | ||
361 | + for(Recomendacao r: recomendacaoList){ | ||
362 | + if(r.getCriterios().size()<1){ | ||
363 | + recomendacaoListErros.add(r); | ||
364 | + }else{ | ||
365 | + List<Criterio> criterios = new ArrayList<Criterio>(); | ||
366 | + for(Criterio c: r.getCriterios()){ | ||
367 | + if(c.getTipoTeste().getId().intValue()==CriterioAvaliado.TIPO_DESCRESCENTE && c.getFaixas().size()<1){ | ||
368 | + criterios.add(c); | ||
369 | + } | ||
370 | + } | ||
371 | + r.setCriterios(criterios); | ||
372 | + recomendacaoListErros.add(r); | ||
373 | + } | ||
374 | + } | ||
375 | + | ||
376 | + | ||
377 | + result.include("recomendacaoList", recomendacaoListErros); | ||
378 | + | ||
379 | + return parametroCalculo; | ||
380 | + } | ||
381 | + | ||
352 | @Get("/parametroAtivo.xls") | 382 | @Get("/parametroAtivo.xls") |
353 | public File exportarAtivo(){ | 383 | public File exportarAtivo(){ |
354 | Long id = dao.getLastParametrosCalculoAtivo().getId(); | 384 | Long id = dao.getLastParametrosCalculoAtivo().getId(); |
Desenvolvimento/Codificacao/e-Selo/target/classes/br/com/eselo/controller/ParametroCalculoController.class
No preview for this file type