|
|
|
|
@ -582,17 +582,19 @@ public class PlanoActuacaoPrintDataProvider
|
|
|
|
|
Virtual2DArray array;
|
|
|
|
|
if( web )
|
|
|
|
|
{
|
|
|
|
|
Select select =
|
|
|
|
|
new Select2(
|
|
|
|
|
new String[]{ "plano_medidas" },
|
|
|
|
|
new Integer[]{},
|
|
|
|
|
new Expression[]{},
|
|
|
|
|
new String[]{ "id", "descricao", "true" },
|
|
|
|
|
new Field( "risco_id" ).isEqual( riscoId ),
|
|
|
|
|
new String[]{ "id" },
|
|
|
|
|
null,
|
|
|
|
|
null,
|
|
|
|
|
null );
|
|
|
|
|
Select select = new Select2(
|
|
|
|
|
new String[]{ "plano_medidas", "estado_medidas" },
|
|
|
|
|
new Integer[] { Select2.JOIN_LEFT_OUTER },
|
|
|
|
|
new Expression[]{
|
|
|
|
|
new Field( "plano_medidas.estado_medidas_id" ).isEqual( new Field( "estado_medidas.id" ) )
|
|
|
|
|
},
|
|
|
|
|
new String[]{ "plano_medidas.id", "plano_medidas.descricao", "true", "estado_medidas.descricao" },
|
|
|
|
|
new Field( "plano_medidas.risco_id" ).isEqual( riscoId ),
|
|
|
|
|
new String[]{ "plano_medidas.id" },
|
|
|
|
|
null,
|
|
|
|
|
null,
|
|
|
|
|
null
|
|
|
|
|
);
|
|
|
|
|
array = WEB_EXECUTER.executeQuery( select );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -610,7 +612,10 @@ public class PlanoActuacaoPrintDataProvider
|
|
|
|
|
new String[]{"hs_relatorio_medida", "hs_relatorio_posto_medida"},
|
|
|
|
|
new Integer[]{Select2.JOIN_INNER},
|
|
|
|
|
new Expression[]{new Field("hs_relatorio_medida.id").isEqual(new Field("hs_relatorio_posto_medida.medida_id"))},
|
|
|
|
|
new String[]{ "hs_relatorio_medida.id", "hs_relatorio_medida.description", "hs_relatorio_posto_medida.is_plano_actuacao" },
|
|
|
|
|
new String[]{
|
|
|
|
|
"hs_relatorio_medida.id", "hs_relatorio_medida.description", "hs_relatorio_posto_medida.is_plano_actuacao"
|
|
|
|
|
, "'' AS estado_medidas_descricao"
|
|
|
|
|
},
|
|
|
|
|
filter,
|
|
|
|
|
new String[]{ "hs_relatorio_medida.id" },
|
|
|
|
|
null,
|
|
|
|
|
@ -623,15 +628,25 @@ public class PlanoActuacaoPrintDataProvider
|
|
|
|
|
Integer id = ( Integer ) array.get( n, 0 );
|
|
|
|
|
String descricao = ( String ) array.get( n, 1 );
|
|
|
|
|
Boolean isPlanoActuacao = ( Boolean ) array.get( n, 2 );
|
|
|
|
|
Vector<PostoToPrint> postos = getPostosToPrintByMedidaId( id );
|
|
|
|
|
if( postos.size() > 0 && isPlanoActuacao)
|
|
|
|
|
String estado_medidas = ( String ) array.get( n, 3 );
|
|
|
|
|
Vector< PostoToPrint > postos = getPostosToPrintByMedidaId( id );
|
|
|
|
|
if( postos.size() > 0 && isPlanoActuacao )
|
|
|
|
|
{
|
|
|
|
|
if ( web )
|
|
|
|
|
{
|
|
|
|
|
descricao = StringConverterUtils.convertHTMLToText( descricao );
|
|
|
|
|
descricao = StringConverterUtils.stripHTMLTags( descricao );
|
|
|
|
|
if ( estado_medidas != null )
|
|
|
|
|
{
|
|
|
|
|
estado_medidas = StringConverterUtils.convertHTMLToText( estado_medidas );
|
|
|
|
|
estado_medidas = StringConverterUtils.stripHTMLTags( estado_medidas );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
estado_medidas = "";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
medidas.add( new MedidaToPrint( descricao, postos ) );
|
|
|
|
|
medidas.add( new MedidaToPrint( descricao, estado_medidas, postos ) );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return medidas;
|
|
|
|
|
|