|  |  |  | @ -83,7 +83,7 @@ public class RelatorioPrintDataProvider | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	public RelatorioToPrint getPlanoToPrint( Integer id ) | 
			
		
	
		
			
				
					|  |  |  |  | 	public RelatorioToPrint getRelatorioToPrint( Integer id ) | 
			
		
	
		
			
				
					|  |  |  |  | 		throws Exception | 
			
		
	
		
			
				
					|  |  |  |  | 	{ | 
			
		
	
		
			
				
					|  |  |  |  | 		Virtual2DArray array;  | 
			
		
	
	
		
			
				
					|  |  |  | @ -99,9 +99,7 @@ public class RelatorioPrintDataProvider | 
			
		
	
		
			
				
					|  |  |  |  | 				}, | 
			
		
	
		
			
				
					|  |  |  |  | 				new String[]{ "empresas.id", "empresas.designacao_social", "empresas.actividade",  | 
			
		
	
		
			
				
					|  |  |  |  | 						"estabelecimentos.id", "estabelecimentos.nome",  | 
			
		
	
		
			
				
					|  |  |  |  | 						"hs_relatorio.data", "marcacoes_estabelecimento.data", "''",  | 
			
		
	
		
			
				
					|  |  |  |  | 						"''", "false",  | 
			
		
	
		
			
				
					|  |  |  |  | 						"false" }, | 
			
		
	
		
			
				
					|  |  |  |  | 						"hs_relatorio.data", "marcacoes_estabelecimento.data" }, | 
			
		
	
		
			
				
					|  |  |  |  | 				new Field( "hs_relatorio.id" ).isEqual( id ), | 
			
		
	
		
			
				
					|  |  |  |  | 				null, | 
			
		
	
		
			
				
					|  |  |  |  | 				null, | 
			
		
	
	
		
			
				
					|  |  |  | @ -116,23 +114,20 @@ public class RelatorioPrintDataProvider | 
			
		
	
		
			
				
					|  |  |  |  | 		Integer logoId = getLogotipoIdForEmpresaId( empresaId ); | 
			
		
	
		
			
				
					|  |  |  |  | 		Date dataRelatorio = ( Date ) array.get( 0, 5 ); | 
			
		
	
		
			
				
					|  |  |  |  | 		Date dataVisita = ( Date ) array.get( 0, 6 ); | 
			
		
	
		
			
				
					|  |  |  |  | 		String observacoesDl = ( String ) array.get( 0, 7 ); | 
			
		
	
		
			
				
					|  |  |  |  | 		String observacoesDns = ( String ) array.get( 0, 8 ); | 
			
		
	
		
			
				
					|  |  |  |  | 		Boolean validacaoDl = ( Boolean ) array.get( 0, 9 ); | 
			
		
	
		
			
				
					|  |  |  |  | 		Boolean validacaoDns = ( Boolean ) array.get( 0, 10 ); | 
			
		
	
		
			
				
					|  |  |  |  | 		EmpresaToPrint empresa = new EmpresaToPrint( nomeEmpresa, | 
			
		
	
		
			
				
					|  |  |  |  | 				"http://www.evolute.pt:13080/SIPRPImages/image?id=" + logoId, | 
			
		
	
		
			
				
					|  |  |  |  | 				nomeEstabelecimento, actividadeEmpresa ); | 
			
		
	
		
			
				
					|  |  |  |  | 		//TODO:
 | 
			
		
	
		
			
				
					|  |  |  |  | 		RelatorioToPrint plano = null; | 
			
		
	
		
			
				
					|  |  |  |  | //			new RelatorioToPrint( 
 | 
			
		
	
		
			
				
					|  |  |  |  | //				empresa, 
 | 
			
		
	
		
			
				
					|  |  |  |  | //				dataRelatorio != null ? new DataToPrint( "data-relatorio", dataRelatorio ) : null, 
 | 
			
		
	
		
			
				
					|  |  |  |  | //				dataVisita != null ? new DataToPrint( "data-hs", dataVisita ) : null, 
 | 
			
		
	
		
			
				
					|  |  |  |  | //				getLegislacaoAplicavel( empresaId, estabelecimentoId ), 
 | 
			
		
	
		
			
				
					|  |  |  |  | //				getAreasToPrintByPlanoId( id, validacaoDl, validacaoDns ),
 | 
			
		
	
		
			
				
					|  |  |  |  | //				observacoesDl,
 | 
			
		
	
		
			
				
					|  |  |  |  | //				observacoesDns );
 | 
			
		
	
		
			
				
					|  |  |  |  | 			new RelatorioToPrint(  | 
			
		
	
		
			
				
					|  |  |  |  | 				empresa,  | 
			
		
	
		
			
				
					|  |  |  |  | 				dataRelatorio != null ? new DataToPrint( "data-relatorio", dataRelatorio ) : null,  | 
			
		
	
		
			
				
					|  |  |  |  | 				dataVisita != null ? new DataToPrint( "data-hs", dataVisita ) : null, | 
			
		
	
		
			
				
					|  |  |  |  | 				null, //TODO: proxima hs
 | 
			
		
	
		
			
				
					|  |  |  |  | 				getLegislacaoAplicavel( id ), | 
			
		
	
		
			
				
					|  |  |  |  | 				getNormalizacaoAplicavel( id ), | 
			
		
	
		
			
				
					|  |  |  |  | 				getEquipamento( id ), | 
			
		
	
		
			
				
					|  |  |  |  | 				getAreasToPrint( id ) ); | 
			
		
	
		
			
				
					|  |  |  |  | 		return plano;  | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
	
		
			
				
					|  |  |  | @ -230,7 +225,34 @@ public class RelatorioPrintDataProvider | 
			
		
	
		
			
				
					|  |  |  |  | 		return new NormalizacaoToPrint( portuguesas, internacionais ); | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	public Vector<AreaToPrint> getAreasToPrintByPlanoId( Integer planoId, boolean validacaoDl, boolean validacaoDns ) | 
			
		
	
		
			
				
					|  |  |  |  | 	public EquipamentosToPrint getEquipamento( Integer relatorioId ) | 
			
		
	
		
			
				
					|  |  |  |  | 		throws Exception | 
			
		
	
		
			
				
					|  |  |  |  | 	{ | 
			
		
	
		
			
				
					|  |  |  |  | 		Select select =  | 
			
		
	
		
			
				
					|  |  |  |  | 			new Select2( | 
			
		
	
		
			
				
					|  |  |  |  | 				new String[]{ "hs_relatorio_equipamento" }, | 
			
		
	
		
			
				
					|  |  |  |  | 				new Integer[]{}, | 
			
		
	
		
			
				
					|  |  |  |  | 				new Expression[]{}, | 
			
		
	
		
			
				
					|  |  |  |  | 				new String[]{ "hs_relatorio_equipamento.tipo", "hs_relatorio_equipamento.marca",  | 
			
		
	
		
			
				
					|  |  |  |  | 						"hs_relatorio_equipamento.modelo" }, | 
			
		
	
		
			
				
					|  |  |  |  | 				new Field( "hs_relatorio_equipamento.relatorio_id" ).isEqual( relatorioId ), | 
			
		
	
		
			
				
					|  |  |  |  | 				null, | 
			
		
	
		
			
				
					|  |  |  |  | 				null, | 
			
		
	
		
			
				
					|  |  |  |  | 				null, | 
			
		
	
		
			
				
					|  |  |  |  | 				null ); | 
			
		
	
		
			
				
					|  |  |  |  | 		Virtual2DArray array = EXECUTER.executeQuery( select ); | 
			
		
	
		
			
				
					|  |  |  |  | 		EquipamentoToPrint equipamentos[] = new EquipamentoToPrint[ array.columnLength() ];  | 
			
		
	
		
			
				
					|  |  |  |  | 		for( int n = 0; n < array.columnLength(); n++ ) | 
			
		
	
		
			
				
					|  |  |  |  | 		{ | 
			
		
	
		
			
				
					|  |  |  |  | 			String tipo = ( String ) array.get( n, 0 ); | 
			
		
	
		
			
				
					|  |  |  |  | 			String marca = ( String ) array.get( n, 1 ); | 
			
		
	
		
			
				
					|  |  |  |  | 			String modelo = ( String ) array.get( n, 2 ); | 
			
		
	
		
			
				
					|  |  |  |  | 			equipamentos[ n ] = new EquipamentoToPrint( tipo, marca, modelo ); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		return new EquipamentosToPrint( equipamentos ); | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	public Vector<AreaToPrint> getAreasToPrint( Integer relatorioId ) | 
			
		
	
		
			
				
					|  |  |  |  | 		throws Exception | 
			
		
	
		
			
				
					|  |  |  |  | 	{ | 
			
		
	
		
			
				
					|  |  |  |  | 		Virtual2DArray array; | 
			
		
	
	
		
			
				
					|  |  |  | @ -242,7 +264,7 @@ public class RelatorioPrintDataProvider | 
			
		
	
		
			
				
					|  |  |  |  | 				new Integer[]{}, | 
			
		
	
		
			
				
					|  |  |  |  | 				new Expression[]{}, | 
			
		
	
		
			
				
					|  |  |  |  | 				new String[]{ "id", "description" }, | 
			
		
	
		
			
				
					|  |  |  |  | 				new Field( "relatorio_id" ).isEqual( planoId ).and( | 
			
		
	
		
			
				
					|  |  |  |  | 				new Field( "relatorio_id" ).isEqual( relatorioId ).and( | 
			
		
	
		
			
				
					|  |  |  |  | 					new Field( "deleted_date" ).isEqual( null ) ), | 
			
		
	
		
			
				
					|  |  |  |  | 				new String[]{ "id" }, | 
			
		
	
		
			
				
					|  |  |  |  | 				null, | 
			
		
	
	
		
			
				
					|  |  |  | @ -254,39 +276,60 @@ public class RelatorioPrintDataProvider | 
			
		
	
		
			
				
					|  |  |  |  | 		{ | 
			
		
	
		
			
				
					|  |  |  |  | 			Integer areaId = ( Integer ) array.get( n, 0 ); | 
			
		
	
		
			
				
					|  |  |  |  | 			String areaDescricao = ( String ) array.get( n, 1 ); | 
			
		
	
		
			
				
					|  |  |  |  | 			Vector<RiscoToPrint> riscos = getRiscosToPrintByAreaId( areaId, validacaoDl, validacaoDns ); | 
			
		
	
		
			
				
					|  |  |  |  | 			if( riscos.size() > 0 ) | 
			
		
	
		
			
				
					|  |  |  |  | 			Vector<PostoToPrint> postos = getPostosToPrintByAreaId( areaId ); | 
			
		
	
		
			
				
					|  |  |  |  | 			if( postos.size() > 0 ) | 
			
		
	
		
			
				
					|  |  |  |  | 			{ | 
			
		
	
		
			
				
					|  |  |  |  | 				areas.add( new AreaToPrint( areaDescricao, riscos ) ); | 
			
		
	
		
			
				
					|  |  |  |  | 				areas.add( new AreaToPrint( areaDescricao, postos ) ); | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		return areas; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	public Vector<RiscoToPrint> getRiscosToPrintByAreaId( Integer areaId, boolean validacaoDl, boolean validacaoDns ) | 
			
		
	
		
			
				
					|  |  |  |  | 	public Vector<PostoToPrint> getPostosToPrintByAreaId( Integer areaId ) | 
			
		
	
		
			
				
					|  |  |  |  | 		throws Exception | 
			
		
	
		
			
				
					|  |  |  |  | 	{ | 
			
		
	
		
			
				
					|  |  |  |  | 		Vector<PostoToPrint> postos = new Vector<PostoToPrint>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		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" }, | 
			
		
	
		
			
				
					|  |  |  |  | 				new Field( "hs_relatorio_posto.area_id" ).isEqual( areaId ), | 
			
		
	
		
			
				
					|  |  |  |  | 				new String[]{ "hs_relatorio_posto.id" }, | 
			
		
	
		
			
				
					|  |  |  |  | 				null, | 
			
		
	
		
			
				
					|  |  |  |  | 				null, | 
			
		
	
		
			
				
					|  |  |  |  | 				null ); | 
			
		
	
		
			
				
					|  |  |  |  | 		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 ); | 
			
		
	
		
			
				
					|  |  |  |  | 			postos.add( new PostoToPrint( descricao, getRiscosToPrintByPostoId( id ) ) ); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		return postos; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	public Vector<RiscoToPrint> getRiscosToPrintByPostoId( Integer postoId ) | 
			
		
	
		
			
				
					|  |  |  |  | 		throws Exception | 
			
		
	
		
			
				
					|  |  |  |  | 	{ | 
			
		
	
		
			
				
					|  |  |  |  | 		Virtual2DArray array; | 
			
		
	
		
			
				
					|  |  |  |  | 		Vector<RiscoToPrint> riscos = new Vector<RiscoToPrint>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		Select select =  | 
			
		
	
		
			
				
					|  |  |  |  | 			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_risco_valor_qualitativo" }, | 
			
		
	
		
			
				
					|  |  |  |  | 				new Integer[]{ Select2.JOIN_INNER, Select2.JOIN_INNER }, | 
			
		
	
		
			
				
					|  |  |  |  | 				new Expression[]{ | 
			
		
	
		
			
				
					|  |  |  |  | 					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.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",  | 
			
		
	
		
			
				
					|  |  |  |  | 						"null", | 
			
		
	
		
			
				
					|  |  |  |  | 						"null",  | 
			
		
	
		
			
				
					|  |  |  |  | 						"null",  | 
			
		
	
		
			
				
					|  |  |  |  | 						"null", | 
			
		
	
		
			
				
					|  |  |  |  | 						"null",  | 
			
		
	
		
			
				
					|  |  |  |  | 						"null",  | 
			
		
	
		
			
				
					|  |  |  |  | 						"null" }, | 
			
		
	
		
			
				
					|  |  |  |  | 				new Field( "hs_relatorio_posto.area_id" ).isEqual( areaId ).and(  | 
			
		
	
		
			
				
					|  |  |  |  | 						"hs_relatorio_posto_risco.probabilidade", | 
			
		
	
		
			
				
					|  |  |  |  | 						"hs_relatorio_posto_risco.severidade",  | 
			
		
	
		
			
				
					|  |  |  |  | 						"hs_relatorio_risco_valor_qualitativo.description" }, | 
			
		
	
		
			
				
					|  |  |  |  | 				new Field( "hs_relatorio_posto.posto_id" ).isEqual( postoId ).and(  | 
			
		
	
		
			
				
					|  |  |  |  | 					new Field( "hs_relatorio_risco.deleted_date" ).isEqual( null ) ).and(  | 
			
		
	
		
			
				
					|  |  |  |  | 					new Field( "hs_relatorio_posto.deleted_date" ).isEqual( null ) ), | 
			
		
	
		
			
				
					|  |  |  |  | 				new String[]{ "hs_relatorio_risco.id" }, | 
			
		
	
	
		
			
				
					|  |  |  | @ -300,44 +343,16 @@ public class RelatorioPrintDataProvider | 
			
		
	
		
			
				
					|  |  |  |  | 		{ | 
			
		
	
		
			
				
					|  |  |  |  | 			Integer id = ( Integer ) array.get( n, 0 ); | 
			
		
	
		
			
				
					|  |  |  |  | 			String descricao = ( String ) array.get( n, 1 ); | 
			
		
	
		
			
				
					|  |  |  |  | 			Integer risco = ( Integer ) array.get( n, 2 ); | 
			
		
	
		
			
				
					|  |  |  |  | 			if( risco == null ) | 
			
		
	
		
			
				
					|  |  |  |  | 			{ | 
			
		
	
		
			
				
					|  |  |  |  | 				continue; | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			String key = descricao + "_" + risco; | 
			
		
	
		
			
				
					|  |  |  |  | 			if( !riscosIdMap.containsKey( key ) ) | 
			
		
	
		
			
				
					|  |  |  |  | 			{ | 
			
		
	
		
			
				
					|  |  |  |  | 				riscosIdMap.put( key, new Vector<Integer>() ); | 
			
		
	
		
			
				
					|  |  |  |  | 				riscosVector.add( key ); | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			riscosIdMap.get( key ).add( id ); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		for( String risco : riscosVector ) | 
			
		
	
		
			
				
					|  |  |  |  | 		{ | 
			
		
	
		
			
				
					|  |  |  |  | 			int index = risco.lastIndexOf( "_" ); | 
			
		
	
		
			
				
					|  |  |  |  | 			String descricao = risco.substring( 0, index ); | 
			
		
	
		
			
				
					|  |  |  |  | 			Integer valor = new Integer( risco.substring( index + 1, risco.length() ) ); | 
			
		
	
		
			
				
					|  |  |  |  | 			Vector<MedidaToPrint> medidas = new Vector<MedidaToPrint>(); | 
			
		
	
		
			
				
					|  |  |  |  | 			for( Integer id : riscosIdMap.get( risco ) ) | 
			
		
	
		
			
				
					|  |  |  |  | 			{ | 
			
		
	
		
			
				
					|  |  |  |  | 				medidas.addAll( getMedidasToPrintByRiscoId( id ) ); | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			if( medidas.size() > 0 ) | 
			
		
	
		
			
				
					|  |  |  |  | 			{ | 
			
		
	
		
			
				
					|  |  |  |  | 				riscos.add( | 
			
		
	
		
			
				
					|  |  |  |  | 						new RiscoToPrint(  | 
			
		
	
		
			
				
					|  |  |  |  | 							descricao,  | 
			
		
	
		
			
				
					|  |  |  |  | 							valor, | 
			
		
	
		
			
				
					|  |  |  |  | 							medidas,  | 
			
		
	
		
			
				
					|  |  |  |  | 							null,  | 
			
		
	
		
			
				
					|  |  |  |  | 							null, | 
			
		
	
		
			
				
					|  |  |  |  | 							null,  | 
			
		
	
		
			
				
					|  |  |  |  | 							null, | 
			
		
	
		
			
				
					|  |  |  |  | 							null,  | 
			
		
	
		
			
				
					|  |  |  |  | 							null,  | 
			
		
	
		
			
				
					|  |  |  |  | 							null ) ); | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			Integer probabilidade = ( Integer ) array.get( n, 2 ); | 
			
		
	
		
			
				
					|  |  |  |  | 			Integer severidade = ( Integer ) array.get( n, 3 ); | 
			
		
	
		
			
				
					|  |  |  |  | 			String valorQualitativo = ( String ) array.get( n, 4 ); | 
			
		
	
		
			
				
					|  |  |  |  | 			riscos.add( | 
			
		
	
		
			
				
					|  |  |  |  | 					new RiscoToPrint(  | 
			
		
	
		
			
				
					|  |  |  |  | 						descricao,  | 
			
		
	
		
			
				
					|  |  |  |  | 						severidade, | 
			
		
	
		
			
				
					|  |  |  |  | 						probabilidade,  | 
			
		
	
		
			
				
					|  |  |  |  | 						valorQualitativo,  | 
			
		
	
		
			
				
					|  |  |  |  | 						getMedidasToPrintByRiscoId( id ) ) ); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		 | 
			
		
	
		
			
				
					|  |  |  |  | 		return riscos; | 
			
		
	
	
		
			
				
					|  |  |  | @ -347,48 +362,25 @@ public class RelatorioPrintDataProvider | 
			
		
	
		
			
				
					|  |  |  |  | 		throws Exception | 
			
		
	
		
			
				
					|  |  |  |  | 	{ | 
			
		
	
		
			
				
					|  |  |  |  | 		Vector<MedidaToPrint> medidas = new Vector<MedidaToPrint>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		Virtual2DArray array; | 
			
		
	
		
			
				
					|  |  |  |  | 		Select select =  | 
			
		
	
		
			
				
					|  |  |  |  | 			new Select2( | 
			
		
	
		
			
				
					|  |  |  |  | 				new String[]{ "hs_relatorio_medida" }, | 
			
		
	
		
			
				
					|  |  |  |  | 				new Integer[]{}, | 
			
		
	
		
			
				
					|  |  |  |  | 				new Expression[]{}, | 
			
		
	
		
			
				
					|  |  |  |  | 				new String[]{ "hs_relatorio_medida.id", "hs_relatorio_medida.description" }, | 
			
		
	
		
			
				
					|  |  |  |  | 				new String[]{ "hs_relatorio_medida.id", "hs_relatorio_medida.requisitos_legais" }, | 
			
		
	
		
			
				
					|  |  |  |  | 				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 ); | 
			
		
	
		
			
				
					|  |  |  |  | 		array = EXECUTER.executeQuery( select ); | 
			
		
	
		
			
				
					|  |  |  |  | 		return medidas; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	public Vector<PostoToPrint> getPostosToPrintByMedidaId( Integer medidaId ) | 
			
		
	
		
			
				
					|  |  |  |  | 		throws Exception | 
			
		
	
		
			
				
					|  |  |  |  | 	{ | 
			
		
	
		
			
				
					|  |  |  |  | 		Vector<PostoToPrint> postos = new Vector<PostoToPrint>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		Virtual2DArray array; | 
			
		
	
		
			
				
					|  |  |  |  | 		Select select =  | 
			
		
	
		
			
				
					|  |  |  |  | 			new Select2(  | 
			
		
	
		
			
				
					|  |  |  |  | 				new String[]{ "hs_relatorio_posto", "hs_relatorio_posto_medida" }, | 
			
		
	
		
			
				
					|  |  |  |  | 				new Integer[]{ Select2.JOIN_INNER }, | 
			
		
	
		
			
				
					|  |  |  |  | 				new Expression[]{ | 
			
		
	
		
			
				
					|  |  |  |  | 					new Field( "hs_relatorio_posto.id" ).isEqual( new Field( "hs_relatorio_posto_medida.posto_id" ) ) | 
			
		
	
		
			
				
					|  |  |  |  | 				}, | 
			
		
	
		
			
				
					|  |  |  |  | 				new String[]{ "hs_relatorio_posto.id", "hs_relatorio_posto.description" }, | 
			
		
	
		
			
				
					|  |  |  |  | 				new Field( "hs_relatorio_posto_medida.medida_id" ).isEqual( medidaId ), | 
			
		
	
		
			
				
					|  |  |  |  | 				new String[]{ "hs_relatorio_posto.id" }, | 
			
		
	
		
			
				
					|  |  |  |  | 				null, | 
			
		
	
		
			
				
					|  |  |  |  | 				null, | 
			
		
	
		
			
				
					|  |  |  |  | 				null ); | 
			
		
	
		
			
				
					|  |  |  |  | 		array = EXECUTER.executeQuery( select ); | 
			
		
	
		
			
				
					|  |  |  |  | 		Virtual2DArray array = EXECUTER.executeQuery( select ); | 
			
		
	
		
			
				
					|  |  |  |  | 		for( int n = 0; n < array.columnLength(); n++ ) | 
			
		
	
		
			
				
					|  |  |  |  | 		{ | 
			
		
	
		
			
				
					|  |  |  |  | 			String descricao = ( String ) array.get( n, 1 ); | 
			
		
	
		
			
				
					|  |  |  |  | 			postos.add( new PostoToPrint( descricao ) ); | 
			
		
	
		
			
				
					|  |  |  |  | 			String requisitosLegais = ( String ) array.get( n, 1 ); | 
			
		
	
		
			
				
					|  |  |  |  | 			medidas.add( new MedidaToPrint( requisitosLegais ) ); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		return postos; | 
			
		
	
		
			
				
					|  |  |  |  | 		return medidas; | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 	 | 
			
		
	
		
			
				
					|  |  |  |  | 	/** | 
			
		
	
	
		
			
				
					|  |  |  | 
 |