diff --git a/trunk/SIPRPSoft/properties/1-development/app.properties b/trunk/SIPRPSoft/properties/1-development/app.properties index 57e9f9ca..6e0a5306 100644 --- a/trunk/SIPRPSoft/properties/1-development/app.properties +++ b/trunk/SIPRPSoft/properties/1-development/app.properties @@ -4,13 +4,14 @@ app.main-class = siprp.Main app.main = siprp.Main db.url.prefix = jdbc:postgresql:// -db.user = siprp -db.password = rg2h-opksiprp -db.name = siprp_local_3 +db.user = postgres +#db.password = rg2h-opksiprp +db.password = Typein +db.name = siprp_local_3_20100813 db.connection.driver = org.postgresql.Driver -jnlp.resources.property.server.address = www.evolute.pt -jnlp.resources.property.server.port = 5436 +jnlp.resources.property.server.address = evoserver +jnlp.resources.property.server.port = 5432 app.resources.j2se.max-heap-size=512m app.resources.j2se.initial-heap-size=256m diff --git a/trunk/SIPRPSoft/src/siprp/Main.java b/trunk/SIPRPSoft/src/siprp/Main.java index b36bc9e8..87f59495 100644 --- a/trunk/SIPRPSoft/src/siprp/Main.java +++ b/trunk/SIPRPSoft/src/siprp/Main.java @@ -167,10 +167,10 @@ public class Main implements com.evolute.utils.ui.window.Connector DBManager dbm = new JDBCManager( url, user, passwd , 10, 8, 8, null ); Singleton.setInstance( Singleton.DEFAULT_DBMANAGER, dbm ); - StatementExecuterFactory.initialize( - new DBStatementExecuter( dbm.getSharedExecuter(this) ) ); + StatementExecuterFactory.initialize( new DBStatementExecuter( dbm.getSharedExecuter(this) ) ); - Updater.getInstance().executeUpdate(true, true, UpdateList.UPDATE_LIST); + Updater.getInstance().executeUpdates( UpdateList.UPDATE_LIST ); +// Updater.getInstance().executeUpdate(true, true, UpdateList.UPDATE_LIST); new ORMInitializer().initializeORM( url, user, passwd ); diff --git a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/GerirMedidasRelatorioPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/GerirMedidasRelatorioPanel.java index 251b8dd1..6fcaee6d 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/GerirMedidasRelatorioPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/GerirMedidasRelatorioPanel.java @@ -381,8 +381,11 @@ public class GerirMedidasRelatorioPanel extends SIPRPLazyLoadedPanel if( confirm("Tem a certeza que deseja remover o requisito '" + shortenString( rel.toMedida_id().toString() ) + "'?") ) { HsRelatorioMedidaData medidaData = rel.toMedida_id(); +// System.out.println( "\nDELETING MEDIDA : " + medidaData.getId() + " - " + medidaData.getDescription() ); medidaData.delete(); +// System.out.println( "\nDELETING REL : " + rel.getMedida_id() + " : " + rel.getPosto_id() ); + rel.delete(); outcome = true; } diff --git a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/print/RelatorioPrintDataProvider.java b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/print/RelatorioPrintDataProvider.java index c161a5ab..b86fc00d 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/print/RelatorioPrintDataProvider.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/print/RelatorioPrintDataProvider.java @@ -93,27 +93,30 @@ public class RelatorioPrintDataProvider { Virtual2DArray array; - Select select = - new Select2( - new String[]{ "hs_relatorio", "marcacoes_estabelecimento", "estabelecimentos", "empresas" }, - new Integer[]{ Select2.JOIN_INNER, Select2.JOIN_INNER, Select2.JOIN_INNER }, - new Expression[]{ - new Field( "hs_relatorio.marcacao_id" ).isEqual( new Field( "marcacoes_estabelecimento.id" ) ), - new Field( "marcacoes_estabelecimento.estabelecimento_id" ).isEqual( new Field( "estabelecimentos.id" ) ), - new Field( "estabelecimentos.empresa_id" ).isEqual( new Field( "empresas.id" ) ) - }, - new String[]{ "empresas.id", "empresas.designacao_social", "empresas.actividade", - "estabelecimentos.id", "estabelecimentos.nome", - "hs_relatorio.data", "marcacoes_estabelecimento.data", - "hs_relatorio.acompanhante1", "hs_relatorio.funcao_acompanhante1", - "hs_relatorio.acompanhante2", "hs_relatorio.funcao_acompanhante2", - "hs_relatorio.funcionarios", "estabelecimentos.morada", - "hs_relatorio.avaliacao_inicial"}, - new Field( "hs_relatorio.id" ).isEqual( id ), - null, - null, - null, - null ); + Select select = new Select2( + new String[]{ "hs_relatorio", "marcacoes_estabelecimento", "estabelecimentos", "empresas" }, + new Integer[]{ Select2.JOIN_INNER, Select2.JOIN_INNER, Select2.JOIN_INNER }, + new Expression[]{ + new Field( "hs_relatorio.marcacao_id" ).isEqual( new Field( "marcacoes_estabelecimento.id" ) ), + new Field( "marcacoes_estabelecimento.estabelecimento_id" ).isEqual( new Field( "estabelecimentos.id" ) ), + new Field( "estabelecimentos.empresa_id" ).isEqual( new Field( "empresas.id" ) ) + }, + new String[]{ + "empresas.id", "empresas.designacao_social", "empresas.actividade", + "estabelecimentos.id", "estabelecimentos.nome", + "hs_relatorio.data", "marcacoes_estabelecimento.data", + "hs_relatorio.acompanhante1", "hs_relatorio.funcao_acompanhante1", + "hs_relatorio.acompanhante2", "hs_relatorio.funcao_acompanhante2", + "hs_relatorio.funcionarios", "estabelecimentos.morada", + "hs_relatorio.avaliacao_inicial"}, + new Field( "hs_relatorio.id" ).isEqual( id ), + null, + null, + null, + null + ); +// System.out.println( "\ngetRelatorioToPrint() : " + select.toString() ); + array = EXECUTER.executeQuery( select ); Integer empresaId = ( Integer ) array.get( 0, 0 ); String nomeEmpresa = ( String ) array.get( 0, 1 ); @@ -135,20 +138,20 @@ public class RelatorioPrintDataProvider "http://www.evolute.pt:13080/SIPRPImages/image?id=" + logoId, nomeEstabelecimento, actividadeEmpresa, nomeAcompanhante, funcaoAcompanhante, nomeAcompanhante2, funcaoAcompanhante2, morada ); - RelatorioToPrint plano = - new RelatorioToPrint( - empresa, - dataRelatorio != null ? new DataToPrint( "data-relatorio", dataRelatorio ) : null, - dataVisita != null ? new DataToPrint( "data-hs", dataVisita ) : null, - tipoAvaliacao, - dataProximaVisita != null ? new DataToPrint( "data-proxima-hs", dataProximaVisita ) : null, - textoFuncionarios, - getTecnicoHS( id ), - getTecnicoSuperiorHS( id ), - getLegislacaoAplicavel( id ), - getNormalizacaoAplicavel( id ), - getEquipamento( id ), - getAreasToPrint( id ) ); + RelatorioToPrint plano = new RelatorioToPrint( + empresa, + dataRelatorio != null ? new DataToPrint( "data-relatorio", dataRelatorio ) : null, + dataVisita != null ? new DataToPrint( "data-hs", dataVisita ) : null, + tipoAvaliacao, + dataProximaVisita != null ? new DataToPrint( "data-proxima-hs", dataProximaVisita ) : null, + textoFuncionarios, + getTecnicoHS( id ), + getTecnicoSuperiorHS( id ), + getLegislacaoAplicavel( id ), + getNormalizacaoAplicavel( id ), + getEquipamento( id ), + getAreasToPrint( id ) + ); return plano; } @@ -384,24 +387,28 @@ public class RelatorioPrintDataProvider Virtual2DArray array; Vector areas = new Vector(); - Select select = - new Select2( - new String[]{ "hs_relatorio_area" }, - new Integer[]{}, - new Expression[]{}, - new String[]{ "id", "description", "ordem" }, - new Field( "relatorio_id" ).isEqual( relatorioId ).and( - new Field( "deleted_date" ).isEqual( null ) ), - new String[]{ "id" }, - null, - null, - null ); + Select select = new Select2( + new String[]{ "hs_relatorio_area" }, + new Integer[]{}, + new Expression[]{}, + new String[]{ "id", "description", "ordem" }, + new Field( "relatorio_id" ).isEqual( relatorioId ).and( + new Field( "deleted_date" ).isEqual( null ) ), + new String[]{ "id" }, + null, + null, + null + ); +// System.out.println( "\ngetAreasToPrint( " + relatorioId + " ) : " + select.toString() ); array = EXECUTER.executeQuery( select ); for( int n = 0; n < array.columnLength(); n++ ) { Integer areaId = ( Integer ) array.get( n, 0 ); String areaDescricao = ( String ) array.get( n, 1 ); + +// System.out.println( "\n\t\tAREA : " + areaDescricao ); + Integer ordem = ( Integer ) array.get( n, 2 ); Vector postos = getPostosToPrintByAreaId( areaId ); if( postos.size() > 0 ) @@ -423,22 +430,31 @@ public class RelatorioPrintDataProvider { Vector postos = new Vector(); Virtual2DArray array; - Select select = - new Select2( - new String[]{ "hs_relatorio_posto" }, - new Integer[]{}, - new Expression[]{}, - new String[]{ "hs_relatorio_posto.id", "hs_relatorio_posto.description", "coalesce(hs_relatorio_posto.is_principal,'FALSE')" }, - new Field( "hs_relatorio_posto.area_id" ).isEqual( areaId ), - new String[]{ "coalesce(hs_relatorio_posto.is_principal,'FALSE') DESC", "hs_relatorio_posto.id" }, - null, - null, - null ); + Select select = new Select2( + new String[]{ "hs_relatorio_posto" }, + new Integer[]{}, + new Expression[]{}, + new String[]{ + "hs_relatorio_posto.id", "hs_relatorio_posto.description", "coalesce(hs_relatorio_posto.is_principal,'FALSE')" + }, + new Field( "hs_relatorio_posto.area_id" ).isEqual( areaId ).and( + new Field( "hs_relatorio_posto.deleted_date" ).isEqual( null ) + ), + new String[]{ "coalesce(hs_relatorio_posto.is_principal,'FALSE') DESC", "hs_relatorio_posto.id" }, + null, + null, + null + ); +// System.out.println( "\n\tgetPostosToPrintByAreaId( " + areaId + " ) : " + select.toString() ); + array = EXECUTER.executeQuery( select ); for( int n = 0; n < array.columnLength(); n++ ) { Integer id = ( Integer ) array.get( n, 0 ); String descricao = ( String ) array.get( n, 1 ); + +// System.out.println( "\n\t\t\tPOSTO : " + descricao ); + Boolean generico = ( Boolean ) array.get( n, 2 ); postos.add( new PostoToPrint( descricao, getRiscosToPrintByPostoId( id ), generico ) ); } @@ -450,28 +466,33 @@ public class RelatorioPrintDataProvider { Virtual2DArray array; Vector riscos = new Vector(); - Select select = - new Select2( - new String[]{ "hs_relatorio_risco", "hs_relatorio_posto_risco", "hs_relatorio_risco_valor_qualitativo" }, - new Integer[]{ Select2.JOIN_INNER, Select2.JOIN_LEFT_OUTER }, - new Expression[]{ - new Field( "hs_relatorio_risco.id" ).isEqual( new Field( "hs_relatorio_posto_risco.risco_id" ) ), - new Field( "hs_relatorio_posto_risco.valor_qualitativo_id" ).isEqual( new Field( "hs_relatorio_risco_valor_qualitativo.id" ) ) - }, - new String[]{ "hs_relatorio_risco.id", - "hs_relatorio_risco.description", - "hs_relatorio_posto_risco.probabilidade", - "hs_relatorio_posto_risco.severidade", - "hs_relatorio_risco_valor_qualitativo.description" }, - new Field( "hs_relatorio_posto_risco.posto_id" ).isEqual( postoId ).and( - new Field( "hs_relatorio_risco.deleted_date" ).isEqual( null ).and( - new Field("hs_relatorio_posto_risco.probabilidade").isDifferent(null).or( - new Field("hs_relatorio_posto_risco.severidade").isDifferent(null).or( - new Field("hs_relatorio_posto_risco.valor_qualitativo_id").isDifferent(null)))) ), - new String[]{ "hs_relatorio_posto_risco.probabilidade*hs_relatorio_posto_risco.severidade DESC" }, - null, - null, - null ); + Select select = new Select2( + new String[]{ "hs_relatorio_risco", "hs_relatorio_posto_risco", "hs_relatorio_risco_valor_qualitativo" }, + new Integer[]{ Select2.JOIN_INNER, Select2.JOIN_LEFT_OUTER }, + new Expression[]{ + new Field( "hs_relatorio_risco.id" ).isEqual( new Field( "hs_relatorio_posto_risco.risco_id" ) ), + new Field( "hs_relatorio_posto_risco.valor_qualitativo_id" ).isEqual( new Field( "hs_relatorio_risco_valor_qualitativo.id" ) ) + }, + new String[]{ + "hs_relatorio_risco.id", "hs_relatorio_risco.description", "hs_relatorio_posto_risco.probabilidade", + "hs_relatorio_posto_risco.severidade", "hs_relatorio_risco_valor_qualitativo.description" + }, + new Field( "hs_relatorio_posto_risco.posto_id" ).isEqual( postoId ).and( + new Field( "hs_relatorio_risco.deleted_date" ).isEqual( null ).and( + new Field( "hs_relatorio_posto_risco.probabilidade" ).isDifferent( null ).or( + new Field( "hs_relatorio_posto_risco.severidade" ).isDifferent( null ).or( + new Field( "hs_relatorio_posto_risco.valor_qualitativo_id" ).isDifferent( null ) + ) + ) + ) + ), + new String[]{ "hs_relatorio_posto_risco.probabilidade*hs_relatorio_posto_risco.severidade DESC" }, + null, + null, + null + ); +// System.out.println( "\n\t\tgetRiscosToPrintByPostoId( " + postoId + " ) : " + select.toString() ); + array = EXECUTER.executeQuery( select ); Vector riscosVector = new Vector(); HashMap> riscosIdMap = new HashMap>(); @@ -479,6 +500,9 @@ public class RelatorioPrintDataProvider { Integer id = ( Integer ) array.get( n, 0 ); String descricao = ( String ) array.get( n, 1 ); + +// System.out.println( "\n\t\t\t\tRISCO : " + descricao ); + Integer probabilidade = ( Integer ) array.get( n, 2 ); Integer severidade = ( Integer ) array.get( n, 3 ); String valorQualitativo = ( String ) array.get( n, 4 ); @@ -555,18 +579,21 @@ public class RelatorioPrintDataProvider throws Exception { Vector medidas = new Vector(); - Select select = - new Select2( - new String[]{ "hs_relatorio_medida" }, - new Integer[]{}, - new Expression[]{}, - new String[]{ "hs_relatorio_medida.id", "hs_relatorio_medida.requesitos_legais", "hs_relatorio_medida.description" }, - new Field( "hs_relatorio_medida.risco_id" ).isEqual( riscoId ).and( - new Field( "hs_relatorio_medida.deleted_date" ).isEqual( null ) ), - new String[]{ "hs_relatorio_medida.id" }, - null, - null, - null ); + Select select = new Select2( + new String[]{ "hs_relatorio_medida" }, + new Integer[]{}, + new Expression[]{}, + new String[]{ + "hs_relatorio_medida.id", "hs_relatorio_medida.requesitos_legais", "hs_relatorio_medida.description" + }, + new Field( "hs_relatorio_medida.risco_id" ).isEqual( riscoId ).and( + new Field( "hs_relatorio_medida.deleted_date" ).isEqual( null ) + ), + new String[]{ "hs_relatorio_medida.id" }, + null, + null, + null + ); Virtual2DArray array = EXECUTER.executeQuery( select ); for( int n = 0; n < array.columnLength(); n++ ) { diff --git a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/print/relatorio.xsl b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/print/relatorio.xsl index c28c025d..2e673790 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/print/relatorio.xsl +++ b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/print/relatorio.xsl @@ -36,9 +36,9 @@ - + - + @@ -2093,40 +2093,32 @@ + font-size="14pt" space-after="3pt" text-align="start" text-indent="0cm" space-before="12pt"> + font-size="14pt" space-after="3pt" text-align="start" text-indent="0cm" space-before="12pt"> + margin-right="-0.0146in" text-indent="0in" text-align="justify" line-height="130%" margin-left="0in"> A SIPRP acompanha a execução das medidas de prevenção através de assessoramento ao cliente durante o preenchimento do Plano de Actuação.   + font-size="14pt" space-after="3pt" text-align="start" text-indent="0cm" space-before="12pt"> + margin-right="-0.0146in" text-indent="0in" text-align="justify" line-height="130%" margin-left="0in"> A execução das medidas de prevenção são verificadas através da realização da avaliação dos riscos profissionais periódica.   + font-size="14pt" space-after="3pt" text-align="start" text-indent="0cm" space-before="12pt"> + font-size="14pt" space-after="3pt" text-align="start" text-indent="0cm" space-before="12pt"> + font-size="14pt" space-after="3pt" text-align="start" text-indent="0cm" space-before="12pt"> @@ -2142,88 +2134,69 @@ + font-size="14pt" space-after="3pt" text-align="start" text-indent="0cm" space-before="12pt"> + font-size="14pt" space-after="3pt" text-align="start" text-indent="0cm" space-before="12pt"> - + A SIPRP agradece a disponibilidade e o apoio de todos os colaboradores da empresa e fica ao dispor para qualquer esclarecimento. + font-size="14pt" space-after="3pt" text-align="start" text-indent="0cm" space-before="12pt"> + font-size="14pt" space-after="3pt" text-align="start" text-indent="0cm" space-before="12pt"> + font-size="14pt" space-after="3pt" text-align="start" text-indent="0cm" space-before="12pt"> - + Lisboa, de - + de - +   - +  Realizado por: - + - + + content-width="4in" content-height="40pt" scaling-method="auto" scaling="uniform" /> - + + font-weight="bold" margin-right="0in" text-indent="0.2134in" text-align="center" margin-left="-0.2134in">   - - Técnico de Higiene e Segurança   - CAP nº @@ -2236,19 +2209,16 @@ - +  Verificado por: - + - + + margin-right="-0.0937in" text-indent="0in" text-align="center" margin-left="0in"> Técnico Superior de Higiene e Segurança   + margin-right="-0.0937in" text-indent="0in" text-align="center" margin-left="0in"> CAP nº @@ -2291,8 +2259,7 @@ - + @@ -2300,8 +2267,7 @@ - + @@ -2509,125 +2475,88 @@ - + border="0.0069in solid #000000" display-align="center" background-color="#808080" writing-mode="lr-tb"> + Grav.   - + (G)   - - + + Prob.   - + (P)   - - + + Valor Risco   - + (G x P)   - - - + + risco / requisito legal e medidas de prevenção + + - - - - - -   - - - - -   - - - - -   - - - - -   - - - - - + + + + + +   + + + + +   + + + + +   + + + + +   + + + + + + + + + @@ -2643,32 +2572,22 @@ - - +   - +   - +   - @@ -2680,32 +2599,21 @@ - - + +   - +   - +   - @@ -2717,37 +2625,25 @@ - - + +   - +   - +   - - @@ -2790,59 +2686,42 @@ - + - - + +   - +   - + - +   - + - + - - + @@ -2856,18 +2735,14 @@ - +   - + @@ -2878,17 +2753,13 @@ - +   - +   diff --git a/trunk/SIPRPSoft/src/siprp/planoactuacao/print/plano_actuacao.xsl b/trunk/SIPRPSoft/src/siprp/planoactuacao/print/plano_actuacao.xsl index a5786e02..899737d0 100644 --- a/trunk/SIPRPSoft/src/siprp/planoactuacao/print/plano_actuacao.xsl +++ b/trunk/SIPRPSoft/src/siprp/planoactuacao/print/plano_actuacao.xsl @@ -195,7 +195,7 @@ - +