Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Aggiunta nuova gestione Consultazione Riepilogo Compensi
- Loading branch information
Showing
16 changed files
with
1,891 additions
and
423 deletions.
There are no files selected for viewing
166 changes: 166 additions & 0 deletions
166
sigla-ejb/src/main/java/it/cnr/contab/compensi00/comp/ConsRiepilogoCompensiComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
package it.cnr.contab.compensi00.comp; | ||
|
||
import it.cnr.contab.anagraf00.core.bulk.TerzoBulk; | ||
import it.cnr.contab.anagraf00.core.bulk.TerzoHome; | ||
import it.cnr.contab.config00.sto.bulk.Unita_organizzativaBulk; | ||
import it.cnr.contab.config00.sto.bulk.V_struttura_organizzativaBulk; | ||
import it.cnr.contab.config00.sto.bulk.V_struttura_organizzativaHome; | ||
import it.cnr.contab.docamm00.consultazioni.bulk.VConsRiepCompensiBulk; | ||
import it.cnr.contab.docamm00.consultazioni.bulk.VConsRiepCompensiHome; | ||
import it.cnr.contab.utenze00.bp.CNRUserContext; | ||
import it.cnr.jada.UserContext; | ||
import it.cnr.jada.comp.CRUDComponent; | ||
import it.cnr.jada.comp.ComponentException; | ||
import it.cnr.jada.persistency.IntrospectionException; | ||
import it.cnr.jada.persistency.PersistencyException; | ||
import it.cnr.jada.persistency.sql.CompoundFindClause; | ||
import it.cnr.jada.persistency.sql.FindClause; | ||
import it.cnr.jada.persistency.sql.SQLBuilder; | ||
|
||
import java.rmi.RemoteException; | ||
|
||
|
||
|
||
/** | ||
* Insert the type's description here. | ||
* Creation date: (13/09/2006) | ||
* @author: Flavia Giardina | ||
*/ | ||
public class ConsRiepilogoCompensiComponent extends CRUDComponent{ | ||
/** | ||
* VarBilancioComponent constructor comment. | ||
*/ | ||
|
||
//private String tabAlias; | ||
|
||
public ConsRiepilogoCompensiComponent() { | ||
super(); | ||
} | ||
|
||
public it.cnr.jada.persistency.sql.SQLBuilder selectFiltroSoggettoByClause( | ||
UserContext aUC, | ||
VConsRiepCompensiBulk incarichi, | ||
TerzoBulk cliente, | ||
CompoundFindClause clauses) | ||
throws ComponentException { | ||
TerzoHome home = (TerzoHome) getHome(aUC, cliente); | ||
SQLBuilder sql = home.createSQLBuilder(); | ||
|
||
sql.setAutoJoins(true); | ||
|
||
sql.addClause(clauses); | ||
return sql; | ||
} | ||
|
||
public SQLBuilder selectUoForPrintByClause (CNRUserContext userContext, | ||
VConsRiepCompensiBulk incarichi, it.cnr.contab.config00.sto.bulk.Unita_organizzativaBulk uo, CompoundFindClause clause) throws ComponentException, PersistencyException | ||
{ | ||
Unita_organizzativaBulk uoScrivania = ((Unita_organizzativaBulk)getHome(userContext, Unita_organizzativaBulk.class).findByPrimaryKey(new Unita_organizzativaBulk(CNRUserContext.getCd_unita_organizzativa(userContext)))); | ||
boolean isUoEnte = uoScrivania.getCd_tipo_unita().compareTo(it.cnr.contab.config00.sto.bulk.Tipo_unita_organizzativaHome.TIPO_UO_ENTE)==0; | ||
boolean isUoSac = uoScrivania.getCd_tipo_unita().compareTo(it.cnr.contab.config00.sto.bulk.Tipo_unita_organizzativaHome.TIPO_UO_SAC)==0; | ||
|
||
SQLBuilder sqlStruttura = getHome(userContext, V_struttura_organizzativaBulk.class).createSQLBuilder(); | ||
sqlStruttura.addClause("AND", "esercizio", SQLBuilder.EQUALS, ((it.cnr.contab.utenze00.bp.CNRUserContext) userContext).getEsercizio()); | ||
if (!isUoEnte){ | ||
sqlStruttura.addClause( "AND", "cd_cds", SQLBuilder.EQUALS, userContext.getCd_cds()); | ||
} | ||
if (isUoSac){ | ||
sqlStruttura.addClause(FindClause.AND, "cdUnitaOrganizzativa", SQLBuilder.EQUALS, CNRUserContext.getCd_unita_organizzativa(userContext)); | ||
} | ||
|
||
sqlStruttura.addClause( "AND", "cd_tipo_livello", SQLBuilder.EQUALS, V_struttura_organizzativaHome.LIVELLO_UO); | ||
sqlStruttura.addSQLJoin( "V_STRUTTURA_ORGANIZZATIVA.CD_ROOT", "UNITA_ORGANIZZATIVA.CD_UNITA_ORGANIZZATIVA"); | ||
|
||
SQLBuilder sql = getHome(userContext, uo.getClass()).createSQLBuilder(); | ||
sql.addSQLExistsClause("AND", sqlStruttura); | ||
sql.addClause( clause ); | ||
return sql; | ||
} | ||
|
||
public VConsRiepCompensiBulk impostaDatiIniziali( | ||
it.cnr.jada.UserContext userContext, | ||
VConsRiepCompensiBulk incarichi) | ||
throws it.cnr.jada.comp.ComponentException { | ||
|
||
incarichi.setUoForPrint(new Unita_organizzativaBulk()); | ||
incarichi.setUOForPrintEnabled(true); | ||
incarichi.setFiltroSoggetto(new TerzoBulk()); | ||
return incarichi; | ||
} | ||
|
||
private void addColumn(SQLBuilder sql, String valore, boolean addColumn){ | ||
if (addColumn) | ||
sql.addColumn(valore); | ||
} | ||
|
||
private void addSQLGroupBy(SQLBuilder sql, String valore, boolean addGroupBy){ | ||
if (addGroupBy) | ||
sql.addSQLGroupBy(valore); | ||
} | ||
|
||
public it.cnr.jada.util.RemoteIterator findRiepilogoCompensi(UserContext userContext, VConsRiepCompensiBulk riepilogCompensi) throws PersistencyException, IntrospectionException, ComponentException, RemoteException | ||
{ | ||
VConsRiepCompensiHome home = (VConsRiepCompensiHome)getHome(userContext, VConsRiepCompensiBulk.class, "CONSULTAZIONE"); | ||
SQLBuilder sql = home.createSQLBuilder(); | ||
sql.resetColumns(); | ||
|
||
addColumn(sql,"CD_TERZO",true); | ||
addColumn(sql,"COGNOME",true); | ||
addColumn(sql,"NOME",true); | ||
addColumn(sql,"CODICE_FISCALE",true); | ||
|
||
addSQLGroupBy(sql,"COGNOME",true); | ||
addSQLGroupBy(sql,"NOME",true); | ||
addSQLGroupBy(sql,"CODICE_FISCALE",true); | ||
addSQLGroupBy(sql,"CD_TERZO",true); | ||
|
||
sql.addColumn("NVL(SUM(IM_LORDO),0)", "IM_LORDO"); | ||
sql.addColumn("NVL(SUM(IRAP_ENTE),0)", "IRAP_ENTE"); | ||
sql.addColumn("NVL(SUM(INPS_ENTE),0)", "INPS_ENTE"); | ||
sql.addColumn("NVL(SUM(INAIL_ENTE),0)", "INAIL_ENTE"); | ||
sql.addColumn("NVL(SUM(IM_FISCALE),0)", "IM_FISCALE"); | ||
sql.addColumn("NVL(SUM(IRPEF),0)", "IRPEF"); | ||
sql.addColumn("NVL(SUM(BONUSDL66),0)", "BONUSDL66"); | ||
sql.addColumn("NVL(SUM(INPS_PERCIPIENTE),0)", "INPS_PERCIPIENTE"); | ||
sql.addColumn("NVL(SUM(INAIL_PERCIPIENTE),0)", "INAIL_PERCIPIENTE"); | ||
sql.addColumn("NVL(SUM(ADD_REG),0)", "ADD_REG"); | ||
sql.addColumn("NVL(SUM(ADD_COM),0)", "ADD_COM"); | ||
sql.addColumn("NVL(SUM(IM_LORDO),0) + NVL(SUM(IRAP_ENTE),0) + NVL(SUM(INPS_ENTE),0) + NVL(SUM(INAIL_ENTE),0)", "TOT_COSTO"); | ||
|
||
sql.addOrderBy("COGNOME"); | ||
sql.addOrderBy("NOME"); | ||
|
||
if (riepilogCompensi.getFiltroSoggetto() != null && riepilogCompensi.getFiltroSoggetto().getCd_terzo() != null){ | ||
sql.addSQLClause("AND","CD_TERZO",SQLBuilder.EQUALS,riepilogCompensi.getFiltroSoggetto().getCd_terzo()); | ||
} | ||
|
||
if (riepilogCompensi.getUoForPrint() != null){ | ||
sql.addSQLClause("AND","CD_UNITA_ORGANIZZATIVA",SQLBuilder.EQUALS,riepilogCompensi.getUoForPrint().getCd_unita_organizzativa()); | ||
} | ||
|
||
if (riepilogCompensi.getDa_dt_pagamento() != null){ | ||
sql.addSQLClause("AND","DT_TRASMISSIONE",SQLBuilder.GREATER_EQUALS,riepilogCompensi.getDa_dt_pagamento()); | ||
} | ||
if (riepilogCompensi.getA_dt_pagamento() != null){ | ||
sql.addSQLClause("AND","DT_TRASMISSIONE",SQLBuilder.LESS_EQUALS,riepilogCompensi.getA_dt_pagamento()); | ||
} | ||
if (riepilogCompensi.getDa_dt_competenza() != null && riepilogCompensi.getA_dt_competenza() != null){ | ||
sql.openParenthesis(FindClause.AND); | ||
|
||
sql.openParenthesis(FindClause.OR); | ||
sql.addSQLClause("AND","DT_DA_COMPETENZA_COGE",SQLBuilder.GREATER_EQUALS,riepilogCompensi.getDa_dt_competenza()); | ||
sql.addSQLClause("AND","DT_DA_COMPETENZA_COGE",SQLBuilder.LESS_EQUALS,riepilogCompensi.getA_dt_competenza()); | ||
sql.closeParenthesis(); | ||
|
||
sql.openParenthesis(FindClause.OR); | ||
sql.addSQLClause("AND","DT_A_COMPETENZA_COGE",SQLBuilder.GREATER_EQUALS,riepilogCompensi.getDa_dt_competenza()); | ||
sql.addSQLClause("AND","DT_A_COMPETENZA_COGE",SQLBuilder.LESS_EQUALS,riepilogCompensi.getA_dt_competenza()); | ||
sql.closeParenthesis(); | ||
|
||
sql.closeParenthesis(); | ||
} | ||
|
||
return iterator(userContext,sql,VConsRiepCompensiBulk.class,null); | ||
|
||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...ejb/src/main/java/it/cnr/contab/compensi00/ejb/ConsRiepilogoCompensiComponentSession.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package it.cnr.contab.compensi00.ejb; | ||
|
||
import it.cnr.contab.docamm00.consultazioni.bulk.VConsRiepCompensiBulk; | ||
import it.cnr.jada.UserContext; | ||
import it.cnr.jada.comp.ComponentException; | ||
import it.cnr.jada.persistency.IntrospectionException; | ||
import it.cnr.jada.persistency.PersistencyException; | ||
import it.cnr.jada.util.RemoteIterator; | ||
|
||
import java.rmi.RemoteException; | ||
|
||
import javax.ejb.Remote; | ||
@Remote | ||
public interface ConsRiepilogoCompensiComponentSession extends it.cnr.jada.ejb.CRUDComponentSession { | ||
RemoteIterator findRiepilogoCompensi(UserContext param0, VConsRiepCompensiBulk param1) throws PersistencyException, IntrospectionException, ComponentException, RemoteException; | ||
VConsRiepCompensiBulk impostaDatiIniziali(UserContext userContext, VConsRiepCompensiBulk incarichi) throws ComponentException; | ||
} |
60 changes: 60 additions & 0 deletions
60
...src/main/java/it/cnr/contab/compensi00/ejb/ConsRiepilogoCompensiComponentSessionBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package it.cnr.contab.compensi00.ejb; | ||
import it.cnr.contab.compensi00.comp.ConsRiepilogoCompensiComponent; | ||
import it.cnr.contab.docamm00.consultazioni.bulk.VConsRiepCompensiBulk; | ||
import it.cnr.jada.UserContext; | ||
import it.cnr.jada.comp.ComponentException; | ||
import it.cnr.jada.persistency.IntrospectionException; | ||
import it.cnr.jada.persistency.PersistencyException; | ||
import it.cnr.jada.util.RemoteIterator; | ||
|
||
import java.rmi.RemoteException; | ||
|
||
import javax.annotation.PostConstruct; | ||
import javax.ejb.EJBException; | ||
import javax.ejb.Stateless; | ||
@Stateless(name="CNRCOMPENSI00_EJB_ConsRiepilogoCompensiComponentSession") | ||
public class ConsRiepilogoCompensiComponentSessionBean extends it.cnr.jada.ejb.CRUDComponentSessionBean implements ConsRiepilogoCompensiComponentSession { | ||
@PostConstruct | ||
public void ejbCreate() throws javax.ejb.CreateException { | ||
componentObj = new ConsRiepilogoCompensiComponent(); | ||
} | ||
public static it.cnr.jada.ejb.CRUDComponentSessionBean newInstance() throws EJBException { | ||
return new ConsRiepilogoCompensiComponentSessionBean(); | ||
} | ||
public RemoteIterator findRiepilogoCompensi(UserContext param0, VConsRiepCompensiBulk param1) throws PersistencyException, IntrospectionException, ComponentException, RemoteException{ | ||
pre_component_invocation(param0,componentObj); | ||
try { | ||
RemoteIterator result = ((ConsRiepilogoCompensiComponent)componentObj).findRiepilogoCompensi(param0,param1); | ||
component_invocation_succes(param0,componentObj); | ||
return result; | ||
} catch(it.cnr.jada.comp.NoRollbackException e) { | ||
component_invocation_succes(param0,componentObj); | ||
throw e; | ||
} catch(it.cnr.jada.comp.ComponentException e) { | ||
component_invocation_failure(param0,componentObj); | ||
throw e; | ||
} catch(RuntimeException e) { | ||
throw uncaughtRuntimeException(param0,componentObj,e); | ||
} catch(Error e) { | ||
throw uncaughtError(param0,componentObj,e); | ||
} | ||
} | ||
public VConsRiepCompensiBulk impostaDatiIniziali(UserContext param0, VConsRiepCompensiBulk param1) throws ComponentException{ | ||
pre_component_invocation(param0,componentObj); | ||
try { | ||
VConsRiepCompensiBulk bulk = ((ConsRiepilogoCompensiComponent)componentObj).impostaDatiIniziali(param0,param1); | ||
component_invocation_succes(param0,componentObj); | ||
return bulk; | ||
} catch(it.cnr.jada.comp.NoRollbackException e) { | ||
component_invocation_succes(param0,componentObj); | ||
throw e; | ||
} catch(it.cnr.jada.comp.ComponentException e) { | ||
component_invocation_failure(param0,componentObj); | ||
throw e; | ||
} catch(RuntimeException e) { | ||
throw uncaughtRuntimeException(param0,componentObj,e); | ||
} catch(Error e) { | ||
throw uncaughtError(param0,componentObj,e); | ||
} | ||
} | ||
} |
101 changes: 101 additions & 0 deletions
101
...rc/main/java/it/cnr/contab/docamm00/consultazioni/action/ConsRiepilogoCompensiAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
package it.cnr.contab.docamm00.consultazioni.action; | ||
import it.cnr.contab.compensi00.ejb.ConsRiepilogoCompensiComponentSession; | ||
import it.cnr.contab.docamm00.consultazioni.bp.ConsRiepilogoCompensiBP; | ||
import it.cnr.contab.docamm00.consultazioni.bp.VisConsRiepilogoCompensiBP; | ||
import it.cnr.contab.docamm00.consultazioni.bulk.VConsRiepCompensiBulk; | ||
import it.cnr.jada.action.ActionContext; | ||
import it.cnr.jada.action.BusinessProcessException; | ||
import it.cnr.jada.action.Forward; | ||
import it.cnr.jada.action.HookForward; | ||
import it.cnr.jada.util.action.ConsultazioniAction; | ||
import it.cnr.jada.util.action.SelezionatoreListaBP; | ||
|
||
import java.rmi.RemoteException; | ||
|
||
import javax.ejb.RemoveException; | ||
|
||
/** | ||
* Action di gestione delle variazioni di bilancio preventivo | ||
*/ | ||
|
||
public class ConsRiepilogoCompensiAction extends ConsultazioniAction { | ||
public ConsRiepilogoCompensiAction() { | ||
super(); | ||
} | ||
|
||
|
||
|
||
//public Forward doCambiaGestione(ActionContext context){ | ||
// try { | ||
// fillModel(context); | ||
// ConsVarStanzCompetenzaBP bp = (ConsVarStanzCompetenzaBP)context.getBusinessProcess(); | ||
// | ||
// VIncarichiAssRicBorseStBulk bulk = (VIncarichiAssRicBorseStBulk)bp.getModel(); | ||
// bp.getParametriLivelli(context); | ||
// | ||
// return context.findDefaultForward(); | ||
// } catch(Throwable e) { | ||
// return handleException(context,e); | ||
// } | ||
//} | ||
// | ||
// | ||
|
||
public Forward doSeleziona(ActionContext context) { | ||
try{ | ||
fillModel(context); | ||
ConsRiepilogoCompensiBP bp = (ConsRiepilogoCompensiBP)context.getBusinessProcess(); | ||
VConsRiepCompensiBulk bulk = (VConsRiepCompensiBulk)bp.getModel(); | ||
// bulk.selezionaRagruppamenti(); | ||
return context.findDefaultForward(); | ||
}catch(it.cnr.jada.bulk.FillException ex){ | ||
return handleException(context, ex); | ||
} | ||
} | ||
public Forward doCerca(ActionContext context) throws RemoteException, InstantiationException, RemoveException{ | ||
ConsRiepilogoCompensiBP bp= (ConsRiepilogoCompensiBP) context.getBusinessProcess(); | ||
try { | ||
VConsRiepCompensiBulk incarichi = (VConsRiepCompensiBulk)bp.getModel(); | ||
bp.fillModel(context); | ||
bp.controlloSelezioni(context,incarichi); | ||
// bp.valorizzaTotVariazione(context,variazioni); | ||
// bp.valorizzaTi_Gestione(context,incarichi); | ||
// bp.valorizzaCd_livello1(context,variazioni); | ||
|
||
|
||
it.cnr.jada.util.RemoteIterator ri = ((ConsRiepilogoCompensiComponentSession)bp.createComponentSession()).findRiepilogoCompensi(context.getUserContext(),incarichi); | ||
ri = it.cnr.jada.util.ejb.EJBCommonServices.openRemoteIterator(context,ri); | ||
if (ri.countElements() == 0) { | ||
it.cnr.jada.util.ejb.EJBCommonServices.closeRemoteIterator(context,ri); | ||
throw new it.cnr.jada.comp.ApplicationException("Attenzione: Nessun dato disponibile."); | ||
} | ||
VisConsRiepilogoCompensiBP nbp = (VisConsRiepilogoCompensiBP)context.createBusinessProcess("VisConsRiepilogoCompensiBP"); | ||
nbp.setIterator(context,ri); | ||
nbp.disableSelection(); | ||
nbp.setBulkInfo(it.cnr.jada.bulk.BulkInfo.getBulkInfo(VConsRiepCompensiBulk.class)); | ||
nbp.setColumns(nbp.getBulkInfo().getColumnFieldPropertyDictionary("CONSULTAZIONE")); | ||
nbp.setFreeSearchSet("CONSULTAZIONE"); | ||
HookForward hook = (HookForward)context.findForward("seleziona"); | ||
return context.addBusinessProcess(nbp); | ||
|
||
|
||
} catch (Exception e) { | ||
return handleException(context,e); | ||
} | ||
|
||
} | ||
public Forward doCloseForm(ActionContext actioncontext) | ||
throws BusinessProcessException | ||
{ | ||
try | ||
{ | ||
return doConfirmCloseForm(actioncontext, 4); | ||
} | ||
catch(Throwable throwable) | ||
{ | ||
return handleException(actioncontext, throwable); | ||
} | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.