Skip to content

Commit

Permalink
Tesoreria Unica - modifiche parziali
Browse files Browse the repository at this point in the history
  • Loading branch information
rpucciarelli committed Jan 20, 2016
1 parent 21736b1 commit 792ece7
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 64 deletions.
Expand Up @@ -125,7 +125,7 @@ protected it.cnr.jada.util.jsp.Button[] createToolbar()
newToolbarTesoreria[ i ] = new it.cnr.jada.util.jsp.Button(it.cnr.jada.util.Config.getHandler().getProperties(getClass()),"CRUDToolbar.stampaProv");
newToolbarTesoreria[ i +1] = new it.cnr.jada.util.jsp.Button(it.cnr.jada.util.Config.getHandler().getProperties(getClass()),"CRUDToolbar.firma");
newToolbarTesoreria[ i +2] = new it.cnr.jada.util.jsp.Button(it.cnr.jada.util.Config.getHandler().getProperties(getClass()),"CRUDToolbar.downloadnew");
newToolbarTesoreria[ i +3] = new it.cnr.jada.util.jsp.Button(it.cnr.jada.util.Config.getHandler().getProperties(getClass()),"CRUDToolbar.downloadFirmatoP7m");
newToolbarTesoreria[ i +3] = new it.cnr.jada.util.jsp.Button(it.cnr.jada.util.Config.getHandler().getProperties(getClass()),"CRUDToolbar.downloadFirmato");
return newToolbarTesoreria;
}
else
Expand Down Expand Up @@ -797,11 +797,17 @@ private String getTitolo() {
}
public String getDocumento(){
Distinta_cassiereBulk distinta = (Distinta_cassiereBulk)getModel();

if (distinta != null){
if(!isFlusso())
return "Distinta ".
concat(String.valueOf(distinta.getEsercizio())).
concat("-").concat(distinta.getCd_unita_organizzativa()==null?"":distinta.getCd_unita_organizzativa()).
concat("-").concat(String.valueOf(distinta.getPg_distinta_def()));
else
return
String.valueOf(distinta.getEsercizio()).concat("-").concat(distinta.getCd_unita_organizzativa()==null?"":distinta.getCd_unita_organizzativa()).
concat("-").concat(String.valueOf(distinta.getPg_distinta_def())).concat("-I.xslt.p7m");
}
return null;
}
Expand Down Expand Up @@ -834,24 +840,20 @@ public void scaricaDistinta(ActionContext actioncontext) throws Exception {
public void scaricaDistintaFirmata(ActionContext actioncontext) throws Exception {
Distinta_cassiereBulk distinta = (Distinta_cassiereBulk)getModel();
if(this.getParametriCnr()!= null && this.getParametriCnr().getFl_tesoreria_unica()){
CmisObject id=null;
if(isFlusso()){
id = documentiContabiliService.getNodeByPath(distinta.getCMISPath(cmisService).getPath().concat("/").concat(String.valueOf(distinta.getEsercizio())).concat("-").concat(distinta.getCd_unita_organizzativa()).
Document id=null;
if(isFlusso()){
id = (Document) documentiContabiliService.getNodeByPath(distinta.getCMISPath(cmisService).getPath().concat("/").concat(String.valueOf(distinta.getEsercizio())).concat("-").concat(distinta.getCd_unita_organizzativa()).
concat("-").concat(String.valueOf(distinta.getPg_distinta_def())).
concat("-I.xslt.p7m"));
concat("-I.xslt.p7m"));
}else
id = documentiContabiliService.getNodeByPath(distinta.getCMISPath(cmisService).getPath().concat("/").concat("Distinta n. ").concat(String.valueOf(distinta.getPg_distinta_def())).
id = (Document) documentiContabiliService.getNodeByPath(distinta.getCMISPath(cmisService).getPath().concat("/").concat("Distinta n. ").concat(String.valueOf(distinta.getPg_distinta_def())).
concat(".pdf"));
InputStream is =null;
if(id!=null){
is = documentiContabiliService.getResource(id);
is = documentiContabiliService.getResource(id);
if (is != null){
if(isFlusso()){
((HttpActionContext)actioncontext).getResponse().setCharacterEncoding("UTF-8");
((HttpActionContext)actioncontext).getResponse().setContentType("text/html");
}
else
((HttpActionContext)actioncontext).getResponse().setContentType("application/pdf");
((HttpActionContext)actioncontext).getResponse().setCharacterEncoding("UTF-8");
((HttpActionContext)actioncontext).getResponse().setContentType(id.getContentStreamMimeType());
OutputStream os = ((HttpActionContext)actioncontext).getResponse().getOutputStream();
((HttpActionContext)actioncontext).getResponse().setDateHeader("Expires", 0);
byte[] buffer = new byte[((HttpActionContext)actioncontext).getResponse().getBufferSize()];
Expand All @@ -871,42 +873,6 @@ public Boolean isSepa() {
public void setSepa(Boolean sepa) {
this.sepa = sepa;
}
public String getDownloadUrl() throws BusinessProcessException
{
try {
Distinta_cassiereBulk distinta =(Distinta_cassiereBulk)this.getModel();
String path=null;
CmisObject id=null;
if(distinta !=null && this.getParametriCnr()!= null && this.getParametriCnr().getFl_tesoreria_unica() && distinta.getPg_distinta_def()!=null && distinta.getFl_flusso()){
File fileSigned = new File(System.getProperty("tmp.dir.SIGLAWeb")+"/tmp/"+String.valueOf(distinta.getEsercizio())+"-"+distinta.getCd_unita_organizzativa()+
"-"+String.valueOf(distinta.getPg_distinta_def())+"-I.xslt.p7m");

id = documentiContabiliService.getNodeByPath(distinta.getCMISPath(cmisService).getPath().concat("/").concat(String.valueOf(distinta.getEsercizio())).concat("-").concat(distinta.getCd_unita_organizzativa()).
concat("-").concat(String.valueOf(distinta.getPg_distinta_def())).
concat("-I.xslt.p7m"));
InputStream streamSigned = documentiContabiliService.getResource(id);
OutputStream outputStream = new FileOutputStream(fileSigned);
IOUtils.copy(streamSigned, outputStream);
outputStream.close();

return fileSigned.getAbsolutePath();
}
else
return null;
} catch (ApplicationException e) {
throw handleException(e);
} catch(java.rmi.RemoteException e) {
throw handleException(e);
} catch(ComponentException e) {
throw handleException(e);
} catch(javax.ejb.EJBException e) {
throw handleException(e);
} catch (IOException e) {
throw handleException(e);
}

}

}


Expand Up @@ -1482,6 +1482,18 @@ private SQLQuery cercaMandatiEReversaliSQL(UserContext userContext,
sql2.addSQLJoin("V_MANDATO_REVERSALE_DISTINTA.PG_DOCUMENTO_CONT",
"V_MANDATO_REVERSALE_DIST_SEPA.PG_DOCUMENTO_CONT");
sql.addSQLNotExistsClause("AND", sql2);

SQLBuilder sql3 = getHome(userContext,V_mandato_reversaleBulk.class,
"V_MANDATO_REVERSALE_DIST_XML").createSQLBuilder();
sql2.addSQLJoin("V_MANDATO_REVERSALE_DISTINTA.ESERCIZIO",
"V_MANDATO_REVERSALE_DIST_XML.ESERCIZIO");
sql2.addSQLJoin("V_MANDATO_REVERSALE_DISTINTA.CD_CDS",
"V_MANDATO_REVERSALE_DIST_XML.CD_CDS");
sql2.addSQLJoin("V_MANDATO_REVERSALE_DISTINTA.CD_TIPO_DOCUMENTO_CONT",
"V_MANDATO_REVERSALE_DIST_XML.CD_TIPO_DOCUMENTO_CONT");
sql2.addSQLJoin("V_MANDATO_REVERSALE_DISTINTA.PG_DOCUMENTO_CONT",
"V_MANDATO_REVERSALE_DIST_XML.PG_DOCUMENTO_CONT");
sql.addSQLNotExistsClause("AND", sql3);
}
sql.addSQLClause("AND", "v_mandato_reversale_distinta.ti_documento_cont", SQLBuilder.NOT_EQUALS,
MandatoBulk.TIPO_REGOLARIZZAZIONE);
Expand Down Expand Up @@ -4058,11 +4070,15 @@ private String parseFilename(File file) {

return file.getName();
}
public ExtCassiereCdsBulk recuperaCodiciCdsCassiere(UserContext userContext,Distinta_cassiereBulk distinta) throws ComponentException, PersistencyException{

public ExtCassiereCdsBulk recuperaCodiciCdsCassiere(UserContext userContext,Distinta_cassiereBulk distinta) throws ComponentException, PersistencyException, EJBException{
try{
ExtCassiereCdsBulk bulk = new ExtCassiereCdsBulk();
bulk.setEsercizio(distinta.getEsercizio());
bulk.setCdCds(distinta.getCd_cds());
if (!tesoreriaUnica(userContext, distinta))
bulk.setCdCds(distinta.getCd_cds());
else
if (distinta.getCd_cds_ente()!=null)
bulk.setCdCds(distinta.getCd_cds_ente());
List oggetti =null;
oggetti=getHome(userContext, ExtCassiereCdsBulk.class).find(bulk);
if (oggetti.size()==0)
Expand All @@ -4071,6 +4087,11 @@ else if (oggetti.size()>1)
throw new ApplicationException("Configurazione errata dati cassiere");
else
return (ExtCassiereCdsBulk)oggetti.get(0);

}catch (Exception e) {
throw handleException(e);

}
}


Expand Down
Expand Up @@ -25,15 +25,6 @@ CRUDToolbar.downloadFirmato.hiddenProperty=estraiButtonHidden
CRUDToolbar.downloadFirmato.title=Scarica firmato
CRUDToolbar.downloadFirmato.accessKey=S

CRUDToolbar.downloadFirmatoP7m.img=img/save24.gif
CRUDToolbar.downloadFirmatoP7m.disabledImg=img/save24.gif
CRUDToolbar.downloadFirmatoP7m.label=<u>S</u>carica <br>file<br> firmato&nbsp;
CRUDToolbar.downloadFirmatoP7m.href=javascript:doScaricaFirmatoP7m()
CRUDToolbar.downloadFirmatoP7m.style=width:70px;
CRUDToolbar.downloadFirmatoP7m.hiddenProperty=estraiButtonHidden
CRUDToolbar.downloadFirmatoP7m.title=Scarica firmato
CRUDToolbar.downloadFirmatoP7m.accessKey=S

CRUDToolbar.downloadnew.img=img/save24.gif
CRUDToolbar.downloadnew.disabledImg=img/save24.gif
CRUDToolbar.downloadnew.label=<u>S</u>carica <br>flusso&nbsp;
Expand Down
3 changes: 0 additions & 3 deletions sigla-web/src/main/webapp/doccont00/tab_distinta.jsp
Expand Up @@ -18,9 +18,6 @@ function doScarica() {
function doScaricaFirmato() {
doPrint('genericdownload/<%=bp.getDocumento()%>?methodName=scaricaDistintaFirmata&it.cnr.jada.action.BusinessProcess=<%=bp.getPath()%>');
}
function doScaricaFirmatoP7m() {
doPrint('genericdownload/<%=bp.getDocumento()%>?methodName=scaricaDistintaFirmata&it.cnr.jada.action.BusinessProcess=<%=bp.getPath()%>');
}
</script>

<div class="Group">
Expand Down

0 comments on commit 792ece7

Please sign in to comment.