Commit a0096de0c68185d6e429ffd02816a8ff1cc16854
1 parent
352da7df
Exists in
master
git-svn-id: https://svn.bento.ifrs.edu.br/default/ASES/e-selo@9528 c2178572-b5ca…
…-4887-91d2-9e3a90c7d55b
Showing
7 changed files
with
157 additions
and
142 deletions
Show diff stats
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/tiposRecomendacao/form.jsp
... | ... | @@ -1,63 +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="/tiposRecomendacao" />"> | |
9 | - <strong><span class="glyphicon glyphicon-check"></span> Tipos de Teste</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="tipoRecomendacaoForm" class="form-horizontal" action="<c:url value="/tiposRecomendacao"/>" method="post"> | |
31 | - <fieldset> | |
32 | - <div class="form-group"> | |
33 | - <label for="inputDescricao" class="col-lg-2 control-label">Descrição</label> | |
34 | - <div class="col-lg-10"> | |
35 | - <input id="inputDescricao" name="tipoRecomendacao.descricao" type="text" class="form-control required" placeholder="Descrição" maxlength="100" value="${tipoRecomendacao.descricao}" /> | |
36 | - </div> | |
37 | - </div> | |
38 | - | |
39 | - <div class="form-group"> | |
40 | - <label for="inputValMaximoConformidade" class="col-lg-2 control-label">Valor Máximo</label> | |
41 | - <div class="col-xs-3"> | |
42 | - <input id="inputValMaximoConformidade" name="tipoRecomendacao.maximoConformidade" min="1" type="number" class="form-control number numeric required" placeholder="Valor Máximo" value="${tipoRecomendacao.maximoConformidade}" /> | |
43 | - </div> | |
44 | - </div> | |
45 | - | |
46 | - <c:if test="${tipoRecomendacao.id != null}"> | |
47 | - <input type="hidden" name="tipoRecomendacao.id" value="${tipoRecomendacao.id}" /> | |
48 | - <input type="hidden" name="_method" value="put" /> | |
49 | - </c:if> | |
50 | - | |
51 | - <div class="form-group"> | |
52 | - <div class="col-lg-10 col-lg-offset-2"> | |
53 | - <button class="btn btn-default btn-cancel">Cancelar</button> | |
54 | - <button type="submit" class="btn btn-primary">Salvar</button> | |
55 | - </div> | |
56 | - </div> | |
57 | - </fieldset> | |
58 | - </form> | |
59 | - </div> | |
60 | - </div> | |
61 | - <!--/row--> | |
62 | - </tiles:putAttribute> | |
63 | -</tiles:insertTemplate> | |
64 | 0 | \ No newline at end of file |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/tiposRecomendacao/lista.jsp
... | ... | @@ -1,58 +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="/tiposRecomendacao" />"><strong><span class="glyphicon glyphicon-check"></span> Tipos de Teste</strong></a> | |
9 | - | |
10 | - <a href="<c:url value="/tiposRecomendacao/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>Descrição</th> | |
37 | - <th> </th> | |
38 | - </tr> | |
39 | - </thead> | |
40 | - <tbody> | |
41 | - <c:forEach items="${tipoRecomendacaoList}" var="tipo"> | |
42 | - <tr> | |
43 | - <td>${tipo.descricao}</td> | |
44 | - <td> | |
45 | - <div class="btn-group"> | |
46 | - <a href="<c:url value="/tiposRecomendacao/${tipo.id}" />" class="btn btn-default btn-sm">Atualizar</a> | |
47 | - <a href="<c:url value="/tiposRecomendacao/delete/${tipo.id}" />" class="btn btn-default btn-sm btn-confirm" data-msg="Deseja realmente excluir o tipo de teste selecionado?">Excluir</a> | |
48 | - </div> | |
49 | - </td> | |
50 | - </tr> | |
51 | - </c:forEach> | |
52 | - </tbody> | |
53 | - </table> | |
54 | - </div> | |
55 | - </div> | |
56 | - </div> | |
57 | - </tiles:putAttribute> | |
58 | -</tiles:insertTemplate> | |
59 | 0 | \ No newline at end of file |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/tiposTeste/form.jsp
0 → 100644
... | ... | @@ -0,0 +1,70 @@ |
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="/tiposTeste" />"> | |
9 | + <strong><span class="glyphicon glyphicon-check"></span> Tipos de Teste</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="tipoRecomendacaoForm" class="form-horizontal" action="<c:url value="/tiposTeste"/>" method="post"> | |
31 | + <fieldset> | |
32 | + <div class="form-group"> | |
33 | + <label for="inputTipo" class="col-lg-2 control-label">Tipo</label> | |
34 | + <div class="col-lg-10"> | |
35 | + <input id="inputTipo" name="tipoTeste.tipo" type="text" class="form-control required" placeholder="Tipo" maxlength="100" value="${tipoTeste.tipo}" /> | |
36 | + </div> | |
37 | + </div> | |
38 | + | |
39 | + <div class="form-group"> | |
40 | + <label for="inputDescricao" class="col-lg-2 control-label">Descrição</label> | |
41 | + <div class="col-lg-10"> | |
42 | + <input id="inputDescricao" name="tipoTeste.descricao" type="text" class="form-control required" placeholder="Descrição" maxlength="100" value="${tipoTeste.descricao}" /> | |
43 | + </div> | |
44 | + </div> | |
45 | + | |
46 | + <div class="form-group"> | |
47 | + <label for="inputValMaximoConformidade" class="col-lg-2 control-label">Valor Máximo</label> | |
48 | + <div class="col-xs-3"> | |
49 | + <input id="inputValMaximoConformidade" name="tipoTeste.maximoTeste" min="1" type="number" class="form-control number numeric required" placeholder="Valor Máximo" value="${tipoTeste.maximoTeste}" /> | |
50 | + </div> | |
51 | + </div> | |
52 | + | |
53 | + <c:if test="${tipoTeste.id != null}"> | |
54 | + <input type="hidden" name="tipoTeste.id" value="${tipoTeste.id}" /> | |
55 | + <input type="hidden" name="_method" value="put" /> | |
56 | + </c:if> | |
57 | + | |
58 | + <div class="form-group"> | |
59 | + <div class="col-lg-10 col-lg-offset-2"> | |
60 | + <button class="btn btn-default btn-cancel">Cancelar</button> | |
61 | + <button type="submit" class="btn btn-primary">Salvar</button> | |
62 | + </div> | |
63 | + </div> | |
64 | + </fieldset> | |
65 | + </form> | |
66 | + </div> | |
67 | + </div> | |
68 | + <!--/row--> | |
69 | + </tiles:putAttribute> | |
70 | +</tiles:insertTemplate> | |
0 | 71 | \ No newline at end of file | ... | ... |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/tiposTeste/lista.jsp
0 → 100644
... | ... | @@ -0,0 +1,60 @@ |
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="/tiposTeste" />"><strong><span class="glyphicon glyphicon-check"></span> Tipos de Teste</strong></a> | |
9 | + | |
10 | + <a href="<c:url value="/tiposTeste/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>Tipo</th> | |
37 | + <th>Descrição</th> | |
38 | + <th> </th> | |
39 | + </tr> | |
40 | + </thead> | |
41 | + <tbody> | |
42 | + <c:forEach items="${tipoTesteList}" var="tipo"> | |
43 | + <tr> | |
44 | + <td>${tipo.tipo}</td> | |
45 | + <td>${tipo.descricao}</td> | |
46 | + <td> | |
47 | + <div class="btn-group"> | |
48 | + <a href="<c:url value="/tiposTeste/${tipo.id}" />" class="btn btn-default btn-sm">Atualizar</a> | |
49 | + <a href="<c:url value="/tiposTeste/delete/${tipo.id}" />" class="btn btn-default btn-sm btn-confirm" data-msg="Deseja realmente excluir o tipo de teste selecionado?">Excluir</a> | |
50 | + </div> | |
51 | + </td> | |
52 | + </tr> | |
53 | + </c:forEach> | |
54 | + </tbody> | |
55 | + </table> | |
56 | + </div> | |
57 | + </div> | |
58 | + </div> | |
59 | + </tiles:putAttribute> | |
60 | +</tiles:insertTemplate> | |
0 | 61 | \ No newline at end of file | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/component/messages.properties
... | ... | @@ -13,11 +13,12 @@ tipo_conformidade.validacao.maximo=É necessário informar o valor máximo do Tipo |
13 | 13 | tipo_conformidade.validacao.maximo.min=É necessário informar o valor máximo do Tipo de Diretriz. |
14 | 14 | tipo_conformidade.validacao.edit=O Tipo de Diretriz não pode ser alterado, pois ele está sendo utilizado. |
15 | 15 | tipo_conformidade.validacao.remove=O Tipo de Diretriz não pode ser excluído, pois ele está sendo utilizado. |
16 | -tipo_recomendacao.mensagem.salva=Tipo de Recomendação salvo com sucesso. | |
17 | -tipo_recomendacao.mensagem.alterada=Tipo de Recomendação alterado com sucesso. | |
18 | -tipo_recomendacao.validacao.descricao=É necessário informar a descrição do Tipo de Recomendação. | |
19 | -tipo_recomendacao.validacao.descricao.unique=Já existe uma descrição com este nome para o Tipo de Recomendação. | |
20 | -tipo_recomendacao.validacao.maximo=É necessário informar o valor máximo do Tipo de Recomendação. | |
21 | -tipo_recomendacao.validacao.maximo.min=É necessário informar o valor máximo do Tipo de Recomendação. | |
22 | -tipo_recomendacao.validacao.edit=O Tipo de Recomendação não pode ser alterado, pois ele está sendo utilizado. | |
23 | -tipo_recomendacao.validacao.remove=O Tipo de Recomendação não pode ser excluído, pois ele está sendo utilizado. | |
24 | 16 | \ No newline at end of file |
17 | +tipo_recomendacao.mensagem.salva=Tipo de Teste salvo com sucesso. | |
18 | +tipo_recomendacao.mensagem.alterada=Tipo de Teste alterado com sucesso. | |
19 | +tipo_recomendacao.validacao.tipo=É necessário informar o nome do Tipo de Teste. | |
20 | +tipo_recomendacao.validacao.descricao=É necessário informar a descrição do Tipo de Teste. | |
21 | +tipo_recomendacao.validacao.descricao.unique=Já existe uma descrição com este nome para o Tipo de Teste. | |
22 | +tipo_recomendacao.validacao.maximo=É necessário informar o valor máximo do Tipo de Teste. | |
23 | +tipo_recomendacao.validacao.maximo.min=É necessário informar o valor máximo do Tipo de Teste. | |
24 | +tipo_recomendacao.validacao.edit=O Tipo de Teste não pode ser alterado, pois ele está sendo utilizado. | |
25 | +tipo_recomendacao.validacao.remove=O Tipo de Teste não pode ser excluído, pois ele está sendo utilizado. | |
25 | 26 | \ No newline at end of file | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/controller/TiposTesteController.java
... | ... | @@ -79,8 +79,9 @@ public class TiposTesteController { |
79 | 79 | validator.onErrorUsePageOf(TiposTesteController.class).form( |
80 | 80 | tipoTeste.getId()); |
81 | 81 | |
82 | + tipoTesteCadastrada.setTipo(tipoTeste.getTipo()); | |
82 | 83 | tipoTesteCadastrada.setDescricao(tipoTeste.getDescricao()); |
83 | - //tipoTesteCadastrada.setMaximoConformidade(tipoTeste.getMaximoConformidade()); | |
84 | + tipoTesteCadastrada.setMaximoTeste(tipoTeste.getMaximoTeste()); | |
84 | 85 | |
85 | 86 | dao.saveOrUpdate(tipoTesteCadastrada); |
86 | 87 | |
... | ... | @@ -107,15 +108,19 @@ public class TiposTesteController { |
107 | 108 | |
108 | 109 | dao.remove(id); |
109 | 110 | |
110 | - result.include("mensagem", "Tipo de Recomendação excluído com sucesso."); | |
111 | + result.include("mensagem", "Tipo de Teste excluído com sucesso."); | |
111 | 112 | result.redirectTo(TiposTesteController.class).lista(); |
112 | 113 | } |
113 | 114 | |
114 | 115 | private void validarTipoConformidade(TipoTeste tipoTeste) { |
115 | - if (tipoTeste.getDescricao() == null) { | |
116 | + if (tipoTeste.getTipo() == null) { | |
117 | + validator.add(new ValidationMessage(Messages | |
118 | + .getString("tipo_recomendacao.validacao.tipo"), | |
119 | + "tipoTeste.tipo")); | |
120 | + } else if (tipoTeste.getDescricao() == null) { | |
116 | 121 | validator.add(new ValidationMessage(Messages |
117 | 122 | .getString("tipo_recomendacao.validacao.descricao"), |
118 | - "tipoRecomendacao.descricao")); | |
123 | + "tipoTeste.descricao")); | |
119 | 124 | } else if (dao.existeTipo(tipoTeste)) { |
120 | 125 | Long id = dao.getIdByDescricao(tipoTeste.getDescricao()); |
121 | 126 | |
... | ... | @@ -124,7 +129,7 @@ public class TiposTesteController { |
124 | 129 | validator |
125 | 130 | .add(new ValidationMessage( |
126 | 131 | Messages.getString("tipo_recomendacao.validacao.descricao.unique"), |
127 | - "tipoRecomendacao.descricao")); | |
132 | + "tipoTeste.descricao")); | |
128 | 133 | } |
129 | 134 | } |
130 | 135 | /* | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/model/TipoTeste.java
... | ... | @@ -18,14 +18,6 @@ public class TipoTeste{ |
18 | 18 | @Column(name = "id_tipo_teste", columnDefinition = "serial", unique = true, nullable = false) |
19 | 19 | private Long id; |
20 | 20 | |
21 | - public String getTipo() { | |
22 | - return tipo; | |
23 | - } | |
24 | - | |
25 | - public void setTipo(String tipo) { | |
26 | - this.tipo = tipo; | |
27 | - } | |
28 | - | |
29 | 21 | @Column(name = "ds_tipo", unique = true, nullable = false) |
30 | 22 | private String tipo; |
31 | 23 | |
... | ... | @@ -42,6 +34,14 @@ public class TipoTeste{ |
42 | 34 | public void setId(Long id) { |
43 | 35 | this.id = id; |
44 | 36 | } |
37 | + | |
38 | + public String getTipo() { | |
39 | + return tipo; | |
40 | + } | |
41 | + | |
42 | + public void setTipo(String tipo) { | |
43 | + this.tipo = tipo; | |
44 | + } | |
45 | 45 | |
46 | 46 | public String getDescricao() { |
47 | 47 | return descricao; | ... | ... |