|  |  | @ -179,6 +179,34 @@ public class PlanoActuacaoPrintDataProvider | 
			
		
	
		
		
			
				
					
					|  |  |  | 		return array.columnLength() > 0 ? ( Integer ) array.get( 0, 0 ) : null; |  |  |  | 		return array.columnLength() > 0 ? ( Integer ) array.get( 0, 0 ) : null; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //	public LegislacaoAplicavelToPrint getLegislacaoAplicavel( Integer planoId )
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //		throws Exception
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //	{
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //		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;
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //	}
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	public LegislacaoAplicavelToPrint getLegislacaoAplicavel( Integer planoId ) |  |  |  | 	public LegislacaoAplicavelToPrint getLegislacaoAplicavel( Integer planoId ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 	throws Exception |  |  |  | 	throws Exception | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
	
		
		
			
				
					|  |  | @ -188,22 +216,36 @@ public class PlanoActuacaoPrintDataProvider | 
			
		
	
		
		
			
				
					
					|  |  |  | 			new Integer[]{}, |  |  |  | 			new Integer[]{}, | 
			
		
	
		
		
			
				
					
					|  |  |  | 			new Expression[]{}, |  |  |  | 			new Expression[]{}, | 
			
		
	
		
		
			
				
					
					|  |  |  | 			new String[]{ "hs_relatorio_legislacao.categoria", "hs_relatorio_legislacao.descricao" }, |  |  |  | 			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.hs_relatorio_id" ).isEqual( planoId ), | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 					new Field( "hs_relatorio_legislacao.categoria" ).isEqual( null ) ), |  |  |  | 			new String[]{ "hs_relatorio_legislacao.categoria DESC" }, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 				null, |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 			null, |  |  |  | 			null, | 
			
		
	
		
		
			
				
					
					|  |  |  | 			null, |  |  |  | 			null, | 
			
		
	
		
		
			
				
					
					|  |  |  | 			null ); |  |  |  | 			null ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 	Virtual2DArray array = LOCAL_EXECUTER.executeQuery( select ); |  |  |  | 	Virtual2DArray array = LOCAL_EXECUTER.executeQuery( select ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		Vector<String> diplomas = new Vector<String>(); |  |  |  | 	Vector<String> diplomasGerais = new Vector<String>(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	Vector<String> nomes = new Vector<String>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	Vector<Vector<String>> diplomas = new Vector<Vector<String>>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	String last = null; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	for( int n = 0; n < array.columnLength(); n++ ) |  |  |  | 	for( int n = 0; n < array.columnLength(); n++ ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ |  |  |  | 	{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 			String descricao = ( String ) array.get( n, 0 ); |  |  |  | 		String categoria = ( String ) array.get( n, 0 ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			diplomas.add( descricao ); |  |  |  | 		String descricao = ( String ) array.get( n, 1 ); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		if( categoria == null || categoria.trim().length() == 0 ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			diplomasGerais.add( descricao ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		else | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			if( !categoria.equals( last ) ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				nomes.add( categoria ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				diplomas.add( new Vector<String>() ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			diplomas.lastElement().add( descricao ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | 	LegislacaoAplicavelToPrint legislacao =  |  |  |  | 	LegislacaoAplicavelToPrint legislacao =  | 
			
		
	
		
		
			
				
					
					|  |  |  | 			new LegislacaoAplicavelToPrint( diplomas ); |  |  |  | 		new LegislacaoAplicavelToPrint( diplomasGerais); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 		 |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 	return legislacao; |  |  |  | 	return legislacao; | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 |  |  |  | 	 | 
			
		
	
	
		
		
			
				
					|  |  | @ -303,7 +345,7 @@ public class PlanoActuacaoPrintDataProvider | 
			
		
	
		
		
			
				
					
					|  |  |  | 				riscos.add( |  |  |  | 				riscos.add( | 
			
		
	
		
		
			
				
					
					|  |  |  | 					new RiscoToPrint(  |  |  |  | 					new RiscoToPrint(  | 
			
		
	
		
		
			
				
					
					|  |  |  | 						descricao,  |  |  |  | 						descricao,  | 
			
		
	
		
		
			
				
					
					|  |  |  | 						valor, |  |  |  | 						valor+"", | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 						getMedidasToPrintByRiscoId( id ),  |  |  |  | 						getMedidasToPrintByRiscoId( id ),  | 
			
		
	
		
		
			
				
					
					|  |  |  | 						responsavelExecucao,  |  |  |  | 						responsavelExecucao,  | 
			
		
	
		
		
			
				
					
					|  |  |  | 						recursosNecessarios, |  |  |  | 						recursosNecessarios, | 
			
		
	
	
		
		
			
				
					|  |  | @ -318,17 +360,18 @@ public class PlanoActuacaoPrintDataProvider | 
			
		
	
		
		
			
				
					
					|  |  |  | 		{ |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Select select =  |  |  |  | 			Select select =  | 
			
		
	
		
		
			
				
					
					|  |  |  | 				new Select2(  |  |  |  | 				new Select2(  | 
			
		
	
		
		
			
				
					
					|  |  |  | 					new String[]{ "hs_relatorio_risco", "hs_relatorio_posto_risco", "hs_relatorio_posto" }, |  |  |  | 					new String[]{ "hs_relatorio_risco", "hs_relatorio_posto_risco", "hs_relatorio_posto", "hs_relatorio_risco_valor_qualitativo" }, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 					new Integer[]{ Select2.JOIN_INNER, Select2.JOIN_INNER }, |  |  |  | 					new Integer[]{ Select2.JOIN_INNER, Select2.JOIN_INNER, Select2.JOIN_LEFT_OUTER }, | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 					new Expression[]{ |  |  |  | 					new Expression[]{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 						new Field( "hs_relatorio_risco.id" ).isEqual( new Field( "hs_relatorio_posto_risco.risco_id" ) ), |  |  |  | 						new Field( "hs_relatorio_risco.id" ).isEqual( new Field( "hs_relatorio_posto_risco.risco_id" ) ), | 
			
		
	
		
		
			
				
					
					|  |  |  | 						new Field( "hs_relatorio_posto_risco.posto_id" ).isEqual( new Field( "hs_relatorio_posto.id" ) ) |  |  |  | 						new Field( "hs_relatorio_posto_risco.posto_id" ).isEqual( new Field( "hs_relatorio_posto.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",  |  |  |  | 					new String[]{ "hs_relatorio_risco.id",  | 
			
		
	
		
		
			
				
					
					|  |  |  | 							"hs_relatorio_risco.description",  |  |  |  | 							"hs_relatorio_risco.description",  | 
			
		
	
		
		
			
				
					
					|  |  |  | 							"hs_relatorio_posto_risco.probabilidade * hs_relatorio_posto_risco.severidade",  |  |  |  | 							"hs_relatorio_posto_risco.probabilidade * hs_relatorio_posto_risco.severidade",  | 
			
		
	
		
		
			
				
					
					|  |  |  | 							"null", |  |  |  | 							"hs_relatorio_risco_valor_qualitativo.description",  | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 							"null",  |  |  |  | 							"hs_relatorio_posto.id", | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 							"null",  |  |  |  | 							"null",  | 
			
		
	
		
		
			
				
					
					|  |  |  | 							"null", |  |  |  | 							"null", | 
			
		
	
		
		
			
				
					
					|  |  |  | 							"null",  |  |  |  | 							"null",  | 
			
		
	
	
		
		
			
				
					|  |  | @ -344,32 +387,47 @@ public class PlanoActuacaoPrintDataProvider | 
			
		
	
		
		
			
				
					
					|  |  |  | 			array = LOCAL_EXECUTER.executeQuery( select ); |  |  |  | 			array = LOCAL_EXECUTER.executeQuery( select ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Vector<String> riscosVector = new Vector<String>(); |  |  |  | 			Vector<String> riscosVector = new Vector<String>(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			HashMap<String,Vector<Integer>> riscosIdMap = new HashMap<String,Vector<Integer>>(); |  |  |  | 			HashMap<String,Vector<Integer>> riscosIdMap = new HashMap<String,Vector<Integer>>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			HashMap<Integer,Integer> riscoPostoMap = new HashMap<Integer, Integer>(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			for( int n = 0; n < array.columnLength(); n++ ) |  |  |  | 			for( int n = 0; n < array.columnLength(); n++ ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 			{ |  |  |  | 			{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 				Integer id = ( Integer ) array.get( n, 0 ); |  |  |  | 				Integer id = ( Integer ) array.get( n, 0 ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				String descricao = ( String ) array.get( n, 1 ); |  |  |  | 				String descricao = ( String ) array.get( n, 1 ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				Integer risco = ( Integer ) array.get( n, 2 ); |  |  |  | 				Integer risco = ( Integer ) array.get( n, 2 ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				if( risco == null ) |  |  |  | 				String risco_qual = ((String) array.get( n, 3)); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 				{ |  |  |  | 				if(risco_qual!=null){ | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					risco_qual = risco_qual.substring(0, 3).toUpperCase(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				Integer posto = ( Integer ) array.get( n, 4 ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				String finalRisco; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				if(risco!=null){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					finalRisco = ""+risco; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				}else if(risco_qual!=null){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					finalRisco = ""+risco_qual; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				}else{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 					continue; |  |  |  | 					continue; | 
			
		
	
		
		
			
				
					
					|  |  |  | 				} |  |  |  | 				} | 
			
		
	
		
		
			
				
					
					|  |  |  | 				String key = descricao + "_" + risco; |  |  |  | 				 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				String key = descricao + "_" + finalRisco; | 
			
		
	
		
		
			
				
					
					|  |  |  | 				if( !riscosIdMap.containsKey( key ) ) |  |  |  | 				if( !riscosIdMap.containsKey( key ) ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 				{ |  |  |  | 				{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 					riscosIdMap.put( key, new Vector<Integer>() ); |  |  |  | 					riscosIdMap.put( key, new Vector<Integer>() ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 					riscosVector.add( key ); |  |  |  | 					riscosVector.add( key ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				} |  |  |  | 				} | 
			
		
	
		
		
			
				
					
					|  |  |  | 				riscosIdMap.get( key ).add( id ); |  |  |  | 				riscosIdMap.get( key ).add( id ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				riscoPostoMap.put(id, posto); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			} |  |  |  | 			} | 
			
		
	
		
		
			
				
					
					|  |  |  | 			for( String risco : riscosVector ) |  |  |  | 			for( String risco : riscosVector ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 			{ |  |  |  | 			{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 				int index = risco.lastIndexOf( "_" ); |  |  |  | 				int index = risco.lastIndexOf( "_" ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				String descricao = risco.substring( 0, index ); |  |  |  | 				String descricao = risco.substring( 0, index ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				Integer valor = new Integer( risco.substring( index + 1, risco.length() ) ); |  |  |  | 				String valor = risco.substring( index + 1, risco.length() ) ; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 				Vector<MedidaToPrint> medidas = new Vector<MedidaToPrint>(); |  |  |  | 				Vector<MedidaToPrint> medidas = new Vector<MedidaToPrint>(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				for( Integer id : riscosIdMap.get( risco ) ) |  |  |  | 				for( Integer id : riscosIdMap.get( risco ) ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 				{ |  |  |  | 				{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 					medidas.addAll( getMedidasToPrintByRiscoId( id ) ); |  |  |  | 					Integer posto = riscoPostoMap.get(id);  | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					medidas.addAll( getMedidasToPrintByRiscoId( id , posto) ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				} |  |  |  | 				} | 
			
		
	
		
		
			
				
					
					|  |  |  | 				if( medidas.size() > 0 ) |  |  |  | 				if( medidas.size() > 0 ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 				{ |  |  |  | 				{ | 
			
		
	
	
		
		
			
				
					|  |  | @ -392,7 +450,11 @@ public class PlanoActuacaoPrintDataProvider | 
			
		
	
		
		
			
				
					
					|  |  |  | 		return riscos; |  |  |  | 		return riscos; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	public Vector<MedidaToPrint> getMedidasToPrintByRiscoId( Integer riscoId ) |  |  |  | 	public Vector<MedidaToPrint> getMedidasToPrintByRiscoId( Integer riscoId) throws Exception{ | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		return getMedidasToPrintByRiscoId(riscoId, null); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	public Vector<MedidaToPrint> getMedidasToPrintByRiscoId( Integer riscoId, Integer posto ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 		throws Exception |  |  |  | 		throws Exception | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ |  |  |  | 	{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 		Vector<MedidaToPrint> medidas = new Vector<MedidaToPrint>(); |  |  |  | 		Vector<MedidaToPrint> medidas = new Vector<MedidaToPrint>(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -414,15 +476,21 @@ public class PlanoActuacaoPrintDataProvider | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  | 		else |  |  |  | 		else | 
			
		
	
		
		
			
				
					
					|  |  |  | 		{ |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			Expression filter = new Field( "hs_relatorio_medida.risco_id" ).isEqual( riscoId ).and(  | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					new Field( "hs_relatorio_medida.deleted_date" ).isEqual( null ) ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					.and(new Field("hs_relatorio_medida.description").isDifferent("")); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			if(posto!=null){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				filter = filter.and(new Field("hs_relatorio_posto_medida.posto_id").isEqual(posto)); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			 | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Select select =  |  |  |  | 			Select select =  | 
			
		
	
		
		
			
				
					
					|  |  |  | 				new Select2( |  |  |  | 				new Select2( | 
			
		
	
		
		
			
				
					
					|  |  |  | 					new String[]{ "hs_relatorio_medida" }, |  |  |  | 					new String[]{"hs_relatorio_medida", "hs_relatorio_posto_medida"}, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 					new Integer[]{}, |  |  |  | 					new Integer[]{Select2.JOIN_INNER}, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 					new Expression[]{}, |  |  |  | 					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" }, |  |  |  | 					new String[]{ "hs_relatorio_medida.id", "hs_relatorio_medida.description", "hs_relatorio_posto_medida.is_plano_actuacao" }, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 					new Field( "hs_relatorio_medida.risco_id" ).isEqual( riscoId ).and(  |  |  |  | 					filter, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 						new Field( "hs_relatorio_medida.deleted_date" ).isEqual( null ) ) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 						.and(new Field("hs_relatorio_medida.description").isDifferent("")), |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 					new String[]{ "hs_relatorio_medida.id" }, |  |  |  | 					new String[]{ "hs_relatorio_medida.id" }, | 
			
		
	
		
		
			
				
					
					|  |  |  | 					null, |  |  |  | 					null, | 
			
		
	
		
		
			
				
					
					|  |  |  | 					null, |  |  |  | 					null, | 
			
		
	
	
		
		
			
				
					|  |  | @ -433,8 +501,9 @@ public class PlanoActuacaoPrintDataProvider | 
			
		
	
		
		
			
				
					
					|  |  |  | 		{ |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Integer id = ( Integer ) array.get( n, 0 ); |  |  |  | 			Integer id = ( Integer ) array.get( n, 0 ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			String descricao = ( String ) array.get( n, 1 ); |  |  |  | 			String descricao = ( String ) array.get( n, 1 ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			Boolean isPlanoActuacao = ( Boolean ) array.get( n, 2 ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Vector<PostoToPrint> postos = getPostosToPrintByMedidaId( id ); |  |  |  | 			Vector<PostoToPrint> postos = getPostosToPrintByMedidaId( id ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			if( postos.size() > 0 ) |  |  |  | 			if( postos.size() > 0 && isPlanoActuacao) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 			{ |  |  |  | 			{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 				medidas.add( new MedidaToPrint(	descricao, postos ) ); |  |  |  | 				medidas.add( new MedidaToPrint(	descricao, postos ) ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			} |  |  |  | 			} | 
			
		
	
	
		
		
			
				
					|  |  | 
 |