diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c60315f..6602ae11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,20 @@ +## 10.4.0 (09-12-2024) + +### Bugfix: 6 +- [#34696](https://parermine.regione.emilia-romagna.it/issues/34696) Correzione funzione di eliminazione xsd sistema di migrazione - Errore 500 +- [#34605](https://parermine.regione.emilia-romagna.it/issues/34605) Correzione composizione AIP Unisincro 1 in caso di documenti aggiunti successivamente (caso componenti) +- [#34600](https://parermine.regione.emilia-romagna.it/issues/34600) Correzione stato restituzione archivio +- [#34492](https://parermine.regione.emilia-romagna.it/issues/34492) Fix recupero da object storage degli Indici Aip Unisincro 1.0 nell'AIP +- [#34038](https://parermine.regione.emilia-romagna.it/issues/34038) Correzione data ultimo versamento estratta per tipologia unità documentaria versata da più automi +- [#34027](https://parermine.regione.emilia-romagna.it/issues/34027) Correzione dell'errore nella modifica del formato numero nel periodo di validità di un tipo fascicolo + +### Novità: 4 +- [#34435](https://parermine.regione.emilia-romagna.it/issues/34435) Estensione servizio di recupero stato di conservazione per includere il log del processo di conservazione +- [#34239](https://parermine.regione.emilia-romagna.it/issues/34239) Estensione servizio per recupero file sbustati +- [#34199](https://parermine.regione.emilia-romagna.it/issues/34199) Nuova gestione per rapprentazione completa su base dati del seriale del certificato (CA, CRL e OCSP) +- [#31162](https://parermine.regione.emilia-romagna.it/issues/31162) Log del processo di conservazione delle unità documentarie + ## 10.3.1 (28-11-2024) ### Bugfix: 1 diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index b95d0272..34ad383a 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,4 +1,15 @@ -## 10.3.1 (28-11-2024) +## 10.4.0 (09-12-2024) -### Bugfix: 1 -- [#34747](https://parermine.regione.emilia-romagna.it/issues/34747) Introduzione log su parametro header per servizi di recupero con certificato +### Bugfix: 6 +- [#34696](https://parermine.regione.emilia-romagna.it/issues/34696) Correzione funzione di eliminazione xsd sistema di migrazione - Errore 500 +- [#34605](https://parermine.regione.emilia-romagna.it/issues/34605) Correzione composizione AIP Unisincro 1 in caso di documenti aggiunti successivamente (caso componenti) +- [#34600](https://parermine.regione.emilia-romagna.it/issues/34600) Correzione stato restituzione archivio +- [#34492](https://parermine.regione.emilia-romagna.it/issues/34492) Fix recupero da object storage degli Indici Aip Unisincro 1.0 nell'AIP +- [#34038](https://parermine.regione.emilia-romagna.it/issues/34038) Correzione data ultimo versamento estratta per tipologia unità documentaria versata da più automi +- [#34027](https://parermine.regione.emilia-romagna.it/issues/34027) Correzione dell'errore nella modifica del formato numero nel periodo di validità di un tipo fascicolo + +### Novità: 4 +- [#34435](https://parermine.regione.emilia-romagna.it/issues/34435) Estensione servizio di recupero stato di conservazione per includere il log del processo di conservazione +- [#34239](https://parermine.regione.emilia-romagna.it/issues/34239) Estensione servizio per recupero file sbustati +- [#34199](https://parermine.regione.emilia-romagna.it/issues/34199) Nuova gestione per rapprentazione completa su base dati del seriale del certificato (CA, CRL e OCSP) +- [#31162](https://parermine.regione.emilia-romagna.it/issues/31162) Log del processo di conservazione delle unità documentarie diff --git a/nbactions-dev.xml b/nbactions-dev.xml deleted file mode 100644 index b4dde17a..00000000 --- a/nbactions-dev.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - test.single - - * - - - test-compile - test - - - ${packageClassName} - false - - - - debug.test.single - - * - - - test-compile - test - - - ${packageClassName} - once - -agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} - true - false - - - - CUSTOM-build skipTests - build skipTests - - clean - package - - - true - - - - rebuild - - * - - - clean - install - - - dev - - - diff --git a/pom.xml b/pom.xml index e92e8580..e8381932 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 sacer-jboss - 10.3.2-SNAPSHOT + 10.4.0 pom sacer Progetto SACER @@ -17,11 +17,11 @@ true - 2.11.0 + 2.12.0 6.15.2 1.10.0 - 1.5.0 + 1.6.0 2.2.0 0.0.9 diff --git a/sacer-ear/pom.xml b/sacer-ear/pom.xml index a239e987..c63d5700 100644 --- a/sacer-ear/pom.xml +++ b/sacer-ear/pom.xml @@ -4,7 +4,7 @@ sacer-jboss it.eng.parer - 10.3.2-SNAPSHOT + 10.4.0 sacer-jboss-ear diff --git a/sacer-ejb/pom.xml b/sacer-ejb/pom.xml index 91809854..cde5122f 100644 --- a/sacer-ejb/pom.xml +++ b/sacer-ejb/pom.xml @@ -3,7 +3,7 @@ sacer-jboss it.eng.parer - 10.3.2-SNAPSHOT + 10.4.0 sacer-jboss-ejb diff --git a/sacer-ejb/src/main/java/it/eng/parer/amministrazioneStrutture/gestioneTipoUd/ejb/TipoUnitaDocEjb.java b/sacer-ejb/src/main/java/it/eng/parer/amministrazioneStrutture/gestioneTipoUd/ejb/TipoUnitaDocEjb.java index 7ebee8f3..2ef38cee 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/amministrazioneStrutture/gestioneTipoUd/ejb/TipoUnitaDocEjb.java +++ b/sacer-ejb/src/main/java/it/eng/parer/amministrazioneStrutture/gestioneTipoUd/ejb/TipoUnitaDocEjb.java @@ -164,12 +164,8 @@ public class TipoUnitaDocEjb { @EJB private ModelliSerieHelper modelliSerieHelper; @EJB - private RegistroHelper registroHelper; - @EJB private AmministrazioneEjb amministrazioneEjb; @EJB - private AmministrazioneHelper amministrazioneHelper; - @EJB private ObjectStorageService objectStorageService; /** @@ -996,18 +992,14 @@ public DecTipoUnitaDocTableBean getDecTipoUnitaDocTableBean(BigDecimal idStrut, String a = null; // Recupero i Sistemi versanti - tipoUnitaRow.setString("nm_sistema_versante", helper - .getAplSistemiVersantiSeparatiPerTipoUd(new BigDecimal(tipoUnitaDoc.getIdTipoUnitaDoc()))); - - // Sistemi versanti - AplSistemaVersanteTableBean listaSistemiVersanti = getAplSistemaVersanteTableBean( - tipoUnitaRow.getIdTipoUnitaDoc()); - AplSistemaVersanteRowBean rigaSistemaVersante = listaSistemiVersanti.getRow(0); - if (rigaSistemaVersante != null && rigaSistemaVersante.getObject("dt_first_vers") != null) { - Date d = (Date) rigaSistemaVersante.getObject("dt_first_vers"); - tipoUnitaRow.setObject("dt_first_vers", d); - Date dLast = (Date) rigaSistemaVersante.getObject("dt_last_vers"); - tipoUnitaRow.setObject("dt_last_vers", dLast); + tipoUnitaRow.setString("nm_sistema_versante", helper.getNmSistemiVersantiRaggruppatiPerTipoUd( + new BigDecimal(tipoUnitaDoc.getIdTipoUnitaDoc()))); + + Object[] sisVersPerTipoUd = helper + .getDtErogSistemiVersantiPerTipoUd(new BigDecimal(tipoUnitaDoc.getIdTipoUnitaDoc())); + if (sisVersPerTipoUd != null) { + tipoUnitaRow.setObject("dt_first_vers", (Date) sisVersPerTipoUd[0]); + tipoUnitaRow.setObject("dt_last_vers", (Date) sisVersPerTipoUd[1]); } boolean existsValoreParamApplicTipoUd = helper @@ -1017,7 +1009,8 @@ public DecTipoUnitaDocTableBean getDecTipoUnitaDocTableBean(BigDecimal idStrut, tipoUnitaTableBean.add(tipoUnitaRow); } } - } catch (Exception e) { + } catch (ClassNotFoundException | IllegalAccessException | IllegalArgumentException | InstantiationException + | NoSuchMethodException | InvocationTargetException e) { logger.error(e.getMessage(), e); } diff --git a/sacer-ejb/src/main/java/it/eng/parer/amministrazioneStrutture/gestioneTipoUd/helper/TipoUnitaDocHelper.java b/sacer-ejb/src/main/java/it/eng/parer/amministrazioneStrutture/gestioneTipoUd/helper/TipoUnitaDocHelper.java index 3f58f132..6982b3b2 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/amministrazioneStrutture/gestioneTipoUd/helper/TipoUnitaDocHelper.java +++ b/sacer-ejb/src/main/java/it/eng/parer/amministrazioneStrutture/gestioneTipoUd/helper/TipoUnitaDocHelper.java @@ -667,7 +667,7 @@ public List getDecTipoUnitaDocList(BigDecimal idStrut, boolean } /** - * Restituisce i sistemi versanti associati al tipo unità documentaria + * Restituisce la lista di sistemi versanti associati al tipo unità documentaria * * @param idTipoUnitaDoc * id tipo unita doc @@ -684,14 +684,14 @@ public List retrieveAplSistemaVersanteListPerTipoUd(BigDecimal idTipoU } /** - * Restituisce i sistemi versanti associati al tipo unità documentaria. + * Restituisce i sistemi versanti, concatenati, associati al tipo unità documentaria. * * @param idTipoUnitaDoc * id tipo unita doc * * @return String sistemi versanti */ - public String getAplSistemiVersantiSeparatiPerTipoUd(BigDecimal idTipoUnitaDoc) { + public String getNmSistemiVersantiRaggruppatiPerTipoUd(BigDecimal idTipoUnitaDoc) { Query q = getEntityManager().createQuery("SELECT dec.nmSistemaVersante FROM DecVLisSisVersByTipoUd dec " + "WHERE dec.id.idTipoUnitaDoc = :idTipoUnitaDoc " + "ORDER BY dec.nmSistemaVersante ASC"); q.setParameter("idTipoUnitaDoc", idTipoUnitaDoc); @@ -699,6 +699,26 @@ public String getAplSistemiVersantiSeparatiPerTipoUd(BigDecimal idTipoUnitaDoc) return StringUtils.join(sList, ", "); } + /** + * Restituisce le date di primo e ultimo versamento del tipo unità documentaria. + * + * @param idTipoUnitaDoc + * id tipo unita doc + * + * @return Object[] le date + */ + public Object[] getDtErogSistemiVersantiPerTipoUd(BigDecimal idTipoUnitaDoc) { + Query q = getEntityManager() + .createQuery("SELECT MIN(dec.dtErog), MAX(dec.dtLastErog) FROM DecVLisSisVersByTipoUd dec " + + "WHERE dec.id.idTipoUnitaDoc = :idTipoUnitaDoc "); + q.setParameter("idTipoUnitaDoc", idTipoUnitaDoc); + List sList = q.getResultList(); + if (!sList.isEmpty()) { + return sList.get(0); + } + return null; + } + public List retrieveAplSistemaVersanteList() { Query q = getEntityManager().createQuery("SELECT sistemaVersante FROM AplSistemaVersante sistemaVersante "); return q.getResultList(); diff --git a/sacer-ejb/src/main/java/it/eng/parer/annulVers/ejb/AnnulVersEjb.java b/sacer-ejb/src/main/java/it/eng/parer/annulVers/ejb/AnnulVersEjb.java index 883e6370..8c6d51c2 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/annulVers/ejb/AnnulVersEjb.java +++ b/sacer-ejb/src/main/java/it/eng/parer/annulVers/ejb/AnnulVersEjb.java @@ -37,6 +37,7 @@ import it.eng.parer.serie.helper.SerieHelper; import it.eng.parer.slite.gen.viewbean.*; import it.eng.parer.viewEntity.*; +import it.eng.parer.web.ejb.UnitaDocumentarieEjb; import it.eng.parer.web.helper.ComponentiHelper; import it.eng.parer.web.helper.UnitaDocumentarieHelper; import it.eng.parer.web.util.Constants; @@ -103,6 +104,11 @@ public class AnnulVersEjb { private SerieHelper serieHelper; @EJB private FascicoliHelper fascicoliHelper; + // MEV #31162 + @EJB + private UnitaDocumentarieEjb udEjb; + // end MEV #31162 + @PersistenceContext(unitName = "ParerJPA") private EntityManager entityManager; @@ -1160,23 +1166,24 @@ public void elaboraRichiestaAnnullamento(long idRichAnnulVers, long idUserIam) { //////////////////////// richiesta non ci sono item da //////////////////////// annullare in ping procedo if (proseguiAnnullamento && !richAnnulInPing) { - context.getBusinessObject(AnnulVersEjb.class).evasioneRichiestaAnnullamento(richiestaAnnullamento); + context.getBusinessObject(AnnulVersEjb.class).evasioneRichiestaAnnullamento(richiestaAnnullamento, + idUserIam); } } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void evasioneRichiestaAnnullamento(AroRichAnnulVers richiestaAnnullamento) { + public void evasioneRichiestaAnnullamento(AroRichAnnulVers richiestaAnnullamento, long idUserIam) { richiestaAnnullamento = entityManager.find(AroRichAnnulVers.class, richiestaAnnullamento.getIdRichAnnulVers(), LockModeType.PESSIMISTIC_WRITE); if (richiestaAnnullamento.getTiRichAnnulVers().equals(CostantiDB.TiRichAnnulVers.UNITA_DOC.name())) { - evadiAnnullamentoVersamentiUnitaDoc(richiestaAnnullamento); + evadiAnnullamentoVersamentiUnitaDoc(richiestaAnnullamento, idUserIam); } else if (richiestaAnnullamento.getTiRichAnnulVers().equals(CostantiDB.TiRichAnnulVers.FASCICOLI.name())) { - evadiAnnullamentoVersamentiFascicoli(richiestaAnnullamento); + evadiAnnullamentoVersamentiFascicoli(richiestaAnnullamento, idUserIam); } } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void evadiAnnullamentoVersamentiUnitaDoc(AroRichAnnulVers richiestaAnnullamento) { + public void evadiAnnullamentoVersamentiUnitaDoc(AroRichAnnulVers richiestaAnnullamento, long idUserIam) { long idRichAnnulVers = richiestaAnnullamento.getIdRichAnnulVers(); logger.debug("{} Id richiesta annullamento versamento {}", LOG_MESSAGE_ANNULLA_UD, idRichAnnulVers); AroStatoRichAnnulVers statoRichAnnulVers = helper.findById(AroStatoRichAnnulVers.class, @@ -1420,10 +1427,25 @@ public void evadiAnnullamentoVersamentiUnitaDoc(AroRichAnnulVers richiestaAnnull logger.debug("{} - Modifica ud, doc e collegamenti della richiesta avente id: {}", LOG_MESSAGE_ANNULLA_UD, idRichAnnulVers); + + // MEV #31162 + List idUnitaDocList = helper.getUnitaDocumentarieItem(idRichAnnulVers); + // end MEV #31162 + // Modifico le ud corrispondenti agli item helper.updateUnitaDocumentarieItem(idRichAnnulVers, dataAnnullamento, CostantiDB.TipoAnnullamentoUnitaDoc.ANNULLAMENTO.name(), CostantiDB.StatoConservazioneUnitaDoc.ANNULLATA.name(), richiestaAnnullamento.getNtRichAnnulVers()); + + // MEV #31162 + IamUser utente = helper.findById(IamUser.class, idUserIam); + for (Long idUnitaDoc : idUnitaDocList) { + udEjb.insertLogStatoConservUd(idUnitaDoc, utente.getNmUserid(), + Constants.EVASIONE_RICHIESTA_ANNULLAMENTO_UD, + CostantiDB.StatoConservazioneUnitaDoc.ANNULLATA.name(), Constants.ANNULLAMENTO_ONLINE); + } + // end MEV #31162 + // Modifico le upd corrispondenti agli item helper.updateUpdUnitaDocumentarieItem(idRichAnnulVers, dataAnnullamento, richiestaAnnullamento.getNtRichAnnulVers()); @@ -1477,7 +1499,7 @@ public void evadiAnnullamentoVersamentiUnitaDoc(AroRichAnnulVers richiestaAnnull } @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void evadiAnnullamentoVersamentiFascicoli(AroRichAnnulVers richiestaAnnullamento) { + public void evadiAnnullamentoVersamentiFascicoli(AroRichAnnulVers richiestaAnnullamento, long idUserIam) { long idRichAnnulVers = richiestaAnnullamento.getIdRichAnnulVers(); AroStatoRichAnnulVers statoRichAnnulVers = helper.findById(AroStatoRichAnnulVers.class, richiestaAnnullamento.getIdStatoRichAnnulVersCor()); @@ -1600,6 +1622,19 @@ public void evadiAnnullamentoVersamentiFascicoli(AroRichAnnulVers richiestaAnnul // MAC#22156 logger.debug( "Annullamento Versamenti Fascicoli - Aggiorna le unit\u00E0 doc appartenenti ai fascicoli della richiesta, assegnando stato = AIP_GENERATO o AIP_FIRMATO, purch\u00E8 tali unit\u00E0 doc non appartengano ad altro fascicolo con stato = VERSAMENTO_IN_ARCHIVIO o IN_ARCHIVIO"); + + // MEV #31162 + List idUnitaDocListAipGenerato = helper.getAroUnitaDocWithoutOtherFascicolos(idRichAnnulVers, + Arrays.asList(CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name(), + CostantiDB.StatoConservazioneUnitaDoc.IN_ARCHIVIO.name()), + ""); + + List idUnitaDocListAipFirmato = helper.getAroUnitaDocWithoutOtherFascicolos(idRichAnnulVers, + Arrays.asList(CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name(), + CostantiDB.StatoConservazioneUnitaDoc.IN_ARCHIVIO.name()), + "NOT"); + // end MEV #31162 + helper.updateStatoConsAipGeneratoAroUnitaDocWithoutOtherFascicolos(idRichAnnulVers, Arrays.asList(CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name(), CostantiDB.StatoConservazioneUnitaDoc.IN_ARCHIVIO.name())); @@ -1607,6 +1642,22 @@ public void evadiAnnullamentoVersamentiFascicoli(AroRichAnnulVers richiestaAnnul Arrays.asList(CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name(), CostantiDB.StatoConservazioneUnitaDoc.IN_ARCHIVIO.name())); // end MAC#22156 + + // MEV #31162 + IamUser utente = helper.findById(IamUser.class, idUserIam); + for (Long idUnitaDoc : idUnitaDocListAipGenerato) { + udEjb.insertLogStatoConservUd(idUnitaDoc, utente.getNmUserid(), + Constants.EVASIONE_RICHIESTA_ANNULLAMENTO_FASC, + CostantiDB.StatoConservazioneUnitaDoc.AIP_GENERATO.name(), Constants.WS_ANNULLAMENTO); + } + + for (Long idUnitaDoc : idUnitaDocListAipFirmato) { + udEjb.insertLogStatoConservUd(idUnitaDoc, utente.getNmUserid(), + Constants.EVASIONE_RICHIESTA_ANNULLAMENTO_FASC, + CostantiDB.StatoConservazioneUnitaDoc.AIP_FIRMATO.name(), Constants.WS_ANNULLAMENTO); + } + // end MEV #31162 + logger.debug("Annullamento Versamenti Fascicoli - Registro il nuovo stato della richiesta avente id: {}", idRichAnnulVers); // Registra il nuovo stato della richiesta diff --git a/sacer-ejb/src/main/java/it/eng/parer/annulVers/helper/AnnulVersHelper.java b/sacer-ejb/src/main/java/it/eng/parer/annulVers/helper/AnnulVersHelper.java index 1edd6a2d..8ef6e37f 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/annulVers/helper/AnnulVersHelper.java +++ b/sacer-ejb/src/main/java/it/eng/parer/annulVers/helper/AnnulVersHelper.java @@ -503,6 +503,15 @@ public void updateUnitaDocumentarieItem(long idRichAnnulVers, Date dtAnnul, Stri q.executeUpdate(); } + // MEV #31162 + public List getUnitaDocumentarieItem(long idRichAnnulVers) { + Query q = getEntityManager().createQuery("SELECT unitaDoc.idUnitaDoc FROM AroUnitaDoc unitaDoc " + + "WHERE EXISTS (SELECT itemRichAnnulVers FROM AroItemRichAnnulVers itemRichAnnulVers WHERE itemRichAnnulVers.aroRichAnnulVers.idRichAnnulVers = :idRichAnnulVers AND itemRichAnnulVers.aroUnitaDoc.idUnitaDoc = unitaDoc.idUnitaDoc AND itemRichAnnulVers.tiStatoItem = 'DA_ANNULLARE_IN_SACER' ) "); + q.setParameter("idRichAnnulVers", idRichAnnulVers); + return q.getResultList(); + } + // end MEV #31162 + public void updateUpdUnitaDocumentarieItem(long idRichAnnulVers, Date dtAnnul, String ntAnnul) { Query q = getEntityManager().createQuery( "UPDATE AroUpdUnitaDoc updUnitaDoc SET updUnitaDoc.dtAnnul = :dtAnnul, updUnitaDoc.ntAnnul = :ntAnnul " @@ -994,6 +1003,43 @@ public int updateStatoConsAipFirmatoAroUnitaDocWithoutOtherFascicolos(long idRic } // end MAC#22156 + // MEV #31162 + public List getAroUnitaDocWithoutOtherFascicolos(long idRichAnnulVers, List statiUdExcluded, + String clause) { + Query query = getEntityManager().createQuery("SELECT ud.idUnitaDoc FROM AroUnitaDoc ud " + + "WHERE ud.tiStatoConservazione IN :statiUdExcluded AND " + + "EXISTS (SELECT udFasc_1 FROM AroItemRichAnnulVers itemRichAnnulVers_1, FasUnitaDocFascicolo udFasc_1 " + + "JOIN itemRichAnnulVers_1.aroRichAnnulVers richAnnulVers_1 " + "JOIN udFasc_1.fasFascicolo fasc_1 " + + "JOIN udFasc_1.aroUnitaDoc ud_1 " + + "WHERE richAnnulVers_1.idRichAnnulVers = :idRichAnnulVers AND itemRichAnnulVers_1.tiStatoItem = 'DA_ANNULLARE_IN_SACER' " + + "AND itemRichAnnulVers_1.fasFascicolo = fasc_1 AND ud_1 = ud ) " + + "AND NOT EXISTS (SELECT udFasc_2 FROM AroItemRichAnnulVers itemRichAnnulVers_2, FasUnitaDocFascicolo udFasc_2 " + + "JOIN itemRichAnnulVers_2.aroRichAnnulVers richAnnulVers_2 " + "JOIN udFasc_2.fasFascicolo fasc_2 " + + "JOIN udFasc_2.aroUnitaDoc ud_2 " + + "WHERE richAnnulVers_2.idRichAnnulVers = :idRichAnnulVers AND itemRichAnnulVers_2.tiStatoItem = 'DA_ANNULLARE_IN_SACER' " + + "AND itemRichAnnulVers_2.fasFascicolo != fasc_2 AND ud_2.idUnitaDoc = ud.idUnitaDoc " + + "AND fasc_2.dtAnnull = :defaultAnnull) " + "AND " + clause + + " EXISTS (SELECT eleDaElab FROM ElvElencoVersDaElab eleDaElab " + + "JOIN eleDaElab.elvElencoVer elenco " + "WHERE elenco = ud.elvElencoVer)"); + query.setParameter("idRichAnnulVers", idRichAnnulVers); + query.setParameter("statiUdExcluded", statiUdExcluded); + + Calendar c = Calendar.getInstance(); + c.set(Calendar.HOUR_OF_DAY, 0); + c.set(Calendar.MINUTE, 0); + c.set(Calendar.SECOND, 0); + c.set(Calendar.MILLISECOND, 0); + c.set(Calendar.YEAR, 2444); + c.set(Calendar.MONTH, Calendar.DECEMBER); + c.set(Calendar.DATE, 31); + + query.setParameter("defaultAnnull", c.getTime()); + + return query.getResultList(); + } + + // end MEV #31162 + public List retrieveElvVLisFascAnnulByElenco(long idRichAnnulVers, long idElencoVersFasc) { Query query = getEntityManager().createQuery( diff --git a/sacer-ejb/src/main/java/it/eng/parer/fascicoli/ejb/ElenchiVersFascicoliEjb.java b/sacer-ejb/src/main/java/it/eng/parer/fascicoli/ejb/ElenchiVersFascicoliEjb.java index 6de3f9fc..47bffa74 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/fascicoli/ejb/ElenchiVersFascicoliEjb.java +++ b/sacer-ejb/src/main/java/it/eng/parer/fascicoli/ejb/ElenchiVersFascicoliEjb.java @@ -94,7 +94,9 @@ import it.eng.parer.viewEntity.ElvVRicElencoFasc; import it.eng.parer.viewEntity.ElvVRicElencoFascByFas; import it.eng.parer.viewEntity.ElvVRicElencoFascByStato; +import it.eng.parer.web.ejb.UnitaDocumentarieEjb; import it.eng.parer.web.helper.ConfigurationHelper; +import it.eng.parer.web.util.Constants; import it.eng.parer.web.util.Transform; import it.eng.parer.ws.dto.CSVersatore; import it.eng.parer.ws.utils.Costanti; @@ -131,6 +133,8 @@ public class ElenchiVersFascicoliEjb { @EJB private ObjectStorageService objectStorageService; // end MEV#30399 + @EJB + private UnitaDocumentarieEjb udEjb; public ElvElencoVersFascRowBean getElvElencoVersFascRowBean(BigDecimal idElencoVersFasc) { ElvElencoVersFasc elenco = evfWebHelper.findById(ElvElencoVersFasc.class, idElencoVersFasc.longValue()); @@ -956,7 +960,8 @@ public ElvFileElencoVersFasc storeFirmaElencoIndiceAipFasc(Long idElencoVersFasc /* Setto l'elenco a stato COMPLETATO */ statoElencoVersFasc.setTiStato(TiStatoElencoFasc.COMPLETATO); /* Imposto l'utente firmatario */ - statoElencoVersFasc.setIamUser(evfWebHelper.findById(IamUser.class, idUtente)); + IamUser utente = evfWebHelper.findById(IamUser.class, idUtente); + statoElencoVersFasc.setIamUser(utente); elenco.getElvStatoElencoVersFascicoli().add(statoElencoVersFasc); /* Aggiorno l’elenco specificando l’identificatore dello stato corrente */ Long idStatoElencoVersFasc = evfHelper @@ -1007,6 +1012,12 @@ public boolean evaluate(final Object object) { .equals(CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name())) { unitaDocFascicolo.getAroUnitaDoc() .setTiStatoConservazione(CostantiDB.StatoConservazioneUnitaDoc.IN_ARCHIVIO.name()); + // MEV #31162 + udEjb.insertLogStatoConservUd(unitaDocFascicolo.getAroUnitaDoc().getIdUnitaDoc(), + utente.getNmUserid(), Constants.FIRMA_ELENCO_INDICE_AIP_FASC, + CostantiDB.StatoConservazioneUnitaDoc.IN_ARCHIVIO.name(), + Constants.FUNZIONALITA_ONLINE); + // end MEV #31162 } } } diff --git a/sacer-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/CryptoInvoker.java b/sacer-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/CryptoInvoker.java index c5b6fdae..b9c71085 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/CryptoInvoker.java +++ b/sacer-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/CryptoInvoker.java @@ -14,9 +14,9 @@ * You should have received a copy of the GNU Affero General Public License along with this program. * If not, see . */ - package it.eng.parer.firma.crypto.verifica; +import it.eng.parer.crypto.model.CryptoSignedP7mUri; import java.net.URI; import java.util.Base64; import java.util.List; @@ -45,8 +45,18 @@ import it.eng.parer.crypto.model.ParerTST; import it.eng.parer.crypto.model.exceptions.CryptoParerException; import it.eng.parer.firma.crypto.helper.CryptoRestConfiguratorHelper; +import it.eng.parer.objectstorage.ejb.AwsPresigner; import it.eng.parer.retry.ParerRetryConfiguration; import it.eng.parer.retry.RestRetryInterceptor; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import javax.ejb.EJBException; +import org.springframework.core.io.FileSystemResource; /** * Invoca la Cryptolibrary. @@ -60,10 +70,15 @@ public class CryptoInvoker { private static final String CRL_CTX = "/api/crl"; private static final String TST_CTX = "/api/tst"; private static final String TSD_CTX = "/api/tsd"; + private static final String UNSIGNED_P7M_CTX = "/api/unsigned-p7m"; + + private static final Logger log = LoggerFactory.getLogger(CryptoInvoker.class); @EJB protected CryptoRestConfiguratorHelper restInvoker; + private static final int BUFFERSIZE = 10 * 1024 * 1024; // 10 megabyte + /** * Health check per il cluster.(Attualmente non è utilizzato) * @@ -215,6 +230,162 @@ public String getFilename() { return result; } + /** + * Ottieni il file sbustato dal .p7m passato. + * + * @param fileP7m + * contenuto da sbustare. + * + * @return Oggetto sbustato. + */ + // @ParerRetry(contextDataValue = RestInvoker.CURRENT_URL, retryException = RestClientException.class) + public ResponseEntity sbustaP7m(File fileP7m) { + RestTemplate restTemplate = buildRestTemplateWithRetry(); + ResponseEntity result = null; + + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.MULTIPART_FORM_DATA); + List l = new ArrayList(); + l.add(MediaType.APPLICATION_XML); + headers.setAccept(l); + /* + * org.springframework.core.io.Resource resource = new ByteArrayResource(fileP7m) { + * + * @Override public String getFilename() { return "sbustaP7m"; } }; + */ + org.springframework.core.io.Resource resource = new FileSystemResource(fileP7m); + + MultiValueMap body = new LinkedMultiValueMap<>(); + body.add("description", "Richiesta sbustamento p7m"); + // body.add("file", resource); + body.add("signed-p7m", resource); + + HttpEntity> requestEntity = new HttpEntity<>(body, headers); + + String preferredEndPoint = restInvoker.preferredEndpoint(); + + String endpoint = preferredEndPoint + UNSIGNED_P7M_CTX; + LOG.debug("post per " + endpoint); + + result = restTemplate.postForEntity(endpoint, requestEntity, byte[].class); + // new ByteArrayInputStream(response.getBody().getBytes()) + return result; + } + + public ResponseEntity sbustaDaOs(CryptoSignedP7mUri dto) { + RestTemplate restTemplate = buildRestTemplateWithRetry(); + ResponseEntity result = null; + + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + + HttpEntity entity = new HttpEntity<>(dto, headers); + + String preferredEndPoint = restInvoker.preferredEndpoint(); + + String endpoint = preferredEndPoint + UNSIGNED_P7M_CTX; + LOG.debug("post per " + endpoint); + + result = restTemplate.postForEntity(endpoint, entity, byte[].class); + return result; + } + + /** + * Copia uno stream in input su un file temporaneo, sbusta il .p7m e strimma il file sbustato nell'outputStream. + * + * @param is + * Stream di input. + * @param os + * Stream di output. + */ + public void copiaStreamsESbustaP7m(InputStream is, OutputStream os) { + int len; + byte[] buffer = new byte[BUFFERSIZE]; + File fileP7m = null; + try { + // Inizia a Strimmare l'input su file temporaneo + fileP7m = File.createTempFile("tempFilePerP7m", ".p7m"); + log.debug("Creo file temporaneo di appoggio..."); + try (OutputStream outFileTemp = new FileOutputStream(fileP7m)) { + while ((len = is.read(buffer)) > 0) { + outFileTemp.write(buffer, 0, len); + } + } + log.info("Scritto file temporaneo {}", fileP7m.getName()); + // Ora sbusta il p7m uploadando il file temporaneo sul servizio di sbustamento ottenendo il file sbustato + // come array di bytes + ResponseEntity fileSbustato = sbustaP7m(fileP7m); + // AdessoStrimma il file sbustato ricevut come array di byte sull'output + log.debug("Inizio a sttimmare il file sbustato appena ricevuto nello ZIP..."); + try (InputStream is2 = new ByteArrayInputStream(fileSbustato.getBody());) { + int len2; + while ((len2 = is2.read(buffer)) > 0) { + os.write(buffer, 0, len2); + log.debug("letto blob e scritto su stream..."); + } + } + } catch (IOException ex) { + log.error("Eccezione CryptoInvoker.copiaStreamsESbusta()", ex); + // EJB spec (14.2.2 in the EJB 3) + throw new EJBException(ex); + } finally { + // Cancella il file temporaneo! + if (fileP7m != null) { + fileP7m.delete(); + } + } + } + + /** + * Copia uno stream in input su un file temporaneo, sbusta il .p7m e strimma il file sbustato nell'outputStream. + * + * @param fileP7m + * File .p7m da sbustare. + * @param os + * Stream di output. + */ + public void sbustaFileP7mEStrimmaOutput(File fileP7m, OutputStream os) { + byte[] buffer = new byte[BUFFERSIZE]; + + // Ora sbusta il p7m uploadando il file temporaneo sul servizio di sbustamento ottenendo il file sbustato + // come array di bytes + ResponseEntity fileSbustato = sbustaP7m(fileP7m); + // Adesso strimma il file sbustato ricevuto come array di byte sull'output + log.debug("Inizio a steamare il file sbustato appena ricevuto nello ZIP..."); + try (InputStream is2 = new ByteArrayInputStream(fileSbustato.getBody());) { + int len2; + while ((len2 = is2.read(buffer)) > 0) { + os.write(buffer, 0, len2); + log.debug("letto blob e scritto su stream..."); + } + } catch (IOException ex) { + log.error("Eccezione CryptoInvoker.sbustaFileP7mEStrimmaOutput()", ex); + // EJB spec (14.2.2 in the EJB 3) + throw new EJBException(ex); + } + } + + public void sbustaDaOsEStrimmaOutput(CryptoSignedP7mUri dto, OutputStream os) { + byte[] buffer = new byte[BUFFERSIZE]; + + // Ora sbusta il p7m uploadando il file temporaneo sul servizio di sbustamento ottenendo il file sbustato + // come array di bytes + ResponseEntity fileSbustato = sbustaDaOs(dto); + // Adesso strimma il file sbustato ricevuto come array di byte sull'output + log.debug("Inizio a steamare il file sbustato da OS nello ZIP..."); + try (InputStream is2 = new ByteArrayInputStream(fileSbustato.getBody());) { + int len2; + while ((len2 = is2.read(buffer)) > 0) { + os.write(buffer, 0, len2); + log.debug("letto blob e scritto su stream..."); + } + } catch (IOException ex) { + log.error("Eccezione CryptoInvoker.sbustaDaOsEStrimmaOutput()", ex); + // EJB spec (14.2.2 in the EJB 3) + throw new EJBException(ex); + } + } + /** * Ottieni l'oggetto marcato. * diff --git a/sacer-ejb/src/main/java/it/eng/parer/job/calcoloEstrazione/RestituzioneArchivioJob.java b/sacer-ejb/src/main/java/it/eng/parer/job/calcoloEstrazione/RestituzioneArchivioJob.java index 9429cba7..4e1dfdfb 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/job/calcoloEstrazione/RestituzioneArchivioJob.java +++ b/sacer-ejb/src/main/java/it/eng/parer/job/calcoloEstrazione/RestituzioneArchivioJob.java @@ -41,7 +41,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import it.eng.parer.async.ejb.CalcoloEstrazioneAsync; import it.eng.parer.async.helper.CalcoloEstrazioneHelper; import it.eng.parer.async.utils.IOUtils; import it.eng.parer.async.utils.UdSerFascObj; @@ -59,8 +58,10 @@ import it.eng.parer.grantedEntity.SIOrgEnteSiam; import it.eng.parer.job.helper.JobHelper; import it.eng.parer.job.utils.JobConstants; +import it.eng.parer.util.helper.UniformResourceNameUtilHelper; import it.eng.parer.viewEntity.AroVChkAipRestArchUd; import it.eng.parer.web.helper.ConfigurationHelper; +import it.eng.parer.web.helper.UnitaDocumentarieHelper; import it.eng.parer.web.util.RecuperoWeb; import it.eng.parer.ws.recupero.dto.RispostaWSRecupero; import it.eng.parer.ws.utils.CostantiDB; @@ -83,11 +84,13 @@ public class RestituzioneArchivioJob { @EJB private JobHelper jobHelper; @EJB - private CalcoloEstrazioneAsync calcoloAsync; - @EJB private CalcoloEstrazioneHelper calcoloHelper; @EJB private ConfigurationHelper configurationHelper; + @EJB(mappedName = "java:app/Parer-ejb/UnitaDocumentarieHelper") + private UnitaDocumentarieHelper udHelper; + @EJB(mappedName = "java:app/Parer-ejb/UniformResourceNameUtilHelper") + private UniformResourceNameUtilHelper urnHelper; private static final Logger LOGGER = LoggerFactory.getLogger(RestituzioneArchivioJob.class); diff --git a/sacer-ejb/src/main/java/it/eng/parer/job/indiceAip/ejb/ElaborazioneRigaIndiceAipDaElab.java b/sacer-ejb/src/main/java/it/eng/parer/job/indiceAip/ejb/ElaborazioneRigaIndiceAipDaElab.java index da2686f8..66ee36b0 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/job/indiceAip/ejb/ElaborazioneRigaIndiceAipDaElab.java +++ b/sacer-ejb/src/main/java/it/eng/parer/job/indiceAip/ejb/ElaborazioneRigaIndiceAipDaElab.java @@ -84,6 +84,7 @@ import it.eng.parer.viewEntity.AroVDtVersMaxByUnitaDoc; import it.eng.parer.viewEntity.AroVLisLinkUnitaDoc; import it.eng.parer.web.ejb.ElenchiVersamentoEjb; +import it.eng.parer.web.ejb.UnitaDocumentarieEjb; import it.eng.parer.web.helper.ConfigurationHelper; import it.eng.parer.web.helper.ParamIamHelper; import it.eng.parer.web.util.Constants; @@ -129,6 +130,10 @@ public class ElaborazioneRigaIndiceAipDaElab { @EJB private ObjectStorageService objectStorageService; // end MEV#30395 + // MEV #31162 + @EJB + private UnitaDocumentarieEjb udEjb; + // end MEV #31162 @Resource(mappedName = "jms/ProducerConnectionFactory") private ConnectionFactory connectionFactory; @@ -477,8 +482,19 @@ public void gestisciIndiceAipDaElab(AroIndiceAipUdDaElab udDaElab, String sincro // end MAC#27786 ) { aroUnitaDoc.setTiStatoConservazione(CostantiDB.StatoConservazioneUnitaDoc.AIP_IN_AGGIORNAMENTO.name()); + // MEV #31162 + udEjb.insertLogStatoConservUd(aroUnitaDoc.getIdUnitaDoc(), Constants.NM_AGENTE_SACER, + Constants.CREAZIONE_INDICE_AIP_UD, + CostantiDB.StatoConservazioneUnitaDoc.AIP_IN_AGGIORNAMENTO.name(), + Constants.JOB_CREAZIONE_INDICE_AIP); + // end MEV #31162 } else { aroUnitaDoc.setTiStatoConservazione(CostantiDB.StatoConservazioneUnitaDoc.AIP_GENERATO.name()); + // MEV #31162 + udEjb.insertLogStatoConservUd(aroUnitaDoc.getIdUnitaDoc(), Constants.NM_AGENTE_SACER, + Constants.CREAZIONE_INDICE_AIP_UD, CostantiDB.StatoConservazioneUnitaDoc.AIP_GENERATO.name(), + Constants.JOB_CREAZIONE_INDICE_AIP); + // end MEV #31162 } } @@ -657,6 +673,13 @@ public void gestisciIndiceAipOs(long idUnitaDoc) AroIndiceAipUd aroIndice = lastVer.getAroIndiceAipUd(); aroIndice.setIdVerIndiceAipLast(new BigDecimal(lastVer.getIdVerIndiceAip())); unitaDoc.setTiStatoConservazione(CostantiDB.StatoConservazioneUnitaDoc.AIP_GENERATO.name()); + + // MEV #31162 + udEjb.insertLogStatoConservUd(unitaDoc.getIdUnitaDoc(), Constants.NM_AGENTE_SACER, + Constants.CREAZIONE_INDICE_AIP_UD_OS_20, CostantiDB.StatoConservazioneUnitaDoc.AIP_GENERATO.name(), + Constants.JOB_CREAZIONE_INDICE_AIP); + // end MEV #31162 + log.debug("Creazione Indice AIP - Operazione di inserimento completata con successo"); } @@ -737,6 +760,13 @@ public void gestisciIndiceAipV2Os(long idUnitaDoc) AroIndiceAipUd aroIndice = lastVer.getAroIndiceAipUd(); aroIndice.setIdVerIndiceAipLast(new BigDecimal(lastVer.getIdVerIndiceAip())); unitaDoc.setTiStatoConservazione(CostantiDB.StatoConservazioneUnitaDoc.AIP_GENERATO.name()); + + // MEV #31162 + udEjb.insertLogStatoConservUd(unitaDoc.getIdUnitaDoc(), Constants.NM_AGENTE_SACER, + Constants.CREAZIONE_INDICE_AIP_UD_OS_20, CostantiDB.StatoConservazioneUnitaDoc.AIP_GENERATO.name(), + Constants.JOB_CREAZIONE_INDICE_AIP); + // end MEV #31162 + log.debug("Creazione Indice AIP v2.0 - Operazione di inserimento completata con successo"); } // end EVO#20972 diff --git a/sacer-ejb/src/main/java/it/eng/parer/job/indiceAip/elenchi/ElaborazioneElencoIndiceAip.java b/sacer-ejb/src/main/java/it/eng/parer/job/indiceAip/elenchi/ElaborazioneElencoIndiceAip.java index 3f438a86..f0769e43 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/job/indiceAip/elenchi/ElaborazioneElencoIndiceAip.java +++ b/sacer-ejb/src/main/java/it/eng/parer/job/indiceAip/elenchi/ElaborazioneElencoIndiceAip.java @@ -64,6 +64,7 @@ import it.eng.parer.entity.ElvElencoVer; import it.eng.parer.entity.ElvElencoVersDaElab; import it.eng.parer.entity.ElvFileElencoVer; +import it.eng.parer.entity.IamUser; import it.eng.parer.entity.LogJob; import it.eng.parer.entity.OrgAmbiente; import it.eng.parer.entity.OrgEnte; @@ -78,6 +79,7 @@ import it.eng.parer.viewEntity.ElvVChkSoloUdAnnul; import it.eng.parer.viewEntity.ElvVLisaipudUrndacalcByele; import it.eng.parer.web.ejb.ElenchiVersamentoEjb; +import it.eng.parer.web.ejb.UnitaDocumentarieEjb; import it.eng.parer.web.helper.ConfigurationHelper; import it.eng.parer.web.util.Constants; import it.eng.parer.ws.dto.CSChiave; @@ -113,6 +115,10 @@ public class ElaborazioneElencoIndiceAip { private ConfigurationHelper configurationHelper; @EJB private UniformResourceNameUtilHelper urnHelper; + // MEV #31162 + @EJB + private UnitaDocumentarieEjb udEjb; + // end MEV #31162 @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) public void creaElencoIndiciAIP(long idElencoVers, long idLogJob) @@ -364,7 +370,8 @@ private String marshallElenco(ElencoIndiciAIP elencoIndiciAIP) throws MarshalExc // @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void setCompletato(ElvElencoVer elenco, List statiUdDocDaCompletare) { + public void setCompletato(ElvElencoVer elenco, List statiUdDocDaCompletare, long idUtente, + String modalitaLog) { ElvElencoVersDaElab elencoDaElab = elencoHelper.retrieveElencoInQueue(elenco); elenco.setTiStatoElenco(ElencoEnums.ElencoStatusEnum.COMPLETATO.name()); // Elimino l'elenco da elaborare @@ -384,6 +391,12 @@ public void setCompletato(ElvElencoVer elenco, List statiUdDocDaCompleta elencoHelper.lockUnitaDoc(ud); if (ud.getTiStatoConservazione().equals(CostantiDB.StatoConservazioneUnitaDoc.AIP_GENERATO.name())) { ud.setTiStatoConservazione(CostantiDB.StatoConservazioneUnitaDoc.AIP_FIRMATO.name()); + // MEV #31162 + IamUser utente = ciaHelper.findById(IamUser.class, idUtente); + udEjb.insertLogStatoConservUd(ud.getIdUnitaDoc(), utente.getNmUserid(), + Constants.MARCA_ELENCO_INDICE_AIP_UD, CostantiDB.StatoConservazioneUnitaDoc.AIP_FIRMATO.name(), + modalitaLog); + // end MEV #31162 } } } diff --git a/sacer-ejb/src/main/java/it/eng/parer/job/validazioneFascicoli/ejb/ValidazioneFascicoliEjb.java b/sacer-ejb/src/main/java/it/eng/parer/job/validazioneFascicoli/ejb/ValidazioneFascicoliEjb.java index f44bae53..b3bcdb2f 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/job/validazioneFascicoli/ejb/ValidazioneFascicoliEjb.java +++ b/sacer-ejb/src/main/java/it/eng/parer/job/validazioneFascicoli/ejb/ValidazioneFascicoliEjb.java @@ -82,6 +82,7 @@ import it.eng.parer.job.validazioneFascicoli.helper.ValidazioneFascicoliHelper; import it.eng.parer.util.helper.UniformResourceNameUtilHelper; import it.eng.parer.viewEntity.FasVLisUdByFasc; +import it.eng.parer.web.ejb.UnitaDocumentarieEjb; import it.eng.parer.web.helper.ConfigurationHelper; import it.eng.parer.web.helper.UserHelper; import it.eng.parer.web.util.Constants; @@ -136,6 +137,10 @@ public class ValidazioneFascicoliEjb { private UniformResourceNameUtilHelper urnHelper; @EJB private RecuperoZipGen zipGen; + // MEV #31162 + @EJB + private UnitaDocumentarieEjb udEjb; + // end MEV #31162 // public void validazioneFascicoli() throws ParerInternalError, ParerUserError, IOException, NoSuchAlgorithmException, @@ -370,7 +375,7 @@ private void annullaFascicoloPerUdAnnullata(long idStrutCorrente, long idFascico avEjb.controlloItemValidazioneFascicoli(rich, idUserIam); // Evasione richiesta - avEjb.evasioneRichiestaAnnullamento(rich); + avEjb.evasioneRichiestaAnnullamento(rich, idUserIam); } } @@ -399,8 +404,21 @@ private void validaFascicolo(long idUserIam, long idFascicolo, long idElencoVers CostantiDB.StatoConservazioneUnitaDoc.AIP_FIRMATO.name(), CostantiDB.StatoConservazioneUnitaDoc.IN_ARCHIVIO.name())); String statoUdNuovo = CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name(); + + // MEV #31162 + List idUnitaDocDaFascicoloList = vfHelper.getIdUnitaDocDaFascicolo(idFascicolo, statiUdDocDaCambiare); + // end MEV #31162 + vfHelper.updateStatoConservazioneUdFascicolo(idFascicolo, statiUdDocDaCambiare, statoUdNuovo); + // MEV #31162 + for (Long idUnitaDocDaFascicolo : idUnitaDocDaFascicoloList) { + udEjb.insertLogStatoConservUd(idUnitaDocDaFascicolo, Constants.NM_AGENTE_SACER, + Constants.VALIDA_FASCICOLO, CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name(), + Constants.JOB_VALIDAZIONE_FASCICOLO); + } + // end MEV #31162 + /* * Aggiorna le unità doc appartenenti al fascicolo con stato di conservazione = IN_VOLUME_DI_CONSERVAZIONE, * assegnando stato di conservazione = AIP_DA_GENERARE @@ -408,8 +426,21 @@ private void validaFascicolo(long idUserIam, long idFascicolo, long idElencoVers statiUdDocDaCambiare = new ArrayList<>( Arrays.asList(CostantiDB.StatoConservazioneUnitaDoc.IN_VOLUME_DI_CONSERVAZIONE.name())); statoUdNuovo = CostantiDB.StatoConservazioneUnitaDoc.AIP_DA_GENERARE.name(); + + // MEV #31162 + idUnitaDocDaFascicoloList = vfHelper.getIdUnitaDocDaFascicolo(idFascicolo, statiUdDocDaCambiare); + // end MEV #31162 + vfHelper.updateStatoConservazioneUdFascicolo(idFascicolo, statiUdDocDaCambiare, statoUdNuovo); + // MEV #31162 + for (Long idUnitaDocDaFascicolo : idUnitaDocDaFascicoloList) { + udEjb.insertLogStatoConservUd(idUnitaDocDaFascicolo, Constants.NM_AGENTE_SACER, + Constants.VALIDA_FASCICOLO, CostantiDB.StatoConservazioneUnitaDoc.AIP_DA_GENERARE.name(), + Constants.VALIDA_FASCICOLO_VDC); + } + // end MEV #31162 + // Determina le unità doc del fascicolo con stato di conservazione = AIP_DA_GENERARE List udAipDaGenerareList = vfHelper.getUdFascicoloByStatoCons(idFascicolo, CostantiDB.StatoConservazioneUnitaDoc.AIP_DA_GENERARE.name()); @@ -509,6 +540,10 @@ private void generaIndiceAipUdVolume(long idUnitaDoc) creaPrimoIndiceAipUniSincro(unitaDoc.getIdUnitaDoc(), causale); // Aggiorno lo stato dell'ud unitaDoc.setTiStatoConservazione(CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name()); + // MEV #31162 + udEjb.insertLogStatoConservUd(idUnitaDoc, Constants.NM_AGENTE_SACER, Constants.VALIDA_FASCICOLO, + CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name(), Constants.VALIDA_FASCICOLO); + // end MEV #31162 } public void creaPrimoIndiceAipUniSincro(Long idUnitaDoc, String causale) diff --git a/sacer-ejb/src/main/java/it/eng/parer/job/validazioneFascicoli/helper/ValidazioneFascicoliHelper.java b/sacer-ejb/src/main/java/it/eng/parer/job/validazioneFascicoli/helper/ValidazioneFascicoliHelper.java index 3b3ad96c..02df02ae 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/job/validazioneFascicoli/helper/ValidazioneFascicoliHelper.java +++ b/sacer-ejb/src/main/java/it/eng/parer/job/validazioneFascicoli/helper/ValidazioneFascicoliHelper.java @@ -151,6 +151,20 @@ public void updateStatoConservazioneUdFascicolo(long idFascicolo, List s getEntityManager().flush(); } + // MEV #31162 + public List getIdUnitaDocDaFascicolo(long idFascicolo, List statiOld) { + Query q = getEntityManager().createQuery( + "SELECT unitaDoc.idUnitaDoc FROM AroUnitaDoc unitaDoc WHERE unitaDoc.tiStatoConservazione IN (:statiOld) " + + "AND unitaDoc.idUnitaDoc IN (SELECT unitaDoc1.idUnitaDoc FROM FasUnitaDocFascicolo unitaDocFascicolo " + + "JOIN unitaDocFascicolo.aroUnitaDoc unitaDoc1 " + + "JOIN unitaDocFascicolo.fasFascicolo fascicolo " + + "WHERE fascicolo.idFascicolo = :idFascicolo)"); + q.setParameter("idFascicolo", idFascicolo); + q.setParameter("statiOld", statiOld); + return q.getResultList(); + } + // end MEV #31162 + /** * Ricavo il progressivo più alto della versione indice AIP * diff --git a/sacer-ejb/src/main/java/it/eng/parer/objectstorage/dto/RecuperoDocBean.java b/sacer-ejb/src/main/java/it/eng/parer/objectstorage/dto/RecuperoDocBean.java index f94b631d..5f54c485 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/objectstorage/dto/RecuperoDocBean.java +++ b/sacer-ejb/src/main/java/it/eng/parer/objectstorage/dto/RecuperoDocBean.java @@ -49,6 +49,7 @@ public class RecuperoDocBean implements java.io.Serializable { // MEV#30400 private String tiFile; // per distinguere i diversi tipi di file per una stessa versione // end MEV#30400 + private boolean fileDaSbustare; public RecuperoDocBean(TiEntitaSacerObjectStorage tipo, long id, OutputStream os, TabellaBlob tabellaBlobDaLeggere) { @@ -153,6 +154,14 @@ public void setTabellaClobDaLeggere(TabellaClob tabellaClobDaLeggere) { this.tabellaClobDaLeggere = tabellaClobDaLeggere; } + public boolean isFileDaSbustare() { + return fileDaSbustare; + } + + public void setFileDaSbustare(boolean fileDaSbustare) { + this.fileDaSbustare = fileDaSbustare; + } + /* * (non-Javadoc) * diff --git a/sacer-ejb/src/main/java/it/eng/parer/objectstorage/ejb/ObjectStorageService.java b/sacer-ejb/src/main/java/it/eng/parer/objectstorage/ejb/ObjectStorageService.java index b8af3aba..24e14ed6 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/objectstorage/ejb/ObjectStorageService.java +++ b/sacer-ejb/src/main/java/it/eng/parer/objectstorage/ejb/ObjectStorageService.java @@ -14,16 +14,11 @@ * You should have received a copy of the GNU Affero General Public License along with this program. * If not, see . */ - package it.eng.parer.objectstorage.ejb; +import it.eng.parer.crypto.model.CryptoSignedP7mUri; import java.io.*; -import java.math.BigInteger; import java.nio.charset.StandardCharsets; -import java.time.Instant; -import java.time.ZoneId; -import java.time.format.DateTimeFormatter; -import java.util.*; import java.util.Collections; import java.util.HashMap; import java.util.Map; @@ -39,7 +34,6 @@ import it.eng.parer.entity.*; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -79,6 +73,9 @@ import software.amazon.awssdk.utils.Md5Utils; import it.eng.spagoCore.util.UUIDMdcLogUtil; import java.io.ByteArrayInputStream; +import java.net.URL; +import it.eng.parer.firma.crypto.verifica.CryptoInvoker; +import java.net.URISyntaxException; @Stateless(mappedName = "ObjectStorageService") @LocalBean @@ -125,6 +122,10 @@ public class ObjectStorageService { @EJB private SalvataggioBackendHelper salvataggioBackendHelper; + @EJB + protected CryptoInvoker cryptoInvoker; + @EJB + protected AwsPresigner awsPresigner; /** * Effettua il lookup per stabilire come sia configurato il backend @@ -592,16 +593,44 @@ public Map getObjectSipFascErrato(long idSesFascicoloErr) { * */ public void getObjectComponente(long idCompDoc, OutputStream outputStream) { + getObjectComponente(idCompDoc, outputStream, false); + } + + /** + * Ottieni lo stream del componente contenuto nell'object storage + * + * @param idCompDoc + * id del componente + * @param fileDaSbustare + * indica se sbustare il file o no + * @param outputStream + * Stream su cui scrivere l'oggetto + * + */ + public void getObjectComponente(long idCompDoc, OutputStream outputStream, boolean fileDaSbustare) { + // File fileP7m = null; + File fileP7m = null; try { AroCompObjectStorage link = salvataggioBackendHelper.getLinkCompDocOs(idCompDoc); ObjectStorageBackend config = salvataggioBackendHelper .getObjectStorageConfiguration(link.getDecBackend().getNmBackend(), COMPONENTI_R); ResponseInputStream object = salvataggioBackendHelper.getObject(config, link.getNmBucket(), link.getCdKeyFile()); - IOUtils.copyLarge(object, outputStream); - } catch (IOException | ObjectStorageException e) { + // MEV#34239 - Estensione servizio per recupero file sbustati + if (fileDaSbustare) { + URL url = awsPresigner.getPresignedUrl(config, link.getCdKeyFile()); + CryptoSignedP7mUri dto = new CryptoSignedP7mUri(url.toURI()); + cryptoInvoker.sbustaDaOsEStrimmaOutput(dto, outputStream); + } else { + IOUtils.copyLarge(object, outputStream); + } + } catch (IOException | ObjectStorageException | URISyntaxException e) { // EJB spec (14.2.2 in the EJB 3) throw new EJBException(e); + } finally { + if (fileP7m != null) { + fileP7m.delete(); + } } } @@ -1333,7 +1362,6 @@ private Map unzipAipFascicolo(ResponseInputStream idUnitaDocList = helper.getStatoConservazioneAroUnitaDocInContenuto( + idContenutoVerSerie.longValue(), + CostantiDB.StatoConservazioneUnitaDoc.IN_VOLUME_DI_CONSERVAZIONE.name()); + // end MEV #31162 + helper.updateStatoConservazioneAroUnitaDocInContenuto(idContenutoVerSerie.longValue(), CostantiDB.StatoConservazioneUnitaDoc.IN_VOLUME_DI_CONSERVAZIONE.name(), CostantiDB.StatoConservazioneUnitaDoc.AIP_DA_GENERARE.name()); + + // MEV #31162 + IamUser utente = helper.findById(IamUser.class, idUser); + for (Long idUnitaDoc : idUnitaDocList) { + udEjb.insertLogStatoConservUd(idUnitaDoc, utente.getNmUserid(), + Constants.CAMBIA_STATO_SERIE_VDC, + CostantiDB.StatoConservazioneUnitaDoc.AIP_DA_GENERARE.name(), + Constants.FUNZIONALITA_ONLINE); + } + // end MEV #31162 + // AGGIORNAMENTO ANALISI STATO INCONSISTENTE // helper.updateStatoConservazioneAroUnitaDocInContenuto(idContenutoVerSerie.longValue(), // CostantiDB.StatoConservazioneUnitaDoc.AIP_GENERATO.name(), @@ -4267,10 +4290,29 @@ public void cambiaStatoSerie(long idUser, BigDecimal idSerie, BigDecimal idVerSe CostantiDB.TipoFileVerSerie.IX_AIP_UNISINCRO.name()); helper.deleteSerVolVerSerie(idVerSerie); helper.deleteSerVerSerieDaElab(idVerSerie); + + // MEV #31162 + List statiConservOld = new ArrayList<>(); + statiConservOld.add(CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name()); + List idUnitaDocList = helper.getStatoConservazioneAroUnitaDocWithoutOtherSeries( + idSerie, verSerie.getIdVerSerie(), statiConservOld); + // end MEV #31162 + helper.updateStatoConservazioneAroUnitaDocWithoutOtherSeries(idSerie, verSerie.getIdVerSerie(), CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name(), CostantiDB.StatoConservazioneUnitaDoc.AIP_GENERATO.name()); + + // MEV #31162 + IamUser utente = helper.findById(IamUser.class, idUser); + for (Long idUnitaDoc : idUnitaDocList) { + udEjb.insertLogStatoConservUd(idUnitaDoc, utente.getNmUserid(), + Constants.CAMBIA_STATO_SERIE_GEN_AIP, + CostantiDB.StatoConservazioneUnitaDoc.AIP_GENERATO.name(), + Constants.FUNZIONALITA_ONLINE); + } + // end MEV #31162 + } if (stato.equals(CostantiDB.StatoVersioneSerie.DA_VALIDARE.name())) { SerVerSerieDaElab serVerSerieDaElab = helper @@ -4477,12 +4519,33 @@ public void cambiaStatoSerie(long idUser, BigDecimal idSerie, BigDecimal idVerSe } logger.debug(SerieEjb.class.getSimpleName() + " --- Aggiorna le unit\u00E0 doc appartenenti al contenuto di tipo EFFETTIVO della nuova versione, assegnando stato = AIP_GENERATO, purch\u00E8 tali unit\u00E0 doc non appartengano al contenuto di tipo EFFETTIVO di altra serie con stato = VERSAMENTO_IN_ARCHIVIO o IN_ARCHIVIO o IN_CUSTODIA"); + + // MEV #31162 + List statiConservOld = new ArrayList<>(); + statiConservOld.add(CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name()); + statiConservOld.add(CostantiDB.StatoConservazioneUnitaDoc.IN_ARCHIVIO.name()); + statiConservOld.add(CostantiDB.StatoConservazioneUnitaDoc.IN_CUSTODIA.name()); + List idUnitaDocList = helper.getStatoConservazioneAroUnitaDocWithoutOtherSeries( + idSerie, verSerieToUpdate.getIdVerSerie(), statiConservOld); + // end MEV #31162 + helper.updateStatoConservazioneAroUnitaDocWithoutOtherSeries(idSerie, verSerieToUpdate.getIdVerSerie(), CostantiDB.StatoConservazioneUnitaDoc.AIP_GENERATO.name(), Arrays.asList(CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name(), CostantiDB.StatoConservazioneUnitaDoc.IN_ARCHIVIO.name(), CostantiDB.StatoConservazioneUnitaDoc.IN_CUSTODIA.name())); + + // MEV #31162 + IamUser utente = helper.findById(IamUser.class, idUser); + for (Long idUnitaDoc : idUnitaDocList) { + udEjb.insertLogStatoConservUd(idUnitaDoc, utente.getNmUserid(), + Constants.CAMBIA_STATO_SERIE_ANNUL, + CostantiDB.StatoConservazioneUnitaDoc.AIP_GENERATO.name(), + Constants.FUNZIONALITA_ONLINE); + } + // end MEV #31162 + } } else { throw new IllegalArgumentException("Impossibile caricare il contenuto di tipo EFFETTIVO"); @@ -5245,9 +5308,21 @@ public void updateSerieValidata(SerVerSerie verSerie) { List statiConservazioneDaCambiare = new ArrayList<>( Arrays.asList(CostantiDB.StatoConservazioneUnitaDoc.AIP_GENERATO.name(), CostantiDB.StatoConservazioneUnitaDoc.AIP_FIRMATO.name())); + // MEV #31162 + List idUnitaDocList = helper.getStatoConservazioneAroUnitaDocInContenuto( + contenEff.getIdContenutoVerSerie(), statiConservazioneDaCambiare); + // end MEV #31162 + helper.updateStatoConservazioneAroUnitaDocInContenuto(contenEff.getIdContenutoVerSerie(), statiConservazioneDaCambiare, CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name()); + // MEV #31162 + for (Long idUnitaDoc : idUnitaDocList) { + udEjb.insertLogStatoConservUd(idUnitaDoc, Constants.NM_AGENTE_SACER, Constants.VALIDA_SERIE, + CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name(), Constants.JOB_VALIDA_SERIE); + } + // end MEV #31162 + Date now = Calendar.getInstance().getTime(); SerStatoVerSerie statoCorrente = helper.findById(SerStatoVerSerie.class, verSerie.getIdStatoVerSerieCor()); SerStatoVerSerie statoValidazioneInCorso = statoCorrente; @@ -5552,9 +5627,24 @@ private void storeFirmaNoTransaction(Long idVerSerie, byte[] fileFirmato, long i */ SerContenutoVerSerie contenutoVerSerie = helper.getSerContenutoVerSerie(idVerSerie, CostantiDB.TipoContenutoVerSerie.EFFETTIVO.name()); + + // MEV #31162 + List idUnitaDocList = helper.getStatoConservazioneAroUnitaDocInContenuto( + contenutoVerSerie.getIdContenutoVerSerie(), + CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name()); + // end MEV #31162 + helper.updateStatoConservazioneAroUnitaDocInContenuto(contenutoVerSerie.getIdContenutoVerSerie(), CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name(), CostantiDB.StatoConservazioneUnitaDoc.IN_ARCHIVIO.name()); + + // MEV #31162 + IamUser utente = helper.findById(IamUser.class, idUtente); + for (Long idUnitaDoc : idUnitaDocList) { + udEjb.insertLogStatoConservUd(idUnitaDoc, utente.getNmUserid(), Constants.FIRMA_SERIE, + CostantiDB.StatoConservazioneUnitaDoc.IN_ARCHIVIO.name(), Constants.FUNZIONALITA_ONLINE); + } + // end MEV #31162 } /* @@ -5722,9 +5812,25 @@ public byte[] marcaFirma(long idVerSerie, byte[] fileVerSerie, int serieSize, lo */ SerContenutoVerSerie contenutoVerSerie = helper.getSerContenutoVerSerie(idVerSerie, CostantiDB.TipoContenutoVerSerie.EFFETTIVO.name()); + + // MEV #31162 + List idUnitaDocList = helper.getStatoConservazioneAroUnitaDocInContenuto( + contenutoVerSerie.getIdContenutoVerSerie(), + CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name()); + // end MEV #31162 + helper.updateStatoConservazioneAroUnitaDocInContenuto(contenutoVerSerie.getIdContenutoVerSerie(), CostantiDB.StatoConservazioneUnitaDoc.VERSAMENTO_IN_ARCHIVIO.name(), CostantiDB.StatoConservazioneUnitaDoc.IN_ARCHIVIO.name()); + + // MEV #31162 + IamUser utente = helper.findById(IamUser.class, idUtente); + for (Long idUnitaDoc : idUnitaDocList) { + udEjb.insertLogStatoConservUd(idUnitaDoc, utente.getNmUserid(), Constants.MARCA_FIRMA_SERIE, + CostantiDB.StatoConservazioneUnitaDoc.IN_ARCHIVIO.name(), Constants.FUNZIONALITA_ONLINE); + } + // end MEV #31162 + } return marcaTemporale; } diff --git a/sacer-ejb/src/main/java/it/eng/parer/serie/helper/SerieHelper.java b/sacer-ejb/src/main/java/it/eng/parer/serie/helper/SerieHelper.java index 4fbcc30f..6304e29c 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/serie/helper/SerieHelper.java +++ b/sacer-ejb/src/main/java/it/eng/parer/serie/helper/SerieHelper.java @@ -1355,6 +1355,17 @@ public int updateStatoConservazioneAroUnitaDocInContenuto(Long idContenutoVerSer return query.executeUpdate(); } + // MEV #31162 + public List getStatoConservazioneAroUnitaDocInContenuto(Long idContenutoVerSerie, + String tiStatoConservazioneOld) { + Query query = getEntityManager().createQuery( + "SELECT ud.idUnitaDoc FROM AroUnitaDoc ud WHERE ud.tiStatoConservazione = :tiStatoConservazioneOld AND EXISTS (SELECT udVerSerie FROM AroUdAppartVerSerie udVerSerie WHERE udVerSerie.serContenutoVerSerie.idContenutoVerSerie = :idContenutoVerSerie AND udVerSerie.aroUnitaDoc.idUnitaDoc = ud.idUnitaDoc)"); + query.setParameter("idContenutoVerSerie", idContenutoVerSerie); + query.setParameter("tiStatoConservazioneOld", tiStatoConservazioneOld); + return query.getResultList(); + } + // end MEV #31162 + public int updateStatoConservazioneAroUnitaDocInContenuto(Long idContenutoVerSerie, List tiStatoConservazioneOld, String tiStatoConservazioneNew) { Query query = getEntityManager().createQuery( @@ -1365,6 +1376,17 @@ public int updateStatoConservazioneAroUnitaDocInContenuto(Long idContenutoVerSer return query.executeUpdate(); } + // MEV #31162 + public List getStatoConservazioneAroUnitaDocInContenuto(Long idContenutoVerSerie, + List tiStatoConservazioneOld) { + Query query = getEntityManager().createQuery( + "SELECT ud.idUnitaDoc FROM AroUnitaDoc ud WHERE ud.tiStatoConservazione IN (:tiStatoConservazioneOld) AND EXISTS (SELECT udVerSerie FROM AroUdAppartVerSerie udVerSerie WHERE udVerSerie.serContenutoVerSerie.idContenutoVerSerie = :idContenutoVerSerie AND udVerSerie.aroUnitaDoc.idUnitaDoc = ud.idUnitaDoc)"); + query.setParameter("idContenutoVerSerie", idContenutoVerSerie); + query.setParameter("tiStatoConservazioneOld", tiStatoConservazioneOld); + return query.getResultList(); + } + // end MEV #31162 + public int updateStatoConservazioneAroUnitaDocWithoutOtherSeries(BigDecimal idSerie, Long idVerSerie, String tiStatoConservazioneOld, String tiStatoConservazioneNew) { Query query = getEntityManager() @@ -1437,6 +1459,38 @@ public int updateStatoConservazioneAroUnitaDocWithoutOtherSeries(BigDecimal idSe return query.executeUpdate(); } + public List getStatoConservazioneAroUnitaDocWithoutOtherSeries(BigDecimal idSerie, Long idVerSerie, + List tiStatoConservazioneOld) { + Query query = getEntityManager().createQuery("SELECT ud.idUnitaDoc FROM AroUnitaDoc ud " + + "WHERE ud.tiStatoConservazione IN (:tiStatoConservazioneOld) AND " + + "EXISTS (SELECT udVerSerie_1 FROM AroUdAppartVerSerie udVerSerie_1 " + + "JOIN udVerSerie_1.serContenutoVerSerie contenuto_1 " + "JOIN contenuto_1.serVerSerie verSerie_1 " + + "JOIN verSerie_1.serSerie serie_1 WHERE serie_1.idSerie = :idSerie " + + "AND verSerie_1.idVerSerie = :idVerSerie " + + "AND udVerSerie_1.serContenutoVerSerie.tiContenutoVerSerie = 'EFFETTIVO' AND udVerSerie_1.aroUnitaDoc.idUnitaDoc = ud.idUnitaDoc )" + + "AND NOT EXISTS (SELECT udVerSerie_2 FROM AroUdAppartVerSerie udVerSerie_2 " + + "JOIN udVerSerie_2.serContenutoVerSerie contenuto_2 " + "JOIN contenuto_2.serVerSerie verSerie_2 " + + "JOIN verSerie_2.serSerie serie_2 WHERE serie_2.idSerie != :idSerie " + + "AND udVerSerie_2.serContenutoVerSerie.tiContenutoVerSerie = 'EFFETTIVO' AND udVerSerie_2.aroUnitaDoc.idUnitaDoc = ud.idUnitaDoc " + + "AND serie_2.dtAnnul = :defaultAnnul )"); + query.setParameter("idSerie", longFromBigDecimal(idSerie)); + query.setParameter("idVerSerie", idVerSerie); + query.setParameter("tiStatoConservazioneOld", tiStatoConservazioneOld); + + Calendar c = Calendar.getInstance(); + c.set(Calendar.HOUR_OF_DAY, 0); + c.set(Calendar.MINUTE, 0); + c.set(Calendar.SECOND, 0); + c.set(Calendar.MILLISECOND, 0); + c.set(Calendar.YEAR, 2444); + c.set(Calendar.MONTH, Calendar.DECEMBER); + c.set(Calendar.DATE, 31); + + query.setParameter("defaultAnnul", c.getTime()); + + return query.getResultList(); + } + public List getAroUdAppartVerSerieInContenEff(Long idVerSerie, String tiStatoConservazioneUd) { Query query = getEntityManager().createQuery( "SELECT udVerSerie FROM AroUdAppartVerSerie udVerSerie JOIN udVerSerie.aroUnitaDoc ud WHERE udVerSerie.serContenutoVerSerie.serVerSerie.idVerSerie = :idVerSerie AND udVerSerie.serContenutoVerSerie.tiContenutoVerSerie = 'EFFETTIVO' AND ud.tiStatoConservazione = :tiStatoConservazioneUd"); diff --git a/sacer-ejb/src/main/java/it/eng/parer/web/ejb/ElenchiVersamentoEjb.java b/sacer-ejb/src/main/java/it/eng/parer/web/ejb/ElenchiVersamentoEjb.java index 1cebac62..9908ac7a 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/web/ejb/ElenchiVersamentoEjb.java +++ b/sacer-ejb/src/main/java/it/eng/parer/web/ejb/ElenchiVersamentoEjb.java @@ -1533,7 +1533,7 @@ public void gestioneMarcaturaElenchiIndiciAip(long idElencoVers, String tiGestEl if (elenco.getTiStatoElenco().equals(ElencoEnums.ElencoStatusEnum.ELENCO_INDICI_AIP_FIRMATO.name())) { List statiUdDocDaCompletare = new ArrayList<>( Arrays.asList(ElencoEnums.UdDocStatusEnum.IN_ELENCO_CON_ELENCO_INDICI_AIP_FIRMATO.name())); - elabElencoIndiceAipEjb.setCompletato(elenco, statiUdDocDaCompletare); + elabElencoIndiceAipEjb.setCompletato(elenco, statiUdDocDaCompletare, idUtente, Constants.JOB_SIGILLO); // EVO 19304 evWebEjb.registraStatoElencoVersamento(BigDecimal.valueOf(elenco.getIdElencoVers()), "MARCA_ELENCO_INDICI_AIP", "Gestione elenco = " + tiGestioneEnum.name(), @@ -1575,7 +1575,7 @@ public void gestioneMarcaturaElenchiIndiciAip(long idElencoVers, String tiGestEl .equals(it.eng.parer.elencoVersamento.utils.ElencoEnums.TipoFirma.XADES)) { log.debug("Marca non necessaria per Xades"); // MEV#15967 - Attivazione della firma Xades e XadesT - impostaStatoCompletatoElencoIndiceAip(elenco, idUtente); + impostaStatoCompletatoElencoIndiceAip(elenco, idUtente, Constants.FUNZIONALITA_ONLINE); // } else { @@ -1587,7 +1587,7 @@ public void gestioneMarcaturaElenchiIndiciAip(long idElencoVers, String tiGestEl if (marcaTemporale != null) { log.info("Marca temporale valida"); ElvFileElencoVer marcaElencoIxAip = saveMarcaElencoIndiceAip(elenco, marcaTemporale, - idUtente, backendIndiciAip); + idUtente, backendIndiciAip, Constants.JOB_SIGILLO); // MEV#30397 /* * Se backendMetadata di tipo O.S. si effettua il salvataggio (con link su apposita entity) @@ -1665,7 +1665,7 @@ private boolean isElencoFirmato(ElvElencoVer elenco, DecCriterioRaggr criterio) } private ElvFileElencoVer saveMarcaElencoIndiceAip(ElvElencoVer elenco, byte[] marcaTemporale, long idUtente, - BackendStorage backendMetadata) { + BackendStorage backendMetadata, String modalitaLog) { final OrgStrut orgStrut = elenco.getOrgStrut(); final OrgEnte orgEnte = orgStrut.getOrgEnte(); final String nmStrut = orgStrut.getNmStrut(); @@ -1719,17 +1719,17 @@ private ElvFileElencoVer saveMarcaElencoIndiceAip(ElvElencoVer elenco, byte[] ma elenco.setDtMarcaElencoIxAip(fileElencoVers.getDtCreazioneFile()); // MEV#15967 - Attivazione della firma Xades e XadesT - impostaStatoCompletatoElencoIndiceAip(elenco, idUtente); + impostaStatoCompletatoElencoIndiceAip(elenco, idUtente, modalitaLog); return fileElencoVers; } // MEV#15967 - Attivazione della firma Xades e XadesT - private void impostaStatoCompletatoElencoIndiceAip(ElvElencoVer elenco, long idUtente) { + private void impostaStatoCompletatoElencoIndiceAip(ElvElencoVer elenco, long idUtente, String modalitaLog) { final OrgStrut orgStrut = elenco.getOrgStrut(); List statiUdDocDaCompletare = new ArrayList<>( Arrays.asList(ElencoEnums.UdDocStatusEnum.IN_ELENCO_CON_ELENCO_INDICI_AIP_FIRMATO.name(), ElencoEnums.UdDocStatusEnum.IN_ELENCO_CON_ELENCO_INDICI_AIP_ERR_MARCA.name())); - elabElencoIndiceAipEjb.setCompletato(elenco, statiUdDocDaCompletare); + elabElencoIndiceAipEjb.setCompletato(elenco, statiUdDocDaCompletare, idUtente, modalitaLog); /* Registro sul log delle operazioni */ evHelper.writeLogElencoVers(elenco, orgStrut, idUtente, ElencoEnums.OpTypeEnum.MARCA_ELENCO_INDICI_AIP.name()); IamUser user = genericHelper.findById(IamUser.class, idUtente); diff --git a/sacer-ejb/src/main/java/it/eng/parer/web/ejb/UnitaDocumentarieEjb.java b/sacer-ejb/src/main/java/it/eng/parer/web/ejb/UnitaDocumentarieEjb.java new file mode 100644 index 00000000..2d458ad7 --- /dev/null +++ b/sacer-ejb/src/main/java/it/eng/parer/web/ejb/UnitaDocumentarieEjb.java @@ -0,0 +1,93 @@ +package it.eng.parer.web.ejb; + +import it.eng.parer.entity.AroLogStatoConservUd; +import it.eng.parer.entity.AroUnitaDoc; +import it.eng.parer.web.helper.ConfigurationHelper; +import java.math.BigDecimal; + +import javax.annotation.Resource; +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.SessionContext; +import javax.ejb.Stateless; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import it.eng.parer.web.helper.UnitaDocumentarieHelper; +import java.util.ArrayList; +import java.util.Date; +import javax.ejb.TransactionAttribute; +import javax.ejb.TransactionAttributeType; + +/** + * + * @author Gilioli_P + */ +@SuppressWarnings("unchecked") +@Stateless(mappedName = "UnitaDocumentarieEjb") +@LocalBean +public class UnitaDocumentarieEjb { + + @Resource + SessionContext ctx; + + @EJB(mappedName = "java:app/Parer-ejb/UnitaDocumentarieHelper") + private UnitaDocumentarieHelper unitaDocumentarieHelper; + + @EJB(mappedName = "java:app/Parer-ejb/ConfigurationHelper") + private ConfigurationHelper configurationHelper; + + public UnitaDocumentarieEjb() { + // + } + + private static final Logger log = LoggerFactory.getLogger(UnitaDocumentarieEjb.class); + + // MEV #31162 + /** + * + * @param idUnitaDoc + * id unità documentaria di cui registrare lo stato di conservazione ud + * @param nmAgente + * nome dell'automatismo o dell'utente che ha portato allo stato di conservazione ud da registrare + * @param tiEvento + * tipo di evento che ha portato allo stato di conservazione ud da registrare + * @param tiStatoConservazione + * stato di conservazione ud da registrare + * @param tiMod + * tipo modalità + */ + @TransactionAttribute(TransactionAttributeType.REQUIRED) + public void insertLogStatoConservUd(long idUnitaDoc, String nmAgente, String tiEvento, String tiStatoConservazione, + String tiMod) { + AroUnitaDoc unitaDoc = unitaDocumentarieHelper.findById(AroUnitaDoc.class, idUnitaDoc); + BigDecimal idAmbiente = BigDecimal + .valueOf(unitaDoc.getOrgStrut().getOrgEnte().getOrgAmbiente().getIdAmbiente()); + BigDecimal idStrut = BigDecimal.valueOf(unitaDoc.getOrgStrut().getIdStrut()); + BigDecimal idTipoUnitaDoc = BigDecimal.valueOf(unitaDoc.getDecTipoUnitaDoc().getIdTipoUnitaDoc()); + // Recupero il parametro per verificare se procedere o meno al log + boolean flAbilitaLogStatoConserv = Boolean.parseBoolean(configurationHelper + .getValoreParamApplicByTipoUd("FL_ABILITA_LOG_STATO_CONSERV", idAmbiente, idStrut, idTipoUnitaDoc)); + if (flAbilitaLogStatoConserv) { + AroLogStatoConservUd logStatoConservUd = new AroLogStatoConservUd(); + logStatoConservUd.setAroUnitaDoc(unitaDoc); + logStatoConservUd.setOrgSubStrut(unitaDoc.getOrgSubStrut()); + logStatoConservUd.setDtStato(new Date()); + logStatoConservUd.setAaKeyUnitaDoc(unitaDoc.getAaKeyUnitaDoc()); + logStatoConservUd.setNmAgente(nmAgente); + logStatoConservUd.setTiEvento(tiEvento); + logStatoConservUd.setTiMod(tiMod); + logStatoConservUd.setAaKeyUnitaDoc(unitaDoc.getAaKeyUnitaDoc()); + logStatoConservUd.setTiStatoConservazione(tiStatoConservazione); + if (unitaDoc.getAroLogStatoConservUds() == null) { + unitaDoc.setAroLogStatoConservUds(new ArrayList<>()); + } + unitaDoc.getAroLogStatoConservUds().add(logStatoConservUd); + unitaDocumentarieHelper.getEntityManager().persist(logStatoConservUd); + unitaDocumentarieHelper.getEntityManager().flush(); + } + } + // end MEV #31162 + +} diff --git a/sacer-ejb/src/main/java/it/eng/parer/web/helper/UnitaDocumentarieHelper.java b/sacer-ejb/src/main/java/it/eng/parer/web/helper/UnitaDocumentarieHelper.java index dd555c10..788b92b0 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/web/helper/UnitaDocumentarieHelper.java +++ b/sacer-ejb/src/main/java/it/eng/parer/web/helper/UnitaDocumentarieHelper.java @@ -59,6 +59,7 @@ import it.eng.parer.entity.AroCompUrnCalc; import it.eng.parer.entity.AroDoc; import it.eng.parer.entity.AroFileVerIndiceAipUd; +import it.eng.parer.entity.AroLogStatoConservUd; import it.eng.parer.entity.AroNotaUnitaDoc; import it.eng.parer.entity.AroRichAnnulVers; import it.eng.parer.entity.AroStrutDoc; @@ -89,6 +90,7 @@ import it.eng.parer.slite.gen.form.UnitaDocumentarieForm.FiltriUnitaDocumentarieAvanzata; import it.eng.parer.slite.gen.form.UnitaDocumentarieForm.FiltriUnitaDocumentarieSemplice; import it.eng.parer.slite.gen.tablebean.AroFileVerIndiceAipUdRowBean; +import it.eng.parer.slite.gen.tablebean.AroLogStatoConservUdTableBean; import it.eng.parer.slite.gen.tablebean.AroUnitaDocRowBean; import it.eng.parer.slite.gen.tablebean.AroUpdUnitaDocTableBean; import it.eng.parer.slite.gen.tablebean.AroVerIndiceAipUdRowBean; @@ -5485,4 +5487,23 @@ public List getDecVersioneWsList(String tiWs) { query.setParameter("tiWs", tiWs); return query.getResultList(); } + + // MEV #31162 + public AroLogStatoConservUdTableBean getAroLogStatoConservUdTableBean(BigDecimal idUnitaDoc) { + String queryStr = "SELECT u FROM AroLogStatoConservUd u WHERE u.aroUnitaDoc.idUnitaDoc = :idUnitaDoc ORDER BY u.dtStato"; + Query query = getEntityManager().createQuery(queryStr); + query.setParameter("idUnitaDoc", idUnitaDoc.longValue()); + List listaLog = query.getResultList(); + AroLogStatoConservUdTableBean logTableBean = new AroLogStatoConservUdTableBean(); + try { + if (listaLog != null && !listaLog.isEmpty()) { + logTableBean = (AroLogStatoConservUdTableBean) Transform.entities2TableBean(listaLog); + } + } catch (Exception e) { + log.error(e.getMessage(), e); + } + return logTableBean; + } + + // end MEV #31162 } diff --git a/sacer-ejb/src/main/java/it/eng/parer/web/util/Constants.java b/sacer-ejb/src/main/java/it/eng/parer/web/util/Constants.java index a19b3175..009f0bc0 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/web/util/Constants.java +++ b/sacer-ejb/src/main/java/it/eng/parer/web/util/Constants.java @@ -45,6 +45,35 @@ public class Constants { public static final String TI_USO_XSD_VERS = "VERS"; public static final String TI_USO_XSD_MIGR = "MIGRAZ"; + // Costanti per log stato conservazione unità documentaria + public static final String FIRMA_ELENCO_INDICE_AIP_UD = "FIRMA_ELENCO_INDICE_AIP_UD"; + public static final String FIRMA_ELENCO_INDICE_AIP_FASC = "Firma indice AIP fascicolo"; + public static final String CREAZIONE_INDICE_AIP_UD = "Creazione indice AIP"; + public static final String CREAZIONE_INDICE_AIP_UD_OS = "Creazione indice AIP"; + public static final String CREAZIONE_INDICE_AIP_UD_OS_20 = "Creazione indice AIP"; + public static final String MARCA_ELENCO_INDICE_AIP_UD = "Firma e apposizione marcatura indice AIP"; + public static final String VALIDA_FASCICOLO = "Validazione fascicolo"; + public static final String VALIDA_FASCICOLO_VDC = "Inserimento UD in VDC in un fascicolo"; + public static final String EVASIONE_RICHIESTA_ANNULLAMENTO_UD = "Annullamento unità documentaria"; + public static final String EVASIONE_RICHIESTA_ANNULLAMENTO_FASC = "Annullamento fascicolo"; + public static final String CAMBIA_STATO_SERIE_VDC = "Inserimento UD in VDC in una serie"; + public static final String CAMBIA_STATO_SERIE_GEN_AIP = "Generazione AIP di UD"; + public static final String CAMBIA_STATO_SERIE_ANNUL = "Annullamento serie"; + public static final String FIRMA_SERIE = "Firma indice AIP serie"; + public static final String MARCA_FIRMA_SERIE = "Firma e marcatura indice AIP serie"; + public static final String VALIDA_SERIE = "Validazione serie"; + + public static final String NM_AGENTE_SACER = "Sacer"; + + // Modalità + public static final String WS_ANNULLAMENTO = "WS Annullamento"; + public static final String ANNULLAMENTO_ONLINE = "Annullamento online"; + public static final String FUNZIONALITA_ONLINE = "Funzionalità online"; + public static final String JOB_CREAZIONE_INDICE_AIP = "JOB Creazione Indice AIP"; + public static final String JOB_VALIDAZIONE_FASCICOLO = "JOB Validazione fascicolo"; + public static final String JOB_SIGILLO = "JOB Sigillo"; + public static final String JOB_VALIDA_SERIE = "JOB Validazione serie"; + // Formato data/ora public static final String DATE_FORMAT_TIMESTAMP_TYPE = "dd/MM/yyyy HH:mm:ss"; public static final String DATE_FORMAT_DATE_TYPE = "dd/MM/yyyy"; diff --git a/sacer-ejb/src/main/java/it/eng/parer/ws/ejb/RecuperoDocumento.java b/sacer-ejb/src/main/java/it/eng/parer/ws/ejb/RecuperoDocumento.java index 3e8918ca..4ae56cb2 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/ws/ejb/RecuperoDocumento.java +++ b/sacer-ejb/src/main/java/it/eng/parer/ws/ejb/RecuperoDocumento.java @@ -25,8 +25,6 @@ import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; -import it.eng.spagoCore.util.JpaUtils; -import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -36,13 +34,6 @@ import it.eng.parer.ws.recupero.ejb.oracleBlb.RecBlbOracle; import it.eng.parer.ws.recupero.ejb.oracleClb.RecClbOracle; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.sql.Clob; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - /** * * @author Sinatti_S @@ -88,6 +79,9 @@ public boolean callRecuperoDocSuStream(RecuperoDocBean dto) { log.debug("RecuperoDocumento.callRecuperoDocSuStream : recupero from BlbOracle, doc = {}", dto); return recBlbOracle.recuperaBlobCompSuStream(dto.getId(), dto.getOs(), dto.getTabellaBlobDaLeggere(), dto); } else { + // MEV#34239 - Estensione servizio per recupero file sbustati + // In questo ramo per quanto riguarda lo sbustamento dei .p7m non ci parrerà mai + // perché sono dei binari, quindi BLOB log.debug("RecuperoDocumento.callRecuperoDocSuStream : recupero from ClbOracle, doc = {}", dto); return recClbOracle.recuperaClobDataSuStream(dto.getId(), dto.getOs(), dto.getTabellaClobDaLeggere()); } diff --git a/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/dto/RecuperoExt.java b/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/dto/RecuperoExt.java index 5a84ef44..7f208c44 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/dto/RecuperoExt.java +++ b/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/dto/RecuperoExt.java @@ -167,7 +167,11 @@ public RispostaControlli checkVersioneRequest(String versione) { versioneCalc = versione; modificatoriWS = EnumSet.noneOf(Costanti.ModificatoriWS.class); - if (versione.equals("1.2")) { + if (versione.equals("1.3")) { + this.versioneCalc = "1.3"; + this.modificatoriWS.add(ModificatoriWS.TAG_LOG_STATO_CONSERV_UD); + this.modificatoriWS.add(ModificatoriWS.TAG_REC_USR_DOC_COMP); + } else if (versione.equals("1.2")) { this.versioneCalc = "1.2"; this.modificatoriWS.add(ModificatoriWS.TAG_REC_USR_DOC_COMP); } else if (versione.equals("1.1")) { diff --git a/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/ejb/ControlliRecupero.java b/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/ejb/ControlliRecupero.java index 3b53a29a..6e095036 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/ejb/ControlliRecupero.java +++ b/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/ejb/ControlliRecupero.java @@ -58,6 +58,7 @@ import it.eng.parer.entity.AroCompUrnCalc; import it.eng.parer.entity.AroDoc; import it.eng.parer.entity.AroFileVerIndiceAipUd; +import it.eng.parer.entity.AroLogStatoConservUd; import it.eng.parer.entity.AroUdAppartVerSerie; import it.eng.parer.entity.AroUnitaDoc; import it.eng.parer.entity.AroUpdUnitaDoc; @@ -211,6 +212,8 @@ public RispostaControlli leggiVolumiUnitaDoc(long idUnitaDoc) { * * @param idUnitaDoc * id unita doc + * @param estraiFileIndiceAip + * se true considera solo i file dei componenti per i quali è stato calcolato l'indice AIP * * @return istanza di RispostaControlli con i campi valorizzati come segue: se va in errore: rBoolean è false se ok: * rBoolean è true rObject contiene una lista di ComponenteRec corrispondenti ai componenti ed rString @@ -218,7 +221,7 @@ public RispostaControlli leggiVolumiUnitaDoc(long idUnitaDoc) { */ // OK @TransactionAttribute(TransactionAttributeType.REQUIRED) - public RispostaControlli leggiCompFileInUD(long idUnitaDoc) { + public RispostaControlli leggiCompFileInUD(long idUnitaDoc, boolean estraiFileIndiceAip) { RispostaControlli rispostaControlli; rispostaControlli = new RispostaControlli(); rispostaControlli.setrBoolean(false); @@ -228,9 +231,18 @@ public RispostaControlli leggiCompFileInUD(long idUnitaDoc) { try { lstComp = new ArrayList<>(); - String queryStr = "select acd from AroCompDoc acd " - + "where acd.aroStrutDoc.aroDoc.aroUnitaDoc.idUnitaDoc = :idUnitaDoc " - + "and acd.tiSupportoComp = 'FILE'"; + String queryStr = ""; + + if (estraiFileIndiceAip) { + // MAC #34605 + queryStr = "select DISTINCT acd from AroCompDoc acd join acd.aroCompVerIndiceAipUds acviau " + + "where acviau.aroVerIndiceAipUd.aroIndiceAipUd.aroUnitaDoc.idUnitaDoc = :idUnitaDoc and acd.tiSupportoComp = 'FILE'"; + // end MAC #34605 + } else { + queryStr = "select acd from AroCompDoc acd " + + "where acd.aroStrutDoc.aroDoc.aroUnitaDoc.idUnitaDoc = :idUnitaDoc " + + "and acd.tiSupportoComp = 'FILE'"; + } javax.persistence.Query query = entityManager.createQuery(queryStr); query.setParameter("idUnitaDoc", idUnitaDoc); @@ -239,13 +251,24 @@ public RispostaControlli leggiCompFileInUD(long idUnitaDoc) { for (AroCompDoc tmpCmp : lstComponenti) { // urn String urnCompletoIniz = null; - String urnCompleto = unitaDocumentarieHelper.findAroCompUrnCalcByType(tmpCmp, TiUrn.NORMALIZZATO) - .getDsUrn(); + String urnCompleto = null; + + AroCompUrnCalc compUrnCalc = unitaDocumentarieHelper.findAroCompUrnCalcByType(tmpCmp, + TiUrn.NORMALIZZATO); + if (compUrnCalc != null) { + urnCompleto = compUrnCalc.getDsUrn(); + } else { + urnCompleto = tmpCmp.getDsUrnCompCalc(); + } + // urn iniz - AroCompUrnCalc compUrnCalc = unitaDocumentarieHelper.findAroCompUrnCalcByType(tmpCmp, TiUrn.INIZIALE); + compUrnCalc = unitaDocumentarieHelper.findAroCompUrnCalcByType(tmpCmp, TiUrn.INIZIALE); if (compUrnCalc != null) { urnCompletoIniz = compUrnCalc.getDsUrn(); + } else { + urnCompletoIniz = tmpCmp.getDsUrnCompCalc(); } + ComponenteRec tmpCRec = new ComponenteRec(urnCompleto, urnCompletoIniz); // MEV#22921 Parametrizzazione servizi di recupero tmpCRec.setUrnOriginaleVersata(tmpCmp.getDlUrnCompVers()); @@ -307,12 +330,22 @@ public RispostaControlli leggiCompFileInUDAIPV2(long idUnitaDoc) { for (AroCompDoc tmpCmp : lstComponenti) { // urn String urnCompletoIniz = null; - String urnCompleto = unitaDocumentarieHelper.findAroCompUrnCalcByType(tmpCmp, TiUrn.NORMALIZZATO) - .getDsUrn(); + String urnCompleto = null; + + AroCompUrnCalc compUrnCalc = unitaDocumentarieHelper.findAroCompUrnCalcByType(tmpCmp, + TiUrn.NORMALIZZATO); + if (compUrnCalc != null) { + urnCompleto = compUrnCalc.getDsUrn(); + } else { + urnCompleto = tmpCmp.getDsUrnCompCalc(); + } + // urn iniz - AroCompUrnCalc compUrnCalc = unitaDocumentarieHelper.findAroCompUrnCalcByType(tmpCmp, TiUrn.INIZIALE); + compUrnCalc = unitaDocumentarieHelper.findAroCompUrnCalcByType(tmpCmp, TiUrn.INIZIALE); if (compUrnCalc != null) { urnCompletoIniz = compUrnCalc.getDsUrn(); + } else { + urnCompletoIniz = tmpCmp.getDsUrnCompCalc(); } ComponenteRec tmpCRec = new ComponenteRec(urnCompleto, urnCompletoIniz); // MEV#22921 Parametrizzazione servizi di recupero @@ -1157,6 +1190,32 @@ public RispostaControlli leggiXMLIndiceAIP(long idUnitaDoc) { return rispostaControlli; } + public RispostaControlli leggiXMLIndiceAIPOs(long idUnitaDoc) { + RispostaControlli rispostaControlli; + rispostaControlli = new RispostaControlli(); + rispostaControlli.setrBoolean(false); + try { + String queryStr = "SELECT aro FROM AroVerIndiceAipUd aro " + + "WHERE aro.aroIndiceAipUd.aroUnitaDoc.idUnitaDoc = :idUnitaDoc " + + "AND aro.aroIndiceAipUd.tiFormatoIndiceAip = 'UNISYNCRO' "; + + javax.persistence.Query query = entityManager.createQuery(queryStr); + query.setParameter("idUnitaDoc", idUnitaDoc); + + List listaAroVer = query.getResultList(); + listaAroVer.stream().forEach(this::loadAroUrnVerIndiceAipUdsOs); + rispostaControlli.setrObject(listaAroVer); + rispostaControlli.setrBoolean(true); + } catch (Exception e) { + rispostaControlli.setrBoolean(false); + rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); + rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "Eccezione ControlliRecupero.leggiXMLIndiceAIP " + e.getMessage())); + log.error(ERROR_FILE_V_INDICE_AIP, e); + } + return rispostaControlli; + } + // MEV#30395 public RispostaControlli leggiXMLIndiceAIPV2Os(long idUnitaDoc) { RispostaControlli rispostaControlli; @@ -1879,6 +1938,17 @@ private void loadAroUrnVerIndiceAipUds(AroFileVerIndiceAipUd aroFileVerIndiceAip } } + private void loadAroUrnVerIndiceAipUdsOs(AroVerIndiceAipUd aroVerIndiceAipUd) { + if (aroVerIndiceAipUd != null) { + final String PARAM_NAME = "aroVerIndiceAipUd"; + TypedQuery query = entityManager.createQuery( + "SELECT t FROM AroUrnVerIndiceAipUd t WHERE t.aroVerIndiceAipUd=:" + PARAM_NAME, + AroUrnVerIndiceAipUd.class); + query.setParameter(PARAM_NAME, aroVerIndiceAipUd); + aroVerIndiceAipUd.setAroUrnVerIndiceAipUds(query.getResultList()); + } + } + public VrsUrnXmlSessioneVers findVrsUrnXmlSessioneVersByTiUrn(VrsXmlDatiSessioneVers vrsXmlDatiSessioneVers, it.eng.parer.entity.constraint.VrsUrnXmlSessioneVers.TiUrnXmlSessioneVers tiUrn) { final String vrsXmlDatiSessioneVersParam = "vrsXmlDatiSessioneVers"; @@ -2070,4 +2140,28 @@ public RispostaControlli findIdUpdUnitaDocByXmlUpdUnitaDoc(AroXmlUpdUnitaDoc aro return rispostaControlli; } + public RispostaControlli leggiLogStatoConservazione(long idUnitaDoc) { + RispostaControlli rispostaControlli; + rispostaControlli = new RispostaControlli(); + rispostaControlli.setrBoolean(false); + List aroLog = null; + + try { + String queryStr = "select t from AroLogStatoConservUd t " + + "where t.aroUnitaDoc.idUnitaDoc = :idUnitaDoc order by t.dtStato desc"; + + javax.persistence.Query query = entityManager.createQuery(queryStr); + query.setParameter("idUnitaDoc", idUnitaDoc); + aroLog = query.getResultList(); + rispostaControlli.setrObject(aroLog); + rispostaControlli.setrBoolean(true); + } catch (Exception e) { + rispostaControlli.setCodErr(MessaggiWSBundle.ERR_666); + rispostaControlli.setDsErr(MessaggiWSBundle.getString(MessaggiWSBundle.ERR_666, + "Eccezione ControlliRecupero.leggiVolumeConserv " + e.getMessage())); + log.error("Eccezione nella lettura della tabella dei volumi di conservazione ", e); + } + return rispostaControlli; + } + } diff --git a/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/ejb/RecuperoSync.java b/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/ejb/RecuperoSync.java index 852dcc28..4bdcc7a7 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/ejb/RecuperoSync.java +++ b/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/ejb/RecuperoSync.java @@ -425,4 +425,31 @@ protected RispostaControlli loadWsVersions(RecuperoExt ext) { return rs; } + // questo metodo viene usato nel WS di recupero stato conservazione UD + public void recuperaLogStatoConservazioneUD(RispostaWSRecupero rispostaWs, RecuperoExt rec) { + StatoConservazione myEsito = rispostaWs.getIstanzaEsito(); + AvanzamentoWs tmpAvanzamentoWs = rispostaWs.getAvanzamento(); + + if (rec.getParametriRecupero().getUtente() == null) { + rispostaWs.setSeverity(SeverityEnum.ERROR); + rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, "Errore: l'utente non è autenticato."); + return; + } + + try { + RecuperoXmlGen tmpGen = new RecuperoXmlGen(rispostaWs); + tmpGen.generaLogStatoConservazione(rec); + tmpAvanzamentoWs.resetFase(); + } catch (Exception e) { + rispostaWs.setSeverity(SeverityEnum.ERROR); + rispostaWs.setEsitoWsErrBundle(MessaggiWSBundle.ERR_666, + "Errore nella fase di generazione dell'XML di risposta del EJB " + e.getMessage()); + log.error("Errore nella fase di generazione dell'XML di risposta del EJB ", e); + } + + if (rispostaWs.getSeverity() == SeverityEnum.ERROR) { + myEsito.setXMLRichiesta(rec.getDatiXml()); + } + } + } diff --git a/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/ejb/objectStorage/RecObjectStorage.java b/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/ejb/objectStorage/RecObjectStorage.java index 65c87624..225c01a4 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/ejb/objectStorage/RecObjectStorage.java +++ b/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/ejb/objectStorage/RecObjectStorage.java @@ -47,11 +47,12 @@ public class RecObjectStorage { @EJB private ObjectStorageService objectStorageService; - private boolean recuperaObjectStorageCompSuStream(long idCompDoc, OutputStream outputStream) { + private boolean recuperaObjectStorageCompSuStream(long idCompDoc, OutputStream outputStream, + boolean fileDaSbustare) { boolean rc = false; try { - objectStorageService.getObjectComponente(idCompDoc, outputStream); + objectStorageService.getObjectComponente(idCompDoc, outputStream, fileDaSbustare); rc = true; } catch (Exception e) { @@ -120,7 +121,7 @@ public boolean recuperaObjectStorageSuStream(RecuperoDocBean dto) { boolean rc = false; switch (dto.getTipo()) { case COMP_DOC: - rc = this.recuperaObjectStorageCompSuStream(dto.getId(), dto.getOs()); + rc = this.recuperaObjectStorageCompSuStream(dto.getId(), dto.getOs(), dto.isFileDaSbustare()); break; case REPORTVF: rc = this.recuperaObjectStorageReportvfSuStream(dto.getId(), dto.getOs()); diff --git a/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/ejb/oracleBlb/RecBlbOracle.java b/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/ejb/oracleBlb/RecBlbOracle.java index 1230051c..b8b045d7 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/ejb/oracleBlb/RecBlbOracle.java +++ b/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/ejb/oracleBlb/RecBlbOracle.java @@ -16,20 +16,20 @@ */ /* - Attenzione - Il codice di questo modulo software è legato: - * al DBMS Oracle - * al driver JDBC proprietario di Oracle (compatibile JDBC 4) - * alla gestione propria di Oracle delle colonne di tipo BLOB - - Questo codice non è direttamente usabile su altre architetture di database e presumibilmente - dovrà essere riscritto in parte o del tutto per gestire la modalità di gestione delle colonne - di tipo BLOB impiegata da un eventuale altro DBMS. - - La scelta di utilizzare una modalità di accesso non portabile per scrivere su tabella nasce - dall'esigenza di dover leggere e scrivere colonne di tipo BLOB potenzialmente enormi e - dall'incapacità dell'architettura JPA di effettuare queste operazioni tramite stream. - */ +Attenzione +Il codice di questo modulo software è legato: +* al DBMS Oracle +* al driver JDBC proprietario di Oracle (compatibile JDBC 4) +* alla gestione propria di Oracle delle colonne di tipo BLOB + +Questo codice non è direttamente usabile su altre architetture di database e presumibilmente +dovrà essere riscritto in parte o del tutto per gestire la modalità di gestione delle colonne +di tipo BLOB impiegata da un eventuale altro DBMS. + +La scelta di utilizzare una modalità di accesso non portabile per scrivere su tabella nasce +dall'esigenza di dover leggere e scrivere colonne di tipo BLOB potenzialmente enormi e +dall'incapacità dell'architettura JPA di effettuare queste operazioni tramite stream. +*/ package it.eng.parer.ws.recupero.ejb.oracleBlb; import java.io.IOException; @@ -44,8 +44,13 @@ import it.eng.parer.exception.ConnectionException; import it.eng.parer.objectstorage.dto.RecuperoDocBean; import it.eng.spagoCore.util.JpaUtils; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileOutputStream; +import javax.ejb.EJB; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import it.eng.parer.firma.crypto.verifica.CryptoInvoker; import javax.ejb.EJBException; import javax.ejb.LocalBean; @@ -54,6 +59,7 @@ import javax.ejb.TransactionAttributeType; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; +import org.springframework.http.ResponseEntity; /** * @author Fioravanti_F @@ -63,6 +69,9 @@ @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) public class RecBlbOracle { + @EJB + private CryptoInvoker cryptoInvoker; + private static final Logger log = LoggerFactory.getLogger(RecBlbOracle.class); @PersistenceContext(unitName = "ParerJPA") private EntityManager entityManager; @@ -128,7 +137,7 @@ public long contaBlobErroriVers(long idPadre) { * @param idPadre * id del record padre (relazione 1 a 0/1) della riga da cui recuperare il blob * @param outputStream - * stream su cui scrivere (può essere uno ZipOutputStream o un semplice FileOutputStream + * stream su cui scrivere (può essere uno ZipOutputStream o un semplice FileOutputStream * @param tabellaBlobDaLeggere * una delle due tabelle di Sacer da cui leggere il blob * @param dto @@ -186,11 +195,18 @@ public boolean recuperaBlobCompSuStream(long idPadre, OutputStream outputStream, closeConnection(conn); } if (blob != null) { - try (InputStream is = blob.getBinaryStream();) { - int len; - while ((len = is.read(buffer)) > 0) { - outputStream.write(buffer, 0, len); - log.debug("letto blob e scritto su stream..."); + // MEV#34239 - Estensione servizio per recupero file sbustati + if (dto != null && dto.isFileDaSbustare()) { + try (InputStream is = blob.getBinaryStream();) { + cryptoInvoker.copiaStreamsESbustaP7m(is, outputStream); + } + } else { + try (InputStream is = blob.getBinaryStream();) { + int len; + while ((len = is.read(buffer)) > 0) { + outputStream.write(buffer, 0, len); + log.debug("letto blob e scritto su stream..."); + } } } rispostaControlli = true; @@ -198,10 +214,10 @@ public boolean recuperaBlobCompSuStream(long idPadre, OutputStream outputStream, /* * MEV 30369 - TODO da rimuovere quando viene completata la migrazione dei BLOB * (https://parermine.regione.emilia-romagna.it/issues/29978) se non lo trovo su VRS_CONTENUTO_FILE_KO - * lo cerco su VRS_CONTENUTO_FILE perché evidentemente non è ancora stato spostato il CLOB + * lo cerco su VRS_CONTENUTO_FILE perché evidentemente non è ancora stato spostato il CLOB */ if (TabellaBlob.ERRORI_VERS.equals(tabellaBlobDaLeggere)) { - recuperaBlobCompSuStream(idPadre, outputStream, TabellaBlob.ERRORI_VERS_TMP, null); + recuperaBlobCompSuStream(idPadre, outputStream, TabellaBlob.ERRORI_VERS_TMP, dto); } log.error("Eccezione nella lettura della tabella dei dati componente: il blob è nullo"); } diff --git a/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/utils/RecuperoXmlGen.java b/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/utils/RecuperoXmlGen.java index 18e8bea6..de7a02fa 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/utils/RecuperoXmlGen.java +++ b/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/utils/RecuperoXmlGen.java @@ -14,9 +14,9 @@ * You should have received a copy of the GNU Affero General Public License along with this program. * If not, see . */ - package it.eng.parer.ws.recupero.utils; +import it.eng.parer.entity.AroLogStatoConservUd; import java.math.BigInteger; import java.util.Date; import java.util.List; @@ -50,6 +50,14 @@ import it.eng.parer.ws.xml.versRespStato.SCVersatoreType; import it.eng.parer.ws.xml.versRespStato.StatoConservazione; import it.eng.parer.ws.xml.versRespStato.StatoConservazioneType; +import it.eng.parer.ws.xml.versRespStato.LogStatoConservazioneType; +import it.eng.parer.ws.xml.versRespStato.LogType; +import java.time.Instant; +import java.util.ArrayList; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; /** * @@ -232,4 +240,51 @@ private void setRispostaWsError() { rispostaWs.setErrorCode(rispostaControlli.getCodErr()); rispostaWs.setErrorMessage(rispostaControlli.getDsErr()); } + + public void generaLogStatoConservazione(RecuperoExt recupero) { + StatoConservazione myEsito = rispostaWs.getIstanzaEsito(); + AvanzamentoWs myAvanzamentoWs = rispostaWs.getAvanzamento(); + parsedUnitaDoc = recupero.getStrutturaRecupero(); + + // compila Log Stato Conservazione + if (rispostaWs.getSeverity() == SeverityEnum.OK) { + rispostaControlli.reset(); + rispostaControlli = controlliRecupero + .leggiLogStatoConservazione(recupero.getParametriRecupero().getIdUnitaDoc()); + if (rispostaControlli.isrBoolean() == false) { + setRispostaWsError(); + rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); + } else { + List list = (List) rispostaControlli.getrObject(); + if (!list.isEmpty()) { + List l = new ArrayList<>(); + list.forEach(logStato -> { + LogType logUD = new LogType(); + Instant i = new java.util.Date(logStato.getDtStato().getTime()).toInstant(); + String dateTimeString = i.toString(); + XMLGregorianCalendar date2 = null; + try { + date2 = DatatypeFactory.newInstance().newXMLGregorianCalendar(dateTimeString); + } catch (DatatypeConfigurationException ex) { + Logger.getLogger(RecuperoXmlGen.class.getName()).log(Level.SEVERE, null, ex); + } + if (date2 != null) { + logUD.setDataEvento(date2); + } + + logUD.setNomeAgente(logStato.getNmAgente()); + logUD.setTipoEvento(logStato.getTiEvento()); + logUD.setTipoStatoConservazione(logStato.getTiStatoConservazione()); + logUD.setModalita(logStato.getTiMod()); + l.add(logUD); + }); + + if (!l.isEmpty()) { + myEsito.setLogStatoConservazione(new LogStatoConservazioneType()); + myEsito.getLogStatoConservazione().getLog().addAll(l); + } + } + } + } + } } diff --git a/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/utils/RecuperoZipGen.java b/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/utils/RecuperoZipGen.java index b189138d..c461dbbc 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/utils/RecuperoZipGen.java +++ b/sacer-ejb/src/main/java/it/eng/parer/ws/recupero/utils/RecuperoZipGen.java @@ -137,6 +137,8 @@ public class RecuperoZipGen { private static final String DIRECTORY_FASC_AIPV2 = "fascicoli"; // end EVO#20972 + private static final String SUFFISSO_P7M = ".p7m"; + // The ZipArchiveEntry.setXxxTime() methods write the time taking into account // the local time zone, // so we must first convert the desired timestamp value in the local time zone @@ -225,7 +227,7 @@ public void generaZipOggetto(String outputPath, RecuperoExt recupero, boolean te recupero.getParametriRecupero().getIdTipoDoc()); } else { rispostaControlli = controlliRecupero - .leggiCompFileInUD(recupero.getParametriRecupero().getIdUnitaDoc()); + .leggiCompFileInUD(recupero.getParametriRecupero().getIdUnitaDoc(), false); } prefisso = "UD_"; break; @@ -247,10 +249,10 @@ public void generaZipOggetto(String outputPath, RecuperoExt recupero, boolean te break; // case UNI_DOC_UNISYNCRO: - rispostaControlli = controlliRecupero - .leggiCompFileInUD(recupero.getParametriRecupero().getIdUnitaDoc()); + rispostaControlli = controlliRecupero.leggiCompFileInUD(recupero.getParametriRecupero().getIdUnitaDoc(), + true); prefisso = "AIP_"; - includiFileIndiceAIPV2 = true; + includiFileIndiceAIP = true; includiSessFileVersamento = true; recuperaDip = false; // per il recupero AIP non si includono mai i file convertiti includiFirmaMarcaElencoIndiceAIP = true; @@ -277,8 +279,8 @@ public void generaZipOggetto(String outputPath, RecuperoExt recupero, boolean te // end EVO#20972 // case UNI_DOC_DIP_ESIBIZIONE: - rispostaControlli = controlliRecupero - .leggiCompFileInUD(recupero.getParametriRecupero().getIdUnitaDoc()); + rispostaControlli = controlliRecupero.leggiCompFileInUD(recupero.getParametriRecupero().getIdUnitaDoc(), + false); prefisso = "DIP_UD_"; includiRapportoVersamento = true; recuperaDip = false; // per il recupero DIP per esibizione non si includono mai i file convertiti @@ -359,7 +361,7 @@ public void generaZipOggetto(String outputPath, RecuperoExt recupero, boolean te if (includiFileIndiceAIP && rispostaWs.getSeverity() == SeverityEnum.OK) { // aggiunge se necessario le varie versioni dell'indice AIP - this.aggiungiIndiciAipUd(tmpZipOutputStream, recupero.getParametriRecupero().getIdUnitaDoc(), + this.aggiungiIndiciAipUdOs(tmpZipOutputStream, recupero.getParametriRecupero().getIdUnitaDoc(), rispostaWs); } @@ -821,6 +823,7 @@ private void aggiungiFileComponenti(ZipArchiveOutputStream zipOutputStream, Recu TokenFileNameType tipoNomeFile = recupero.getStrutturaRecupero().getChiave().getTipoNomeFile(); for (ComponenteRec tmpCmp : lstComp) { ZipArchiveEntry zae = null; + boolean fileDaSbustare = false; // Se viene passato NIENTE oppure NOME_FILE_URN_SACER si vuole il vecchio // comportamento if (tipoNomeFile == null || tipoNomeFile.value().trim().equals("") @@ -921,6 +924,14 @@ private void aggiungiFileComponenti(ZipArchiveOutputStream zipOutputStream, Recu } } pathCompleto = eliminaEventualiDoppiSlash(pathCompleto); + // MEV#34239 - Estensione servizio per recupero file sbustati + String suffissoFile = pathCompleto.substring(pathCompleto.length() - 4, pathCompleto.length()); + if (recupero.getStrutturaRecupero().getChiave().isFileSbustato() != null + && recupero.getStrutturaRecupero().getChiave().isFileSbustato() + && suffissoFile.equalsIgnoreCase(SUFFISSO_P7M)) { + pathCompleto = pathCompleto.substring(0, pathCompleto.length() - 4); + fileDaSbustare = true; + } provaAdInserireEntry(zipOutputStream, DIRECTORY_REC + MessaggiWSFormat.normalizingFileName(pathCompleto), entryGiaInserite); } @@ -936,6 +947,7 @@ private void aggiungiFileComponenti(ZipArchiveOutputStream zipOutputStream, Recu tmpCmp.getIdCompDoc(), zipOutputStream, RecBlbOracle.TabellaBlob.valueOf(recupero.getTipoSalvataggioFile().name())); // recupero + csRecuperoDoc.setFileDaSbustare(fileDaSbustare); boolean esitoRecupero = recuperoDocumento.callRecuperoDocSuStream(csRecuperoDoc); rispostaControlli.setrBoolean(esitoRecupero); if (!esitoRecupero) { @@ -1072,6 +1084,76 @@ public boolean evaluate(final Object object) { } } + private void aggiungiIndiciAipUdOs(ZipArchiveOutputStream zipOutputStream, long idUnitaDoc, + RispostaWSRecupero rispostaWs) throws IOException { + + RispostaControlli rispostaControlli = new RispostaControlli(); + List lstVrsIndice = null; + if (rispostaWs.getSeverity() == SeverityEnum.OK) { + rispostaControlli.reset(); + rispostaControlli = controlliRecupero.leggiXMLIndiceAIPOs(idUnitaDoc); + + if (!rispostaControlli.isrBoolean()) { + setRispostaWsError(rispostaWs, rispostaControlli); + rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); + } else { + lstVrsIndice = (List) rispostaControlli.getrObject(); + } + } + + if (rispostaWs.getSeverity() == SeverityEnum.OK) { + if (lstVrsIndice != null && !lstVrsIndice.isEmpty()) { + boolean closeEntry = false; + for (AroVerIndiceAipUd verIndiceLastVers : lstVrsIndice) { + // EVO#16486 + String fileName = ""; + + if (verIndiceLastVers.getAroUrnVerIndiceAipUds() != null + && !verIndiceLastVers.getAroUrnVerIndiceAipUds().isEmpty()) { + // Recupero lo urn ORIGINALE + AroUrnVerIndiceAipUd urnVerIndiceAipUd = (AroUrnVerIndiceAipUd) CollectionUtils + .find(verIndiceLastVers.getAroUrnVerIndiceAipUds(), new Predicate() { + @Override + public boolean evaluate(final Object object) { + return ((AroUrnVerIndiceAipUd) object).getTiUrn() + .equals(TiUrnVerIxAipUd.ORIGINALE); + } + }); + if (urnVerIndiceAipUd != null) { + fileName = urnVerIndiceAipUd.getDsUrn(); + } + } else { + fileName = verIndiceLastVers.getDsUrn(); + } + + // end EVO#16486 + ZipArchiveEntry zae = new ZipArchiveEntry(ComponenteRec.estraiNomeFileCompleto(fileName) + ".xml"); + this.filterZipEntry(zae); + zipOutputStream.putArchiveEntry(zae); + // recupero documento blob vs obj storage + // build dto per recupero + RecuperoDocBean csRecuperoDoc = new RecuperoDocBean(TiEntitaSacerObjectStorage.INDICE_AIP, + verIndiceLastVers.getIdVerIndiceAip(), zipOutputStream, RecClbOracle.TabellaClob.CLOB); + // recupero + boolean esitoRecupero = recuperoDocumento.callRecuperoDocSuStream(csRecuperoDoc); + rispostaControlli.setrBoolean(esitoRecupero); + closeEntry = true; + if (!esitoRecupero) { + throw new IOException("Errore non gestito nel recupero del file"); + } + // this.filterZipEntry(zae); + // zipOutputStream.putArchiveEntry(zae); + // zipOutputStream.write(fileIndice.getBlFileVerIndiceAip().getBytes()); + // zipOutputStream.closeArchiveEntry(); + } + + if (closeEntry) { + zipOutputStream.closeArchiveEntry(); + } + } + } + } + // MEV#30395 private void aggiungiIndiciAipUdV2Os(ZipArchiveOutputStream zipOutputStream, long idUnitaDoc, RispostaWSRecupero rispostaWs) throws IOException { @@ -1218,7 +1300,7 @@ private void aggiungiIndiciAipUdExt(ZipArchiveOutputStream zipOutputStream, long // rispostaControlli.reset(); rispostaControlli = controlliRecupero - .leggiCompFileInUD(fileIndicePrecVersExt.getIdUnitaDocAip().longValue()); + .leggiCompFileInUD(fileIndicePrecVersExt.getIdUnitaDocAip().longValue(), true); if (!rispostaControlli.isrBoolean()) { setRispostaWsError(rispostaWs, rispostaControlli); rispostaWs.setEsitoWsError(rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); diff --git a/sacer-ejb/src/main/java/it/eng/parer/ws/richiestaAnnullamentoVersamenti/ejb/InvioRichiestaAnnullamentoVersamentiEjb.java b/sacer-ejb/src/main/java/it/eng/parer/ws/richiestaAnnullamentoVersamenti/ejb/InvioRichiestaAnnullamentoVersamentiEjb.java index 78c47bdd..04746596 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/ws/richiestaAnnullamentoVersamenti/ejb/InvioRichiestaAnnullamentoVersamentiEjb.java +++ b/sacer-ejb/src/main/java/it/eng/parer/ws/richiestaAnnullamentoVersamenti/ejb/InvioRichiestaAnnullamentoVersamentiEjb.java @@ -451,7 +451,7 @@ public void evasioneRichiestaAnnullamento(Long idRichAnnulVers, long idUserIam, log.debug("controlloItemWsRichiestaAnnul - FINE"); // Evasione richiesta log.debug("evasioneRichiestaAnnullamento - INIZIO"); - avEjb.evasioneRichiestaAnnullamento(richiestaAnnullamento); + avEjb.evasioneRichiestaAnnullamento(richiestaAnnullamento, idUserIam); log.debug("evasioneRichiestaAnnullamento - FINE"); } diff --git a/sacer-ejb/src/main/java/it/eng/parer/ws/utils/Costanti.java b/sacer-ejb/src/main/java/it/eng/parer/ws/utils/Costanti.java index 42abfd9c..79eda205 100644 --- a/sacer-ejb/src/main/java/it/eng/parer/ws/utils/Costanti.java +++ b/sacer-ejb/src/main/java/it/eng/parer/ws/utils/Costanti.java @@ -384,7 +384,9 @@ public enum ModificatoriWS { // TAG_ANNUL_FASC, // tag di annullamento, abilita l'opzione di Annullamento Fascicolo, - TAG_ANNUL_TIPO_ANNUL // tag di annullamento che abilita il tag opzionale TipoAnnullamento + TAG_ANNUL_TIPO_ANNUL, // tag di annullamento che abilita il tag opzionale TipoAnnullamento + + TAG_LOG_STATO_CONSERV_UD // tag di annullamento che abilita il tag opzionale TipoAnnullamento } public enum CategoriaDocumento { diff --git a/sacer-ejb/src/test/java/it/eng/parer/amministrazioneStrutture/gestioneTipoUd/helper/TipoUnitaDocHelperTest.java b/sacer-ejb/src/test/java/it/eng/parer/amministrazioneStrutture/gestioneTipoUd/helper/TipoUnitaDocHelperTest.java index 375ca093..530c2b03 100644 --- a/sacer-ejb/src/test/java/it/eng/parer/amministrazioneStrutture/gestioneTipoUd/helper/TipoUnitaDocHelperTest.java +++ b/sacer-ejb/src/test/java/it/eng/parer/amministrazioneStrutture/gestioneTipoUd/helper/TipoUnitaDocHelperTest.java @@ -287,7 +287,7 @@ public void retrieveAplSistemaVersanteListPerTipoUd_queryIsOk() { @Test public void getAplSistemiVersantiSeparatiPerTipoUd_queryIsOk() { BigDecimal idTipoUnitaDoc = aBigDecimal(); - helper.getAplSistemiVersantiSeparatiPerTipoUd(idTipoUnitaDoc); + helper.getNmSistemiVersantiRaggruppatiPerTipoUd(idTipoUnitaDoc); assertTrue(true); } diff --git a/sacer-ejb/src/test/java/it/eng/parer/ws/recupero/ejb/ControlliRecuperoTest.java b/sacer-ejb/src/test/java/it/eng/parer/ws/recupero/ejb/ControlliRecuperoTest.java index eee02ca7..27e5bd5d 100644 --- a/sacer-ejb/src/test/java/it/eng/parer/ws/recupero/ejb/ControlliRecuperoTest.java +++ b/sacer-ejb/src/test/java/it/eng/parer/ws/recupero/ejb/ControlliRecuperoTest.java @@ -67,7 +67,8 @@ public void leggiVolumiUnitaDocQueryIsOk() { @Test public void leggiCompFileInUDQueryIsOk() { Long idUnitaDoc = 28L; - RispostaControlli rispostaControlli = helper.leggiCompFileInUD(idUnitaDoc); + boolean estraiFileIndiceAip = false; + RispostaControlli rispostaControlli = helper.leggiCompFileInUD(idUnitaDoc, estraiFileIndiceAip); assertNotEquals("666", rispostaControlli.getCodErr()); } diff --git a/sacer-jpa/pom.xml b/sacer-jpa/pom.xml index 98c9fab5..f9c3d6fa 100644 --- a/sacer-jpa/pom.xml +++ b/sacer-jpa/pom.xml @@ -3,7 +3,7 @@ sacer-jboss it.eng.parer - 10.3.2-SNAPSHOT + 10.4.0 sacer-jboss-jpa diff --git a/sacer-jpa/src/main/java/it/eng/parer/entity/AroLogStatoConservUd.java b/sacer-jpa/src/main/java/it/eng/parer/entity/AroLogStatoConservUd.java new file mode 100644 index 00000000..58cc6b57 --- /dev/null +++ b/sacer-jpa/src/main/java/it/eng/parer/entity/AroLogStatoConservUd.java @@ -0,0 +1,118 @@ +package it.eng.parer.entity; + +import java.io.Serializable; +import javax.persistence.*; +import java.math.BigDecimal; +import java.util.Date; + +/** + * The persistent class for the ARO_LOG_STATO_CONSERV_UD database table. + * + */ +@Entity +@Table(name = "ARO_LOG_STATO_CONSERV_UD") +@NamedQuery(name = "AroLogStatoConservUd.findAll", query = "SELECT a FROM AroLogStatoConservUd a") +public class AroLogStatoConservUd implements Serializable { + private static final long serialVersionUID = 1L; + private long idLogStatoConservUd; + private BigDecimal aaKeyUnitaDoc; + private Date dtStato; + private String nmAgente; + private String tiEvento; + private String tiMod; + private String tiStatoConservazione; + private AroUnitaDoc aroUnitaDoc; + private OrgSubStrut orgSubStrut; + + public AroLogStatoConservUd() { + } + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "ID_LOG_STATO_CONSERV_UD") + public long getIdLogStatoConservUd() { + return this.idLogStatoConservUd; + } + + public void setIdLogStatoConservUd(long idLogStatoConservUd) { + this.idLogStatoConservUd = idLogStatoConservUd; + } + + @Column(name = "AA_KEY_UNITA_DOC") + public BigDecimal getAaKeyUnitaDoc() { + return this.aaKeyUnitaDoc; + } + + public void setAaKeyUnitaDoc(BigDecimal aaKeyUnitaDoc) { + this.aaKeyUnitaDoc = aaKeyUnitaDoc; + } + + @Temporal(TemporalType.DATE) + @Column(name = "DT_STATO") + public Date getDtStato() { + return this.dtStato; + } + + public void setDtStato(Date dtStato) { + this.dtStato = dtStato; + } + + @Column(name = "NM_AGENTE") + public String getNmAgente() { + return this.nmAgente; + } + + public void setNmAgente(String nmAgente) { + this.nmAgente = nmAgente; + } + + @Column(name = "TI_EVENTO") + public String getTiEvento() { + return this.tiEvento; + } + + public void setTiEvento(String tiEvento) { + this.tiEvento = tiEvento; + } + + @Column(name = "TI_MOD") + public String getTiMod() { + return this.tiMod; + } + + public void setTiMod(String tiMod) { + this.tiMod = tiMod; + } + + @Column(name = "TI_STATO_CONSERVAZIONE") + public String getTiStatoConservazione() { + return this.tiStatoConservazione; + } + + public void setTiStatoConservazione(String tiStatoConservazione) { + this.tiStatoConservazione = tiStatoConservazione; + } + + // bi-directional many-to-one association to AroUnitaDoc + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_UNITA_DOC") + public AroUnitaDoc getAroUnitaDoc() { + return this.aroUnitaDoc; + } + + public void setAroUnitaDoc(AroUnitaDoc aroUnitaDoc) { + this.aroUnitaDoc = aroUnitaDoc; + } + + // bi-directional many-to-one association to OrgSubStrut + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ID_SUB_STRUT") + public OrgSubStrut getOrgSubStrut() { + return this.orgSubStrut; + } + + public void setOrgSubStrut(OrgSubStrut orgSubStrut) { + this.orgSubStrut = orgSubStrut; + } + +} \ No newline at end of file diff --git a/sacer-jpa/src/main/java/it/eng/parer/entity/AroUnitaDoc.java b/sacer-jpa/src/main/java/it/eng/parer/entity/AroUnitaDoc.java index d7c64983..90bad6b1 100644 --- a/sacer-jpa/src/main/java/it/eng/parer/entity/AroUnitaDoc.java +++ b/sacer-jpa/src/main/java/it/eng/parer/entity/AroUnitaDoc.java @@ -188,10 +188,13 @@ public class AroUnitaDoc implements Serializable { private List aroUpdUnitaDocs = new ArrayList<>(); + private List aroLogStatoConservUds; + public AroUnitaDoc() {/* Hibernate */ } @Id + @Column(name = "ID_UNITA_DOC") @GenericGenerator(name = "SARO_UNITA_DOC_ID_UNITA_DOC_GENERATOR", strategy = "it.eng.sequences.hibernate.NonMonotonicSequenceGenerator", parameters = { @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SARO_UNITA_DOC"), @@ -725,6 +728,7 @@ public void setAroUsoXsdDatiSpecs(List aroUsoXsdDatiSpecs) { } @OneToMany(mappedBy = "aroUnitaDoc") + public List getRecUnitaDocRecups() { return this.recUnitaDocRecups; } @@ -891,4 +895,12 @@ public void setAroXmlUnitaDocObjectStorage(AroXmlUnitaDocObjectStorage aroXmlUni this.aroXmlUnitaDocObjectStorage = aroXmlUnitaDocObjectStorage; } + @OneToMany(mappedBy = "aroUnitaDoc") + public List getAroLogStatoConservUds() { + return this.aroLogStatoConservUds; + } + + public void setAroLogStatoConservUds(List aroLogStatoConservUds) { + this.aroLogStatoConservUds = aroLogStatoConservUds; + } } diff --git a/sacer-jpa/src/main/java/it/eng/parer/entity/FirCertifCa.java b/sacer-jpa/src/main/java/it/eng/parer/entity/FirCertifCa.java index 3af21186..96f15353 100644 --- a/sacer-jpa/src/main/java/it/eng/parer/entity/FirCertifCa.java +++ b/sacer-jpa/src/main/java/it/eng/parer/entity/FirCertifCa.java @@ -18,7 +18,6 @@ package it.eng.parer.entity; import java.io.Serializable; -import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -65,8 +64,6 @@ public class FirCertifCa implements Serializable { private Date dtIniValCertifCa; - private BigDecimal niSerialCertifCa; - private List firCertifFirmatarios = new ArrayList<>(); private List firCrls = new ArrayList<>(); @@ -76,8 +73,11 @@ public class FirCertifCa implements Serializable { private String dsSubjectKeyId; private String dlDnIssuerCertifCa; + private String dlDnSubjectCertifCa; + private String dsSerialCertifCa; + public FirCertifCa() {/* Hibernate */ } @@ -115,13 +115,13 @@ public void setDtIniValCertifCa(Date dtIniValCertifCa) { this.dtIniValCertifCa = dtIniValCertifCa; } - @Column(name = "NI_SERIAL_CERTIF_CA") - public BigDecimal getNiSerialCertifCa() { - return this.niSerialCertifCa; + @Column(name = "DS_SERIAL_CERTIF_CA") + public String getDsSerialCertifCa() { + return this.dsSerialCertifCa; } - public void setNiSerialCertifCa(BigDecimal niSerialCertifCa) { - this.niSerialCertifCa = niSerialCertifCa; + public void setDsSerialCertifCa(String dsSerialCertifCa) { + this.dsSerialCertifCa = dsSerialCertifCa; } @Column(name = "DS_SUBJECT_KEY_ID") diff --git a/sacer-jpa/src/main/java/it/eng/parer/grantedEntity/IamParamApplic.java b/sacer-jpa/src/main/java/it/eng/parer/grantedEntity/IamParamApplic.java index 5d4b2bdc..10d19a39 100644 --- a/sacer-jpa/src/main/java/it/eng/parer/grantedEntity/IamParamApplic.java +++ b/sacer-jpa/src/main/java/it/eng/parer/grantedEntity/IamParamApplic.java @@ -39,6 +39,8 @@ public class IamParamApplic implements Serializable { private static final long serialVersionUID = 1L; private Long idParamApplic; + private String cdVersioneAppIni; + private String cdVersioneAppFine; private String dsParamApplic; private String dsListaValoriAmmessi; private String flAppartAmbiente; @@ -62,6 +64,24 @@ public void setIdParamApplic(Long idParamApplic) { this.idParamApplic = idParamApplic; } + @Column(name = "CD_VERSIONE_APP_INI") + public String getCdVersioneAppIni() { + return this.cdVersioneAppIni; + } + + public void setCdVersioneAppIni(String cdVersioneAppIni) { + this.cdVersioneAppIni = cdVersioneAppIni; + } + + @Column(name = "CD_VERSIONE_APP_FINE") + public String getCdVersioneAppFine() { + return this.cdVersioneAppFine; + } + + public void setCdVersioneAppFine(String cdVersioneAppFine) { + this.cdVersioneAppFine = cdVersioneAppFine; + } + @Column(name = "DS_PARAM_APPLIC") public String getDsParamApplic() { return this.dsParamApplic; diff --git a/sacer-jpa/src/main/java/it/eng/parer/viewEntity/AroVLisCertifCaFirmaComp.java b/sacer-jpa/src/main/java/it/eng/parer/viewEntity/AroVLisCertifCaFirmaComp.java index e6d291c2..dcf1f272 100644 --- a/sacer-jpa/src/main/java/it/eng/parer/viewEntity/AroVLisCertifCaFirmaComp.java +++ b/sacer-jpa/src/main/java/it/eng/parer/viewEntity/AroVLisCertifCaFirmaComp.java @@ -45,12 +45,12 @@ public class AroVLisCertifCaFirmaComp implements Serializable { private BigDecimal idContrFirmaComp; private BigDecimal idFirmaComp; private BigDecimal idUsoCertifCaContrComp; - private BigDecimal niSerialCertifCa; - private BigDecimal niSerialCertifCrl; - private BigDecimal niSerialCrl; + private String dsSerialCertifCa; + private String dsSerialCertifCrl; + private String dsSerialCrl; private BigDecimal pgCertifCa; private String dlDnIssuerCertifOcsp; - private BigDecimal niSerialCertifOcsp; + private String dsSerialCertifOcsp; private Date dtIniValCertifOcsp; private Date dtFinValCertifOcsp; private String tiContr; @@ -134,31 +134,31 @@ public void setIdUsoCertifCaContrComp(BigDecimal idUsoCertifCaContrComp) { this.idUsoCertifCaContrComp = idUsoCertifCaContrComp; } - @Column(name = "NI_SERIAL_CERTIF_CA") - public BigDecimal getNiSerialCertifCa() { - return this.niSerialCertifCa; + @Column(name = "DS_SERIAL_CERTIF_CA") + public String getDsSerialCertifCa() { + return this.dsSerialCertifCa; } - public void setNiSerialCertifCa(BigDecimal niSerialCertifCa) { - this.niSerialCertifCa = niSerialCertifCa; + public void setDsSerialCertifCa(String dsSerialCertifCa) { + this.dsSerialCertifCa = dsSerialCertifCa; } - @Column(name = "NI_SERIAL_CERTIF_CRL") - public BigDecimal getNiSerialCertifCrl() { - return this.niSerialCertifCrl; + @Column(name = "DS_SERIAL_CERTIF_CRL") + public String getDsSerialCertifCrl() { + return this.dsSerialCertifCrl; } - public void setNiSerialCertifCrl(BigDecimal niSerialCertifCrl) { - this.niSerialCertifCrl = niSerialCertifCrl; + public void setDsSerialCertifCrl(String dsSerialCertifCrl) { + this.dsSerialCertifCrl = dsSerialCertifCrl; } - @Column(name = "NI_SERIAL_CRL") - public BigDecimal getNiSerialCrl() { - return this.niSerialCrl; + @Column(name = "DS_SERIAL_CRL") + public String getDsSerialCrl() { + return this.dsSerialCrl; } - public void setNiSerialCrl(BigDecimal niSerialCrl) { - this.niSerialCrl = niSerialCrl; + public void setDsSerialCrl(String dsSerialCrl) { + this.dsSerialCrl = dsSerialCrl; } @Column(name = "PG_CERTIF_CA") @@ -179,13 +179,13 @@ public void setDlDnIssuerCertifOcsp(String dlDnIssuerCertifOcsp) { this.dlDnIssuerCertifOcsp = dlDnIssuerCertifOcsp; } - @Column(name = "NI_SERIAL_CERTIF_OCSP") - public BigDecimal getNiSerialCertifOcsp() { - return niSerialCertifOcsp; + @Column(name = "DS_SERIAL_CERTIF_OCSP") + public String getDsSerialCertifOcsp() { + return dsSerialCertifOcsp; } - public void setNiSerialCertifOcsp(BigDecimal niSerialCertifOcsp) { - this.niSerialCertifOcsp = niSerialCertifOcsp; + public void setDsSerialCertifOcsp(String dsSerialCertifOcsp) { + this.dsSerialCertifOcsp = dsSerialCertifOcsp; } @Temporal(TemporalType.TIMESTAMP) diff --git a/sacer-jpa/src/main/java/it/eng/parer/viewEntity/AroVLisCertifCaMarcaComp.java b/sacer-jpa/src/main/java/it/eng/parer/viewEntity/AroVLisCertifCaMarcaComp.java index 59eca6c0..26674668 100644 --- a/sacer-jpa/src/main/java/it/eng/parer/viewEntity/AroVLisCertifCaMarcaComp.java +++ b/sacer-jpa/src/main/java/it/eng/parer/viewEntity/AroVLisCertifCaMarcaComp.java @@ -45,12 +45,12 @@ public class AroVLisCertifCaMarcaComp implements Serializable { private BigDecimal idContrMarcaComp; private BigDecimal idMarcaComp; private BigDecimal idUsoCertifCaContrMarca; - private BigDecimal niSerialCertifCa; - private BigDecimal niSerialCertifCrl; - private BigDecimal niSerialCrl; + private String dsSerialCertifCa; + private String dsSerialCertifCrl; + private String dsSerialCrl; private BigDecimal pgCertifCa; private String dlDnIssuerCertifOcsp; - private BigDecimal niSerialCertifOcsp; + private String dsSerialCertifOcsp; private Date dtIniValCertifOcsp; private Date dtFinValCertifOcsp; private String tiContr; @@ -134,31 +134,31 @@ public void setIdUsoCertifCaContrMarca(BigDecimal idUsoCertifCaContrMarca) { this.idUsoCertifCaContrMarca = idUsoCertifCaContrMarca; } - @Column(name = "NI_SERIAL_CERTIF_CA") - public BigDecimal getNiSerialCertifCa() { - return this.niSerialCertifCa; + @Column(name = "DS_SERIAL_CERTIF_CA") + public String getDsSerialCertifCa() { + return this.dsSerialCertifCa; } - public void setNiSerialCertifCa(BigDecimal niSerialCertifCa) { - this.niSerialCertifCa = niSerialCertifCa; + public void setDsSerialCertifCa(String dsSerialCertifCa) { + this.dsSerialCertifCa = dsSerialCertifCa; } - @Column(name = "NI_SERIAL_CERTIF_CRL") - public BigDecimal getNiSerialCertifCrl() { - return this.niSerialCertifCrl; + @Column(name = "DS_SERIAL_CERTIF_CRL") + public String getDsSerialCertifCrl() { + return this.dsSerialCertifCrl; } - public void setNiSerialCertifCrl(BigDecimal niSerialCertifCrl) { - this.niSerialCertifCrl = niSerialCertifCrl; + public void setDsSerialCertifCrl(String dsSerialCertifCrl) { + this.dsSerialCertifCrl = dsSerialCertifCrl; } - @Column(name = "NI_SERIAL_CRL") - public BigDecimal getNiSerialCrl() { - return this.niSerialCrl; + @Column(name = "DS_SERIAL_CRL") + public String getDsSerialCrl() { + return this.dsSerialCrl; } - public void setNiSerialCrl(BigDecimal niSerialCrl) { - this.niSerialCrl = niSerialCrl; + public void setDsSerialCrl(String dsSerialCrl) { + this.dsSerialCrl = dsSerialCrl; } @Column(name = "PG_CERTIF_CA") @@ -179,13 +179,13 @@ public void setDlDnIssuerCertifOcsp(String dlDnIssuerCertifOcsp) { this.dlDnIssuerCertifOcsp = dlDnIssuerCertifOcsp; } - @Column(name = "NI_SERIAL_CERTIF_OCSP") - public BigDecimal getNiSerialCertifOcsp() { - return niSerialCertifOcsp; + @Column(name = "DS_SERIAL_CERTIF_OCSP") + public String getDsSerialCertifOcsp() { + return dsSerialCertifOcsp; } - public void setNiSerialCertifOcsp(BigDecimal niSerialCertifOcsp) { - this.niSerialCertifOcsp = niSerialCertifOcsp; + public void setDsSerialCertifOcsp(String dsSerialCertifOcsp) { + this.dsSerialCertifOcsp = dsSerialCertifOcsp; } @Temporal(TemporalType.TIMESTAMP) diff --git a/sacer-jpa/src/main/java/it/eng/parer/viewEntity/AroVVisFirmaComp.java b/sacer-jpa/src/main/java/it/eng/parer/viewEntity/AroVVisFirmaComp.java index cc708074..bbb65f82 100644 --- a/sacer-jpa/src/main/java/it/eng/parer/viewEntity/AroVVisFirmaComp.java +++ b/sacer-jpa/src/main/java/it/eng/parer/viewEntity/AroVVisFirmaComp.java @@ -98,8 +98,8 @@ public class AroVVisFirmaComp implements Serializable { private String msgEsitoOcspDtVers; private String msgEsitoCrlVol; private BigDecimal niOrdCompDoc; - private BigDecimal niSerialCertifCa; - private BigDecimal niSerialCertifFirmatario; + private String dsSerialCertifCa; + private String dsSerialCertifFirmatario; private String nmAmbiente; private String nmCognomeFirmatario; private String nmCognomeFirmatarioPadre; @@ -117,10 +117,10 @@ public class AroVVisFirmaComp implements Serializable { private BigDecimal pgBusta; private BigDecimal pgDoc; private BigDecimal pgFirma; - private BigDecimal serialCaCrl; - private BigDecimal serialCrl; - private BigDecimal serialCrlDtVers; - private BigDecimal serialCrlVol; + private String serialCaCrl; + private String serialCrl; + private String serialCrlDtVers; + private String serialCrlVol; private String tiAnnulDoc; private String tiAnnulUnitaDoc; private String tiDoc; @@ -689,22 +689,22 @@ public void setNiOrdCompDoc(BigDecimal niOrdCompDoc) { this.niOrdCompDoc = niOrdCompDoc; } - @Column(name = "NI_SERIAL_CERTIF_CA") - public BigDecimal getNiSerialCertifCa() { - return this.niSerialCertifCa; + @Column(name = "DS_SERIAL_CERTIF_CA") + public String getDsSerialCertifCa() { + return this.dsSerialCertifCa; } - public void setNiSerialCertifCa(BigDecimal niSerialCertifCa) { - this.niSerialCertifCa = niSerialCertifCa; + public void setDsSerialCertifCa(String dsSerialCertifCa) { + this.dsSerialCertifCa = dsSerialCertifCa; } - @Column(name = "NI_SERIAL_CERTIF_FIRMATARIO") - public BigDecimal getNiSerialCertifFirmatario() { - return this.niSerialCertifFirmatario; + @Column(name = "DS_SERIAL_CERTIF_FIRMATARIO") + public String getDsSerialCertifFirmatario() { + return this.dsSerialCertifFirmatario; } - public void setNiSerialCertifFirmatario(BigDecimal niSerialCertifFirmatario) { - this.niSerialCertifFirmatario = niSerialCertifFirmatario; + public void setDsSerialCertifFirmatario(String dsSerialCertifFirmatario) { + this.dsSerialCertifFirmatario = dsSerialCertifFirmatario; } @Column(name = "NM_AMBIENTE") @@ -861,38 +861,38 @@ public void setPgFirma(BigDecimal pgFirma) { } @Column(name = "SERIAL_CA_CRL") - public BigDecimal getSerialCaCrl() { + public String getSerialCaCrl() { return this.serialCaCrl; } - public void setSerialCaCrl(BigDecimal serialCaCrl) { + public void setSerialCaCrl(String serialCaCrl) { this.serialCaCrl = serialCaCrl; } @Column(name = "SERIAL_CRL") - public BigDecimal getSerialCrl() { + public String getSerialCrl() { return this.serialCrl; } - public void setSerialCrl(BigDecimal serialCrl) { + public void setSerialCrl(String serialCrl) { this.serialCrl = serialCrl; } @Column(name = "SERIAL_CRL_DT_VERS") - public BigDecimal getSerialCrlDtVers() { + public String getSerialCrlDtVers() { return this.serialCrlDtVers; } - public void setSerialCrlDtVers(BigDecimal serialCrlDtVers) { + public void setSerialCrlDtVers(String serialCrlDtVers) { this.serialCrlDtVers = serialCrlDtVers; } @Column(name = "SERIAL_CRL_VOL") - public BigDecimal getSerialCrlVol() { + public String getSerialCrlVol() { return this.serialCrlVol; } - public void setSerialCrlVol(BigDecimal serialCrlVol) { + public void setSerialCrlVol(String serialCrlVol) { this.serialCrlVol = serialCrlVol; } @@ -1042,7 +1042,7 @@ public void setIssuerCertifOcsp(String issuerCertiftOcsp) { this.issuerCertiftOcsp = issuerCertiftOcsp; } - @Column(name = "SERIAL_CERTIF_OCSP", columnDefinition = "NUMBER") + @Column(name = "SERIAL_CERTIF_OCSP") public String getSerialCertifOcsp() { return this.serialCertifOcsp; } @@ -1069,7 +1069,7 @@ public void setIssuerCertifOcspDtVers(String issuerCertiftOcspDtVers) { this.issuerCertiftOcspDtVers = issuerCertiftOcspDtVers; } - @Column(name = "SERIAL_CERTIF_OCSP_DT_VERS", columnDefinition = "NUMBER") + @Column(name = "SERIAL_CERTIF_OCSP_DT_VERS") public String getSerialCertifOcspDtVers() { return this.serialCertifOcspDtVers; } diff --git a/sacer-slg/pom.xml b/sacer-slg/pom.xml index c37d114a..c558c7b0 100644 --- a/sacer-slg/pom.xml +++ b/sacer-slg/pom.xml @@ -3,7 +3,7 @@ sacer-jboss it.eng.parer - 10.3.2-SNAPSHOT + 10.4.0 sacer-jboss-slg diff --git a/sacer-slg/src/main/java/it/eng/parer/slite/gen/tablebean/AroLogStatoConservUdRowBean.java b/sacer-slg/src/main/java/it/eng/parer/slite/gen/tablebean/AroLogStatoConservUdRowBean.java new file mode 100644 index 00000000..0fb349ba --- /dev/null +++ b/sacer-slg/src/main/java/it/eng/parer/slite/gen/tablebean/AroLogStatoConservUdRowBean.java @@ -0,0 +1,180 @@ +package it.eng.parer.slite.gen.tablebean; + +import it.eng.spagoLite.db.base.BaseRowInterface; +import it.eng.spagoLite.db.base.JEEBaseRowInterface; +import it.eng.spagoLite.db.base.row.BaseRow; +import it.eng.spagoLite.db.oracle.bean.column.TableDescriptor; +import it.eng.parer.entity.AroLogStatoConservUd; +import it.eng.parer.entity.AroUnitaDoc; +import it.eng.parer.entity.OrgSubStrut; + +import java.math.BigDecimal; +import java.sql.Timestamp; + +/** + * RowBean per la tabella Aro_Log_Stato_Conserv_Ud + * + */ +public class AroLogStatoConservUdRowBean extends BaseRow implements BaseRowInterface, JEEBaseRowInterface { + + /* + * @Generated( value = "it.eg.dbtool.db.oracle.beangen.Oracle4JPAClientBeanGen$TableBeanWriter", comments = + * "This class was generated by OraTool", date = "Wednesday, 20 March 2024 20:25" ) + */ + + public static AroLogStatoConservUdTableDescriptor TABLE_DESCRIPTOR = new AroLogStatoConservUdTableDescriptor(); + + public AroLogStatoConservUdRowBean() { + super(); + } + + public TableDescriptor getTableDescriptor() { + return TABLE_DESCRIPTOR; + } + + // getter e setter + public BigDecimal getIdLogStatoConservUd() { + return getBigDecimal("id_log_stato_conserv_ud"); + } + + public void setIdLogStatoConservUd(BigDecimal id_log_stato_conserv_ud) { + setObject("id_log_stato_conserv_ud", id_log_stato_conserv_ud); + } + + public BigDecimal getIdUnitaDoc() { + return getBigDecimal("id_unita_doc"); + } + + public void setIdUnitaDoc(BigDecimal id_unita_doc) { + setObject("id_unita_doc", id_unita_doc); + } + + public BigDecimal getIdSubStrut() { + return getBigDecimal("id_sub_strut"); + } + + public void setIdSubStrut(BigDecimal id_sub_strut) { + setObject("id_sub_strut", id_sub_strut); + } + + public Timestamp getDtStato() { + return getTimestamp("dt_stato"); + } + + public void setDtStato(Timestamp dt_stato) { + setObject("dt_stato", dt_stato); + } + + public String getTiEvento() { + return getString("ti_evento"); + } + + public void setTiEvento(String ti_evento) { + setObject("ti_evento", ti_evento); + } + + public String getTiMod() { + return getString("ti_mod"); + } + + public void setTiMod(String ti_mod) { + setObject("ti_mod", ti_mod); + } + + public String getTiStatoConservazione() { + return getString("ti_stato_conservazione"); + } + + public void setTiStatoConservazione(String ti_stato_conservazione) { + setObject("ti_stato_conservazione", ti_stato_conservazione); + } + + public String getNmAgente() { + return getString("nm_agente"); + } + + public void setNmAgente(String nm_agente) { + setObject("nm_agente", nm_agente); + } + + public BigDecimal getAaKeyUnitaDoc() { + return getBigDecimal("aa_key_unita_doc"); + } + + public void setAaKeyUnitaDoc(BigDecimal aa_key_unita_doc) { + setObject("aa_key_unita_doc", aa_key_unita_doc); + } + + @Override + public void entityToRowBean(Object obj) { + AroLogStatoConservUd entity = (AroLogStatoConservUd) obj; + this.setIdLogStatoConservUd(new BigDecimal(entity.getIdLogStatoConservUd())); + if (entity.getAroUnitaDoc() != null) { + this.setIdUnitaDoc(new BigDecimal(entity.getAroUnitaDoc().getIdUnitaDoc())); + } + if (entity.getOrgSubStrut() != null) { + this.setIdSubStrut(new BigDecimal(entity.getOrgSubStrut().getIdSubStrut())); + } + if (entity.getDtStato() != null) { + this.setDtStato(new Timestamp(entity.getDtStato().getTime())); + } + this.setTiEvento(entity.getTiEvento()); + this.setTiStatoConservazione(entity.getTiStatoConservazione()); + this.setNmAgente(entity.getNmAgente()); + this.setTiMod(entity.getTiMod()); + this.setAaKeyUnitaDoc(entity.getAaKeyUnitaDoc()); + } + + @Override + public AroLogStatoConservUd rowBeanToEntity() { + AroLogStatoConservUd entity = new AroLogStatoConservUd(); + if (this.getIdLogStatoConservUd() != null) { + entity.setIdLogStatoConservUd(this.getIdLogStatoConservUd().longValue()); + } + if (this.getIdUnitaDoc() != null) { + if (entity.getAroUnitaDoc() == null) { + entity.setAroUnitaDoc(new AroUnitaDoc()); + } + entity.getAroUnitaDoc().setIdUnitaDoc(this.getIdUnitaDoc().longValue()); + } + if (this.getIdSubStrut() != null) { + if (entity.getOrgSubStrut() == null) { + entity.setOrgSubStrut(new OrgSubStrut()); + } + entity.getOrgSubStrut().setIdSubStrut(this.getIdSubStrut().longValue()); + } + entity.setDtStato(this.getDtStato()); + entity.setTiEvento(this.getTiEvento()); + entity.setTiStatoConservazione(this.getTiStatoConservazione()); + entity.setNmAgente(this.getNmAgente()); + entity.setTiMod(this.getTiMod()); + entity.setAaKeyUnitaDoc(this.getAaKeyUnitaDoc()); + return entity; + } + + // gestione della paginazione + public void setRownum(Integer rownum) { + setObject("rownum", rownum); + } + + public Integer getRownum() { + return Integer.parseInt(getObject("rownum").toString()); + } + + public void setRnum(Integer rnum) { + setObject("rnum", rnum); + } + + public Integer getRnum() { + return Integer.parseInt(getObject("rnum").toString()); + } + + public void setNumrecords(Integer numRecords) { + setObject("numrecords", numRecords); + } + + public Integer getNumrecords() { + return Integer.parseInt(getObject("numrecords").toString()); + } + +} diff --git a/sacer-slg/src/main/java/it/eng/parer/slite/gen/tablebean/AroLogStatoConservUdTableBean.java b/sacer-slg/src/main/java/it/eng/parer/slite/gen/tablebean/AroLogStatoConservUdTableBean.java new file mode 100644 index 00000000..2b59dde0 --- /dev/null +++ b/sacer-slg/src/main/java/it/eng/parer/slite/gen/tablebean/AroLogStatoConservUdTableBean.java @@ -0,0 +1,37 @@ +package it.eng.parer.slite.gen.tablebean; + +import it.eng.spagoLite.db.base.table.AbstractBaseTable; +import it.eng.spagoLite.db.oracle.bean.column.TableDescriptor; + +import java.util.Iterator; + +/** + * TableBean per la tabella Aro_Log_Stato_Conserv_Ud + * + */ +public class AroLogStatoConservUdTableBean extends AbstractBaseTable { + + /* + * @Generated( value = "it.eg.dbtool.db.oracle.beangen.Oracle4JPAClientBeanGen$TableBeanWriter", comments = + * "This class was generated by OraTool", date = "Wednesday, 20 March 2024 20:25" ) + */ + + public static AroLogStatoConservUdTableDescriptor TABLE_DESCRIPTOR = new AroLogStatoConservUdTableDescriptor(); + + public AroLogStatoConservUdTableBean() { + super(); + } + + protected AroLogStatoConservUdRowBean createRow() { + return new AroLogStatoConservUdRowBean(); + } + + public TableDescriptor getTableDescriptor() { + return TABLE_DESCRIPTOR; + } + + @Deprecated + public Iterator getRowsIterator() { + return iterator(); + } +} diff --git a/sacer-slg/src/main/java/it/eng/parer/slite/gen/tablebean/AroLogStatoConservUdTableDescriptor.java b/sacer-slg/src/main/java/it/eng/parer/slite/gen/tablebean/AroLogStatoConservUdTableDescriptor.java new file mode 100644 index 00000000..8d3e85b3 --- /dev/null +++ b/sacer-slg/src/main/java/it/eng/parer/slite/gen/tablebean/AroLogStatoConservUdTableDescriptor.java @@ -0,0 +1,62 @@ +package it.eng.parer.slite.gen.tablebean; + +import it.eng.spagoLite.db.oracle.bean.column.ColumnDescriptor; +import it.eng.spagoLite.db.oracle.bean.column.TableDescriptor; + +import java.sql.Types; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * @author Sloth + * + * Bean per la tabella Aro_Log_Stato_Conserv_Ud + * + */ +public class AroLogStatoConservUdTableDescriptor extends TableDescriptor { + + /* + * @Generated( value = "it.eg.dbtool.db.oracle.beangen.Oracle4JPAClientBeanGen$TableBeanWriter", comments = + * "This class was generated by OraTool", date = "Wednesday, 20 March 2024 20:25" ) + */ + + public static final String SELECT = "Select * from Aro_Log_Stato_Conserv_Ud /**/"; + public static final String TABLE_NAME = "Aro_Log_Stato_Conserv_Ud"; + public static final String COL_ID_LOG_STATO_CONSERV_UD = "id_log_stato_conserv_ud"; + public static final String COL_AA_KEY_UNITA_DOC = "aa_key_unita_doc"; + public static final String COL_ID_UNITA_DOC = "id_unita_doc"; + public static final String COL_ID_SUB_STRUT = "id_sub_strut"; + public static final String COL_DT_STATO = "dt_stato"; + public static final String COL_TI_EVENTO = "ti_evento"; + public static final String COL_TI_MOD = "ti_mod"; + public static final String COL_TI_STATO_CONSERVAZIONE = "ti_stato_conservazione"; + public static final String COL_NM_AGENTE = "nm_agente"; + + private static Map map = new LinkedHashMap(); + + static { + map.put(COL_ID_LOG_STATO_CONSERV_UD, + new ColumnDescriptor(COL_ID_LOG_STATO_CONSERV_UD, Types.DECIMAL, 22, true)); + map.put(COL_AA_KEY_UNITA_DOC, new ColumnDescriptor(COL_AA_KEY_UNITA_DOC, Types.DECIMAL, 22, false)); + map.put(COL_ID_UNITA_DOC, new ColumnDescriptor(COL_ID_UNITA_DOC, Types.DECIMAL, 22, false)); + map.put(COL_ID_SUB_STRUT, new ColumnDescriptor(COL_ID_SUB_STRUT, Types.DECIMAL, 22, false)); + map.put(COL_DT_STATO, new ColumnDescriptor(COL_DT_STATO, Types.TIMESTAMP, 7, false)); + map.put(COL_TI_EVENTO, new ColumnDescriptor(COL_TI_EVENTO, Types.VARCHAR, 256, false)); + map.put(COL_TI_STATO_CONSERVAZIONE, new ColumnDescriptor(COL_TI_STATO_CONSERVAZIONE, Types.VARCHAR, 30, false)); + map.put(COL_NM_AGENTE, new ColumnDescriptor(COL_NM_AGENTE, Types.VARCHAR, 256, false)); + map.put(COL_TI_MOD, new ColumnDescriptor(COL_TI_MOD, Types.VARCHAR, 256, false)); + } + + public Map getColumnMap() { + return map; + } + + public String getTableName() { + return TABLE_NAME; + } + + public String getStatement() { + return SELECT; + } + +} diff --git a/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVLisCertifCaFirmaCompRowBean.java b/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVLisCertifCaFirmaCompRowBean.java index 6588d735..44f726fb 100644 --- a/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVLisCertifCaFirmaCompRowBean.java +++ b/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVLisCertifCaFirmaCompRowBean.java @@ -87,12 +87,12 @@ public void setDlDnIssuerCertifCa(String dlDnIssuerCertifCa) { setObject("dl_dn_issuer_certif_ca", dlDnIssuerCertifCa); } - public BigDecimal getNiSerialCertifCa() { - return getBigDecimal("ni_serial_certif_ca"); + public String getDsSerialCertifCa() { + return getString("ds_serial_certif_ca"); } - public void setNiSerialCertifCa(BigDecimal niSerialCertifCa) { - setObject("ni_serial_certif_ca", niSerialCertifCa); + public void setDsSerialCertifCa(String dsSerialCertifCa) { + setObject("ds_serial_certif_ca", dsSerialCertifCa); } public Timestamp getDtIniValCertifCa() { @@ -119,20 +119,20 @@ public void setDlDnIssuerCrl(String dlDnIssuerCrl) { setObject("dl_dn_issuer_crl", dlDnIssuerCrl); } - public BigDecimal getNiSerialCertifCrl() { - return getBigDecimal("ni_serial_certif_crl"); + public String getDsSerialCertifCrl() { + return getString("ds_serial_certif_crl"); } - public void setNiSerialCertifCrl(BigDecimal niSerialCertifCrl) { - setObject("ni_serial_certif_crl", niSerialCertifCrl); + public void setDsSerialCertifCrl(String dsSerialCertifCrl) { + setObject("ds_serial_certif_crl", dsSerialCertifCrl); } - public BigDecimal getNiSerialCrl() { - return getBigDecimal("ni_serial_crl"); + public String getDsSerialCrl() { + return getString("ds_serial_crl"); } - public void setNiSerialCrl(BigDecimal niSerialCrl) { - setObject("ni_serial_crl", niSerialCrl); + public void setDsSerialCrl(String dsSerialCrl) { + setObject("ds_serial_crl", dsSerialCrl); } public Timestamp getDtScadCrl() { @@ -151,12 +151,12 @@ public void setDlDnIssuerCertifOcsp(String dl_dn_issuer_certif_ocsp) { setObject("dl_dn_issuer_certif_ocsp", dl_dn_issuer_certif_ocsp); } - public BigDecimal getNiSerialCertifOcsp() { - return getBigDecimal("ni_serial_certif_ocsp"); + public String getDsSerialCertifOcsp() { + return getString("ds_serial_certif_ocsp"); } - public void setNiSerialCertifOcsp(BigDecimal ni_serial_certif_ocsp) { - setObject("ni_serial_certif_ocsp", ni_serial_certif_ocsp); + public void setDsSerialCertifOcsp(String ds_serial_certif_ocsp) { + setObject("ds_serial_certif_ocsp", ds_serial_certif_ocsp); } public Timestamp getDtIniValCertifOcsp() { @@ -183,7 +183,7 @@ public void entityToRowBean(Object obj) { this.setIdContrFirmaComp(entity.getIdContrFirmaComp()); this.setPgCertifCa(entity.getPgCertifCa()); this.setDlDnIssuerCertifCa(entity.getDlDnIssuerCertifCa()); - this.setNiSerialCertifCa(entity.getNiSerialCertifCa()); + this.setDsSerialCertifCa(entity.getDsSerialCertifCa()); if (entity.getDtIniValCertifCa() != null) { this.setDtIniValCertifCa(new Timestamp(entity.getDtIniValCertifCa().getTime())); } @@ -191,13 +191,13 @@ public void entityToRowBean(Object obj) { this.setDtFinValCertifCa(new Timestamp(entity.getDtFinValCertifCa().getTime())); } this.setDlDnIssuerCrl(entity.getDlDnIssuerCrl()); - this.setNiSerialCertifCrl(entity.getNiSerialCertifCrl()); - this.setNiSerialCrl(entity.getNiSerialCrl()); + this.setDsSerialCertifCrl(entity.getDsSerialCertifCrl()); + this.setDsSerialCrl(entity.getDsSerialCrl()); if (entity.getDtScadCrl() != null) { this.setDtScadCrl(new Timestamp(entity.getDtScadCrl().getTime())); } this.setDlDnIssuerCertifOcsp(entity.getDlDnIssuerCertifOcsp()); - this.setNiSerialCertifOcsp(entity.getNiSerialCertifOcsp()); + this.setDsSerialCertifOcsp(entity.getDsSerialCertifOcsp()); if (entity.getDtIniValCertifOcsp() != null) { this.setDtIniValCertifOcsp(new Timestamp(entity.getDtIniValCertifOcsp().getTime())); } @@ -214,15 +214,15 @@ public AroVLisCertifCaFirmaComp rowBeanToEntity() { entity.setIdContrFirmaComp(this.getIdContrFirmaComp()); entity.setPgCertifCa(this.getPgCertifCa()); entity.setDlDnIssuerCertifCa(this.getDlDnIssuerCertifCa()); - entity.setNiSerialCertifCa(this.getNiSerialCertifCa()); + entity.setDsSerialCertifCa(this.getDsSerialCertifCa()); entity.setDtIniValCertifCa(this.getDtIniValCertifCa()); entity.setDtFinValCertifCa(this.getDtFinValCertifCa()); entity.setDlDnIssuerCrl(this.getDlDnIssuerCrl()); - entity.setNiSerialCertifCrl(this.getNiSerialCertifCrl()); - entity.setNiSerialCrl(this.getNiSerialCrl()); + entity.setDsSerialCertifCrl(this.getDsSerialCertifCrl()); + entity.setDsSerialCrl(this.getDsSerialCrl()); entity.setDtScadCrl(this.getDtScadCrl()); entity.setDlDnIssuerCertifOcsp(this.getDlDnIssuerCertifOcsp()); - entity.setNiSerialCertifOcsp(this.getNiSerialCertifOcsp()); + entity.setDsSerialCertifOcsp(this.getDsSerialCertifOcsp()); entity.setDtIniValCertifOcsp(this.getDtIniValCertifOcsp()); entity.setDtFinValCertifOcsp(this.getDtFinValCertifOcsp()); return entity; diff --git a/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVLisCertifCaFirmaCompTableDescriptor.java b/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVLisCertifCaFirmaCompTableDescriptor.java index a706537f..048c33e3 100644 --- a/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVLisCertifCaFirmaCompTableDescriptor.java +++ b/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVLisCertifCaFirmaCompTableDescriptor.java @@ -44,12 +44,12 @@ public class AroVLisCertifCaFirmaCompTableDescriptor extends TableDescriptor { public static final String COL_ID_CONTR_FIRMA_COMP = "id_contr_firma_comp"; public static final String COL_PG_CERTIF_CA = "pg_certif_ca"; public static final String COL_DL_DN_ISSUER_CERTIF_CA = "dl_dn_issuer_certif_ca"; - public static final String COL_NI_SERIAL_CERTIF_CA = "ni_serial_certif_ca"; + public static final String COL_DS_SERIAL_CERTIF_CA = "ds_serial_certif_ca"; public static final String COL_DT_INI_VAL_CERTIF_CA = "dt_ini_val_certif_ca"; public static final String COL_DT_FIN_VAL_CERTIF_CA = "dt_fin_val_certif_ca"; public static final String COL_DL_DN_ISSUER_CRL = "dl_dn_issuer_crl"; - public static final String COL_NI_SERIAL_CERTIF_CRL = "ni_serial_certif_crl"; - public static final String COL_NI_SERIAL_CRL = "ni_serial_crl"; + public static final String COL_DS_SERIAL_CERTIF_CRL = "ds_serial_certif_crl"; + public static final String COL_DS_SERIAL_CRL = "ds_serial_crl"; public static final String COL_DT_SCAD_CRL = "dt_scad_crl"; private static Map map = new LinkedHashMap(); @@ -62,12 +62,12 @@ public class AroVLisCertifCaFirmaCompTableDescriptor extends TableDescriptor { map.put(COL_PG_CERTIF_CA, new ColumnDescriptor(COL_PG_CERTIF_CA, Types.DECIMAL, 22, true)); map.put(COL_DL_DN_ISSUER_CERTIF_CA, new ColumnDescriptor(COL_DL_DN_ISSUER_CERTIF_CA, Types.VARCHAR, 1024, true)); - map.put(COL_NI_SERIAL_CERTIF_CA, new ColumnDescriptor(COL_NI_SERIAL_CERTIF_CA, Types.DECIMAL, 22, true)); + map.put(COL_DS_SERIAL_CERTIF_CA, new ColumnDescriptor(COL_DS_SERIAL_CERTIF_CA, Types.VARCHAR, 100, true)); map.put(COL_DT_INI_VAL_CERTIF_CA, new ColumnDescriptor(COL_DT_INI_VAL_CERTIF_CA, Types.TIMESTAMP, 7, true)); map.put(COL_DT_FIN_VAL_CERTIF_CA, new ColumnDescriptor(COL_DT_FIN_VAL_CERTIF_CA, Types.TIMESTAMP, 7, true)); map.put(COL_DL_DN_ISSUER_CRL, new ColumnDescriptor(COL_DL_DN_ISSUER_CRL, Types.VARCHAR, 1024, true)); - map.put(COL_NI_SERIAL_CERTIF_CRL, new ColumnDescriptor(COL_NI_SERIAL_CERTIF_CRL, Types.DECIMAL, 22, true)); - map.put(COL_NI_SERIAL_CRL, new ColumnDescriptor(COL_NI_SERIAL_CRL, Types.DECIMAL, 22, true)); + map.put(COL_DS_SERIAL_CERTIF_CRL, new ColumnDescriptor(COL_DS_SERIAL_CERTIF_CRL, Types.VARCHAR, 100, true)); + map.put(COL_DS_SERIAL_CRL, new ColumnDescriptor(COL_DS_SERIAL_CRL, Types.VARCHAR, 100, true)); map.put(COL_DT_SCAD_CRL, new ColumnDescriptor(COL_DT_SCAD_CRL, Types.TIMESTAMP, 7, true)); } diff --git a/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVLisCertifCaMarcaCompRowBean.java b/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVLisCertifCaMarcaCompRowBean.java index 8799c67b..df2e80b9 100644 --- a/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVLisCertifCaMarcaCompRowBean.java +++ b/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVLisCertifCaMarcaCompRowBean.java @@ -87,12 +87,12 @@ public void setDlDnIssuerCertifCa(String dlDnIssuerCertifCa) { setObject("dl_dn_issuer_certif_ca", dlDnIssuerCertifCa); } - public BigDecimal getNiSerialCertifCa() { - return getBigDecimal("ni_serial_certif_ca"); + public String getDsSerialCertifCa() { + return getString("ds_serial_certif_ca"); } - public void setNiSerialCertifCa(BigDecimal niSerialCertifCa) { - setObject("ni_serial_certif_ca", niSerialCertifCa); + public void setDsSerialCertifCa(String dsSerialCertifCa) { + setObject("ds_serial_certif_ca", dsSerialCertifCa); } public Timestamp getDtIniValCertifCa() { @@ -119,20 +119,20 @@ public void setDlDnIssuerCrl(String dlDnIssuerCrl) { setObject("dl_dn_issuer_crl", dlDnIssuerCrl); } - public BigDecimal getNiSerialCertifCrl() { - return getBigDecimal("ni_serial_certif_crl"); + public String getDsSerialCertifCrl() { + return getString("ds_serial_certif_crl"); } - public void setNiSerialCertifCrl(BigDecimal niSerialCertifCrl) { - setObject("ni_serial_certif_crl", niSerialCertifCrl); + public void setDsSerialCertifCrl(String dsSerialCertifCrl) { + setObject("ds_serial_certif_crl", dsSerialCertifCrl); } - public BigDecimal getNiSerialCrl() { - return getBigDecimal("ni_serial_crl"); + public String getDsSerialCrl() { + return getString("ds_serial_crl"); } - public void setNiSerialCrl(BigDecimal niSerialCrl) { - setObject("ni_serial_crl", niSerialCrl); + public void setDsSerialCrl(String niSerialCrl) { + setObject("ds_serial_crl", niSerialCrl); } public Timestamp getDtScadCrl() { @@ -151,12 +151,12 @@ public void setDlDnIssuerCertifOcsp(String dl_dn_issuer_certif_ocsp) { setObject("dl_dn_issuer_certif_ocsp", dl_dn_issuer_certif_ocsp); } - public BigDecimal getNiSerialCertifOcsp() { - return getBigDecimal("ni_serial_certif_ocsp"); + public String getDsSerialCertifOcsp() { + return getString("ds_serial_certif_ocsp"); } - public void setNiSerialCertifOcsp(BigDecimal ni_serial_certif_ocsp) { - setObject("ni_serial_certif_ocsp", ni_serial_certif_ocsp); + public void setDsSerialCertifOcsp(String ds_serial_certif_ocsp) { + setObject("ds_serial_certif_ocsp", ds_serial_certif_ocsp); } public Timestamp getDtIniValCertifOcsp() { @@ -183,7 +183,7 @@ public void entityToRowBean(Object obj) { this.setIdContrMarcaComp(entity.getIdContrMarcaComp()); this.setPgCertifCa(entity.getPgCertifCa()); this.setDlDnIssuerCertifCa(entity.getDlDnIssuerCertifCa()); - this.setNiSerialCertifCa(entity.getNiSerialCertifCa()); + this.setDsSerialCertifCa(entity.getDsSerialCertifCa()); if (entity.getDtIniValCertifCa() != null) { this.setDtIniValCertifCa(new Timestamp(entity.getDtIniValCertifCa().getTime())); } @@ -191,13 +191,13 @@ public void entityToRowBean(Object obj) { this.setDtFinValCertifCa(new Timestamp(entity.getDtFinValCertifCa().getTime())); } this.setDlDnIssuerCrl(entity.getDlDnIssuerCrl()); - this.setNiSerialCertifCrl(entity.getNiSerialCertifCrl()); - this.setNiSerialCrl(entity.getNiSerialCrl()); + this.setDsSerialCertifCrl(entity.getDsSerialCertifCrl()); + this.setDsSerialCrl(entity.getDsSerialCertifCrl()); if (entity.getDtScadCrl() != null) { this.setDtScadCrl(new Timestamp(entity.getDtScadCrl().getTime())); } this.setDlDnIssuerCertifOcsp(entity.getDlDnIssuerCertifOcsp()); - this.setNiSerialCertifOcsp(entity.getNiSerialCertifOcsp()); + this.setDsSerialCertifOcsp(entity.getDsSerialCertifOcsp()); if (entity.getDtIniValCertifOcsp() != null) { this.setDtIniValCertifOcsp(new Timestamp(entity.getDtIniValCertifOcsp().getTime())); } @@ -214,15 +214,15 @@ public AroVLisCertifCaMarcaComp rowBeanToEntity() { entity.setIdContrMarcaComp(this.getIdContrMarcaComp()); entity.setPgCertifCa(this.getPgCertifCa()); entity.setDlDnIssuerCertifCa(this.getDlDnIssuerCertifCa()); - entity.setNiSerialCertifCa(this.getNiSerialCertifCa()); + entity.setDsSerialCertifCa(this.getDsSerialCertifCa()); entity.setDtIniValCertifCa(this.getDtIniValCertifCa()); entity.setDtFinValCertifCa(this.getDtFinValCertifCa()); entity.setDlDnIssuerCrl(this.getDlDnIssuerCrl()); - entity.setNiSerialCertifCrl(this.getNiSerialCertifCrl()); - entity.setNiSerialCrl(this.getNiSerialCrl()); + entity.setDsSerialCertifCrl(this.getDsSerialCertifCrl()); + entity.setDsSerialCrl(this.getDsSerialCrl()); entity.setDtScadCrl(this.getDtScadCrl()); entity.setDlDnIssuerCertifOcsp(this.getDlDnIssuerCertifOcsp()); - entity.setNiSerialCertifOcsp(this.getNiSerialCertifOcsp()); + entity.setDsSerialCertifOcsp(this.getDsSerialCertifOcsp()); entity.setDtIniValCertifOcsp(this.getDtIniValCertifOcsp()); entity.setDtFinValCertifOcsp(this.getDtFinValCertifOcsp()); return entity; diff --git a/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVLisCertifCaMarcaCompTableDescriptor.java b/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVLisCertifCaMarcaCompTableDescriptor.java index 7e397677..c3d24ce2 100644 --- a/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVLisCertifCaMarcaCompTableDescriptor.java +++ b/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVLisCertifCaMarcaCompTableDescriptor.java @@ -44,12 +44,12 @@ public class AroVLisCertifCaMarcaCompTableDescriptor extends TableDescriptor { public static final String COL_ID_CONTR_MARCA_COMP = "id_contr_marca_comp"; public static final String COL_PG_CERTIF_CA = "pg_certif_ca"; public static final String COL_DL_DN_ISSUER_CERTIF_CA = "dl_dn_issuer_certif_ca"; - public static final String COL_NI_SERIAL_CERTIF_CA = "ni_serial_certif_ca"; + public static final String COL_DS_SERIAL_CERTIF_CA = "ds_serial_certif_ca"; public static final String COL_DT_INI_VAL_CERTIF_CA = "dt_ini_val_certif_ca"; public static final String COL_DT_FIN_VAL_CERTIF_CA = "dt_fin_val_certif_ca"; public static final String COL_DL_DN_ISSUER_CRL = "dl_dn_issuer_crl"; - public static final String COL_NI_SERIAL_CERTIF_CRL = "ni_serial_certif_crl"; - public static final String COL_NI_SERIAL_CRL = "ni_serial_crl"; + public static final String COL_DS_SERIAL_CERTIF_CRL = "ds_serial_certif_crl"; + public static final String COL_DS_SERIAL_CRL = "ds_serial_crl"; public static final String COL_DT_SCAD_CRL = "dt_scad_crl"; private static Map map = new LinkedHashMap(); @@ -62,12 +62,12 @@ public class AroVLisCertifCaMarcaCompTableDescriptor extends TableDescriptor { map.put(COL_PG_CERTIF_CA, new ColumnDescriptor(COL_PG_CERTIF_CA, Types.DECIMAL, 22, true)); map.put(COL_DL_DN_ISSUER_CERTIF_CA, new ColumnDescriptor(COL_DL_DN_ISSUER_CERTIF_CA, Types.VARCHAR, 1024, true)); - map.put(COL_NI_SERIAL_CERTIF_CA, new ColumnDescriptor(COL_NI_SERIAL_CERTIF_CA, Types.DECIMAL, 22, true)); + map.put(COL_DS_SERIAL_CERTIF_CA, new ColumnDescriptor(COL_DS_SERIAL_CERTIF_CA, Types.VARCHAR, 100, true)); map.put(COL_DT_INI_VAL_CERTIF_CA, new ColumnDescriptor(COL_DT_INI_VAL_CERTIF_CA, Types.TIMESTAMP, 7, true)); map.put(COL_DT_FIN_VAL_CERTIF_CA, new ColumnDescriptor(COL_DT_FIN_VAL_CERTIF_CA, Types.TIMESTAMP, 7, true)); map.put(COL_DL_DN_ISSUER_CRL, new ColumnDescriptor(COL_DL_DN_ISSUER_CRL, Types.VARCHAR, 1024, true)); - map.put(COL_NI_SERIAL_CERTIF_CRL, new ColumnDescriptor(COL_NI_SERIAL_CERTIF_CRL, Types.DECIMAL, 22, true)); - map.put(COL_NI_SERIAL_CRL, new ColumnDescriptor(COL_NI_SERIAL_CRL, Types.DECIMAL, 22, true)); + map.put(COL_DS_SERIAL_CERTIF_CRL, new ColumnDescriptor(COL_DS_SERIAL_CERTIF_CRL, Types.VARCHAR, 100, true)); + map.put(COL_DS_SERIAL_CRL, new ColumnDescriptor(COL_DS_SERIAL_CRL, Types.VARCHAR, 100, true)); map.put(COL_DT_SCAD_CRL, new ColumnDescriptor(COL_DT_SCAD_CRL, Types.TIMESTAMP, 7, true)); } diff --git a/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVVisFirmaCompRowBean.java b/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVVisFirmaCompRowBean.java index be38d387..9a69525d 100644 --- a/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVVisFirmaCompRowBean.java +++ b/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVVisFirmaCompRowBean.java @@ -335,20 +335,20 @@ public void setIssuerCertifFirmatario(String issuerCertifFirmatario) { setObject("issuer_certif_firmatario", issuerCertifFirmatario); } - public BigDecimal getNiSerialCertifCa() { - return getBigDecimal("ni_serial_certif_ca"); + public String getDsSerialCertifCa() { + return getString("ds_serial_certif_ca"); } - public void setNiSerialCertifCa(BigDecimal niSerialCertifCa) { - setObject("ni_serial_certif_ca", niSerialCertifCa); + public void setDsSerialCertifCa(String dsSerialCertifCa) { + setObject("ds_serial_certif_ca", dsSerialCertifCa); } - public BigDecimal getNiSerialCertifFirmatario() { - return getBigDecimal("ni_serial_certif_firmatario"); + public String getDsSerialCertifFirmatario() { + return getString("ds_serial_certif_firmatario"); } - public void setNiSerialCertifFirmatario(BigDecimal niSerialCertifFirmatario) { - setObject("ni_serial_certif_firmatario", niSerialCertifFirmatario); + public void setDsSerialCertifFirmatario(String dsSerialCertifFirmatario) { + setObject("ds_serial_certif_firmatario", dsSerialCertifFirmatario); } public Timestamp getDtIniValCertifFirmatario() { @@ -527,19 +527,19 @@ public void setIssuerCrl(String issuerCrl) { setObject("issuer_crl", issuerCrl); } - public BigDecimal getSerialCaCrl() { - return getBigDecimal("serial_ca_crl"); + public String getSerialCaCrl() { + return getString("serial_ca_crl"); } - public void setSerialCaCrl(BigDecimal serialCaCrl) { + public void setSerialCaCrl(String serialCaCrl) { setObject("serial_ca_crl", serialCaCrl); } - public BigDecimal getSerialCrl() { - return getBigDecimal("serial_crl"); + public String getSerialCrl() { + return getString("serial_crl"); } - public void setSerialCrl(BigDecimal serialCrl) { + public void setSerialCrl(String serialCrl) { setObject("serial_crl", serialCrl); } @@ -655,11 +655,11 @@ public void setMsgEsitoCrlVol(String msgEsitoCrlVol) { setObject("msg_esito_crl_vol", msgEsitoCrlVol); } - public BigDecimal getSerialCrlVol() { - return getBigDecimal("serial_crl_vol"); + public String getSerialCrlVol() { + return getString("serial_crl_vol"); } - public void setSerialCrlVol(BigDecimal serialCrlVol) { + public void setSerialCrlVol(String serialCrlVol) { setObject("serial_crl_vol", serialCrlVol); } @@ -751,11 +751,11 @@ public void setMsgEsitoCrlDtVers(String msgEsitoCrlDtVers) { setObject("msg_esito_crl_dt_vers", msgEsitoCrlDtVers); } - public BigDecimal getSerialCrlDtVers() { - return getBigDecimal("serial_crl_dt_vers"); + public String getSerialCrlDtVers() { + return getString("serial_crl_dt_vers"); } - public void setSerialCrlDtVers(BigDecimal serialCrlDtVers) { + public void setSerialCrlDtVers(String serialCrlDtVers) { setObject("serial_crl_dt_vers", serialCrlDtVers); } @@ -906,8 +906,8 @@ public void entityToRowBean(Object obj) { this.setTiFormatoFirma(entity.getTiFormatoFirma()); this.setPgBusta(entity.getPgBusta()); this.setIssuerCertifFirmatario(entity.getIssuerCertifFirmatario()); - this.setNiSerialCertifCa(entity.getNiSerialCertifCa()); - this.setNiSerialCertifFirmatario(entity.getNiSerialCertifFirmatario()); + this.setDsSerialCertifCa(entity.getDsSerialCertifCa()); + this.setDsSerialCertifFirmatario(entity.getDsSerialCertifFirmatario()); if (entity.getDtIniValCertifFirmatario() != null) { this.setDtIniValCertifFirmatario(new Timestamp(entity.getDtIniValCertifFirmatario().getTime())); } @@ -1033,8 +1033,8 @@ public AroVVisFirmaComp rowBeanToEntity() { entity.setTiFormatoFirma(this.getTiFormatoFirma()); entity.setPgBusta(this.getPgBusta()); entity.setIssuerCertifFirmatario(this.getIssuerCertifFirmatario()); - entity.setNiSerialCertifCa(this.getNiSerialCertifCa()); - entity.setNiSerialCertifFirmatario(this.getNiSerialCertifFirmatario()); + entity.setDsSerialCertifCa(this.getDsSerialCertifCa()); + entity.setDsSerialCertifFirmatario(this.getDsSerialCertifFirmatario()); entity.setDtIniValCertifFirmatario(this.getDtIniValCertifFirmatario()); entity.setDtFinValCertifFirmatario(this.getDtFinValCertifFirmatario()); entity.setDtFirma(this.getDtFirma()); diff --git a/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVVisFirmaCompTableDescriptor.java b/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVVisFirmaCompTableDescriptor.java index e25348fc..a74979e7 100644 --- a/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVVisFirmaCompTableDescriptor.java +++ b/sacer-slg/src/main/java/it/eng/parer/slite/gen/viewbean/AroVVisFirmaCompTableDescriptor.java @@ -75,8 +75,8 @@ public class AroVVisFirmaCompTableDescriptor extends TableDescriptor { public static final String COL_TI_FORMATO_FIRMA = "ti_formato_firma"; public static final String COL_PG_BUSTA = "pg_busta"; public static final String COL_ISSUER_CERTIF_FIRMATARIO = "issuer_certif_firmatario"; - public static final String COL_NI_SERIAL_CERTIF_CA = "ni_serial_certif_ca"; - public static final String COL_NI_SERIAL_CERTIF_FIRMATARIO = "ni_serial_certif_firmatario"; + public static final String COL_DS_SERIAL_CERTIF_CA = "ds_serial_certif_ca"; + public static final String COL_DS_SERIAL_CERTIF_FIRMATARIO = "ds_serial_certif_firmatario"; public static final String COL_DT_INI_VAL_CERTIF_FIRMATARIO = "dt_ini_val_certif_firmatario"; public static final String COL_DT_FIN_VAL_CERTIF_FIRMATARIO = "dt_fin_val_certif_firmatario"; public static final String COL_DT_FIRMA = "dt_firma"; @@ -174,9 +174,9 @@ public class AroVVisFirmaCompTableDescriptor extends TableDescriptor { map.put(COL_PG_BUSTA, new ColumnDescriptor(COL_PG_BUSTA, Types.DECIMAL, 22, true)); map.put(COL_ISSUER_CERTIF_FIRMATARIO, new ColumnDescriptor(COL_ISSUER_CERTIF_FIRMATARIO, Types.VARCHAR, 1024, true)); - map.put(COL_NI_SERIAL_CERTIF_CA, new ColumnDescriptor(COL_NI_SERIAL_CERTIF_CA, Types.DECIMAL, 22, true)); - map.put(COL_NI_SERIAL_CERTIF_FIRMATARIO, - new ColumnDescriptor(COL_NI_SERIAL_CERTIF_FIRMATARIO, Types.DECIMAL, 22, true)); + map.put(COL_DS_SERIAL_CERTIF_CA, new ColumnDescriptor(COL_DS_SERIAL_CERTIF_CA, Types.VARCHAR, 100, true)); + map.put(COL_DS_SERIAL_CERTIF_FIRMATARIO, + new ColumnDescriptor(COL_DS_SERIAL_CERTIF_FIRMATARIO, Types.VARCHAR, 100, true)); map.put(COL_DT_INI_VAL_CERTIF_FIRMATARIO, new ColumnDescriptor(COL_DT_INI_VAL_CERTIF_FIRMATARIO, Types.TIMESTAMP, 7, true)); map.put(COL_DT_FIN_VAL_CERTIF_FIRMATARIO, @@ -206,8 +206,8 @@ public class AroVVisFirmaCompTableDescriptor extends TableDescriptor { map.put(COL_ESITO_CRL, new ColumnDescriptor(COL_ESITO_CRL, Types.VARCHAR, 30, true)); map.put(COL_MSG_ESITO_CRL, new ColumnDescriptor(COL_MSG_ESITO_CRL, Types.VARCHAR, 1024, true)); map.put(COL_ISSUER_CRL, new ColumnDescriptor(COL_ISSUER_CRL, Types.VARCHAR, 1024, true)); - map.put(COL_SERIAL_CA_CRL, new ColumnDescriptor(COL_SERIAL_CA_CRL, Types.DECIMAL, 22, true)); - map.put(COL_SERIAL_CRL, new ColumnDescriptor(COL_SERIAL_CRL, Types.DECIMAL, 22, true)); + map.put(COL_SERIAL_CA_CRL, new ColumnDescriptor(COL_SERIAL_CA_CRL, Types.VARCHAR, 100, true)); + map.put(COL_SERIAL_CRL, new ColumnDescriptor(COL_SERIAL_CRL, Types.VARCHAR, 100, true)); map.put(COL_DT_SCAD_CRL, new ColumnDescriptor(COL_DT_SCAD_CRL, Types.TIMESTAMP, 7, true)); map.put(COL_NM_VOLUME_CONSERV, new ColumnDescriptor(COL_NM_VOLUME_CONSERV, Types.VARCHAR, 100, true)); map.put(COL_DS_VOLUME_CONSERV, new ColumnDescriptor(COL_DS_VOLUME_CONSERV, Types.VARCHAR, 254, true)); @@ -226,7 +226,7 @@ public class AroVVisFirmaCompTableDescriptor extends TableDescriptor { new ColumnDescriptor(COL_MSG_ESITO_CERTIFICATO_VOL, Types.VARCHAR, 1024, true)); map.put(COL_ESITO_CRL_VOL, new ColumnDescriptor(COL_ESITO_CRL_VOL, Types.VARCHAR, 30, true)); map.put(COL_MSG_ESITO_CRL_VOL, new ColumnDescriptor(COL_MSG_ESITO_CRL_VOL, Types.VARCHAR, 1024, true)); - map.put(COL_SERIAL_CRL_VOL, new ColumnDescriptor(COL_SERIAL_CRL_VOL, Types.DECIMAL, 22, true)); + map.put(COL_SERIAL_CRL_VOL, new ColumnDescriptor(COL_SERIAL_CRL_VOL, Types.VARCHAR, 100, true)); map.put(COL_DT_SCAD_CRL_VOL, new ColumnDescriptor(COL_DT_SCAD_CRL_VOL, Types.TIMESTAMP, 7, true)); map.put(COL_TI_ESITO_VERIF_FIRMA_DT_VERS, new ColumnDescriptor(COL_TI_ESITO_VERIF_FIRMA_DT_VERS, Types.VARCHAR, 20, true)); @@ -244,7 +244,7 @@ public class AroVVisFirmaCompTableDescriptor extends TableDescriptor { new ColumnDescriptor(COL_MSG_ESITO_CERTIFICATO_DT_VERS, Types.VARCHAR, 1024, true)); map.put(COL_ESITO_CRL_DT_VERS, new ColumnDescriptor(COL_ESITO_CRL_DT_VERS, Types.VARCHAR, 30, true)); map.put(COL_MSG_ESITO_CRL_DT_VERS, new ColumnDescriptor(COL_MSG_ESITO_CRL_DT_VERS, Types.VARCHAR, 1024, true)); - map.put(COL_SERIAL_CRL_DT_VERS, new ColumnDescriptor(COL_SERIAL_CRL_DT_VERS, Types.DECIMAL, 22, true)); + map.put(COL_SERIAL_CRL_DT_VERS, new ColumnDescriptor(COL_SERIAL_CRL_DT_VERS, Types.VARCHAR, 100, true)); map.put(COL_DT_SCAD_CRL_DT_VERS, new ColumnDescriptor(COL_DT_SCAD_CRL_DT_VERS, Types.TIMESTAMP, 7, true)); map.put(COL_BL_FIRMA_BASE64, new ColumnDescriptor(COL_BL_FIRMA_BASE64, Types.CLOB, 4000, true)); } diff --git a/sacer-slg/src/main/resources/forms/Componenti.xml b/sacer-slg/src/main/resources/forms/Componenti.xml index a6d6b2a5..dcb6fb7a 100644 --- a/sacer-slg/src/main/resources/forms/Componenti.xml +++ b/sacer-slg/src/main/resources/forms/Componenti.xml @@ -308,7 +308,7 @@ - + @@ -333,7 +333,7 @@ - + @@ -344,22 +344,22 @@ - + - + - + - + @@ -413,8 +413,8 @@ - - + + @@ -427,7 +427,7 @@ - + @@ -443,7 +443,7 @@ - + diff --git a/sacer-slg/src/main/resources/forms/StrutTipiFascicolo.xml b/sacer-slg/src/main/resources/forms/StrutTipiFascicolo.xml index fb131a0d..0a8ded34 100644 --- a/sacer-slg/src/main/resources/forms/StrutTipiFascicolo.xml +++ b/sacer-slg/src/main/resources/forms/StrutTipiFascicolo.xml @@ -157,7 +157,7 @@ - + diff --git a/sacer-slg/src/main/resources/forms/Strutture.xml b/sacer-slg/src/main/resources/forms/Strutture.xml index 3c1e4111..b7de7977 100644 --- a/sacer-slg/src/main/resources/forms/Strutture.xml +++ b/sacer-slg/src/main/resources/forms/Strutture.xml @@ -366,6 +366,7 @@ + diff --git a/sacer-slg/src/main/resources/forms/UnitaDocumentarie.xml b/sacer-slg/src/main/resources/forms/UnitaDocumentarie.xml index 96abf865..705f059b 100644 --- a/sacer-slg/src/main/resources/forms/UnitaDocumentarie.xml +++ b/sacer-slg/src/main/resources/forms/UnitaDocumentarie.xml @@ -534,6 +534,14 @@ + + + + + + + + @@ -557,6 +565,7 @@ + diff --git a/sacer-web/pom.xml b/sacer-web/pom.xml index d7482ba3..a9512180 100644 --- a/sacer-web/pom.xml +++ b/sacer-web/pom.xml @@ -4,7 +4,7 @@ sacer-jboss it.eng.parer - 10.3.2-SNAPSHOT + 10.4.0 sacer-jboss-web diff --git a/sacer-web/src/main/java/it/eng/parer/restWS/RecStatoConservSrvlt.java b/sacer-web/src/main/java/it/eng/parer/restWS/RecStatoConservSrvlt.java index 1458cc0e..aa06d79b 100644 --- a/sacer-web/src/main/java/it/eng/parer/restWS/RecStatoConservSrvlt.java +++ b/sacer-web/src/main/java/it/eng/parer/restWS/RecStatoConservSrvlt.java @@ -60,6 +60,7 @@ import it.eng.parer.ws.recupero.dto.WSDescRecStatoCons; import it.eng.parer.ws.recupero.ejb.RecuperoSync; import it.eng.parer.ws.utils.AvanzamentoWs; +import it.eng.parer.ws.utils.Costanti; import it.eng.parer.ws.utils.MessaggiWSBundle; import it.eng.parer.ws.versamento.dto.SyncFakeSessn; import it.eng.parer.ws.xml.versRespStato.StatoConservazione; @@ -225,6 +226,15 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) recuperoSync.recuperaStatoConservazioneUD(rispostaWs, myRecuperoExt); } + // inserisco i record della tabella ARO_LOG_STATO_CONSERVAZIONE + myEsito = rispostaWs.getIstanzaEsito(); + if (rispostaWs.getSeverity() == SeverityEnum.OK && myRecuperoExt.getModificatoriWSCalc() + .contains(Costanti.ModificatoriWS.TAG_LOG_STATO_CONSERV_UD)) { + tmpAvanzamento.setFase("inserimento dati ARO_LOG_STATO_CONSERVAZIONE").logAvanzamento(); + + recuperoSync.recuperaLogStatoConservazioneUD(rispostaWs, myRecuperoExt); + } + myEsito = rispostaWs.getIstanzaEsito(); } catch (FileUploadException e1) { rispostaWs.setSeverity(SeverityEnum.ERROR); diff --git a/sacer-web/src/main/java/it/eng/parer/web/action/StrutTipiFascicoloAction.java b/sacer-web/src/main/java/it/eng/parer/web/action/StrutTipiFascicoloAction.java index 44361d8c..8b17b7b5 100644 --- a/sacer-web/src/main/java/it/eng/parer/web/action/StrutTipiFascicoloAction.java +++ b/sacer-web/src/main/java/it/eng/parer/web/action/StrutTipiFascicoloAction.java @@ -804,15 +804,26 @@ public void insertDettaglio() throws EMFError { // getForm().getMetadatiProfiloFascicoloList().setUserOperations(true, true, true, true); forwardToPublisher(Application.Publisher.XSD_AA_TIPO_FASCICOLO_DETAIL); } else if (getTableName().equals(getForm().getParteNumeroFascicoloList().getName())) { - getForm().getParteNumeroFascicoloList().setStatus(Status.insert); - getForm().getParteNumeroFascicoloDetail().setStatus(Status.insert); + // MAC #34027 - controllo per proseguire o meno + DecParteNumeroFascicoloTableBean tb = (DecParteNumeroFascicoloTableBean) getForm() + .getParteNumeroFascicoloList().getTable(); + // Recupero la colonna TiCharParte dal tablebean ed eseguo il controllo sul tipo GENERICO + List tipiCarattere = tb.toList(DecParteNumeroFascicoloTableDescriptor.COL_TI_CHAR_PARTE); + if (tipiCarattere.size() == 1 && tipiCarattere.contains(TiCharParte.GENERICO.name())) { + getMessageBox().addError( + "Impossibile inserire ulteriori parti in quanto ne \u00E8 già presente una con il carattere GENERICO"); + forwardToPublisher(getLastPublisher()); + } else { + getForm().getParteNumeroFascicoloList().setStatus(Status.insert); + getForm().getParteNumeroFascicoloDetail().setStatus(Status.insert); - getForm().getParteNumeroFascicoloDetail().reset(); - getForm().getParteNumeroFascicoloDetail().setEditMode(); - // Inizializzo le combo - initParteNumeroFascicoloDetail(); - increaseNiNumeroFascicolo(); - forwardToPublisher(Application.Publisher.FORMATO_NUMERO_LISTA_PARTI_DETAIL); + getForm().getParteNumeroFascicoloDetail().reset(); + getForm().getParteNumeroFascicoloDetail().setEditMode(); + // Inizializzo le combo + initParteNumeroFascicoloDetail(); + increaseNiNumeroFascicolo(); + forwardToPublisher(Application.Publisher.FORMATO_NUMERO_LISTA_PARTI_DETAIL); + } } } @@ -1052,8 +1063,8 @@ private boolean saveParteNumeroFascicolo() throws EMFError { param.setTransactionLogContext(sacerLogEjb.getNewTransactionLogContext()); BigDecimal idTipoFascicolo = getForm().getTipoFascicoloDetail().getId_tipo_fascicolo().parse(); - DecParteNumeroFascicoloTableBean tb = (DecParteNumeroFascicoloTableBean) getForm() - .getParteNumeroFascicoloList().getTable(); + DecParteNumeroFascicoloTableBean tb = getDecParteNumeroFascicoloTableBeanPerControlli( + partenumeroFascicoloRowBean); tb.clearSortingRule(); tb.addSortingRule(DecParteNumeroFascicoloTableDescriptor.COL_NI_PARTE_NUMERO); tb.sort(); @@ -1061,7 +1072,7 @@ private boolean saveParteNumeroFascicolo() throws EMFError { // Recupero la colonna TiCharParte dal tablebean ed eseguo il controllo sul tipo GENERICO if (!getMessageBox().hasError()) { List tipiCarattere = tb.toList(DecParteNumeroFascicoloTableDescriptor.COL_TI_CHAR_PARTE); - if (tipiCarattere.size() >= 1 && tipiCarattere.contains(TiCharParte.GENERICO.name())) { + if (tipiCarattere.size() > 1 && tipiCarattere.contains(TiCharParte.GENERICO.name())) { getMessageBox().addError( "Il carattere GENERICO \u00E8 ammesso solo se il tipo fascicolo si compone di una sola parte"); } @@ -1173,6 +1184,27 @@ private boolean saveParteNumeroFascicolo() throws EMFError { return !getMessageBox().hasError(); } + private DecParteNumeroFascicoloTableBean getDecParteNumeroFascicoloTableBeanPerControlli( + DecParteNumeroFascicoloRowBean partenumeroFascicoloRowBean) { + DecParteNumeroFascicoloTableBean tb = (DecParteNumeroFascicoloTableBean) getForm().getParteNumeroFascicoloList() + .getTable(); + + DecParteNumeroFascicoloTableBean tbForCheck = new DecParteNumeroFascicoloTableBean(); + tbForCheck.addAll(tb); + // Id nullo, significa che il record è nuovo + if (partenumeroFascicoloRowBean.getIdParteNumeroFascicolo() == null) { + tbForCheck.add(partenumeroFascicoloRowBean); + } // altrimenti il record già esiste e va "sostituito" con quello modificato per i controlli + else { + for (DecParteNumeroFascicoloRowBean rb : tbForCheck) { + if (rb.getIdParteNumeroFascicolo().equals(partenumeroFascicoloRowBean.getIdParteNumeroFascicolo())) { + rb.copyFromBaseRow(partenumeroFascicoloRowBean); + } + } + } + return tbForCheck; + } + private boolean savePeriodoValiditaFascicolo() throws EMFError { DecAaTipoFascicoloRowBean aaTipoFascicoloRowBean = new DecAaTipoFascicoloRowBean(); BigDecimal idTipoFascicolo = getForm().getTipoFascicoloDetail().getId_tipo_fascicolo().parse(); diff --git a/sacer-web/src/main/java/it/eng/parer/web/action/StruttureAction.java b/sacer-web/src/main/java/it/eng/parer/web/action/StruttureAction.java index 4482615d..0aa1b79f 100644 --- a/sacer-web/src/main/java/it/eng/parer/web/action/StruttureAction.java +++ b/sacer-web/src/main/java/it/eng/parer/web/action/StruttureAction.java @@ -249,6 +249,8 @@ public class StruttureAction extends StruttureAbstractAction { private AmministrazioneEjb amministrazioneEjb; @EJB(mappedName = "java:app/Parer-ejb/RestituzioneArchivioEjb") private RestituzioneArchivioEjb restArchEjb; + @EJB(mappedName = "java:app/Parer-ejb/DatiSpecificiEjb") + private DatiSpecificiEjb datiSpecificiEjb; // Pattern per l'inserimento del nome struttura conforme al set di caratteri ammessi private static final String NOME_STRUT = "^[A-Za-z0-9_][A-Za-z0-9\\. _-]*$"; @@ -1556,67 +1558,9 @@ else if (getForm().getTipoFascicoloList().getName().equals(lista) redirectToCreaCriterioRaggrPage(); } else if (lista.equals(getForm().getSistemiMigrazioneList().getName())) { forwardToPublisher(Application.Publisher.XSD_MIGR_STRUT); - } else if (getForm().getXsdDatiSpecList().getName().equals(lista)) { - String nmSistemaMigraz = getForm().getGestioneXsdMigrazione().getNm_sistema_migraz().getDecodedValue(); - if (StringUtils.isBlank(nmSistemaMigraz)) { - getMessageBox().addError("Errore inatteso nel recupero del sistema di migrazione"); - } - if (getMessageBox().isEmpty()) { - StrutDatiSpecForm form = new StrutDatiSpecForm(); - Integer row = getForm().getXsdDatiSpecList().getTable().getCurrentRowIndex(); - if (idStrut == null) { - idStrut = ((BaseRowInterface) getForm().getStruttureList().getTable().getCurrentRow()) - .getBigDecimal("id_strut"); - } - - StringBuilder string = new StringBuilder( - "?operation=listNavigationOnClick&navigationEvent=" + getNavigationEvent() + "&table=" - + StrutDatiSpecForm.XsdDatiSpecList.NAME + "&riga=" + row.toString()); - form.getXsdDatiSpecList().setTable(getForm().getXsdDatiSpecList().getTable()); - - // Non controllo il publisher da cui arrivo perché sono sicuro di essere in quello della migrazione - // controllo invece quale tabella di strutture ha richiamato la funzione, se quella normale o quella di - // duplica - form.getIdList().getId_strut().setValue(idStrut.toString()); - form.getIdList().getNm_sys_migraz().setValue(nmSistemaMigraz); - - if (getForm().getXsdMigrStrutTab().getCurrentTab() - .equals(getForm().getXsdMigrStrutTab().getXsdMigrTipoDoc())) { - form.getIdList().getNm_sacer_type().setValue("DOC"); - getSession().setAttribute("elementoRif", "Documento"); - - } else if (getForm().getXsdMigrStrutTab().getCurrentTab() - .equals(getForm().getXsdMigrStrutTab().getXsdMigrTipoUnitaDoc())) { - form.getIdList().getNm_sacer_type().setValue("UNI_DOC"); - getSession().setAttribute("elementoRif", "UD"); - - } else if (getForm().getXsdMigrStrutTab().getCurrentTab() - .equals(getForm().getXsdMigrStrutTab().getXsdMigrTipoCompDoc())) { - form.getIdList().getNm_sacer_type().setValue("COMP"); - getSession().setAttribute("elementoRif", "Componente"); - - } - getRequest().setAttribute("lastPage", "migraz"); - - string.append("&idStrut=").append(idStrut); - string.append("&cessato=").append(getForm().getInsStruttura().getFl_cessato().parse()); - // form = form nuova - BaseRowInterface rowBean = getForm().getStruttureList().getTable().getCurrentRow(); - - form.getStrutRif().getNm_strut().setValue(rowBean.getString("nm_strut")); - form.getStrutRif().getDs_strut().setValue(rowBean.getString("ds_strut")); - OrgEnteRowBean enteTemp = struttureEjb.getOrgEnteRowBean(rowBean.getBigDecimal("id_ente")); - form.getStrutRif().getId_ente().setValue(enteTemp.getNmEnte()); - form.getStrutRif().getStruttura() - .setValue(rowBean.getString("nm_strut") + " (" + rowBean.getString("ds_strut") + ")"); - - // fisso a false tutte le autorizzazioni a procedere con le altre fasi della listNavigationOnClick in - // questa action - this.setInsertAction(false); - this.setEditAction(false); - this.setDeleteAction(false); - redirectToAction(Application.Actions.STRUT_DATI_SPEC, string.toString(), form); - } + } else if (getForm().getXsdDatiSpecList().getName().equals(lista) + && action.equals(ListAction.NE_DETTAGLIO_VIEW)) { + redirectToXsdDatiSpecPage(); } else if (lista.equals(getForm().getTitolariList().getName()) && action.equals(ListAction.NE_DETTAGLIO_VIEW)) { redirectToTitolarioPage(action); } else if (lista.equals(getForm().getTipologieSerieList().getName()) @@ -2036,6 +1980,8 @@ public void insertDettaglio() throws EMFError { redirectToFormatoFileDocPage(); } else if (lista.equals(getForm().getCriteriRaggruppamentoList().getName())) { redirectToCreaCriterioRaggrPage(); + } else if (lista.equals(getForm().getXsdDatiSpecList().getName())) { + redirectToXsdDatiSpecPage(); } else if (lista.equals(getForm().getTipoCompAmmessoDaTipoRapprCompList().getName())) { // Lista "Tipo Rappresentazione Componente" BigDecimal idStrut = ((BaseRowInterface) getForm().getStruttureList().getTable().getCurrentRow()) @@ -4560,6 +4506,71 @@ private StrutFormatoFileForm prepareRedirectToStrutFormatoFile() throws EMFError return form; } + private StrutDatiSpecForm prepareRedirectToStrutDatiSpec() throws EMFError { + StrutDatiSpecForm form = new StrutDatiSpecForm(); + BigDecimal idStrut = getForm().getStruttureList().getTable().getCurrentRow().getBigDecimal("id_strut"); + String nmSistemaMigraz = getForm().getGestioneXsdMigrazione().getNm_sistema_migraz().getDecodedValue(); + if (StringUtils.isBlank(nmSistemaMigraz)) { + getMessageBox().addError("Errore inatteso nel recupero del sistema di migrazione"); + } + if (getMessageBox().isEmpty()) { + + Integer row = getForm().getXsdDatiSpecList().getTable().getCurrentRowIndex(); + if (idStrut == null) { + idStrut = ((BaseRowInterface) getForm().getStruttureList().getTable().getCurrentRow()) + .getBigDecimal("id_strut"); + } + + StringBuilder string = new StringBuilder( + "?operation=listNavigationOnClick&navigationEvent=" + getNavigationEvent() + "&table=" + + StrutDatiSpecForm.XsdDatiSpecList.NAME + "&riga=" + row.toString()); + form.getXsdDatiSpecList().setTable(getForm().getXsdDatiSpecList().getTable()); + + // Non controllo il publisher da cui arrivo perché sono sicuro di essere in quello della migrazione + // controllo invece quale tabella di strutture ha richiamato la funzione, se quella normale o quella di + // duplica + form.getIdList().getId_strut().setValue(idStrut.toString()); + form.getIdList().getNm_sys_migraz().setValue(nmSistemaMigraz); + + if (getForm().getXsdMigrStrutTab().getCurrentTab() + .equals(getForm().getXsdMigrStrutTab().getXsdMigrTipoDoc())) { + form.getIdList().getNm_sacer_type().setValue("DOC"); + getSession().setAttribute("elementoRif", "Documento"); + + } else if (getForm().getXsdMigrStrutTab().getCurrentTab() + .equals(getForm().getXsdMigrStrutTab().getXsdMigrTipoUnitaDoc())) { + form.getIdList().getNm_sacer_type().setValue("UNI_DOC"); + getSession().setAttribute("elementoRif", "UD"); + + } else if (getForm().getXsdMigrStrutTab().getCurrentTab() + .equals(getForm().getXsdMigrStrutTab().getXsdMigrTipoCompDoc())) { + form.getIdList().getNm_sacer_type().setValue("COMP"); + getSession().setAttribute("elementoRif", "Componente"); + + } + getRequest().setAttribute("lastPage", "migraz"); + + string.append("&idStrut=").append(idStrut); + string.append("&cessato=").append(getForm().getInsStruttura().getFl_cessato().parse()); + // form = form nuova + BaseRowInterface rowBean = getForm().getStruttureList().getTable().getCurrentRow(); + + form.getStrutRif().getNm_strut().setValue(rowBean.getString("nm_strut")); + form.getStrutRif().getDs_strut().setValue(rowBean.getString("ds_strut")); + OrgEnteRowBean enteTemp = struttureEjb.getOrgEnteRowBean(rowBean.getBigDecimal("id_ente")); + form.getStrutRif().getId_ente().setValue(enteTemp.getNmEnte()); + form.getStrutRif().getStruttura() + .setValue(rowBean.getString("nm_strut") + " (" + rowBean.getString("ds_strut") + ")"); + + // fisso a false tutte le autorizzazioni a procedere con le altre fasi della listNavigationOnClick in + // questa action + this.setInsertAction(false); + this.setEditAction(false); + this.setDeleteAction(false); + } + return form; + } + private void redirectToRegistroPage() throws EMFError { StrutTipiForm form = prepareRedirectToStrutTipi(); form.getRegistroUnitaDocList() @@ -4644,6 +4655,14 @@ private void redirectToCreaCriterioRaggrPage() throws EMFError { form); } + private void redirectToXsdDatiSpecPage() throws EMFError { + StrutDatiSpecForm form = prepareRedirectToStrutDatiSpec(); + + form.getXsdDatiSpecList().setFilterValidRecords(getForm().getXsdDatiSpecList().isFilterValidRecords()); + redirectToPage(Application.Actions.STRUT_DATI_SPEC, form, form.getXsdDatiSpecList().getName(), + getForm().getXsdDatiSpecList().getTable(), getNavigationEvent()); + } + private void redirectToPage(final String action, BaseForm form, String listToPopulate, BaseTableInterface table, String event) throws EMFError { ((it.eng.spagoLite.form.list.List>) form.getComponent(listToPopulate)).setTable(table); @@ -7124,4 +7143,108 @@ public void filterInactiveRecordsParametriGestioneStrutturaList() throws EMFErro forwardToPublisher(getLastPublisher()); } + @Override + public void deleteXsdDatiSpecList() throws EMFError { + + DecXsdDatiSpecRowBean xsdDatiSpecRowBean = ((DecXsdDatiSpecRowBean) getForm().getXsdDatiSpecList().getTable() + .getCurrentRow()); + getMessageBox().clear(); + Date dtSoppres = xsdDatiSpecRowBean.getDtSoppres(); + Date today = Calendar.getInstance().getTime(); + if (dtSoppres.compareTo(today) < 0) { + getMessageBox().addError("Versione XSD gi\u00E0 disattivata in precedenza"); + forwardToPublisher(getLastPublisher()); + } else { + // Il sistema controlla che tale attributo non sia associato a nessun tipo serie, altrimenti da errore + if (datiSpecificiEjb.isXsdDatiSpecInUseInTipiSerie(xsdDatiSpecRowBean.getIdXsdDatiSpec())) { + getMessageBox().addError( + "Almeno un attributo dell'xsd \u00E8 utilizzato da un tipo serie . L'eliminazione dell'xsd non \u00E8 consentita"); + } + if (!getMessageBox().hasError()) { + boolean isInUse = datiSpecificiEjb.isXsdDatiSpecInUse(xsdDatiSpecRowBean); + boolean isInUseOnCampiRegole = datiSpecificiEjb.isXsdDatiSpecInUseOnCampi( + xsdDatiSpecRowBean.getIdXsdDatiSpec(), "DATO_SPEC_UNI_DOC", "DATO_SPEC_DOC_PRINC"); + // se in uso non posso cancellare, ma posso disattivare + if (isInUse || isInUseOnCampiRegole) { + if (StringUtils.isNotBlank(getLastPublisher())) { + // Mostra messaggio di disattivazione + getRequest().setAttribute("confermaDisattivazioneXsd", true); + forwardToPublisher(getLastPublisher()); + SessionManager.removeLastExecutionHistory(getSession()); + } else { + deleteXsd(xsdDatiSpecRowBean); + } + } else { + deleteXsd(xsdDatiSpecRowBean); + } + } else { + forwardToPublisher(getLastPublisher()); + SessionManager.removeLastExecutionHistory(getSession()); + } + } + } + + private void deleteXsd(DecXsdDatiSpecRowBean xsdDatiSpecRowBean) throws EMFError { + // se non in uso e ultimo in lista + /* + * Codice aggiuntivo per il logging... + */ + LogParam param = SpagoliteLogUtil.getLogParam( + configurationHelper.getValoreParamApplicByApplic(CostantiDB.ParametroAppl.NM_APPLIC), + getUser().getUsername(), SpagoliteLogUtil.getPageName(this)); + param.setTransactionLogContext(sacerLogEjb.getNewTransactionLogContext()); + if (Application.Publisher.XSD_DATI_SPEC_DETAIL.equalsIgnoreCase(param.getNomePagina())) { + param.setNomeAzione(SpagoliteLogUtil.getToolbarDelete()); + } else { + param.setNomeAzione(SpagoliteLogUtil.getDetailActionNameDelete(getForm(), getForm().getXsdDatiSpecList())); + } + + try { + datiSpecificiEjb.delXsdDatiSpec(param, xsdDatiSpecRowBean); + getMessageBox().addInfo("Eliminazione xsd avvenuta con successo"); + } catch (ParerUserError ex) { + logger.error(ex.getMessage(), ex); + getMessageBox().addError("Errore inatteso nell'eliminazione del xsd"); + } + if (!getMessageBox().hasError()) { + DecXsdDatiSpecTableBean xsdDatiSpecTableBean = datiSpecEjb.getDecXsdDatiSpecTableBean( + xsdDatiSpecRowBean.getIdStrut(), CostantiDB.TipiUsoDatiSpec.MIGRAZ.name(), + xsdDatiSpecRowBean.getTiEntitaSacer(), xsdDatiSpecRowBean.getNmSistemaMigraz()); + + getForm().getXsdDatiSpecList().setTable(xsdDatiSpecTableBean); + getForm().getXsdDatiSpecList().getTable().first(); + getForm().getXsdDatiSpecList().getTable().setPageSize(WebConstants.DEFAULT_PAGE_SIZE); + } + forwardToPublisher(getLastPublisher()); + SessionManager.removeLastExecutionHistory(getSession()); + } + + public void confermaDisattivazione() throws EMFError { + DecXsdDatiSpecRowBean xsdDatiSpecRowBean = ((DecXsdDatiSpecRowBean) getForm().getXsdDatiSpecList().getTable() + .getCurrentRow()); + disattivaXsd(xsdDatiSpecRowBean.getIdXsdDatiSpec()); + if (!getMessageBox().hasError()) { + DecXsdDatiSpecTableBean xsdDatiSpecTableBean = datiSpecEjb.getDecXsdDatiSpecTableBean( + xsdDatiSpecRowBean.getIdStrut(), CostantiDB.TipiUsoDatiSpec.MIGRAZ.name(), + xsdDatiSpecRowBean.getTiEntitaSacer(), xsdDatiSpecRowBean.getNmSistemaMigraz()); + + getForm().getXsdDatiSpecList().setTable(xsdDatiSpecTableBean); + getForm().getXsdDatiSpecList().getTable().first(); + getForm().getXsdDatiSpecList().getTable().setPageSize(WebConstants.DEFAULT_PAGE_SIZE); + } + forwardToPublisher(getLastPublisher()); + } + + private void disattivaXsd(BigDecimal idXsdDatiSpec) throws EMFError { + /* + * Codice aggiuntivo per il logging... + */ + LogParam param = SpagoliteLogUtil.getLogParam( + configurationHelper.getValoreParamApplicByApplic(CostantiDB.ParametroAppl.NM_APPLIC), + getUser().getUsername(), SpagoliteLogUtil.getPageName(this)); + param.setNomeAzione(SpagoliteLogUtil.getToolbarUpdate()); + param.setTransactionLogContext(sacerLogEjb.getNewTransactionLogContext()); + datiSpecificiEjb.deactivateXsdAndLog(param, idXsdDatiSpec); + } + } diff --git a/sacer-web/src/main/java/it/eng/parer/web/action/UnitaDocumentarieAction.java b/sacer-web/src/main/java/it/eng/parer/web/action/UnitaDocumentarieAction.java index ca626cc1..6073df53 100644 --- a/sacer-web/src/main/java/it/eng/parer/web/action/UnitaDocumentarieAction.java +++ b/sacer-web/src/main/java/it/eng/parer/web/action/UnitaDocumentarieAction.java @@ -97,6 +97,7 @@ import it.eng.parer.slite.gen.form.UnitaDocumentarieForm.FiltriUnitaDocumentarieSemplice; import it.eng.parer.slite.gen.form.UnitaDocumentarieForm.UnitaDocumentarieList; import it.eng.parer.slite.gen.form.VolumiForm; +import it.eng.parer.slite.gen.tablebean.AroLogStatoConservUdTableBean; import it.eng.parer.slite.gen.tablebean.AroUpdUnitaDocTableBean; import it.eng.parer.slite.gen.tablebean.AroVerIndiceAipUdRowBean; import it.eng.parer.slite.gen.tablebean.AroVerIndiceAipUdTableBean; @@ -2220,6 +2221,18 @@ public void getDettaglioUD(BigDecimal idUnitDoc) throws EMFError { getForm().getNoteList().getTable().first(); getForm().getUnitaDocumentarieDettaglioListsTabs().getListaNoteUD().setHidden(false); // end MEV#24597 + + // MEV #31162 + AroLogStatoConservUdTableBean logStatoConservUdTableBean = udHelper.getAroLogStatoConservUdTableBean(idUnitDoc); + int logStatoConservUdPageSize = 10; + if (getForm().getStatiConservazioneUdList().getTable() != null) { + logStatoConservUdPageSize = getForm().getStatiConservazioneUdList().getTable().getPageSize(); + } + getForm().getStatiConservazioneUdList().setTable(logStatoConservUdTableBean); + getForm().getStatiConservazioneUdList().getTable().setPageSize(logStatoConservUdPageSize); + getForm().getStatiConservazioneUdList().getTable().first(); + // end MEV #31162 + } @Override @@ -2524,6 +2537,13 @@ public void tabListaDocumentiUDOnClick() throws EMFError { forwardToPublisher(Application.Publisher.UNITA_DOCUMENTARIE_DETAIL); } + @Override + public void tabListaStatiConservUDOnClick() throws EMFError { + getForm().getUnitaDocumentarieDettaglioListsTabs() + .setCurrentTab(getForm().getUnitaDocumentarieDettaglioListsTabs().getListaStatiConservUD()); + forwardToPublisher(Application.Publisher.UNITA_DOCUMENTARIE_DETAIL); + } + /** * Attiva il tab Lista Collegamenti nel dettaglio di un'unità documentaria * @@ -3067,9 +3087,9 @@ public void scarica_xml_unisincro() throws EMFError { } else { forwardToPublisher(Application.Publisher.DOWNLOAD_PAGE); } - } catch (ParerInternalError e) { - log.error("Eccezione nel recupero AIP ", e); - getMessageBox().addError("Eccezione nel recupero AIP: " + e.getDescription()); + // } catch (ParerInternalError e) { + // log.error("Eccezione nel recupero AIP ", e); + // getMessageBox().addError("Eccezione nel recupero AIP: " + e.getDescription()); } catch (Exception e) { String message = "Eccezione nel recupero AIP " + ExceptionUtils.getRootCauseMessage(e); getMessageBox().addError("Eccezione nel recupero AIP: " + message); diff --git a/sacer-web/src/main/webapp/jsp/firmeDetail.jsp b/sacer-web/src/main/webapp/jsp/firmeDetail.jsp index 143fa1d7..0cb85e59 100644 --- a/sacer-web/src/main/webapp/jsp/firmeDetail.jsp +++ b/sacer-web/src/main/webapp/jsp/firmeDetail.jsp @@ -176,9 +176,9 @@ - + - + diff --git a/sacer-web/src/main/webapp/jsp/struttura/xsdMigrStrut.jsp b/sacer-web/src/main/webapp/jsp/struttura/xsdMigrStrut.jsp index f5044bc5..33d06eaf 100644 --- a/sacer-web/src/main/webapp/jsp/struttura/xsdMigrStrut.jsp +++ b/sacer-web/src/main/webapp/jsp/struttura/xsdMigrStrut.jsp @@ -4,12 +4,41 @@ + + + +
+
    +
  • Desideri disattivare la versione di XSD ?
  • +
+
+
+ + + + +