|
|
|
|
@ -8,12 +8,17 @@ import siprp.planoactuacao.db.PlanoActuacaoDBInit;
|
|
|
|
|
|
|
|
|
|
import com.evolute.utils.Singleton;
|
|
|
|
|
import com.evolute.utils.arrays.Virtual2DArray;
|
|
|
|
|
import com.evolute.utils.data.Mappable;
|
|
|
|
|
import com.evolute.utils.data.MappableObject;
|
|
|
|
|
import com.evolute.utils.db.DBManager;
|
|
|
|
|
import com.evolute.utils.db.Executer;
|
|
|
|
|
import com.evolute.utils.sql.Assignment;
|
|
|
|
|
import com.evolute.utils.sql.BlobUpdate;
|
|
|
|
|
import com.evolute.utils.sql.Expression;
|
|
|
|
|
import com.evolute.utils.sql.Field;
|
|
|
|
|
import com.evolute.utils.sql.Select;
|
|
|
|
|
import com.evolute.utils.sql.Select2;
|
|
|
|
|
import com.evolute.utils.sql.Update;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class PlanoActuacaoPrintDataProvider
|
|
|
|
|
@ -82,7 +87,7 @@ public class PlanoActuacaoPrintDataProvider
|
|
|
|
|
Boolean validacaoDl = ( Boolean ) array.get( 0, 8 );
|
|
|
|
|
Boolean validacaoDns = ( Boolean ) array.get( 0, 9 );
|
|
|
|
|
EmpresaToPrint empresa = new EmpresaToPrint( nomeEmpresa,
|
|
|
|
|
"www.evolute.pt:13080/SIPRPImages/image?id=" + logoId,
|
|
|
|
|
"http://www.evolute.pt:13080/SIPRPImages/image?id=" + logoId,
|
|
|
|
|
// "http://apdp/siprp/auchan_jumbo_lado.jpg",
|
|
|
|
|
nomeEstabelecimento );
|
|
|
|
|
PlanoActuacaoToPrint plano =
|
|
|
|
|
@ -255,4 +260,44 @@ public class PlanoActuacaoPrintDataProvider
|
|
|
|
|
}
|
|
|
|
|
return postos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Para fazer dump dos logotipos para converter para jpeg
|
|
|
|
|
*/
|
|
|
|
|
public Mappable[] getLogotipos()
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
Select select =
|
|
|
|
|
new Select2(
|
|
|
|
|
new String[]{ "image" },
|
|
|
|
|
new Integer[]{},
|
|
|
|
|
new Expression[]{},
|
|
|
|
|
new String[]{ "id", "image_data" },
|
|
|
|
|
null,
|
|
|
|
|
null,
|
|
|
|
|
null,
|
|
|
|
|
null,
|
|
|
|
|
null );
|
|
|
|
|
Virtual2DArray array = LOCAL_EXECUTER.executeQuery( select );
|
|
|
|
|
Mappable logotipos[] = new Mappable[ array.columnLength() ];
|
|
|
|
|
for( int n = 0; n < logotipos.length; n++ )
|
|
|
|
|
{
|
|
|
|
|
Integer id = ( Integer ) array.get( n, 0 );
|
|
|
|
|
byte data[] = ( byte[] ) array.get( n, 1 );
|
|
|
|
|
logotipos[ n ] =
|
|
|
|
|
new MappableObject( id, data );
|
|
|
|
|
}
|
|
|
|
|
return logotipos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Para fazer import dos logotipos convertidos para jpeg
|
|
|
|
|
*/
|
|
|
|
|
public void updateLogotipo( Integer id, byte[] data )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
BlobUpdate update =
|
|
|
|
|
new BlobUpdate( "image", "image_data", data, new Field( "id" ).isEqual( id ) );
|
|
|
|
|
LOCAL_EXECUTER.executeQuery( update );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|