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

lxbfYeaa
Diogo Neves 15 years ago
parent a0d9f29751
commit 3393916aa5

@ -4,16 +4,26 @@ import java.util.Vector;
import org.jdom.Element;
public class MedidaToPrint
implements PrintableInterface
public class MedidaToPrint implements PrintableInterface
{
protected String descricao;
protected Vector<PostoToPrint> postos;
protected String estado;
protected Vector< PostoToPrint > postos;
public MedidaToPrint( String descricao, Vector<PostoToPrint> postos )
public MedidaToPrint( String descricao, Vector< PostoToPrint > postos )
{
this( descricao, "", postos );
// super();
// this.descricao = descricao;
// this.postos = postos;
}
public MedidaToPrint( String descricao, String estado, Vector< PostoToPrint > postos )
{
super();
this.descricao = descricao;
this.estado = estado;
this.postos = postos;
}
@ -24,6 +34,9 @@ public class MedidaToPrint
Element descricaoElement = new Element( "descricao" );
descricaoElement.setText( descricao );
medidaElement.addContent( descricaoElement );
Element estadoElement = new Element( "estado" );
estadoElement.setText( estado );
medidaElement.addContent( estadoElement );
for( PostoToPrint posto : postos )
{
medidaElement.addContent( posto.toJdomElement() );
@ -55,4 +68,13 @@ public class MedidaToPrint
{
postos.add( posto );
}
public String getEstado() {
return estado;
}
public void setEstado(String estado) {
this.estado = estado;
}
}

@ -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;

@ -1152,6 +1152,9 @@
<!-- <xsl:attribute name="number-rows-spanned">-->
<!-- <xsl:value-of select="$risco-rows" />-->
<!-- </xsl:attribute>-->
<fo:block font-size="9pt" text-align="center" line-height="130%" margin-top="0in" margin-bottom="0in">
<xsl:value-of select="../estado" />
</fo:block>
<fo:block font-size="9pt" text-align="center" line-height="130%" margin-top="0in" margin-bottom="0in">
<xsl:value-of select="../../verificacao-siprp" />
</fo:block>

@ -1054,6 +1054,9 @@
<!-- <xsl:attribute name="number-rows-spanned">-->
<!-- <xsl:value-of select="$risco-rows" />-->
<!-- </xsl:attribute>-->
<fo:block font-size="9pt" text-align="center" line-height="130%" margin-top="0in" margin-bottom="0in">
<xsl:value-of select="../estado" />
</fo:block>
<fo:block font-size="9pt" text-align="center" line-height="130%" margin-top="0in" margin-bottom="0in">
<xsl:value-of select="../../verificacao-siprp" />
</fo:block>

Loading…
Cancel
Save