Skip to content

Commit

Permalink
Nuova Stampa Bilancio Decisionale/Gestionale
Browse files Browse the repository at this point in the history
  • Loading branch information
raffaelepagano committed Oct 17, 2016
1 parent dc968a0 commit c31c6e1
Show file tree
Hide file tree
Showing 12 changed files with 511 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Created on Apr 26, 2005
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package it.cnr.contab.prevent01.action;

import it.cnr.contab.prevent01.bp.StampaPdgpBilancioBP;
import it.cnr.jada.action.ActionContext;
import it.cnr.jada.action.BusinessProcessException;
import it.cnr.jada.action.Forward;

/**
* @author mspasiano
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class StampaPdgpBilancioAction extends it.cnr.contab.reports.action.ParametricPrintAction {

/**
*
*/
public StampaPdgpBilancioAction() {
super();
}

public Forward doOnTipoChange(ActionContext context) {
try{
StampaPdgpBilancioBP bp = (StampaPdgpBilancioBP)context.getBusinessProcess();
fillModel(context);
try {
bp.loadModelBulkOptions(context);
} catch (BusinessProcessException e) {
return handleException(context, e);
}
return context.findDefaultForward();
}catch(it.cnr.jada.bulk.FillException ex){
return handleException(context, ex);
}
}

public Forward doOnFonteChange(ActionContext context) {
try{
StampaPdgpBilancioBP bp = (StampaPdgpBilancioBP)context.getBusinessProcess();
fillModel(context);
try {
bp.loadModelBulkOptions(context);
} catch (BusinessProcessException e) {
return handleException(context, e);
}
return context.findDefaultForward();
}catch(it.cnr.jada.bulk.FillException ex){
return handleException(context, ex);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
package it.cnr.contab.prevent01.bp;

import it.cnr.contab.config00.pdcfin.cla.bulk.Parametri_livelliBulk;
import it.cnr.contab.prevent01.bulk.Stampa_pdgp_bilancioBulk;
import it.cnr.contab.reports.bp.ParametricPrintBP;
import it.cnr.contab.utenze00.bp.CNRUserContext;
import it.cnr.contab.util.Utility;
import it.cnr.jada.action.ActionContext;
import it.cnr.jada.action.BusinessProcessException;
import it.cnr.jada.bulk.OggettoBulk;


public class StampaPdgpBilancioBP extends ParametricPrintBP {

/**
*
*/
private static final long serialVersionUID = -3023075061400467210L;

/**
* StampaRendicontoFinanziarioBP constructor comment.
*/
public StampaPdgpBilancioBP() {
super();
}
/**
* StampaRendicontoFinanziarioBP constructor comment.
* @param function java.lang.String
*/
public StampaPdgpBilancioBP(String function) {
super(function);
}

@Override
public OggettoBulk initializeBulkForPrint(ActionContext context, OggettoBulk bulk) throws BusinessProcessException {
try {
OggettoBulk oggettoBulk = super.initializeBulkForPrint(context, bulk);
if (oggettoBulk instanceof Stampa_pdgp_bilancioBulk) {
((Stampa_pdgp_bilancioBulk) oggettoBulk).setEsercizio(CNRUserContext.getEsercizio(context.getUserContext()));
((Stampa_pdgp_bilancioBulk) oggettoBulk).setTi_fonte(Stampa_pdgp_bilancioBulk.TIPO_DECISIONALE_SCIENTIFICO);
((Stampa_pdgp_bilancioBulk) oggettoBulk).setTi_gestione(Stampa_pdgp_bilancioBulk.TIPO_GESTIONE_ENTRATA);

loadModelBulkOptions(context, (Stampa_pdgp_bilancioBulk) oggettoBulk);
}
return oggettoBulk;
}catch(Throwable e) {
throw new BusinessProcessException(e);
}
}

public void loadModelBulkOptions(ActionContext context) throws BusinessProcessException {
try {
OggettoBulk oggettoBulk = this.getModel();
if (oggettoBulk instanceof Stampa_pdgp_bilancioBulk)
loadModelBulkOptions(context, (Stampa_pdgp_bilancioBulk) oggettoBulk);
}catch(Throwable e) {
throw new BusinessProcessException(e);
}
}

private Stampa_pdgp_bilancioBulk loadModelBulkOptions(ActionContext context, Stampa_pdgp_bilancioBulk stampa) throws BusinessProcessException {
try {
stampa.setTi_livello(null);

Parametri_livelliBulk parliv = Utility.createClassificazioneVociComponentSession().findParametriLivelli(context.getUserContext(), stampa.getEsercizio());

it.cnr.jada.util.OrderedHashtable livelliOptions = new it.cnr.jada.util.OrderedHashtable();

int index = 1;

if (Stampa_pdgp_bilancioBulk.TIPO_DECISIONALE_SCIENTIFICO.equals(stampa.getTi_fonte())||
Stampa_pdgp_bilancioBulk.TIPO_GESTIONALE_SCIENTIFICO.equals(stampa.getTi_fonte())||
Stampa_pdgp_bilancioBulk.TIPO_STANZIAMENTO_SCIENTIFICO.equals(stampa.getTi_fonte())) {
livelliOptions.put(index++, "Programma");
livelliOptions.put(index++, "Missione");
}

if (Stampa_pdgp_bilancioBulk.TIPO_GESTIONE_ENTRATA.equals(stampa.getTi_gestione())) {
if (parliv.getDs_livello1e()!=null)
livelliOptions.put(index++, parliv.getDs_livello1e());
if (parliv.getDs_livello2e()!=null)
livelliOptions.put(index++, parliv.getDs_livello2e());
if (parliv.getDs_livello3e()!=null)
livelliOptions.put(index++, parliv.getDs_livello3e());
if (parliv.getDs_livello4e()!=null)
livelliOptions.put(index++, parliv.getDs_livello4e());
if (parliv.getDs_livello5e()!=null)
livelliOptions.put(index++, parliv.getDs_livello5e());
if (parliv.getDs_livello6e()!=null)
livelliOptions.put(index++, parliv.getDs_livello6e());
if (parliv.getDs_livello7e()!=null)
livelliOptions.put(index++, parliv.getDs_livello7e());
} else {
if (parliv.getDs_livello1s()!=null)
livelliOptions.put(index++, parliv.getDs_livello1s());
if (parliv.getDs_livello2s()!=null)
livelliOptions.put(index++, parliv.getDs_livello2s());
if (parliv.getDs_livello3s()!=null)
livelliOptions.put(index++, parliv.getDs_livello3s());
if (parliv.getDs_livello4s()!=null)
livelliOptions.put(index++, parliv.getDs_livello4s());
if (parliv.getDs_livello5s()!=null)
livelliOptions.put(index++, parliv.getDs_livello5s());
if (parliv.getDs_livello6s()!=null)
livelliOptions.put(index++, parliv.getDs_livello6s());
if (parliv.getDs_livello7s()!=null)
livelliOptions.put(index++, parliv.getDs_livello7s());
}

stampa.setLivelliOptions(livelliOptions);
}catch(Throwable e) {
throw new BusinessProcessException(e);
}
return stampa;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/*
* Created on Oct 4, 2005
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package it.cnr.contab.prevent01.bulk;

import java.util.Enumeration;
import java.util.Iterator;

import it.cnr.jada.bulk.OggettoBulk;

/**
* @author
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class Stampa_pdgp_bilancioBulk extends OggettoBulk {

private Integer esercizio;

// Tipo gestione
private String ti_gestione;

// Tipo di stampa
private String ti_fonte;

// Tipo livello
private String ti_livello;

private it.cnr.jada.util.OrderedHashtable livelliOptions = new it.cnr.jada.util.OrderedHashtable();

public final static String TIPO_DECISIONALE_SCIENTIFICO = "DECSCI";
public final static String TIPO_GESTIONALE_SCIENTIFICO = "GESTSCI";
public final static String TIPO_STANZIAMENTO_SCIENTIFICO = "STASCI";
public final static String TIPO_DECISIONALE_FINANZIARIO = "DECFIN";
public final static String TIPO_GESTIONALE_FINANZIARIO = "GESTFIN";
public final static String TIPO_STANZIAMENTO_FINANZIARIO = "STAFIN";

public final static java.util.Dictionary ti_fonteKeys;

static {
ti_fonteKeys = new it.cnr.jada.util.OrderedHashtable();
ti_fonteKeys.put(TIPO_DECISIONALE_SCIENTIFICO,"Decisionale Scientifico");
ti_fonteKeys.put(TIPO_GESTIONALE_SCIENTIFICO,"Gestionale Scientifico");
ti_fonteKeys.put(TIPO_DECISIONALE_FINANZIARIO,"Decisionale Finanziario");
ti_fonteKeys.put(TIPO_GESTIONALE_FINANZIARIO,"Gestionale Finanziario");
};

public final static String TIPO_GESTIONE_ENTRATA = "E";
public final static String TIPO_GESTIONE_SPESA = "S";

public final static java.util.Dictionary ti_gestioneKeys;

static {
ti_gestioneKeys = new it.cnr.jada.util.OrderedHashtable();
ti_gestioneKeys.put(TIPO_GESTIONE_ENTRATA,"Entrata");
ti_gestioneKeys.put(TIPO_GESTIONE_SPESA,"Spesa");
};

public Stampa_pdgp_bilancioBulk() {
super();
}


public java.lang.Integer getEsercizio() {
return esercizio;
}
public void setEsercizio(java.lang.Integer newEsercizio) {
esercizio = newEsercizio;
}

public String getTi_gestione() {
return ti_gestione;
}
public void setTi_gestione(String ti_gestione) {
this.ti_gestione = ti_gestione;
}

public String getTi_fonte() {
return ti_fonte;
}
public void setTi_fonte(String ti_fonte) {
this.ti_fonte = ti_fonte;
}

public String getTi_livello() {
return ti_livello;
}
public void setTi_livello(String ti_livello) {
this.ti_livello = ti_livello;
}

public it.cnr.jada.util.OrderedHashtable getLivelliOptions() {
return livelliOptions;
}
public void setLivelliOptions(it.cnr.jada.util.OrderedHashtable livelliOptions) {
this.livelliOptions = livelliOptions;
}

public Integer getNr_livello() {
Enumeration a = livelliOptions.keys();
while (a.hasMoreElements()) {
Integer key = (Integer) a.nextElement();
if (livelliOptions.get(key).equals(ti_livello))
return key;
}
return 1;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package it.cnr.contab.prevent01.bulk;

import it.cnr.jada.bulk.BulkHome;

/**
* Insert the type's description here.
* Creation date: (26/03/2003 10.28.22)
* @author: Gennaro Borriello
*/
public class Stampa_pdgp_bilancioHome extends BulkHome {

public Stampa_pdgp_bilancioHome(Class clazz, java.sql.Connection conn) {
super(clazz, conn);
}

public Stampa_pdgp_bilancioHome(Class clazz, java.sql.Connection conn, it.cnr.jada.persistency.PersistentCache persistentCache) {
super(clazz, conn, persistentCache);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package it.cnr.contab.prevent01.comp;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Iterator;
import java.util.List;
Expand Down Expand Up @@ -48,6 +49,7 @@
import it.cnr.jada.comp.ApplicationException;
import it.cnr.jada.comp.CRUDComponent;
import it.cnr.jada.comp.ComponentException;
import it.cnr.jada.comp.IPrintMgr;
import it.cnr.jada.persistency.IntrospectionException;
import it.cnr.jada.persistency.ObjectNotFoundException;
import it.cnr.jada.persistency.PersistencyException;
Expand All @@ -57,7 +59,7 @@
import it.cnr.jada.persistency.sql.SQLBroker;
import it.cnr.jada.persistency.sql.SQLBuilder;

public class PdgAggregatoModuloComponent extends CRUDComponent {
public class PdgAggregatoModuloComponent extends CRUDComponent implements IPrintMgr {
/**
* PdgAggregatoComponent constructor comment.
*/
Expand Down Expand Up @@ -928,4 +930,14 @@ private void controllaRipartizioneDecisionale(UserContext userContext, Pdg_modul
throw handleException(e);
}
}

@Override
public OggettoBulk inizializzaBulkPerStampa(UserContext usercontext, OggettoBulk oggettobulk) throws ComponentException {
return oggettobulk;
}

@Override
public OggettoBulk stampaConBulk(UserContext usercontext, OggettoBulk oggettobulk) throws ComponentException {
return oggettobulk;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import javax.ejb.Remote;

@Remote
public interface PdgAggregatoModuloComponentSession extends it.cnr.jada.ejb.CRUDComponentSession {
public interface PdgAggregatoModuloComponentSession extends it.cnr.jada.ejb.CRUDComponentSession, it.cnr.jada.ejb.PrintComponentSession{
it.cnr.contab.config00.sto.bulk.CdrBulk cdrFromUserContext(it.cnr.jada.UserContext userContext) throws it.cnr.jada.comp.ComponentException, java.rmi.RemoteException;
it.cnr.jada.bulk.OggettoBulk modificaStatoPdg_aggregato(it.cnr.jada.UserContext param0,it.cnr.contab.prevent01.bulk.Pdg_moduloBulk param1) throws it.cnr.jada.comp.ComponentException,java.rmi.RemoteException;
boolean isPdGAggregatoModificabile(it.cnr.jada.UserContext param0,it.cnr.contab.prevent01.bulk.Pdg_moduloBulk param1) throws it.cnr.jada.comp.ComponentException,java.rmi.RemoteException;
Expand Down
Loading

0 comments on commit c31c6e1

Please sign in to comment.