Commit 08887e55b5be5152e2b159ca86ed622aba3b775b
1 parent
e2901154
Exists in
master
Melhoramento do painel de acessibilidade.
Showing
19 changed files
with
871 additions
and
35 deletions
Show diff stats
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/arquivosHtml/arquivosHtml.jsp
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/painelAcessibilidade/errosMaisComuns.jsp
0 → 100644
| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | +<%@taglib prefix="t" tagdir="/WEB-INF/tags"%> | |
| 2 | +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> | |
| 3 | +<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> | |
| 4 | +<%@page contentType="text/html" pageEncoding="UTF-8"%> | |
| 5 | +<t:baseLayout> | |
| 6 | + <jsp:body> | |
| 7 | + | |
| 8 | +${html} | |
| 9 | + | |
| 10 | +</jsp:body> | |
| 11 | +</t:baseLayout> | |
| 0 | 12 | \ No newline at end of file | ... | ... |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/painelAcessibilidade/mediaAvaliacao.jsp
| ... | ... | @@ -69,5 +69,45 @@ |
| 69 | 69 | <br> |
| 70 | 70 | </div> |
| 71 | 71 | </c:if> |
| 72 | + | |
| 73 | + <div class="avaliacao"> | |
| 74 | + <c:if test="${exibirTabelaRelatorio != false}"> | |
| 75 | + | |
| 76 | + <c:if test="${not empty lsRelatoriosFad}"> | |
| 77 | + <h2>Relatório Circunstantiado e Plano de Trabalho enviados ao Ministério do Planejamento e ao Ministério Público Federal.</h2> | |
| 78 | + | |
| 79 | + <hr> | |
| 80 | + <table> | |
| 81 | + <thead> | |
| 82 | + <tr> | |
| 83 | + <th id="nome">${tipo}</th> | |
| 84 | + <th id="relatorio" class="centralizado">Relatório Circunstanciado</th> | |
| 85 | + <th id="planoTrabalho" class="centralizado">Plano de trabalho</th> | |
| 86 | + </tr> | |
| 87 | + </thead> | |
| 88 | + <tbody> | |
| 89 | + <c:forEach items="${lsRelatoriosFad}" var="relatoriosFad"> | |
| 90 | + <tr> | |
| 91 | + <td headers="nome" class="celula">${relatoriosFad.no_unidade_plano } | |
| 92 | + | |
| 93 | + </td> | |
| 94 | + <td headers="relatorio" class="celula"><a href="${pageContext.request.contextPath}/painel-acessibilidade/${relatoriosFad.id }/fad">Download</a> | |
| 95 | + | |
| 96 | + </td> | |
| 97 | + <td headers="planoTrabalho" class="celula"><a href="${pageContext.request.contextPath}/painel-acessibilidade/${relatoriosFad.id }/plano">Download </a> | |
| 98 | + </td> | |
| 99 | + </tr> | |
| 100 | + </c:forEach> | |
| 101 | + | |
| 102 | + </tbody> | |
| 103 | + </table> | |
| 104 | + <br> | |
| 105 | + </c:if> | |
| 106 | + <c:if test="${empty lsRelatoriosFad}"> | |
| 107 | + <label class="fonteVermelha">Relatórios não recebidos pelo Ministério do Planejamento.</label> | |
| 108 | + </c:if> | |
| 109 | + </c:if> | |
| 110 | + </div> | |
| 111 | + | |
| 72 | 112 | </jsp:body> |
| 73 | 113 | </t:baseLayout> |
| 74 | 114 | \ No newline at end of file | ... | ... |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/jsp/painelAcessibilidade/painelAcessibilidade.jsp
| ... | ... | @@ -7,5 +7,59 @@ |
| 7 | 7 | |
| 8 | 8 | ${html} |
| 9 | 9 | |
| 10 | + <div class="avaliacao"> | |
| 11 | + <h2>Relatório Circunstanciado de Acessibilidade Digital</h2> | |
| 12 | + <br> | |
| 13 | + <c:if test="${not empty lsMediaAvaliacao}"> | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + <c:if test="${carregamento == 'orgao'}"> | |
| 18 | + <table> | |
| 19 | + <thead> | |
| 20 | + <tr> | |
| 21 | + <th id="nome">${tipo}</th> | |
| 22 | + <th id="total" class="centralizado">Total de ${nomeTotal}</th> | |
| 23 | + <th id="media" class="centralizado">Média</th> | |
| 24 | + </tr> | |
| 25 | + </thead> | |
| 26 | + <tbody> | |
| 27 | + <c:forEach items="${lsMediaAvaliacao}" var="mediaAvaliacao"> | |
| 28 | + <tr> | |
| 29 | + <td headers="nome" class="celula"> | |
| 30 | + <c:if test="${tipo == 'Páginas'}"> | |
| 31 | + | |
| 32 | + <c:set var = "stringLowerCase" value = "${fn:toLowerCase(mediaAvaliacao.nome)}" /> | |
| 33 | + <c:set var = "string1" value = "${fn:replace(stringLowerCase, 'http://', '')}"/> | |
| 34 | + <c:set var = "string2" value ="${fn:replace(string1, '/', '')}"/> | |
| 35 | + <c:set var = "string3" value ="${fn:replace(string2, '.', '')}"/> | |
| 36 | + <c:set var = "string4" value ="${fn:replace(string3, ' ', '')}"/> | |
| 37 | + <a href="http://eselo-prd.brazilsouth.cloudapp.azure.com:8080/arquivosHtml/${string4}.html">${mediaAvaliacao.nome }</a> | |
| 38 | + | |
| 39 | + </c:if> | |
| 40 | + <c:if test="${tipo != 'Páginas'}"> | |
| 41 | + <a href="${pageContext.request.contextPath}/media-avaliacao/${novoTipo }/${mediaAvaliacao.id}/${mediaAvaliacao.nome }/${mediaAvaliacao.media }">${mediaAvaliacao.nome }</a> | |
| 42 | + </c:if> | |
| 43 | + </td> | |
| 44 | + <td headers="total" class="celula centralizado"> | |
| 45 | + ${mediaAvaliacao.total } | |
| 46 | + </td> | |
| 47 | + | |
| 48 | + <td headers="media" class="celula centralizado"> | |
| 49 | + ${mediaAvaliacao.media } | |
| 50 | + </td> | |
| 51 | + </tr> | |
| 52 | + | |
| 53 | + </c:forEach> | |
| 54 | + | |
| 55 | + </tbody> | |
| 56 | + </table> | |
| 57 | + </c:if> | |
| 58 | + | |
| 59 | + <br> | |
| 60 | + | |
| 61 | + </c:if> | |
| 62 | + | |
| 63 | + | |
| 10 | 64 | </jsp:body> |
| 11 | 65 | </t:baseLayout> |
| 12 | 66 | \ No newline at end of file | ... | ... |
Desenvolvimento/Codificacao/e-Selo/WebContent/WEB-INF/tags/baseLayout.tag
| ... | ... | @@ -32,8 +32,8 @@ |
| 32 | 32 | </ul> |
| 33 | 33 | <br> <br> |
| 34 | 34 | <div id="logo"> |
| 35 | - <h1 id="portal-title-1">Painel de Acessibilidade Digital do | |
| 36 | - Governo</h1> | |
| 35 | + <h1 id="portal-title-1"><a href="${pageContext.request.contextPath}/painel-acessibilidade">Painel de Acessibilidade Digital do | |
| 36 | + Governo</a></h1> | |
| 37 | 37 | </div> |
| 38 | 38 | <div id="barra-brasil" class="barra_brasil"> |
| 39 | 39 | <ul id="menu-barra-temp"> |
| ... | ... | @@ -44,12 +44,22 @@ |
| 44 | 44 | Barra de Governo</a></li> |
| 45 | 45 | </ul> |
| 46 | 46 | </div> |
| 47 | - </div> | |
| 47 | + | |
| 48 | 48 | </header> |
| 49 | + </div> | |
| 50 | + <nav id="menu"> | |
| 51 | + <ul> | |
| 52 | + <li id="portalservicos-contato" class="portalservicos-item"> | |
| 53 | + <a href="${pageContext.request.contextPath}/media-avaliacao/orgao">Média Brasil</a><span> | </span> | |
| 54 | + </li><li id="portalservicosErrosMaisComuns" class="portalservicos-item"> | |
| 55 | + <a href="${pageContext.request.contextPath}/erros-mais-comuns">Erros mais comuns</a> | |
| 56 | + </li> | |
| 57 | + </ul> | |
| 58 | + </nav> | |
| 49 | 59 | <div class="contanner"> |
| 50 | 60 | |
| 51 | 61 | <a id="inicioConteudo" class="oculto">Início do Conteúdo</a> |
| 52 | - <h2>As verificações passíveis de verificação automática representam apenas 20% (vinte por cento) do conjunto de verificações necessárias.</h2> | |
| 62 | + <h2 id="alertaAvaliacaoAutomatica">As verificações passíveis de verificação automática representam apenas 20% (vinte por cento) do conjunto de verificações necessárias.</h2> | |
| 53 | 63 | <!-- <div class="avaliacao"> --> |
| 54 | 64 | <!-- Início Conteudo --> |
| 55 | 65 | |
| ... | ... | @@ -57,11 +67,23 @@ |
| 57 | 67 | |
| 58 | 68 | <!--Término Conteudo--> |
| 59 | 69 | <!-- </div>--> |
| 70 | + </div> | |
| 71 | + <div class="avaliacao ferramentas"> | |
| 72 | + <h2>Ferramentas para Promover a Acessibilidade Digital</h2> | |
| 73 | + <hr> | |
| 74 | + | |
| 75 | + <img class="ferramentasAcessibilidade" alt="Ases Web - validador automático de sites" src="${pageContext.request.contextPath}/static/img/ASESWEB.jpg"><a href="http://asesweb.governoeletronico.gov.br">Ases Web - validador automático de sites <img src="${pageContext.request.contextPath}/static/img/site-ext.gif" alt="Site Externo" /></a> | |
| 76 | + <br> | |
| 77 | + | |
| 78 | + <img class="ferramentasAcessibilidade" alt="Vlibras - tradutor automático de conteúdos para LIBRAS" src="${pageContext.request.contextPath}/static/img/vlibras.png"><a href="http://www.vlibras.gov.br/">Vlibras - tradutor automático de conteúdos para LIBRAS <img src="${pageContext.request.contextPath}/static/img/site-ext.gif" alt="Site Externo" /></a><br> | |
| 79 | + | |
| 80 | + <img class="ferramentasAcessibilidade" alt="Modelo de Acessibilidade em Governo Eletrônico - eMAG" src="${pageContext.request.contextPath}/static/img/emag.png"><a href="http://emag.governoeletronico.gov.br/">Modelo de Acessibilidade em Governo Eletrônico - eMAG <img src="${pageContext.request.contextPath}/static/img/site-ext.gif" alt="Site Externo" /></a><br><br> | |
| 81 | + </div> | |
| 60 | 82 | <a id="fimConteudo" class="oculto">Fim do Conteúdo</a> |
| 61 | 83 | <div id="voltar-topo"> |
| 62 | 84 | <a href="#topoPagina">Voltar para o topo</a> |
| 63 | 85 | </div> |
| 64 | - </div> | |
| 86 | + | |
| 65 | 87 | <footer id="footer-brasil"></footer> |
| 66 | 88 | <script defer="defer" src="//barra.brasil.gov.br/barra.js" type="text/javascript"></script> |
| 67 | 89 | <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery-1.10.2.min.js"></script> | ... | ... |
Desenvolvimento/Codificacao/e-Selo/WebContent/static/css/painelAcessibilidade.css
| ... | ... | @@ -12,6 +12,43 @@ body { |
| 12 | 12 | font-family: "Open Sans", Arial, Helvetica, sans-serif; |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | +.fonteVermelha{ | |
| 16 | +text-align: center; | |
| 17 | +color: #ff0000; | |
| 18 | +} | |
| 19 | + | |
| 20 | +#menu { | |
| 21 | + background: #0a5517; | |
| 22 | + padding-top: 1px; | |
| 23 | + padding-bottom: 1px; | |
| 24 | + font-family: Arial, Helvetica, sans-serif; | |
| 25 | + text-align: right; | |
| 26 | +} | |
| 27 | +#menu ul{ | |
| 28 | + | |
| 29 | + margin-right: 25%; | |
| 30 | +} | |
| 31 | + | |
| 32 | +#menu li{ | |
| 33 | + list-style: none; | |
| 34 | + text-align: right; | |
| 35 | + margin: 0 !important; | |
| 36 | + | |
| 37 | + } | |
| 38 | + | |
| 39 | +#menu ul li{ | |
| 40 | + display: inline; | |
| 41 | + color: #ffffff !important; | |
| 42 | +} | |
| 43 | + #menu ul li a{ | |
| 44 | + display: inline; | |
| 45 | + color: #ffffff !important; | |
| 46 | + margin: 0; | |
| 47 | +} | |
| 48 | + | |
| 49 | + h2#alertaAvaliacaoAutomatica { | |
| 50 | + margin-left: 0; | |
| 51 | +} | |
| 15 | 52 | |
| 16 | 53 | header { |
| 17 | 54 | width: 100%; |
| ... | ... | @@ -44,7 +81,7 @@ header { |
| 44 | 81 | |
| 45 | 82 | h2{ |
| 46 | 83 | font-size: 15px; |
| 47 | - margin: 0; | |
| 84 | + margin-left: 2.8em; | |
| 48 | 85 | } |
| 49 | 86 | |
| 50 | 87 | .oculto_visao { |
| ... | ... | @@ -54,7 +91,8 @@ h2{ |
| 54 | 91 | } |
| 55 | 92 | |
| 56 | 93 | a { |
| 57 | - text-decoration: none; | |
| 94 | + text-decoration: none; | |
| 95 | + margin-left: 0.8em; | |
| 58 | 96 | } |
| 59 | 97 | |
| 60 | 98 | #barra-brasil { |
| ... | ... | @@ -70,6 +108,18 @@ a { |
| 70 | 108 | padding: 0; |
| 71 | 109 | } |
| 72 | 110 | |
| 111 | +.ferramentasAcessibilidade | |
| 112 | +{ | |
| 113 | + height: 30px; | |
| 114 | + width: 30px; | |
| 115 | +} | |
| 116 | + | |
| 117 | +.ferramentas img | |
| 118 | +{ | |
| 119 | + margin-top: 0.8em; | |
| 120 | + margin-left: 1em; | |
| 121 | + padding-right: 0.5em; | |
| 122 | +} | |
| 73 | 123 | |
| 74 | 124 | #accessibility { |
| 75 | 125 | display: inline; |
| ... | ... | @@ -85,13 +135,16 @@ h1 { |
| 85 | 135 | padding-top: 50px; |
| 86 | 136 | } |
| 87 | 137 | |
| 138 | +h1 a { | |
| 139 | + color: #ffffff; | |
| 140 | +} | |
| 141 | + | |
| 88 | 142 | #accessibility li { |
| 89 | 143 | display: inline; |
| 90 | 144 | } |
| 91 | 145 | |
| 92 | 146 | #accessibility a { |
| 93 | 147 | color: #ffffff; |
| 94 | - font-size: 1.2em; | |
| 95 | 148 | padding-right: 10px; |
| 96 | 149 | font-family: Arial, Helvetica, sans-serif; |
| 97 | 150 | } |
| ... | ... | @@ -119,6 +172,7 @@ Table { |
| 119 | 172 | font-size: 0.9em; |
| 120 | 173 | } |
| 121 | 174 | |
| 175 | + | |
| 122 | 176 | #logo { |
| 123 | 177 | color: #ffffff !important; |
| 124 | 178 | padding: 0; |
| ... | ... | @@ -145,6 +199,7 @@ Table { |
| 145 | 199 | /*background: #97aeec;*/ |
| 146 | 200 | text-align: center; |
| 147 | 201 | float: left; |
| 202 | + font-size: 12px; | |
| 148 | 203 | } |
| 149 | 204 | |
| 150 | 205 | #grafico { |
| ... | ... | @@ -341,11 +396,7 @@ a.oculto { |
| 341 | 396 | margin-top: 2px; |
| 342 | 397 | } |
| 343 | 398 | |
| 344 | - #tituloTabela | |
| 345 | - { | |
| 346 | - margin-left: 10px !important; | |
| 347 | - } | |
| 348 | - | |
| 399 | + | |
| 349 | 400 | .mBrasil{ |
| 350 | 401 | margin-left: 20px; |
| 351 | 402 | } |
| ... | ... | @@ -385,7 +436,33 @@ a.oculto { |
| 385 | 436 | font-weight: normal; |
| 386 | 437 | font-family: "Open Sans", Arial, Helvetica, sans-serif; |
| 387 | 438 | } |
| 439 | +#menu { | |
| 440 | + background: #0a5517; | |
| 441 | + padding-top: 1px; | |
| 442 | + padding-bottom: 1px; | |
| 443 | + font-family: Arial, Helvetica, sans-serif; | |
| 444 | +} | |
| 388 | 445 | |
| 446 | +.fonteVermelha{ | |
| 447 | +text-align: center; | |
| 448 | +color: #ff0000; | |
| 449 | +} | |
| 450 | +#menu li{ | |
| 451 | + list-style: none; | |
| 452 | + text-align: right; | |
| 453 | + margin: 0 !important; | |
| 454 | + | |
| 455 | + } | |
| 456 | + | |
| 457 | +#menu ul li{ | |
| 458 | + display: inline; | |
| 459 | + color: #ffffff !important; | |
| 460 | +} | |
| 461 | + #menu ul li a{ | |
| 462 | + display: inline; | |
| 463 | + color: #ffffff !important; | |
| 464 | + margin: 0; | |
| 465 | +} | |
| 389 | 466 | header { |
| 390 | 467 | width: 100%; |
| 391 | 468 | /*Banner*/ |
| ... | ... | @@ -413,9 +490,13 @@ header { |
| 413 | 490 | |
| 414 | 491 | h2{ |
| 415 | 492 | font-size: 15px; |
| 416 | - margin: 0; | |
| 493 | + margin-left: 2.8em; | |
| 494 | + padding-left: 2em; | |
| 417 | 495 | } |
| 418 | 496 | |
| 497 | + h2#alertaAvaliacaoAutomatica { | |
| 498 | + margin-left: 0; | |
| 499 | +} | |
| 419 | 500 | |
| 420 | 501 | .oculto { |
| 421 | 502 | display: none; |
| ... | ... | @@ -428,7 +509,8 @@ h2{ |
| 428 | 509 | } |
| 429 | 510 | |
| 430 | 511 | a { |
| 431 | - text-decoration: none; | |
| 512 | + text-decoration: none; | |
| 513 | + margin-left: 0.8em; | |
| 432 | 514 | } |
| 433 | 515 | |
| 434 | 516 | #barra-brasil { |
| ... | ... | @@ -461,13 +543,16 @@ h1 { |
| 461 | 543 | font-size: 1.6em; |
| 462 | 544 | } |
| 463 | 545 | |
| 546 | +h1 a { | |
| 547 | + color: #ffffff; | |
| 548 | +} | |
| 549 | + | |
| 464 | 550 | #accessibility li { |
| 465 | 551 | display: inline; |
| 466 | 552 | } |
| 467 | 553 | |
| 468 | 554 | #accessibility a { |
| 469 | - color: #ffffff; | |
| 470 | - font-size: 1.2em; | |
| 555 | + color: #ffffff; | |
| 471 | 556 | padding-right: 10px; |
| 472 | 557 | font-family: Arial, Helvetica, sans-serif; |
| 473 | 558 | } |
| ... | ... | @@ -516,6 +601,7 @@ h1 { |
| 516 | 601 | /*background: #97aeec;*/ |
| 517 | 602 | text-align: center; |
| 518 | 603 | float: left; |
| 604 | + font-size: 12px; | |
| 519 | 605 | } |
| 520 | 606 | |
| 521 | 607 | #grafico { |
| ... | ... | @@ -576,6 +662,7 @@ table { |
| 576 | 662 | width: 90%; |
| 577 | 663 | font-size: 0.6em; |
| 578 | 664 | border-collapse: collapse; |
| 665 | + padding-left: 2em; | |
| 579 | 666 | } |
| 580 | 667 | |
| 581 | 668 | |
| ... | ... | @@ -616,6 +703,7 @@ a.oculto { |
| 616 | 703 | margin: auto; |
| 617 | 704 | text-align: right; |
| 618 | 705 | font-size: 12px; |
| 706 | + padding-right: 2em; | |
| 619 | 707 | } |
| 620 | 708 | |
| 621 | 709 | #webaxscore { |
| ... | ... | @@ -719,8 +807,6 @@ a.oculto { |
| 719 | 807 | list-style: none; |
| 720 | 808 | margin-top: 2px; |
| 721 | 809 | } |
| 722 | - #tituloTabela | |
| 723 | - { | |
| 724 | - margin-left: 10px !important; | |
| 725 | - } | |
| 810 | + | |
| 811 | + | |
| 726 | 812 | } |
| 727 | 813 | \ No newline at end of file | ... | ... |
4.89 KB
92 KB
79 Bytes
10.7 KB
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/controller/ErrosMaisComunsController.java
| ... | ... | @@ -37,7 +37,7 @@ public class ErrosMaisComunsController { |
| 37 | 37 | |
| 38 | 38 | public ErrosMaisComunsController(ErrosMaisComunsDAO _errosMaisComunsDAO, ServletContext application, Result result) throws IOException { |
| 39 | 39 | super(); |
| 40 | - errosMaisComunsDAO = _errosMaisComunsDAO; | |
| 40 | + this.errosMaisComunsDAO = _errosMaisComunsDAO; | |
| 41 | 41 | this.application = application; |
| 42 | 42 | this.result = result; |
| 43 | 43 | String fileName = "config.properties"; |
| ... | ... | @@ -82,7 +82,7 @@ public class ErrosMaisComunsController { |
| 82 | 82 | |
| 83 | 83 | |
| 84 | 84 | bufferOut |
| 85 | - .write(" <h2 class=\"oculto_visao\" >Gráfico com os 10 erros mais comuns.</h2> "); | |
| 85 | + .write(" <h2 class=\"oculto_visao\" >Gráfico com os 10 erros mais comuns.</h2><br> "); | |
| 86 | 86 | |
| 87 | 87 | bufferOut.write("<ul class=\"oculto_visao\" > "); |
| 88 | 88 | |
| ... | ... | @@ -239,7 +239,7 @@ public class ErrosMaisComunsController { |
| 239 | 239 | //inicio Avaliação |
| 240 | 240 | |
| 241 | 241 | bufferOut |
| 242 | - .write(" <a href=\"/painelAcessibilidade\">Voltar ao painel de acessibilidade</a>\n"); | |
| 242 | + .write(" <a href=\"/painel-acessibilidade\">Voltar ao painel de acessibilidade</a>\n"); | |
| 243 | 243 | bufferOut.write(" <div class=\"avaliacao\"> "); |
| 244 | 244 | |
| 245 | 245 | bufferOut.write(" <h2 id=\"tituloTabela\">Outros erros mais comuns</h2>"); | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/controller/PainelAcessibilidadeController.java
| ... | ... | @@ -6,19 +6,29 @@ import java.io.BufferedReader; |
| 6 | 6 | import java.io.File; |
| 7 | 7 | import java.io.FileInputStream; |
| 8 | 8 | import java.io.FileNotFoundException; |
| 9 | +import java.io.FileOutputStream; | |
| 9 | 10 | import java.io.IOException; |
| 10 | 11 | import java.io.InputStream; |
| 11 | 12 | import java.io.InputStreamReader; |
| 13 | +import java.io.OutputStreamWriter; | |
| 14 | +import java.io.UnsupportedEncodingException; | |
| 12 | 15 | import java.net.MalformedURLException; |
| 13 | 16 | import java.sql.Date; |
| 17 | +import java.text.DecimalFormat; | |
| 14 | 18 | import java.util.ArrayList; |
| 19 | +import java.util.HashMap; | |
| 15 | 20 | import java.util.List; |
| 21 | +import java.util.Map; | |
| 16 | 22 | import java.util.Properties; |
| 17 | 23 | |
| 18 | 24 | import javax.servlet.ServletContext; |
| 25 | +import javax.servlet.ServletOutputStream; | |
| 26 | +import javax.servlet.http.HttpServletResponse; | |
| 19 | 27 | import javax.ws.rs.QueryParam; |
| 20 | 28 | |
| 21 | 29 | import org.apache.regexp.REUtil; |
| 30 | +import org.hibernate.cfg.AnnotationConfiguration; | |
| 31 | +import org.hibernate.cfg.Configuration; | |
| 22 | 32 | import org.slf4j.Logger; |
| 23 | 33 | import org.slf4j.LoggerFactory; |
| 24 | 34 | |
| ... | ... | @@ -29,15 +39,19 @@ import br.com.caelum.vraptor.Resource; |
| 29 | 39 | import br.com.caelum.vraptor.Result; |
| 30 | 40 | import br.com.caelum.vraptor.Validator; |
| 31 | 41 | import br.com.caelum.vraptor.ioc.spring.VRaptorRequestHolder; |
| 42 | +import br.com.caelum.vraptor.view.Results; | |
| 32 | 43 | import br.com.eselo.component.Mailer; |
| 33 | 44 | import br.com.eselo.component.URLNormalizer; |
| 34 | 45 | import br.com.eselo.component.Util; |
| 35 | 46 | import br.com.eselo.conversor.ESeloDateConverter; |
| 36 | 47 | import br.com.eselo.dao.ErrosMaisComunsDAO; |
| 37 | 48 | import br.com.eselo.dao.MediaAvaliacaoDAO; |
| 49 | +import br.com.eselo.dao.RelatoriosFadDAO; | |
| 38 | 50 | import br.com.eselo.dao.UrlDAO; |
| 51 | +import br.com.eselo.model.ErrosMaisComuns; | |
| 39 | 52 | import br.com.eselo.model.GraficoMediaAvaliacao; |
| 40 | 53 | import br.com.eselo.model.MediaAvaliacao; |
| 54 | +import br.com.eselo.model.RelatoriosFad; | |
| 41 | 55 | import br.com.eselo.model.UltimaAvaliacao; |
| 42 | 56 | import br.com.eselo.model.Url; |
| 43 | 57 | |
| ... | ... | @@ -49,17 +63,27 @@ public class PainelAcessibilidadeController { |
| 49 | 63 | private Result result; |
| 50 | 64 | private Validator validator; |
| 51 | 65 | private final UrlDAO daoUrl; |
| 66 | + private final ErrosMaisComunsDAO errosMaisComunsDAO; | |
| 52 | 67 | private final MediaAvaliacaoDAO mediaAvaliacaoDAO; |
| 68 | + private final RelatoriosFadDAO relatoriosFadDAO; | |
| 53 | 69 | private static final String PAINEL_AGREGADO = "eselo.config.avaliacao.painelAgregado"; |
| 54 | 70 | private final Properties properties = new Properties(); |
| 55 | 71 | private ServletContext application; |
| 56 | 72 | |
| 57 | - public PainelAcessibilidadeController(Result result, Validator validator, UrlDAO _dao, MediaAvaliacaoDAO _mediaAvaliacaoDAO, ServletContext application) throws IOException{ | |
| 73 | + private static final String HOST = "eselo.config.buscaRelatorioFAD.host"; | |
| 74 | + private static final String USUARIO = "eselo.config.buscaRelatorioFAD.usuario"; | |
| 75 | + private static final String SENHA = "eselo.config.buscaRelatorioFAD.senha"; | |
| 76 | + private static final String DBNAME = "eselo.config.buscaRelatorioFAD.dbname"; | |
| 77 | + | |
| 78 | + public PainelAcessibilidadeController(ErrosMaisComunsDAO _errosMaisComunsDAO, Result result, Validator validator, UrlDAO _dao, MediaAvaliacaoDAO _mediaAvaliacaoDAO, ServletContext application, RelatoriosFadDAO _relatoriosFadDAO) throws IOException{ | |
| 79 | + | |
| 80 | + this.errosMaisComunsDAO = _errosMaisComunsDAO; | |
| 58 | 81 | this.result = result; |
| 59 | 82 | this.validator = validator; |
| 60 | 83 | this.daoUrl = _dao; |
| 61 | 84 | this.mediaAvaliacaoDAO = _mediaAvaliacaoDAO; |
| 62 | 85 | this.application = application; |
| 86 | + this.relatoriosFadDAO = _relatoriosFadDAO; | |
| 63 | 87 | |
| 64 | 88 | String fileName = "config.properties"; |
| 65 | 89 | InputStream stream = Mailer.class.getResourceAsStream("/" + fileName); |
| ... | ... | @@ -73,8 +97,9 @@ public class PainelAcessibilidadeController { |
| 73 | 97 | } |
| 74 | 98 | } |
| 75 | 99 | |
| 76 | - @Get("/painelAcessibilidade") | |
| 77 | - public void painelAcessibilidade() { | |
| 100 | + @Get("/erros-mais-comuns") | |
| 101 | + public void errosMaisComuns() { | |
| 102 | + | |
| 78 | 103 | |
| 79 | 104 | File diretorioHtml = new File(properties.getProperty(PAINEL_AGREGADO) + "/painelAgregado.txt"); |
| 80 | 105 | |
| ... | ... | @@ -130,6 +155,11 @@ public class PainelAcessibilidadeController { |
| 130 | 155 | } |
| 131 | 156 | |
| 132 | 157 | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 133 | 163 | @Get |
| 134 | 164 | @Path("/media-avaliacao/{tipo}/{id}/{nome}/{media}") |
| 135 | 165 | public void mediaAvaliacao(String tipo, String id,String nome, Double media) { |
| ... | ... | @@ -159,6 +189,10 @@ public class PainelAcessibilidadeController { |
| 159 | 189 | |
| 160 | 190 | boolean existe = false; |
| 161 | 191 | |
| 192 | + if(!tipo.equalsIgnoreCase("dominio")) | |
| 193 | + { | |
| 194 | + VRaptorRequestHolder.currentRequest().getServletContext().setAttribute("exibirTabelaRelatorio", false); | |
| 195 | + } | |
| 162 | 196 | switch (tipo) { |
| 163 | 197 | |
| 164 | 198 | case "orgao": novoTipo="dominio"; |
| ... | ... | @@ -194,7 +228,8 @@ public class PainelAcessibilidadeController { |
| 194 | 228 | caminhoLink.setNome("Órgão: " + nome + " - " + media); |
| 195 | 229 | caminhoLink.setLink("/media-avaliacao/dominio/"+ id + "/" + nome + "/" + media); |
| 196 | 230 | caminhoLink.setClasse("orgao"); |
| 197 | - | |
| 231 | + VRaptorRequestHolder.currentRequest().getServletContext().setAttribute("exibirTabelaRelatorio", true); | |
| 232 | + buscarRelatorios(id); | |
| 198 | 233 | existe = false; |
| 199 | 234 | |
| 200 | 235 | for (int i = 0; i < lsCaminhoAvaliacao.size(); i++) { |
| ... | ... | @@ -330,7 +365,7 @@ public class PainelAcessibilidadeController { |
| 330 | 365 | |
| 331 | 366 | |
| 332 | 367 | VRaptorRequestHolder.currentRequest().getServletContext().setAttribute("ultimaAvaliacao", Util.convertDataBrasil(dataUltimaAvaliacao.getData_ultima_avaliacao())); |
| 333 | - | |
| 368 | + VRaptorRequestHolder.currentRequest().getServletContext().setAttribute("exibirTabelaRelatorio", false); | |
| 334 | 369 | |
| 335 | 370 | } |
| 336 | 371 | |
| ... | ... | @@ -468,6 +503,333 @@ for (GraficoMediaAvaliacao graficoMediaAvaliacao : lsGraficoMediaAvaliacao) { |
| 468 | 503 | |
| 469 | 504 | } |
| 470 | 505 | |
| 506 | + | |
| 507 | + | |
| 508 | + //@Get | |
| 509 | + //@Path("/painel-acessibilidade/{id}") | |
| 510 | + //public void painelAcessibilidade(int id) { | |
| 511 | + public void buscarRelatorios(String id) { | |
| 512 | + | |
| 513 | + | |
| 514 | + Map<String,byte[]> relatorio = new HashMap<String,byte[]>(); | |
| 515 | + Map<String,byte[]> planoTrabalho = new HashMap<String,byte[]>(); | |
| 516 | + | |
| 517 | + List<RelatoriosFad> lsRelatoriosFad = relatoriosFadDAO.retornarRelatoriosFad(id, properties.getProperty(HOST), properties.getProperty(DBNAME), properties.getProperty(USUARIO), properties.getProperty(SENHA)); | |
| 518 | + | |
| 519 | + for (RelatoriosFad relatoriosFad : lsRelatoriosFad) { | |
| 520 | + relatorio.put(relatoriosFad.getId().toString(), relatoriosFad.getArquivo_fad()); | |
| 521 | + planoTrabalho.put(relatoriosFad.getId().toString(), relatoriosFad.getArquivo_plano()); | |
| 522 | + } | |
| 523 | + | |
| 524 | + | |
| 525 | + VRaptorRequestHolder.currentRequest().getServletContext().setAttribute("lsRelatoriosFad", lsRelatoriosFad); | |
| 526 | + VRaptorRequestHolder.currentRequest().getServletContext().setAttribute("relatorio", relatorio); | |
| 527 | + VRaptorRequestHolder.currentRequest().getServletContext().setAttribute("planoTrabalho", planoTrabalho); | |
| 528 | + | |
| 529 | + //serve para escolher qual tabela carregar(orgão ou os domínios com seus relatórios para download | |
| 530 | + result.include("carregamento", "dominios"); | |
| 531 | + | |
| 532 | + } | |
| 533 | + | |
| 534 | + @Get | |
| 535 | + @Path("/painel-acessibilidade/{id}/{relatorio_plTrabalho}") | |
| 536 | + public void painelAcessibilidade(String id, String relatorio_plTrabalho, HttpServletResponse response) { | |
| 537 | + Map<String,byte[]> relatorio; | |
| 538 | + Map<String,byte[]> planoTrabalho; | |
| 539 | + | |
| 540 | + String keyToSearch = id; | |
| 541 | + byte[] dados = null; | |
| 542 | + String nome = ""; | |
| 543 | + if(relatorio_plTrabalho.equalsIgnoreCase("fad")) | |
| 544 | + { | |
| 545 | + relatorio = (Map<String, byte[]>) VRaptorRequestHolder.currentRequest().getServletContext().getAttribute("relatorio"); | |
| 546 | + | |
| 547 | + if ( relatorio.containsKey( keyToSearch ) ) { | |
| 548 | + | |
| 549 | + try { | |
| 550 | + dados = relatorio.get(keyToSearch); | |
| 551 | + nome = "Relatório Circunstanciado.pdf"; | |
| 552 | + | |
| 553 | + response.setContentType("inline/download"); | |
| 554 | + String arq = "attachment;filename=" + nome; | |
| 555 | + response.setHeader("Content-Disposition", arq); | |
| 556 | + ServletOutputStream os; | |
| 557 | + | |
| 558 | + os = response.getOutputStream(); | |
| 559 | + os.write(dados); | |
| 560 | + os.flush(); | |
| 561 | + os.close(); | |
| 562 | + | |
| 563 | + } catch (IOException e) { | |
| 564 | + e.printStackTrace(); | |
| 565 | + } | |
| 566 | + | |
| 567 | + }else{ | |
| 568 | + System.err.println("Chave não existe"); | |
| 569 | + } | |
| 570 | + | |
| 571 | + }else if(relatorio_plTrabalho.equalsIgnoreCase("plano")) | |
| 572 | + { | |
| 573 | + planoTrabalho = (Map<String, byte[]>) VRaptorRequestHolder.currentRequest().getServletContext().getAttribute("planoTrabalho"); | |
| 574 | + | |
| 575 | + if ( planoTrabalho.containsKey( keyToSearch ) ) { | |
| 576 | + | |
| 577 | + try { | |
| 578 | + dados = planoTrabalho.get(keyToSearch); | |
| 579 | + nome = "Plano de trabalho.pdf"; | |
| 580 | + | |
| 581 | + response.setContentType("inline/download"); | |
| 582 | + String arq = "attachment;filename=" + nome; | |
| 583 | + response.setHeader("Content-Disposition", arq); | |
| 584 | + ServletOutputStream os; | |
| 585 | + | |
| 586 | + os = response.getOutputStream(); | |
| 587 | + os.write(dados); | |
| 588 | + os.flush(); | |
| 589 | + os.close(); | |
| 590 | + | |
| 591 | + } catch (IOException e) { | |
| 592 | + e.printStackTrace(); | |
| 593 | + } | |
| 594 | + | |
| 595 | + }else{ | |
| 596 | + System.err.println("Chave não existe"); | |
| 597 | + } | |
| 598 | + | |
| 599 | + } | |
| 600 | + | |
| 601 | + | |
| 602 | + result.include("grafico_js", "<script type=\"text/javascript\" src=\"/static/js/chartMediaAvaliacao.js\"></script>"); | |
| 603 | + } | |
| 604 | + | |
| 605 | + @Get("/painel-acessibilidade") | |
| 606 | + public void painelAcessibilidade() { | |
| 607 | + | |
| 608 | + | |
| 609 | + List<ErrosMaisComuns> lsErrosMaisComuns = errosMaisComunsDAO.errosMaisComuns(); | |
| 610 | + File painelAgregado = new File(properties.getProperty(PAINEL_AGREGADO)); | |
| 611 | + StringBuffer html = new StringBuffer(); | |
| 612 | + | |
| 613 | + Double mediaBrasil; | |
| 614 | + | |
| 615 | + List<GraficoMediaAvaliacao> lsGraficoMediaAvaliacao = mediaAvaliacaoDAO.gerarGraficoMediaAvaliacao("governo federal", null, 4); | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + mediaBrasil = buscaMediaBrasil(lsGraficoMediaAvaliacao); | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + String webaxscore = ""; | |
| 624 | + | |
| 625 | + if (mediaBrasil >= 95) { | |
| 626 | + webaxscore = "bom"; | |
| 627 | + } else if (mediaBrasil >= 85 & mediaBrasil < 95) { | |
| 628 | + webaxscore = "razoavel"; | |
| 629 | + } else if (mediaBrasil >= 70 & mediaBrasil < 85) { | |
| 630 | + webaxscore = "ruim"; | |
| 631 | + }else { | |
| 632 | + webaxscore = "pessimo"; | |
| 633 | + } | |
| 634 | + | |
| 635 | + | |
| 636 | + html.append(" <div class=\"logoAvaliacao\"> "); | |
| 637 | + html.append(" <div id=\"emag\"> "); | |
| 638 | + html.append(" <label>eMAG v 3.1</label> "); | |
| 639 | + html.append(" </div> "); | |
| 640 | + | |
| 641 | + html.append(" <div id=\"testesAutomaticos\"> \n"); | |
| 642 | + //bufferOut.write(" <label>Testes Automáticos<br> Nota: " + resumoAvaliacao.getValor() + "/100</label> </div> "); | |
| 643 | + | |
| 644 | + html.append(" <div class=\"cell width-5 position-2 >\n"); | |
| 645 | + | |
| 646 | + | |
| 647 | + html.append(" <div id=\"block\">\n"); | |
| 648 | + html.append(" <div id=\"webaxscore\" class=\"scoreB_" + webaxscore + "\">Porcentagem"); | |
| 649 | + html.append(" <strong>Média</strong>"); | |
| 650 | + html.append(" <span>" + mediaBrasil +"%</span>\n"); | |
| 651 | + html.append(" </div>\n"); | |
| 652 | + html.append(" </div>\n"); | |
| 653 | + | |
| 654 | + //bufferOut.write(" <br>"); | |
| 655 | + | |
| 656 | + | |
| 657 | + html.append("<div id=\"legenda\" >\n"); | |
| 658 | + html.append("<label>Legenda</label><br>"); | |
| 659 | + html.append("<ul>"); | |
| 660 | + html.append(" <li class=\"legenda\"><img id=\"bom\" alt=\"farol verde, média maior ou igual a 95%\" src=\"/static/img/verde.png\"></li>"); | |
| 661 | + html.append(" <li class=\"legenda\"><img id=\"razoavel\" alt=\"farol amarela, média maior ou igual a 85% e menor que 95%\" src=\"/static/img/amarelo.png\"></li>"); | |
| 662 | + html.append(" <li class=\"legenda\"><img id=\"ruim\" alt=\"farol laranja, média maior ou igual a 70% e menor que 85%\" src=\"/static/img/laranja.png\"></li>"); | |
| 663 | + html.append(" <li class=\"legenda\"><img id=\"pessimo\" alt=\"farol vermelho, média menor que 70%\" src=\"/static/img/vermelho.png\"></li>"); | |
| 664 | + html.append("</ul>"); | |
| 665 | + html.append("</div>"); | |
| 666 | + | |
| 667 | + html.append(" </div>"); | |
| 668 | + | |
| 669 | + html.append(" <div id=\"grafico2\"> "); | |
| 670 | + html.append(" <h2 class=\"oculto_visao\">Gráfico com as notas das últimas avaliações ordenada da mais antiga para a mais atual, limitado até quatro avaliações.</h2> "); | |
| 671 | + html.append(" <ul class=\"oculto_visao\"> "); | |
| 672 | + | |
| 673 | + int qntAvaliacoes = 0; | |
| 674 | + | |
| 675 | + String dataAvaliacao = ""; | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + for (GraficoMediaAvaliacao graficoMediaAvaliacao : lsGraficoMediaAvaliacao) { | |
| 680 | + | |
| 681 | + mediaBrasil += graficoMediaAvaliacao.getMedia(); | |
| 682 | + | |
| 683 | + qntAvaliacoes++; | |
| 684 | + | |
| 685 | + //dataAvaliacao = graficoMediaAvaliacao.getIdAgendamento().substring(6, 8) + "/"; | |
| 686 | + dataAvaliacao = graficoMediaAvaliacao.getIdAgendamento().substring(4, 6) + "/"; | |
| 687 | + dataAvaliacao += graficoMediaAvaliacao.getIdAgendamento().substring(0, 4); | |
| 688 | + | |
| 689 | + html.append(" <li>Média "+ qntAvaliacoes + ": <span id=\"media"+ qntAvaliacoes +"\">"+graficoMediaAvaliacao.getMedia()+"</span><span>Data da avaliação: </span><span id=\"data" + qntAvaliacoes + "\">"+ dataAvaliacao +"</span></li>"); | |
| 690 | + | |
| 691 | + } | |
| 692 | + | |
| 693 | + | |
| 694 | + html.append(" </ul> "); | |
| 695 | + html.append(" <label id=\"qntAvaliacoes\" class=\"oculto\">"+ qntAvaliacoes +"</label> "); | |
| 696 | + //html.append(" <label id=\"qntAvaliacoes\" >"+ legenda +"</label> "); | |
| 697 | + | |
| 698 | + html.append(" <div class=\"myChart\"> "); | |
| 699 | + html.append(" <iframe class=\"chartjs-hidden-iframe\" "); | |
| 700 | + html.append(" style=\"width: 100%; display: block; border: 0px; height: 0px; margin: 0px; position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px;\"></iframe> "); | |
| 701 | + html.append(" <canvas id=\"myChartMediaAvaliacao\" style=\"width: 420px; height: 210px;\" "); | |
| 702 | + html.append(" width=\"420\" height=\"210\"></canvas> "); | |
| 703 | + html.append(" </div> "); | |
| 704 | + html.append(" </div> "); | |
| 705 | + html.append(" </div> "); | |
| 706 | + | |
| 707 | + | |
| 708 | + long total = 0; | |
| 709 | + double percentual = 0; | |
| 710 | + long totalDezErrosMaisComuns = 0; | |
| 711 | + double qntErro; | |
| 712 | + | |
| 713 | + int i = 0; | |
| 714 | + for (ErrosMaisComuns errosMaisComuns : lsErrosMaisComuns) { | |
| 715 | + | |
| 716 | + if(errosMaisComuns.getDescricao().equalsIgnoreCase("Total")) | |
| 717 | + { | |
| 718 | + total = errosMaisComuns.getQtd_erros(); | |
| 719 | + } | |
| 720 | + else | |
| 721 | + { | |
| 722 | + qntErro = errosMaisComuns.getQtd_erros() * 100; | |
| 723 | + percentual = qntErro/total; | |
| 724 | + totalDezErrosMaisComuns = totalDezErrosMaisComuns + errosMaisComuns.getQtd_erros(); | |
| 725 | + | |
| 726 | + DecimalFormat df = new DecimalFormat("0.##"); | |
| 727 | + | |
| 728 | + i++; | |
| 729 | + //html.append("<li >erro: <span id=\"erro" + i +"\">" + "Erro: " + i + "</span><span>" + errosMaisComuns.getDescricao() + "</span> <span id=\"p_erro" + i + "\">" + df.format(percentual) + "</span></li>"); | |
| 730 | + } | |
| 731 | + } | |
| 732 | + | |
| 733 | + qntErro = (total - totalDezErrosMaisComuns) * 100; | |
| 734 | + percentual = qntErro/total; | |
| 735 | + | |
| 736 | + DecimalFormat df = new DecimalFormat("0.##"); | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + //inicio Avaliação | |
| 741 | + html.append(" <div class=\"avaliacao\"> "); | |
| 742 | + | |
| 743 | + | |
| 744 | + html.append(" <h2 id=\"tituloTabela\">Os 10 erros mais comuns</h2><br>"); | |
| 745 | + //inicio tabela | |
| 746 | + html.append(" <table> "); | |
| 747 | + html.append(" <thead> "); | |
| 748 | + html.append(" <tr><th colspan=\"3\"> Testes Automáticos</th></tr>"); | |
| 749 | + html.append(" <tr> "); | |
| 750 | + html.append(" <th id=\"erro_numero\">Erro n°</th> "); | |
| 751 | + html.append(" <th id=\"erro\">Erro</th> "); | |
| 752 | + html.append(" <th id=\"incidencia\">Incidência</th> "); | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + total = 0; | |
| 759 | + percentual = 0; | |
| 760 | + totalDezErrosMaisComuns = 0; | |
| 761 | + qntErro = 0; | |
| 762 | + Integer erro_numero = 0; | |
| 763 | + | |
| 764 | + for (ErrosMaisComuns errosMaisComuns : lsErrosMaisComuns) { | |
| 765 | + | |
| 766 | + if(errosMaisComuns.getDescricao().equalsIgnoreCase("Total")) | |
| 767 | + { | |
| 768 | + total = errosMaisComuns.getQtd_erros(); | |
| 769 | + } | |
| 770 | + else | |
| 771 | + { | |
| 772 | + qntErro = errosMaisComuns.getQtd_erros() * 100.00; | |
| 773 | + percentual = qntErro/total; | |
| 774 | + totalDezErrosMaisComuns = totalDezErrosMaisComuns + errosMaisComuns.getQtd_erros(); | |
| 775 | + | |
| 776 | + erro_numero++; | |
| 777 | + | |
| 778 | + DecimalFormat df2 = new DecimalFormat("0.##"); | |
| 779 | + html.append(" <tr> "); | |
| 780 | + html.append(" <td headers=\"erro_numero\" class=\"celula\"> " + erro_numero + " </td> "); | |
| 781 | + html.append(" <td headers=\"erro\" class=\"celula\"> " + errosMaisComuns.getDescricao() + " </td> "); | |
| 782 | + html.append(" <td headers=\"incidencia\" class=\"celula\"> " + df2.format(percentual) + "% </td> "); | |
| 783 | + html.append(" </tr> "); | |
| 784 | + } | |
| 785 | + } | |
| 786 | + | |
| 787 | + qntErro = (total - totalDezErrosMaisComuns) * 100.00; | |
| 788 | + percentual = qntErro/total; | |
| 789 | + | |
| 790 | + DecimalFormat df2 = new DecimalFormat("0.##"); | |
| 791 | + | |
| 792 | + erro_numero++; | |
| 793 | + | |
| 794 | + html.append(" <tr> "); | |
| 795 | + html.append(" <td headers=\"erro_numero\" class=\"celula\"> " + erro_numero + " </td> "); | |
| 796 | + html.append(" <td headers=\"erroMaisComum\" class=\"celula\"> <a href=\"/outros-erros-mais-comuns\"> Outros </a></td> "); | |
| 797 | + html.append(" <td headers=\"percentual\" class=\"celula\">" + df2.format(percentual) + "%</td> "); | |
| 798 | + html.append(" <tr> "); | |
| 799 | + | |
| 800 | + html.append(" </tbody> "); | |
| 801 | + html.append(" </table> <br>"); | |
| 802 | + html.append(" </div> "); | |
| 803 | + //fim Avaliação | |
| 804 | + | |
| 805 | + | |
| 806 | + //inicio Erros mais comuns | |
| 807 | + | |
| 808 | + String novoTipo = ""; | |
| 809 | + | |
| 810 | + UltimaAvaliacao dataUltimaAvaliacao = mediaAvaliacaoDAO.ultimaAvaliacao(); | |
| 811 | + List<MediaAvaliacao> lsMediaAvaliacao = mediaAvaliacaoDAO.mediaAvaliacao("orgao", null); | |
| 812 | + | |
| 813 | + | |
| 814 | + //serve para escolher qual tabela carregar(orgão ou os domínios com seus relatórios para download | |
| 815 | + result.include("carregamento", "orgao"); | |
| 816 | + | |
| 817 | + result.include("html", html.toString()); | |
| 818 | + result.include("lsMediaAvaliacao", lsMediaAvaliacao); | |
| 819 | + result.include("tipo", "Órgãos"); | |
| 820 | + result.include("novoTipo", "dominio"); | |
| 821 | + result.include("nomeTotal", "domínios"); | |
| 822 | + result.include("legenda", "Média Brasil: gov.br"); | |
| 823 | + result.include("grafico_js", "<script type=\"text/javascript\" src=\"/static/js/chartMediaAvaliacao.js\"></script>"); | |
| 824 | + //gerarGrafico("governo federal", null, "Média Brasil: gov.br", true, 0); | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + //fim Erros mais comuns | |
| 830 | + | |
| 831 | + } | |
| 832 | + | |
| 471 | 833 | |
| 472 | 834 | public class CaminhoLink |
| 473 | 835 | { | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/dao/AgendamentoAvaliacaoUrlDAO.java
0 → 100644
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | +package br.com.eselo.dao; | |
| 2 | + | |
| 3 | +import org.hibernate.Session; | |
| 4 | + | |
| 5 | +import br.com.caelum.vraptor.ioc.Component; | |
| 6 | +import br.com.eselo.model.AgendamentoAvaliacaoUrl; | |
| 7 | + | |
| 8 | +@Component | |
| 9 | +public class AgendamentoAvaliacaoUrlDAO extends GenericDAO<AgendamentoAvaliacaoUrl>{ | |
| 10 | + | |
| 11 | + public AgendamentoAvaliacaoUrlDAO(Session _session) { | |
| 12 | + super(_session); | |
| 13 | + } | |
| 14 | + | |
| 15 | +} | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/dao/GenericDAO.java
| ... | ... | @@ -72,14 +72,12 @@ public abstract class GenericDAO<T> { |
| 72 | 72 | |
| 73 | 73 | public void save(T entity) throws HibernateException { |
| 74 | 74 | try { |
| 75 | - System.out.println("iniciar salvar"); | |
| 76 | 75 | this.session.save(entity); |
| 77 | 76 | this.session.flush(); |
| 78 | 77 | } catch (HibernateException e) { |
| 79 | - System.out.println("erro salvar"); | |
| 80 | 78 | logger.debug(e.getMessage()); |
| 81 | 79 | System.out.println(e.getMessage()); |
| 82 | - throw e; | |
| 80 | + //throw e; | |
| 83 | 81 | } |
| 84 | 82 | } |
| 85 | 83 | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/dao/RelatoriosFadDAO.java
0 → 100644
| ... | ... | @@ -0,0 +1,67 @@ |
| 1 | +package br.com.eselo.dao; | |
| 2 | + | |
| 3 | +import java.io.InputStream; | |
| 4 | +import java.util.ArrayList; | |
| 5 | +import java.util.List; | |
| 6 | +import java.util.Properties; | |
| 7 | + | |
| 8 | +import org.hibernate.SQLQuery; | |
| 9 | +import org.hibernate.Session; | |
| 10 | +import org.hibernate.cfg.AnnotationConfiguration; | |
| 11 | +import org.hibernate.cfg.Configuration; | |
| 12 | + | |
| 13 | +import br.com.caelum.vraptor.ioc.Component; | |
| 14 | +import br.com.eselo.component.Mailer; | |
| 15 | +import br.com.eselo.model.RelatoriosFad; | |
| 16 | + | |
| 17 | + | |
| 18 | +@Component | |
| 19 | +public class RelatoriosFadDAO extends GenericDAO<RelatoriosFad>{ | |
| 20 | + | |
| 21 | + public RelatoriosFadDAO(Session _session) { | |
| 22 | + | |
| 23 | + super(_session); | |
| 24 | + } | |
| 25 | + | |
| 26 | + | |
| 27 | + /*public Configuration getConfig() { | |
| 28 | + | |
| 29 | + Configuration config = new AnnotationConfiguration() | |
| 30 | + .addAnnotatedClass(RelatoriosFad.class) | |
| 31 | + .setProperty("hibernate.connection.driver_class", "org.postgresql.Driver") | |
| 32 | + .setProperty("hibernate.connection.url", "jdbc:postgresql://localhost/relatorioCircunstanciado") | |
| 33 | + .setProperty("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect") | |
| 34 | + .setProperty("hibernate.connection.username", "postgres") | |
| 35 | + .setProperty("hibernate.connection.password", "postgree") | |
| 36 | + .setProperty("hibernate.show_sql", "true"); | |
| 37 | + | |
| 38 | + return config; | |
| 39 | + }*/ | |
| 40 | + | |
| 41 | + public List<RelatoriosFad> retornarRelatoriosFad(String id, String host, String dbname, String usuario, String senha) { | |
| 42 | + List<RelatoriosFad> lsRelatoriosFad = new ArrayList<RelatoriosFad>(); | |
| 43 | + StringBuffer query = new StringBuffer(); | |
| 44 | + | |
| 45 | + //query.append(" SELECT * FROM RetornaRelatorioCircunstanciado("+ id +") AS (id_questionario integer, "); | |
| 46 | + //query.append(" no_unidade_plano text, dt_rel timestamp with time zone, id_plano_trabalho integer, "); | |
| 47 | + //query.append(" id_unidade integer, nome_plano text, arquivo_plano bytea, nome_fad text, arquivo_fad bytea); "); | |
| 48 | + | |
| 49 | + //Configuration config = getConfig(); | |
| 50 | + | |
| 51 | + //Session sessao = config.buildSessionFactory().openSession(); | |
| 52 | + query.append(" SELECT * FROM dblink('hostaddr="+ host +" dbname="+ dbname +" user=" + usuario + " password="+ senha +"', 'select * from RetornaRelatorioCircunstanciado("+ id +") "); | |
| 53 | + query.append(" AS (id_questionario integer, no_unidade_plano text, dt_rel timestamp with time zone, id_plano_trabalho integer, id_unidade integer, nome_plano text, arquivo_plano bytea, nome_fad text, arquivo_fad bytea)')"); | |
| 54 | + query.append(" AS rel_circ(id_questionario integer, no_unidade_plano text, dt_rel timestamp with time zone, id_plano_trabalho integer, id_unidade integer, nome_plano text, arquivo_plano bytea, nome_fad text, arquivo_fad bytea)"); | |
| 55 | + | |
| 56 | + SQLQuery sqlQuery = session.createSQLQuery(query.toString()); | |
| 57 | + sqlQuery.addEntity(RelatoriosFad.class); | |
| 58 | + List list = sqlQuery.list(); | |
| 59 | + | |
| 60 | + for (Object object : list) { | |
| 61 | + lsRelatoriosFad.add((RelatoriosFad) object); | |
| 62 | + } | |
| 63 | + | |
| 64 | + return lsRelatoriosFad; | |
| 65 | + } | |
| 66 | + | |
| 67 | +} | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/model/AgendamentoAvaliacaoUrl.java
0 → 100644
| ... | ... | @@ -0,0 +1,55 @@ |
| 1 | +package br.com.eselo.model; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | + | |
| 5 | +import javax.persistence.Column; | |
| 6 | +import javax.persistence.Entity; | |
| 7 | +import javax.persistence.GeneratedValue; | |
| 8 | +import javax.persistence.Id; | |
| 9 | +import javax.persistence.Table; | |
| 10 | +import javax.persistence.Temporal; | |
| 11 | +import javax.persistence.TemporalType; | |
| 12 | + | |
| 13 | +@Entity | |
| 14 | +@Table(name = "sel_solicita_agendamento_url") | |
| 15 | +public class AgendamentoAvaliacaoUrl { | |
| 16 | + | |
| 17 | + @Id | |
| 18 | + @GeneratedValue | |
| 19 | + @Column(name = "id_solicitacao_url", columnDefinition = "serial", unique = true, nullable = false) | |
| 20 | + private Long id; | |
| 21 | + | |
| 22 | + private String url; | |
| 23 | + | |
| 24 | + @Temporal(TemporalType.TIMESTAMP) | |
| 25 | + private Date dt_solicitacao; | |
| 26 | + | |
| 27 | + private String status; | |
| 28 | + | |
| 29 | + public Long getId() { | |
| 30 | + return id; | |
| 31 | + } | |
| 32 | + public void setId(Long id) { | |
| 33 | + this.id = id; | |
| 34 | + } | |
| 35 | + public String getUrl() { | |
| 36 | + return url; | |
| 37 | + } | |
| 38 | + public void setUrl(String url) { | |
| 39 | + this.url = url; | |
| 40 | + } | |
| 41 | + public Date getDt_solicitacao() { | |
| 42 | + return dt_solicitacao; | |
| 43 | + } | |
| 44 | + public void setDt_solicitacao(Date dt_solicitacao) { | |
| 45 | + this.dt_solicitacao = dt_solicitacao; | |
| 46 | + } | |
| 47 | + public String getStatus() { | |
| 48 | + return status; | |
| 49 | + } | |
| 50 | + public void setStatus(String status) { | |
| 51 | + this.status = status; | |
| 52 | + } | |
| 53 | + | |
| 54 | + | |
| 55 | +} | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/java/br/com/eselo/model/RelatoriosFad.java
0 → 100644
| ... | ... | @@ -0,0 +1,114 @@ |
| 1 | +package br.com.eselo.model; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | + | |
| 5 | +import javax.persistence.Column; | |
| 6 | +import javax.persistence.Entity; | |
| 7 | +import javax.persistence.GeneratedValue; | |
| 8 | +import javax.persistence.Id; | |
| 9 | +import javax.persistence.Table; | |
| 10 | +import javax.persistence.Temporal; | |
| 11 | +import javax.persistence.TemporalType; | |
| 12 | + | |
| 13 | +@Entity | |
| 14 | +@Table(name = "sel_relarorios_fad") | |
| 15 | +public class RelatoriosFad { | |
| 16 | + | |
| 17 | + @Id | |
| 18 | + @GeneratedValue | |
| 19 | + @Column(name = "id_questionario", columnDefinition = "serial", unique = true, nullable = false) | |
| 20 | + private Long id; | |
| 21 | + | |
| 22 | + private String no_unidade_plano; | |
| 23 | + | |
| 24 | + @Temporal(TemporalType.TIMESTAMP) | |
| 25 | + private Date dt_rel; | |
| 26 | + | |
| 27 | + private Long id_plano_trabalho; | |
| 28 | + | |
| 29 | + private Long id_unidade; | |
| 30 | + | |
| 31 | + private String nome_plano; | |
| 32 | + | |
| 33 | + private byte[] arquivo_plano; | |
| 34 | + | |
| 35 | + private String nome_fad; | |
| 36 | + | |
| 37 | + private byte[] arquivo_fad; | |
| 38 | + | |
| 39 | + public Long getId() { | |
| 40 | + return id; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public void setId(Long id) { | |
| 44 | + this.id = id; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public String getNo_unidade_plano() { | |
| 48 | + return no_unidade_plano; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public void setNo_unidade_plano(String no_unidade_plano) { | |
| 52 | + this.no_unidade_plano = no_unidade_plano; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public Date getDt_rel() { | |
| 56 | + return dt_rel; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public void setDt_rel(Date dt_rel) { | |
| 60 | + this.dt_rel = dt_rel; | |
| 61 | + } | |
| 62 | + | |
| 63 | + | |
| 64 | + public Long getId_plano_trabalho() { | |
| 65 | + return id_plano_trabalho; | |
| 66 | + } | |
| 67 | + | |
| 68 | + public void setId_plano_trabalho(Long id_plano_trabalho) { | |
| 69 | + this.id_plano_trabalho = id_plano_trabalho; | |
| 70 | + } | |
| 71 | + | |
| 72 | + public Long getId_unidade() { | |
| 73 | + return id_unidade; | |
| 74 | + } | |
| 75 | + | |
| 76 | + public void setId_unidade(Long id_unidade) { | |
| 77 | + this.id_unidade = id_unidade; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public String getNome_plano() { | |
| 81 | + return nome_plano; | |
| 82 | + } | |
| 83 | + | |
| 84 | + public void setNome_plano(String nome_plano) { | |
| 85 | + this.nome_plano = nome_plano; | |
| 86 | + } | |
| 87 | + | |
| 88 | + public byte[] getArquivo_plano() { | |
| 89 | + return arquivo_plano; | |
| 90 | + } | |
| 91 | + | |
| 92 | + public void setArquivo_plano(byte[] arquivo_plano) { | |
| 93 | + this.arquivo_plano = arquivo_plano; | |
| 94 | + } | |
| 95 | + | |
| 96 | + public String getNome_fad() { | |
| 97 | + return nome_fad; | |
| 98 | + } | |
| 99 | + | |
| 100 | + public void setNome_fad(String nome_fad) { | |
| 101 | + this.nome_fad = nome_fad; | |
| 102 | + } | |
| 103 | + | |
| 104 | + public byte[] getArquivo_fad() { | |
| 105 | + return arquivo_fad; | |
| 106 | + } | |
| 107 | + | |
| 108 | + public void setArquivo_fad(byte[] arquivo_fad) { | |
| 109 | + this.arquivo_fad = arquivo_fad; | |
| 110 | + } | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | +} | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/resources/config.properties
| ... | ... | @@ -12,4 +12,12 @@ eselo.config.avaliacao.painelAgregado=/var/www/arquivo/painel/painelAgregado |
| 12 | 12 | |
| 13 | 13 | #eselo.config.avaliacao.enderecoHtml=http://localhost:18080/eselo/arquivosHtml/ |
| 14 | 14 | #eselo.config.avaliacao.enderecoHtml=http://189.9.137.162:8080/eselo/arquivosHtml/ |
| 15 | -eselo.config.avaliacao.enderecoHtml=http://eselo-prd.brazilsouth.cloudapp.azure.com:8080/arquivosHtml | |
| 16 | 15 | \ No newline at end of file |
| 16 | +eselo.config.avaliacao.enderecoHtml=http://eselo-prd.brazilsouth.cloudapp.azure.com:8080/arquivosHtml | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | +#Conexão com o banco de dados relatorioCircunstanciado para recuperar os relatórios e os planos de trabalho | |
| 21 | +eselo.config.buscaRelatorioFAD.host=127.0.0.1 | |
| 22 | +eselo.config.buscaRelatorioFAD.dbname=relatorioCircunstanciado | |
| 23 | +eselo.config.buscaRelatorioFAD.usuario=postgres | |
| 24 | +eselo.config.buscaRelatorioFAD.senha=dgeSLTIcgpge2015 | ... | ... |
Desenvolvimento/Codificacao/e-Selo/src/main/resources/hibernate.cfg.xml
| ... | ... | @@ -10,7 +10,7 @@ |
| 10 | 10 | <property name="hibernate.connection.url">jdbc:postgresql://database:5432/eselo</property> |
| 11 | 11 | <property name="hibernate.connection.driver_class">org.postgresql.Driver</property> |
| 12 | 12 | <property name="hibernate.connection.username">postgres</property> |
| 13 | - <property name="hibernate.connection.password">dgeSLTIcgpge2015</property> | |
| 13 | + <property name="hibernate.connection.password">postgres</property> | |
| 14 | 14 | <property name="hibernate.connection.CharSet">utf8</property> |
| 15 | 15 | <property name="hibernate.connection.characterEncoding">utf8</property> |
| 16 | 16 | <property name="hibernate.connection.useUnicode">true</property> |
| ... | ... | @@ -39,9 +39,11 @@ |
| 39 | 39 | <mapping class="br.com.eselo.model.ErrosMaisComuns" /> |
| 40 | 40 | <mapping class="br.com.eselo.model.MediaAvaliacao" /> |
| 41 | 41 | <mapping class="br.com.eselo.model.GraficoMediaAvaliacao" /> |
| 42 | + <mapping class="br.com.eselo.model.AgendamentoAvaliacaoUrl"/> | |
| 42 | 43 | <mapping class="br.com.eselo.model.ResultadoRecomendacao" /> |
| 43 | 44 | <mapping class="br.com.eselo.model.ResultadoCriterio" /> |
| 44 | 45 | <mapping class="br.com.eselo.model.UltimaAvaliacao" /> |
| 46 | + <mapping class="br.com.eselo.model.RelatoriosFad" /> | |
| 45 | 47 | |
| 46 | 48 | |
| 47 | 49 | ... | ... |