Commit a7268eee53438dd7af60239783dd9a12c8da72fd
1 parent
302f0123
Exists in
master
[Ajustes] Revisão na Base Zerada #3781
git-svn-id: https://svn.bento.ifrs.edu.br/default/ASES/e-selo@10150 c2178572-b5ca-4887-91d2-9e3a90c7d55b
Showing
11 changed files
with
27 additions
and
23 deletions
Show diff stats
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/parametroCalculo/relatorio.jsp
... | ... | @@ -134,7 +134,7 @@ |
134 | 134 | </td> |
135 | 135 | </tr> |
136 | 136 | </c:if> |
137 | - <c:if test="${criterio.tipoTeste.id==3 and empty criterio.faixas}"> passei | |
137 | + <c:if test="${criterio.tipoTeste.id==3 and empty criterio.faixas}"> | |
138 | 138 | <tr> |
139 | 139 | <td colspan="3"> |
140 | 140 | <table id="criteriosTable" pagesize="10" class="table table-condensed table-hover"> | ... | ... |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/recomendacao/form.jsp
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | |
10 | 10 | <hr /> |
11 | 11 | |
12 | - <h3>Cadastro de Recomendaçãos</h3> | |
12 | + <h3>Cadastro de Recomendações</h3> | |
13 | 13 | <br/><br/> |
14 | 14 | |
15 | 15 | <c:forEach var="error" items="${errors}"> |
... | ... | @@ -85,7 +85,10 @@ |
85 | 85 | <div class="btn-group"> |
86 | 86 | <a href="<c:url value="/criterio/form/${criterio.id}" />" class="btn btn-default btn-sm">Consultar</a> |
87 | 87 | <c:if test="${not empty parametroCalculo.avaliacoes}"> |
88 | - <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 poderá ser criado a partir do atual. Deseja realmente excluir o critério selecionado?">Excluir</a> | |
88 | + <a href="<c:url value="/criterio/delete/${recomendacao.id}" />" class="btn btn-default btn-sm btn-confirm" data-msg="Um novo Parâmetro de Cálculo poderá ser criado a partir do atual. Deseja realmente excluir o critério selecionado?">Excluir</a> | |
89 | + </c:if> | |
90 | + <c:if test="${empty parametroCalculo.avaliacoes}"> | |
91 | + <a href="<c:url value="/criterio/delete/${recomendacao.id}" />" class="btn btn-default btn-sm btn-confirm" data-msg="Deseja realmente excluir o critério selecionada?">Excluir</a> | |
89 | 92 | </c:if> |
90 | 93 | </div> |
91 | 94 | </td> | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/controller/CriteriosController.java
... | ... | @@ -279,10 +279,6 @@ public class CriteriosController { |
279 | 279 | validator.add(new ValidationMessage( |
280 | 280 | Messages.getString("criterio.validacao.descricao"), |
281 | 281 | "criteiro.descricao")); |
282 | - }else if (criterio.getRequisito() == null) { | |
283 | - validator.add(new ValidationMessage( | |
284 | - Messages.getString("criterio.validacao.requisto"), | |
285 | - "criteiro.requisto")); | |
286 | 282 | }else if (criterio.getTipoTeste().getId() == null) { |
287 | 283 | validator.add(new ValidationMessage( |
288 | 284 | Messages.getString("criterio.validacao.tipo_teste"), | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/controller/ParametroCalculoController.java
... | ... | @@ -150,15 +150,15 @@ public class ParametroCalculoController { |
150 | 150 | @Restrito(descricao = "PARAMETRO_CALCULO_ATIVAR") |
151 | 151 | public void ativar(Long id) { |
152 | 152 | |
153 | - ParametroCalculo pc = dao.load(id); | |
154 | - | |
155 | - if(validarParametroCalculoAtivacao(pc)){ | |
156 | - ativarParametroCalculo(id); | |
157 | - result.redirectTo(ParametroCalculoController.class).lista(); | |
158 | - }else{ | |
159 | - result.redirectTo(ParametroCalculoController.class).errosAtivacao(id); | |
160 | - } | |
153 | + ParametroCalculo pc = dao.load(id); | |
154 | + | |
155 | + if(validarParametroCalculoAtivacao(pc)){ | |
156 | + ativarParametroCalculo(id); | |
157 | + result.redirectTo(ParametroCalculoController.class).lista(); | |
158 | + }else{ | |
159 | + result.redirectTo(ParametroCalculoController.class).errosAtivacao(id); | |
161 | 160 | } |
161 | + } | |
162 | 162 | |
163 | 163 | @Path("/parametrosCalculo/delete/{id}") |
164 | 164 | @Restrito(descricao = "PARAMETRO_CALCULO_EXCLUIR") |
... | ... | @@ -355,21 +355,26 @@ public class ParametroCalculoController { |
355 | 355 | ParametroCalculo parametroCalculo = this.dao.load(id); |
356 | 356 | result.include("usuarioList", dao.getAllUsuarios()); |
357 | 357 | |
358 | - List<Recomendacao> recomendacaoList = new RecomendacaoDAO(dao.getSession()).listAllAtivas(parametroCalculo); | |
358 | + | |
359 | + List<Recomendacao> recomendacaoList = parametroCalculo.getRecomendacoes(); | |
359 | 360 | List<Recomendacao> recomendacaoListErros = new ArrayList<Recomendacao>(); |
360 | 361 | |
361 | 362 | for(Recomendacao r: recomendacaoList){ |
362 | 363 | if(r.getCriterios().size()<1){ |
363 | 364 | recomendacaoListErros.add(r); |
364 | 365 | }else{ |
366 | + boolean add = false; | |
365 | 367 | List<Criterio> criterios = new ArrayList<Criterio>(); |
366 | 368 | for(Criterio c: r.getCriterios()){ |
367 | 369 | if(c.getTipoTeste().getId().intValue()==CriterioAvaliado.TIPO_DESCRESCENTE && c.getFaixas().size()<1){ |
368 | 370 | criterios.add(c); |
371 | + add = true; | |
369 | 372 | } |
370 | 373 | } |
371 | - r.setCriterios(criterios); | |
372 | - recomendacaoListErros.add(r); | |
374 | + if(add){ | |
375 | + r.setCriterios(criterios); | |
376 | + recomendacaoListErros.add(r); | |
377 | + } | |
373 | 378 | } |
374 | 379 | } |
375 | 380 | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/model/Criterio.java
... | ... | @@ -74,7 +74,7 @@ public class Criterio { |
74 | 74 | @Column(name = "lo_erro", nullable = false) |
75 | 75 | private boolean erro; |
76 | 76 | |
77 | - @Column(name = "ds_requisito", nullable = false) | |
77 | + @Column(name = "ds_requisito", nullable = true) | |
78 | 78 | private String requisito; |
79 | 79 | |
80 | 80 | public Long getId() { | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/resources/hibernate.cfg.xml
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | <hibernate-configuration> |
8 | 8 | <session-factory> |
9 | 9 | <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property> |
10 | - <property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/eselo2</property> | |
10 | + <property name="hibernate.connection.url">jdbc:postgresql://127.0.0.1:5432/eselo2</property> | |
11 | 11 | <property name="hibernate.connection.driver_class">org.postgresql.Driver</property> |
12 | 12 | <property name="hibernate.connection.username">postgres</property> |
13 | 13 | <property name="hibernate.connection.password">postgres</property> | ... | ... |
Desenvolvimento/Codificacao/e-Selo/target/classes/br/com/eselo/controller/CriteriosController.class
No preview for this file type
Desenvolvimento/Codificacao/e-Selo/target/classes/br/com/eselo/controller/ParametroCalculoController.class
No preview for this file type
Desenvolvimento/Codificacao/e-Selo/target/classes/br/com/eselo/model/Criterio.class
No preview for this file type
Desenvolvimento/Codificacao/e-Selo/target/classes/hibernate.cfg.xml
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | <hibernate-configuration> |
8 | 8 | <session-factory> |
9 | 9 | <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property> |
10 | - <property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/eselo2</property> | |
10 | + <property name="hibernate.connection.url">jdbc:postgresql://127.0.0.1:5432/eselo2</property> | |
11 | 11 | <property name="hibernate.connection.driver_class">org.postgresql.Driver</property> |
12 | 12 | <property name="hibernate.connection.username">postgres</property> |
13 | 13 | <property name="hibernate.connection.password">postgres</property> | ... | ... |