|
|
|
|
@ -17,12 +17,14 @@ import db.entidades.Medida;
|
|
|
|
|
import db.entidades.PlanoActuacao;
|
|
|
|
|
import db.entidades.PostoTrabalho;
|
|
|
|
|
import db.entidades.Risco;
|
|
|
|
|
import db.entidades.Valor;
|
|
|
|
|
import db.providers.UtilizadoresLogic;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.Comparator;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import javax.faces.FacesException;
|
|
|
|
|
import javax.faces.component.html.HtmlPanelGrid;
|
|
|
|
|
import javax.sound.midi.SysexMessage;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <p>Page bean that corresponds to a similarly named JSP page. This
|
|
|
|
|
@ -197,14 +199,12 @@ public class ViewPlano extends AbstractPageBean
|
|
|
|
|
{
|
|
|
|
|
System.out.println( "\nViewPlano . showPlano( " + p.getId() + " ) : \n" );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gridPlano = new HtmlPanelGrid();
|
|
|
|
|
gridPlano.setId( "gridPlano" );
|
|
|
|
|
gridPlano.setWidth( "100%" );
|
|
|
|
|
gridPlano.setColumns( 1 );
|
|
|
|
|
gridPlano.setStyle( "background-color: #f6f4e8; border: solid 1px #000000" );
|
|
|
|
|
gridPlano.setColumnClasses( "gridColCenter" );
|
|
|
|
|
//plano
|
|
|
|
|
//lblTop.setText("Plano de actuação da auditoria " + p.getData_visita_str());
|
|
|
|
|
|
|
|
|
|
if ( p.getConcluidoPorDesactivacao() )
|
|
|
|
|
@ -259,11 +259,6 @@ public class ViewPlano extends AbstractPageBean
|
|
|
|
|
gridAreaContainer.setColumnClasses( "gridColLeft" );
|
|
|
|
|
gridAreaContainer.setWidth( "100%" );
|
|
|
|
|
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// st.setText("AAAAAAAAA");
|
|
|
|
|
// gridAreaContainer.getChildren().add(st);
|
|
|
|
|
|
|
|
|
|
gridArea.getChildren().add( gridAreaContainer );
|
|
|
|
|
showRiscos( area.getRiscos() );
|
|
|
|
|
}
|
|
|
|
|
@ -272,6 +267,15 @@ public class ViewPlano extends AbstractPageBean
|
|
|
|
|
private void showRiscos( List< Risco > riscos )
|
|
|
|
|
{
|
|
|
|
|
int rCount = 0;
|
|
|
|
|
Collections.sort( riscos, new Comparator< Risco >()
|
|
|
|
|
{
|
|
|
|
|
public int compare( Risco o1, Risco o2 )
|
|
|
|
|
{
|
|
|
|
|
// false first, true after
|
|
|
|
|
return o1.getIsPatrimonial().compareTo( o2.getIsPatrimonial() );
|
|
|
|
|
}
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
|
for ( Risco risco : riscos )
|
|
|
|
|
{
|
|
|
|
|
HtmlPanelGrid grd = new HtmlPanelGrid();
|
|
|
|
|
@ -383,7 +387,6 @@ public class ViewPlano extends AbstractPageBean
|
|
|
|
|
st.setText( r.getResponsavel_execucao().toString() );
|
|
|
|
|
pg.getChildren().add( st );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( r.getPor() != null )
|
|
|
|
|
{
|
|
|
|
|
if ( r.getPor().trim().length() > 0 )
|
|
|
|
|
@ -478,7 +481,6 @@ public class ViewPlano extends AbstractPageBean
|
|
|
|
|
st.setText( r.getParecer_dl().toString() );
|
|
|
|
|
pg.getChildren().add( st );
|
|
|
|
|
gridParecer.getChildren().add( pg );
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -516,192 +518,191 @@ public class ViewPlano extends AbstractPageBean
|
|
|
|
|
st.setText( r.getVerificacao_siprp().toString() );
|
|
|
|
|
pg.getChildren().add( st );
|
|
|
|
|
gridParecer.getChildren().add( pg );
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void showValores(List<Valor> valores)
|
|
|
|
|
{
|
|
|
|
|
for(Valor valor : valores)
|
|
|
|
|
{
|
|
|
|
|
HtmlPanelGrid grd = new HtmlPanelGrid();
|
|
|
|
|
grd.setColumns(1);
|
|
|
|
|
grd.setWidth("100%");
|
|
|
|
|
//grd.setStyleClass("centerBlock");
|
|
|
|
|
//gridRisco.getChildren().add(grd);
|
|
|
|
|
|
|
|
|
|
gridValor = new HtmlPanelGrid();
|
|
|
|
|
gridRisco.getChildren().add(gridValor);
|
|
|
|
|
////gridValor.setStyleClass("centerBlock");
|
|
|
|
|
gridValor.setWidth("100%");
|
|
|
|
|
gridValor.setColumns(1);
|
|
|
|
|
gridValor.setColumnClasses("gridColLeft");
|
|
|
|
|
//grd.getChildren().add(gridValor);
|
|
|
|
|
pg = new PanelGroup();
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
st.setStyleClass("label");
|
|
|
|
|
st.setText("Valor: ");
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
if(valor.getValor() == null)
|
|
|
|
|
{
|
|
|
|
|
st.setText(" - ");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
st.setText(valor.getValor().toString());
|
|
|
|
|
}
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
gridValor.getChildren().add(pg);
|
|
|
|
|
|
|
|
|
|
showMedidas(valor.getMedidas());
|
|
|
|
|
|
|
|
|
|
grd = new HtmlPanelGrid();
|
|
|
|
|
grd.setColumns(1);
|
|
|
|
|
grd.setWidth("100%");
|
|
|
|
|
// private void showValores( List< Valor > valores )
|
|
|
|
|
// {
|
|
|
|
|
// for ( Valor valor : valores )
|
|
|
|
|
// {
|
|
|
|
|
// HtmlPanelGrid grd = new HtmlPanelGrid();
|
|
|
|
|
// grd.setColumns( 1 );
|
|
|
|
|
// grd.setWidth( "100%" );
|
|
|
|
|
// //grd.setStyleClass("centerBlock");
|
|
|
|
|
gridValor.getChildren().add(grd);
|
|
|
|
|
HtmlPanelGrid gridParecer = new HtmlPanelGrid();
|
|
|
|
|
gridParecer.setStyleClass("centerBlock");
|
|
|
|
|
gridParecer.setWidth("98%");
|
|
|
|
|
gridParecer.setColumns(1);
|
|
|
|
|
gridParecer.setColumnClasses("gridColLeft");
|
|
|
|
|
grd.getChildren().add(gridParecer);
|
|
|
|
|
|
|
|
|
|
if(valor.getResponsavel_execucao() != null)
|
|
|
|
|
{
|
|
|
|
|
if(valor.getResponsavel_execucao().trim().length() > 0)
|
|
|
|
|
{
|
|
|
|
|
pg = new PanelGroup();
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
st.setStyleClass("label");
|
|
|
|
|
st.setText("Responsável de execução: ");
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
st.setText(valor.getResponsavel_execucao().toString());
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
gridParecer.getChildren().add(pg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(valor.getRecursos_necessarios() != null)
|
|
|
|
|
{
|
|
|
|
|
if(valor.getRecursos_necessarios().trim().length() > 0)
|
|
|
|
|
{
|
|
|
|
|
pg = new PanelGroup();
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
st.setStyleClass("label");
|
|
|
|
|
st.setText("Recursos necessários: ");
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
st.setText(valor.getRecursos_necessarios().toString());
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
gridParecer.getChildren().add(pg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(valor.getData_inicio() != null)
|
|
|
|
|
{
|
|
|
|
|
pg = new PanelGroup();
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
st.setStyleClass("label");
|
|
|
|
|
st.setText("Data início: ");
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
String data_str = "";
|
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
|
|
|
|
|
data_str = formatter.format(valor.getData_inicio());
|
|
|
|
|
st.setText(data_str);
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
gridParecer.getChildren().add(pg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(valor.getData_fim() != null)
|
|
|
|
|
{
|
|
|
|
|
pg = new PanelGroup();
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
st.setStyleClass("label");
|
|
|
|
|
st.setText("Data fim: ");
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
String data_str = "";
|
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
|
|
|
|
|
data_str = formatter.format(valor.getData_fim());
|
|
|
|
|
st.setText(data_str);
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
gridParecer.getChildren().add(pg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(valor.getParecer_dl() != null)
|
|
|
|
|
{
|
|
|
|
|
if(valor.getParecer_dl().trim().length() > 0)
|
|
|
|
|
{
|
|
|
|
|
pg = new PanelGroup();
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
st.setStyleClass("label");
|
|
|
|
|
st.setText("Parecer DL: ");
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
st.setText(valor.getParecer_dl().toString());
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
gridParecer.getChildren().add(pg);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(valor.getParecer_dns() != null)
|
|
|
|
|
{
|
|
|
|
|
if(valor.getParecer_dns().trim().length() > 0)
|
|
|
|
|
{
|
|
|
|
|
pg = new PanelGroup();
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
st.setStyleClass("label");
|
|
|
|
|
st.setText("Parecer DNS: ");
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
st.setText(valor.getParecer_dns().toString());
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
gridParecer.getChildren().add(pg);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(valor.getVerificacao_siprp() != null)
|
|
|
|
|
{
|
|
|
|
|
if(valor.getVerificacao_siprp().trim().length() > 0)
|
|
|
|
|
{
|
|
|
|
|
pg = new PanelGroup();
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
st.setStyleClass("label");
|
|
|
|
|
st.setText("Verificação SIPRP: ");
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
st.setText(valor.getVerificacao_siprp().toString());
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
gridParecer.getChildren().add(pg);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// //gridRisco.getChildren().add(grd);
|
|
|
|
|
//
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// gridValor = new HtmlPanelGrid();
|
|
|
|
|
// gridRisco.getChildren().add( gridValor );
|
|
|
|
|
// ////gridValor.setStyleClass("centerBlock");
|
|
|
|
|
// gridValor.setWidth( "100%" );
|
|
|
|
|
// gridValor.setColumns( 1 );
|
|
|
|
|
// gridValor.setColumnClasses( "gridColLeft" );
|
|
|
|
|
// //grd.getChildren().add(gridValor);
|
|
|
|
|
// pg = new PanelGroup();
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// st.setStyleClass("label");
|
|
|
|
|
// st.setText("Valor: ");
|
|
|
|
|
// pg.getChildren().add(st);
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// if(valor.getValor() == null)
|
|
|
|
|
// {
|
|
|
|
|
// st.setText(" - ");
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
// st.setText(valor.getValor().toString());
|
|
|
|
|
// }
|
|
|
|
|
// pg.getChildren().add(st);
|
|
|
|
|
// gridValor.getChildren().add(pg);
|
|
|
|
|
//
|
|
|
|
|
// showMedidas(valor.getMedidas());
|
|
|
|
|
//
|
|
|
|
|
// grd = new HtmlPanelGrid();
|
|
|
|
|
// grd.setColumns(1);
|
|
|
|
|
// grd.setWidth("100%");
|
|
|
|
|
// ////grd.setStyleClass("centerBlock");
|
|
|
|
|
// gridValor.getChildren().add(grd);
|
|
|
|
|
// HtmlPanelGrid gridParecer = new HtmlPanelGrid();
|
|
|
|
|
// gridParecer.setStyleClass("centerBlock");
|
|
|
|
|
// gridParecer.setWidth("98%");
|
|
|
|
|
// gridParecer.setColumns(1);
|
|
|
|
|
// gridParecer.setColumnClasses("gridColLeft");
|
|
|
|
|
// grd.getChildren().add(gridParecer);
|
|
|
|
|
//
|
|
|
|
|
// if(valor.getResponsavel_execucao() != null)
|
|
|
|
|
// {
|
|
|
|
|
// if(valor.getResponsavel_execucao().trim().length() > 0)
|
|
|
|
|
// {
|
|
|
|
|
// pg = new PanelGroup();
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// st.setStyleClass("label");
|
|
|
|
|
// st.setText("Responsável de execução: ");
|
|
|
|
|
// pg.getChildren().add(st);
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// st.setText(valor.getResponsavel_execucao().toString());
|
|
|
|
|
// pg.getChildren().add(st);
|
|
|
|
|
// gridParecer.getChildren().add(pg);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if(valor.getRecursos_necessarios() != null)
|
|
|
|
|
// {
|
|
|
|
|
// if(valor.getRecursos_necessarios().trim().length() > 0)
|
|
|
|
|
// {
|
|
|
|
|
// pg = new PanelGroup();
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// st.setStyleClass("label");
|
|
|
|
|
// st.setText("Recursos necessários: ");
|
|
|
|
|
// pg.getChildren().add(st);
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// st.setText(valor.getRecursos_necessarios().toString());
|
|
|
|
|
// pg.getChildren().add(st);
|
|
|
|
|
// gridParecer.getChildren().add(pg);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if(valor.getData_inicio() != null)
|
|
|
|
|
// {
|
|
|
|
|
// pg = new PanelGroup();
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// st.setStyleClass("label");
|
|
|
|
|
// st.setText("Data início: ");
|
|
|
|
|
// pg.getChildren().add(st);
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// String data_str = "";
|
|
|
|
|
// SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
|
|
|
|
|
// data_str = formatter.format(valor.getData_inicio());
|
|
|
|
|
// st.setText(data_str);
|
|
|
|
|
// pg.getChildren().add(st);
|
|
|
|
|
// gridParecer.getChildren().add(pg);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if(valor.getData_fim() != null)
|
|
|
|
|
// {
|
|
|
|
|
// pg = new PanelGroup();
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// st.setStyleClass("label");
|
|
|
|
|
// st.setText("Data fim: ");
|
|
|
|
|
// pg.getChildren().add(st);
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// String data_str = "";
|
|
|
|
|
// SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
|
|
|
|
|
// data_str = formatter.format(valor.getData_fim());
|
|
|
|
|
// st.setText(data_str);
|
|
|
|
|
// pg.getChildren().add(st);
|
|
|
|
|
// gridParecer.getChildren().add(pg);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if(valor.getParecer_dl() != null)
|
|
|
|
|
// {
|
|
|
|
|
// if(valor.getParecer_dl().trim().length() > 0)
|
|
|
|
|
// {
|
|
|
|
|
// pg = new PanelGroup();
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// st.setStyleClass("label");
|
|
|
|
|
// st.setText("Parecer DL: ");
|
|
|
|
|
// pg.getChildren().add(st);
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// st.setText(valor.getParecer_dl().toString());
|
|
|
|
|
// pg.getChildren().add(st);
|
|
|
|
|
// gridParecer.getChildren().add(pg);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if(valor.getParecer_dns() != null)
|
|
|
|
|
// {
|
|
|
|
|
// if(valor.getParecer_dns().trim().length() > 0)
|
|
|
|
|
// {
|
|
|
|
|
// pg = new PanelGroup();
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// st.setStyleClass("label");
|
|
|
|
|
// st.setText("Parecer DNS: ");
|
|
|
|
|
// pg.getChildren().add(st);
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// st.setText(valor.getParecer_dns().toString());
|
|
|
|
|
// pg.getChildren().add(st);
|
|
|
|
|
// gridParecer.getChildren().add(pg);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if(valor.getVerificacao_siprp() != null)
|
|
|
|
|
// {
|
|
|
|
|
// if(valor.getVerificacao_siprp().trim().length() > 0)
|
|
|
|
|
// {
|
|
|
|
|
// pg = new PanelGroup();
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// st.setStyleClass("label");
|
|
|
|
|
// st.setText("Verificação SIPRP: ");
|
|
|
|
|
// pg.getChildren().add(st);
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape(false);
|
|
|
|
|
// st.setText(valor.getVerificacao_siprp().toString());
|
|
|
|
|
// pg.getChildren().add(st);
|
|
|
|
|
// gridParecer.getChildren().add(pg);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// //
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
private void showMedidas( List< Medida > medidas )
|
|
|
|
|
{
|
|
|
|
|
@ -721,6 +722,7 @@ public class ViewPlano extends AbstractPageBean
|
|
|
|
|
gridMedida.setColumns(1);
|
|
|
|
|
gridMedida.setColumnClasses("gridColLeft");
|
|
|
|
|
grd.getChildren().add( gridMedida );
|
|
|
|
|
|
|
|
|
|
pg = new PanelGroup();
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape(false);
|
|
|
|
|
|