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

lxbfYeaa
Frederico Palma 16 years ago
parent 9be18ff2ed
commit 3256ff50eb

@ -162,7 +162,8 @@ public class PlanoActuacaoPrintDataProvider
getLegislacaoAplicavel( id ),
getAreasToPrintByPlanoId( id, validacaoDl, validacaoDns ),
observacoesDl,
observacoesDns );
observacoesDns,
getTecnicoHS( id ) );
return plano;
}
@ -184,34 +185,6 @@ public class PlanoActuacaoPrintDataProvider
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;
// }
protected Integer getRelatorioIdForPlanoId( Integer planoId )
throws Exception
{
@ -747,4 +720,46 @@ public class PlanoActuacaoPrintDataProvider
new BlobUpdate( "image", "image_data", data, new Field( "id" ).isEqual( id ) );
LOCAL_EXECUTER.executeQuery( update );
}
public TecnicoHSToPrint getTecnicoHS( Integer relatorioId )
throws Exception
{
if( web )
{
relatorioId = getRelatorioIdForPlanoId( relatorioId );
}
Select select =
new Select2(
new String[]{ "hs_relatorio", "marcacoes_estabelecimento", "marcacoes_tecnicos_hst" },
new Integer[]{ Select2.JOIN_INNER, Select2.JOIN_INNER },
new Expression[]{
new Field( "hs_relatorio.marcacao_id" ).isEqual( new Field( "marcacoes_estabelecimento.id" ) ),
new Field( "marcacoes_estabelecimento.tecnico_hst" ).isEqual( new Field( "marcacoes_tecnicos_hst.id" ) ),
},
new String[]{
"marcacoes_tecnicos_hst.id",
"marcacoes_tecnicos_hst.nome",
"marcacoes_tecnicos_hst.cap",
"marcacoes_tecnicos_hst.formacao",
"marcacoes_tecnicos_hst.assinatura",},
new Field( "hs_relatorio.id" ).isEqual( relatorioId ),
null,
null,
null,
null );
Virtual2DArray array = LOCAL_EXECUTER.executeQuery( select );
if( array.columnLength() == 0 )
{
return null;
}
else
{
Integer id = ( Integer ) array.get( 0, 0 );
String nome = ( String ) array.get( 0, 1 );
String cap = ( String ) array.get( 0, 2 );
String formacao = ( String ) array.get( 0, 3 );
Integer assinatura = ( Integer ) array.get( 0, 4 );
return new TecnicoHSToPrint( id, nome, cap, formacao, "http://www.evolute.pt:13080/SIPRPImages/image?id=" + assinatura );
}
}
}

@ -14,10 +14,12 @@ public class PlanoActuacaoToPrint
protected Vector<AreaToPrint> areas;
protected String observacoesDl;
protected String observacoesDns;
protected TecnicoHSToPrint tecnico;
public PlanoActuacaoToPrint( EmpresaToPrint empresa, DataToPrint dataRelatorio,
DataToPrint dataHs, LegislacaoAplicavelToPrint legislacaoAplicavel,
Vector<AreaToPrint> areas, String observacoesDl, String observacoesDns )
Vector<AreaToPrint> areas, String observacoesDl, String observacoesDns,
TecnicoHSToPrint tecnico )
{
super();
this.empresa = empresa;
@ -27,6 +29,7 @@ public class PlanoActuacaoToPrint
this.areas = areas;
this.observacoesDl = observacoesDl;
this.observacoesDns = observacoesDns;
this.tecnico = tecnico;
}
public EmpresaToPrint getEmpresa()
@ -108,6 +111,10 @@ public class PlanoActuacaoToPrint
Element observacoesDnsElement = new Element( "observacoes-dns" );
observacoesDnsElement.setText( observacoesDns );
planoElement.addContent( observacoesDnsElement );
if( tecnico != null )
{
planoElement.addContent( tecnico.toJdomElement() );
}
return planoElement;
}
@ -131,4 +138,14 @@ public class PlanoActuacaoToPrint
this.observacoesDns = observacoesDns;
}
public TecnicoHSToPrint getTecnico()
{
return tecnico;
}
public void setTecnico(TecnicoHSToPrint tecnico)
{
this.tecnico = tecnico;
}
}

Loading…
Cancel
Save