Commit 3cc2ebd41c859a7b9bf7be6371d2bbee8336fb16
1 parent
fceeea11
Exists in
master
Codificação #2721: Arrumar o Layout do Protótipo
git-svn-id: https://svn.bento.ifrs.edu.br/default/ASES/e-selo@9546 c2178572-b5ca-4887-91d2-9e3a90c7d55b
Showing
15 changed files
with
486 additions
and
271 deletions
Show diff stats
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/conformidades/form.jsp
... | ... | @@ -30,7 +30,7 @@ |
30 | 30 | <form name="conformidadesForm" class="form-horizontal" action="<c:url value="/conformidades"/>" method="post"> |
31 | 31 | <fieldset> |
32 | 32 | |
33 | - <input type="hidden" name="conformidade.diretriz.id" value="${diretrizId}" /> | |
33 | + <input type="hidden" name="conformidade.criterio.id" value="${criterioId}" /> | |
34 | 34 | |
35 | 35 | <div class="form-group"> |
36 | 36 | <label for="inputFaixaInicio" class="col-lg-2 control-label">Faixa Inicial</label> | ... | ... |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/criterios/form.jsp
0 → 100644
... | ... | @@ -0,0 +1,120 @@ |
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" | |
2 | + pageEncoding="UTF-8"%> | |
3 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | |
4 | +<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%> | |
5 | + | |
6 | +<tiles:insertTemplate template="/WEB-INF/jsp/template/template.jsp"> | |
7 | + <tiles:putAttribute name="body"> | |
8 | + <a href="<c:url value="/parametrosAvaliacao/atualizar/${parametroAvaliacao.id}"/>"><strong><span class="glyphicon glyphicon-check"></span> Parametros de Cálculo</strong></a> | |
9 | + | |
10 | + <hr /> | |
11 | + | |
12 | + <h4>Cadastro de Critério</h4> | |
13 | + | |
14 | + <c:forEach var="error" items="${errors}"> | |
15 | + <div class="alert alert-success alert-dismissable"> | |
16 | + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
17 | + ${error.message} | |
18 | + </div> | |
19 | + </c:forEach> | |
20 | + | |
21 | + <c:if test="${not empty mensagem}"> | |
22 | + <div class="alert alert-success alert-dismissable"> | |
23 | + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
24 | + ${mensagem} | |
25 | + </div> | |
26 | + </c:if> | |
27 | + | |
28 | + <div class="row"> | |
29 | + <div class="col-md-12"> | |
30 | + <form name="diretrizForm" class="form-horizontal" action="<c:url value="/recomendacao"/>" method="post"> | |
31 | + <fieldset> | |
32 | + <div class="form-group"> | |
33 | + <label for="inputPeso" class="col-lg-2 control-label">Peso</label> | |
34 | + <div class="col-xs-3"> | |
35 | + <input id="inputPeso" name="criterio.peso" type="number" class="form-control numeric" placeholder="Peso" value="${criterio.peso}" min="0" > | |
36 | + </div> | |
37 | + </div> | |
38 | + | |
39 | + <div class="form-group"> | |
40 | + <label for="selectTipoTeste" class="col-lg-2 control-label">Tipo de Teste</label> | |
41 | + <div class="col-lg-10"> | |
42 | + <select id="selectTipoConformidade" class="form-control required" name="criterio.tipoTeste.id"> | |
43 | + <option value>Selecione</option> | |
44 | + <c:forEach items="${tipoTesteList}" var="tipoTeste"> | |
45 | + <c:choose> | |
46 | + <c:when test="${criterio.tipoTeste.id == tipoTeste.id}"> | |
47 | + <option value="${tipoTeste.id}" selected>${tipoTeste.tipo}</option> | |
48 | + </c:when> | |
49 | + <c:otherwise> | |
50 | + <option value="${tipoTeste.id}">${tipoTeste.tipo}</option> | |
51 | + </c:otherwise> | |
52 | + </c:choose> | |
53 | + </c:forEach> | |
54 | + </select> | |
55 | + </div> | |
56 | + </div> | |
57 | + | |
58 | + <c:if test="${criterio.id != null}"> | |
59 | + | |
60 | + <c:if test="${parametroAvaliacao.tsFim == null}"> | |
61 | + <div class="form-group"> | |
62 | + <a id="add-criterios" href="<c:url value="/conformidades/gerarForm/${criterio.id}/${criterio.recomendacao.tipoRecomendacao.maximoConformidade}" />" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-plus"></span> Incluir Faixas</a> | |
63 | + </div> | |
64 | + </c:if> | |
65 | + | |
66 | + <div class="form-group"> | |
67 | + <table id="criteriosTable" pagesize="10" class="table table-striped table-bordered table-hover table-condensed"> | |
68 | + <thead> | |
69 | + <tr> | |
70 | + <th class="text-center" colspan="3">Faixas</th> | |
71 | + </tr> | |
72 | + <tr> | |
73 | + <th>Faixa Inicial</th> | |
74 | + <th>Faixa Final</th> | |
75 | + <th> </th> | |
76 | + </tr> | |
77 | + </thead> | |
78 | + <tbody> | |
79 | + <c:forEach items="${criterio.faixas}" var="faixa"> | |
80 | + <tr> | |
81 | + <td>${faixa.faixaInicio}</td> | |
82 | + <td>${faixa.faixaFim}</td> | |
83 | + <td> | |
84 | + <div class="btn-group"> | |
85 | + <a href="<c:url value="/conformidades/form/${criterio.id}/${faixa.id}" />" class="btn btn-default btn-sm">Consultar</a> | |
86 | + <c:if test="${parametroAvaliacao.tsFim == null}"> | |
87 | + <a href="<c:url value="/conformidades/delete/${faixa.id}" />" class="btn btn-default btn-sm btn-confirm" data-msg="Deseja realmente excluir a faixa selecionado?">Excluir</a> | |
88 | + </c:if> | |
89 | + </div> | |
90 | + </td> | |
91 | + </tr> | |
92 | + </c:forEach> | |
93 | + </tbody> | |
94 | + </table> | |
95 | + </div> | |
96 | + </c:if> | |
97 | + | |
98 | + <div class="form-group"> | |
99 | + <input type="hidden" name="recomendacao.parametroAvaliacao.id" value="${parametroAvaliacao.id}" /> | |
100 | + <c:if test="${criterio.id != null}"> | |
101 | + <input type="hidden" name="criterio.id" value="${criterio.id}" /> | |
102 | + <input type="hidden" name="_method" value="put" /> | |
103 | + </c:if> | |
104 | + </div> | |
105 | + | |
106 | + <div class="form-group"> | |
107 | + <div class="col-lg-10 col-lg-offset-2"> | |
108 | + <button class="btn btn-default btn-cancel">Cancelar</button> | |
109 | + <c:if test="${parametroAvaliacao.tsFim == null}"> | |
110 | + <button type="submit" class="btn btn-primary">Salvar</button> | |
111 | + </c:if> | |
112 | + </div> | |
113 | + </div> | |
114 | + </fieldset> | |
115 | + </form> | |
116 | + </div> | |
117 | + </div> <!--/row--> | |
118 | + | |
119 | + </tiles:putAttribute> | |
120 | +</tiles:insertTemplate> | |
0 | 121 | \ No newline at end of file | ... | ... |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/faixa/add.jsp
0 → 100644
... | ... | @@ -0,0 +1,72 @@ |
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" | |
2 | + pageEncoding="UTF-8"%> | |
3 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | |
4 | +<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%> | |
5 | + | |
6 | +<tiles:insertTemplate template="/WEB-INF/jsp/template/template.jsp"> | |
7 | + <tiles:putAttribute name="body"> | |
8 | + <a href="<c:url value="/parametrosAvaliacao/atualizar/${parametroAvaliacao.id}"/>"><strong><span class="glyphicon glyphicon-check"></span> Parametros de Cálculo</strong></a> | |
9 | + | |
10 | + <hr /> | |
11 | + | |
12 | + <c:forEach var="error" items="${errors}"> | |
13 | + <div class="alert alert-success alert-dismissable"> | |
14 | + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
15 | + ${error.message} | |
16 | + </div> | |
17 | + </c:forEach> | |
18 | + | |
19 | + <c:if test="${not empty mensagem}"> | |
20 | + <div class="alert alert-success alert-dismissable"> | |
21 | + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
22 | + ${mensagem} | |
23 | + </div> | |
24 | + </c:if> | |
25 | + | |
26 | + <div class="row"> | |
27 | + <div class="col-md-12"> | |
28 | + <form id="form-add-conformidades" name="conformidadesForm" class="form-horizontal" action="<c:url value="/conformidades/add"/>" method="post" novalidate="novalidate"> | |
29 | + <fieldset> | |
30 | + | |
31 | + <c:forEach var="i" begin="1" end="${quantidadeConformidades}"> | |
32 | + <fieldset class="conformidade"> | |
33 | + <legend>Faixa ${i}</legend> | |
34 | + | |
35 | + <input type="hidden" name="conformidades[${i}].diretriz.id" value="${diretrizId}" /> | |
36 | + | |
37 | + <div class="form-group"> | |
38 | + <label class="col-lg-2 control-label">Valor Inicial</label> | |
39 | + <div class="col-xs-2"> | |
40 | + <input name="conformidades[${i}].faixaInicio" type="number" class="form-control required numeric faixaInicial" placeholder="Faixa Inicial" min="0" max="${diretriz.tipoDiretriz.maximoConformidade}" /> | |
41 | + </div> | |
42 | + </div> | |
43 | + | |
44 | + <div class="form-group"> | |
45 | + <label class="col-lg-2 control-label">Valor Final</label> | |
46 | + <div class="col-xs-2"> | |
47 | + <input name="conformidades[${i}].faixaFim" type="number" class="form-control required numeric faixaFinal" placeholder="Faixa Final" min="0" max="${diretriz.tipoDiretriz.maximoConformidade}" /> | |
48 | + </div> | |
49 | + </div> | |
50 | + </fieldset> | |
51 | + </c:forEach> | |
52 | + | |
53 | + <div class="form-group"> | |
54 | + <div class="col-lg-10 col-lg-offset-2"> | |
55 | + <button class="btn btn-default btn-cancel">Cancelar</button> | |
56 | + <c:if test="${parametroAvaliacao.tsFim == null}"> | |
57 | + <button type="submit" class="btn btn-primary">Salvar</button> | |
58 | + </c:if> | |
59 | + </div> | |
60 | + </div> | |
61 | + </fieldset> | |
62 | + </form> | |
63 | + </div> | |
64 | + </div> | |
65 | + | |
66 | + <script> | |
67 | + var quantidadeConformidades = ${quantidadeConformidades}; | |
68 | + var quantidadeMaximaDiretriz = ${diretriz.tipoDiretriz.maximoConformidade}; | |
69 | + </script> | |
70 | + </tiles:putAttribute> | |
71 | +</tiles:insertTemplate> | |
72 | + | ... | ... |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/faixa/form.jsp
0 → 100644
... | ... | @@ -0,0 +1,72 @@ |
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" | |
2 | + pageEncoding="UTF-8"%> | |
3 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | |
4 | +<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%> | |
5 | + | |
6 | +<tiles:insertTemplate template="/WEB-INF/jsp/template/template.jsp"> | |
7 | + <tiles:putAttribute name="body"> | |
8 | + <a href="<c:url value="/conformidades" />"> | |
9 | + <strong><span class="glyphicon glyphicon-list-alt"></span> Conformidades</strong> | |
10 | + </a> | |
11 | + | |
12 | + <hr /> | |
13 | + | |
14 | + <c:forEach var="error" items="${errors}"> | |
15 | + <div class="alert alert-success alert-dismissable"> | |
16 | + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
17 | + ${error.message} | |
18 | + </div> | |
19 | + </c:forEach> | |
20 | + | |
21 | + <c:if test="${not empty mensagem}"> | |
22 | + <div class="alert alert-success alert-dismissable"> | |
23 | + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
24 | + ${mensagem} | |
25 | + </div> | |
26 | + </c:if> | |
27 | + | |
28 | + <div class="row"> | |
29 | + <div class="col-md-12"> | |
30 | + <form name="conformidadesForm" class="form-horizontal" action="<c:url value="/conformidades"/>" method="post"> | |
31 | + <fieldset> | |
32 | + | |
33 | + <input type="hidden" name="conformidade.diretriz.id" value="${diretrizId}" /> | |
34 | + | |
35 | + <div class="form-group"> | |
36 | + <label for="inputFaixaInicio" class="col-lg-2 control-label">Faixa Inicial</label> | |
37 | + <div class="col-xs-2"> | |
38 | + <input id="inputFaixaInicio" name="conformidade.faixaInicio" type="text" class="form-control required number" placeholder="Faixa Inicial" value="${conformidade.faixaInicio}" min="0" /> | |
39 | + </div> | |
40 | + </div> | |
41 | + | |
42 | + <div class="form-group"> | |
43 | + <label for="inputFaixaFim" class="col-lg-2 control-label">Faixa Final</label> | |
44 | + <div class="col-xs-2"> | |
45 | + <input id="inputFaixaFim" name="conformidade.faixaFim" type="text" class="form-control required number" placeholder="Faixa Final" value="${conformidade.faixaFim}" min="0" /> | |
46 | + </div> | |
47 | + </div> | |
48 | + | |
49 | + <c:if test="${conformidade.id != null}"> | |
50 | + <input type="hidden" name="conformidade.id" value="${conformidade.id}" /> | |
51 | + <input type="hidden" name="_method" value="put" /> | |
52 | + </c:if> | |
53 | + | |
54 | + <div class="form-group"> | |
55 | + <div class="col-lg-10 col-lg-offset-2"> | |
56 | + <button class="btn btn-default btn-cancel">Cancelar</button> | |
57 | + <c:if test="${parametroAvaliacao.tsFim == null}"> | |
58 | + <button type="submit" class="btn btn-primary">Salvar</button> | |
59 | + </c:if> | |
60 | + </div> | |
61 | + </div> | |
62 | + </fieldset> | |
63 | + </form> | |
64 | + </div> | |
65 | + </div> | |
66 | + | |
67 | + <script> | |
68 | + var quantidadeConformidades = ${quantidadeConformidades}; | |
69 | + </script> | |
70 | + </tiles:putAttribute> | |
71 | +</tiles:insertTemplate> | |
72 | + | ... | ... |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/faixa/lista.jsp
0 → 100644
... | ... | @@ -0,0 +1,62 @@ |
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" | |
2 | + pageEncoding="UTF-8"%> | |
3 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | |
4 | +<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%> | |
5 | + | |
6 | +<tiles:insertTemplate template="/WEB-INF/jsp/template/template.jsp"> | |
7 | + <tiles:putAttribute name="body"> | |
8 | + <a href="<c:url value="/conformidades" />"><strong><span class="glyphicon glyphicon-list-alt"></span> Conformidades</strong></a> | |
9 | + | |
10 | + <a href="<c:url value="/conformidades/form" />" class="btn btn-default pull-right"><span class="glyphicon glyphicon-plus"></span> Incluir</a> | |
11 | + | |
12 | + <br /> | |
13 | + | |
14 | + <hr /> | |
15 | + | |
16 | + <c:forEach var="error" items="${errors}"> | |
17 | + <div class="alert alert-success alert-dismissable"> | |
18 | + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
19 | + ${error.message} | |
20 | + </div> | |
21 | + </c:forEach> | |
22 | + | |
23 | + <c:if test="${not empty mensagem}"> | |
24 | + <div class="alert alert-success alert-dismissable"> | |
25 | + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
26 | + ${mensagem} | |
27 | + </div> | |
28 | + </c:if> | |
29 | + | |
30 | + <div class="row"> | |
31 | + <div class="col-md-12"> | |
32 | + <div class="table-responsive"> | |
33 | + <table id="gruposTable" pagesize="10" class="table table-striped table-bordered table-hover table-condensed"> | |
34 | + <thead> | |
35 | + <tr> | |
36 | + <th>Diretriz</th> | |
37 | + <th>Faixa Inicial</th> | |
38 | + <th>Faixa Final</th> | |
39 | + <th> </th> | |
40 | + </tr> | |
41 | + </thead> | |
42 | + <tbody> | |
43 | + <c:forEach items="${conformidadeList}" var="conformidade"> | |
44 | + <tr> | |
45 | + <td>${conformidade.diretriz.descricao}</td> | |
46 | + <td>${conformidade.faixaInicio}</td> | |
47 | + <td>${conformidade.faixaFim}</td> | |
48 | + <td> | |
49 | + <div class="btn-group"> | |
50 | + <a href="<c:url value="/conformidades/${conformidade.id}" />" class="btn btn-default btn-sm">Atualizar</a> | |
51 | + <a href="<c:url value="/conformidades/delete/${conformidade.id}" />" class="btn btn-default btn-sm btn-confirm" data-msg="Deseja realmente excluir a conformidade selecionado?">Excluir</a> | |
52 | + </div> | |
53 | + </td> | |
54 | + </tr> | |
55 | + </c:forEach> | |
56 | + </tbody> | |
57 | + </table> | |
58 | + </div> | |
59 | + </div> | |
60 | + </div> | |
61 | + </tiles:putAttribute> | |
62 | +</tiles:insertTemplate> | |
0 | 63 | \ No newline at end of file | ... | ... |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/faixas/add.jsp
... | ... | @@ -1,74 +0,0 @@ |
1 | -<%@ page language="java" contentType="text/html; charset=UTF-8" | |
2 | - pageEncoding="UTF-8"%> | |
3 | -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | |
4 | -<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%> | |
5 | - | |
6 | -<tiles:insertTemplate template="/WEB-INF/jsp/template/template.jsp"> | |
7 | - <tiles:putAttribute name="body"> | |
8 | - <a href="<c:url value="/conformidades" />"> | |
9 | - <strong><span class="glyphicon glyphicon-list-alt"></span> Conformidades</strong> | |
10 | - </a> | |
11 | - | |
12 | - <hr /> | |
13 | - | |
14 | - <c:forEach var="error" items="${errors}"> | |
15 | - <div class="alert alert-success alert-dismissable"> | |
16 | - <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
17 | - ${error.message} | |
18 | - </div> | |
19 | - </c:forEach> | |
20 | - | |
21 | - <c:if test="${not empty mensagem}"> | |
22 | - <div class="alert alert-success alert-dismissable"> | |
23 | - <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
24 | - ${mensagem} | |
25 | - </div> | |
26 | - </c:if> | |
27 | - | |
28 | - <div class="row"> | |
29 | - <div class="col-md-12"> | |
30 | - <form id="form-add-conformidades" name="conformidadesForm" class="form-horizontal" action="<c:url value="/conformidades/add"/>" method="post" novalidate="novalidate"> | |
31 | - <fieldset> | |
32 | - | |
33 | - <c:forEach var="i" begin="1" end="${quantidadeConformidades}"> | |
34 | - <fieldset class="conformidade"> | |
35 | - <legend>Conformidade ${i}</legend> | |
36 | - | |
37 | - <input type="hidden" name="conformidades[${i}].diretriz.id" value="${diretrizId}" /> | |
38 | - | |
39 | - <div class="form-group"> | |
40 | - <label class="col-lg-2 control-label">Faixa Inicial</label> | |
41 | - <div class="col-xs-2"> | |
42 | - <input name="conformidades[${i}].faixaInicio" type="number" class="form-control required numeric faixaInicial" placeholder="Faixa Inicial" min="0" max="${diretriz.tipoDiretriz.maximoConformidade}" /> | |
43 | - </div> | |
44 | - </div> | |
45 | - | |
46 | - <div class="form-group"> | |
47 | - <label class="col-lg-2 control-label">Faixa Final</label> | |
48 | - <div class="col-xs-2"> | |
49 | - <input name="conformidades[${i}].faixaFim" type="number" class="form-control required numeric faixaFinal" placeholder="Faixa Final" min="0" max="${diretriz.tipoDiretriz.maximoConformidade}" /> | |
50 | - </div> | |
51 | - </div> | |
52 | - </fieldset> | |
53 | - </c:forEach> | |
54 | - | |
55 | - <div class="form-group"> | |
56 | - <div class="col-lg-10 col-lg-offset-2"> | |
57 | - <button class="btn btn-default btn-cancel">Cancelar</button> | |
58 | - <c:if test="${parametroAvaliacao.tsFim == null}"> | |
59 | - <button type="submit" class="btn btn-primary">Salvar</button> | |
60 | - </c:if> | |
61 | - </div> | |
62 | - </div> | |
63 | - </fieldset> | |
64 | - </form> | |
65 | - </div> | |
66 | - </div> | |
67 | - | |
68 | - <script> | |
69 | - var quantidadeConformidades = ${quantidadeConformidades}; | |
70 | - var quantidadeMaximaDiretriz = ${diretriz.tipoDiretriz.maximoConformidade}; | |
71 | - </script> | |
72 | - </tiles:putAttribute> | |
73 | -</tiles:insertTemplate> | |
74 | - |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/faixas/form.jsp
... | ... | @@ -1,72 +0,0 @@ |
1 | -<%@ page language="java" contentType="text/html; charset=UTF-8" | |
2 | - pageEncoding="UTF-8"%> | |
3 | -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | |
4 | -<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%> | |
5 | - | |
6 | -<tiles:insertTemplate template="/WEB-INF/jsp/template/template.jsp"> | |
7 | - <tiles:putAttribute name="body"> | |
8 | - <a href="<c:url value="/conformidades" />"> | |
9 | - <strong><span class="glyphicon glyphicon-list-alt"></span> Conformidades</strong> | |
10 | - </a> | |
11 | - | |
12 | - <hr /> | |
13 | - | |
14 | - <c:forEach var="error" items="${errors}"> | |
15 | - <div class="alert alert-success alert-dismissable"> | |
16 | - <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
17 | - ${error.message} | |
18 | - </div> | |
19 | - </c:forEach> | |
20 | - | |
21 | - <c:if test="${not empty mensagem}"> | |
22 | - <div class="alert alert-success alert-dismissable"> | |
23 | - <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
24 | - ${mensagem} | |
25 | - </div> | |
26 | - </c:if> | |
27 | - | |
28 | - <div class="row"> | |
29 | - <div class="col-md-12"> | |
30 | - <form name="conformidadesForm" class="form-horizontal" action="<c:url value="/conformidades"/>" method="post"> | |
31 | - <fieldset> | |
32 | - | |
33 | - <input type="hidden" name="conformidade.diretriz.id" value="${diretrizId}" /> | |
34 | - | |
35 | - <div class="form-group"> | |
36 | - <label for="inputFaixaInicio" class="col-lg-2 control-label">Faixa Inicial</label> | |
37 | - <div class="col-xs-2"> | |
38 | - <input id="inputFaixaInicio" name="conformidade.faixaInicio" type="text" class="form-control required number" placeholder="Faixa Inicial" value="${conformidade.faixaInicio}" min="0" /> | |
39 | - </div> | |
40 | - </div> | |
41 | - | |
42 | - <div class="form-group"> | |
43 | - <label for="inputFaixaFim" class="col-lg-2 control-label">Faixa Final</label> | |
44 | - <div class="col-xs-2"> | |
45 | - <input id="inputFaixaFim" name="conformidade.faixaFim" type="text" class="form-control required number" placeholder="Faixa Final" value="${conformidade.faixaFim}" min="0" /> | |
46 | - </div> | |
47 | - </div> | |
48 | - | |
49 | - <c:if test="${conformidade.id != null}"> | |
50 | - <input type="hidden" name="conformidade.id" value="${conformidade.id}" /> | |
51 | - <input type="hidden" name="_method" value="put" /> | |
52 | - </c:if> | |
53 | - | |
54 | - <div class="form-group"> | |
55 | - <div class="col-lg-10 col-lg-offset-2"> | |
56 | - <button class="btn btn-default btn-cancel">Cancelar</button> | |
57 | - <c:if test="${parametroAvaliacao.tsFim == null}"> | |
58 | - <button type="submit" class="btn btn-primary">Salvar</button> | |
59 | - </c:if> | |
60 | - </div> | |
61 | - </div> | |
62 | - </fieldset> | |
63 | - </form> | |
64 | - </div> | |
65 | - </div> | |
66 | - | |
67 | - <script> | |
68 | - var quantidadeConformidades = ${quantidadeConformidades}; | |
69 | - </script> | |
70 | - </tiles:putAttribute> | |
71 | -</tiles:insertTemplate> | |
72 | - |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/faixas/lista.jsp
... | ... | @@ -1,62 +0,0 @@ |
1 | -<%@ page language="java" contentType="text/html; charset=UTF-8" | |
2 | - pageEncoding="UTF-8"%> | |
3 | -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | |
4 | -<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%> | |
5 | - | |
6 | -<tiles:insertTemplate template="/WEB-INF/jsp/template/template.jsp"> | |
7 | - <tiles:putAttribute name="body"> | |
8 | - <a href="<c:url value="/conformidades" />"><strong><span class="glyphicon glyphicon-list-alt"></span> Conformidades</strong></a> | |
9 | - | |
10 | - <a href="<c:url value="/conformidades/form" />" class="btn btn-default pull-right"><span class="glyphicon glyphicon-plus"></span> Incluir</a> | |
11 | - | |
12 | - <br /> | |
13 | - | |
14 | - <hr /> | |
15 | - | |
16 | - <c:forEach var="error" items="${errors}"> | |
17 | - <div class="alert alert-success alert-dismissable"> | |
18 | - <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
19 | - ${error.message} | |
20 | - </div> | |
21 | - </c:forEach> | |
22 | - | |
23 | - <c:if test="${not empty mensagem}"> | |
24 | - <div class="alert alert-success alert-dismissable"> | |
25 | - <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
26 | - ${mensagem} | |
27 | - </div> | |
28 | - </c:if> | |
29 | - | |
30 | - <div class="row"> | |
31 | - <div class="col-md-12"> | |
32 | - <div class="table-responsive"> | |
33 | - <table id="gruposTable" pagesize="10" class="table table-striped table-bordered table-hover table-condensed"> | |
34 | - <thead> | |
35 | - <tr> | |
36 | - <th>Diretriz</th> | |
37 | - <th>Faixa Inicial</th> | |
38 | - <th>Faixa Final</th> | |
39 | - <th> </th> | |
40 | - </tr> | |
41 | - </thead> | |
42 | - <tbody> | |
43 | - <c:forEach items="${conformidadeList}" var="conformidade"> | |
44 | - <tr> | |
45 | - <td>${conformidade.diretriz.descricao}</td> | |
46 | - <td>${conformidade.faixaInicio}</td> | |
47 | - <td>${conformidade.faixaFim}</td> | |
48 | - <td> | |
49 | - <div class="btn-group"> | |
50 | - <a href="<c:url value="/conformidades/${conformidade.id}" />" class="btn btn-default btn-sm">Atualizar</a> | |
51 | - <a href="<c:url value="/conformidades/delete/${conformidade.id}" />" class="btn btn-default btn-sm btn-confirm" data-msg="Deseja realmente excluir a conformidade selecionado?">Excluir</a> | |
52 | - </div> | |
53 | - </td> | |
54 | - </tr> | |
55 | - </c:forEach> | |
56 | - </tbody> | |
57 | - </table> | |
58 | - </div> | |
59 | - </div> | |
60 | - </div> | |
61 | - </tiles:putAttribute> | |
62 | -</tiles:insertTemplate> | |
63 | 0 | \ No newline at end of file |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/parametroAvaliacao/form.jsp
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 | |
6 | 6 | <tiles:insertTemplate template="/WEB-INF/jsp/template/template.jsp"> |
7 | 7 | <tiles:putAttribute name="body"> |
8 | - <a href="<c:url value="/parametrosAvaliacao"/>"><strong><span class="glyphicon glyphicon-check"></span> Parametros de Avaliação</strong></a> | |
8 | + <a href="<c:url value="/parametrosAvaliacao"/>"><strong><span class="glyphicon glyphicon-check"></span> Parametros de Cálculo</strong></a> | |
9 | 9 | |
10 | 10 | <hr /> |
11 | 11 | |
... | ... | @@ -53,7 +53,7 @@ |
53 | 53 | |
54 | 54 | <c:if test="${parametroAvaliacao.tsFim == null}"> |
55 | 55 | <div class="form-group"> |
56 | - <a href="<c:url value="/diretriz/form/${parametroAvaliacao.id}" />" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-plus"></span> Incluir Diretriz</a> | |
56 | + <a href="<c:url value="/recomendacao/form/${parametroAvaliacao.id}" />" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-plus"></span> Incluir Recomendação</a> | |
57 | 57 | </div> |
58 | 58 | </c:if> |
59 | 59 | |
... | ... | @@ -61,26 +61,28 @@ |
61 | 61 | <table id="diretrizTable" class="table table-striped table-bordered table-hover table-condensed"> |
62 | 62 | <thead> |
63 | 63 | <tr> |
64 | - <th class="text-center" colspan="4">Diretrizes</th> | |
64 | + <th class="text-center" colspan="5">Recomendações</th> | |
65 | 65 | </tr> |
66 | 66 | <tr> |
67 | 67 | <th>Número</th> |
68 | 68 | <th>Peso</th> |
69 | 69 | <th>Descrição</th> |
70 | + <th>Tipo</th> | |
70 | 71 | <th> </th> |
71 | 72 | </tr> |
72 | 73 | </thead> |
73 | 74 | <tbody> |
74 | - <c:forEach items="${parametroAvaliacao.diretrizes}" var="diretriz"> | |
75 | + <c:forEach items="${parametroAvaliacao.recomendacoes}" var="recomendacao"> | |
75 | 76 | <tr> |
76 | - <td><a href="<c:url value="/diretriz/form/${diretriz.parametroAvaliacao.id}/${diretriz.id}" />">${diretriz.numeroDiretriz}</a></td> | |
77 | - <td>${diretriz.peso}</td> | |
78 | - <td>${diretriz.descricao}</td> | |
77 | + <td><a href="<c:url value="/recomendacao/form/${recomendacao.parametroAvaliacao.id}/${recomendacao.id}" />">${recomendacao.numeroRecomendacao}</a></td> | |
78 | + <td>${recomendacao.peso}</td> | |
79 | + <td>${recomendacao.descricao}</td> | |
80 | + <td>${recomendacao.tipoRecomendacao.descricao}</td> | |
79 | 81 | <td width="30%"> |
80 | 82 | <div class="btn-group"> |
81 | - <a href="<c:url value="/diretriz/form/${diretriz.parametroAvaliacao.id}/${diretriz.id}" />" class="btn btn-default btn-sm">Consultar</a> | |
83 | + <a href="<c:url value="/recomendacao/form/${recomendacao.parametroAvaliacao.id}/${recomendacao.id}" />" class="btn btn-default btn-sm">Consultar</a> | |
82 | 84 | <c:if test="${parametroAvaliacao.tsFim == null}"> |
83 | - <a href="<c:url value="/diretriz/delete/${diretriz.id}" />" class="btn btn-default btn-sm btn-confirm" data-msg="Um novo Parâmetro de Avaliação será criado a partir do atual. Deseja realmente excluir a diretriz selecionada?">Excluir</a> | |
85 | + <a href="<c:url value="/recomendacao/delete/${recomendacao.id}" />" class="btn btn-default btn-sm btn-confirm" data-msg="Um novo Parâmetro de Cálculo será criado a partir do atual. Deseja realmente excluir a recomendação selecionada?">Excluir</a> | |
84 | 86 | </c:if> |
85 | 87 | </div> |
86 | 88 | </td> | ... | ... |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/parametroAvaliacao/lista.jsp
... | ... | @@ -5,11 +5,11 @@ |
5 | 5 | |
6 | 6 | <tiles:insertTemplate template="/WEB-INF/jsp/template/template.jsp"> |
7 | 7 | <tiles:putAttribute name="body"> |
8 | - <a href="<c:url value="/parametrosAvaliacao" />"><strong><span class="glyphicon glyphicon-check"></span> Parametros de Avaliação</strong></a> | |
8 | + <a href="<c:url value="/parametrosAvaliacao" />"><strong><span class="glyphicon glyphicon-check"></span> Parametros de Cálculo</strong></a> | |
9 | 9 | |
10 | 10 | <c:choose> |
11 | 11 | <c:when test="${ultimoParametro != null}"> |
12 | - <a href="<c:url value="/parametrosAvaliacao/atualizar/${ultimoParametro.id}" />" class="btn btn-default btn-confirm-modal pull-right"><span class="glyphicon glyphicon-plus"></span> Incluir Parametro de Avaliação</a> | |
12 | + <a href="<c:url value="/parametrosAvaliacao/atualizar/${ultimoParametro.id}" />" class="btn btn-default btn-confirm-modal pull-right"><span class="glyphicon glyphicon-plus"></span> Incluir Parametro de Cálculo</a> | |
13 | 13 | </c:when> |
14 | 14 | |
15 | 15 | <c:otherwise> | ... | ... |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/recomendacao/form.jsp
... | ... | @@ -5,11 +5,11 @@ |
5 | 5 | |
6 | 6 | <tiles:insertTemplate template="/WEB-INF/jsp/template/template.jsp"> |
7 | 7 | <tiles:putAttribute name="body"> |
8 | - <a href="<c:url value="/parametrosAvaliacao/atualizar/${parametroAvaliacaoId}"/>"><strong><span class="glyphicon glyphicon-check"></span> Parametros de Avaliação</strong></a> | |
8 | + <a href="<c:url value="/parametrosAvaliacao/atualizar/${parametroAvaliacaoId}"/>"><strong><span class="glyphicon glyphicon-check"></span> Parametros de Cálculo</strong></a> | |
9 | 9 | |
10 | 10 | <hr /> |
11 | 11 | |
12 | - <h4>Cadastro de Diretriz</h4> | |
12 | + <h4>Cadastro de Recomendação</h4> | |
13 | 13 | |
14 | 14 | <c:forEach var="error" items="${errors}"> |
15 | 15 | <div class="alert alert-success alert-dismissable"> |
... | ... | @@ -27,41 +27,41 @@ |
27 | 27 | |
28 | 28 | <div class="row"> |
29 | 29 | <div class="col-md-12"> |
30 | - <form name="diretrizForm" class="form-horizontal" action="<c:url value="/diretriz"/>" method="post"> | |
30 | + <form name="diretrizForm" class="form-horizontal" action="<c:url value="/recomendacao"/>" method="post"> | |
31 | 31 | <fieldset> |
32 | 32 | <div class="form-group"> |
33 | - <label for="inputNumero" class="col-lg-2 control-label">Número da Diretriz</label> | |
33 | + <label for="inputNumero" class="col-lg-2 control-label">Número da Recomendação</label> | |
34 | 34 | <div class="col-xs-3"> |
35 | - <input id="inputNumero" name="diretriz.numeroDiretriz" type="number" class="form-control numeric" placeholder="Número da Diretriz" min="0" value="${diretriz.numeroDiretriz}" > | |
35 | + <input id="inputNumero" name="recomendacao.numeroRecomendacao" type="number" class="form-control numeric" placeholder="Número da Recomendação" min="0" value="${recomendacao.numeroRecomendacao}" > | |
36 | 36 | </div> |
37 | 37 | </div> |
38 | 38 | |
39 | 39 | <div class="form-group"> |
40 | 40 | <label for="inputDesc" class="col-lg-2 control-label">Descrição</label> |
41 | 41 | <div class="col-lg-10"> |
42 | - <input id="inputDesc" name="diretriz.descricao" type="text" class="form-control" placeholder="Descrição" value="${diretriz.descricao}" > | |
42 | + <input id="inputDesc" name="recomendacao.descricao" type="text" class="form-control" placeholder="Descrição" value="${recomendacao.descricao}" > | |
43 | 43 | </div> |
44 | 44 | </div> |
45 | 45 | |
46 | 46 | <div class="form-group"> |
47 | 47 | <label for="inputPeso" class="col-lg-2 control-label">Peso</label> |
48 | 48 | <div class="col-xs-3"> |
49 | - <input id="inputPeso" name="diretriz.peso" type="number" class="form-control numeric" placeholder="Peso" value="${diretriz.peso}" min="0" > | |
49 | + <input id="inputPeso" name="recomendacao.peso" type="number" class="form-control numeric" placeholder="Peso" value="${recomendacao.peso}" min="0" > | |
50 | 50 | </div> |
51 | 51 | </div> |
52 | 52 | |
53 | 53 | <div class="form-group"> |
54 | - <label for="selectTipoConformidade" class="col-lg-2 control-label">Tipo de Diretriz</label> | |
54 | + <label for="selectTipoConformidade" class="col-lg-2 control-label">Tipo de Recomendação</label> | |
55 | 55 | <div class="col-lg-10"> |
56 | - <select id="selectTipoConformidade" class="form-control required" name="diretriz.tipoDiretriz.id"> | |
56 | + <select id="selectTipoConformidade" class="form-control required" name="recomendacao.tipoRecomendacao.id"> | |
57 | 57 | <option value>Selecione</option> |
58 | - <c:forEach items="${tipoDiretrizList}" var="tipoDiretriz"> | |
58 | + <c:forEach items="${tipoRecomendacaoList}" var="tipoRecomendacao"> | |
59 | 59 | <c:choose> |
60 | - <c:when test="${diretriz.tipoDiretriz.id == tipoDiretriz.id}"> | |
61 | - <option value="${tipoDiretriz.id}" selected>${tipoDiretriz.descricao}</option> | |
60 | + <c:when test="${recomendacao.tipoRecomendacao.id == tipoRecomendacao.id}"> | |
61 | + <option value="${tipoRecomendacao.id}" selected>${tipoRecomendacao.descricao}</option> | |
62 | 62 | </c:when> |
63 | 63 | <c:otherwise> |
64 | - <option value="${tipoDiretriz.id}">${tipoDiretriz.descricao}</option> | |
64 | + <option value="${tipoRecomendacao.id}">${tipoRecomendacao.descricao}</option> | |
65 | 65 | </c:otherwise> |
66 | 66 | </c:choose> |
67 | 67 | </c:forEach> |
... | ... | @@ -69,36 +69,36 @@ |
69 | 69 | </div> |
70 | 70 | </div> |
71 | 71 | |
72 | - <c:if test="${diretriz.id != null}"> | |
72 | + <c:if test="${recomendacao.id != null}"> | |
73 | 73 | |
74 | 74 | <c:if test="${parametroAvaliacao.tsFim == null}"> |
75 | 75 | <div class="form-group"> |
76 | - <a id="add-conformidades" href="<c:url value="/conformidades/${diretriz.id}" />" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-plus"></span> Incluir Conformidade</a> | |
76 | + <a id="add-criterios" href="<c:url value="/criterios/form/${recomendacao.id}" />" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-plus"></span> Incluir Critério</a> | |
77 | 77 | </div> |
78 | 78 | </c:if> |
79 | 79 | |
80 | 80 | <div class="form-group"> |
81 | - <table id="conformidadesTable" pagesize="10" class="table table-striped table-bordered table-hover table-condensed"> | |
81 | + <table id="criteriosTable" pagesize="10" class="table table-striped table-bordered table-hover table-condensed"> | |
82 | 82 | <thead> |
83 | 83 | <tr> |
84 | - <th class="text-center" colspan="3">Conformidades</th> | |
84 | + <th class="text-center" colspan="3">Critérios</th> | |
85 | 85 | </tr> |
86 | 86 | <tr> |
87 | - <th>Faixa Inicial</th> | |
88 | - <th>Faixa Final</th> | |
87 | + <th>Peso</th> | |
88 | + <th>Tipo de Teste</th> | |
89 | 89 | <th> </th> |
90 | 90 | </tr> |
91 | 91 | </thead> |
92 | 92 | <tbody> |
93 | - <c:forEach items="${diretriz.conformidades}" var="conformidade"> | |
93 | + <c:forEach items="${recomendacao.criterios}" var="criterio"> | |
94 | 94 | <tr> |
95 | - <td>${conformidade.faixaInicio}</td> | |
96 | - <td>${conformidade.faixaFim}</td> | |
95 | + <td>${criterio.peso}</td> | |
96 | + <td>${criterio.tipoTeste.tipo}</td> | |
97 | 97 | <td> |
98 | 98 | <div class="btn-group"> |
99 | - <a href="<c:url value="/conformidades/${diretriz.id}/${conformidade.id}" />" class="btn btn-default btn-sm">Consultar</a> | |
99 | + <a href="<c:url value="/criterios/form/${recomendacao.id}/${criterio.id}" />" class="btn btn-default btn-sm">Consultar</a> | |
100 | 100 | <c:if test="${parametroAvaliacao.tsFim == null}"> |
101 | - <a href="<c:url value="/conformidades/delete/${conformidade.id}" />" class="btn btn-default btn-sm btn-confirm" data-msg="Deseja realmente excluir a conformidade selecionado?">Excluir</a> | |
101 | + <a href="<c:url value="/criterios/delete/${conformidade.id}" />" class="btn btn-default btn-sm btn-confirm" data-msg="Deseja realmente excluir o critério selecionado?">Excluir</a> | |
102 | 102 | </c:if> |
103 | 103 | </div> |
104 | 104 | </td> |
... | ... | @@ -110,9 +110,9 @@ |
110 | 110 | </c:if> |
111 | 111 | |
112 | 112 | <div class="form-group"> |
113 | - <input type="hidden" name="diretriz.parametroAvaliacao.id" value="${parametroAvaliacaoId}" /> | |
114 | - <c:if test="${diretriz.id != null}"> | |
115 | - <input type="hidden" name="diretriz.id" value="${diretriz.id}" /> | |
113 | + <input type="hidden" name="recomendacao.parametroAvaliacao.id" value="${parametroAvaliacaoId}" /> | |
114 | + <c:if test="${recomendacao.id != null}"> | |
115 | + <input type="hidden" name="recomendacao.id" value="${recomendacao.id}" /> | |
116 | 116 | <input type="hidden" name="_method" value="put" /> |
117 | 117 | </c:if> |
118 | 118 | </div> |
... | ... | @@ -134,7 +134,7 @@ |
134 | 134 | <div class="modal-dialog modal-sm"> |
135 | 135 | <div class="modal-content"> |
136 | 136 | <div class="modal-body"> |
137 | - <p>Em quantas conformidades o valor máximo da diretriz deve ser dividido?</p> | |
137 | + <p>Em quantas conformidades o valor máximo da recomendação deve ser dividido?</p> | |
138 | 138 | |
139 | 139 | <div class="form-group"> |
140 | 140 | <div class="col-xs-3"> |
... | ... | @@ -151,7 +151,7 @@ |
151 | 151 | |
152 | 152 | <script> |
153 | 153 | var urlCadastroConformidades = "<c:url value="/conformidades/gerarForm" />"; |
154 | - var diretrizId = ${diretriz.id}; | |
154 | + var diretrizId = ${recomendacao.id}; | |
155 | 155 | </script> |
156 | 156 | </tiles:putAttribute> |
157 | 157 | </tiles:insertTemplate> |
158 | 158 | \ No newline at end of file | ... | ... |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/recomendacao/lista.jsp
... | ... | @@ -7,9 +7,9 @@ |
7 | 7 | |
8 | 8 | <tiles:insertTemplate template="/WEB-INF/jsp/template/template.jsp"> |
9 | 9 | <tiles:putAttribute name="body"> |
10 | - <a href="<c:url value="/diretriz" />"><strong><span class="glyphicon glyphicon-check"></span> Diretrizes</strong></a> | |
10 | + <a href="<c:url value="/diretriz" />"><strong><span class="glyphicon glyphicon-check"></span> Recomendações</strong></a> | |
11 | 11 | |
12 | - <a href="<c:url value="/diretriz/form/${parametroAvaliacaoId}" />" class="btn btn-default pull-right"><span class="glyphicon glyphicon-plus"></span> Incluir Diretriz</a> | |
12 | + <a href="<c:url value="/diretriz/form/${parametroAvaliacaoId}" />" class="btn btn-default pull-right"><span class="glyphicon glyphicon-plus"></span> Incluir Recomendação</a> | |
13 | 13 | |
14 | 14 | <br /> |
15 | 15 | |
... | ... | @@ -30,7 +30,7 @@ |
30 | 30 | <div class="row"> |
31 | 31 | <div class="col-md-12"> |
32 | 32 | <div class="table-responsive"> |
33 | - <p>Lista de diretrizes do Parametro de Avaliação válido a partir de | |
33 | + <p>Lista de recomendações do Parametro de Avaliação válido a partir de | |
34 | 34 | <b><fmt:formatDate pattern="dd/MM/yyyy HH:mm:ss" value="${parametroAvaliacao.tsInicio}" /></b> |
35 | 35 | , cadastrado por |
36 | 36 | <b>${parametroAvaliacao.usuario.nome}</b> | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/controller/CriteriosController.java
0 → 100644
... | ... | @@ -0,0 +1,50 @@ |
1 | +package br.com.eselo.controller; | |
2 | + | |
3 | +import br.com.caelum.vraptor.Get; | |
4 | +import br.com.caelum.vraptor.Resource; | |
5 | +import br.com.caelum.vraptor.Result; | |
6 | +import br.com.caelum.vraptor.Validator; | |
7 | +import br.com.eselo.annotations.Restrito; | |
8 | +import br.com.eselo.component.UsuarioWeb; | |
9 | +import br.com.eselo.dao.CriterioDAO; | |
10 | +import br.com.eselo.model.Criterio; | |
11 | + | |
12 | +@Resource | |
13 | +public class CriteriosController { | |
14 | + | |
15 | + private final CriterioDAO dao; | |
16 | + private final Result result; | |
17 | + private final Validator validator; | |
18 | + private final UsuarioWeb usuarioWeb; | |
19 | + | |
20 | + public CriteriosController(CriterioDAO _dao, Result _result, | |
21 | + Validator _validator, UsuarioWeb _usuarioWeb) { | |
22 | + this.dao = _dao; | |
23 | + this.result = _result; | |
24 | + this.validator = _validator; | |
25 | + this.usuarioWeb = _usuarioWeb; | |
26 | + } | |
27 | + | |
28 | + @Get("/criterios/form/{recomendacaoId}/{id}") | |
29 | + @Restrito(descricao = "CRITERIO_ATUALIZAR") | |
30 | + public Criterio form(Long recomendacaoId, Long id) { | |
31 | + Criterio criterio = dao.load(id); | |
32 | + result.include("recomendacaoId", recomendacaoId); | |
33 | + result.include("parametroAvaliacao", criterio.getRecomendacao().getParametroAvaliacao()); | |
34 | + populateSelectLists(); | |
35 | + | |
36 | + return criterio; | |
37 | + } | |
38 | + | |
39 | + @Get("/criterios/form/{recomendacaoId}") | |
40 | + @Restrito(descricao = "CRITERIO_ADICIONAR") | |
41 | + public void form(Long recomendacaoId) { | |
42 | + result.include("recomendacaoId", recomendacaoId); | |
43 | + populateSelectLists(); | |
44 | + } | |
45 | + | |
46 | + private void populateSelectLists() { | |
47 | + result.include("tipoTesteList", dao.getAllTipoTeste()); | |
48 | + } | |
49 | + | |
50 | +} | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/controller/FaixaController.java
... | ... | @@ -13,10 +13,12 @@ import br.com.caelum.vraptor.validator.ValidationMessage; |
13 | 13 | import br.com.eselo.annotations.Restrito; |
14 | 14 | import br.com.eselo.component.Messages; |
15 | 15 | import br.com.eselo.component.UsuarioWeb; |
16 | +import br.com.eselo.dao.CriterioDAO; | |
16 | 17 | import br.com.eselo.dao.FaixaDAO; |
17 | 18 | import br.com.eselo.dao.ParametroAvaliacaoDAO; |
18 | 19 | import br.com.eselo.dao.RecomendacaoDAO; |
19 | 20 | import br.com.eselo.dao.UsuarioDAO; |
21 | +import br.com.eselo.model.Criterio; | |
20 | 22 | import br.com.eselo.model.Faixa; |
21 | 23 | import br.com.eselo.model.ParametroAvaliacao; |
22 | 24 | import br.com.eselo.model.Recomendacao; |
... | ... | @@ -27,16 +29,18 @@ public class FaixaController { |
27 | 29 | |
28 | 30 | private final FaixaDAO dao; |
29 | 31 | private final RecomendacaoDAO daoRecomendacao; |
32 | + private final CriterioDAO daoCriterio; | |
30 | 33 | private final ParametroAvaliacaoDAO daoParametro; |
31 | 34 | private final Result result; |
32 | 35 | private final Validator validator; |
33 | 36 | private final UsuarioWeb usuarioWeb; |
34 | 37 | |
35 | 38 | public FaixaController(FaixaDAO _dao, |
36 | - RecomendacaoDAO _daoRecomendacao, ParametroAvaliacaoDAO _daoParametro, | |
39 | + RecomendacaoDAO _daoRecomendacao, CriterioDAO _daoCriterio, ParametroAvaliacaoDAO _daoParametro, | |
37 | 40 | Result _result, Validator _validator, UsuarioWeb _usuarioWeb) { |
38 | 41 | dao = _dao; |
39 | 42 | daoRecomendacao = _daoRecomendacao; |
43 | + daoCriterio = _daoCriterio; | |
40 | 44 | daoParametro = _daoParametro; |
41 | 45 | result = _result; |
42 | 46 | validator = _validator; |
... | ... | @@ -56,25 +60,26 @@ public class FaixaController { |
56 | 60 | result.forwardTo(this).add(diretrizId); |
57 | 61 | } |
58 | 62 | |
59 | - @Get("/conformidades/{recomendacaoId}/") | |
63 | + @Get("/conformidades/{criterioId}") | |
60 | 64 | @Restrito(descricao = "CONFORMIDADES_ADICIONAR") |
61 | - public void add(Long recomendacaoId) { | |
62 | - Recomendacao recomendacao = daoRecomendacao.load(recomendacaoId); | |
63 | - result.include("recomendacaoId", recomendacaoId); | |
64 | - result.include("recomendacao", recomendacao); | |
65 | + public void add(Long criterioId) { | |
66 | + Criterio criterio = daoCriterio.load(criterioId); | |
67 | + result.include("criterioId", criterioId); | |
68 | + result.include("criterio", criterio); | |
69 | + result.include("parametroAvaliacao", criterio.getRecomendacao().getParametroAvaliacao()); | |
65 | 70 | populateSelectLists(); |
66 | 71 | } |
67 | 72 | |
68 | - @Get("/conformidades/{recomendacaoId}/{id}") | |
73 | + @Get("/conformidades/{criterioId}/{id}") | |
69 | 74 | @Restrito(descricao = "CONFORMIDADES_ATUALIZAR") |
70 | - public Faixa form(Long recomendacaoId, Long id) { | |
75 | + public Faixa form(Long criterioId, Long id) { | |
71 | 76 | Faixa faixa = dao.load(id); |
72 | 77 | |
73 | - Recomendacao recomendacao = daoRecomendacao.load(recomendacaoId); | |
74 | - ParametroAvaliacao parametro = daoParametro.load(recomendacao | |
78 | + Criterio criterio = daoCriterio.load(criterioId); | |
79 | + ParametroAvaliacao parametro = daoParametro.load(criterio.getRecomendacao() | |
75 | 80 | .getParametroAvaliacao().getId()); |
76 | 81 | |
77 | - result.include("recomendacaoId", recomendacaoId); | |
82 | + result.include("criterioId", criterioId); | |
78 | 83 | result.include("parametroAvaliacao", parametro); |
79 | 84 | populateSelectLists(); |
80 | 85 | |
... | ... | @@ -84,9 +89,9 @@ public class FaixaController { |
84 | 89 | @Post("/conformidades/add") |
85 | 90 | @Restrito(descricao = "CONFORMIDADES_ADICIONAR") |
86 | 91 | public void adicionar(List<Faixa> conformidades) { |
87 | - Long recomendacaoId = null; | |
92 | + Long criterioId = null; | |
88 | 93 | for (Faixa conformidade : conformidades) { |
89 | - recomendacaoId = conformidade.getCriterio().getId(); | |
94 | + criterioId = conformidade.getCriterio().getId(); | |
90 | 95 | validarConformidade(conformidade); |
91 | 96 | |
92 | 97 | validator.onErrorUsePageOf(FaixaController.class).add( |
... | ... | @@ -95,12 +100,12 @@ public class FaixaController { |
95 | 100 | |
96 | 101 | dao.saveAll(conformidades); |
97 | 102 | |
98 | - Recomendacao recomendacao = daoRecomendacao.load(recomendacaoId); | |
103 | + Criterio criterio = daoCriterio.load(criterioId); | |
99 | 104 | |
100 | 105 | result.include("mensagem", |
101 | 106 | Messages.getString("conformidades.mensagem.salva")); |
102 | - result.redirectTo(RecomendacaoController.class).form( | |
103 | - recomendacao.getParametroAvaliacao().getId(), recomendacao.getId()); | |
107 | + result.redirectTo(CriteriosController.class).form( | |
108 | + criterio.getRecomendacao().getParametroAvaliacao().getId(), criterio.getId()); | |
104 | 109 | } |
105 | 110 | |
106 | 111 | @Put("/conformidades") |
... | ... | @@ -124,7 +129,7 @@ public class FaixaController { |
124 | 129 | .getLastParametrosAvaliacao(); |
125 | 130 | |
126 | 131 | Recomendacao recomendacao = daoRecomendacao |
127 | - .load(faixa.getCriterio().getId()); | |
132 | + .load(faixa.getCriterio().getRecomendacao().getId()); | |
128 | 133 | |
129 | 134 | if (daoRecomendacao.hasAvaliacao(ultimoParametroAvaliacao)) { |
130 | 135 | criarNovoParametroAvaliacao(recomendacao, faixa); |
... | ... | @@ -147,7 +152,7 @@ public class FaixaController { |
147 | 152 | .getLastParametrosAvaliacao(); |
148 | 153 | |
149 | 154 | Recomendacao recomendacao = daoRecomendacao |
150 | - .load(conformidade.getCriterio().getId()); | |
155 | + .load(conformidade.getCriterio().getRecomendacao().getId()); | |
151 | 156 | |
152 | 157 | if (daoRecomendacao.hasAvaliacao(ultimoParametroAvaliacao)) { |
153 | 158 | criarNovoParametroAvaliacao(recomendacao, conformidade); |
... | ... | @@ -232,7 +237,7 @@ public class FaixaController { |
232 | 237 | dao.save(faixa); |
233 | 238 | } |
234 | 239 | */ |
235 | - /* | |
240 | + | |
236 | 241 | for (Faixa conformidadeSalva : recomendacaoCadastrada |
237 | 242 | .getConformidades()) { |
238 | 243 | novaFaixa = new Faixa(); | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/dao/CriterioDAO.java
0 → 100644
... | ... | @@ -0,0 +1,40 @@ |
1 | +package br.com.eselo.dao; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +import org.hibernate.Session; | |
6 | +import org.hibernate.criterion.Order; | |
7 | +import org.hibernate.criterion.Restrictions; | |
8 | + | |
9 | +import br.com.caelum.vraptor.ioc.Component; | |
10 | +import br.com.eselo.model.Criterio; | |
11 | +import br.com.eselo.model.Recomendacao; | |
12 | + | |
13 | +@Component | |
14 | +public class CriterioDAO extends GenericDAO<Criterio> { | |
15 | + | |
16 | + public CriterioDAO(Session _session) { | |
17 | + super(_session); | |
18 | + } | |
19 | + | |
20 | + @SuppressWarnings("unchecked") | |
21 | + public List<Criterio> listAll() { | |
22 | + return getSession().createCriteria(getPersistentClass()) | |
23 | + .addOrder(Order.asc("id")).list(); | |
24 | + } | |
25 | + | |
26 | + @SuppressWarnings("unchecked") | |
27 | + public List<Criterio> listAllAtivas(Recomendacao recomendacao) { | |
28 | + return getSession().createCriteria(getPersistentClass()) | |
29 | + .add(Restrictions.eq("recomendacao", recomendacao)) | |
30 | + .addOrder(Order.asc("id")).list(); | |
31 | + } | |
32 | + | |
33 | + public Object getAllTipoTeste() { | |
34 | + TipoTesteDAO tipoTesteDao = (TipoTesteDAO) new TipoTesteDAO( | |
35 | + getSession()); | |
36 | + | |
37 | + return tipoTesteDao.listAll(); | |
38 | + } | |
39 | + | |
40 | +} | ... | ... |