git-svn-id: https://svn.coded.pt/svn/SIPRP@989 bb69d46d-e84e-40c8-a05a-06db0d633741

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Frederico Palma 17 years ago
parent e907f465b5
commit 0dde5bd777

@ -154,7 +154,7 @@ public class PlanoActuacaoPrintDataProvider
empresa,
dataRelatorio != null ? new DataToPrint( "data-relatorio", dataRelatorio ) : null,
dataVisita != null ? new DataToPrint( "data-hs", dataVisita ) : null,
getLegislacaoAplicavel( empresaId, estabelecimentoId ),
getLegislacaoAplicavel( id ),
getAreasToPrintByPlanoId( id, validacaoDl, validacaoDns ),
observacoesDl,
observacoesDns );
@ -179,11 +179,30 @@ public class PlanoActuacaoPrintDataProvider
return array.columnLength() > 0 ? ( Integer ) array.get( 0, 0 ) : null;
}
public LegislacaoAplicavelToPrint getLegislacaoAplicavel( Integer empresaId, Integer estabelecimentoId )
public LegislacaoAplicavelToPrint getLegislacaoAplicavel( Integer planoId )
throws Exception
{
LegislacaoAplicavelToPrint legislacao = new LegislacaoAplicavelToPrint( new Vector<String>() );
Select select =
new Select2(
new String[]{ "hs_relatorio_legislacao" },
new Integer[]{},
new Expression[]{},
new String[]{ "hs_relatorio_legislacao.categoria", "hs_relatorio_legislacao.descricao" },
new Field( "hs_relatorio_legislacao.hs_relatorio_id" ).isEqual( planoId ).and(
new Field( "hs_relatorio_legislacao.categoria" ).isEqual( null ) ),
null,
null,
null,
null );
Virtual2DArray array = LOCAL_EXECUTER.executeQuery( select );
Vector<String> diplomas = new Vector<String>();
for( int n = 0; n < array.columnLength(); n++ )
{
String descricao = ( String ) array.get( n, 0 );
diplomas.add( descricao );
}
LegislacaoAplicavelToPrint legislacao =
new LegislacaoAplicavelToPrint( diplomas );
return legislacao;
}

Loading…
Cancel
Save