diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java index 858d18ba..7dcb5431 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java @@ -1,7 +1,7 @@ /** * * @author Salvatore La Manna, Manifattura Web Group per Regione Siciliana - * + * */ package it.mwg.sismica.bo.util; @@ -156,8 +156,12 @@ public class ManutenzioneDatabase { public static List pulisci(ServiceContext serviceContext, String mode) throws SystemException, PortalException { + List esito = new ArrayList<>(); long companyId = serviceContext.getCompanyId(); + if (mode.contains("!Workflow=")) { + esito.addAll(SismicaUtil.riparaWorkflow(mode.replaceAll(".*?!Workflow=([^!]*)!", "$1"))); + } if (mode.contains("!Pulisci!")) { esito.addAll(puliziaDocumentLibrary(companyId)); esitoLog( @@ -166,8 +170,8 @@ public class ManutenzioneDatabase { ConfigurazioneConstants.ATTACHMENT_FOLDER_ID))); esitoLog( esito, - puliziaAllegati(companyId, ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, - AvvisoUtil.getAllTipoDocumentoFolderProps().get(StatoPraticaConstants.CONFORME)))); + puliziaAllegati(companyId, ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, AvvisoUtil + .getAllTipoDocumentoFolderProps().get(StatoPraticaConstants.CONFORME)))); if (mode.contains("!IntPratica!")) { esitoLog(esito, svuotaIntPraticaDettPratica()); } @@ -176,8 +180,7 @@ public class ManutenzioneDatabase { } esito.addAll(svuotaDatabase(companyId)); if (mode.contains("!Reset!")) { - ConfigurazioneLocalServiceUtil.storeConfig(Constants.NUMERO_PROGETTO_KEY_DB, "1", - serviceContext); + ConfigurazioneLocalServiceUtil.storeConfig(Constants.NUMERO_PROGETTO_KEY_DB, "1", serviceContext); } clearCache(); _log.info("Elaborazione completata correttamente."); @@ -185,10 +188,6 @@ public class ManutenzioneDatabase { if (mode.contains("!Integrazioni!")) { SismicaUtil.integrazioniScadute(); } - if (mode.startsWith("!Workflow!")) { - String[] pezzi = StringUtil.split(mode, '!'); - esito.addAll(SismicaUtil.aggiungiWorkflow(pezzi[2], pezzi[3])); - } return esito; } @@ -262,12 +261,10 @@ public class ManutenzioneDatabase { if (parent.getFolderId() == allegatiFolderId) { long[] ids = StringUtil.split(folder.getName(), "_", 0L); if ((ids.length == 2) && (ids[0] == ids[1])) { - if (!esiste(DETTPRATICA_CLASS_NAME, ids[0]) - && !esiste(DOCPRATICA_CLASS_NAME, ids[0]) + if (!esiste(DETTPRATICA_CLASS_NAME, ids[0]) && !esiste(DOCPRATICA_CLASS_NAME, ids[0]) && !esiste(ALLEGATOMANUALE_CLASS_NAME, ids[0]) && !esiste(ASSEVERAZIONE_CLASS_NAME, ids[0]) - && !esiste(AVVISO_CLASS_NAME, ids[0]) - && !esiste(COLLAUDO_CLASS_NAME, ids[0]) + && !esiste(AVVISO_CLASS_NAME, ids[0]) && !esiste(COLLAUDO_CLASS_NAME, ids[0]) && !esiste(CONTROLLOPRATICA_CLASS_NAME, ids[0]) && !esiste(DELEGA_CLASS_NAME, ids[0]) && !esiste(DOCAGGIUNTIVA_CLASS_NAME, ids[0]) @@ -291,8 +288,7 @@ public class ManutenzioneDatabase { emailId = Long.parseLong(folder.getName()); } catch (NumberFormatException e) { } - if (Validator.isNotNull(emailId) - && String.valueOf(emailId).equals(folder.getName()) + if (Validator.isNotNull(emailId) && String.valueOf(emailId).equals(folder.getName()) && !esiste(EMAIL_CLASS_NAME, emailId)) { _log.info("Cancello la cartella " + folder.getName()); DLAppLocalServiceUtil.deleteFolder(folder.getFolderId()); @@ -332,8 +328,7 @@ public class ManutenzioneDatabase { return result; } - private static String puliziaAllegati(long companyId, long folderId) throws SystemException, - PortalException { + private static String puliziaAllegati(long companyId, long folderId) throws SystemException, PortalException { List avvisiFileEntries = avvisiFileEntries(); long repositoryId = DLAppLocalServiceUtil.getFolder(folderId).getRepositoryId(); int start = 0; @@ -343,8 +338,7 @@ public class ManutenzioneDatabase { int rimossi = 0; fileEntries = DLAppServiceUtil.getFileEntries(repositoryId, folderId, start, start + SLICE); for (FileEntry fileEntry : fileEntries) { - String[] parti = StringUtil.split(fileEntry.getTitle() - .replaceAll("\\.p7m$", StringPool.BLANK), '_'); + String[] parti = StringUtil.split(fileEntry.getTitle().replaceAll("\\.p7m$", StringPool.BLANK), '_'); String strId1 = parti[0]; String tipo = StringPool.BLANK; String strId2 = StringPool.BLANK; @@ -886,8 +880,7 @@ public class ManutenzioneDatabase { List resourcePermissions = null; do { int rimossi = 0; - resourcePermissions = ResourcePermissionLocalServiceUtil.getResourcePermissions(start, start - + SLICE); + resourcePermissions = ResourcePermissionLocalServiceUtil.getResourcePermissions(start, start + SLICE); for (ResourcePermission resourcePermission : resourcePermissions) { long classPK = 0; try { @@ -971,12 +964,11 @@ public class ManutenzioneDatabase { List storicoSoggettiPratiche = null; do { int rimossi = 0; - storicoSoggettiPratiche = StoricoSoggettoPraticaLocalServiceUtil.getStoricoSoggettoPraticas( - start, start + SLICE); + storicoSoggettiPratiche = StoricoSoggettoPraticaLocalServiceUtil.getStoricoSoggettoPraticas(start, start + + SLICE); for (StoricoSoggettoPratica storicoSoggettoPratica : storicoSoggettiPratiche) { if (!esiste(INTPRATICA_CLASS_NAME, storicoSoggettoPratica.getIntPraticaId())) { - StoricoSoggettoPraticaLocalServiceUtil - .deleteStoricoSoggettoPratica(storicoSoggettoPratica); + StoricoSoggettoPraticaLocalServiceUtil.deleteStoricoSoggettoPratica(storicoSoggettoPratica); cancellati++; rimossi++; } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java index 19a24a47..62fd103f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java @@ -320,6 +320,35 @@ public class SismicaUtil { return esito; } + public static List riparaWorkflow(String numeroProgetto) throws SystemException, PortalException { + + List esito = new ArrayList<>(); + IntPratica pratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto); + long intPraticaId = pratica.getIntPraticaId(); + long companyId = pratica.getCompanyId(); + long groupId = pratica.getGroupId(); + long userId = pratica.getUserId(); + DettPratica dettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPraticaId); + long dettPraticaId = dettPratica.getDettPraticaId(); + if (Validator.isNull(pratica)) { + esitoLog(esito, "Progetto " + numeroProgetto + " non trovato"); + return esito; + } + // STATUS_APPROVED STATUS_DENIED STATUS_DRAFT STATUS_INACTIVE STATUS_PENDING + List controlli = ControlloPraticaLocalServiceUtil.findByIntPraticaId_Status(intPraticaId, + WorkflowConstants.STATUS_PENDING); + if (0 == controlli.size()) { + esitoLog(esito, "Aggiungo controllo pratica"); + ServiceContext serviceContext = new ServiceContext(); + serviceContext.setCompanyId(companyId); + serviceContext.setScopeGroupId(dettPraticaId); + serviceContext.setUserId(userId); + ControlloPraticaLocalServiceUtil.addControlloPratica(groupId, userId, intPraticaId, dettPraticaId, true, + serviceContext); + } + return esito; + } + public static List aggiungiWorkflow(String numeroProgetto, String mode) throws SystemException, PortalException { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java index b2761f10..678cb41a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java @@ -71,21 +71,25 @@ public class ControlloPraticaIndexer extends BaseIndexer { private static final Log _log = LogFactoryUtil.getLog(ControlloPraticaIndexer.class); public ControlloPraticaIndexer() { + setPermissionAware(true); } @Override public String[] getClassNames() { + return CLASS_NAMES; } @Override public String getPortletId() { + return PORTLET_ID; } @Override protected void doDelete(Object obj) throws Exception { + if (Validator.isNotNull(obj)) { ControlloPratica controlloPratica = (ControlloPratica) obj; deleteDocument(controlloPratica.getCompanyId(), controlloPratica.getControlloPraticaId()); @@ -96,6 +100,7 @@ public class ControlloPraticaIndexer extends BaseIndexer { @Override protected Document doGetDocument(Object obj) throws Exception { + Document document = null; if (Validator.isNotNull(obj)) { ControlloPratica controlloPratica = (ControlloPratica) obj; @@ -323,6 +328,7 @@ public class ControlloPraticaIndexer extends BaseIndexer { @Override protected Document getBaseModelDocument(String portletId, BaseModel baseModel) throws SystemException { + Document document = newDocument(); String className = baseModel.getModelClassName(); long classPK = 0; @@ -385,6 +391,7 @@ public class ControlloPraticaIndexer extends BaseIndexer { @Override protected void doReindex(Object obj) throws Exception { + if (Validator.isNotNull(obj)) { ControlloPratica controlloPratica = (ControlloPratica) obj; Document document = getDocument(controlloPratica); @@ -406,9 +413,12 @@ public class ControlloPraticaIndexer extends BaseIndexer { } protected void reindexControlloPratica(long companyId) throws PortalException, SystemException { + ActionableDynamicQuery actionableDynamicQuery = new ControlloPraticaActionableDynamicQuery() { + @Override protected void performAction(Object object) throws PortalException { + if (object != null) { ControlloPratica controlloPratica = (ControlloPratica) object; if (controlloPratica != null) { @@ -438,15 +448,18 @@ public class ControlloPraticaIndexer extends BaseIndexer { @Override protected void doReindex(String className, long id) throws Exception { + ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(id); doReindex(controlloPratica); } private boolean checkSottopostaAParere(long intPraticaId) throws SystemException, PortalException { + return WorkflowUtil.isWorkflowDisattivabile(intPraticaId); } private boolean checkLavorazioneSorteggiata(long intPraticaId) throws SystemException { + Sorteggio sorteggio = SorteggioLocalServiceUtil.findByIntPratica(intPraticaId); if (Validator.isNotNull(sorteggio)) { return true; @@ -457,6 +470,7 @@ public class ControlloPraticaIndexer extends BaseIndexer { @Override protected String getPortletId(SearchContext searchContext) { + return PORTLET_ID; } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java index 68ece9c5..81eafb6f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java @@ -6,7 +6,6 @@ import it.tref.liferay.portos.bo.model.IntPratica; import it.tref.liferay.portos.bo.model.ParereGeologo; import it.tref.liferay.portos.bo.model.Provincia; import it.tref.liferay.portos.bo.model.Soggetto; -import it.tref.liferay.portos.bo.model.Sorteggio; import it.tref.liferay.portos.bo.model.Territorio; import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil; import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; @@ -96,62 +95,44 @@ public class IntPraticaIndexer extends BaseIndexer { /* * Manifattura Web Group per Regione Siciliana - * - * Modifiche per rendere i campi di testo ricercabili per parole contenute e - * non per corrispondenza esatta. + * + * Modifiche per rendere i campi di testo ricercabili per parole contenute e non per corrispondenza esatta. */ @Override protected Document doGetDocument(Object obj) throws Exception { Document document = null; - if (Validator.isNotNull(obj)) { - IntPratica intPratica = (IntPratica) obj; IntPratica intPraticaFromDB = IntPraticaServiceUtil.getIntPratica(intPratica.getIntPraticaId()); - if (_log.isDebugEnabled()) { _log.debug("Indicizzo la pratica " - + (Validator.isNull(intPratica.getNumeroProgetto()) ? "" : intPratica - .getNumeroProgetto() + ", ") + "id " + intPratica.getIntPraticaId()); + + (Validator.isNull(intPratica.getNumeroProgetto()) ? "" : intPratica.getNumeroProgetto() + + ", ") + "id " + intPratica.getIntPraticaId()); } - document = getBaseModelDocument(PORTLET_ID, intPratica); - document.addKeyword("entryClassName", IntPratica.class.getName()); - - // Prendo l ultimo DettPratica legato a IntPratica + // Prendo l'ultimo DettPratica legato a IntPratica DettPratica lastDettPratica = DettPraticaLocalServiceUtil .getLastCompletedByIntPraticaAndProtocolloNotEmpty(intPraticaFromDB.getIntPraticaId()); - if (Validator.isNull(lastDettPratica)) { - lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica - .getIntPraticaId()); + lastDettPratica = DettPraticaLocalServiceUtil + .getLastCompletedByIntPratica(intPratica.getIntPraticaId()); } - // Aggiunta field custom per la ricerca document.addKeyword(Field.PORTLET_ID, getPortletId()); - if (Validator.isNotNull(intPraticaFromDB.getDtPratica())) { document.addKeyword(PortosIndexField.DATA_RICHIESTA, DATE_FORMAT.format(intPraticaFromDB.getDtPratica())); - - document.addKeyword(PortosIndexField.DT_PRATICA, - DATE_FORMAT.format(intPraticaFromDB.getDtPratica())); - + document.addKeyword(PortosIndexField.DT_PRATICA, DATE_FORMAT.format(intPraticaFromDB.getDtPratica())); document.addKeywordSortable(PortosIndexField.DT_PRATICA, DATE_FORMAT.format(intPraticaFromDB.getDtPratica())); - document.addDate(PortosIndexField.DT_PRATICA, intPraticaFromDB.getDtPratica()); - } else { document.addKeyword(PortosIndexField.DT_PRATICA, 0); } - document.addKeyword(PortosIndexField.INT_PRATICA_ID, intPraticaFromDB.getIntPraticaId()); - - if (intPraticaFromDB.getNumeroProgetto() != null - && !intPraticaFromDB.getNumeroProgetto().equals("")) { + if (intPraticaFromDB.getNumeroProgetto() != null && !intPraticaFromDB.getNumeroProgetto().equals("")) { document.addKeyword(PortosIndexField.NUMERO_PROGETTO, Integer.valueOf(intPraticaFromDB.getNumeroProgetto())); document.addNumber(PortosIndexField.NUMERO_PROGETTO, @@ -159,38 +140,27 @@ public class IntPraticaIndexer extends BaseIndexer { document.addNumberSortable(PortosIndexField.NUMERO_PROGETTO, Integer.valueOf(intPraticaFromDB.getNumeroProgetto())); } - if (lastDettPratica != null) { - document.addKeyword("nuovaCostruzione", lastDettPratica.getTcNuovaCostruzione()); document.addKeyword("adeguamentoSismico", lastDettPratica.getTcAdeguamentoSismico()); document.addKeyword("miglioramentoSismico", lastDettPratica.getTcMiglioramentoSismico()); document.addKeyword("interventoLocale", lastDettPratica.getTcRiparazioneInterventoLocale()); - if (lastDettPratica.getProtocollo() != null && !lastDettPratica.getProtocollo().equals("")) { - document.addKeyword(PortosIndexField.PROTOCOLLO, - Long.parseLong(lastDettPratica.getProtocollo())); - document.addNumber(PortosIndexField.PROTOCOLLO, - Long.parseLong(lastDettPratica.getProtocollo())); + document.addKeyword(PortosIndexField.PROTOCOLLO, Long.parseLong(lastDettPratica.getProtocollo())); + document.addNumber(PortosIndexField.PROTOCOLLO, Long.parseLong(lastDettPratica.getProtocollo())); document.addNumberSortable(PortosIndexField.PROTOCOLLO, Long.parseLong(lastDettPratica.getProtocollo())); } - if (lastDettPratica.getVia() != null && !lastDettPratica.getVia().equals("")) { document.addText(PortosIndexField.INDIRIZZO, lastDettPratica.getVia()); } - if (lastDettPratica.getLocalita() != null && !lastDettPratica.getLocalita().equals("")) { document.addText(PortosIndexField.LOCALITA, lastDettPratica.getLocalita()); } - } - - boolean sorteggiata = SorteggioLocalServiceUtil.findByIntPratica(intPraticaFromDB - .getIntPraticaId()) != null; + boolean sorteggiata = SorteggioLocalServiceUtil.findByIntPratica(intPraticaFromDB.getIntPraticaId()) != null; document.addKeyword("sorteggiata", sorteggiata); document.addKeyword("controlloObbligatorio", intPraticaFromDB.isControlloObbligatorio()); - // Gestione pratica aperta/chiusa fine lavori if (intPraticaFromDB.getCollaudoTotale()) { document.addKeyword(PortosIndexField.PRATICA_APERTA, false); @@ -203,23 +173,17 @@ public class IntPraticaIndexer extends BaseIndexer { } else { document.addKeyword(PortosIndexField.PRATICA_APERTA, true); } - if (intPraticaFromDB.getStatoPratica().equals(StatoPraticaConstants.INTEGRAZIONE)) { document.addKeyword(PortosIndexField.PRATICA_APERTA, true); } - document.addKeyword(PortosIndexField.STATUS, intPraticaFromDB.getStatus()); - if (intPraticaFromDB.getStatusDate() != null) { - document.addKeyword(PortosIndexField.STATUS_DATE, - DATE_FORMAT.format(intPraticaFromDB.getStatusDate())); + document.addKeyword(PortosIndexField.STATUS_DATE, DATE_FORMAT.format(intPraticaFromDB.getStatusDate())); } - // LAVORAZIONE STATO PRATICA if (intPraticaFromDB.getStatoPratica() != null && !intPraticaFromDB.getStatoPratica().equals("")) { document.addKeyword(PortosIndexField.STATO_PRATICA, intPraticaFromDB.getStatoPratica()); } - boolean variata = false; int countVariantiForIntPratica = DettPraticaLocalServiceUtil.countVariateByIntPratica(intPratica .getIntPraticaId()); @@ -227,18 +191,14 @@ public class IntPraticaIndexer extends BaseIndexer { variata = true; } document.addKeyword(PortosIndexField.VARIATA, variata); - document.addKeyword(PortosIndexField.COLLAUDO_COMPLETATO, intPraticaFromDB.getCollaudoTotale()); document.addKeyword(PortosIndexField.COLLAUDO_PARZIALE, intPraticaFromDB.getCollaudoParziale()); - document.addKeyword(PortosIndexField.FINE_LAVORI_COMPLETATI, - intPraticaFromDB.getFineLavoriTotale()); - document.addKeyword(PortosIndexField.FINE_LAVORI_PARZIALI, - intPraticaFromDB.getFineLavoriParziale()); + document.addKeyword(PortosIndexField.FINE_LAVORI_COMPLETATI, intPraticaFromDB.getFineLavoriTotale()); + document.addKeyword(PortosIndexField.FINE_LAVORI_PARZIALI, intPraticaFromDB.getFineLavoriParziale()); document.addKeyword(PortosIndexField.SOTTOPOSTO_A_PARERE, checkSottopostaAParere(intPraticaFromDB.getIntPraticaId())); document.addKeyword(PortosIndexField.LAVORAZIONE_SORTEGGIATA, checkLavorazioneSorteggiata(intPraticaFromDB.getIntPraticaId())); - // Gestione Istruttore if (Validator.isNotNull(intPraticaFromDB.getStatusByUserId())) { document.addKeyword(PortosIndexField.ISTRUTTORE_USER_ID, intPraticaFromDB.getStatusByUserId()); @@ -246,14 +206,12 @@ public class IntPraticaIndexer extends BaseIndexer { UserLocalServiceUtil.getUser(intPraticaFromDB.getStatusByUserId()).getScreenName() .toUpperCase()); } - if (intPratica.getStatusByUserId() != 0L) { User userIstruttore = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId()); if (userIstruttore != null) { document.addText(PortosIndexField.ISTRUTTORE_FULL_NAME, userIstruttore.getFullName()); } } - if (intPratica.getUserId() != 0L) { User proprietarioDigitale = UserLocalServiceUtil.fetchUser(intPratica.getUserId()); if (proprietarioDigitale != null) { @@ -261,90 +219,62 @@ public class IntPraticaIndexer extends BaseIndexer { proprietarioDigitale.getFullName()); } } - // Prendo la lista dei soggetti committenti legati a IntPratica List committenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto( intPratica.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE); - if (lastDettPratica != null) { if (Validator.isNotNull(lastDettPratica.getDescLongIntervento())) { - document.addText(PortosIndexField.DESC_INTERVENTO, - lastDettPratica.getDescLongIntervento()); + document.addText(PortosIndexField.DESC_INTERVENTO, lastDettPratica.getDescLongIntervento()); } - - document.addKeyword(PortosIndexField.NUOVA_COSTRUZIONE, - lastDettPratica.getTcNuovaCostruzione()); - document.addKeyword(PortosIndexField.ADEGUAMENTO_SISMICO, - lastDettPratica.getTcAdeguamentoSismico()); - document.addKeyword(PortosIndexField.MIGLIORAMENTO_SISMICO, - lastDettPratica.getTcMiglioramentoSismico()); + document.addKeyword(PortosIndexField.NUOVA_COSTRUZIONE, lastDettPratica.getTcNuovaCostruzione()); + document.addKeyword(PortosIndexField.ADEGUAMENTO_SISMICO, lastDettPratica.getTcAdeguamentoSismico()); + document.addKeyword(PortosIndexField.MIGLIORAMENTO_SISMICO, lastDettPratica.getTcMiglioramentoSismico()); document.addKeyword(PortosIndexField.RIPARAZIONE_INTERVENTO_LOCALE, lastDettPratica.getTcRiparazioneInterventoLocale()); - } - // Gestione GroupId preso da territorio - Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPraticaFromDB - .getTerritorioId()); + Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPraticaFromDB.getTerritorioId()); if (Validator.isNotNull(territorio)) { document.addKeyword(Field.GROUP_ID, territorio.getGroupId()); } else { document.addKeyword(Field.GROUP_ID, intPraticaFromDB.getGroupId()); } - if (Validator.isNotNull(territorio)) { - if (Validator.isNotNull(territorio.getComuneId())) { - Comune comune = ComuneLocalServiceUtil.fetchComune(territorio.getComuneId()); if (Validator.isNotNull(comune)) { document.addKeyword(PortosIndexField.COMUNE_ID, comune.getComuneId()); document.addKeyword(PortosIndexField.COMUNE_DENOMINAZIONE, comune.getDenominazione()); } - if (Validator.isNotNull(territorio.getCodiceProvincia())) { - Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia()); - if (Validator.isNotNull(provincia)) { - document.addKeyword(PortosIndexField.PROVINCIA_ID, provincia.getProvinciaId()); - document.addKeyword(PortosIndexField.PROVINCIA_CODICE, - provincia.getCodiceProvincia()); + document.addKeyword(PortosIndexField.PROVINCIA_CODICE, provincia.getCodiceProvincia()); document.addKeyword(PortosIndexField.PROVINCIA_NAME, provincia.getProvincia()); - } } } } - document.addKeyword(PortosIndexField.TIPO_PRATICA, intPraticaFromDB.getTipoPratica()); document.addKeywordSortable(PortosIndexField.TIPO_PRATICA, intPraticaFromDB.getTipoPratica()); - // Gestione Parere Geologo List listaParereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId( intPratica.getIntPraticaId(), -1, 1); - if (Validator.isNotNull(listaParereGeologo) && !listaParereGeologo.isEmpty()) { document.addKeyword(PortosIndexField.PARERE_GEOLOGO, "true"); } else { document.addKeyword(PortosIndexField.PARERE_GEOLOGO, "false"); } - // Gestione pratica sospesa document.addKeyword(PortosIndexField.STATUS_SOSPESA, intPraticaFromDB.isSospesa()); - // Gestione Diverse tipologie di IntPratica - // MIEI PROGETTI && ARCHIVIO PROGETTI document.addKeyword(Field.USER_ID, intPraticaFromDB.getUserId()); - // ALTRI PROGETTI if (Validator.isNotNull(committenti) && committenti.size() > 0) { - - // Creao una stringa contenente tutti i codFisc legati alla - // IntPratica separati da , + // Creo una stringa contenente tutti i codFisc legati alla IntPratica separati da , List listaSoggetti = new ArrayList(); for (Soggetto soggetto : committenti) { if (Validator.isNotNull(soggetto.getCognome())) { @@ -356,7 +286,6 @@ public class IntPraticaIndexer extends BaseIndexer { } document.addText(PortosIndexField.COMMITTENTI, listaSoggetti.toArray(new String[0])); } - // Prendo la lista dei direttori dei lavori List direttoriLavori = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto( intPratica.getIntPraticaId(), TipoSoggettoUtil.DIRETTORE_LAVORI); @@ -367,7 +296,6 @@ public class IntPraticaIndexer extends BaseIndexer { } document.addKeyword(PortosIndexField.DIRETTORE_LAVORI, direttori.toArray(new String[0])); } - // Prendo la lista dei collaudatori List collaudatoriList = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto( intPratica.getIntPraticaId(), TipoSoggettoUtil.COLLAUDATORE); @@ -378,45 +306,32 @@ public class IntPraticaIndexer extends BaseIndexer { } document.addKeyword(PortosIndexField.COLLAUDATORI, collaudatori.toArray(new String[0])); } - if (intPraticaFromDB.getStatus() != WorkflowConstants.STATUS_ANY && intPraticaFromDB.getStatus() != WorkflowConstants.STATUS_INCOMPLETE) { - String codiceFiscaleTitolare = UserLocalServiceUtil.getUser(intPraticaFromDB.getUserId()) .getScreenName(); - List listaSoggetti = new ArrayList(); List soggettiInteressati = SoggettoLocalServiceUtil.getValidByIntPratica(intPratica .getIntPraticaId()); for (Soggetto soggetto : soggettiInteressati) { - if (!soggetto.getCodiceFiscale().equalsIgnoreCase(codiceFiscaleTitolare)) { listaSoggetti.add(soggetto.getCodiceFiscale().toUpperCase()); } - } - - document.addKeyword(PortosIndexField.SOGGETTI_INTERESSATI, - listaSoggetti.toArray(new String[0])); + document.addKeyword(PortosIndexField.SOGGETTI_INTERESSATI, listaSoggetti.toArray(new String[0])); } - // Soggetti connessi alla intPratica List listSoggettiInterconnessi = SoggettoLocalServiceUtil .getSoggettiByIntPraticaId_DtRimozioneNull(intPraticaFromDB.getIntPraticaId()); - if (listSoggettiInterconnessi != null && !listSoggettiInterconnessi.isEmpty()) { - List listaStringata = new ArrayList(); - for (Soggetto sog : listSoggettiInterconnessi) { if (Validator.isNotNull(sog.getCognome())) listaStringata.add(sog.getNome() + " " + sog.getCognome()); if (Validator.isNotNull(sog.getDenominazione())) listaStringata.add(sog.getDenominazione()); } - - document.addText(PortosIndexField.SOGGETTI_INTERCONNESSI, - listaStringata.toArray(new String[0])); + document.addText(PortosIndexField.SOGGETTI_INTERCONNESSI, listaStringata.toArray(new String[0])); } } else { _log.warn("Received a null IntPratica in input."); @@ -429,32 +344,25 @@ public class IntPraticaIndexer extends BaseIndexer { throws Exception { if (Validator.isNotNull(document)) { - String title = document.get(""); String content = document.get(""); String intPraticaId = document.get(PortosIndexField.INT_PRATICA_ID); - portletURL.setParameter("struts_action", "/web/TODO"); portletURL.setParameter("intPraticaId", intPraticaId); - return new Summary(title, content, portletURL); } else { _log.warn("Received a null document in input."); return new Summary("---", "---", portletURL); } - } @Override protected Document getBaseModelDocument(String portletId, BaseModel baseModel) throws SystemException { Document document = newDocument(); - String className = baseModel.getModelClassName(); - - long classPK = 0; - long resourcePrimKey = 0; - + long classPK = 0L; + long resourcePrimKey = 0L; if (baseModel instanceof ResourcedModel) { ResourcedModel resourcedModel = (ResourcedModel) baseModel; classPK = resourcedModel.getResourcePrimKey(); @@ -462,65 +370,44 @@ public class IntPraticaIndexer extends BaseIndexer { } else { classPK = GetterUtil.getLong(baseModel.getPrimaryKeyObj()); } - document.addUID(portletId, classPK, className); - document.addKeyword(Field.ENTRY_CLASS_NAME, className); document.addKeyword(Field.ENTRY_CLASS_PK, classPK); document.addKeyword(Field.PORTLET_ID, portletId); - if (resourcePrimKey > 0) { document.addKeyword(Field.ROOT_ENTRY_CLASS_PK, resourcePrimKey); } - if (baseModel instanceof AuditedModel) { AuditedModel auditedModel = (AuditedModel) baseModel; - document.addKeyword(Field.COMPANY_ID, auditedModel.getCompanyId()); document.addDate(Field.CREATE_DATE, auditedModel.getCreateDate()); document.addDate(Field.MODIFIED_DATE, auditedModel.getModifiedDate()); - document.addKeyword(Field.USER_ID, auditedModel.getUserId()); - String userName = PortalUtil.getUserName(auditedModel.getUserId(), auditedModel.getUserName()); - document.addKeyword(Field.USER_NAME, userName, true); - } - GroupedModel groupedModel = null; - if (baseModel instanceof GroupedModel) { groupedModel = (GroupedModel) baseModel; - - // document.addKeyword(Field.GROUP_ID, - // getSiteGroupId(groupedModel.getGroupId())); document.addKeyword(Field.SCOPE_GROUP_ID, groupedModel.getGroupId()); } - if ((groupedModel != null) && (baseModel instanceof TrashedModel)) { TrashedModel trashedModel = (TrashedModel) baseModel; - if (trashedModel.isInTrash()) { addTrashFields(document, trashedModel); } } - addAssetFields(document, className, classPK); - return document; - } @Override protected void doReindex(Object obj) throws Exception { if (Validator.isNotNull(obj)) { - IntPratica intPratica = (IntPratica) obj; Document document = getDocument(intPratica); SearchEngineUtil.updateDocument(getSearchEngineId(), intPratica.getCompanyId(), document, false); - } else { _log.warn("Received a null IntPratica in input."); } @@ -533,16 +420,15 @@ public class IntPraticaIndexer extends BaseIndexer { if (ids != null && ids.length > 0) { long companyId = GetterUtil.getLong(ids[0]); reindexIntPratica(companyId); - } else { _log.warn("Received a null or empty set of ids."); } - } protected void reindexIntPratica(long companyId) throws PortalException, SystemException { ActionableDynamicQuery actionableDynamicQuery = new IntPraticaActionableDynamicQuery() { + @Override protected void performAction(Object object) throws PortalException { @@ -572,7 +458,6 @@ public class IntPraticaIndexer extends BaseIndexer { } }; - actionableDynamicQuery.setCompanyId(companyId); actionableDynamicQuery.setSearchEngineId(getSearchEngineId()); actionableDynamicQuery.performActions(); @@ -583,7 +468,6 @@ public class IntPraticaIndexer extends BaseIndexer { IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(id); doReindex(intPratica); - } @Override @@ -595,26 +479,10 @@ public class IntPraticaIndexer extends BaseIndexer { private boolean checkSottopostaAParere(long intPraticaId) throws SystemException, PortalException { return WorkflowUtil.isWorkflowDisattivabile(intPraticaId); - // List lista = - // ControlloPraticaLocalServiceUtil.findByIntPraticaId_Status(intPraticaId, - // WorkflowConstants.STATUS_APPROVED); - // - // if (Validator.isNotNull(lista) && !lista.isEmpty()) { - // return true; - // } else { - // return false; - // } - } private boolean checkLavorazioneSorteggiata(long intPraticaId) throws SystemException { - Sorteggio sorteggio = SorteggioLocalServiceUtil.findByIntPratica(intPraticaId); - if (Validator.isNotNull(sorteggio)) { - return true; - } else { - return false; - } + return Validator.isNotNull(SorteggioLocalServiceUtil.findByIntPratica(intPraticaId)); } - } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AllegatoManualeImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AllegatoManualeImpl.java index d342abd1..150a5047 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AllegatoManualeImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AllegatoManualeImpl.java @@ -1,33 +1,32 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package it.tref.liferay.portos.bo.model.impl; /** - * The extended model implementation for the AllegatoManuale service. Represents a row in the "portos_bo_AllegatoManuale" database table, with each column mapped to a property of this class. + * The extended model implementation for the AllegatoManuale service. Represents a row in the + * "portos_bo_AllegatoManuale" database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.AllegatoManuale} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.AllegatoManuale} interface. *

* * @author Davide Barbagallo, 3F Consulting */ public class AllegatoManualeImpl extends AllegatoManualeBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this class directly. All methods that expect a allegato manuale model instance should use the {@link it.tref.liferay.portos.bo.model.AllegatoManuale} interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a allegato manuale model + * instance should use the {@link it.tref.liferay.portos.bo.model.AllegatoManuale} interface instead. */ public AllegatoManualeImpl() { } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AsseverazioneImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AsseverazioneImpl.java index cb7467ca..29ec8b71 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AsseverazioneImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AsseverazioneImpl.java @@ -1,14 +1,12 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ @@ -28,14 +26,12 @@ import com.liferay.portal.kernel.json.JSONFactoryUtil; import com.liferay.portal.kernel.util.Validator; /** - * The extended model implementation for the Asseverazione service. Represents a - * row in the "portos_bo_Asseverazione" database table, with each - * column mapped to a property of this class. + * The extended model implementation for the Asseverazione service. Represents a row in the + * "portos_bo_Asseverazione" database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. - * Whenever methods are added, rerun ServiceBuilder to copy their definitions - * into the {@link it.tref.liferay.portos.bo.model.Asseverazione} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Asseverazione} interface. *

* * @author Davide Barbagallo, 3F Consulting @@ -43,15 +39,13 @@ import com.liferay.portal.kernel.util.Validator; @SuppressWarnings("serial") public class AsseverazioneImpl extends AsseverazioneBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this class directly. All methods that expect a - * asseverazione model instance should use the {@link - * it.tref.liferay.portos.bo.model.Asseverazione} interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a asseverazione model instance + * should use the {@link it.tref.liferay.portos.bo.model.Asseverazione} interface instead. */ public AsseverazioneImpl() { } + @Override public Map getDichiarazioniMap() { JSONDeserializer> deserializer = JSONFactoryUtil.createJSONDeserializer(); String dichiarazioni = getDichiarazioni(); @@ -61,6 +55,7 @@ public class AsseverazioneImpl extends AsseverazioneBaseImpl { return deserializer.deserialize(dichiarazioni); } + @Override public String getModello() throws PortalException, SystemException { String modello = ""; switch (this.getTipologia()) { @@ -80,9 +75,8 @@ public class AsseverazioneImpl extends AsseverazioneBaseImpl { modello = "AS-GEO"; break; case TipoSoggettoUtil.PROGETTISTA: - Soggetto soggetto = SoggettoLocalServiceUtil - .getValidByIntPratica_CodiceFiscale_TipologiaSoggetto(this.getIntPraticaId(), - this.getCodiceFiscale(), this.getTipologia()); + Soggetto soggetto = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale_TipologiaSoggetto( + this.getIntPraticaId(), this.getCodiceFiscale(), this.getTipologia()); if (soggetto.getAmbitoProfessione().equals("architettonico")) { modello = "AS-PRA"; } else { @@ -92,4 +86,4 @@ public class AsseverazioneImpl extends AsseverazioneBaseImpl { } return modello; } -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AvvisoImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AvvisoImpl.java index dcccc32a..28caf7c2 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AvvisoImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AvvisoImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.model.impl; @@ -30,87 +30,77 @@ import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.language.LanguageUtil; import com.liferay.portal.kernel.repository.model.FileEntry; import com.liferay.portal.kernel.util.LocaleUtil; +import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.theme.ThemeDisplay; import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil; import com.liferay.portlet.documentlibrary.util.DLUtil; /** - * The extended model implementation for the Avviso service. Represents a row in - * the "portos_bo_Avviso" database table, with each column mapped to a - * property of this class. + * The extended model implementation for the Avviso service. Represents a row in the "portos_bo_Avviso" + * database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. - * Whenever methods are added, rerun ServiceBuilder to copy their definitions - * into the {@link it.tref.liferay.portos.bo.model.Avviso} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Avviso} interface. *

* * @author Davide Barbagallo, 3F Consulting */ public class AvvisoImpl extends AvvisoBaseImpl { /** - * + * */ private static final long serialVersionUID = -2350602144741897095L; /* - * NOTE FOR DEVELOPERS: Never reference this class directly. All methods - * that expect a avviso model instance should use the {@link - * it.tref.liferay.portos.bo.model.Avviso} interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a avviso model instance should + * use the {@link it.tref.liferay.portos.bo.model.Avviso} interface instead. */ public AvvisoImpl() { } + @Override public String getFullDescription() throws PortalException, SystemException { String tipoDocumento = AvvisoUtil.getAllTipoDocumento().containsKey(this.getTipoDocumento()) ? AvvisoUtil .getAllTipoDocumento().get(this.getTipoDocumento()) : "label.admingeniocivile.avviso.tipoDocumento.avvisomanuale"; - String fullDescription = LanguageUtil.get(LocaleUtil.ITALIAN, tipoDocumento); - if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.VIDIMATA)) { if (this.getClassName().equals(DettPratica.class.getName())) { DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(this.getClassPk()); - if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica - .getTipoIntegrazione())) { - fullDescription += " di " - + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-12") + ""; + if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { + fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-12") + + ""; } else if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica .getTipoIntegrazione())) { - fullDescription += " di " - + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-05") + " n° " - + dettPratica.getIntegrazione() + ""; + fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-05") + + " n° " + dettPratica.getIntegrazione() + ""; } else if (TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { - fullDescription += " di " - + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-13") + " n° " - + dettPratica.getVarianteNumero() + ""; + fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-13") + + " n° " + dettPratica.getVarianteNumero() + ""; } } else if (this.getClassName().equals(FineLavori.class.getName())) { FineLavori fineLavori = FineLavoriLocalServiceUtil.getFineLavori(this.getClassPk()); fullDescription += " di " - + LanguageUtil.get(LocaleUtil.ITALIAN, - "label-integrazione-" + (fineLavori.getParziale() ? "09" : "07")) + " n° " - + fineLavori.getNumero() + ""; + + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-" + + (fineLavori.getParziale() ? "09" : "07")) + " n° " + fineLavori.getNumero() + + ""; } else if (this.getClassName().equals(Collaudo.class.getName())) { Collaudo collaudo = CollaudoLocalServiceUtil.getCollaudo(this.getClassPk()); fullDescription += " di " - + LanguageUtil.get(LocaleUtil.ITALIAN, - "label-integrazione-" + (collaudo.getParziale() ? "10" : "08")) + " n° " - + collaudo.getNumero() + ""; + + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-" + + (collaudo.getParziale() ? "10" : "08")) + " n° " + collaudo.getNumero() + ""; } - } else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.CONFORME)) { IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId()); - return LanguageUtil.get( LocaleUtil.ITALIAN, AvvisoUtil.getAllTipoDocumento().get( PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.CONFORME, intPratica))); - } else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.NON_CONFORME)) { IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId()); return LanguageUtil.get( @@ -118,10 +108,10 @@ public class AvvisoImpl extends AvvisoBaseImpl { AvvisoUtil.getAllTipoDocumento().get( PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.NON_CONFORME, intPratica))); } - return fullDescription; } + @Override public String getDescriptionOggettoProtocollo() throws PortalException, SystemException { String fullDescription = LanguageUtil.get(LocaleUtil.ITALIAN, @@ -132,15 +122,11 @@ public class AvvisoImpl extends AvvisoBaseImpl { } else if (Validator.isNotNull(this.getDescLong())) { fullDescription = this.getDescLong(); } - if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.VIDIMATA)) { - if (this.getClassName().equals(DettPratica.class.getName())) { DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(this.getClassPk()); - if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica - .getTipoIntegrazione())) { - fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-12") - + ""; + if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { + fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-12") + ""; } else if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica .getTipoIntegrazione())) { fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-05"); @@ -150,24 +136,20 @@ public class AvvisoImpl extends AvvisoBaseImpl { } else if (this.getClassName().equals(FineLavori.class.getName())) { FineLavori fineLavori = FineLavoriLocalServiceUtil.getFineLavori(this.getClassPk()); fullDescription += " di " - + LanguageUtil.get(LocaleUtil.ITALIAN, - "label-integrazione-" + (fineLavori.getParziale() ? "09" : "07")); - + + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-" + + (fineLavori.getParziale() ? "09" : "07")); } else if (this.getClassName().equals(Collaudo.class.getName())) { Collaudo collaudo = CollaudoLocalServiceUtil.getCollaudo(this.getClassPk()); fullDescription += " di " - + LanguageUtil.get(LocaleUtil.ITALIAN, - "label-integrazione-" + (collaudo.getParziale() ? "10" : "08")); + + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-" + + (collaudo.getParziale() ? "10" : "08")); } - } else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.CONFORME)) { IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId()); - return LanguageUtil.get( LocaleUtil.ITALIAN, AvvisoUtil.getAllTipoDocumento().get( PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.CONFORME, intPratica))); - } else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.NON_CONFORME)) { IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId()); return LanguageUtil.get( @@ -175,40 +157,34 @@ public class AvvisoImpl extends AvvisoBaseImpl { AvvisoUtil.getAllTipoDocumento().get( PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.NON_CONFORME, intPratica))); } - - return fullDescription.replace("Avviso di ", ""); + return fullDescription.replace("Avviso di ", StringPool.BLANK); } + @Override public String getDownloadUrl(ThemeDisplay themeDisplay) throws PortalException, SystemException { if (Validator.isNotNull(getFileEntryIdInvio())) { - FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(getFileEntryIdInvio()); - - return DLUtil - .getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, "&download=true"); + return DLUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, "&download=true"); } return null; } + @Override public String translateTipoDocumento() throws PortalException, SystemException { String tipoDocumento = AvvisoUtil.getAllTipoDocumento().containsKey(this.getTipoDocumento()) ? AvvisoUtil .getAllTipoDocumento().get(this.getTipoDocumento()) : "label.admingeniocivile.avviso.tipoDocumento.avvisomanuale"; - if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.CONFORME)) { IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId()); tipoDocumento = AvvisoUtil.getAllTipoDocumento().get( PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.CONFORME, intPratica)); - } else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.NON_CONFORME)) { IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId()); tipoDocumento = AvvisoUtil.getAllTipoDocumento().get( PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.NON_CONFORME, intPratica)); } - return tipoDocumento; - } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/CollaudoImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/CollaudoImpl.java index 361e5b37..47562fe8 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/CollaudoImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/CollaudoImpl.java @@ -54,7 +54,6 @@ public class CollaudoImpl extends CollaudoBaseImpl { public String getTitle(Locale locale) { StringBuilder sb = new StringBuilder(); - try { IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(getIntPraticaId()); if (AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId())) { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ComuneImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ComuneImpl.java index ddec84f4..bf6bc9b4 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ComuneImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ComuneImpl.java @@ -31,11 +31,11 @@ package it.tref.liferay.portos.bo.model.impl; public class ComuneImpl extends ComuneBaseImpl { /* * NOTE FOR DEVELOPERS: - * + * * Never reference this class directly. All methods that expect a comune * model instance should use the {@link * it.tref.liferay.portos.bo.model.Comune} interface instead. */ public ComuneImpl() { } -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ComunicazioneImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ComunicazioneImpl.java index 05c80b7c..54ff6e2e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ComunicazioneImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ComunicazioneImpl.java @@ -31,4 +31,4 @@ public class ComunicazioneImpl extends ComunicazioneBaseImpl { */ public ComunicazioneImpl() { } -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ConfigurazioneImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ConfigurazioneImpl.java index 44bbcddd..ccc4653c 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ConfigurazioneImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ConfigurazioneImpl.java @@ -31,4 +31,4 @@ public class ConfigurazioneImpl extends ConfigurazioneBaseImpl { */ public ConfigurazioneImpl() { } -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ControlloPraticaImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ControlloPraticaImpl.java index b7c181a5..d4bcfcd5 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ControlloPraticaImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ControlloPraticaImpl.java @@ -31,11 +31,11 @@ package it.tref.liferay.portos.bo.model.impl; public class ControlloPraticaImpl extends ControlloPraticaBaseImpl { /* * NOTE FOR DEVELOPERS: - * + * * Never reference this class directly. All methods that expect a controllo * pratica model instance should use the {@link * it.tref.liferay.portos.bo.model.ControlloPratica} interface instead. */ public ControlloPraticaImpl() { } -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DelegaImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DelegaImpl.java index c0936b0f..71c8968a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DelegaImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DelegaImpl.java @@ -15,7 +15,6 @@ package it.tref.liferay.portos.bo.model.impl; import java.io.Serializable; -import java.util.HashMap; import java.util.Map; import com.liferay.portal.kernel.json.JSONDeserializer; @@ -39,7 +38,7 @@ import com.liferay.portal.kernel.util.Validator; public class DelegaImpl extends DelegaBaseImpl { /* * NOTE FOR DEVELOPERS: - * + * * Never reference this class directly. All methods that expect a delega * model instance should use the {@link * it.tref.liferay.portos.bo.model.Delega} interface instead. @@ -47,7 +46,9 @@ public class DelegaImpl extends DelegaBaseImpl { public DelegaImpl() { } + @Override public Map getDichiarazioniMap() { + JSONDeserializer> deserializer = JSONFactoryUtil.createJSONDeserializer(); String dichiarazioni = getDichiarazioni(); if (Validator.isNull(dichiarazioni)) { @@ -55,4 +56,4 @@ public class DelegaImpl extends DelegaBaseImpl { } return deserializer.deserialize(dichiarazioni); } -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DettPraticaImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DettPraticaImpl.java index f45467cf..84d0eec3 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DettPraticaImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DettPraticaImpl.java @@ -70,9 +70,7 @@ public class DettPraticaImpl extends DettPraticaBaseImpl { StringBuilder sb = new StringBuilder(); IntPratica intPratica = null; - try { - intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(getIntPraticaId()); if (AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId())) { sb.append("Deposito "); @@ -778,7 +776,6 @@ public class DettPraticaImpl extends DettPraticaBaseImpl { Validator.isNull(getIntervFinPubDesc()) ? StringPool.BLANK : LanguageUtil.get( LocaleUtil.getSiteDefault(), "interv-fin-pub-desc")); attributes.put("dpdc", getDpdc() ? StringPool.TRUE : StringPool.FALSE); - return attributes; } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DocAggiuntivaImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DocAggiuntivaImpl.java index b83a46ab..9fbc922f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DocAggiuntivaImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DocAggiuntivaImpl.java @@ -37,7 +37,7 @@ import com.liferay.portlet.documentlibrary.service.DLFileEntryServiceUtil; public class DocAggiuntivaImpl extends DocAggiuntivaBaseImpl { /* * NOTE FOR DEVELOPERS: - * + * * Never reference this class directly. All methods that expect a doc * aggiuntiva model instance should use the {@link * it.tref.liferay.portos.bo.model.DocAggiuntiva} interface instead. @@ -45,13 +45,13 @@ public class DocAggiuntivaImpl extends DocAggiuntivaBaseImpl { public DocAggiuntivaImpl() { } + @Override public String getFileName() throws PortalException, SystemException { if (getFileEntryId() == 0L && getOldFileEntryId() != 0L) { FilesImporter.handleFileImportDocAggiuntiva(this); return StringPool.BLANK; } - DLFileEntry file = DLFileEntryServiceUtil.getFileEntry(getFileEntryId()); return file.getDescription(); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DocPraticaImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DocPraticaImpl.java index 3e91e3ea..c0a9e58c 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DocPraticaImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DocPraticaImpl.java @@ -39,7 +39,7 @@ import com.liferay.portlet.documentlibrary.util.DLUtil; public class DocPraticaImpl extends DocPraticaBaseImpl { /* * NOTE FOR DEVELOPERS: - * + * * Never reference this class directly. All methods that expect a doc * pratica model instance should use the {@link * it.tref.liferay.portos.bo.model.DocPratica} interface instead. @@ -56,6 +56,7 @@ public class DocPraticaImpl extends DocPraticaBaseImpl { return file.getTitle(); } + @Override public String getDownloadUrl(ThemeDisplay themeDisplay) throws PortalException, SystemException { if (Validator.isNull(getDlFileEntryId())) { return "Da importare"; @@ -63,5 +64,4 @@ public class DocPraticaImpl extends DocPraticaBaseImpl { FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(getDlFileEntryId()); return DLUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, "&download=true"); } - } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/FineLavoriImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/FineLavoriImpl.java index 578164d4..835a6118 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/FineLavoriImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/FineLavoriImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.model.impl; @@ -29,84 +29,68 @@ import com.liferay.portal.kernel.util.Validator; /** * The extended model implementation for the FineLavori service. Represents a row in the - * "portos_bo_FineLavori" database table, with each column mapped to a property of this - * class. + * "portos_bo_FineLavori" database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. Whenever methods are added, - * rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.model.FineLavori} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.FineLavori} interface. *

* * @author Davide Barbagallo, 3F Consulting */ +@SuppressWarnings("serial") public class FineLavoriImpl extends FineLavoriBaseImpl { - /* - * NOTE FOR DEVELOPERS: - * - * Never reference this class directly. All methods that expect a fine lavori model instance - * should use the {@link it.tref.liferay.portos.bo.model.FineLavori} interface instead. - */ - - private static final Log _log = LogFactoryUtil.getLog(FineLavoriImpl.class); - - public FineLavoriImpl() {} - - public String getTitle(Locale locale) { - - StringBuilder sb = new StringBuilder(); - - try { - - IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(getIntPraticaId()); - // sb.append("Progetto "); - if (AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId())) { - sb.append("Deposito "); - } else if (AzioniPraticheUtil.isAutorizzazione(intPratica.getIntPraticaId())) { - sb.append("Autorizzazione "); - } - sb.append("n. "); - - if (Validator.isNotNull(getProtocollo())) { - sb.append(intPratica.getNumeroProgetto()); - - // TODO da decidere che data, per adesso si mette quella di creazione il numero protocollo - // sbagliato dovrebbe essere il primo - sb.append(" del "); - sb.append(FastDateFormatFactoryUtil.getDate(locale).format(intPratica.getDtPratica())); - sb.append(StringPool.SPACE + StringPool.DASH + StringPool.SPACE); - sb.append(" id "); - sb.append(intPratica.getIntPraticaId()); - - } else { - if (Validator.isNotNull(intPratica.getNumeroProgetto())) { - sb.append(intPratica.getNumeroProgetto()); - sb.append(StringPool.SPACE + StringPool.DASH + StringPool.SPACE); - } - sb.append(getFineLavoriId()); - sb.append(" (Temporaneo) "); - sb.append(StringPool.SPACE + StringPool.DASH + StringPool.SPACE); - sb.append(" id "); - sb.append(intPratica.getIntPraticaId()); - } - - } catch (PortalException e) { - _log.error(e, e); - } catch (SystemException e) { - _log.error(e, e); - } - - return sb.toString(); - - } - - public String getTitle() { - - return getTitle(LocaleUtil.getSiteDefault()); - } - - public String getFullDescription() { - - return getTitle(); - } + /* + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a fine lavori model instance + * should use the {@link it.tref.liferay.portos.bo.model.FineLavori} interface instead. + */ + + private static final Log _log = LogFactoryUtil.getLog(FineLavoriImpl.class); + + public FineLavoriImpl() { + } + + @Override + public String getTitle(Locale locale) { + + StringBuilder sb = new StringBuilder(); + try { + IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(getIntPraticaId()); + if (AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId())) { + sb.append("Deposito "); + } else if (AzioniPraticheUtil.isAutorizzazione(intPratica.getIntPraticaId())) { + sb.append("Autorizzazione "); + } + sb.append("n. "); + if (Validator.isNotNull(getProtocollo())) { + // TODO da decidere che data, per adesso si mette quella di creazione il numero protocollo + // sbagliato dovrebbe essere il primo + sb.append(intPratica.getNumeroProgetto()).append(" del ") + .append(FastDateFormatFactoryUtil.getDate(locale).format(intPratica.getDtPratica())) + .append(" - id ").append(intPratica.getIntPraticaId()); + + } else { + if (Validator.isNotNull(intPratica.getNumeroProgetto())) { + sb.append(intPratica.getNumeroProgetto()).append(StringPool.SPACE).append(StringPool.DASH) + .append(StringPool.SPACE); + } + sb.append(getFineLavoriId()).append(" (Temporaneo) - id ").append(intPratica.getIntPraticaId()); + } + } catch (PortalException | SystemException e) { + _log.error(e, e); + } + return sb.toString(); + } + + @Override + public String getTitle() { + + return getTitle(LocaleUtil.getSiteDefault()); + } + + @Override + public String getFullDescription() { + + return getTitle(); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/HistoryWorkflowActionImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/HistoryWorkflowActionImpl.java index 8be9b6f7..1b03145a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/HistoryWorkflowActionImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/HistoryWorkflowActionImpl.java @@ -1,28 +1,24 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package it.tref.liferay.portos.bo.model.impl; /** - * The extended model implementation for the HistoryWorkflowAction service. - * Represents a row in the "portos_bo_HistoryWorkflowAction" database - * table, with each column mapped to a property of this class. + * The extended model implementation for the HistoryWorkflowAction service. Represents a row in the + * "portos_bo_HistoryWorkflowAction" database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. - * Whenever methods are added, rerun ServiceBuilder to copy their definitions - * into the {@link it.tref.liferay.portos.bo.model.HistoryWorkflowAction} + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.HistoryWorkflowAction} * interface. *

* @@ -31,12 +27,9 @@ package it.tref.liferay.portos.bo.model.impl; @SuppressWarnings("serial") public class HistoryWorkflowActionImpl extends HistoryWorkflowActionBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this class directly. All methods that expect a history - * workflow action model instance should use the {@link - * it.tref.liferay.portos.bo.model.HistoryWorkflowAction} interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a history workflow action model + * instance should use the {@link it.tref.liferay.portos.bo.model.HistoryWorkflowAction} interface instead. */ public HistoryWorkflowActionImpl() { } -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IUVImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IUVImpl.java index 161e1e10..c0614473 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IUVImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IUVImpl.java @@ -1,28 +1,24 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package it.tref.liferay.portos.bo.model.impl; /** - * The extended model implementation for the IUV service. Represents a row in - * the "portos_bo_IUV" database table, with each column mapped to a - * property of this class. + * The extended model implementation for the IUV service. Represents a row in the "portos_bo_IUV" database + * table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. - * Whenever methods are added, rerun ServiceBuilder to copy their definitions - * into the {@link it.tref.liferay.portos.bo.model.IUV} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.IUV} interface. *

* * @author Davide Barbagallo, 3F Consulting @@ -30,12 +26,9 @@ package it.tref.liferay.portos.bo.model.impl; @SuppressWarnings("serial") public class IUVImpl extends IUVBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this class directly. All methods that expect a i u v - * model instance should use the {@link it.tref.liferay.portos.bo.model.IUV} - * interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a i u v model instance should + * use the {@link it.tref.liferay.portos.bo.model.IUV} interface instead. */ public IUVImpl() { } -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/InfoFascicoloImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/InfoFascicoloImpl.java index f924c80d..47e532a5 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/InfoFascicoloImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/InfoFascicoloImpl.java @@ -1,28 +1,24 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package it.tref.liferay.portos.bo.model.impl; /** - * The extended model implementation for the InfoFascicolo service. Represents a - * row in the "portos_bo_InfoFascicolo" database table, with each - * column mapped to a property of this class. + * The extended model implementation for the InfoFascicolo service. Represents a row in the + * "portos_bo_InfoFascicolo" database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. - * Whenever methods are added, rerun ServiceBuilder to copy their definitions - * into the {@link it.tref.liferay.portos.bo.model.InfoFascicolo} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.InfoFascicolo} interface. *

* * @author Davide Barbagallo, 3F Consulting @@ -30,12 +26,9 @@ package it.tref.liferay.portos.bo.model.impl; @SuppressWarnings("serial") public class InfoFascicoloImpl extends InfoFascicoloBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this class directly. All methods that expect a info - * fascicolo model instance should use the {@link - * it.tref.liferay.portos.bo.model.InfoFascicolo} interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a info fascicolo model instance + * should use the {@link it.tref.liferay.portos.bo.model.InfoFascicolo} interface instead. */ public InfoFascicoloImpl() { } -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IntPraticaImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IntPraticaImpl.java index 3a6c33b9..c28d2e0e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IntPraticaImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IntPraticaImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.model.impl; @@ -21,26 +21,25 @@ import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.util.LocaleUtil; +import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.Validator; /** - * The extended model implementation for the IntPratica service. Represents a - * row in the "portos_bo_IntPratica" database table, with each column - * mapped to a property of this class. + * The extended model implementation for the IntPratica service. Represents a row in the + * "portos_bo_IntPratica" database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. - * Whenever methods are added, rerun ServiceBuilder to copy their definitions - * into the {@link it.tref.liferay.portos.bo.model.IntPratica} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.IntPratica} interface. *

* * @author Davide Barbagallo, 3F Consulting */ +@SuppressWarnings("serial") public class IntPraticaImpl extends IntPraticaBaseImpl { /* - * NOTE FOR DEVELOPERS: Never reference this class directly. All methods - * that expect a int pratica model instance should use the {@link - * it.tref.liferay.portos.bo.model.IntPratica} interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a int pratica model instance + * should use the {@link it.tref.liferay.portos.bo.model.IntPratica} interface instead. */ private static final Log _log = LogFactoryUtil.getLog(IntPraticaImpl.class); @@ -49,6 +48,7 @@ public class IntPraticaImpl extends IntPraticaBaseImpl { } + @Override public String getTitle(Locale locale, boolean completed) { DettPratica dettPratica = null; @@ -56,7 +56,6 @@ public class IntPraticaImpl extends IntPraticaBaseImpl { if (completed) { dettPratica = DettPraticaLocalServiceUtil .getLastCompletedByIntPraticaAndProtocolloNotEmpty(getIntPraticaId()); - } else { dettPratica = DettPraticaLocalServiceUtil.getLastEditableByIntPratica(getIntPraticaId()); if (dettPratica == null) { @@ -66,34 +65,31 @@ public class IntPraticaImpl extends IntPraticaBaseImpl { } catch (SystemException e) { _log.error("Error on intPraticaId=" + getIntPraticaId(), e); } - - return Validator.isNotNull(dettPratica) ? dettPratica.getTitle(locale) : "-"; + return Validator.isNotNull(dettPratica) ? dettPratica.getTitle(locale) : StringPool.DASH; } + @Override public String getTitle(boolean completed) { return getTitle(LocaleUtil.getSiteDefault(), completed); } + @Override public boolean isAnnullata() { return Validator.isNotNull(this.getDtAnnullamento()); } + @Override public boolean isChiusa() throws SystemException { boolean completata = false; - DettPratica lastDettPratica = DettPraticaLocalServiceUtil - .getLastCompletedByIntPratica(getIntPraticaId()); - + DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(getIntPraticaId()); if (getCollaudoTotale()) { completata = true; } else if (lastDettPratica != null && lastDettPratica.getCollaudoStatico() && getFineLavoriTotale()) { completata = true; - } else { - completata = false; } - return completata; } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/PagamentoImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/PagamentoImpl.java index 569f3b0d..38419998 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/PagamentoImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/PagamentoImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.model.impl; @@ -25,45 +25,45 @@ import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil; import com.liferay.portlet.documentlibrary.util.DLUtil; /** - * The extended model implementation for the Pagamento service. Represents a row in the - * "portos_bo_Pagamento" database table, with each column mapped to a property of this - * class. + * The extended model implementation for the Pagamento service. Represents a row in the "portos_bo_Pagamento" + * database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. Whenever methods are added, - * rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.model.Pagamento} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Pagamento} interface. *

* * @author Davide Barbagallo, 3F Consulting */ +@SuppressWarnings("serial") public class PagamentoImpl extends PagamentoBaseImpl { - /* - * NOTE FOR DEVELOPERS: - * - * Never reference this class directly. All methods that expect a pagamento model instance should - * use the {@link it.tref.liferay.portos.bo.model.Pagamento} interface instead. - */ - public PagamentoImpl() {} + /* + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a pagamento model instance + * should use the {@link it.tref.liferay.portos.bo.model.Pagamento} interface instead. + */ + public PagamentoImpl() { + } - public String getDownloadUrl(ThemeDisplay themeDisplay) throws PortalException, SystemException { - if (Validator.isNull(getFileEntryId())) { - return null; - } + @Override + public String getDownloadUrl(ThemeDisplay themeDisplay) throws PortalException, SystemException { - FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(getFileEntryId()); - return DLUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, "&download=true"); + if (Validator.isNull(getFileEntryId())) { + return null; + } + FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(getFileEntryId()); + return DLUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, "&download=true"); + } - } + @Override + public String getImportoString() { - public String getImportoString() { - String importo = getImporto(); - BigDecimal importoVal; - if (Validator.isNotNull(importo)) { - importoVal = new BigDecimal(importo); - } else { - importoVal = new BigDecimal(0.00); - } - return NumberFormat.getCurrencyInstance(Locale.ITALY).format(importoVal); - } + String importo = getImporto(); + BigDecimal importoVal; + if (Validator.isNotNull(importo)) { + importoVal = new BigDecimal(importo); + } else { + importoVal = new BigDecimal(0.00); + } + return NumberFormat.getCurrencyInstance(Locale.ITALY).format(importoVal); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ParereGeologoImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ParereGeologoImpl.java index 0833751a..af84d1e6 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ParereGeologoImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ParereGeologoImpl.java @@ -1,34 +1,34 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package it.tref.liferay.portos.bo.model.impl; /** - * The extended model implementation for the ParereGeologo service. Represents a row in the "portos_bo_ParereGeologo" database table, with each column mapped to a property of this class. + * The extended model implementation for the ParereGeologo service. Represents a row in the + * "portos_bo_ParereGeologo" database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.ParereGeologo} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.ParereGeologo} interface. *

* * @author Davide Barbagallo, 3F Consulting */ +@SuppressWarnings("serial") public class ParereGeologoImpl extends ParereGeologoBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this class directly. All methods that expect a parere geologo model instance should use the {@link it.tref.liferay.portos.bo.model.ParereGeologo} interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a parere geologo model instance + * should use the {@link it.tref.liferay.portos.bo.model.ParereGeologo} interface instead. */ public ParereGeologoImpl() { } -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ProvinciaImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ProvinciaImpl.java index da2f7ada..eebbcf50 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ProvinciaImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ProvinciaImpl.java @@ -1,28 +1,24 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package it.tref.liferay.portos.bo.model.impl; /** - * The extended model implementation for the Provincia service. Represents a row - * in the "portos_provincia" database table, with each column mapped - * to a property of this class. + * The extended model implementation for the Provincia service. Represents a row in the "portos_provincia" + * database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. - * Whenever methods are added, rerun ServiceBuilder to copy their definitions - * into the {@link it.tref.liferay.portos.bo.model.Provincia} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Provincia} interface. *

* * @author Davide Barbagallo, 3F Consulting @@ -30,12 +26,9 @@ package it.tref.liferay.portos.bo.model.impl; @SuppressWarnings("serial") public class ProvinciaImpl extends ProvinciaBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this class directly. All methods that expect a provincia - * model instance should use the {@link - * it.tref.liferay.portos.bo.model.Provincia} interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a provincia model instance + * should use the {@link it.tref.liferay.portos.bo.model.Provincia} interface instead. */ public ProvinciaImpl() { } -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/SoggettoImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/SoggettoImpl.java index 44f2b5f0..f8389957 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/SoggettoImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/SoggettoImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.model.impl; @@ -18,14 +18,12 @@ import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.Validator; /** - * The extended model implementation for the Soggetto service. Represents a row - * in the "portos_bo_Soggetto" database table, with each column mapped - * to a property of this class. + * The extended model implementation for the Soggetto service. Represents a row in the "portos_bo_Soggetto" + * database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. - * Whenever methods are added, rerun ServiceBuilder to copy their definitions - * into the {@link it.tref.liferay.portos.bo.model.Soggetto} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Soggetto} interface. *

* * @author Davide Barbagallo, 3F Consulting @@ -33,18 +31,16 @@ import com.liferay.portal.kernel.util.Validator; @SuppressWarnings("serial") public class SoggettoImpl extends SoggettoBaseImpl { /* - * NOTE FOR DEVELOPERS: Never reference this class directly. All methods - * that expect a soggetto model instance should use the {@link - * it.tref.liferay.portos.bo.model.Soggetto} interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a soggetto model instance + * should use the {@link it.tref.liferay.portos.bo.model.Soggetto} interface instead. */ public SoggettoImpl() { - } + @Override public String getFullTipologiaSoggetto() { String tipologia = LanguageUtil.get(LocaleUtil.ITALIAN, "gc-soggetto-" + getTipologiaSoggetto()); - String ambito = StringPool.BLANK; if (Validator.isNotNull(getAmbitoProfessione())) { ambito = StringPool.SPACE + StringPool.DASH + StringPool.SPACE; @@ -57,10 +53,10 @@ public class SoggettoImpl extends SoggettoBaseImpl { return tipologia + ambito; } + @Override public String getDescrizioneCompleta() { - String descrizione = getCodiceFiscale().toUpperCase() + StringPool.SPACE + "-"; - + String descrizione = getCodiceFiscale().toUpperCase() + StringPool.SPACE + StringPool.DASH; if (Validator.isNotNull(getCognome())) { descrizione += StringPool.SPACE + getCognome(); } @@ -73,10 +69,10 @@ public class SoggettoImpl extends SoggettoBaseImpl { return descrizione; } + @Override public String getDescrizioneCompletaAccessoAtti() { - String descrizione = ""; - + String descrizione = StringPool.BLANK; if (Validator.isNotNull(getCognome())) { descrizione += StringPool.SPACE + getCognome(); } @@ -87,9 +83,9 @@ public class SoggettoImpl extends SoggettoBaseImpl { descrizione += StringPool.SPACE + getDenominazione(); } return descrizione; - } + @Override public String getDescrizioneRuolo() { String descrizione = getDescrizioneCompleta(); @@ -97,6 +93,7 @@ public class SoggettoImpl extends SoggettoBaseImpl { return descrizione + " - " + ruolo; } + @Override public String getTitle() { if (Validator.isNotNull(getDenominazione())) { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/SorteggioImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/SorteggioImpl.java index c7806456..0a81a738 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/SorteggioImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/SorteggioImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.model.impl; @@ -15,14 +15,12 @@ package it.tref.liferay.portos.bo.model.impl; import com.liferay.portal.kernel.util.Validator; /** - * The extended model implementation for the Sorteggio service. Represents a row - * in the "portos_bo_Sorteggio" database table, with each column - * mapped to a property of this class. + * The extended model implementation for the Sorteggio service. Represents a row in the "portos_bo_Sorteggio" + * database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. - * Whenever methods are added, rerun ServiceBuilder to copy their definitions - * into the {@link it.tref.liferay.portos.bo.model.Sorteggio} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Sorteggio} interface. *

* * @author Davide Barbagallo, 3F Consulting @@ -30,16 +28,15 @@ import com.liferay.portal.kernel.util.Validator; @SuppressWarnings("serial") public class SorteggioImpl extends SorteggioBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this class directly. All methods that expect a sorteggio - * model instance should use the {@link - * it.tref.liferay.portos.bo.model.Sorteggio} interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a sorteggio model instance + * should use the {@link it.tref.liferay.portos.bo.model.Sorteggio} interface instead. */ public SorteggioImpl() { } + @Override public boolean mesePrecedenteToBoolean() { + if (Validator.isNull(getMesePrecedente())) { return false; } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/StoricoSoggettoPraticaImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/StoricoSoggettoPraticaImpl.java index e4cc48cf..4334f9bb 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/StoricoSoggettoPraticaImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/StoricoSoggettoPraticaImpl.java @@ -1,28 +1,24 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package it.tref.liferay.portos.bo.model.impl; /** - * The extended model implementation for the StoricoSoggettoPratica service. - * Represents a row in the "portos_bo_StoricoSoggettoPratica" database - * table, with each column mapped to a property of this class. + * The extended model implementation for the StoricoSoggettoPratica service. Represents a row in the + * "portos_bo_StoricoSoggettoPratica" database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. - * Whenever methods are added, rerun ServiceBuilder to copy their definitions - * into the {@link it.tref.liferay.portos.bo.model.StoricoSoggettoPratica} + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.StoricoSoggettoPratica} * interface. *

* @@ -31,13 +27,9 @@ package it.tref.liferay.portos.bo.model.impl; @SuppressWarnings("serial") public class StoricoSoggettoPraticaImpl extends StoricoSoggettoPraticaBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this class directly. All methods that expect a storico - * soggetto pratica model instance should use the {@link - * it.tref.liferay.portos.bo.model.StoricoSoggettoPratica} interface - * instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a storico soggetto pratica + * model instance should use the {@link it.tref.liferay.portos.bo.model.StoricoSoggettoPratica} interface instead. */ public StoricoSoggettoPraticaImpl() { } -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/TempisticaImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/TempisticaImpl.java index 3ac46fd7..b4ecc628 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/TempisticaImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/TempisticaImpl.java @@ -1,34 +1,34 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package it.tref.liferay.portos.bo.model.impl; /** - * The extended model implementation for the Tempistica service. Represents a row in the "portos_bo_Tempistica" database table, with each column mapped to a property of this class. + * The extended model implementation for the Tempistica service. Represents a row in the + * "portos_bo_Tempistica" database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Tempistica} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Tempistica} interface. *

* * @author Davide Barbagallo, 3F Consulting */ +@SuppressWarnings("serial") public class TempisticaImpl extends TempisticaBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this class directly. All methods that expect a tempistica model instance should use the {@link it.tref.liferay.portos.bo.model.Tempistica} interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a tempistica model instance + * should use the {@link it.tref.liferay.portos.bo.model.Tempistica} interface instead. */ public TempisticaImpl() { } -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/TerritorioImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/TerritorioImpl.java index 80c12765..e616da6d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/TerritorioImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/TerritorioImpl.java @@ -1,41 +1,38 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.model.impl; /** - * The extended model implementation for the Territorio service. Represents a - * row in the "portos_bo_Territorio" database table, with each column - * mapped to a property of this class. + * The extended model implementation for the Territorio service. Represents a row in the + * "portos_bo_Territorio" database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. - * Whenever methods are added, rerun ServiceBuilder to copy their definitions - * into the {@link it.tref.liferay.portos.bo.model.Territorio} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Territorio} interface. *

* * @author Davide Barbagallo, 3F Consulting */ +@SuppressWarnings("serial") public class TerritorioImpl extends TerritorioBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this class directly. All methods that expect a territorio - * model instance should use the {@link - * it.tref.liferay.portos.bo.model.Territorio} interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a territorio model instance + * should use the {@link it.tref.liferay.portos.bo.model.Territorio} interface instead. */ public TerritorioImpl() { } + @Override public String getZonaFasciaDesc() { String ret = "Zona " + getZona(); if (getArticolo61()) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/UtentePortosImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/UtentePortosImpl.java index b2732ecb..c24e1280 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/UtentePortosImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/UtentePortosImpl.java @@ -1,28 +1,24 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package it.tref.liferay.portos.bo.model.impl; /** - * The extended model implementation for the UtentePortos service. Represents a - * row in the "portos_bo_UtentePortos" database table, with each - * column mapped to a property of this class. + * The extended model implementation for the UtentePortos service. Represents a row in the + * "portos_bo_UtentePortos" database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. - * Whenever methods are added, rerun ServiceBuilder to copy their definitions - * into the {@link it.tref.liferay.portos.bo.model.UtentePortos} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.UtentePortos} interface. *

* * @author Davide Barbagallo, 3F Consulting @@ -30,12 +26,9 @@ package it.tref.liferay.portos.bo.model.impl; @SuppressWarnings("serial") public class UtentePortosImpl extends UtentePortosBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this class directly. All methods that expect a utente - * portos model instance should use the {@link - * it.tref.liferay.portos.bo.model.UtentePortos} interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a utente portos model instance + * should use the {@link it.tref.liferay.portos.bo.model.UtentePortos} interface instead. */ public UtentePortosImpl() { } -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerPratiche.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerPratiche.java index da72a357..e2f18b96 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerPratiche.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerPratiche.java @@ -56,11 +56,10 @@ public class SchedulerPratiche implements MessageListener { @Override public void receive(Message message) throws MessageListenerException { + if (lock.tryLock()) { try { - /* - * Fascicoli Senza progetto - */ + // Fascicoli Senza progetto int count = IntPraticaLocalServiceUtil.countFascicoliNotProgetto(); if (count > 0) { for (int cursor = 0; cursor <= count; cursor += SIZE) { @@ -82,9 +81,7 @@ public class SchedulerPratiche implements MessageListener { } } } - /* - * Pratiche gestite ma senza protocollo - */ + // Pratiche gestite ma senza protocollo count = DettPraticaLocalServiceUtil.countPraticheCompleteNotProtocollo(); if (count > 0) { for (int cursor = 0; cursor <= count; cursor += SIZE) { @@ -106,9 +103,7 @@ public class SchedulerPratiche implements MessageListener { } } } - /* - * Fine Lavori complete ma senza protocollo - */ + // Fine Lavori complete ma senza protocollo count = FineLavoriLocalServiceUtil.countFineLavoriCompleteNotProtocollo(); if (count > 0) { for (int cursor = 0; cursor <= count; cursor += SIZE) { @@ -130,9 +125,7 @@ public class SchedulerPratiche implements MessageListener { } } } - /* - * Fine Lavori complete con protocollo non gestite - */ + // Fine Lavori complete con protocollo non gestite count = FineLavoriLocalServiceUtil.countFineLavoriCompleteNotGestite(); if (count > 0) { for (int cursor = 0; cursor <= count; cursor += SIZE) { @@ -158,9 +151,7 @@ public class SchedulerPratiche implements MessageListener { } } } - /* - * Collaudi complete ma senza protocollo - */ + // Collaudi complete ma senza protocollo count = CollaudoLocalServiceUtil.countCollaudiCompletiNotProtocollo(); if (count > 0) { for (int cursor = 0; cursor <= count; cursor += SIZE) { @@ -182,9 +173,7 @@ public class SchedulerPratiche implements MessageListener { } } } - /* - * Collaudi complete con protocollo non gestiti - */ + // Collaudi complete con protocollo non gestiti count = CollaudoLocalServiceUtil.countCollaudiCompletiNotGestiti(); if (count > 0) { for (int cursor = 0; cursor <= count; cursor += SIZE) { @@ -267,6 +256,7 @@ public class SchedulerPratiche implements MessageListener { private void creaAvvisoVidimazione(long companyId, long groupId, long userId, long intPraticaId, long classPk, String className) throws SystemException, PortalException { + String descLong = StringPool.BLANK; Date dtAvviso = new Date(); String tipoAvviso = AvvisoUtil.TIPO_AVVISO_DIRETTO; @@ -284,18 +274,17 @@ public class SchedulerPratiche implements MessageListener { } String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(propertiesTemplateType); long fileEntryIdTemplate = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, propertiesTemplate); - long controlloPraticaId = 0L; ServiceContext serviceContext = new ServiceContext(); serviceContext.setCompanyId(companyId); serviceContext.setScopeGroupId(groupId); serviceContext.setUserId(userId); - AvvisoLocalServiceUtil.addAvviso(intPraticaId, descLong, dtAvviso, tipoAvviso, tipoDocumento, fileEntryIdTemplate, classPk, className, controlloPraticaId, serviceContext); } private IntPratica assegnaNumeroProgetto(IntPratica intPratica) throws PortalException, SystemException { + // in caso di errore successivo alla protocollazione salto questa operazione if (Validator.isNull(intPratica.getNumeroProgetto())) { intPratica = IntPraticaLocalServiceUtil.addNumeroProgetto(intPratica.getIntPraticaId()); @@ -304,13 +293,14 @@ public class SchedulerPratiche implements MessageListener { } public void gestionePratica(DettPratica dettPratica) throws Exception { + ServiceContext serviceContext = getServiceContext(dettPratica); // protocollazione da servizio remoto protocollazione(serviceContext.getCompanyId(), serviceContext.getScopeGroupId(), dettPratica); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); intPratica = assegnaNumeroProgetto(intPratica); String tipoIntegrazione = dettPratica.getTipoIntegrazione(); - // 1o Avviso di ricezione corretta o in errore della pratica + // 1º Avviso di ricezione corretta o in errore della pratica int count = AvvisoLocalServiceUtil.countAvvisoByClassPk_ClassName(dettPratica.getDettPraticaId(), DettPratica.class.getName()); // in caso di errore non genere un nuovo avviso @@ -366,10 +356,11 @@ public class SchedulerPratiche implements MessageListener { } private DettPratica protocollazione(long companyId, long groupId, DettPratica dettPratica) throws Exception { + // in caso di errore successivo alla protocollazione salto questa operazione if (Validator.isNull(dettPratica.getProtocollo())) { String protocollo = null; - String title = dettPratica.getDettPraticaId() + "_" + System.currentTimeMillis(); + String title = dettPratica.getDettPraticaId() + StringPool.UNDERLINE + System.currentTimeMillis(); protocollo = ProtocollazioneUtil.protocollaArrivo(dettPratica, title); if (Validator.isNull(protocollo)) { throw new Exception("errore nella protocollazione pratica"); @@ -381,12 +372,11 @@ public class SchedulerPratiche implements MessageListener { } private FineLavori protocollazione(long companyId, long groupId, FineLavori fineLavori) throws Exception { + // in caso di errore successivo alla protocollazione salto questa operazione if (Validator.isNull(fineLavori.getProtocollo())) { - String protocollo = null; - - String title = fineLavori.getFineLavoriId() + "_" + System.currentTimeMillis(); + String title = fineLavori.getFineLavoriId() + StringPool.UNDERLINE + System.currentTimeMillis(); protocollo = ProtocollazioneUtil.protocollaArrivo(fineLavori, title); if (Validator.isNull(protocollo)) { throw new Exception("errore nella protocollazione fine lavori"); @@ -401,13 +391,12 @@ public class SchedulerPratiche implements MessageListener { private Collaudo protocollazione(long companyId, long groupId, Collaudo collaudo) throws Exception { - // in caso di errore successivo alla protocollazione salto questa - // operazione + // in caso di errore successivo alla protocollazione salto questa operazione if (Validator.isNull(collaudo.getProtocollo())) { String protocollo = null; - String title = collaudo.getCollaudoId() + "_" + System.currentTimeMillis(); + String title = collaudo.getCollaudoId() + StringPool.UNDERLINE + System.currentTimeMillis(); protocollo = ProtocollazioneUtil.protocollaArrivo(collaudo, title); if (Validator.isNull(protocollo)) { throw new Exception("errore nella protocollazione collaudo"); @@ -421,6 +410,7 @@ public class SchedulerPratiche implements MessageListener { private ControlloPratica avvioWorkflow(DettPratica dettPratica, long userId, ServiceContext serviceContext) throws Exception { + if (dettPratica.isCompleta() && !dettPratica.isGestita()) { IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); @@ -436,6 +426,7 @@ public class SchedulerPratiche implements MessageListener { } private ServiceContext getServiceContext(DettPratica dettPratica) { + ServiceContext serviceContext = new ServiceContext(); serviceContext.setCompanyId(dettPratica.getCompanyId()); serviceContext.setScopeGroupId(dettPratica.getGroupId()); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AllegatoManualeLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AllegatoManualeLocalServiceImpl.java index 021e3943..91551fc0 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AllegatoManualeLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AllegatoManualeLocalServiceImpl.java @@ -57,41 +57,45 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException; */ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalServiceBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link * it.tref.liferay.portos.bo.service.AllegatoManualeLocalServiceUtil} to access the allegato manuale local service. */ @Override public List findByIntPratica(long intPraticaId) throws SystemException { + return allegatoManualePersistence.findByIntPratica(intPraticaId); } @Override public List findByIntPratica(long intPraticaId, int start, int end, OrderByComparator orderByComparator) throws SystemException { + return allegatoManualePersistence.findByIntPratica(intPraticaId, start, end, orderByComparator); } @Override public int countByIntPratica(long intPraticaId) throws SystemException { + return allegatoManualePersistence.countByIntPratica(intPraticaId); } @Override public List findByDettPratica(long dettPraticaId) throws SystemException { + return allegatoManualePersistence.findByIntPratica(dettPraticaId); } @Override public List findByDettPratica(long dettPraticaId, int start, int end, OrderByComparator orderByComparator) throws SystemException { + return allegatoManualePersistence.findByIntPratica(dettPraticaId, start, end, orderByComparator); } @Override public int countByDettPratica(long dettPraticaId) throws SystemException { + return allegatoManualePersistence.countByIntPratica(dettPraticaId); } @@ -99,13 +103,12 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService public AllegatoManuale addAllegatoManuale(long userId, long intPraticaId, long dettPraticaId, String descrizione, byte[] content, String sourceFileName, ServiceContext serviceContext) throws SystemException, PortalException { + AllegatoManuale allegatoManuale = allegatoManualePersistence.create(counterLocalService .increment(AllegatoManuale.class.getName())); - DettPratica dettPratica = dettPraticaLocalService.getDettPratica(dettPraticaId); User user = userPersistence.findByPrimaryKey(userId); Date now = new Date(); - allegatoManuale.setCompanyId(serviceContext.getCompanyId()); allegatoManuale.setUserId(user.getUserId()); allegatoManuale.setUserName(user.getFullName()); @@ -115,12 +118,9 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService allegatoManuale.setIntPraticaId(intPraticaId); allegatoManuale.setDettPraticaId(dettPraticaId); allegatoManuale.setDescrizione(descrizione); - - long fileEntryId = 0l; - + long fileEntryId = 0L; long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); - Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId); String folderName = PraticaUtil.getFolderName(dettPratica.getDettPraticaId()); serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); @@ -137,16 +137,13 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService + StringPool.UNDERLINE + sourceFileName; String description = StringPool.BLANK; String mimeType = MimeTypesUtil.getContentType(sourceFileName); - String changeLog = StringPool.BLANK; FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(), folder.getFolderId(), now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title, description, changeLog, content, serviceContext); fileEntryId = fileEntry.getFileEntryId(); allegatoManuale.setFileEntryId(fileEntryId); - String codiceFiscalePrimaFirma = StringPool.BLANK; - ServiceContext serviceContextAvvisi = (ServiceContext) serviceContext.clone(); IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId); Territorio territorio = territorioLocalService.getTerritorio(intPratica.getTerritorioId()); @@ -158,20 +155,20 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService Avviso avviso = avvisoLocalService.addAvviso(intPratica.getIntPraticaId(), descrizione, now, AvvisoUtil.TIPO_AVVISO_FIRMA, "MA", 0L, dettPraticaId, DettPratica.class.getName(), codiceFiscalePrimaFirma, fileEntryId, 0L, StringPool.BLANK, 0L, serviceContextAvvisi); - allegatoManuale.setAvvisoId(avviso.getAvvisoId()); allegatoManuale = allegatoManualePersistence.update(allegatoManuale); - return allegatoManuale; } @Override public AllegatoManuale deleteAllegatoManuale(AllegatoManuale allegatoManuale) throws SystemException { + return super.deleteAllegatoManuale(allegatoManuale); } @Override public AllegatoManuale deleteAllegatoManuale(long allegatoManualeId) throws PortalException, SystemException { + return deleteAllegatoManuale(allegatoManualeLocalService.getAllegatoManuale(allegatoManualeId)); } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AllegatoManualeServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AllegatoManualeServiceImpl.java index d0b1d02c..53d8b2c4 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AllegatoManualeServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AllegatoManualeServiceImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.service.impl; @@ -29,13 +29,12 @@ import com.liferay.portal.service.ServiceContext; * The implementation of the allegato manuale remote service. * *

- * All custom service methods should be put in this class. Whenever methods are added, rerun - * ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.AllegatoManualeService} interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.AllegatoManualeService} interface. * *

- * This is a remote service. Methods of this service are expected to have security checks based on - * the propagated JAAS credentials because this service can be accessed remotely. + * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS + * credentials because this service can be accessed remotely. *

* * @author Davide Barbagallo, 3F Consulting @@ -43,55 +42,72 @@ import com.liferay.portal.service.ServiceContext; * @see it.tref.liferay.portos.bo.service.AllegatoManualeServiceUtil */ public class AllegatoManualeServiceImpl extends AllegatoManualeServiceBaseImpl { - /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link - * it.tref.liferay.portos.bo.service.AllegatoManualeServiceUtil} to access the allegato manuale - * remote service. - */ - public List findByIntPratica(long intPraticaId) throws SystemException { - return allegatoManualeLocalService.findByIntPratica(intPraticaId); - } - - public List findByIntPratica(long intPraticaId, int start, int end, - OrderByComparator orderByComparator) throws SystemException { - return allegatoManualeLocalService.findByIntPratica(intPraticaId, start, end, orderByComparator); - } - - public int countByIntPratica(long intPraticaId) throws SystemException { - return allegatoManualeLocalService.countByIntPratica(intPraticaId); - } - - public List findByDettPratica(long dettPraticaId) throws SystemException { - return allegatoManualeLocalService.findByIntPratica(dettPraticaId); - } - - public List findByDettPratica(long dettPraticaId, int start, int end, - OrderByComparator orderByComparator) throws SystemException { - return allegatoManualeLocalService.findByIntPratica(dettPraticaId, start, end, orderByComparator); - } - - public int countByDettPratica(long dettPraticaId) throws SystemException { - return allegatoManualeLocalService.countByIntPratica(dettPraticaId); - } - - public AllegatoManuale addAllegatoManuale(long userId, long intPraticaId, long dettPraticaId, String descrizione, - byte[] content, String sourceFileName, ServiceContext serviceContext) throws SystemException, PortalException { - return allegatoManualeLocalService.addAllegatoManuale(userId, intPraticaId, dettPraticaId, descrizione, content, - sourceFileName, serviceContext); - } - - public AllegatoManuale deleteAllegatoManuale(AllegatoManuale allegatoManuale) throws SystemException { - Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(allegatoManuale.getAvvisoId()); - if (Validator.isNotNull(avviso) && Validator.isNull(avviso.getFileEntryIdInvio())) { - return allegatoManualeLocalService.deleteAllegatoManuale(allegatoManuale); - } else { - throw new SystemException("allegato manuale #" + allegatoManuale.getAllegatoManualeId() + " non eliminabile"); - } - } - - public AllegatoManuale deleteAllegatoManuale(long allegatoManualeId) throws PortalException, SystemException { - return allegatoManualeLocalService.deleteAllegatoManuale(allegatoManualeId); - } + /* + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.AllegatoManualeServiceUtil} to access the allegato manuale remote service. + */ + @Override + public List findByIntPratica(long intPraticaId) throws SystemException { + + return allegatoManualeLocalService.findByIntPratica(intPraticaId); + } + + @Override + public List findByIntPratica(long intPraticaId, int start, int end, + OrderByComparator orderByComparator) throws SystemException { + + return allegatoManualeLocalService.findByIntPratica(intPraticaId, start, end, orderByComparator); + } + + @Override + public int countByIntPratica(long intPraticaId) throws SystemException { + + return allegatoManualeLocalService.countByIntPratica(intPraticaId); + } + + @Override + public List findByDettPratica(long dettPraticaId) throws SystemException { + + return allegatoManualeLocalService.findByIntPratica(dettPraticaId); + } + + @Override + public List findByDettPratica(long dettPraticaId, int start, int end, + OrderByComparator orderByComparator) throws SystemException { + + return allegatoManualeLocalService.findByIntPratica(dettPraticaId, start, end, orderByComparator); + } + + @Override + public int countByDettPratica(long dettPraticaId) throws SystemException { + + return allegatoManualeLocalService.countByIntPratica(dettPraticaId); + } + + @Override + public AllegatoManuale addAllegatoManuale(long userId, long intPraticaId, long dettPraticaId, String descrizione, + byte[] content, String sourceFileName, ServiceContext serviceContext) throws SystemException, + PortalException { + + return allegatoManualeLocalService.addAllegatoManuale(userId, intPraticaId, dettPraticaId, descrizione, + content, sourceFileName, serviceContext); + } + + @Override + public AllegatoManuale deleteAllegatoManuale(AllegatoManuale allegatoManuale) throws SystemException { + + Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(allegatoManuale.getAvvisoId()); + if (Validator.isNotNull(avviso) && Validator.isNull(avviso.getFileEntryIdInvio())) { + return allegatoManualeLocalService.deleteAllegatoManuale(allegatoManuale); + } else { + throw new SystemException("allegato manuale #" + allegatoManuale.getAllegatoManualeId() + + " non eliminabile"); + } + } + + @Override + public AllegatoManuale deleteAllegatoManuale(long allegatoManualeId) throws PortalException, SystemException { + + return allegatoManualeLocalService.deleteAllegatoManuale(allegatoManualeId); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java index 83d49b9c..5f2c4d8b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java @@ -93,18 +93,21 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase @Override public String anteprimaAsseverazione(String tipo, User user, DettPratica dettPratica, String relazioni) throws IOException, SystemException, PortalException { + return testoAsseverazione(tipo, user.getScreenName(), dettPratica, relazioni, true); } @Override public String testoAsseverazione(String tipo, User user, long dettPraticaId, String relazioni) throws SystemException, PortalException, IOException { + return testoAsseverazione(tipo, user.getScreenName(), dettPraticaId, relazioni); } @Override public String testoAsseverazione(String tipo, String codiceFiscale, long dettPraticaId, String relazioni) throws PortalException, SystemException, IOException { + DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId); return testoAsseverazione(tipo, codiceFiscale, dettPratica, relazioni); } @@ -112,18 +115,19 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase @Override public String testoAsseverazione(String tipo, String codiceFiscale, DettPratica dettPratica, String relazioni) throws SystemException, PortalException, IOException { + return testoAsseverazione(tipo, codiceFiscale, dettPratica, relazioni, false); } private String testoAsseverazione(String tipo, String codiceFiscale, DettPratica dettPratica, String relazioni, boolean anteprima) throws SystemException, PortalException, IOException { + List soggetti = SoggettoLocalServiceUtil.getValidTmpByIntPratica_CodiceFiscale( dettPratica.getIntPraticaId(), codiceFiscale, 0L); if (soggetti.size() > 0) { Soggetto soggetto = soggetti.get(0); String nome = Validator.isNull(soggetto.getCognome()) ? soggetto.getLegaleRap() : soggetto.getNome(); String cognome = Validator.isNull(soggetto.getCognome()) ? StringPool.BLANK : soggetto.getCognome(); - return testoAsseverazione(tipo, nome, cognome, codiceFiscale, soggetto.getAmbitoProfessione(), dettPratica, relazioni, false); } @@ -166,7 +170,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase default: return null; } - InputStream input = getClass().getClassLoader() .getResourceAsStream("/resource/asseverazioni/" + file + ".html"); if (Validator.isNull(input)) { @@ -179,20 +182,15 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase } scanner.close(); input.close(); - String RG = dettPratica.getGeoRischioGeomorfologicoPai(); String RI = dettPratica.getGeoRischioIdraulicoPai(); String PG = dettPratica.getGeoPericolositaGeomorfica(); String PI = dettPratica.getGeoPericolositaIdraulica(); - boolean rischio = (RG.equals("3") || RG.equals("4") || RG.equals("5") || RI.equals("3") || RI.equals("4") || PG.equals("3") || PG.equals("4") || PI.equals("3") || PI.equals("4") || PI.equals("5")); - boolean coniugio = Validator.isNotNull(relazioni); - IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); - float ag = 0; if (Validator.isNotNull(dettPratica.getAg())) { ag = Float.parseFloat(dettPratica.getAg().replace(',', '.')); @@ -201,23 +199,17 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase } else if (Validator.isNotNull(territorio.getAgMin())) { ag = Float.parseFloat(territorio.getAgMin().replace(',', '.')); } - boolean agAlto = (dettPratica.getTcAdeguamentoSismico() || dettPratica.getTcMiglioramentoSismico()) && (territorio.getZona().equals("1") || (territorio.getZona().equals("2") && (ag >= 0.2))); - boolean complesse = dettPratica.getTcNuovaCostruzioneComplessa(); - boolean strategico = dettPratica.getDestinazione().startsWith("A") || dettPratica.getDestinazione().startsWith("B"); - boolean rilevanti = agAlto || complesse || strategico; - boolean agMedio = false; boolean riparazioni = false; boolean nuove = false; boolean agricoli = false; boolean nonRilevanti = false; - if (!rilevanti) { agMedio = (dettPratica.getTcAdeguamentoSismico() || dettPratica.getTcMiglioramentoSismico()) && ((territorio.getZona().equals("2") && (ag >= 0.15) && (ag <= 0.2)) || territorio.getZona() @@ -225,10 +217,8 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase riparazioni = dettPratica.getTcRiparazioneInterventoLocale(); nuove = dettPratica.getTcNuovaCostruzione(); agricoli = dettPratica.getDestinazione().equals("1"); - nonRilevanti = agMedio || riparazioni || nuove || agricoli; } - String html = buffer.toString().replaceAll("##anteprima(.*?)##", anteprima ? StringPool.BLANK : "$1") .replaceAll("##lavoripubblici(.*?)##", dettPratica.getLavoriPubblici() ? StringPool.BLANK : "$1") .replace("{{agalto}}", agAlto ? CHECKED : StringPool.SPACE) @@ -247,9 +237,10 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase html = html.replace("{{coniugio}}", StringPool.SPACE).replace("{{!coniugio}}", StringPool.SPACE) .replace("{{relazioni}}", StringPool.BLANK); } else { - html = html.replace("{{coniugio}}", coniugio ? CHECKED : StringPool.SPACE) + html = html + .replace("{{coniugio}}", coniugio ? CHECKED : StringPool.SPACE) .replace("{{!coniugio}}", coniugio ? StringPool.SPACE : CHECKED) - .replace("{{relazioni}}", relazioni.trim().replace(StringPool.NEW_LINE, ", ")); + .replace("{{relazioni}}", relazioni.trim().replace(StringPool.NEW_LINE, StringPool.COMMA_AND_SPACE)); } return html; } @@ -259,19 +250,15 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase String codiceFiscale, ServiceContext serviceContext) throws PortalException, SystemException { User user = userPersistence.findByPrimaryKey(userId); - Date now = new Date(); - Asseverazione asseverazione = asseverazionePersistence.create(counterLocalService.increment(Asseverazione.class .getName())); - asseverazione.setCompanyId(serviceContext.getCompanyId()); asseverazione.setUserId(user.getUserId()); asseverazione.setUserName(user.getFullName()); asseverazione.setCreateDate(serviceContext.getCreateDate(now)); asseverazione.setModifiedDate(serviceContext.getModifiedDate(now)); asseverazione.setGroupId(serviceContext.getScopeGroupId()); - asseverazione.setIntPraticaId(intPraticaId); asseverazione.setDettPraticaId(dettPraticaId); asseverazione.setTipologia(tipologia); @@ -281,9 +268,7 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase if (!soggetti.isEmpty()) { asseverazione.setSoggettoId(soggetti.get(0).getUserId()); } - asseverazione = asseverazionePersistence.update(asseverazione); - return asseverazione; } @@ -297,7 +282,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica.getTipoIntegrazione()) || TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione()) || TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { - List nuoviSoggetti = new ArrayList( soggettoLocalService.getValidTmpByDettPratica(dettPraticaId)); List cfNuoviSoggetti = soggettoLocalService.getCfValidTmpByDettPratica(dettPraticaId); @@ -312,19 +296,8 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase cfDelegato, 0l); GenericUtils.addAllIfnotExist(nuoviSoggetti, delegato); } - if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { User titolaredigitaleUser = UserLocalServiceUtil.getUser(intPratica.getUserId()); - // Soggetto titolareDigitale = - // soggettoLocalService.getValidTmpByIntPratica_CodiceFiscale(intPraticaId, - // titolaredigitaleUser.getScreenName()).get(0); - // addAsseverazione(serviceContext.getUserId(), - // dettPratica.getIntPraticaId(), - // dettPraticaId, - // titolareDigitale.getTipologiaSoggetto(), - // titolareDigitale.getCodiceFiscale(), - // serviceContext); - // il titolare digitale potrebbe avere più ruoli List titolareDigitali = soggettoLocalService.getValidTmpByIntPratica_CodiceFiscale( intPraticaId, titolaredigitaleUser.getScreenName(), 0l); @@ -333,12 +306,9 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase titolareDigitale.getTipologiaSoggetto(), titolareDigitale.getCodiceFiscale(), serviceContext); } - } else if (TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { String[] tipoSoggetti = new String[] { TipoSoggettoUtil.COMMITTENTE, TipoSoggettoUtil.DIRETTORE_LAVORI, TipoSoggettoUtil.DITTA, TipoSoggettoUtil.PROGETTISTA }; - - // if (SoggettiUtil.isTitolareInCommittenti(intPraticaId)) { if (ValidazionePraticaUtil.isA98Required(dettPratica)) { tipoSoggetti = (String[]) ArrayUtils.removeElement(tipoSoggetti, TipoSoggettoUtil.COMMITTENTE); } @@ -346,7 +316,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase .getSoggettiPrincipaliValidTmpByDettPratica_TipologiaSoggetto(dettPraticaId, tipoSoggetti); GenericUtils.addAllIfnotExist(nuoviSoggetti, soggettiPrincipali); } - for (Soggetto soggetto : nuoviSoggetti) { if (TipoSoggettoUtil.COMMITTENTE.equalsIgnoreCase(soggetto.getTipologiaSoggetto())) { if (!ValidazionePraticaUtil.isA98Required(dettPratica)) { @@ -357,11 +326,8 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase addAsseverazione(serviceContext.getUserId(), dettPratica.getIntPraticaId(), dettPraticaId, soggetto.getTipologiaSoggetto(), soggetto.getCodiceFiscale(), serviceContext); } - } - } else { - List soggetti = soggettoLocalService.getValidTmpByIntPratica(dettPratica.getIntPraticaId()); for (Soggetto soggetto : soggetti) { if ((TipoSoggettoUtil.COMMITTENTE.equalsIgnoreCase(soggetto.getTipologiaSoggetto()) && !ValidazionePraticaUtil @@ -375,9 +341,7 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase soggetto.getTipologiaSoggetto(), soggetto.getCodiceFiscale(), serviceContext); } } - } - } @Override @@ -390,7 +354,7 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase } asseverazione.setEsito(AsseverazioniUtil.STATO_ASSEGNATA); asseverazione.setDtEsito(null); - if (asseverazione.getFileEntryId() != 0) { + if (asseverazione.getFileEntryId() != 0L) { DLAppLocalServiceUtil.deleteFileEntry(asseverazione.getFileEntryId()); asseverazione.setFileEntryId(0); } @@ -409,15 +373,12 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase Asseverazione asseverazione = asseverazioneLocalService.getAsseverazione(asseverazioneId); Date now = new Date(); - if (AsseverazioniUtil.STATO_ESEGUITA.equals(stato)) { asseverazione = generateReportAsseverazione(asseverazione, userId); } - asseverazione.setEsito(stato); asseverazione.setMezzo(AsseverazioniUtil.ASSEVERAZIONE_DA_APPLICATIVO); asseverazione.setDtEsito(now); - asseverazione = asseverazionePersistence.update(asseverazione); } @@ -428,22 +389,18 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase if (Validator.isNotNull(asseverazione.getFileEntryId())) { dlAppLocalService.deleteFileEntry(asseverazione.getFileEntryId()); } - String tipoDocumento = "AS"; String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(tipoDocumento); - long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(asseverazione.getCompanyId(), propertiesTemplate); String propertiesFolder = AvvisoUtil.getAllTipoDocumentoFolderProps().get(tipoDocumento); long fileEntryIdFolder = configurazioneLocalService.findByC_ChiaveLong(asseverazione.getCompanyId(), propertiesFolder); - String fileName = StringUtils.leftPad(String.valueOf(asseverazione.getDettPraticaId()), 10, '0') + (Validator.isNotNull(tipoDocumento) ? StringPool.UNDERLINE + tipoDocumento : StringPool.BLANK) + StringPool.UNDERLINE + (Validator.isNotNull(asseverazione.getAsseverazioneId()) ? asseverazione.getAsseverazioneId() : System.currentTimeMillis()); - ReportDto reportDto = new ReportDto(); reportDto.setFileEntryIds(new long[] { fileEntryIdTemplate }); reportDto.setFolderId(fileEntryIdFolder); @@ -453,7 +410,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase reportDto.setFooter(StringPool.BLANK); reportDto.setFooterHeight(40); Map parameters = new HashMap(); - String relazioni = null; Map dichiarazioniMap = asseverazione.getDichiarazioniMap(); if (dichiarazioniMap.containsKey("coniugio")) { @@ -465,31 +421,24 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase relazioni = StringPool.BLANK; } } - String testoAsseverazione = testoAsseverazione(asseverazione.getTipologia(), asseverazione.getCodiceFiscale(), asseverazione.getDettPraticaId(), relazioni); if (Validator.isNull(testoAsseverazione)) { testoAsseverazione = AsseverazioniUtil.retrieveAsseverazioneText(asseverazione, asseverazione.getCodiceFiscale()); } - parameters.put("html", testoAsseverazione); parameters.put("modello", asseverazione.getModello()); - reportDto.setParameters(parameters); reportDto.setShowNumberOfPage(true); reportDto.setType(ReportConstants.ReportType.VELOCITY_TO_PDF.toString()); - String resourcePath = getClass().getName().replaceAll("\\w+\\.", "../") .replace(getClass().getSimpleName(), "resource/asseverazioni"); reportDto.setPortalURL(getClass().getResource(resourcePath).getPath()); - ReportResultDto result = ReportUtil.generateReport(asseverazione.getCompanyId(), userId, reportDto, null); long idFileEntry = result.getFileEntryIds()[0]; asseverazione.setFileEntryId(idFileEntry); - asseverazione = asseverazionePersistence.update(asseverazione); - return asseverazione; } @@ -526,7 +475,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase asseverazione.setFileEntryId(0); asseverazionePersistence.update(asseverazione); } - } @Override @@ -556,14 +504,10 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase // TODO forse dobbiamo mettere i permesssi ma non mi pare sicuro. FileEntry fileEntry = null; if (asseverazione.getEsito().equalsIgnoreCase(AsseverazioniUtil.STATO_ASSEGNATA)) { - long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); - Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId); - String folderName = PraticaUtil.getFolderName(dettPratica.getDettPraticaId()); - serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); Folder folder = null; try { @@ -580,7 +524,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase + tipologiaUtente + StringPool.UNDERLINE + sourceFileName; String description = StringPool.BLANK; String mimeType = MimeTypesUtil.getContentType(sourceFileName); - String changeLog = StringPool.BLANK; fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" + sourceFileName, mimeType, title, description, @@ -765,5 +708,4 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase return asseverazionePersistence.countByDettPratica_Tipologia_InEsito(dettPraticaId, tipologia, esiti); } - } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java index c5e35247..78ae2b61 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java @@ -138,7 +138,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { } long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), propertiesTemplate); - return addAvviso(intPratica.getIntPraticaId(), StringPool.BLANK, new Date(), tipoAvviso, statoPratica, fileEntryIdTemplate, classPk, className, userCodiceFiscalePrimaFirma, jsonParameters, controlloPraticaId, serviceContext); @@ -152,7 +151,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { long controlloPraticaId) throws SystemException, PortalException { IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId); - boolean varianteNonSostanziale = false; if (className.equals(DettPratica.class.getName())) { DettPratica dettPratica = dettPraticaLocalService.getDettPratica(classPk); @@ -161,10 +159,8 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { } String statoPraticaCode = varianteNonSostanziale ? "DPVNS" : PraticaUtil.getStatoPraticaCode(stato, intPratica); String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(statoPraticaCode); - long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), propertiesTemplate); - _log.info("debugAvviso: " + propertiesTemplate + " (" + statoPraticaCode + ")" + (varianteNonSostanziale ? " non sostanziale" : StringPool.BLANK)); return addAvviso(intPraticaId, StringPool.BLANK, new Date(), tipoAvviso, stato, fileEntryIdTemplate, classPk, @@ -210,14 +206,12 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { User user = userPersistence.fetchByPrimaryKey(serviceContext.getUserId()); Date now = new Date(); Avviso avviso = createAvviso(counterLocalService.increment(Avviso.class.getName())); - avviso.setCompanyId(serviceContext.getCompanyId()); avviso.setGroupId(serviceContext.getScopeGroupId()); avviso.setUserId(serviceContext.getUserId()); avviso.setUserName(user.getFullName()); avviso.setCreateDate(serviceContext.getCreateDate(now)); avviso.setModifiedDate(serviceContext.getModifiedDate(now)); - avviso.setDescLong(descLong); avviso.setTipoAvviso(tipoAvviso); avviso.setDtAvviso(dtAvviso); @@ -237,7 +231,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { avviso.setJsonParameters(jsonParameters); avviso.setInviatoTecnico(false); avviso.setOldAvvisoId(0L); - return addAvviso(avviso); } @@ -249,7 +242,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { Date now = new Date(); Avviso avviso = createAvviso(counterLocalService.increment(Avviso.class.getName())); - avviso.setCompanyId(serviceContext.getCompanyId()); avviso.setGroupId(serviceContext.getScopeGroupId()); avviso.setUserId(serviceContext.getUserId()); @@ -309,14 +301,13 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { private DynamicQuery searchDynamicQuery(long[] groupIds, Long classPk, String keywords) { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); - if (Validator.isNotNull(classPk)) { dynamicQuery.add(PropertyFactoryUtil.forName("classPk").eq(classPk)); } if (groupIds.length > 0) { dynamicQuery.add(PropertyFactoryUtil.forName("groupId").in(groupIds)); } else { - dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0l)); + dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0L)); } if (Validator.isNotNull(keywords)) { String[] sqlKeywords = CustomSQLUtil.keywords(keywords); @@ -416,11 +407,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); dynamicQuery.add(PropertyFactoryUtil.forName("companyId").eq(companyId)); - dynamicQuery.add(RestrictionsFactoryUtil.ilike("userCodiceFiscalePrimaFirma", cf)); dynamicQuery.add(PropertyFactoryUtil.forName("fileEntryIdBase").ne(0L)); dynamicQuery.add(PropertyFactoryUtil.forName("inviato").eq(AvvisoUtil.DOCUMENTO_NON_INVIATO)); - dynamicQuery.add(PropertyFactoryUtil.forName("tipoAvviso").eq(AvvisoUtil.TIPO_AVVISO_FIRMA)); dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false)); @@ -451,14 +440,13 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { if (groupIds.length > 0) { dynamicQuery.add(PropertyFactoryUtil.forName("groupId").in(groupIds)); } else { - dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0l)); + dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0L)); } dynamicQuery.add(RestrictionsFactoryUtil.not(RestrictionsFactoryUtil.ilike("userCodiceFiscalePrimaFirma", cf))); dynamicQuery.add(RestrictionsFactoryUtil.isNotNull("userCodiceFiscalePrimaFirma")); dynamicQuery.add(RestrictionsFactoryUtil.ne("userCodiceFiscalePrimaFirma", StringPool.BLANK)); dynamicQuery.add(PropertyFactoryUtil.forName("fileEntryIdBase").ne(0L)); dynamicQuery.add(PropertyFactoryUtil.forName("inviato").eq(AvvisoUtil.DOCUMENTO_NON_INVIATO)); - dynamicQuery.add(PropertyFactoryUtil.forName("tipoAvviso").eq(AvvisoUtil.TIPO_AVVISO_FIRMA)); dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false)); @@ -489,20 +477,17 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { if (groupIds.length > 0) { dynamicQuery.add(PropertyFactoryUtil.forName("groupId").in(groupIds)); } else { - dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0l)); + dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0L)); } dynamicQuery.add(PropertyFactoryUtil.forName("fileEntryIdInvio").eq(0L)); - dynamicQuery.add(PropertyFactoryUtil.forName("inviato").eq(AvvisoUtil.DOCUMENTO_NON_INVIATO)); dynamicQuery.add(PropertyFactoryUtil.forName("tipoAvviso").eq(AvvisoUtil.TIPO_AVVISO_FIRMA)); dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("rifiutato").eq(false)); - Disjunction disjunction = RestrictionsFactoryUtil.disjunction(); disjunction.add(RestrictionsFactoryUtil.eq("userCodiceFiscalePrimaFirma", StringPool.BLANK)); disjunction.add(RestrictionsFactoryUtil.isNull("userCodiceFiscalePrimaFirma")); - dynamicQuery.add(disjunction); return dynamicQuery; } @@ -561,7 +546,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { andPrimaFirma.add(PropertyFactoryUtil.forName("fileEntryIdInvio").eq(0L)); andPrimaFirma.add(PropertyFactoryUtil.forName("transactionIdPrimaFirma").isNotNull()); andPrimaFirma.add(PropertyFactoryUtil.forName("transactionIdPrimaFirma").ne(StringPool.BLANK)); - dynamicQuery.add(andPrimaFirma); return dynamicQuery; } @@ -605,7 +589,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioSignal(avvisoId); List avviso = avvisoPersistence.findWithDynamicQuery(dynamicQuery, 0, 1); - return !avviso.isEmpty() ? avviso.get(0) : null; + return avviso.isEmpty() ? null : avviso.get(0); } @Override @@ -624,12 +608,10 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { dynamicQuery.add(PropertyFactoryUtil.forName("dtInvioSignal").isNull()); dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false)); - Disjunction disjunction = RestrictionsFactoryUtil.disjunction(); disjunction.add(PropertyFactoryUtil.forName("inviato").eq(AvvisoUtil.DOCUMENTO_INVIATO)); disjunction.add(PropertyFactoryUtil.forName("rifiutato").eq(true)); dynamicQuery.add(disjunction); - if (Validator.isNotNull(avvisoId)) { dynamicQuery.add(PropertyFactoryUtil.forName("avvisoId").eq(avvisoId)); } @@ -688,7 +670,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); if (Validator.isNotNull(avviso.getTransactionIdPrimaFirma())) { - throw new PortalException("Richiesta firma gia' effettuata"); + throw new PortalException("Richiesta firma già effettuata"); } avviso.setFirmaInCorso(true); avviso.setTransactionIdPrimaFirma(transactionId); @@ -805,15 +787,12 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { public Avviso updateAvvisoProtocollo(long avvisoId, String protocollo) throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); - Date now = new Date(); - avviso.setModifiedDate(now); avviso.setProtocollo(protocollo); avviso.setDtProtocollo(now); avviso.setOggettoProtocollo(ProtocollazioneUtil.generaOggettoProtocollo(avviso.getClass().getName(), avviso.getAvvisoId())); - return avvisoLocalService.updateAvviso(avviso); } @@ -925,7 +904,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { if (groupIds.length > 0) { dynamicQuery.add(PropertyFactoryUtil.forName("groupId").in(groupIds)); } else { - dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0l)); + dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0L)); } Junction or = RestrictionsFactoryUtil.disjunction(); or.add(PropertyFactoryUtil.forName("fileEntryIdTemplate").eq(fileEntryId)); @@ -979,9 +958,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoPersistence.fetchByProtocollo(protocollo); } - /* - * Utilizzato nell'override di update e add per automatizzazione campo signal (default false) - */ + // Utilizzato nell'override di update e add per automatizzazione campo signal (default false) private void updateSignalAndTempistica(Avviso avviso) { String tipoDocumento = avviso.getTipoDocumento(); @@ -1026,8 +1003,8 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.ilike("userCodiceFiscalePrimaFirma", codFisc)); dynamicQuery.add(RestrictionsFactoryUtil.eq("tipoAvviso", AvvisoUtil.TIPO_AVVISO_FIRMA)); - dynamicQuery.add(RestrictionsFactoryUtil.eq("fileEntryIdInvio", 0l)); - dynamicQuery.add(RestrictionsFactoryUtil.ne("fileEntryIdBase", 0l)); + dynamicQuery.add(RestrictionsFactoryUtil.eq("fileEntryIdInvio", 0L)); + dynamicQuery.add(RestrictionsFactoryUtil.ne("fileEntryIdBase", 0L)); dynamicQuery.add(RestrictionsFactoryUtil.eq("rifiutato", false)); List avvisi = avvisoPersistence.findWithDynamicQuery(dynamicQuery); @@ -1057,10 +1034,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); if (avviso.getFileEntryIdInvio() != 0) { - throw new SystemException("File gia' firmato rilascio firma non possibile"); + throw new SystemException("File già firmato rilascio firma non possibile"); } avviso.setUserCodiceFiscalePrimaFirma(StringPool.BLANK); - return avvisoLocalService.updateAvviso(avviso); } @@ -1069,10 +1045,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); if (avviso.getFileEntryIdInvio() != 0) { - throw new SystemException("File gia' firmato assegna firma non possibile"); + throw new SystemException("File già firmato assegna firma non possibile"); } avviso.setUserCodiceFiscalePrimaFirma(cf); - return avvisoLocalService.updateAvviso(avviso); } @@ -1082,7 +1057,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class); dynamicQuery.add(PropertyFactoryUtil.forName("oldFileEntryIdInvio").ne(0L)); dynamicQuery.addOrder(OrderFactoryUtil.desc("oldFileEntryIdInvio")); - return avvisoLocalService.dynamicQuery(dynamicQuery, start, end); } @@ -1092,7 +1066,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class); dynamicQuery.add(PropertyFactoryUtil.forName("oldFileEntryIdBase").ne(0L)); dynamicQuery.addOrder(OrderFactoryUtil.desc("oldFileEntryIdBase")); - return avvisoLocalService.dynamicQuery(dynamicQuery, start, end); } @@ -1102,9 +1075,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class); dynamicQuery.add(RestrictionsFactoryUtil.eq("controlloPraticaId", controlloPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("rifiutato", true)); - dynamicQuery.addOrder(OrderFactoryUtil.desc("avvisoId")); - return avvisoLocalService.dynamicQuery(dynamicQuery); } @@ -1113,40 +1084,30 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { throws Exception { Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(avvisoId); - long folderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(avviso.getCompanyId(), avvisoLocalService .getAllTipoDocumentoFolderProps().get(avviso.getTipoDocumento())); - String fileName = getFileNameAvviso(classPk, avviso.getTipoDocumento(), avviso.getAvvisoId(), "F"); - if (Validator.isNotNull(folderId)) { - Folder folder = DLAppLocalServiceUtil.getFolder(folderId); if (Validator.isNotNull(folder)) { - byte[] bytes = Base64.decode(fileToSave); serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); FileEntry fileEntry = DLAppLocalServiceUtil.addFileEntry(avviso.getUserId(), folder.getRepositoryId(), folderId, fileName, MimeTypesUtil.getContentType(fileName + ".p7m"), fileName + ".p7m", StringPool.BLANK, StringPool.BLANK, bytes, serviceContext); - avviso.setFileEntryIdInvio(fileEntry.getFileEntryId()); avviso = avvisoLocalService.updateAvviso(avviso); - if (Validator.isNull(avviso.getProtocollo())) { String protocollo = ProtocollazioneUtil.protocollaPartenza(avviso, fileEntry.getFileEntryId()); avviso = avvisoLocalService.updateAvvisoProtocollo(avviso.getAvvisoId(), protocollo); } - } else { throw new Exception("No folder id exist"); } } else { throw new Exception("No folder id exist"); } - return avviso; - } @Override @@ -1190,6 +1151,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { @Override public int countProtocolliSearch(String dataDa, String dataA, String numeroProtocollo) throws SystemException, ParseException { + int count = 0; SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); DynamicQuery query = DynamicQueryFactoryUtil.forClass(Avviso.class); @@ -1224,6 +1186,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { @Override public List getAvvisiPerAggiuntaProtocollo(int start, int end) throws SystemException { + DynamicQuery dynamicQuery = dynamicQueryAggiuntaProtocollo(); dynamicQuery.addOrder(OrderFactoryUtil.asc("dtAvviso")); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); @@ -1231,6 +1194,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { @Override public DynamicQuery dynamicQueryAggiuntaProtocollo() throws SystemException { + DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); dynamicQuery.add(PropertyFactoryUtil.forName("inviato").eq(AvvisoUtil.DOCUMENTO_NON_INVIATO)); dynamicQuery.add(PropertyFactoryUtil.forName("protocollo").ne(StringPool.BLANK)); @@ -1244,39 +1208,31 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { @Override public List findByClassPk(long classPk) throws SystemException { + return avvisoPersistence.findByClassPk(classPk); } // NUOVI METODI ADT - /** - * ADT - */ + // ADT @Override public int countAvvisiInvioTecnicoNew() throws SystemException { + DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnicoNew(null); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); } - /** - * ADT - * - */ + // ADT @Override public List getAvvisiInvioTecnicoNew(int start, int end) throws SystemException { + DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnicoNew(null); dynamicQuery.addOrder(OrderFactoryUtil.asc("dtAvviso")); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); } - /** - * - * ADT - * - * @param avvisoId - * @return - * @throws SystemException - */ + // ADT private DynamicQuery dynamicQueryAvvisiInvioTecnicoNew(Long avvisoId) throws SystemException { + DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); dynamicQuery.add(PropertyFactoryUtil.forName("inviatoTecnico").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento").in( @@ -1290,22 +1246,16 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { // avvisi Calendar gc = GregorianCalendar.getInstance(); gc.set(Calendar.YEAR, 2018); - gc.set(Calendar.MONTH, 10);// NOVEMBRE + gc.set(Calendar.MONTH, 10); // NOVEMBRE gc.set(Calendar.DAY_OF_MONTH, 24); dynamicQuery.add(PropertyFactoryUtil.forName("createDate").ge(gc.getTime())); return dynamicQuery; } - /** - * ADT - * - * @param intPraticaId - * @param dettPraticaID - * @return - * @throws SystemException - */ + // ADT @Override public Avviso getAvvisoVidimazione(long intPraticaId, long dettPraticaID) throws SystemException { + DynamicQuery dynamicQuery = AvvisoLocalServiceUtil.dynamicQuery(); dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento").in( new String[] { StatoPraticaConstants.VIDIMATA })); @@ -1323,15 +1273,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { } } - /** - * - * - * @param intPraticaId - * @return - * @throws SystemException - */ @Override public Avviso getLastAvvisoIntegrazione(long intPraticaId) throws SystemException { + DynamicQuery dynamicQuery = AvvisoLocalServiceUtil.dynamicQuery(); dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento").in( new String[] { StatoPraticaConstants.INTEGRAZIONE })); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/CollaudoLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/CollaudoLocalServiceImpl.java index edb20efe..e44906db 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/CollaudoLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/CollaudoLocalServiceImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.service.impl; @@ -56,14 +56,12 @@ import com.liferay.portal.service.ServiceContext; * The implementation of the collaudo local service. * *

- * All custom service methods should be put in this class. Whenever methods are - * added, rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.CollaudoLocalService} interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.CollaudoLocalService} interface. * *

- * This is a local service. Methods of this service will not have security - * checks based on the propagated JAAS credentials because this service can only - * be accessed from within the same VM. + * This is a local service. Methods of this service will not have security checks based on the propagated JAAS + * credentials because this service can only be accessed from within the same VM. *

* * @author Davide Barbagallo, 3F Consulting @@ -72,46 +70,37 @@ import com.liferay.portal.service.ServiceContext; */ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl { /* - * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use - * {@link it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil} to - * access the collaudo local service. + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil} to access the collaudo local service. */ private Collaudo initCollaudo(ServiceContext serviceContext) throws PortalException, SystemException { User user = userLocalService.getUser(serviceContext.getUserId()); - Date now = new Date(); - - Collaudo collaudo = collaudoPersistence.create(counterLocalService.increment(DettPratica.class - .getName())); - + Collaudo collaudo = collaudoPersistence.create(counterLocalService.increment(DettPratica.class.getName())); collaudo.setCompanyId(serviceContext.getCompanyId()); collaudo.setGroupId(serviceContext.getScopeGroupId()); collaudo.setUserId(serviceContext.getUserId()); collaudo.setUserName(user.getFullName()); collaudo.setCreateDate(serviceContext.getCreateDate(now)); collaudo.setModifiedDate(serviceContext.getModifiedDate(now)); - // setto parametri di default collaudo.setParziale(false); collaudo.setDataEffettuazione(null); collaudo.setDataCollaudo(null); collaudo.setCodiceFiscaleDelegato(StringPool.BLANK); - return collaudo; } + @Override @Indexable(type = IndexableType.REINDEX) public Collaudo addCollaudo(long intPraticaId, ServiceContext serviceContext) throws PortalException, SystemException { IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); - Collaudo collaudo = initCollaudo(serviceContext); - collaudo.setGroupId(intPratica.getGroupId()); collaudo.setIntPraticaId(intPraticaId); - collaudoPersistence.update(collaudo); return collaudo; } @@ -125,12 +114,10 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl { for (DocPratica docPratica : docPraticas) { docPraticaLocalService.deleteDocPratica(docPratica); } - List pagamenti = pagamentoLocalService.findByClassPk(collaudo.getCollaudoId()); for (Pagamento pagamento : pagamenti) { pagamentoLocalService.deletePagamento(pagamento); } - return super.deleteCollaudo(collaudo); } @@ -139,29 +126,27 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl { public Collaudo deleteCollaudo(long collaudoId) throws PortalException, SystemException { Collaudo collaudo = collaudoPersistence.findByPrimaryKey(collaudoId); - return deleteCollaudo(collaudo); } + @Override @Indexable(type = IndexableType.REINDEX) public Collaudo updateCollaudo(long userId, long collaudoId, long intPraticaId, boolean parziale, boolean completata, Date dataCollaudo, String codiceFiscaleDelegato, boolean normEsenteBollo, String noteCollaudo) throws NoSuchCollaudoException, SystemException { Collaudo collaudo = collaudoPersistence.findByPrimaryKey(collaudoId); - collaudo.setParziale(parziale); collaudo.setCompletata(completata); collaudo.setDataCollaudo(dataCollaudo); collaudo.setCodiceFiscaleDelegato(codiceFiscaleDelegato); collaudo.setNormEsenteBollo(normEsenteBollo); collaudo.setNoteCollaudo(noteCollaudo); - collaudo = collaudoPersistence.update(collaudo); - return collaudo; } + @Override public Collaudo getLastEditable(long intPraticaId) throws SystemException { DynamicQuery dynamicQuery = dynamicQuery(); @@ -174,6 +159,7 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl { return null; } + @Override public Collaudo getLastCompleted(long intPraticaId) throws SystemException { DynamicQuery dynamicQuery = dynamicQuery(); @@ -186,82 +172,68 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl { return null; } + @Override public void updateEsitoPagamento(long pagamentoId, long collaudoId, String stato) throws SystemException, PortalException { updateEsitoPagamento(pagamentoId, collaudoId, 0l, stato); } + @Override public void updateEsitoPagamento(long pagamentoId, long collaudoId, long fileEntryId, String stato) throws SystemException, PortalException { Date now = new Date(); Collaudo collaudo = collaudoPersistence.fetchByPrimaryKey(collaudoId); - collaudo.setModifiedDate(now); if (stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_PAGATA)) { - collaudo.setCompletata(true); collaudo.setDataEffettuazione(now); - collaudo.setNumero(collaudoPersistence.countByIntPraticaId_Completata(collaudo.getIntPraticaId(), - true) + 1); + collaudo.setNumero(collaudoPersistence.countByIntPraticaId_Completata(collaudo.getIntPraticaId(), true) + 1); collaudo = updateCollaudo(collaudo); - updateIntPraticaStatus(collaudo, collaudo.getIntPraticaId()); - docPraticaLocalService.completeInvalidation(collaudo.getIntPraticaId()); - IntPratica intPratica = intPraticaLocalService.getIntPratica(collaudo.getIntPraticaId()); if (WorkflowUtil.isWorkflowDisattivabile(collaudo.getIntPraticaId()) && Validator.isNotNull(intPratica.getStatusByUserId())) { inviaMailnotifica(collaudoId, intPratica.getStatusByUserId(), now); } pagamentoLocalService.updatePagamentoUtilizzata(pagamentoId, stato); - } else if (stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_NON_PAGABILE) || stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_RIFIUTATA) || stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_ANNULLATO)) { pagamentoLocalService.updatePagamentoUtilizzata(pagamentoId, stato); } - } + @Override public Collaudo updateEsito(long collaudoId, int stato) throws SystemException, PortalException { Date now = new Date(); Collaudo collaudo = collaudoPersistence.fetchByPrimaryKey(collaudoId); collaudo.setModifiedDate(now); - collaudo.setCompletata(true); collaudo.setDataEffettuazione(now); - collaudo.setNumero(collaudoPersistence.countByIntPraticaId_Completata(collaudo.getIntPraticaId(), - true) + 1); + collaudo.setNumero(collaudoPersistence.countByIntPraticaId_Completata(collaudo.getIntPraticaId(), true) + 1); collaudo = updateCollaudo(collaudo); - updateIntPraticaStatus(collaudo, collaudo.getIntPraticaId()); - docPraticaLocalService.completeInvalidation(collaudo.getIntPraticaId()); - IntPratica intPratica = intPraticaLocalService.getIntPratica(collaudo.getIntPraticaId()); if (WorkflowUtil.isWorkflowDisattivabile(collaudo.getIntPraticaId()) && Validator.isNotNull(intPratica.getStatusByUserId())) { inviaMailnotifica(collaudoId, intPratica.getStatusByUserId(), now); } - return collaudo; } - private void inviaMailnotifica(long collaudoId, long tecnicoIstruttoreId, Date date) - throws SystemException, PortalException { + private void inviaMailnotifica(long collaudoId, long tecnicoIstruttoreId, Date date) throws SystemException, + PortalException { Collaudo collaudo = collaudoPersistence.fetchByPrimaryKey(collaudoId); - User tecnicoIstruttore = userLocalService.getUser(tecnicoIstruttoreId); - String[] to = { tecnicoIstruttore.getEmailAddress() }; String[] cc = new String[0]; String[] ccn = new String[0]; - String tipoPratica = StringPool.BLANK; long intPraticaId = collaudo.getIntPraticaId(); if (AzioniPraticheUtil.isDeposito(intPraticaId)) { @@ -269,24 +241,19 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl { } else if (AzioniPraticheUtil.isAutorizzazione(intPraticaId)) { tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-02"); } - JSONObject templateVariables = JSONFactoryUtil.createJSONObject(); templateVariables.put("receiver", tecnicoIstruttore.getFullName()); templateVariables.put("tipoPratica", tipoPratica); - templateVariables.put( - "tipoOggetto", - LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-" - + (collaudo.getParziale() ? "10" : "08"))); - templateVariables.put("dataInvio", FastDateFormatFactoryUtil.getSimpleDateFormat("dd/MM/yyyy HH:mm") - .format(date)); - + templateVariables.put("tipoOggetto", + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-" + (collaudo.getParziale() ? "10" : "08"))); + templateVariables.put("dataInvio", + FastDateFormatFactoryUtil.getSimpleDateFormat("dd/MM/yyyy HH:mm").format(date)); ServiceContext serviceContext = new ServiceContext(); serviceContext.setScopeGroupId(collaudo.getGroupId()); serviceContext.setCompanyId(collaudo.getCompanyId()); serviceContext.setUserId(collaudo.getUserId()); - - MailUtil.invioMailNotifica(collaudo.getIntPraticaId(), 0l, collaudoId, Collaudo.class.getName(), to, - cc, ccn, "NOTIFICA-BO", templateVariables, null, serviceContext); + MailUtil.invioMailNotifica(collaudo.getIntPraticaId(), 0l, collaudoId, Collaudo.class.getName(), to, cc, ccn, + "NOTIFICA-BO", templateVariables, null, serviceContext); } private IntPratica updateIntPraticaStatus(Collaudo collaudo, long intPraticaId) throws PortalException, @@ -302,6 +269,7 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl { return intPratica; } + @Override public Collaudo updateCollaudoProtocollo(long collaudoId, String protocollo) throws PortalException, SystemException { @@ -310,87 +278,91 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl { collaudo.setProtocollo(protocollo); collaudo.setDtProtocollo(new Date()); collaudo = collaudoLocalService.updateCollaudo(collaudo); - return collaudo; } + @Override public Collaudo findByProtocollo(long companyId, long groupId, String protocollo) throws PortalException, SystemException { return collaudoPersistence.findByC_G_Protocollo(companyId, groupId, protocollo); } + @Override public Collaudo fetchByProtocollo(String protocollo) throws PortalException, SystemException { return collaudoPersistence.fetchByProtocollo(protocollo); } + @Override public Collaudo pagaInvia(long collaudoId, String codiceFiscaleCommittente, String currentURL, ServiceContext serviceContext) throws SystemException, PortalException { Collaudo collaudo = collaudoPersistence.findByPrimaryKey(collaudoId); - BigDecimal importoBolli = PagamentiCommonUtil.getImportoBolli(collaudo.getCompanyId(), collaudo.getCollaudoId(), Collaudo.class.getName(), TipoIntegrazioneUtil.COLLAUDO); - collaudo.setImportoBolli(importoBolli.toString()); collaudo = updateCollaudo(collaudo); - PagamentiUtil.nuovoPagamento(currentURL, collaudo.getCollaudoId(), Collaudo.class.getName(), - PagamentoConstants.PAGAMENTO_BOLLI, importoBolli.toString(), codiceFiscaleCommittente, - serviceContext); - + PagamentoConstants.PAGAMENTO_BOLLI, importoBolli.toString(), codiceFiscaleCommittente, serviceContext); return collaudo; } - public List findByIntPraticaId(long intPraticaId, int start, int end, - OrderByComparator orderByComparator) throws SystemException { + @Override + public List findByIntPraticaId(long intPraticaId, int start, int end, OrderByComparator orderByComparator) + throws SystemException { return collaudoPersistence.findByIntPraticaId(intPraticaId, start, end, orderByComparator); } + @Override public int countByIntPraticaId(long intPraticaId) throws SystemException { return collaudoPersistence.countByIntPraticaId(intPraticaId); } - public List findByIntPraticaId_Parziale(long intPraticaId, boolean parziale, int start, - int end, OrderByComparator orderByComparator) throws SystemException { + @Override + public List findByIntPraticaId_Parziale(long intPraticaId, boolean parziale, int start, int end, + OrderByComparator orderByComparator) throws SystemException { - return collaudoPersistence.findByIntPraticaId_Parziale(intPraticaId, parziale, start, end, - orderByComparator); + return collaudoPersistence.findByIntPraticaId_Parziale(intPraticaId, parziale, start, end, orderByComparator); } + @Override public int countByIntPraticaId_Parziale(long intPraticaId, boolean parziale) throws SystemException { return collaudoPersistence.countByIntPraticaId_Parziale(intPraticaId, parziale); } - public List findByIntPraticaId_Completata(long intPraticaId, boolean completata, int start, - int end, OrderByComparator orderByComparator) throws SystemException { + @Override + public List findByIntPraticaId_Completata(long intPraticaId, boolean completata, int start, int end, + OrderByComparator orderByComparator) throws SystemException { return collaudoPersistence.findByIntPraticaId_Completata(intPraticaId, completata, start, end, orderByComparator); } + @Override public int countByIntPraticaId_Completata(long intPraticaId, boolean completata) throws SystemException { return collaudoPersistence.countByIntPraticaId_Completata(intPraticaId, completata); } - public List findByCodiceFiscale_Completata(String codiceFiscaleDelegato, boolean completata, - int start, int end, OrderByComparator orderByComparator) throws SystemException { + @Override + public List findByCodiceFiscale_Completata(String codiceFiscaleDelegato, boolean completata, int start, + int end, OrderByComparator orderByComparator) throws SystemException { - return collaudoPersistence.findByCodiceFiscale_Completata(codiceFiscaleDelegato, completata, start, - end, orderByComparator); + return collaudoPersistence.findByCodiceFiscale_Completata(codiceFiscaleDelegato, completata, start, end, + orderByComparator); } - public int countByCodiceFiscale_Completata(String codiceFiscaleDelegato, boolean completata) - throws SystemException { + @Override + public int countByCodiceFiscale_Completata(String codiceFiscaleDelegato, boolean completata) throws SystemException { return collaudoPersistence.countByCodiceFiscale_Completata(codiceFiscaleDelegato, completata); } + @Override public List findByIntPraticaId_Parziale_leCollaudoId(long collaudoId, long intPraticaId, boolean parziale, int start, int end, OrderByComparator orderByComparator) throws SystemException { @@ -398,10 +370,10 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl { dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.lt("collaudoId", collaudoId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("parziale", parziale)); - return dynamicQuery(dynamicQuery, start, end, orderByComparator); } + @Override public int countByIntPraticaId_Parziale_leCollaudoId(long collaudoId, long intPraticaId, boolean parziale) throws SystemException { @@ -409,11 +381,11 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl { dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.lt("collaudoId", collaudoId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("parziale", parziale)); - List results = dynamicQuery(dynamicQuery); - return results.isEmpty() ? 0 : results.size(); + return results.size(); } + @Override public List findCollaudiCompletiNotProtocollo(int start, int end) throws SystemException { DynamicQuery dynamicQuery = getDynamicQueryCollaudiCompletiNotProtocollo(); @@ -421,6 +393,7 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl { return collaudoPersistence.findWithDynamicQuery(dynamicQuery, start, end); } + @Override public int countCollaudiCompletiNotProtocollo() throws SystemException { DynamicQuery dynamicQuery = getDynamicQueryCollaudiCompletiNotProtocollo(); @@ -439,6 +412,7 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl { return dynamicQuery; } + @Override public List findCollaudiCompletiNotGestiti(int start, int end) throws SystemException { DynamicQuery dynamicQuery = getDynamicQueryCollaudiCompletiNotGestiti(); @@ -446,6 +420,7 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl { return collaudoPersistence.findWithDynamicQuery(dynamicQuery, start, end); } + @Override public int countCollaudiCompletiNotGestiti() throws SystemException { DynamicQuery dynamicQuery = getDynamicQueryCollaudiCompletiNotGestiti(); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ComunicazioneLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ComunicazioneLocalServiceImpl.java index 57436a23..a896cdd6 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ComunicazioneLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ComunicazioneLocalServiceImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.service.impl; @@ -44,13 +44,12 @@ import com.liferay.portal.service.ServiceContext; * The implementation of the comunicazione local service. * *

- * All custom service methods should be put in this class. Whenever methods are added, rerun - * ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.ComunicazioneLocalService} interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.ComunicazioneLocalService} interface. * *

- * This is a local service. Methods of this service will not have security checks based on the - * propagated JAAS credentials because this service can only be accessed from within the same VM. + * This is a local service. Methods of this service will not have security checks based on the propagated JAAS + * credentials because this service can only be accessed from within the same VM. *

* * @author Davide Barbagallo, 3F Consulting @@ -58,191 +57,133 @@ import com.liferay.portal.service.ServiceContext; * @see it.tref.liferay.portos.bo.service.ComunicazioneLocalServiceUtil */ public class ComunicazioneLocalServiceImpl extends ComunicazioneLocalServiceBaseImpl { - /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link - * it.tref.liferay.portos.bo.service.ComunicazioneLocalServiceUtil} to access the comunicazione - * local service. - */ - - public Comunicazione addComunicazione(long userId, long intPraticaId, String domanda, ServiceContext serviceContext) - throws SystemException, PortalException { - Comunicazione comunicazione = - comunicazionePersistence.create(counterLocalService.increment(Comunicazione.class.getName())); - - User user = userPersistence.findByPrimaryKey(userId); - - Date now = new Date(); - - comunicazione.setCompanyId(serviceContext.getCompanyId()); - comunicazione.setUserId(user.getUserId()); - comunicazione.setUserName(user.getFullName()); - comunicazione.setCreateDate(serviceContext.getCreateDate(now)); - comunicazione.setModifiedDate(serviceContext.getModifiedDate(now)); - comunicazione.setGroupId(serviceContext.getScopeGroupId()); - - comunicazione.setIntPraticaId(intPraticaId); - comunicazione.setDomanda(domanda); - - comunicazione = comunicazionePersistence.update(comunicazione); - - // Send notification mail for new Comunicazione Mediata - this.invioAddMailNotifica(comunicazione.getComunicazioneId(), serviceContext); - - return comunicazione; - } - - public Comunicazione updateComunicazione(long comunicazioneId, String risposta) throws SystemException, - PortalException { - Comunicazione comunicazione = comunicazionePersistence.fetchByPrimaryKey(comunicazioneId); - - Date now = new Date(); - comunicazione.setDtRisposta(now); - comunicazione.setRisposta(risposta); - - comunicazione = comunicazionePersistence.update(comunicazione); - - // resourceLocalService.updateModelResources(comunicazione, serviceContext); - IntPratica intPratica = intPraticaLocalService.getIntPratica(comunicazione.getIntPraticaId()); - if (WorkflowUtil.isWorkflowDisattivabile(intPratica.getIntPraticaId()) - && Validator.isNotNull(intPratica.getStatusByUserId())) { - - this.invioUpdateMailNotifica(comunicazione.getComunicazioneId(), intPratica.getStatusByUserId(), now); - } - - return comunicazione; - } - - public List findByIntPratica(long intPraticaId) throws SystemException { - return comunicazionePersistence.findByIntPratica(intPraticaId); - } - - public List findByIntPratica(long intPraticaId, int start, int end, OrderByComparator orderByComparator) - throws SystemException { - return comunicazionePersistence.findByIntPratica(intPraticaId, start, end, orderByComparator); - } - - public int countByIntPratica(long intPraticaId) throws SystemException { - return comunicazionePersistence.countByIntPratica(intPraticaId); - } - - public int countNotAnsweredByIntPratica(long intPraticaId) throws SystemException { - DynamicQuery dynamicQuery = dynamicQuery(); - dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); - - dynamicQuery.add(RestrictionsFactoryUtil.isNull("dtRisposta")); - - return (int) comunicazionePersistence.countWithDynamicQuery(dynamicQuery); - } - - // private void invioMailNotifica(long comunicazioneId, ServiceContext serviceContext) throws - // PortalException, - // SystemException { - // - // Comunicazione comunicazione = comunicazioneLocalService.getComunicazione(comunicazioneId); - // - // IntPratica intPratica = intPraticaLocalService.getIntPratica(comunicazione.getIntPraticaId()); - // - // User titolaredigitaleUser = userLocalService.getUser(intPratica.getUserId()); - // List titolari = - // soggettoLocalService.getValidByIntPratica_CodiceFiscale(intPratica.getIntPraticaId(), - // titolaredigitaleUser.getScreenName()); - // String eMail = StringPool.BLANK; - // String title = StringPool.BLANK; - // if (!titolari.isEmpty()) { - // Soggetto titolareDigitale = titolari.get(0); - // eMail = titolareDigitale.getEmail(); - // title = titolareDigitale.getDescrizioneCompleta(); - // } - // - // String[] to = {eMail}; - // String[] cc = new String[0]; - // String[] ccn = new String[0]; - // - // String queryString = "_" + PortletKeys.FASCICOLOFE + "_toolbarItem=view-comunicazioni"; - // String url = - // FascicoloURLUtil.getFascicoloFEViewURL(intPratica.getCompanyId(), intPratica.getIntPraticaId(), - // "/html/fascicolofe/view_fascicolo.jsp", queryString); - // - // JSONObject templateVariables = JSONFactoryUtil.createJSONObject(); - // templateVariables.put("receiver", title); - // templateVariables.put("praticaNum", intPratica.getNumeroProgetto()); - // templateVariables.put("link", url); - // - // MailManagerUtil.sendMailByTemplatName(Comunicazione.class.getName(), comunicazioneId, - // "NUOVA-COMUNICAZIONE", to, - // cc, ccn, templateVariables, null, serviceContext); - // } - - private void invioAddMailNotifica(long comunicazioneId, ServiceContext serviceContext) throws PortalException, - SystemException { - - Comunicazione comunicazione = comunicazioneLocalService.getComunicazione(comunicazioneId); - - IntPratica intPratica = intPraticaLocalService.getIntPratica(comunicazione.getIntPraticaId()); - - User titolaredigitaleUser = userLocalService.getUser(intPratica.getUserId()); - List titolari = - soggettoLocalService.getValidByIntPratica_CodiceFiscale(intPratica.getIntPraticaId(), - titolaredigitaleUser.getScreenName()); - String eMail = StringPool.BLANK; - String receiver = StringPool.BLANK; - if (!titolari.isEmpty()) { - Soggetto titolareDigitale = titolari.get(0); - eMail = titolareDigitale.getEmail(); - receiver = titolareDigitale.getDescrizioneCompleta(); - } - - String[] to = {eMail}; - String[] cc = new String[0]; - String[] ccn = new String[0]; - - String queryString = "_" + PortletKeys.FASCICOLOFE + "_toolbarItem=view-comunicazioni"; - String url = - FascicoloURLUtil.getFascicoloFEViewURL(intPratica.getCompanyId(), intPratica.getIntPraticaId(), - "/html/fascicolofe/view_fascicolo.jsp", queryString); - - JSONObject templateVariable = JSONFactoryUtil.createJSONObject(); - templateVariable.put("receiver", receiver); - templateVariable.put("link", url); - - MailUtil.invioMailNotifica(comunicazione.getIntPraticaId(), 0l, comunicazioneId, Comunicazione.class.getName(), to, - cc, ccn, "INVIO-RICHIESTA-ASSEVERAZIONE", templateVariable, null, serviceContext); - } - - private void invioUpdateMailNotifica(long comunicazioneId, long tecnicoIstruttoreId, Date date) - throws PortalException, SystemException { - - Comunicazione comunicazione = comunicazioneLocalService.getComunicazione(comunicazioneId); - - User tecnicoIstruttore = userLocalService.getUser(tecnicoIstruttoreId); - - String[] to = {tecnicoIstruttore.getEmailAddress()}; - String[] cc = new String[0]; - String[] ccn = new String[0]; - - String tipoPratica = StringPool.BLANK; - long intPraticaId = comunicazione.getIntPraticaId(); - if (AzioniPraticheUtil.isDeposito(intPraticaId)) { - tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-01"); - } else if (AzioniPraticheUtil.isAutorizzazione(intPraticaId)) { - tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-02"); - } - - JSONObject templateVariables = JSONFactoryUtil.createJSONObject(); - templateVariables.put("receiver", tecnicoIstruttore.getFullName()); - templateVariables.put("tipoPratica", tipoPratica); - templateVariables.put("tipoOggetto", LanguageUtil.get(LocaleUtil.ITALIAN, "label.comunicazione.mediata")); - templateVariables.put("dataInvio", FastDateFormatFactoryUtil.getSimpleDateFormat("dd/MM/yyyy HH:mm").format(date)); - - ServiceContext serviceContext = new ServiceContext(); - serviceContext.setScopeGroupId(comunicazione.getGroupId()); - serviceContext.setCompanyId(comunicazione.getCompanyId()); - serviceContext.setUserId(comunicazione.getUserId()); - - MailUtil.invioMailNotifica(comunicazione.getIntPraticaId(), 0l, comunicazioneId, Comunicazione.class.getName(), to, - cc, ccn, "NOTIFICA-BO", templateVariables, null, serviceContext); - } - + /* + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.ComunicazioneLocalServiceUtil} to access the comunicazione local service. + */ + + @Override + public Comunicazione addComunicazione(long userId, long intPraticaId, String domanda, ServiceContext serviceContext) + throws SystemException, PortalException { + + Comunicazione comunicazione = comunicazionePersistence.create(counterLocalService.increment(Comunicazione.class + .getName())); + User user = userPersistence.findByPrimaryKey(userId); + Date now = new Date(); + comunicazione.setCompanyId(serviceContext.getCompanyId()); + comunicazione.setUserId(user.getUserId()); + comunicazione.setUserName(user.getFullName()); + comunicazione.setCreateDate(serviceContext.getCreateDate(now)); + comunicazione.setModifiedDate(serviceContext.getModifiedDate(now)); + comunicazione.setGroupId(serviceContext.getScopeGroupId()); + comunicazione.setIntPraticaId(intPraticaId); + comunicazione.setDomanda(domanda); + comunicazione = comunicazionePersistence.update(comunicazione); + // Send notification mail for new Comunicazione Mediata + this.invioAddMailNotifica(comunicazione.getComunicazioneId(), serviceContext); + return comunicazione; + } + + @Override + public Comunicazione updateComunicazione(long comunicazioneId, String risposta) throws SystemException, + PortalException { + + Comunicazione comunicazione = comunicazionePersistence.fetchByPrimaryKey(comunicazioneId); + Date now = new Date(); + comunicazione.setDtRisposta(now); + comunicazione.setRisposta(risposta); + comunicazione = comunicazionePersistence.update(comunicazione); + // resourceLocalService.updateModelResources(comunicazione, serviceContext); + IntPratica intPratica = intPraticaLocalService.getIntPratica(comunicazione.getIntPraticaId()); + if (WorkflowUtil.isWorkflowDisattivabile(intPratica.getIntPraticaId()) + && Validator.isNotNull(intPratica.getStatusByUserId())) { + this.invioUpdateMailNotifica(comunicazione.getComunicazioneId(), intPratica.getStatusByUserId(), now); + } + return comunicazione; + } + + @Override + public List findByIntPratica(long intPraticaId) throws SystemException { + + return comunicazionePersistence.findByIntPratica(intPraticaId); + } + + @Override + public List findByIntPratica(long intPraticaId, int start, int end, + OrderByComparator orderByComparator) throws SystemException { + + return comunicazionePersistence.findByIntPratica(intPraticaId, start, end, orderByComparator); + } + + @Override + public int countByIntPratica(long intPraticaId) throws SystemException { + + return comunicazionePersistence.countByIntPratica(intPraticaId); + } + + @Override + public int countNotAnsweredByIntPratica(long intPraticaId) throws SystemException { + + DynamicQuery dynamicQuery = dynamicQuery(); + dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); + dynamicQuery.add(RestrictionsFactoryUtil.isNull("dtRisposta")); + return (int) comunicazionePersistence.countWithDynamicQuery(dynamicQuery); + } + + private void invioAddMailNotifica(long comunicazioneId, ServiceContext serviceContext) throws PortalException, + SystemException { + + Comunicazione comunicazione = comunicazioneLocalService.getComunicazione(comunicazioneId); + IntPratica intPratica = intPraticaLocalService.getIntPratica(comunicazione.getIntPraticaId()); + User titolaredigitaleUser = userLocalService.getUser(intPratica.getUserId()); + List titolari = soggettoLocalService.getValidByIntPratica_CodiceFiscale(intPratica.getIntPraticaId(), + titolaredigitaleUser.getScreenName()); + String eMail = StringPool.BLANK; + String receiver = StringPool.BLANK; + if (!titolari.isEmpty()) { + Soggetto titolareDigitale = titolari.get(0); + eMail = titolareDigitale.getEmail(); + receiver = titolareDigitale.getDescrizioneCompleta(); + } + String[] to = { eMail }; + String[] cc = new String[0]; + String[] ccn = new String[0]; + String queryString = "_" + PortletKeys.FASCICOLOFE + "_toolbarItem=view-comunicazioni"; + String url = FascicoloURLUtil.getFascicoloFEViewURL(intPratica.getCompanyId(), intPratica.getIntPraticaId(), + "/html/fascicolofe/view_fascicolo.jsp", queryString); + JSONObject templateVariable = JSONFactoryUtil.createJSONObject(); + templateVariable.put("receiver", receiver); + templateVariable.put("link", url); + MailUtil.invioMailNotifica(comunicazione.getIntPraticaId(), 0l, comunicazioneId, Comunicazione.class.getName(), + to, cc, ccn, "INVIO-RICHIESTA-ASSEVERAZIONE", templateVariable, null, serviceContext); + } + + private void invioUpdateMailNotifica(long comunicazioneId, long tecnicoIstruttoreId, Date date) + throws PortalException, SystemException { + + Comunicazione comunicazione = comunicazioneLocalService.getComunicazione(comunicazioneId); + User tecnicoIstruttore = userLocalService.getUser(tecnicoIstruttoreId); + String[] to = { tecnicoIstruttore.getEmailAddress() }; + String[] cc = new String[0]; + String[] ccn = new String[0]; + String tipoPratica = StringPool.BLANK; + long intPraticaId = comunicazione.getIntPraticaId(); + if (AzioniPraticheUtil.isDeposito(intPraticaId)) { + tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-01"); + } else if (AzioniPraticheUtil.isAutorizzazione(intPraticaId)) { + tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-02"); + } + JSONObject templateVariables = JSONFactoryUtil.createJSONObject(); + templateVariables.put("receiver", tecnicoIstruttore.getFullName()); + templateVariables.put("tipoPratica", tipoPratica); + templateVariables.put("tipoOggetto", LanguageUtil.get(LocaleUtil.ITALIAN, "label.comunicazione.mediata")); + templateVariables.put("dataInvio", + FastDateFormatFactoryUtil.getSimpleDateFormat("dd/MM/yyyy HH:mm").format(date)); + ServiceContext serviceContext = new ServiceContext(); + serviceContext.setScopeGroupId(comunicazione.getGroupId()); + serviceContext.setCompanyId(comunicazione.getCompanyId()); + serviceContext.setUserId(comunicazione.getUserId()); + MailUtil.invioMailNotifica(comunicazione.getIntPraticaId(), 0l, comunicazioneId, Comunicazione.class.getName(), + to, cc, ccn, "NOTIFICA-BO", templateVariables, null, serviceContext); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ConfigurazioneLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ConfigurazioneLocalServiceImpl.java index 3a67feeb..49545252 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ConfigurazioneLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ConfigurazioneLocalServiceImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.service.impl; @@ -29,15 +29,12 @@ import com.liferay.portal.service.ServiceContext; * The implementation of the configurazione local service. * *

- * All custom service methods should be put in this class. Whenever methods are - * added, rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.ConfigurazioneLocalService} - * interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.ConfigurazioneLocalService} interface. * *

- * This is a local service. Methods of this service will not have security - * checks based on the propagated JAAS credentials because this service can only - * be accessed from within the same VM. + * This is a local service. Methods of this service will not have security checks based on the propagated JAAS + * credentials because this service can only be accessed from within the same VM. *

* * @author Davide Barbagallo, 3F Consulting @@ -46,12 +43,12 @@ import com.liferay.portal.service.ServiceContext; */ public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBaseImpl { /* - * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use - * {@link it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil} - * to access the configurazione local service. + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil} to access the configurazione local service. */ private static final Log _log = LogFactoryUtil.getLog(ConfigurazioneLocalServiceImpl.class); + @Override public long findByC_ChiaveLong(long companyId, String chiave) throws SystemException { try { @@ -65,6 +62,7 @@ public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBa } } + @Override public String findByC_ChiaveString(long companyId, String chiave) throws SystemException { Configurazione configurazione = configurazionePersistence.fetchByC_Chiave(companyId, chiave); @@ -76,6 +74,7 @@ public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBa return configurazione.getValore(); } + @Override public Configurazione storeConfig(String chiave, String valore, ServiceContext serviceContext) throws SystemException, PortalException { @@ -85,8 +84,7 @@ public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBa } catch (NoSuchConfigurazioneException e) { } if (configurazione == null) { - configurazione = createConfigurazione(counterLocalService.increment(Configurazione.class - .getName())); + configurazione = createConfigurazione(counterLocalService.increment(Configurazione.class.getName())); configurazione.setChiave(chiave); configurazione.setCompanyId(serviceContext.getCompanyId()); configurazione.setCreateDate(new Date()); @@ -98,6 +96,7 @@ public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBa return configurazioneLocalService.updateConfigurazione(configurazione); } + @Override public long getAndIncrement(long companyId, String chiave) throws SystemException { try { @@ -107,16 +106,16 @@ public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBa configurazioneLocalService.updateConfigurazione(configurazione); return current; } catch (NoSuchConfigurazioneException e) { - Configurazione configurazione = createConfigurazione(counterLocalService - .increment(Configurazione.class.getName())); + Configurazione configurazione = createConfigurazione(counterLocalService.increment(Configurazione.class + .getName())); configurazione.setChiave(chiave); configurazione.setCompanyId(companyId); configurazione.setCreateDate(new Date()); configurazione.setGroupId(-1); - configurazione.setUserId(0l); + configurazione.setUserId(0L); configurazione.setValore("2"); configurazioneLocalService.updateConfigurazione(configurazione); - return 1l; + return 1L; } catch (NumberFormatException e) { _log.error("error", e); throw new SystemException("Errore imprevisto", e); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java index 994b82c7..d7023e7d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java @@ -113,36 +113,25 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi SystemException { User user = userPersistence.findByPrimaryKey(userId); - // In creazione del sito viene avviato il workflow sul sito principale - // mentre in update di una - // issue viene avviato - // sul sito specifico per ovviare a bug - // long groupId = serviceContext.getScopeGroupId(); - + // In creazione del sito viene avviato il workflow sul sito principale mentre in update di una issue viene + // avviato sul sito specifico per ovviare a bug Date now = new Date(); - long controlloPraticaId = counterLocalService.increment(ControlloPratica.class.getName()); - ControlloPratica entry = controlloPraticaPersistence.create(controlloPraticaId); - entry.setCompanyId(user.getCompanyId()); entry.setUserId(user.getUserId()); entry.setUserName(user.getFullName()); _log.info("User Full Name: " + user.getFullName()); entry.setCreateDate(serviceContext.getCreateDate(now)); entry.setModifiedDate(serviceContext.getModifiedDate(now)); - entry.setGroupId(groupId); entry.setIntPraticaId(intPraticaId); entry.setDettPraticaId(dettPraticaId); // Workflow entry.setStatus(WorkflowConstants.STATUS_DRAFT); - controlloPraticaPersistence.update(entry); - // Resources resourceLocalService.addModelResources(entry, serviceContext); - // aggiorno int e dett pratica per avvio workflow IntPratica intPratica = intPraticaLocalService.updateStatoPratica(intPraticaId, StatoPraticaConstants.SOTTOPOSTA_A_PARERE); @@ -150,11 +139,9 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi intPratica.setControlloObbligatorio(true); intPratica = intPraticaLocalService.updateIntPratica(intPratica); } - // Asset updateAsset(userId, entry, serviceContext.getAssetCategoryIds(), serviceContext.getAssetTagNames(), serviceContext.getAssetLinkEntryIds(), now); - // ADT: BUG BO GESTIONE WORKFLOW Map wfContextMap = new HashMap(); DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId); @@ -162,21 +149,17 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi wfContextMap.put("wf_variante", "OK"); } // /////////// - // Workflow WorkflowHandlerRegistryUtil.startWorkflowInstance(entry.getCompanyId(), entry.getGroupId(), entry.getUserId(), ControlloPratica.class.getName(), entry.getPrimaryKey(), entry, serviceContext, wfContextMap); - Date dtInvio = null; if (intPratica.getDtSorteggio() != null) { dtInvio = intPratica.getDtSorteggio(); } else { dtInvio = entry.getCreateDate(); } - TempisticaLocalServiceUtil.addTempistica(intPraticaId, dettPraticaId, TempisticaConstants.TIPO_PRATICA, dtInvio, serviceContext); - return entry; } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DelegaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DelegaLocalServiceImpl.java index fd30d504..f5d937a5 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DelegaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DelegaLocalServiceImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.service.impl; @@ -55,14 +55,12 @@ import com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil; * The implementation of the delega local service. * *

- * All custom service methods should be put in this class. Whenever methods are - * added, rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.DelegaLocalService} interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.DelegaLocalService} interface. * *

- * This is a local service. Methods of this service will not have security - * checks based on the propagated JAAS credentials because this service can only - * be accessed from within the same VM. + * This is a local service. Methods of this service will not have security checks based on the propagated JAAS + * credentials because this service can only be accessed from within the same VM. *

* * @author Davide Barbagallo, 3F Consulting @@ -71,42 +69,31 @@ import com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil; */ public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link - * it.tref.liferay.portos.bo.service.DelegaLocalServiceUtil} to access the - * delega local service. + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.DelegaLocalServiceUtil} to access the delega local service. */ private Log _log = LogFactoryUtil.getLog(DelegaLocalServiceImpl.class); @Override - public Delega addDelega(long userId, long intPraticaId, long dettPraticaId, String tipologia, - String codiceFiscale, ServiceContext serviceContext) throws PortalException, SystemException { + public Delega addDelega(long userId, long intPraticaId, long dettPraticaId, String tipologia, String codiceFiscale, + ServiceContext serviceContext) throws PortalException, SystemException { User user = userPersistence.findByPrimaryKey(userId); - Date now = new Date(); - - validate(tipologia, codiceFiscale); - Delega delega = delegaPersistence.create(counterLocalService.increment(Delega.class.getName())); - delega.setCompanyId(serviceContext.getCompanyId()); delega.setUserId(user.getUserId()); delega.setUserName(user.getFullName()); delega.setCreateDate(serviceContext.getCreateDate(now)); delega.setModifiedDate(serviceContext.getModifiedDate(now)); delega.setGroupId(serviceContext.getScopeGroupId()); - delega.setIntPraticaId(intPraticaId); delega.setDettPraticaId(dettPraticaId); delega.setTipologia(tipologia); delega.setEsito(DelegheUtil.STATO_ASSEGNATA); delega.setCodiceFiscale(codiceFiscale); - delega = delegaPersistence.update(delega); - return delega; } @@ -126,6 +113,7 @@ public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl { @Override public void concludiDeleghePagamento(long dettPraticaId) throws PortalException, SystemException { + List deleghe = this.findByDettPratica_Tipologia_InEsito(dettPraticaId, new String[] { DelegheUtil.TIPO_PAGAMENTO }, new String[] { DelegheUtil.STATO_ASSEGNATA }); for (Delega delega : deleghe) { @@ -146,115 +134,120 @@ public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl { return deleteDelega(delega); } - private void validate(String tipologia, String codiceFiscale) throws PortalException, SystemException { - // TODO Write your own validation code - } - @Override - public List findByIntPratica(long intPraticaId, int start, int end, - OrderByComparator orderByComparator) throws SystemException { + public List findByIntPratica(long intPraticaId, int start, int end, OrderByComparator orderByComparator) + throws SystemException { + return delegaPersistence.findByIntPratica(intPraticaId, start, end, orderByComparator); } @Override - public List findByDettPratica(long dettPraticaId, int start, int end, - OrderByComparator orderByComparator) throws SystemException { + public List findByDettPratica(long dettPraticaId, int start, int end, OrderByComparator orderByComparator) + throws SystemException { + return delegaPersistence.findByDettPratica(dettPraticaId, start, end, orderByComparator); } @Override public int countByIntPratica(long intPraticaId) throws SystemException { + return delegaPersistence.countByIntPratica(intPraticaId); } @Override public int countByDettPratica(long dettPraticaId) throws SystemException { + return delegaPersistence.countByIntPratica(dettPraticaId); } @Override - public List findByIntPratica_CodiceFiscale(long intPraticaId, String codiceFiscale, int start, - int end, OrderByComparator orderByComparator) throws SystemException { + public List findByIntPratica_CodiceFiscale(long intPraticaId, String codiceFiscale, int start, int end, + OrderByComparator orderByComparator) throws SystemException { + return delegaPersistence.findByIntPratica_CodiceFiscale(intPraticaId, codiceFiscale, start, end, orderByComparator); } @Override public List findByCodiceFiscale(String codiceFiscale) throws SystemException { + return delegaPersistence.findByCodiceFiscale(codiceFiscale); } @Override - public int countByIntPratica_CodiceFiscale(long intPraticaId, String codiceFiscale) - throws SystemException { + public int countByIntPratica_CodiceFiscale(long intPraticaId, String codiceFiscale) throws SystemException { + return delegaPersistence.countByIntPratica_CodiceFiscale(intPraticaId, codiceFiscale); } @Override public List findByCodiceFiscale_InEsito(String codiceFiscale, String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException { - return delegaPersistence.findByCodiceFiscale_InEsito(codiceFiscale, esiti, start, end, - orderByComparator); + + return delegaPersistence.findByCodiceFiscale_InEsito(codiceFiscale, esiti, start, end, orderByComparator); } @Override public int countByCodiceFiscale_InEsito(String codiceFiscale, String[] esiti) throws SystemException { + return delegaPersistence.countByCodiceFiscale_InEsito(codiceFiscale, esiti); } @Override - public List findByIntPratica_CodiceFiscale_InEsito(long intPraticaId, String codiceFiscale, - String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException { - return delegaPersistence.findByIntPratica_CodiceFiscale_InEsito(intPraticaId, codiceFiscale, esiti, - start, end, orderByComparator); + public List findByIntPratica_CodiceFiscale_InEsito(long intPraticaId, String codiceFiscale, String[] esiti, + int start, int end, OrderByComparator orderByComparator) throws SystemException { + + return delegaPersistence.findByIntPratica_CodiceFiscale_InEsito(intPraticaId, codiceFiscale, esiti, start, end, + orderByComparator); } @Override public int countByIntPratica_CodiceFiscale_InEsito(long intPraticaId, String codiceFiscale, String[] esiti) throws SystemException { + return delegaPersistence.countByIntPratica_CodiceFiscale_InEsito(intPraticaId, codiceFiscale, esiti); } @Override public List findByDettPratica_CodiceFiscale_InEsito(long dettPraticaId, String codiceFiscale, String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException { - return delegaPersistence.findByDettPratica_CodiceFiscale_InEsito(dettPraticaId, codiceFiscale, esiti, - start, end, orderByComparator); + + return delegaPersistence.findByDettPratica_CodiceFiscale_InEsito(dettPraticaId, codiceFiscale, esiti, start, + end, orderByComparator); } @Override - public int countByDettPratica_CodiceFiscale_InEsito(long dettPraticaId, String codiceFiscale, - String[] esiti) throws SystemException { - return delegaPersistence - .countByDettPratica_CodiceFiscale_InEsito(dettPraticaId, codiceFiscale, esiti); + public int countByDettPratica_CodiceFiscale_InEsito(long dettPraticaId, String codiceFiscale, String[] esiti) + throws SystemException { + + return delegaPersistence.countByDettPratica_CodiceFiscale_InEsito(dettPraticaId, codiceFiscale, esiti); } @Override public List findByIntPratica_InEsito(long intPraticaId, String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException { + return delegaPersistence.findByIntPratica_InEsito(intPraticaId, esiti, start, end, orderByComparator); } @Override public int countByIntPratica_InEsito(long intPraticaId, String[] esiti) throws SystemException { + return delegaPersistence.countByIntPratica_InEsito(intPraticaId, esiti); } @Override public List findByDettPratica_InEsito(long dettPraticaId, String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException { - return delegaPersistence.findByDettPratica_InEsito(dettPraticaId, esiti, start, end, - orderByComparator); + + return delegaPersistence.findByDettPratica_InEsito(dettPraticaId, esiti, start, end, orderByComparator); } @Override - public List findCfByDettPratica_InEsito(long dettPraticaId, String[] esiti) - throws SystemException { + public List findCfByDettPratica_InEsito(long dettPraticaId, String[] esiti) throws SystemException { DynamicQuery dynamicQuery = createQueryByDettPratica_InEsito(dettPraticaId, esiti); - dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil - .property("codiceFiscale"))); - + dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("codiceFiscale"))); return delegaPersistence.findWithDynamicQuery(dynamicQuery); } @@ -262,148 +255,148 @@ public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl { public List findByDettPratica_InEsito(long dettPraticaId, String[] esiti) throws SystemException { DynamicQuery dynamicQuery = createQueryByDettPratica_InEsito(dettPraticaId, esiti); - return delegaPersistence.findWithDynamicQuery(dynamicQuery); } @Override - public List findCfByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie, - String[] esiti) throws SystemException { + public List findCfByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie, String[] esiti) + throws SystemException { DynamicQuery dynamicQuery = createQueryByDettPratica_InEsito(dettPraticaId, esiti); dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie)); - dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil - .property("codiceFiscale"))); - + dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("codiceFiscale"))); return delegaPersistence.findWithDynamicQuery(dynamicQuery); } @Override - public List findByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie, - String[] esiti) throws SystemException { + public List findByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie, String[] esiti) + throws SystemException { DynamicQuery dynamicQuery = createQueryByDettPratica_InEsito(dettPraticaId, esiti); dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie)); - return delegaPersistence.findWithDynamicQuery(dynamicQuery); } private DynamicQuery createQueryByDettPratica_InEsito(long dettPraticaId, String[] esiti) { + DynamicQuery dynamicQuery = dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaId", dettPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.in("esito", esiti)); - return dynamicQuery; } @Override public int countByDettPratica_InEsito(long dettPraticaId, String[] esiti) throws SystemException { + return delegaPersistence.countByDettPratica_InEsito(dettPraticaId, esiti); } @Override - public List findByCodiceFiscale_Tipologia_InEsito(String codiceFiscale, String tipologia, - String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException { - return delegaPersistence.findByCodiceFiscale_Tipologia_InEsito(codiceFiscale, tipologia, esiti, - start, end, orderByComparator); + public List findByCodiceFiscale_Tipologia_InEsito(String codiceFiscale, String tipologia, String[] esiti, + int start, int end, OrderByComparator orderByComparator) throws SystemException { + + return delegaPersistence.findByCodiceFiscale_Tipologia_InEsito(codiceFiscale, tipologia, esiti, start, end, + orderByComparator); } @Override public int countByCodiceFiscale_Tipologia_InEsito(String codiceFiscale, String tipologia, String[] esiti) throws SystemException { + return delegaPersistence.countByCodiceFiscale_Tipologia_InEsito(codiceFiscale, tipologia, esiti); } @Override - public List findByIntPratica_CodiceFiscale_Tipologia_InEsito(long intPraticaId, - String codiceFiscale, String tipologia, String[] esiti, int start, int end, - OrderByComparator orderByComparator) throws SystemException { - return delegaPersistence.findByIntPratica_CodiceFiscale_Tipologia_InEsito(intPraticaId, - codiceFiscale, tipologia, esiti, start, end, orderByComparator); + public List findByIntPratica_CodiceFiscale_Tipologia_InEsito(long intPraticaId, String codiceFiscale, + String tipologia, String[] esiti, int start, int end, OrderByComparator orderByComparator) + throws SystemException { + + return delegaPersistence.findByIntPratica_CodiceFiscale_Tipologia_InEsito(intPraticaId, codiceFiscale, + tipologia, esiti, start, end, orderByComparator); } @Override public int countByIntPratica_CodiceFiscale_Tipologia_InEsito(long intPraticaId, String codiceFiscale, String tipologia, String[] esiti) throws SystemException { - return delegaPersistence.countByIntPratica_CodiceFiscale_Tipologia_InEsito(intPraticaId, - codiceFiscale, tipologia, esiti); + + return delegaPersistence.countByIntPratica_CodiceFiscale_Tipologia_InEsito(intPraticaId, codiceFiscale, + tipologia, esiti); } @Override - public List findByDettPratica_CodiceFiscale_Tipologia_InEsito(long dettPraticaId, - String codiceFiscale, String[] tipologie, String[] esiti, int start, int end, - OrderByComparator orderByComparator) throws SystemException { - return delegaPersistence.findByDettPratica_CodiceFiscale_Tipologia_InEsito(dettPraticaId, - codiceFiscale, tipologie, esiti, start, end, orderByComparator); + public List findByDettPratica_CodiceFiscale_Tipologia_InEsito(long dettPraticaId, String codiceFiscale, + String[] tipologie, String[] esiti, int start, int end, OrderByComparator orderByComparator) + throws SystemException { + + return delegaPersistence.findByDettPratica_CodiceFiscale_Tipologia_InEsito(dettPraticaId, codiceFiscale, + tipologie, esiti, start, end, orderByComparator); } @Override public int countByDettPratica_CodiceFiscale_Tipologia_InEsito(long dettPraticaId, String codiceFiscale, String[] tipologie, String[] esiti) throws SystemException { - return delegaPersistence.countByDettPratica_CodiceFiscale_Tipologia_InEsito(dettPraticaId, - codiceFiscale, tipologie, esiti); + + return delegaPersistence.countByDettPratica_CodiceFiscale_Tipologia_InEsito(dettPraticaId, codiceFiscale, + tipologie, esiti); } @Override - public List findByIntPratica_Tipologia_InEsito(long intPraticaId, String tipologia, - String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException { - return delegaPersistence.findByIntPratica_Tipologia_InEsito(intPraticaId, tipologia, esiti, start, - end, orderByComparator); + public List findByIntPratica_Tipologia_InEsito(long intPraticaId, String tipologia, String[] esiti, + int start, int end, OrderByComparator orderByComparator) throws SystemException { + + return delegaPersistence.findByIntPratica_Tipologia_InEsito(intPraticaId, tipologia, esiti, start, end, + orderByComparator); } @Override - public List findByDettPratica_Tipologia_InEsito(long dettPraticaId, String tipologia, - String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException { - return delegaPersistence.findByDettPratica_Tipologia_InEsito(dettPraticaId, tipologia, esiti, start, - end, orderByComparator); + public List findByDettPratica_Tipologia_InEsito(long dettPraticaId, String tipologia, String[] esiti, + int start, int end, OrderByComparator orderByComparator) throws SystemException { + + return delegaPersistence.findByDettPratica_Tipologia_InEsito(dettPraticaId, tipologia, esiti, start, end, + orderByComparator); } @Override public int countByIntPratica_Tipologia_InEsito(long intPraticaId, String tipologia, String[] esiti) throws SystemException { + return delegaPersistence.countByIntPratica_Tipologia_InEsito(intPraticaId, tipologia, esiti); } @Override - public List findByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie, - String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException { - return delegaPersistence.findByDettPratica_Tipologie_InEsiti(dettPraticaId, tipologie, esiti, start, - end, orderByComparator); + public List findByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie, String[] esiti, + int start, int end, OrderByComparator orderByComparator) throws SystemException { + + return delegaPersistence.findByDettPratica_Tipologie_InEsiti(dettPraticaId, tipologie, esiti, start, end, + orderByComparator); } @Override public int countByDettPratica_Tipologia_InEsito(long intPraticaId, String[] tipologie, String[] esiti) throws SystemException { + return delegaPersistence.countByDettPratica_Tipologie_InEsiti(intPraticaId, tipologie, esiti); } - /** - * - * ADT: nuovo metodo generazione documento conclusione delega - */ + // ADT: nuovo metodo generazione documento conclusione delega @Override - public void generaDocumentoConcludiDelegaGeologo(long dettPraticaId, Delega delega, - ServiceContext serviceContext) throws PortalException, SystemException { + public void generaDocumentoConcludiDelegaGeologo(long dettPraticaId, Delega delega, ServiceContext serviceContext) + throws PortalException, SystemException { try { if (delega.getTipologia().equalsIgnoreCase(DelegheUtil.TIPO_GEOLOGO)) { String tipoDocumento = "D_GEO_"; long userId = serviceContext.getUserId(); - DLFolder folderTemplate = DLFolderLocalServiceUtil.getFolder(serviceContext.getThemeDisplay() .getCompanyGroupId(), 0L, "Template"); - FileEntry fileEntryIdTemplate = DLAppLocalServiceUtil.getFileEntry(serviceContext - .getThemeDisplay().getCompanyGroupId(), folderTemplate.getFolderId(), "Modello Asseverazione"); + FileEntry fileEntryIdTemplate = DLAppLocalServiceUtil.getFileEntry(serviceContext.getThemeDisplay() + .getCompanyGroupId(), folderTemplate.getFolderId(), "Modello Asseverazione"); DLFolder folderAllegati = DLFolderLocalServiceUtil.getFolder(serviceContext.getThemeDisplay() .getCompanyGroupId(), 0L, "Allegati"); - String fileName = StringUtils.leftPad(String.valueOf(delega.getIntPraticaId()), 10, '0') - + (Validator.isNotNull(tipoDocumento) ? StringPool.UNDERLINE + tipoDocumento - : StringPool.BLANK) + StringPool.UNDERLINE + System.currentTimeMillis() - + ".pdf"; - + + (Validator.isNotNull(tipoDocumento) ? StringPool.UNDERLINE + tipoDocumento : StringPool.BLANK) + + StringPool.UNDERLINE + System.currentTimeMillis() + ".pdf"; Map parameters = new HashMap(); - ReportDto reportDto = new ReportDto(); reportDto.setFileEntryIds(new long[] { fileEntryIdTemplate.getFileEntryId() }); reportDto.setFolderId(folderAllegati.getFolderId()); @@ -412,46 +405,35 @@ public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl { reportDto.setHeaderHeight(1); reportDto.setFooter(StringPool.BLANK); reportDto.setFooterHeight(40); - reportDto.setParameters(parameters); reportDto.setShowNumberOfPage(true); reportDto.setType(ReportConstants.ReportType.VELOCITY_TO_PDF.toString()); - String resourcePath = getClass().getName().replaceAll("\\w+\\.", "../") .replace(getClass().getSimpleName(), "resource/asseverazioni"); reportDto.setPortalURL(getClass().getResource(resourcePath).getPath()); - String relazioni = StringPool.BLANK; Map dichiarazioniMap = delega.getDichiarazioniMap(); if (dichiarazioniMap.containsKey("coniugio") && ((Boolean) dichiarazioniMap.get("coniugio")) && dichiarazioniMap.containsKey("relazioni")) { relazioni = (String) dichiarazioniMap.get("relazioni"); } - User user = userLocalService.getUser(userId); - parameters.put("html", AsseverazioneLocalServiceUtil.testoAsseverazione( - TipoSoggettoUtil.GEOLOGO, user, dettPraticaId, relazioni)); + parameters.put("html", AsseverazioneLocalServiceUtil.testoAsseverazione(TipoSoggettoUtil.GEOLOGO, user, + dettPraticaId, relazioni)); parameters.put("modello", "AS-GEO"); - - ReportResultDto result = ReportUtil.generateReport(delega.getCompanyId(), userId, reportDto, - null); + ReportResultDto result = ReportUtil.generateReport(delega.getCompanyId(), userId, reportDto, null); long fileEntryId = result.getFileEntryIds()[0]; - String sha256 = StringPool.BLANK; try { - sha256 = DigestUtils.sha256Hex(dlAppLocalService.getFileEntry(fileEntryId) - .getContentStream()); + sha256 = DigestUtils.sha256Hex(dlAppLocalService.getFileEntry(fileEntryId).getContentStream()); } catch (Exception e) { } - FirmeBean firmeBean = new FirmeBean(); String jsonFirmatari = FirmeUtil.addFirma(firmeBean, user.getScreenName()); - docPraticaLocalService.addDocPraticaAnnullamento(userId, Delega.class.getName(), - delega.getDelegaId(), delega.getIntPraticaId(), fileEntryId, fileName, tipoDocumento, - sha256, jsonFirmatari, serviceContext); - _log.info("Documento conclusione delega correttamente generato per delegaid = " - + delega.getDelegaId()); - + docPraticaLocalService.addDocPraticaAnnullamento(userId, Delega.class.getName(), delega.getDelegaId(), + delega.getIntPraticaId(), fileEntryId, fileName, tipoDocumento, sha256, jsonFirmatari, + serviceContext); + _log.info("Documento conclusione delega correttamente generato per delegaid = " + delega.getDelegaId()); } else { _log.info("Impossibile generare documento delega - soggetto non trovato"); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java index 7377c651..09b8d471 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java @@ -108,29 +108,22 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl private DettPratica initDettPratica(ServiceContext serviceContext) throws PortalException, SystemException { User user = userLocalService.getUser(serviceContext.getUserId()); - Date now = new Date(); - DettPratica dettPratica = dettPraticaLocalService.createDettPratica(counterLocalService .increment(DettPratica.class.getName())); - dettPratica.setCompanyId(serviceContext.getCompanyId()); dettPratica.setGroupId(serviceContext.getScopeGroupId()); dettPratica.setUserId(serviceContext.getUserId()); dettPratica.setUserName(user.getScreenName()); dettPratica.setCreateDate(serviceContext.getCreateDate(now)); dettPratica.setModifiedDate(serviceContext.getModifiedDate(now)); - // setto parametri di default - dettPratica.setIntegrazione(0); dettPratica.setProtocollo(null); dettPratica.setTipoIntegrazione(StringPool.BLANK); dettPratica.setCompleta(false); dettPratica.setGestita(false); - dettPratica.setOperaConforme(false); - dettPratica.setInizioLavoriContestualeOpera(false); dettPratica.setDataInizioLavoriOpera(null); dettPratica.setDataInizioEsecuzioneOpera(null); @@ -149,10 +142,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl DettPratica dettPratica = initDettPratica(serviceContext); IntPratica intPratica = intPraticaLocalService.addIntPratica(territorioId, tipoProcedura, serviceContext); - dettPratica.setGroupId(intPratica.getGroupId()); dettPratica.setIntPraticaId(intPratica.getIntPraticaId()); - dettPratica = dettPraticaPersistence.update(dettPratica); return dettPratica; } @@ -163,11 +154,9 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl throws PortalException, SystemException { IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId); - DettPratica dettPratica = initDettPratica(serviceContext); dettPratica.setGroupId(intPratica.getGroupId()); dettPratica.setIntPraticaId(intPraticaId); - dettPratica = dettPraticaPersistence.update(dettPratica); return dettPratica; } @@ -178,15 +167,12 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl String tipoIntegrazione, ServiceContext serviceContext) throws PortalException, SystemException { IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId); - DettPratica dettPratica = initDettPratica(serviceContext); dettPratica = dettPraticaPersistence.update(dettPratica); DettPratica dettPraticaToClone = dettPraticaPersistence.findByPrimaryKey(dettPraticaToCloneId); - dettPratica = copyDettPratica(dettPratica, dettPraticaToClone, tipoIntegrazione, serviceContext); dettPratica.setIntPraticaId(intPratica.getGroupId()); dettPratica.setIntPraticaId(intPraticaId); - dettPratica = dettPraticaPersistence.update(dettPratica); return dettPratica; } @@ -203,7 +189,7 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl dettPraticaToClone.getCodiceFiscaleDelegatoFineLavori(), dettPraticaToClone.getCodiceFiscaleDelegatoCollaudo(), dettPraticaToClone.getLavoriInEconomiaCommittente(), dettPraticaToClone.getMetratura(), - dettPraticaToClone.getLavoriPubblici(), 0l, dettPraticaToClone.getLavoriPubbliciPercentuale(), + dettPraticaToClone.getLavoriPubblici(), 0L, dettPraticaToClone.getLavoriPubbliciPercentuale(), dettPraticaToClone.getNumeroCivico(), dettPraticaToClone.getDcParticelle(), dettPraticaToClone.getDcFoglio(), dettPraticaToClone.getDcAllegato(), dettPraticaToClone.getDePiani(), dettPraticaToClone.getDeAltezza(), dettPraticaToClone.getDeInterrati(), @@ -274,7 +260,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl dettPraticaToClone.getClRischioPostInt(), dettPraticaToClone.getIntervFinPub(), dettPraticaToClone.getIntervFinPubDesc(), dettPraticaToClone.getTcNuovaCostruzioneComplessa(), serviceContext, true); - copy = updateDettPraticaGeologo(copy.getUserId(), copy.getDettPraticaId(), copy.getIntPraticaId(), dettPraticaToClone.getGeoClasseIndagine(), dettPraticaToClone.getGeoCategoriaSottosuolo(), dettPraticaToClone.getGeoCategoriaTopografica(), dettPraticaToClone.getGeoConsolidamento(), @@ -288,18 +273,15 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl dettPraticaToClone.getGeoNotePrescrizioni(), dettPraticaToClone.getGeoNoteIndagini(), dettPraticaToClone.getGeoEvidenzeGeomorfiche(), dettPraticaToClone.getGeoEvidenzeGeologiche(), dettPraticaToClone.getGeoDtRelazione(), serviceContext, false); - copy.setCodiceFiscaleDelegatoCommittente(dettPraticaToClone.getCodiceFiscaleDelegatoCommittente()); copy.setCodiceFiscaleDelegatoFineLavori(dettPraticaToClone.getCodiceFiscaleDelegatoFineLavori()); copy.setCodiceFiscaleDelegatoCollaudo(dettPraticaToClone.getCodiceFiscaleDelegatoCollaudo()); - copy.setCodiceFiscalePrincipaleCollaudatore(dettPraticaToClone.getCodiceFiscalePrincipaleCollaudatore()); copy.setCodiceFiscalePrincipaleCommittente(dettPraticaToClone.getCodiceFiscalePrincipaleCommittente()); copy.setCodiceFiscalePrincipaleDirettoreLavori(dettPraticaToClone.getCodiceFiscalePrincipaleDirettoreLavori()); copy.setCodiceFiscalePrincipaleDitta(dettPraticaToClone.getCodiceFiscalePrincipaleDitta()); copy.setCodiceFiscalePrincipaleGeologo(dettPraticaToClone.getCodiceFiscalePrincipaleGeologo()); copy.setCodiceFiscalePrincipaleProgettista(dettPraticaToClone.getCodiceFiscalePrincipaleProgettista()); - return copy; } @@ -309,62 +291,34 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl DettPratica copy = dettPraticaPersistence.findByPrimaryKey(dettPraticaId); DettPratica dettPraticaToClone = dettPraticaPersistence.findByPrimaryKey(dettPraticaToCloneId); - copy.setCodiceFiscaleDelegatoCommittente(dettPraticaToClone.getCodiceFiscaleDelegatoCommittente()); copy.setCodiceFiscaleDelegatoFineLavori(dettPraticaToClone.getCodiceFiscaleDelegatoFineLavori()); copy.setCodiceFiscaleDelegatoCollaudo(dettPraticaToClone.getCodiceFiscaleDelegatoCollaudo()); - copy.setCodiceFiscalePrincipaleCollaudatore(dettPraticaToClone.getCodiceFiscalePrincipaleCollaudatore()); copy.setCodiceFiscalePrincipaleCommittente(dettPraticaToClone.getCodiceFiscalePrincipaleCommittente()); copy.setCodiceFiscalePrincipaleDirettoreLavori(dettPraticaToClone.getCodiceFiscalePrincipaleDirettoreLavori()); copy.setCodiceFiscalePrincipaleDitta(dettPraticaToClone.getCodiceFiscalePrincipaleDitta()); copy.setCodiceFiscalePrincipaleGeologo(dettPraticaToClone.getCodiceFiscalePrincipaleGeologo()); copy.setCodiceFiscalePrincipaleProgettista(dettPraticaToClone.getCodiceFiscalePrincipaleProgettista()); - copy = dettPraticaPersistence.update(copy); return copy; } - // public void cloneSoggettiByDettPratica(long dettPraticaIdToClone, long - // dettPraticaIdCloned, - // ServiceContext serviceContext) throws NoSuchDettPraticaException, - // SystemException{ - // - // User user = userLocalService.getUser(serviceContext.getUserId()); - // - // DettPratica dettPraticaToClone = - // dettPraticaPersistence.findByPrimaryKey(dettPraticaIdToClone); - // DettPratica dettPraticaCloned = - // dettPraticaPersistence.findByPrimaryKey(dettPraticaIdCloned); - // - // List soggettiToClone = - // soggettoLocalService.findByDettPratica(dettPraticaIdToClone); - // for (Soggetto soggetto : soggettiToClone) { - // soggettoLocalService.cloneSoggetto(user.getUserId(), - // dettPraticaIdToClone, - // dettPraticaToClone.getIntPraticaId(), soggetto, serviceContext); - // } - // - // } - @Override @Indexable(type = IndexableType.REINDEX) public DettPratica addDettPraticaForImport(ServiceContext serviceContext) throws SystemException, PortalException { DettPratica dettPratica = dettPraticaLocalService.createDettPratica(counterLocalService .increment(DettPratica.class.getName())); - dettPratica.setCompanyId(serviceContext.getCompanyId()); dettPratica.setGroupId(serviceContext.getScopeGroupId()); dettPratica.setUserId(serviceContext.getUserId()); dettPratica.setUserName(StringPool.BLANK); dettPratica.setCreateDate(serviceContext.getCreateDate()); dettPratica.setModifiedDate(serviceContext.getModifiedDate()); - // in avvio in draft -> pratiche sempre controllate nella loro vita dettPratica.setStatus(WorkflowConstants.STATUS_DRAFT); dettPraticaPersistence.update(dettPratica); - return dettPratica; } @@ -373,14 +327,10 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl DynamicQuery dynamicQuery = dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); - // dynamicQuery.add(RestrictionsFactoryUtil.eq("status", - // WorkflowConstants.STATUS_DRAFT)); - Disjunction disjunction = RestrictionsFactoryUtil.disjunction(); disjunction.add(RestrictionsFactoryUtil.eq("status", WorkflowConstants.STATUS_DRAFT)); disjunction.add(RestrictionsFactoryUtil.eq("status", WorkflowConstants.STATUS_INCOMPLETE)); dynamicQuery.add(disjunction); - dynamicQuery.addOrder(OrderFactoryUtil.desc("dettPraticaId")); List ritorno = dynamicQuery(dynamicQuery, 0, 1); if (ritorno.isEmpty()) { @@ -434,7 +384,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl dynamicQuery.add(RestrictionsFactoryUtil.ne("status", WorkflowConstants.STATUS_DRAFT)); dynamicQuery.add(RestrictionsFactoryUtil.ne("status", WorkflowConstants.STATUS_INCOMPLETE)); dynamicQuery.add(RestrictionsFactoryUtil.ne("protocollo", StringPool.BLANK)); - // togliere commento dynamicQuery.addOrder(OrderFactoryUtil.desc("dettPraticaId")); List ritorno = dynamicQuery(dynamicQuery, 0, 1); @@ -470,12 +419,10 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl DynamicQuery dynamicQuery = dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.in("tipoIntegrazione", tipoPratiche)); - Disjunction disjunction = RestrictionsFactoryUtil.disjunction(); disjunction.add(RestrictionsFactoryUtil.eq("status", WorkflowConstants.STATUS_DRAFT)); disjunction.add(RestrictionsFactoryUtil.eq("status", WorkflowConstants.STATUS_INCOMPLETE)); dynamicQuery.add(disjunction); - dynamicQuery.addOrder(OrderFactoryUtil.desc("dettPraticaId")); List ritorno = dettPraticaPersistence.findWithDynamicQuery(dynamicQuery, 0, 1); if (ritorno.isEmpty()) { @@ -491,10 +438,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl DynamicQuery dynamicQuery = dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); - dynamicQuery.add(RestrictionsFactoryUtil.ne("status", WorkflowConstants.STATUS_DRAFT)); dynamicQuery.add(RestrictionsFactoryUtil.ne("status", WorkflowConstants.STATUS_INCOMPLETE)); - dynamicQuery.add(RestrictionsFactoryUtil.in("tipoIntegrazione", tipoPratiche)); dynamicQuery.addOrder(OrderFactoryUtil.desc("dettPraticaId")); return dynamicQuery(dynamicQuery); @@ -506,10 +451,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl DynamicQuery dynamicQuery = dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); - dynamicQuery.add(RestrictionsFactoryUtil.ne("status", WorkflowConstants.STATUS_DRAFT)); dynamicQuery.add(RestrictionsFactoryUtil.ne("status", WorkflowConstants.STATUS_INCOMPLETE)); - dynamicQuery.add(RestrictionsFactoryUtil.in("tipoIntegrazione", tipoPratiche)); dynamicQuery.addOrder(OrderFactoryUtil.desc("dettPraticaId")); int size = dynamicQuery(dynamicQuery).size(); @@ -522,12 +465,10 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl DynamicQuery dynamicQuery = dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); - dynamicQuery.add(RestrictionsFactoryUtil.ne("status", WorkflowConstants.STATUS_DRAFT)); dynamicQuery.add(RestrictionsFactoryUtil.ne("status", WorkflowConstants.STATUS_INCOMPLETE)); dynamicQuery.add(RestrictionsFactoryUtil.ne("tipoIntegrazione", TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO)); dynamicQuery.add(RestrictionsFactoryUtil.ne("tipoIntegrazione", TipoIntegrazioneUtil.ANNULLA)); - dynamicQuery.add(RestrictionsFactoryUtil.gt("dettPraticaId", dettPraticaId)); dynamicQuery.addOrder(OrderFactoryUtil.desc("dettPraticaId")); return dynamicQuery(dynamicQuery); @@ -538,7 +479,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl public DettPratica deleteDettPratica(DettPratica dettPratica) throws SystemException, PortalException { deleteAsset(dettPratica); - List soggetti = soggettoLocalService.findByDettPratica(dettPratica.getDettPraticaId()); for (Soggetto soggetto : soggetti) { try { @@ -546,24 +486,20 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl } catch (PortalException e) { } } - List allegati = docPraticaLocalService.findByClassPk(dettPratica.getDettPraticaId()); for (DocPratica allegato : allegati) { docPraticaLocalService.deleteDocPratica(allegato); } - List asseverazioni = asseverazioneLocalService.findByDettPratica(dettPratica.getDettPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); for (Asseverazione asseverazione : asseverazioni) { asseverazioneLocalService.deleteAsseverazione(asseverazione); } - List deleghe = delegaLocalService.findByDettPratica(dettPratica.getDettPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); for (Delega delega : deleghe) { delegaLocalService.deleteDelega(delega); } - List pagamenti = pagamentoLocalService.findByClassPk(dettPratica.getDettPraticaId()); for (Pagamento pagamento : pagamenti) { try { @@ -579,7 +515,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl public DettPratica deleteDettPratica(long dettPraticaId) throws PortalException, SystemException { DettPratica dettPratica = dettPraticaPersistence.findByPrimaryKey(dettPraticaId); - return deleteDettPratica(dettPratica); } @@ -588,21 +523,17 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl Indexer indexer = IndexerRegistryUtil.nullSafeGetIndexer(DettPratica.class); Hits hits = indexer.search(searchContext); - List list = new ArrayList<>(); for (Document document : hits.getDocs()) { long dettPraticaId = GetterUtil.getLong(document.get(Field.ENTRY_CLASS_PK)); - DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId); if (dettPratica != null) { list.add(dettPratica); } else { long companyId = GetterUtil.getLong(document.get(Field.COMPANY_ID)); - indexer.delete(companyId, document.getUID()); } } - return list; } @@ -611,7 +542,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl Indexer indexer = IndexerRegistryUtil.nullSafeGetIndexer(DettPratica.class); Hits hits = indexer.search(searchContext); - return hits.getLength(); } @@ -623,22 +553,14 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl SystemException { Date now = new Date(); - - validate(userId, dettPraticaId, intPraticaId, codiceFiscaleDelegatoCommittente, - codiceFiscaleDelegatoFineLavori, codiceFiscaleDelegatoCollaudo, serviceContext); - DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId); - dettPratica.setModifiedDate(serviceContext.getModifiedDate(now)); dettPratica.setIntPraticaId(intPraticaId); dettPratica.setCodiceFiscaleDelegatoCommittente(codiceFiscaleDelegatoCommittente); dettPratica.setCodiceFiscaleDelegatoFineLavori(codiceFiscaleDelegatoFineLavori); dettPratica.setCodiceFiscaleDelegatoCollaudo(codiceFiscaleDelegatoCollaudo); - dettPratica = dettPraticaPersistence.update(dettPratica); - resourceLocalService.updateModelResources(dettPratica, serviceContext); - updateAsset(dettPratica, serviceContext); return dettPratica; } @@ -710,57 +632,7 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl ServiceContext serviceContext, boolean bozza) throws PortalException, SystemException { Date now = new Date(); - - validate(userId, dettPraticaId, intPraticaId, integrazione, protocollo, tipoIntegrazione, completa, gestita, - codicePagamentoOneri, causalePagamentoOneri, mezzoPagamentoOneri, importoBolli, - importoSpeseIstruttoria, dataEffettuazione, statusTask, workflowForzato, soggettoSostituitoId, - destinazione, ag, descLongIntervento, via, localita, estremiCatastali, estremiPratCom, variataDa, - varianteNumero, varianteSostanziale, operaConforme, collaudoStatico, codiceFiscaleDelegatoCommittente, - codiceFiscaleDelegatoFineLavori, codiceFiscaleDelegatoCollaudo, codiceRuoloDelegato, - lavoriInEconomiaCommittente, inizioLavoriContestualeOpera, dataInizioLavoriOpera, - dataInizioEsecuzioneOpera, dataFineEsecuzioneOpera, metratura, lavoriPubblici, pagamentoIdOneri, - lavoriPubbliciPercentuale, numeroCivico, dcParticelle, dcFoglio, dcAllegato, dePiani, deAltezza, - deInterrati, deSuperficie, deCostruzione, deRistrutturazione, deUso, dePubblica, dePrivata, - deUtilizzazione, dePosizioneEdificio, deInfStradalePonte, deInfStradaleStrada, deInfStradaleAltro, - deInfIdraulicaLong, deInfIdraulicaTrasv, deInfIdraulicaAltro, deInfOperaAccStradale, - deInfOperaAccIdraulica, deInfOperaAccAltro, deInfAltraInfrastruttura, deInfAltro, deInfAltroDesc, - dccFondazioni, dccStruttureEleMuraturePietrame, dccStruttureEleMuratureLaterizio, - dccStruttureEleMuratureMisto, dccStruttureEleMuratureStoriche, dccStruttureEleAcciaio, - dccStruttureEleCA, dccStruttureEleLegno, dccStruttureEleMistoCA, dccStruttureEleMistoAcciaio, - dccStruttureEleMistoMuratura, dccStruttureEleMistoLegno, dccStruttureElePrefabbricato, - dccStruttureEleAltro, dccStruttureEleAltroDescrizione, dccOrizzontamentiCAAcciaio, - dccOrizzontamentiLegno, dccOrizzontamentiLegnoCA, dccOrizzontamentiLamieraGrecata, - dccOrizzontamentiVolte, dccOrizzontamentiAltro, dccOrizzontamentiAltroDescrizione, dccCopertura, - dccCoperturaCAAcciaio, dccCoperturaLegno, dccCoperturaLegnoCA, dccCoperturaLamieraGrecata, - dccCoperturaPannelli, dccCoperturaPVCTelonati, dccCoperturaLeggere, dccCoperturaAltro, - dccCoperturaAltroDesrizione, dccElemNonStrutLaterizio, dccElemNonStrutCartongesso, - dccElemNonStrutCalcestruzzo, dccElemNonStrutLegno, dccElemNonStrutAltro, - dccElemNonStrutAltroDescrizione, dccOpereDiRinforzoInsCatene, dccOpereDiRinforzoInsCordoli, - dccOpereDiRinforzoIniArmate, dccOpereDiRinforzoPlaccaggi, dccOpereDiRinforzoIrrSolai, - dccOpereDiRinforzoRinforziFRP, dccOpereDiRinforzoTelaiECerchiature, dccOpereDiRinforzoInsRompitratta, - dccOpereDiRinforzoAltro, dccOpereDiRinforzoAltroDescrizione, geoClasseIndagine, geoCategoriaSottosuolo, - geoCategoriaTopografica, geoConsolidamento, geoPericolositaGeologica, geoRischioGeomorfologicoPai, - geoPericolositaIdraulicaPai, geoRischioIdraulicoPai, geoPericolositaSismica, geoPericolositaIdraulica, - geoPericolositaGeomorfica, geoFattibilitaGeologica, geoFattibilitaSismica, geoFattibilitaIdraulica, - geoOperaRilevante, geoOpereDiSostegno, geoOpereInSotterranea, geoPresenzaPrescrizioni, - geoNotePrescrizioni, geoNoteIndagini, geoEvidenzeGeomorfiche, geoEvidenzeGeologiche, geoDtRelazione, - pagNuoveCostruzioni, pagAdeguamentoSismico, pagMiglioramentoSismico, pagRiparazioneInterventoLocale, - pagNuovaCostruzione, pagVarianti, pagAltro, pagMiglioramentoSismicoSicilia, - pagCalcolatoAdeguamentoSismico, pagCalcolatoMiglioramentoSismico, - pagCalcolatoRiparazioneInterventoLocale, pagCalcolatoOperaNonQuantificabile, - pagEffettivoAdeguamentoSismico, pagEffettivoMiglioramentoSismico, - pagEffettivoRiparazioneInterventoLocale, pagEffettivoOperaNonQuantificabile, pagNoteUtente, note, - noteUfficio, localizzazioneGeografica, tcNuovaCostruzione, tcAdeguamentoSismico, - tcMiglioramentoSismico, tcRiparazioneInterventoLocale, tcInCA, tcInOpera, tcPrefabbricato, tcInAcciaio, - tcMista, tcInMuratura, tcInMuraturaOrdinaria, tcInMuraturaArmata, tcInMuraturaMista, tcInLegno, - tcAltro, tcAltroDescrizione, tcConDispositivi, normLavoriInProprio, normEsenteBollo, normEsenteSpese, - normDpr01Dep, normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02, normDm03, normDm2018, - normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01, normDm04, normDm05, normCI01, - normLTC01, suap, normSismaBonus, clRischioPreInt, clRischioPostInt, intervFinPub, intervFinPubDesc, - tcNuovaCostruzioneComplessa, serviceContext, bozza); - DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId); - dettPratica.setModifiedDate(serviceContext.getModifiedDate(now)); dettPratica.setIntPraticaId(intPraticaId); dettPratica.setIntegrazione(integrazione); @@ -945,9 +817,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl dettPratica.setNormDpr02Dep(normDpr02Dep); dettPratica.setNormDpr01Aut(normDpr01Aut); dettPratica.setNormDpr02Aut(normDpr02Aut); - // dettPratica.setNormDpr03(normDpr02Dep); - // dettPratica.setNormDpr04(normDpr02Dep); - // dettPratica.setNormDpr05(normDpr02Dep); dettPratica.setNormDm01(normDm01); dettPratica.setNormDm02(normDm02); dettPratica.setNormDm03(normDm03); @@ -962,18 +831,14 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl dettPratica.setNormLTC01(normLTC01); dettPratica.setNormArt3com3(normArt3com3); dettPratica.setNormArt3com4(normArt3com4); - dettPratica.setSuap(suap); dettPratica.setNormSismaBonus(normSismaBonus); dettPratica.setClRischioPreInt(clRischioPreInt); dettPratica.setClRischioPostInt(clRischioPostInt); dettPratica.setIntervFinPub(intervFinPub); dettPratica.setIntervFinPubDesc(intervFinPubDesc); - dettPratica = dettPraticaPersistence.update(dettPratica); - resourceLocalService.updateModelResources(dettPratica, serviceContext); - updateAsset(dettPratica, serviceContext); return dettPratica; } @@ -1025,46 +890,11 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl ServiceContext serviceContext, boolean bozza) throws PortalException, SystemException { Date now = new Date(); - - validateDatiDomanda(userId, dettPraticaId, intPraticaId, tipoIntegrazione, metratura, lavoriPubblici, - pagamentoIdOneri, lavoriPubbliciPercentuale, numeroCivico, dcParticelle, dcFoglio, dcAllegato, dePiani, - deAltezza, deInterrati, deSuperficie, deCostruzione, deRistrutturazione, deUso, dePubblica, dePrivata, - deUtilizzazione, dePosizioneEdificio, deInfStradalePonte, deInfStradaleStrada, deInfStradaleAltro, - deInfIdraulicaLong, deInfIdraulicaTrasv, deInfIdraulicaAltro, deInfOperaAccStradale, - deInfOperaAccIdraulica, deInfOperaAccAltro, deInfAltraInfrastruttura, deInfAltro, deInfAltroDesc, - dccFondazioni, dccStruttureEleMuraturePietrame, dccStruttureEleMuratureLaterizio, - dccStruttureEleMuratureMisto, dccStruttureEleMuratureStoriche, dccStruttureEleAcciaio, - dccStruttureEleCA, dccStruttureEleLegno, dccStruttureEleMistoCA, dccStruttureEleMistoAcciaio, - dccStruttureEleMistoMuratura, dccStruttureEleMistoLegno, dccStruttureElePrefabbricato, - dccStruttureEleAltro, dccStruttureEleAltroDescrizione, dccOrizzontamentiCAAcciaio, - dccOrizzontamentiLegno, dccOrizzontamentiLegnoCA, dccOrizzontamentiLamieraGrecata, - dccOrizzontamentiVolte, dccOrizzontamentiAltro, dccOrizzontamentiAltroDescrizione, dccCopertura, - dccCoperturaCAAcciaio, dccCoperturaLegno, dccCoperturaLegnoCA, dccCoperturaLamieraGrecata, - dccCoperturaPannelli, dccCoperturaPVCTelonati, dccCoperturaLeggere, dccCoperturaAltro, - dccCoperturaAltroDesrizione, dccElemNonStrutLaterizio, dccElemNonStrutCartongesso, - dccElemNonStrutCalcestruzzo, dccElemNonStrutLegno, dccElemNonStrutAltro, - dccElemNonStrutAltroDescrizione, dccOpereDiRinforzoInsCatene, dccOpereDiRinforzoInsCordoli, - dccOpereDiRinforzoIniArmate, dccOpereDiRinforzoPlaccaggi, dccOpereDiRinforzoIrrSolai, - dccOpereDiRinforzoRinforziFRP, dccOpereDiRinforzoTelaiECerchiature, dccOpereDiRinforzoInsRompitratta, - dccOpereDiRinforzoAltro, dccOpereDiRinforzoAltroDescrizione, localizzazioneGeografica, - tcNuovaCostruzione, tcAdeguamentoSismico, tcMiglioramentoSismico, tcRiparazioneInterventoLocale, - tcInCA, tcInOpera, tcPrefabbricato, tcInAcciaio, tcMista, tcInMuratura, tcInMuraturaOrdinaria, - tcInMuraturaArmata, tcInMuraturaMista, tcInLegno, tcAltro, tcAltroDescrizione, tcConDispositivi, - normLavoriInProprio, normEsenteBollo, normEsenteSpese, normDpr01Dep, normDpr02Dep, normDpr01Aut, - normDpr02Aut, normDm01, normDm02, normDm03, normDm2018, normDprg01, normDprg02, normAnr, normArt3com3, - normArt3com4, normOrd01, normDm04, normDm05, normCI01, normLTC01, suap, normSismaBonus, - clRischioPreInt, clRischioPostInt, intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, - serviceContext, bozza); - DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId); - dettPratica.setModifiedDate(serviceContext.getModifiedDate(now)); - dettPratica.setIntPraticaId(intPraticaId); - dettPratica.setTipoIntegrazione(tipoIntegrazione); dettPratica.setVarianteSostanziale(varianteSostanziale); - dettPratica.setDestinazione(destinazione); dettPratica.setAg(ag); dettPratica.setDescLongIntervento(descLongIntervento); @@ -1179,9 +1009,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl dettPratica.setNormDpr02Dep(normDpr02Dep); dettPratica.setNormDpr01Aut(normDpr01Aut); dettPratica.setNormDpr02Aut(normDpr02Aut); - // dettPratica.setNormDpr03(normDpr02Dep); - // dettPratica.setNormDpr04(normDpr02Dep); - // dettPratica.setNormDpr05(normDpr02Dep); dettPratica.setNormDm01(normDm01); dettPratica.setNormDm02(normDm02); dettPratica.setNormDm03(normDm03); @@ -1196,70 +1023,21 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl dettPratica.setNormLTC01(normLTC01); dettPratica.setNormArt3com3(normArt3com3); dettPratica.setNormArt3com4(normArt3com4); - dettPratica.setSuap(suap); dettPratica.setNormSismaBonus(normSismaBonus); dettPratica.setClRischioPreInt(clRischioPreInt); dettPratica.setClRischioPostInt(clRischioPostInt); dettPratica.setIntervFinPub(intervFinPub); dettPratica.setIntervFinPubDesc(intervFinPubDesc); - dettPratica.setCodiceFiscaleDelegatoCommittente(codiceFiscaleDelegatoCommittente); dettPratica.setCodiceFiscaleDelegatoFineLavori(codiceFiscaleDelegatoFineLavori); dettPratica.setCodiceFiscaleDelegatoCollaudo(codiceFiscaleDelegatoCollaudo); - dettPratica = dettPraticaPersistence.update(dettPratica); - resourceLocalService.updateModelResources(dettPratica, serviceContext); - updateAsset(dettPratica, serviceContext); return dettPratica; } - private void validateDatiDomanda(long userId, long dettPraticaId, long intPraticaId, String tipoIntegrazione, - String metratura, boolean lavoriPubblici, long pagamentoId, int lavoriPubbliciPercentuale, - String numeroCivico, String dcParticelle, String dcFoglio, String dcAllegato, String dePiani, - String deAltezza, String deInterrati, String deSuperficie, String deCostruzione, String deRistrutturazione, - String deUso, String dePubblica, String dePrivata, String deUtilizzazione, String dePosizioneEdificio, - boolean deInfStradalePonte, boolean deInfStradaleStrada, boolean deInfStradaleAltro, - boolean deInfIdraulicaLong, boolean deInfIdraulicaTrasv, boolean deInfIdraulicaAltro, - boolean deInfOperaAccStradale, boolean deInfOperaAccIdraulica, boolean deInfOperaAccAltro, - boolean deInfAltraInfrastruttura, boolean deInfAltro, String deInfAltroDesc, String dccFondazioni, - boolean dccStruttureEleMuraturePietrame, boolean dccStruttureEleMuratureLaterizio, - boolean dccStruttureEleMuratureMisto, boolean dccStruttureEleMuratureStoriche, - String dccStruttureEleAcciaio, String dccStruttureEleCA, String dccStruttureEleLegno, - boolean dccStruttureEleMistoCA, boolean dccStruttureEleMistoAcciaio, boolean dccStruttureEleMistoMuratura, - boolean dccStruttureEleMistoLegno, boolean dccStruttureElePrefabbricato, boolean dccStruttureEleAltro, - String dccStruttureEleAltroDescrizione, boolean dccOrizzontamentiCAAcciaio, boolean dccOrizzontamentiLegno, - boolean dccOrizzontamentiLegnoCA, boolean dccOrizzontamentiLamieraGrecata, boolean dccOrizzontamentiVolte, - boolean dccOrizzontamentiAltro, String dccOrizzontamentiAltroDescrizione, String dccCopertura, - boolean dccCoperturaCAAcciaio, boolean dccCoperturaLegno, boolean dccCoperturaLegnoCA, - boolean dccCoperturaLamieraGrecata, boolean dccCoperturaPannelli, boolean dccCoperturaPVCTelonati, - boolean dccCoperturaLeggere, boolean dccCoperturaAltro, String dccCoperturaAltroDesrizione, - boolean dccElemNonStrutLaterizio, boolean dccElemNonStrutCartongesso, boolean dccElemNonStrutCalcestruzzo, - boolean dccElemNonStrutLegno, boolean dccElemNonStrutAltro, String dccElemNonStrutAltroDescrizione, - boolean dccOpereDiRinforzoInsCatene, boolean dccOpereDiRinforzoInsCordoli, - boolean dccOpereDiRinforzoIniArmate, boolean dccOpereDiRinforzoPlaccaggi, - boolean dccOpereDiRinforzoIrrSolai, boolean dccOpereDiRinforzoRinforziFRP, - boolean dccOpereDiRinforzoTelaiECerchiature, boolean dccOpereDiRinforzoInsRompitratta, - boolean dccOpereDiRinforzoAltro, String dccOpereDiRinforzoAltroDescrizione, - String localizzazioneGeografica, boolean tcNuovaCostruzione, boolean tcAdeguamentoSismico, - boolean tcMiglioramentoSismico, boolean tcRiparazioneInterventoLocale, boolean tcInCA, boolean tcInOpera, - boolean tcPrefabbricato, boolean tcInAcciaio, boolean tcMista, boolean tcInMuratura, - boolean tcInMuraturaOrdinaria, boolean tcInMuraturaArmata, boolean tcInMuraturaMista, boolean tcInLegno, - boolean tcAltro, String tcAltroDescrizione, boolean tcConDispositivi, boolean normLavoriInProprio, - boolean normEsenteBollo, boolean normEsenteSpese, boolean normDpr01Dep, boolean normDpr02Dep, - boolean normDpr01Aut, boolean normDpr02Aut, boolean normDm01, boolean normDm02, boolean normDm03, - boolean normDm2018, boolean normDprg01, boolean normDprg02, boolean normAnr, boolean normArt3com3, - boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, - boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt, String clRischioPostInt, - boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, - ServiceContext serviceContext, boolean bozza) { - - // TODO Auto-generated method stub - - } - @Override @Indexable(type = IndexableType.REINDEX) public DettPratica updateDettPraticaGeologo(long userId, long dettPraticaId, long intPraticaId, @@ -1274,19 +1052,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl throws PortalException, SystemException { Date now = new Date(); - - validateDatiGeologo(userId, dettPraticaId, intPraticaId, geoClasseIndagine, geoCategoriaSottosuolo, - geoCategoriaTopografica, geoConsolidamento, geoPericolositaGeologica, geoRischioGeomorfologicoPai, - geoPericolositaIdraulicaPai, geoRischioIdraulicoPai, geoPericolositaSismica, geoPericolositaIdraulica, - geoPericolositaGeomorfica, geoFattibilitaGeologica, geoFattibilitaSismica, geoFattibilitaIdraulica, - geoOperaRilevante, geoOpereDiSostegno, geoOpereInSotterranea, geoPresenzaPrescrizioni, - geoNotePrescrizioni, geoNoteIndagini, geoEvidenzeGeomorfiche, geoEvidenzeGeologiche, geoDtRelazione, - serviceContext, bozza); - DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId); - dettPratica.setModifiedDate(serviceContext.getModifiedDate(now)); - dettPratica.setGeoClasseIndagine(geoClasseIndagine); dettPratica.setGeoCategoriaSottosuolo(geoCategoriaSottosuolo); dettPratica.setGeoCategoriaTopografica(geoCategoriaTopografica); @@ -1310,11 +1077,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl dettPratica.setGeoEvidenzeGeomorfiche(geoEvidenzeGeomorfiche); dettPratica.setGeoEvidenzeGeologiche(geoEvidenzeGeologiche); dettPratica.setGeoDtRelazione(geoDtRelazione); - dettPratica = dettPraticaPersistence.update(dettPratica); - resourceLocalService.updateModelResources(dettPratica, serviceContext); - updateAsset(dettPratica, serviceContext); return dettPratica; } @@ -1332,14 +1096,10 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl throws SystemException, PortalException { Date now = new Date(); - DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId); - dettPratica.setModifiedDate(serviceContext.getModifiedDate(now)); - dettPratica.setPagAdeguamentoSismico(pagAdeguamentoSismico); dettPratica.setPagAltro(pagAltro); - // /dettPratica.setPagamentoId(pagamentoId); dettPratica.setPagMiglioramentoSismico(pagMiglioramentoSismico); dettPratica.setPagNuovaCostruzione(pagNuovaCostruzione); dettPratica.setPagNuoveCostruzioni(pagNuoveCostruzioni); @@ -1358,9 +1118,7 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl dettPratica.setPagEffettivoOperaNonQuantificabile(pagEffettivoOperaNonQuantificabile); dettPratica.setPagNoteUtente(pagNoteUtente); dettPratica = dettPraticaPersistence.update(dettPratica); - resourceLocalService.updateModelResources(dettPratica, serviceContext); - updateAsset(dettPratica, serviceContext); return dettPratica; } @@ -1380,7 +1138,7 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl public void updateEsitoPagamento(long pagamentoId, long dettPraticaId, String stato) throws IOException, SystemException, PortalException { - updateEsitoPagamento(pagamentoId, dettPraticaId, 0l, stato); + updateEsitoPagamento(pagamentoId, dettPraticaId, 0L, stato); } @Override @@ -1390,10 +1148,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl Date now = new Date(); DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId); dettPratica.setModifiedDate(now); - Pagamento pagamento = pagamentoPersistence.findByPrimaryKey(pagamentoId); String tipoPagamento = pagamento.getTipoPagamento(); - if (stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_PAGATA)) { boolean completed = false; if (!dettPratica.isNormEsenteBollo() && !dettPratica.isNormEsenteSpese()) { @@ -1411,10 +1167,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl completed = true; } } - if (completed) { dettPratica = updateEsito(dettPraticaId, WorkflowConstants.STATUS_APPROVED); - try { WorkflowUtil.valutaEffettiInvioVariante(dettPratica); } catch (Exception e) { @@ -1429,7 +1183,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl || stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_ANNULLATO)) { pagamentoLocalService.updatePagamentoUtilizzata(pagamentoId, stato); } - } @Override @@ -1439,9 +1192,7 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl if (isRiparazione && !dettPratica.getTcNuovaCostruzione()) { return false; } - return !dettPratica.getDestinazione().equals("1") && !dettPratica.getDestinazione().equals("2"); - } @Override @@ -1449,15 +1200,12 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl public DettPratica updateEsito(long dettPraticaId, int stato) throws IOException, SystemException, PortalException { boolean sendMail = false; - Date now = new Date(); DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId); dettPratica.setModifiedDate(now); - dettPratica.setStatus(stato); dettPratica.setCompleta(true); dettPratica.setDataEffettuazione(now); - IntPratica intPratica = intPraticaLocalService.updateDelegati(dettPratica.getIntPraticaId(), dettPratica.getCodiceFiscaleDelegatoFineLavori(), dettPratica.getCodiceFiscaleDelegatoCollaudo(), isControlloObbligatorio(dettPratica)); @@ -1466,7 +1214,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl intPratica = intPraticaLocalService.updateIntPratica(intPratica); } asseverazioneLocalService.concludiAsseverazioniExpired(dettPraticaId); - if (TipoIntegrazioneUtil.VARIANTE.equals(dettPratica.getTipoIntegrazione())) { dettPratica.setVarianteNumero(dettPraticaPersistence.countByIntPraticaId_TipoIntegrazione_Completa( dettPratica.getIntPraticaId(), TipoIntegrazioneUtil.VARIANTE, true) + 1); @@ -1474,7 +1221,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl && !dettPratica.getVarianteSostanziale()) { sendMail = true; } - } else if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equals(dettPratica.getTipoIntegrazione())) { dettPratica.setIntegrazione(dettPraticaPersistence.countByIntPraticaId_TipoIntegrazione_Completa( dettPratica.getIntPraticaId(), TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE, true) + 1); @@ -1482,10 +1228,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl sendMail = true; } dettPratica = dettPraticaLocalService.updateDettPratica(dettPratica); - docPraticaLocalService.completeInvalidation(dettPratica.getIntPraticaId()); soggettoLocalService.completeInvalidation(dettPratica.getIntPraticaId()); - // chiudo timer pratica se presente if (TipoIntegrazioneUtil.ANNULLA.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { Tempistica tempisticaPratica = tempisticaLocalService.getTempistica(intPratica.getCompanyId(), @@ -1506,7 +1250,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl if (tempisticaI != null) { tempisticaLocalService.concludiTempistica(tempisticaI.getTempisticaId(), new Date()); } - // gestione tempistica riavvio in caso di integrazione long intPraticaId = dettPratica.getIntPraticaId(); Tempistica tempisticaP = tempisticaLocalService.getTempistica(intPratica.getCompanyId(), intPraticaId, @@ -1514,14 +1257,11 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl if (tempisticaP != null) { tempisticaLocalService.ravvioTempistica(tempisticaP.getTempisticaId(), new Date()); } - } - if (sendMail && WorkflowUtil.isWorkflowDisattivabile(dettPratica.getIntPraticaId()) && Validator.isNotNull(intPratica.getStatusByUserId())) { inviaMailnotifica(dettPraticaId, intPratica.getStatusByUserId(), now); } - return dettPratica; } @@ -1529,13 +1269,10 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl PortalException { DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId); - User tecnicoIstruttore = userLocalService.getUser(tecnicoIstruttoreId); - String[] to = { tecnicoIstruttore.getEmailAddress() }; String[] cc = new String[0]; String[] ccn = new String[0]; - String tipoPratica = StringPool.BLANK; long intPraticaId = dettPratica.getIntPraticaId(); if (AzioniPraticheUtil.isDeposito(intPraticaId)) { @@ -1543,7 +1280,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl } else if (AzioniPraticheUtil.isAutorizzazione(intPraticaId)) { tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-02"); } - JSONObject templateVariables = JSONFactoryUtil.createJSONObject(); templateVariables.put("receiver", tecnicoIstruttore.getFullName()); templateVariables.put("tipoPratica", tipoPratica); @@ -1553,12 +1289,10 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl + dettPratica.getTipoIntegrazione() : StringPool.BLANK)); templateVariables.put("dataInvio", FastDateFormatFactoryUtil.getSimpleDateFormat("dd/MM/yyyy HH:mm").format(date)); - ServiceContext serviceContext = new ServiceContext(); serviceContext.setScopeGroupId(dettPratica.getGroupId()); serviceContext.setCompanyId(dettPratica.getCompanyId()); serviceContext.setUserId(dettPratica.getUserId()); - MailUtil.invioMailNotifica(dettPratica.getIntPraticaId(), dettPraticaId, dettPraticaId, DettPratica.class.getName(), to, cc, ccn, "NOTIFICA-BO", templateVariables, null, serviceContext); } @@ -1573,7 +1307,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl ControlloPratica controlloPratica = controlloPraticaLocalService.findByIntPraticaId_Status(intPraticaId, WorkflowConstants.STATUS_PENDING).get(0); controlloPraticaLocalService.addPraticheAlControllo(controlloPratica.getControlloPraticaId(), dettPraticaId); - return dettPratica; } @@ -1590,14 +1323,12 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl String currentURL, ServiceContext serviceContext) throws SystemException, PortalException { DettPratica dettPratica = dettPraticaPersistence.findByPrimaryKey(dettPraticaId); - BigDecimal importoBolli = PagamentiUtil.getImportoBolli(dettPratica.getCompanyId(), dettPratica.getDettPraticaId(), dettPratica.getTipoIntegrazione()); PagamentiUtil.nuovoPagamento(currentURL, dettPratica.getDettPraticaId(), DettPratica.class.getName(), PagamentoConstants.PAGAMENTO_BOLLI, importoBolli.toString(), codiceFiscaleCommittente, serviceContext); PagamentiUtil.nuovoPagamento(currentURL, dettPratica.getDettPraticaId(), DettPratica.class.getName(), PagamentoConstants.PAGAMENTO_ONERI, importoSpeseIstruttoria, codiceFiscaleCommittente, serviceContext); - dettPratica = updateDettPraticaPagamento(dettPratica.getDettPraticaId(), pagAdeguamentoSismico, pagAltro, pagMiglioramentoSismico, pagNuovaCostruzione, pagNuoveCostruzioni, pagRiparazioneInterventoLocale, pagVarianti, importoSpeseIstruttoria, importoBolli.toString(), pagMiglioramentoSismicoSicilia, @@ -1606,111 +1337,17 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl pagEffettivoAdeguamentoSismico, pagEffettivoMiglioramentoSismico, pagEffettivoRiparazioneInterventoLocale, pagEffettivoOperaNonQuantificabile, pagNoteUtente, serviceContext); - long intPraticaid = dettPratica.getIntPraticaId(); IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaid); if (intPratica.getStatus() == WorkflowConstants.STATUS_ANY) { intPraticaLocalService.updateStatus(intPraticaid, WorkflowConstants.STATUS_INCOMPLETE); } - dettPratica = updateDettPratica(dettPratica); - updateStatus(dettPraticaId, WorkflowConstants.STATUS_INCOMPLETE); - dettPratica = dettPraticaLocalService.getDettPratica(dettPraticaId); - return dettPratica; } - private void validateDatiGeologo(long userId, long dettPraticaId, long intPraticaId, String geoClasseIndagine, - String geoCategoriaSottosuolo, String geoCategoriaTopografica, String geoConsolidamento, - String geoPericolositaGeologica, String geoRischioGeomorfologicoPai, String geoPericolositaIdraulicaPai, - String geoRischioIdraulicoPai, String geoPericolositaSismica, String geoPericolositaIdraulica, - String geoPericolositaGeomorfica, String geoFattibilitaGeologica, String geoFattibilitaSismica, - String geoFattibilitaIdraulica, String geoOperaRilevante, String geoOpereDiSostegno, - String geoOpereInSotterranea, String geoPresenzaPrescrizioni, String geoNotePrescrizioni, - String geoNoteIndagini, String geoEvidenzeGeomorfiche, String geoEvidenzeGeologiche, Date geoDtRelazione, - ServiceContext serviceContext, boolean bozza) { - - // TODO Auto-generated method stub - - } - - private void validate(long userId, long dettPraticaId, long intPraticaId, String codiceFiscaleDelegatoCommittente, - String codiceFiscaleDelegatoFineLavori, String codiceFiscaleDelegatoCollaudo, ServiceContext serviceContext) { - - // TODO Auto-generated method stub - - } - - private void validate(long userId, long dettPraticaId, long intPraticaId, long integrazione, String protocollo, - String tipoIntegrazione, boolean completa, boolean gestita, String codicePagamento, - String causalePagamento, String mezzoPagamento, String importoBolli, String importoSpeseIstruttoria, - Date dataEffettuazione, int statusTask, boolean workflowForzato, long soggettoSostituitoId, - String destinazione, String ag, String descLongIntervento, String via, String localita, - String estremiCatastali, String estremiPratCom, long variataDa, long varianteNumero, - boolean varianteSostanziale, boolean operaConforme, boolean collaudoStatico, - String codiceFiscaleDelegatoCommittente, String codiceFiscaleDelegatoFineLavori, - String codiceFiscaleDelegatoCollaudo, String codiceRuoloDelegato, boolean lavoriInEconomiaCommittente, - boolean inizioLavoriContestualeOpera, Date dataInizioLavoriOpera, Date dataInizioEsecuzioneOpera, - Date dataFineEsecuzioneOpera, String metratura, boolean lavoriPubblici, long pagamentoId, - int lavoriPubbliciPercentuale, String numeroCivico, String dcParticelle, String dcFoglio, - String dcAllegato, String dePiani, String deAltezza, String deInterrati, String deSuperficie, - String deCostruzione, String deRistrutturazione, String deUso, String dePubblica, String dePrivata, - String deUtilizzazione, String dePosizioneEdificio, boolean deInfStradalePonte, - boolean deInfStradaleStrada, boolean deInfStradaleAltro, boolean deInfIdraulicaLong, - boolean deInfIdraulicaTrasv, boolean deInfIdraulicaAltro, boolean deInfOperaAccStradale, - boolean deInfOperaAccIdraulica, boolean deInfOperaAccAltro, boolean deInfAltraInfrastruttura, - boolean deInfAltro, String deInfAltroDesc, String dccFondazioni, boolean dccStruttureEleMuraturePietrame, - boolean dccStruttureEleMuratureLaterizio, boolean dccStruttureEleMuratureMisto, - boolean dccStruttureEleMuratureStoriche, String dccStruttureEleAcciaio, String dccStruttureEleCA, - String dccStruttureEleLegno, boolean dccStruttureEleMistoCA, boolean dccStruttureEleMistoAcciaio, - boolean dccStruttureEleMistoMuratura, boolean dccStruttureEleMistoLegno, - boolean dccStruttureElePrefabbricato, boolean dccStruttureEleAltro, String dccStruttureEleAltroDescrizione, - boolean dccOrizzontamentiCAAcciaio, boolean dccOrizzontamentiLegno, boolean dccOrizzontamentiLegnoCA, - boolean dccOrizzontamentiLamieraGrecata, boolean dccOrizzontamentiVolte, boolean dccOrizzontamentiAltro, - String dccOrizzontamentiAltroDescrizione, String dccCopertura, boolean dccCoperturaCAAcciaio, - boolean dccCoperturaLegno, boolean dccCoperturaLegnoCA, boolean dccCoperturaLamieraGrecata, - boolean dccCoperturaPannelli, boolean dccCoperturaPVCTelonati, boolean dccCoperturaLeggere, - boolean dccCoperturaAltro, String dccCoperturaAltroDesrizione, boolean dccElemNonStrutLaterizio, - boolean dccElemNonStrutCartongesso, boolean dccElemNonStrutCalcestruzzo, boolean dccElemNonStrutLegno, - boolean dccElemNonStrutAltro, String dccElemNonStrutAltroDescrizione, boolean dccOpereDiRinforzoInsCatene, - boolean dccOpereDiRinforzoInsCordoli, boolean dccOpereDiRinforzoIniArmate, - boolean dccOpereDiRinforzoPlaccaggi, boolean dccOpereDiRinforzoIrrSolai, - boolean dccOpereDiRinforzoRinforziFRP, boolean dccOpereDiRinforzoTelaiECerchiature, - boolean dccOpereDiRinforzoInsRompitratta, boolean dccOpereDiRinforzoAltro, - String dccOpereDiRinforzoAltroDescrizione, String geoClasseIndagine, String geoCategoriaSottosuolo, - String geoCategoriaTopografica, String geoConsolidamento, String geoPericolositaGeologica, - String geoRischioGeomorfologicoPai, String geoPericolositaIdraulicaPai, String geoRischioIdraulicoPai, - String geoPericolositaSismica, String geoPericolositaIdraulica, String geoPericolositaGeomorfica, - String geoFattibilitaGeologica, String geoFattibilitaSismica, String geoFattibilitaIdraulica, - String geoOperaRilevante, String geoOpereDiSostegno, String geoOpereInSotterranea, - String geoPresenzaPrescrizioni, String geoNotePrescrizioni, String geoNoteIndagini, - String geoEvidenzeGeomorfiche, String geoEvidenzeGeologiche, Date geoDtRelazione, - boolean pagNuoveCostruzioni, int pagAdeguamentoSismico, int pagMiglioramentoSismico, - boolean pagRiparazioneInterventoLocale, int pagNuovaCostruzione, boolean pagVarianti, int pagAltro, - boolean pagMiglioramentoSismicoSicilia, String pagCalcolatoAdeguamentoSismico, - String pagCalcolatoMiglioramentoSismico, String pagCalcolatoRiparazioneInterventoLocale, - String pagCalcolatoOperaNonQuantificabile, String pagEffettivoAdeguamentoSismico, - String pagEffettivoMiglioramentoSismico, String pagEffettivoRiparazioneInterventoLocale, - String pagEffettivoOperaNonQuantificabile, String pagNoteUtente, String note, String noteUfficio, - String localizzazioneGeografica, boolean tcNuovaCostruzione, boolean tcAdeguamentoSismico, - boolean tcMiglioramentoSismico, boolean tcRiparazioneInterventoLocale, boolean tcInCA, boolean tcInOpera, - boolean tcPrefabbricato, boolean tcInAcciaio, boolean tcMista, boolean tcInMuratura, - boolean tcInMuraturaOrdinaria, boolean tcInMuraturaArmata, boolean tcInMuraturaMista, boolean tcInLegno, - boolean tcAltro, String tcAltroDescrizione, boolean tcConDispositivi, boolean normLavoriInProprio, - boolean normEsenteBollo, boolean normEsenteSpese, boolean normDpr01Dep, boolean normDpr02Dep, - boolean normDpr01Aut, boolean normDpr02Aut, boolean normDm01, boolean normDm02, boolean normDm03, - boolean normDm2018, boolean normDprg01, boolean normDprg02, boolean normAnr, boolean normArt3com3, - boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, - boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt, String clRischioPostInt, - boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, - ServiceContext serviceContext, boolean bozza) { - - // TODO Auto-generated method stub - - } - @Override @Indexable(type = IndexableType.REINDEX) public DettPratica updateStatus(long userId, long resourcePrimKey, int status, ServiceContext serviceContext) @@ -1718,20 +1355,16 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl User user = userPersistence.findByPrimaryKey(userId); Date now = new Date(); - DettPratica dettPratica = dettPraticaPersistence.findByPrimaryKey(resourcePrimKey); - dettPratica.setStatus(status); dettPratica.setStatusByUserId(user.getUserId()); dettPratica.setStatusByUserName(user.getFullName()); dettPratica.setStatusDate(serviceContext.getModifiedDate(now)); - if (status == WorkflowConstants.STATUS_APPROVED) { assetEntryLocalService.updateVisible(DettPratica.class.getName(), resourcePrimKey, true); } else { assetEntryLocalService.updateVisible(DettPratica.class.getName(), resourcePrimKey, false); } - return dettPraticaPersistence.update(dettPratica); } @@ -1739,12 +1372,9 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl try { assetEntryLocalService.deleteEntry(DettPratica.class.getName(), dettPratica.getPrimaryKey()); - expandoValueLocalService.deleteValues(DettPratica.class.getName(), dettPratica.getPrimaryKey()); - resourceLocalService.deleteResource(dettPratica.getCompanyId(), DettPratica.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, dettPratica.getDettPraticaId()); - } catch (PortalException e) { throw new SystemException(e); } @@ -1759,10 +1389,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl serviceContext.getAssetTagNames(), true, null, null, null, ContentTypes.TEXT_HTML, dettPratica.getDescLongIntervento(), dettPratica.getDescLongIntervento(), null, null, null, 0, 0, 0, false); - assetLinkLocalService.updateLinks(dettPratica.getUserId(), assetEntry.getEntryId(), serviceContext.getAssetLinkEntryIds(), AssetLinkConstants.TYPE_RELATED); - dettPratica.setExpandoBridgeAttributes(serviceContext); } @@ -1774,9 +1402,7 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl dettPratica.setModifiedDate(new Date()); dettPratica.setProtocollo(protocollo); dettPratica.setDtProtocollo(new Date()); - dettPratica = dettPraticaLocalService.updateDettPratica(dettPratica); - IntPratica intPratica = intPraticaLocalService.getIntPratica(dettPratica.getIntPraticaId()); if (intPratica.getStatus() == WorkflowConstants.STATUS_ANY || intPratica.getStatus() == WorkflowConstants.STATUS_INCOMPLETE) { @@ -1928,107 +1554,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl @Override public void updateAsset(DettPratica dettPratica, long[] categoryIds, boolean visible) throws SystemException, PortalException { - - // List tagNames = new ArrayList(); - // IntPratica intPratica = - // intPraticaLocalService.getIntPratica(dettPratica.getIntPraticaId()); - // TODO gestire la nuova logica di asset - // aggiunta tag tipologia pratica - // if (dettPratica.getIntegrazione() != 0L) { - // String tagName = - // TagsPraticaValue.getTagsLabelMap().get(dettPratica.getTipoIntegrazione()); - // if (Validator.isNotNull(tagName)) { - // tagNames.add(tagName); - // } - // } else { - // if (intPratica.isVariante()) { - // tagNames.add(TagsPraticaValue.VARIANTE); - // } else { - // tagNames.add(TagsPraticaValue.ORIGINALE); - // } - // } - // - // DettPratica dettPraticaLast = - // dettPraticaLocalService.getLastDettPratica(dettPratica.getIntPraticaId()); - // boolean sorteggiata = - // sorteggioLocalService.isDettPraticaSorteggiata(dettPraticaLast.getCompanyId(), - // dettPraticaLast.getDettPraticaId()); - // if (sorteggiata) { - // tagNames.add(TagsPraticaValue.getTagsLabelMap().get(StatoPraticaConstants.SORTEGGIATA)); - // } - // - // if - // (intPratica.getStatoPratica().equals(StatoPraticaConstants.ANNULLATA)) - // { - // String tagName = - // TagsPraticaValue.getTagsLabelMap().get(TipoIntegrazioneConstants.ANNULLA); - // tagNames.add(tagName); - // } - // - // // aggiunta tag validazione - // if (dettPratica.isValidata()) { - // tagNames.add(TagsPraticaValue.getTagsLabelMap().get(StatoPraticaConstants.VIDIMATA)); - // // eventuale aggiunta tag anomalia fine lavoro - // if - // (StatoPraticaConstants.isStatoPraticaFineLavoriConAnomalia(dettPratica)) - // { - // tagNames.add(TagsPraticaValue.getTagsLabelMap().get(StatoPraticaConstants.FINE_LAVORI_CON_ANOMALIA)); - // } - // } else { - // tagNames.add(TagsPraticaValue.getTagsLabelMap().get(StatoPraticaConstants.RIFIUTATA)); - // } - // // pratica indica se è stata variata - // if (intPratica.getVariataDa() != 0l) { - // tagNames.add(TagsPraticaValue.getTagsLabelMap().get(StatoPraticaConstants.VARIATA)); - // } - // // aggiunta del tag pending - // if (dettPratica.getStatus() == WorkflowConstants.STATUS_PENDING) { - // tagNames.add(TagsPraticaValue.getTagsLabelMap().get(StatoPraticaConstants.SOTTOPOSTA_A_PARERE)); - // } else { - // String tagName = - // TagsPraticaValue.getTagsLabelMap().get(intPratica.getStatoPratica()); - // if (Validator.isNotNull(tagName)) { - // tagNames.add(tagName); - // } - // if (Validator.isNotNull(intPratica.getStatoPraticaWorkflow())) { - // tagName = - // TagsPraticaValue.getTagsLabelMap().get(intPratica.getStatoPraticaWorkflow()); - // if (Validator.isNotNull(tagName)) { - // tagNames.add(tagName); - // } - // } - // } - // - // ServiceContext serviceContext = new ServiceContext(); - // serviceContext.setCompanyId(dettPratica.getCompanyId()); - // serviceContext.setScopeGroupId(dettPratica.getGroupId()); - // serviceContext.setUserId(dettPratica.getUserId()); - // - // try { - // AssetEntry currentAssetEntry = - // assetEntryLocalService.getEntry(DettPratica.class.getName(), - // dettPratica.getDettPraticaId()); - // categoryIds = - // createUpdateAssetCategory(intPratica, dettPratica, - // currentAssetEntry.getCategoryIds(), - // serviceContext); - // visible = currentAssetEntry.isVisible() || visible; - // } catch (Exception e) { - // } - // - // if (categoryIds.length > 0) { - // assetEntryLocalService.updateEntry(dettPratica.getUserId(), - // dettPratica.getGroupId(), - // DettPratica.class.getName(), dettPratica.getDettPraticaId(), - // dettPratica.getUuid(), 0l, - // categoryIds, - // tagNames.toArray(new String[] {}), visible, null, null, - // dettPratica.getCreateDate(), null, - // ContentTypes.TEXT_HTML, - // PraticaUtil.generateTitle(dettPratica.getDettPraticaId()), null, - // PraticaUtil.generateTitle(dettPratica.getDettPraticaId()), null, - // null, 0, 0, null, false); - // } } @Override @@ -2074,7 +1599,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl public DynamicQuery dynamicQueryInvioSignal(Long dettPraticaId) throws SystemException { DynamicQuery dynamicQuery = dettPraticaLocalService.dynamicQuery(); - if (Validator.isNotNull(dettPraticaId)) { dynamicQuery.add(PropertyFactoryUtil.forName("avvisoId").eq(dettPraticaId)); } @@ -2082,7 +1606,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl dynamicQuery.add(PropertyFactoryUtil.forName("status").eq(WorkflowConstants.STATUS_APPROVED)); dynamicQuery.add(PropertyFactoryUtil.forName("tipoIntegrazione") .eq(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)); - return dynamicQuery; } @@ -2109,31 +1632,22 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl case TipoSoggettoUtil.COMMITTENTE: dettPratica.setCodiceFiscalePrincipaleCommittente(codiceFiscale); break; - case TipoSoggettoUtil.COLLAUDATORE: dettPratica.setCodiceFiscalePrincipaleCollaudatore(codiceFiscale); break; - case TipoSoggettoUtil.DIRETTORE_LAVORI: dettPratica.setCodiceFiscalePrincipaleDirettoreLavori(codiceFiscale); break; - case TipoSoggettoUtil.PROGETTISTA: dettPratica.setCodiceFiscalePrincipaleProgettista(codiceFiscale); break; - case TipoSoggettoUtil.GEOLOGO: dettPratica.setCodiceFiscalePrincipaleGeologo(codiceFiscale); break; - case TipoSoggettoUtil.DITTA: dettPratica.setCodiceFiscalePrincipaleDitta(codiceFiscale); break; - - default: - break; } - dettPratica = DettPraticaLocalServiceUtil.updateDettPratica(dettPratica); return dettPratica; } @@ -2143,7 +1657,6 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl DettPratica dettPratica = dettPraticaLocalService.getDettPratica(dettPraticaId); String jsonToVersioning = dettPratica.serializeToVersioning(); - JSONObject response = HttpServiceUtil.postJson(url, jsonToVersioning); int version = response.getInt("version"); dettPratica.setVersion(version); @@ -2157,15 +1670,12 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl Options options = new Options(); options.setLocation(url); options.setPost(false); - String responseBody = HttpUtil.URLtoString(options); - if (options.getResponse().getResponseCode() == HttpServletResponse.SC_OK) { return Integer.parseInt(responseBody); } else { _log.error(options.getLocation() + ": " + options.getResponse().getResponseCode()); } - return 0; } @@ -2173,18 +1683,16 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl public String getVersionNumber(String url, int version) throws IOException, PortalException, SystemException { String response = callToVersion(url); - JSONObject jsonObjectResponse = JSONFactoryUtil.createJSONObject(response); JSONObject snapshot = jsonObjectResponse.getJSONObject("Snapshot"); int responseVersion = snapshot.getInt("version"); if (responseVersion != version) { - _log.error("Le versioni non corrispondono " + responseVersion + "/" + version); + _log.error("Le versioni non corrispondono " + responseVersion + StringPool.FORWARD_SLASH + version); } JSONObject jsonFields = snapshot.getJSONObject("fields"); for (String hiddenField : PraticaUtil.getDettPraticaHiddenFields()) { jsonFields.remove(hiddenField); } - return jsonFields.toString(); } @@ -2193,15 +1701,12 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl Options options = new Options(); options.setLocation(versioningURL); options.setPost(false); - String responseBody = HttpUtil.URLtoString(options); - if (options.getResponse().getResponseCode() == HttpServletResponse.SC_OK) { return responseBody; } else { _log.error(options.getLocation() + ": " + options.getResponse().getResponseCode()); } - // return "{\"values\":[],\"Snapshot\":{\"version\":0,\"fields\":{}}}"; return StringPool.BLANK; } @@ -2209,9 +1714,7 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl public JSONArray callForChanges(String url) throws IOException, PortalException, SystemException { String response = callToVersion(url); - JSONArray jsonArray = JSONFactoryUtil.createJSONObject(response).getJSONArray("values"); - return jsonArray; } @@ -2221,13 +1724,7 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl return dettPraticaPersistence.countByIntPraticaId_TipoIntegrazione(intPraticaId, TipoIntegrazioneUtil.VARIANTE); } - /** - * ADT: nuovo metodo per stampa fascicolo - * - * @param intPraticaId - * @return - * @throws SystemException - */ + // ADT: nuovo metodo per stampa fascicolo @Override public DettPratica getFirstCompletedByIntPratica(long intPraticaId) throws SystemException { @@ -2243,5 +1740,4 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl return ritorno.get(0); } } - } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocAggiuntivaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocAggiuntivaLocalServiceImpl.java index 2d86c403..bebb58ad 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocAggiuntivaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocAggiuntivaLocalServiceImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.service.impl; @@ -40,15 +40,12 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException; * The implementation of the doc aggiuntiva local service. * *

- * All custom service methods should be put in this class. Whenever methods are - * added, rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.DocAggiuntivaLocalService} - * interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.DocAggiuntivaLocalService} interface. * *

- * This is a local service. Methods of this service will not have security - * checks based on the propagated JAAS credentials because this service can only - * be accessed from within the same VM. + * This is a local service. Methods of this service will not have security checks based on the propagated JAAS + * credentials because this service can only be accessed from within the same VM. *

* * @author Davide Barbagallo, 3F Consulting @@ -57,100 +54,98 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException; */ public class DocAggiuntivaLocalServiceImpl extends DocAggiuntivaLocalServiceBaseImpl { /* - * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use - * {@link it.tref.liferay.portos.bo.service.DocAggiuntivaLocalServiceUtil} - * to access the doc aggiuntiva local service. + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.DocAggiuntivaLocalServiceUtil} to access the doc aggiuntiva local service. */ + @Override public List findByIntPratica(long intPraticaId) throws SystemException { return docAggiuntivaPersistence.findByIntPratica(intPraticaId); } + @Override public List findByIntPratica(long intPraticaId, int start, int end, OrderByComparator orderByComparator) throws SystemException { return docAggiuntivaPersistence.findByIntPratica(intPraticaId, start, end, orderByComparator); } + @Override public int countByIntPratica(long intPraticaId) throws SystemException { return docAggiuntivaPersistence.countByIntPratica(intPraticaId); } + @Override public List findByDettPratica(long dettPraticaId) throws SystemException { return docAggiuntivaPersistence.findByIntPratica(dettPraticaId); } + @Override public List findByDettPratica(long dettPraticaId, int start, int end, OrderByComparator orderByComparator) throws SystemException { return docAggiuntivaPersistence.findByIntPratica(dettPraticaId, start, end, orderByComparator); } + @Override public int countByDettPratica(long dettPraticaId) throws SystemException { return docAggiuntivaPersistence.countByIntPratica(dettPraticaId); } - public List findByIntPraticaFeVisible(long intPraticaId, boolean feVisible) - throws SystemException { + @Override + public List findByIntPraticaFeVisible(long intPraticaId, boolean feVisible) throws SystemException { return docAggiuntivaPersistence.findByIntPratica_FeVisible(intPraticaId, feVisible); } - public List findByIntPraticaFeVisible(long intPraticaId, boolean feVisible, int start, - int end, OrderByComparator orderByComparator) throws SystemException { + @Override + public List findByIntPraticaFeVisible(long intPraticaId, boolean feVisible, int start, int end, + OrderByComparator orderByComparator) throws SystemException { return docAggiuntivaPersistence.findByIntPratica_FeVisible(intPraticaId, feVisible, start, end, orderByComparator); } + @Override public int countByIntPraticaFeVisible(long intPraticaId, boolean feVisible) throws SystemException { return docAggiuntivaPersistence.countByIntPratica_FeVisible(intPraticaId, feVisible); } - public DocAggiuntiva addDocAggiuntiva(long userId, long intPraticaId, long dettPraticaId, - String descrizione, boolean feVisible, byte[] content, String sourceFileName, - ServiceContext serviceContext) throws SystemException, PortalException { - - DocAggiuntiva docAggiuntiva = docAggiuntivaPersistence.create(counterLocalService - .increment(DocAggiuntiva.class.getName())); + @Override + public DocAggiuntiva addDocAggiuntiva(long userId, long intPraticaId, long dettPraticaId, String descrizione, + boolean feVisible, byte[] content, String sourceFileName, ServiceContext serviceContext) + throws SystemException, PortalException { + DocAggiuntiva docAggiuntiva = docAggiuntivaPersistence.create(counterLocalService.increment(DocAggiuntiva.class + .getName())); DettPratica dettPratica = dettPraticaLocalService.getDettPratica(dettPraticaId); - User user = userPersistence.findByPrimaryKey(userId); - Date now = new Date(); - docAggiuntiva.setCompanyId(serviceContext.getCompanyId()); docAggiuntiva.setUserId(user.getUserId()); docAggiuntiva.setUserName(user.getFullName()); docAggiuntiva.setCreateDate(serviceContext.getCreateDate(now)); docAggiuntiva.setModifiedDate(serviceContext.getModifiedDate(now)); docAggiuntiva.setGroupId(serviceContext.getScopeGroupId()); - docAggiuntiva.setIntPraticaId(intPraticaId); docAggiuntiva.setDettPraticaId(dettPraticaId); - docAggiuntiva.setDescrizione(descrizione); docAggiuntiva.setFeVisible(feVisible); - - long fileEntryId = 0l; - + long fileEntryId = 0L; long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); - Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId); String folderName = PraticaUtil.getFolderName(dettPratica.getDettPraticaId()); - serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); Folder folder = null; try { - folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), - defaultFolder.getFolderId(), folderName); + folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), defaultFolder.getFolderId(), + folderName); } catch (NoSuchFolderException e) { // cartella non presente -> creo cartella folder = dlAppLocalService.addFolder(serviceContext.getUserId(), defaultFolder.getRepositoryId(), @@ -160,16 +155,13 @@ public class DocAggiuntivaLocalServiceImpl extends DocAggiuntivaLocalServiceBase + docAggiuntiva.getDocAggiuntivaId() + StringPool.UNDERLINE + sourceFileName; String description = sourceFileName; String mimeType = MimeTypesUtil.getContentType(sourceFileName); - String changeLog = StringPool.BLANK; - FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), - folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" + sourceFileName, - mimeType, title, description, changeLog, content, serviceContext); + FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(), + folder.getFolderId(), now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title, + description, changeLog, content, serviceContext); fileEntryId = fileEntry.getFileEntryId(); docAggiuntiva.setFileEntryId(fileEntryId); - docAggiuntiva = docAggiuntivaPersistence.update(docAggiuntiva); - return docAggiuntiva; } @@ -193,9 +185,9 @@ public class DocAggiuntivaLocalServiceImpl extends DocAggiuntivaLocalServiceBase return deleteDocAggiuntiva(docAggiuntivaLocalService.getDocAggiuntiva(docAggiuntivaId)); } + @Override public DocAggiuntiva fetchByOldFileEntryId(long oldFileEntryId) throws SystemException { return docAggiuntivaPersistence.fetchByoldFileEntryId(oldFileEntryId); } - } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaLocalServiceImpl.java index 77ff18d6..51abb9f5 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaLocalServiceImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.service.impl; @@ -21,6 +21,7 @@ import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants; import it.tref.liferay.portos.bo.shared.util.FirmeUtil; import it.tref.liferay.portos.bo.util.PraticaUtil; +import java.net.HttpURLConnection; import java.util.Date; import java.util.List; @@ -54,14 +55,12 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException; * The implementation of the doc pratica local service. * *

- * All custom service methods should be put in this class. Whenever methods are - * added, rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.DocPraticaLocalService} interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.DocPraticaLocalService} interface. * *

- * This is a local service. Methods of this service will not have security - * checks based on the propagated JAAS credentials because this service can only - * be accessed from within the same VM. + * This is a local service. Methods of this service will not have security checks based on the propagated JAAS + * credentials because this service can only be accessed from within the same VM. *

* * @author Davide Barbagallo, 3F Consulting @@ -70,9 +69,8 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException; */ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { /* - * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use - * {@link it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil} to - * access the doc pratica local service. + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil} to access the doc pratica local service. */ @Override @@ -93,32 +91,22 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { return deleteDocPratica(docPraticaLocalService.getDocPratica(docPraticaId)); } - public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, - byte[] dlFileEntry, String fileName, String version, boolean praticaValidata, String descLong, - String tipologia, String sha256, boolean aggiornato, String jsonFirmatari, - long dettPraticaIdRimozione, Date dtDataRimozione, ServiceContext serviceContext) - throws PortalException, SystemException { + @Override + public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, byte[] dlFileEntry, + String fileName, String version, boolean praticaValidata, String descLong, String tipologia, String sha256, + boolean aggiornato, String jsonFirmatari, long dettPraticaIdRimozione, Date dtDataRimozione, + ServiceContext serviceContext) throws PortalException, SystemException { User user = userPersistence.findByPrimaryKey(userId); - Date now = new Date(); - - validate(serviceContext.getScopeGroupId(), 0L, className, classPk, intPraticaId, dlFileEntry, - fileName, version, praticaValidata, descLong, tipologia, sha256, aggiornato, jsonFirmatari, - dettPraticaIdRimozione, dtDataRimozione); - - DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class - .getName())); - + DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName())); FileEntry fileEntry = addAttachment(classPk, intPraticaId, userId, fileName, dlFileEntry, tipologia); - docPratica.setCompanyId(serviceContext.getCompanyId()); docPratica.setUserId(user.getUserId()); docPratica.setUserName(user.getFullName()); docPratica.setCreateDate(serviceContext.getCreateDate(now)); docPratica.setModifiedDate(serviceContext.getModifiedDate(now)); docPratica.setGroupId(serviceContext.getScopeGroupId()); - docPratica.setClassName(className); docPratica.setClassPk(classPk); docPratica.setIntPraticaId(intPraticaId); @@ -132,34 +120,26 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { docPratica.setJsonFirmatari(jsonFirmatari); docPratica.setDettPraticaIdRimozione(dettPraticaIdRimozione); docPratica.setDtDataRimozione(dtDataRimozione); - docPratica.setStatus(WorkflowConstants.STATUS_PENDING); - docPratica = docPraticaPersistence.update(docPratica); - return docPratica; } - public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, - byte[] dlFileEntry, String fileName, String tipologia, String jsonFirmatari, - ServiceContext serviceContext) throws PortalException, SystemException { + @Override + public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, byte[] dlFileEntry, + String fileName, String tipologia, String jsonFirmatari, ServiceContext serviceContext) + throws PortalException, SystemException { User user = userPersistence.findByPrimaryKey(userId); - Date now = new Date(); - - DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class - .getName())); - + DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName())); FileEntry fileEntry = addAttachment(classPk, intPraticaId, userId, fileName, dlFileEntry, tipologia); - docPratica.setCompanyId(serviceContext.getCompanyId()); docPratica.setUserId(user.getUserId()); docPratica.setUserName(user.getFullName()); docPratica.setCreateDate(serviceContext.getCreateDate(now)); docPratica.setModifiedDate(serviceContext.getModifiedDate(now)); docPratica.setGroupId(serviceContext.getScopeGroupId()); - docPratica.setClassName(className); docPratica.setClassPk(classPk); docPratica.setIntPraticaId(intPraticaId); @@ -172,32 +152,25 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { docPratica.setJsonFirmatari(jsonFirmatari); docPratica.setDettPraticaIdRimozione(0l); docPratica.setDtDataRimozione(null); - docPratica.setStatus(WorkflowConstants.STATUS_PENDING); - docPratica = docPraticaPersistence.update(docPratica); - return docPratica; } - public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, - long fileEntryId, String fileName, String tipologia, String jsonFirmatari, - ServiceContext serviceContext) throws PortalException, SystemException { + @Override + public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, long fileEntryId, + String fileName, String tipologia, String jsonFirmatari, ServiceContext serviceContext) + throws PortalException, SystemException { User user = userPersistence.findByPrimaryKey(userId); - Date now = new Date(); - - DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class - .getName())); - + DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName())); docPratica.setCompanyId(serviceContext.getCompanyId()); docPratica.setUserId(user.getUserId()); docPratica.setUserName(user.getFullName()); docPratica.setCreateDate(serviceContext.getCreateDate(now)); docPratica.setModifiedDate(serviceContext.getModifiedDate(now)); docPratica.setGroupId(serviceContext.getScopeGroupId()); - docPratica.setClassName(className); docPratica.setClassPk(classPk); docPratica.setIntPraticaId(intPraticaId); @@ -210,29 +183,20 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { docPratica.setJsonFirmatari(jsonFirmatari); docPratica.setDettPraticaIdRimozione(0l); docPratica.setDtDataRimozione(null); - docPratica.setStatus(WorkflowConstants.STATUS_PENDING); - docPratica = docPraticaPersistence.update(docPratica); - return docPratica; } + @Override public DocPratica addDocPraticaForImport(long userId, String className, long classPk, long intPraticaId, byte[] dlFileEntry, String fileName, String version, boolean praticaValidata, String descLong, - String tipologia, String sha256, boolean aggiornato, String jsonFirmatari, - long dettPraticaIdRimozione, Date dtDataRimozione, long oldDocPraticaId, - ServiceContext serviceContext) throws PortalException, SystemException { + String tipologia, String sha256, boolean aggiornato, String jsonFirmatari, long dettPraticaIdRimozione, + Date dtDataRimozione, long oldDocPraticaId, ServiceContext serviceContext) throws PortalException, + SystemException { Date now = new Date(); - - validate(serviceContext.getScopeGroupId(), 0L, className, classPk, intPraticaId, dlFileEntry, - fileName, version, praticaValidata, descLong, tipologia, sha256, aggiornato, jsonFirmatari, - dettPraticaIdRimozione, dtDataRimozione); - - DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class - .getName())); - + DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName())); docPratica.setCompanyId(serviceContext.getCompanyId()); docPratica.setUserId(userId); if (userId > 0) { @@ -255,85 +219,72 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { docPratica.setDettPraticaIdRimozione(dettPraticaIdRimozione); docPratica.setDtDataRimozione(dtDataRimozione); docPratica.setOldDocPraticaId(oldDocPraticaId); - docPratica.setStatus(WorkflowConstants.STATUS_APPROVED); - return docPraticaPersistence.update(docPratica); } + @Override public FileEntry addAttachment(long classPk, long intPraticaId, long delegaUserId, String sourceFileName, byte[] content, String tipoAllegato) throws SystemException, PortalException { FileEntry fileEntry = null; - - // DettPratica dettPratica = - // dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId); IntPratica intPratica = intPraticaPersistence.fetchByPrimaryKey(intPraticaId); Territorio territorio = territorioPersistence.fetchByPrimaryKey(intPratica.getTerritorioId()); - long companyId = territorio.getCompanyId(); long groupId = territorio.getGroupId(); - // TODO forse è meglio ragionare con un'altra logica per i permessi User user = UserLocalServiceUtil.getRoleUsers( - RoleLocalServiceUtil.getRole(intPratica.getCompanyId(), RoleConstants.ADMINISTRATOR) - .getRoleId()).get(0); + RoleLocalServiceUtil.getRole(intPratica.getCompanyId(), RoleConstants.ADMINISTRATOR).getRoleId()) + .get(0); try { PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(user)); } catch (Exception e) { throw new SystemException(e); - } long userId = user.getUserId(); - ServiceContext serviceContext = new ServiceContext(); serviceContext.setCompanyId(companyId); serviceContext.setScopeGroupId(groupId); serviceContext.setUserId(userId); serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); - long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(companyId, ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); - Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId); - String folderName = PraticaUtil.getFolderName(classPk); - Folder folder = null; try { - folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), - defaultFolder.getFolderId(), folderName); + folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), defaultFolder.getFolderId(), + folderName); } catch (NoSuchFolderException e) { // cartella non presente -> creo cartella - folder = dlAppLocalService.addFolder(userId, defaultFolder.getRepositoryId(), - defaultFolder.getFolderId(), folderName, StringPool.BLANK, serviceContext); + folder = dlAppLocalService.addFolder(userId, defaultFolder.getRepositoryId(), defaultFolder.getFolderId(), + folderName, StringPool.BLANK, serviceContext); } Date now = new Date(); String title = tipoAllegato + StringPool.UNDERLINE + sourceFileName; String description = sourceFileName; String mimeType = MimeTypesUtil.getContentType(sourceFileName); - String changeLog = StringPool.BLANK; fileEntry = dlAppLocalService.addFileEntry(userId, folder.getRepositoryId(), folder.getFolderId(), - now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog, content, - serviceContext); - + now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title, description, changeLog, + content, serviceContext); try { - PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil - .create(UserLocalServiceUtil.getUser(delegaUserId))); + PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(UserLocalServiceUtil + .getUser(delegaUserId))); } catch (Exception e) { throw new SystemException(e); - } return fileEntry; } + @Override public FileEntry getAttachment(long classPk) throws SystemException, PortalException { DocPratica fileAllegato = docPraticaPersistence.findByPrimaryKey(classPk); return dlAppLocalService.getFileEntry(fileAllegato.getDlFileEntryId()); } + @Override public void addFirma(long docPraticaId, String codiceFiscale) throws PortalException, SystemException { DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); @@ -341,6 +292,7 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { docPraticaLocalService.updateDocPratica(docPratica); } + @Override public void addFirmeAndApprova(long docPraticaId, List codiciFiscali) throws PortalException, SystemException { @@ -355,18 +307,19 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { docPraticaLocalService.updateDocPratica(docPratica); } - public void addErrorAndApprova(long docPraticaId, String errorCode) throws PortalException, - SystemException { + @Override + public void addErrorAndApprova(long docPraticaId, String errorCode) throws PortalException, SystemException { DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); docPratica.setModifiedDate(new Date()); docPratica.setErrorCode(errorCode); - if ("400".equalsIgnoreCase(errorCode)) { + if (String.valueOf(HttpURLConnection.HTTP_BAD_REQUEST).equals(errorCode)) { docPratica.setStatus(WorkflowConstants.STATUS_DENIED); } docPraticaLocalService.updateDocPratica(docPratica); } + @Override public void removeFirma(long docPraticaId, String codiceFiscale) throws PortalException, SystemException { DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); @@ -374,17 +327,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { docPraticaLocalService.updateDocPratica(docPratica); } - private void validate(long groupId, long docPraticaId, String className, long classPk, long intPraticaId, - byte[] dlFileEntry, String fileName, String version, boolean praticaValidata, String descLong, - String tipologia, String sha256, boolean aggiornato, String jsonFirmatari, - long dettPraticaIdRimozione, Date dtDataRimozione) throws PortalException, SystemException { - - // TODO Write your own validation code - - } - - public DocPratica updateDocPraticaAggiornato(long docPraticaId, boolean aggiornato) - throws SystemException { + @Override + public DocPratica updateDocPraticaAggiornato(long docPraticaId, boolean aggiornato) throws SystemException { DocPratica docPratica = docPraticaPersistence.fetchByPrimaryKey(docPraticaId); docPratica.setAggiornato(aggiornato); @@ -392,18 +336,22 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { return docPraticaLocalService.updateDocPratica(docPratica); } + @Override public int countDocPraticaDaInviareDax() throws SystemException { DynamicQuery dynamicQuery = dynamicQueryDocPraticaDaInviareDax(); return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery); } + @Override public List getDocPraticaDaInviareDax(int start, int end) throws SystemException { + DynamicQuery dynamicQuery = dynamicQueryDocPraticaDaInviareDax(); return docPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end); } private DynamicQuery dynamicQueryDocPraticaDaInviareDax() { + DynamicQuery dynamicQuery = docPraticaLocalService.dynamicQuery(); dynamicQuery.add(PropertyFactoryUtil.forName("dtInvioDax").isNull()); dynamicQuery.add(PropertyFactoryUtil.forName("daxId").eq(0L)); @@ -412,47 +360,56 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { return dynamicQuery; } + @Override public int countByClassPk(long classPk) throws SystemException { + return docPraticaPersistence.countByClassPk(classPk); } + @Override public List findByClassPk(long classPk, int start, int end) throws SystemException { return docPraticaPersistence.findByClassPk(classPk, start, end); } + @Override public List findByIntPratica(long intPraticaId) throws SystemException { return docPraticaPersistence.findByIntPratica(intPraticaId); } + @Override public List findByClassPk(long classPk) throws SystemException { return docPraticaPersistence.findByClassPk(classPk); } - public List findByStaus(int status, int start, int end, OrderByComparator order) - throws SystemException { + @Override + public List findByStaus(int status, int start, int end, OrderByComparator order) throws SystemException { return docPraticaPersistence.findByStatus(status, start, end, order); } + @Override public int countByStatus(long status) throws SystemException { return docPraticaPersistence.countByStatus(status); } + @Override public int countByClassPk_Tipologia(long classPk, String tipologia) throws SystemException { return docPraticaPersistence.countByClassPk_Tipologia(classPk, tipologia); } + @Override public List findByClassPk_Tipologia(long classPk, String tipologia, int start, int end) throws SystemException { return docPraticaPersistence.findByClassPk_Tipologia(classPk, tipologia, start, end); } + @Override public List findByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) throws SystemException { @@ -463,8 +420,9 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { return soggettoPersistence.findWithDynamicQuery(dynamicQuery, start, end); } - public List findByIntPratica_ClassPk_Tipologia(long intPraticaId, long classPk, - String tipologia, int start, int end) throws SystemException { + @Override + public List findByIntPratica_ClassPk_Tipologia(long intPraticaId, long classPk, String tipologia, + int start, int end) throws SystemException { DynamicQuery dynamicQuery = dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); @@ -474,8 +432,9 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { return dynamicQuery(dynamicQuery, start, end); } - public List findByIntPratica_ClassPk_Tipologie(long intPraticaId, long classPk, - List tipologie) throws SystemException { + @Override + public List findByIntPratica_ClassPk_Tipologie(long intPraticaId, long classPk, List tipologie) + throws SystemException { DynamicQuery dynamicQuery = dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); @@ -485,6 +444,7 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { return dynamicQuery(dynamicQuery); } + @Override public List findByIntPratica_ClassPkEqual_Tipologie(long intPraticaId, long classPk, List tipologie) throws SystemException { @@ -496,29 +456,31 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { return dynamicQuery(dynamicQuery); } - public DocPratica fetchByC_Group_DlFileEntry_Version(long dlFileEntryId, String version) - throws SystemException { + @Override + public DocPratica fetchByC_Group_DlFileEntry_Version(long dlFileEntryId, String version) throws SystemException { return docPraticaPersistence.fetchByDlFileEntry_Version(dlFileEntryId, version); } + @Override public DocPratica fetchByOldDocPraticaId(long oldDocPraticaId) throws SystemException { return docPraticaPersistence.fetchByOldDocPratica(oldDocPraticaId); } + @Override public List findDistinctDlFileEntryId(long classPk, String tipologia, int start, int end) throws SystemException { return findDistinctDlFileEntryId(new long[] { classPk }, tipologia, start, end); } + @Override public List findDistinctDlFileEntryId(long[] classPks, String tipologia, int start, int end) throws SystemException { DynamicQuery dynamicQuery = docPraticaLocalService.dynamicQuery(); - dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil - .property("dlFileEntryId"))); + dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("dlFileEntryId"))); dynamicQuery.add(PropertyFactoryUtil.forName("tipologia").eq(tipologia)); Junction or = RestrictionsFactoryUtil.disjunction(); for (long classPk : classPks) { @@ -529,6 +491,7 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { return docPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end); } + @Override public List getValidByIntPratica(long intPraticaId) throws SystemException { DynamicQuery dynamicQuery = dynamicQuery(); @@ -538,8 +501,9 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { return dynamicQuery(dynamicQuery); } - public List getValidByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, - int end) throws SystemException { + @Override + public List getValidByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) + throws SystemException { DynamicQuery dynamicQuery = dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); @@ -549,53 +513,51 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { return dynamicQuery(dynamicQuery, start, end); } - public int countValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia) - throws SystemException { + @Override + public int countValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia) throws SystemException { DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); - return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery); } - public List getValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, - int end) throws SystemException { + @Override + public List getValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) + throws SystemException { DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); - dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione")); return dynamicQuery(dynamicQuery, start, end); } - public List getValidTmpByIntPratica_DettPratica_Tipologia(long intPraticaId, - long dettPraticaId, String tipologia, int start, int end) throws SystemException { + @Override + public List getValidTmpByIntPratica_DettPratica_Tipologia(long intPraticaId, long dettPraticaId, + String tipologia, int start, int end) throws SystemException { DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); dynamicQuery.add(RestrictionsFactoryUtil.eq("classPk", dettPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("className", DettPratica.class.getName())); - dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione")); return dynamicQuery(dynamicQuery, start, end); } - public List getValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie, - int start, int end) throws SystemException { + @Override + public List getValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie, int start, int end) + throws SystemException { DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie)); - dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione")); return dynamicQuery(dynamicQuery, start, end); } - public int countValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie) - throws SystemException { + @Override + public int countValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie) throws SystemException { DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie)); - return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery); } @@ -604,10 +566,10 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { DynamicQuery dynamicQuery = dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaIdRimozione", null)); - return dynamicQuery; } + @Override public List getInvalidByIntPratica(long intPraticaId) throws SystemException { DynamicQuery dynamicQuery = dynamicQuery(); @@ -617,6 +579,7 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { return dynamicQuery(dynamicQuery); } + @Override public List getInvalidTmpByIntPratica(long intPraticaId) throws SystemException { DynamicQuery dynamicQuery = dynamicQuery(); @@ -626,20 +589,20 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { return dynamicQuery(dynamicQuery); } - public List getValidUntilClassPkByIntPratica(long intPraticaId, long classPk, - String tipologia, int start, int end) throws SystemException { + @Override + public List getValidUntilClassPkByIntPratica(long intPraticaId, long classPk, String tipologia, + int start, int end) throws SystemException { DynamicQuery dynamicQuery = dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.le("classPk", classPk)); dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); - // dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaIdRimozione", - // null)); dynamicQuery.add(RestrictionsFactoryUtil.eq("rimosso", false)); dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk")); return dynamicQuery(dynamicQuery, start, end); } + @Override public void completeInvalidation(long intPraticaId) throws SystemException { Date now = new Date(); @@ -652,34 +615,29 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { } } + @Override public List getDocPraticaWithOldFileEntryId(int start, int end) throws SystemException { DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(DocPratica.class); dynamicQuery.add(PropertyFactoryUtil.forName("oldDlFileEntryId").ne(0L)); dynamicQuery.addOrder(OrderFactoryUtil.desc("oldDlFileEntryId")); - return docPraticaLocalService.dynamicQuery(dynamicQuery, start, end); } - // ADT BUG FE ID = 9 - public DocPratica addDocPraticaAnnullamento(long userId, String className, long classPk, - long intPraticaId, long fileEntryId, String fileName, String tipologia, String sha256, - String jsonFirmatari, ServiceContext serviceContext) throws PortalException, SystemException { + @Override + public DocPratica addDocPraticaAnnullamento(long userId, String className, long classPk, long intPraticaId, + long fileEntryId, String fileName, String tipologia, String sha256, String jsonFirmatari, + ServiceContext serviceContext) throws PortalException, SystemException { User user = userPersistence.findByPrimaryKey(userId); - Date now = new Date(); - - DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class - .getName())); - + DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName())); docPratica.setCompanyId(serviceContext.getCompanyId()); docPratica.setUserId(user.getUserId()); docPratica.setUserName(user.getFullName()); docPratica.setCreateDate(serviceContext.getCreateDate(now)); docPratica.setModifiedDate(serviceContext.getModifiedDate(now)); docPratica.setGroupId(serviceContext.getScopeGroupId()); - docPratica.setClassName(className); docPratica.setClassPk(classPk); docPratica.setIntPraticaId(intPraticaId); @@ -693,27 +651,15 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { docPratica.setJsonFirmatari(jsonFirmatari); docPratica.setDettPraticaIdRimozione(0l); docPratica.setDtDataRimozione(null); - docPratica.setStatus(WorkflowConstants.STATUS_PENDING); - docPratica = docPraticaPersistence.update(docPratica); - return docPratica; } - /** - * Metodo nuovo ADT - * - * @param intPraticaId - * @param classPk - * @param tipologia - * @param start - * @param end - * @return - * @throws SystemException - */ - public List findByIntPratica_ClassPk_TipologiaNew(long intPraticaId, long classPk, - String tipologia, int start, int end) throws SystemException { + // Metodo nuovo ADT + @Override + public List findByIntPratica_ClassPk_TipologiaNew(long intPraticaId, long classPk, String tipologia, + int start, int end) throws SystemException { DynamicQuery dynamicQuery = dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); @@ -722,5 +668,4 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk")); return dynamicQuery(dynamicQuery, start, end); } - } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaServiceImpl.java index e6f99c76..d386fd10 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaServiceImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.service.impl; @@ -26,13 +26,12 @@ import com.liferay.portal.service.ServiceContext; * The implementation of the doc pratica remote service. * *

- * All custom service methods should be put in this class. Whenever methods are added, rerun - * ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.DocPraticaService} interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.DocPraticaService} interface. * *

- * This is a remote service. Methods of this service are expected to have security checks based on - * the propagated JAAS credentials because this service can be accessed remotely. + * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS + * credentials because this service can be accessed remotely. *

* * @author Davide Barbagallo, 3F Consulting @@ -40,103 +39,112 @@ import com.liferay.portal.service.ServiceContext; * @see it.tref.liferay.portos.bo.service.DocPraticaServiceUtil */ public class DocPraticaServiceImpl extends DocPraticaServiceBaseImpl { - /* - * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link - * it.tref.liferay.portos.bo.service.DocPraticaServiceUtil} to access the doc pratica remote - * service. - */ - public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, byte[] dlFileEntry, - String fileName, String version, boolean praticaValidata, String descLong, String tipologia, String sha256, - boolean aggiornato, String jsonFirmatari, long intPraticaIdRimozione, long dettPraticaIdRimozione, - Date dtDataRimozione, ServiceContext serviceContext) throws PortalException, SystemException { + /* + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.DocPraticaServiceUtil} to access the doc pratica remote service. + */ + @Override + public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, byte[] dlFileEntry, + String fileName, String version, boolean praticaValidata, String descLong, String tipologia, String sha256, + boolean aggiornato, String jsonFirmatari, long intPraticaIdRimozione, long dettPraticaIdRimozione, + Date dtDataRimozione, ServiceContext serviceContext) throws PortalException, SystemException { - // TODO aggiungere controlli di permessi di aggiutna file!!!! + // TODO aggiungere controlli di permessi di aggiunta file!!!! + return docPraticaLocalService.addDocPratica(userId, className, classPk, intPraticaId, dlFileEntry, fileName, + version, praticaValidata, descLong, tipologia, sha256, aggiornato, jsonFirmatari, + dettPraticaIdRimozione, dtDataRimozione, serviceContext); + } - return docPraticaLocalService.addDocPratica(userId, className, classPk, intPraticaId, dlFileEntry, fileName, - version, praticaValidata, descLong, tipologia, sha256, aggiornato, jsonFirmatari, dettPraticaIdRimozione, - dtDataRimozione, serviceContext); + @Override + public DocPratica getDocPratica(long docPraticaId) throws PortalException, SystemException { - } + // TODO permessi + return docPraticaLocalService.getDocPratica(docPraticaId); + } - public DocPratica getDocPratica(long docPraticaId) throws PortalException, SystemException { + @Override + public int countByClassPk_Tipologia(long classPk, String tipologia) throws SystemException { - // TODO permessi - return docPraticaLocalService.getDocPratica(docPraticaId); - } + // TODO permessi + return docPraticaLocalService.countByClassPk_Tipologia(classPk, tipologia); + } - public int countByClassPk_Tipologia(long classPk, String tipologia) throws SystemException { + @Override + public List findByClassPk_Tipologia(long dettPratica, String tipologia, int start, int end) + throws SystemException { - // TODO permessi - return docPraticaLocalService.countByClassPk_Tipologia(classPk, tipologia); - } + // TODO permessi + return docPraticaLocalService.findByClassPk_Tipologia(dettPratica, tipologia, start, end); + } - public List findByClassPk_Tipologia(long dettPratica, String tipologia, int start, int end) - throws SystemException { + @Override + public List findByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) + throws SystemException { - // TODO permessi - return docPraticaLocalService.findByClassPk_Tipologia(dettPratica, tipologia, start, end); - } + // TODO permessi + return docPraticaLocalService.findByIntPratica_Tipologia(intPraticaId, tipologia, start, end); + } - public List findByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) - throws SystemException { + @Override + public List findByIntPratica_ClassPk_Tipologia(long intPraticaId, long classPk, String tipologia, + int start, int end) throws SystemException { - // TODO permessi - return docPraticaLocalService.findByIntPratica_Tipologia(intPraticaId, tipologia, start, end); - } + return docPraticaLocalService.findByIntPratica_ClassPk_Tipologia(intPraticaId, classPk, tipologia, start, end); + } - public List findByIntPratica_ClassPk_Tipologia(long intPraticaId, long classPk, String tipologia, - int start, int end) throws SystemException { + @Override + public DocPratica deleteDocPratica(DocPratica docPratica) throws PortalException, SystemException { - return docPraticaLocalService.findByIntPratica_ClassPk_Tipologia(intPraticaId, classPk, tipologia, start, end); - } + return docPraticaLocalService.deleteDocPratica(docPratica); + } - public DocPratica deleteDocPratica(DocPratica docPratica) throws PortalException, SystemException { + @Override + public DocPratica deleteDocPratica(long docPraticaId) throws PortalException, SystemException { + return docPraticaLocalService.deleteDocPratica(docPraticaId); + } - return docPraticaLocalService.deleteDocPratica(docPratica); - } + @Override + public List getValidByIntPratica(long intPraticaId) throws SystemException { - public DocPratica deleteDocPratica(long docPraticaId) throws PortalException, SystemException { + // TODO permessi + return docPraticaLocalService.getValidByIntPratica(intPraticaId); + } + @Override + public List getValidByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) + throws SystemException { - return docPraticaLocalService.deleteDocPratica(docPraticaId); - } + // TODO permessi + return docPraticaLocalService.getValidByIntPratica_Tipologia(intPraticaId, tipologia, start, end); + } - public List getValidByIntPratica(long intPraticaId) throws SystemException { + @Override + public List getValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) + throws SystemException { - // TODO permessi - return docPraticaLocalService.getValidByIntPratica(intPraticaId); - } + // TODO permessi + return docPraticaLocalService.getValidTmpByIntPratica_Tipologia(intPraticaId, tipologia, start, end); + } - public List getValidByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) - throws SystemException { + @Override + public List getInvalidByIntPratica(long intPraticaId) throws SystemException { - // TODO permessi - return docPraticaLocalService.getValidByIntPratica_Tipologia(intPraticaId, tipologia, start, end); - } + // TODO permessi + return docPraticaLocalService.getInvalidByIntPratica(intPraticaId); + } - public List getValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) - throws SystemException { + @Override + public List getInvalidTmpByIntPratica(long intPraticaId) throws SystemException { - // TODO permessi - return docPraticaLocalService.getValidTmpByIntPratica_Tipologia(intPraticaId, tipologia, start, end); - } + // TODO permessi + return docPraticaLocalService.getInvalidTmpByIntPratica(intPraticaId); + } - public List getInvalidByIntPratica(long intPraticaId) throws SystemException { + @Override + public List getValidUntilClassPkByIntPratica(long intPraticaId, long classPk, String tipologia, + int start, int end) throws SystemException { - // TODO permessi - return docPraticaLocalService.getInvalidByIntPratica(intPraticaId); - } - - public List getInvalidTmpByIntPratica(long intPraticaId) throws SystemException { - - // TODO permessi - return docPraticaLocalService.getInvalidTmpByIntPratica(intPraticaId); - } - - public List getValidUntilClassPkByIntPratica(long intPraticaId, long classPk, String tipologia, - int start, int end) throws SystemException { - - return docPraticaLocalService.getValidUntilClassPkByIntPratica(intPraticaId, classPk, tipologia, start, end); - } + return docPraticaLocalService.getValidUntilClassPkByIntPratica(intPraticaId, classPk, tipologia, start, end); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/FineLavoriLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/FineLavoriLocalServiceImpl.java index f08966ef..44bad525 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/FineLavoriLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/FineLavoriLocalServiceImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.service.impl; @@ -57,14 +57,12 @@ import com.liferay.portal.service.ServiceContext; * The implementation of the fine lavori local service. * *

- * All custom service methods should be put in this class. Whenever methods are - * added, rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.FineLavoriLocalService} interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.FineLavoriLocalService} interface. * *

- * This is a local service. Methods of this service will not have security - * checks based on the propagated JAAS credentials because this service can only - * be accessed from within the same VM. + * This is a local service. Methods of this service will not have security checks based on the propagated JAAS + * credentials because this service can only be accessed from within the same VM. *

* * @author Davide Barbagallo, 3F Consulting @@ -73,9 +71,8 @@ import com.liferay.portal.service.ServiceContext; */ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { /* - * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use - * {@link it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil} to - * access the fine lavori local service. + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil} to access the fine lavori local service. */ private FineLavori initFineLavori(ServiceContext serviceContext) throws PortalException, SystemException { @@ -83,17 +80,14 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { User user = userLocalService.getUser(serviceContext.getUserId()); Date now = new Date(); - - FineLavori fineLavori = fineLavoriPersistence.create(counterLocalService.increment(DettPratica.class - .getName())); - + FineLavori fineLavori = fineLavoriPersistence + .create(counterLocalService.increment(DettPratica.class.getName())); fineLavori.setCompanyId(serviceContext.getCompanyId()); fineLavori.setGroupId(serviceContext.getScopeGroupId()); fineLavori.setUserId(serviceContext.getUserId()); fineLavori.setUserName(user.getFullName()); fineLavori.setCreateDate(serviceContext.getCreateDate(now)); fineLavori.setModifiedDate(serviceContext.getModifiedDate(now)); - // setto parametri di default fineLavori.setParziale(false); fineLavori.setDataEffettuazione(null); @@ -102,20 +96,18 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { fineLavori.setNormEsenteBollo(false); fineLavori.setNormEsenteCollaudo(false); fineLavori.setComunicazioneDirettoreLavori(StringPool.BLANK); - return fineLavori; } + @Override @Indexable(type = IndexableType.REINDEX) public FineLavori addFineLavori(long intPraticaId, ServiceContext serviceContext) throws PortalException, SystemException { IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); - FineLavori fineLavori = initFineLavori(serviceContext); fineLavori.setGroupId(intPratica.getGroupId()); fineLavori.setIntPraticaId(intPraticaId); - fineLavoriPersistence.update(fineLavori); return fineLavori; } @@ -129,12 +121,10 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { for (DocPratica docPratica : docPraticas) { docPraticaLocalService.deleteDocPratica(docPratica); } - List pagamenti = pagamentoLocalService.findByClassPk(fineLavori.getFineLavoriId()); for (Pagamento pagamento : pagamenti) { pagamentoLocalService.deletePagamento(pagamento); } - return super.deleteFineLavori(fineLavori); } @@ -143,18 +133,17 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { public FineLavori deleteFineLavori(long fineLavoriId) throws PortalException, SystemException { FineLavori fineLavori = fineLavoriPersistence.findByPrimaryKey(fineLavoriId); - return deleteFineLavori(fineLavori); } + @Override @Indexable(type = IndexableType.REINDEX) public FineLavori updateFineLavori(long userId, long fineLavoriId, long intPraticaId, boolean parziale, boolean completata, Date dataFineLavori, String codiceFiscaleDelegato, boolean normEsenteBollo, - boolean normEsenteCollaudo, String comunicazioneDirettoreLavori) - throws NoSuchFineLavoriException, SystemException { + boolean normEsenteCollaudo, String comunicazioneDirettoreLavori) throws NoSuchFineLavoriException, + SystemException { FineLavori fineLavori = fineLavoriPersistence.findByPrimaryKey(fineLavoriId); - fineLavori.setParziale(parziale); fineLavori.setCompletata(completata); fineLavori.setDataFineLavori(dataFineLavori); @@ -162,12 +151,11 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { fineLavori.setNormEsenteBollo(normEsenteBollo); fineLavori.setNormEsenteCollaudo(normEsenteCollaudo); fineLavori.setComunicazioneDirettoreLavori(comunicazioneDirettoreLavori); - fineLavori = fineLavoriPersistence.update(fineLavori); - return fineLavori; } + @Override public FineLavori getLastEditable(long intPraticaId) throws SystemException { DynamicQuery dynamicQuery = dynamicQuery(); @@ -181,6 +169,7 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { return null; } + @Override public FineLavori getLastCompleted(long intPraticaId) throws SystemException { DynamicQuery dynamicQuery = dynamicQuery(); @@ -194,118 +183,42 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { return null; } + @Override public FineLavori pagaInvia(long fineLavoriId, String codiceFiscaleCommittente, String currentURL, ServiceContext serviceContext) throws SystemException, PortalException { FineLavori fineLavori = fineLavoriPersistence.findByPrimaryKey(fineLavoriId); - BigDecimal importoBolli = PagamentiCommonUtil.getImportoBolli(fineLavori.getCompanyId(), fineLavori.getFineLavoriId(), FineLavori.class.getName(), TipoIntegrazioneUtil.FINE_LAVORI); - fineLavori.setImportoBolli(importoBolli.toString()); fineLavori = updateFineLavori(fineLavori); - PagamentiUtil.nuovoPagamento(currentURL, fineLavori.getFineLavoriId(), FineLavori.class.getName(), - PagamentoConstants.PAGAMENTO_BOLLI, importoBolli.toString(), codiceFiscaleCommittente, - serviceContext); - + PagamentoConstants.PAGAMENTO_BOLLI, importoBolli.toString(), codiceFiscaleCommittente, serviceContext); return fineLavori; } - // public void sostituisciPagamento(long pagamentoId, long fineLavoriId, - // String - // codiceFiscaleCommittente, String mezzo, - // String url, ServiceContext serviceContext) throws PortalException, - // SystemException { - // - // FineLavori fineLavori = getFineLavori(fineLavoriId); - // Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId); - // String currentUtilizzata = pagamento.getUtilizzata(); - // String currentMezzo = pagamento.getMezzo(); - // - // boolean irisEnable = - // PagamentiUtil.irisIsEnable(pagamento.getCompanyId()); - // if (fineLavori.getPagamentoId() != pagamentoId) { - // throw new PortalException("Pagamento non abbinato alla Fine Lavori"); - // } - // if (mezzo.equalsIgnoreCase(PagamentoConstants.MEZZO_MANUALE)) { - // if (irisEnable) { - // throw new - // PortalException("Creazione pagamento manuale con iris enable non possibile"); - // } else if - // (currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_NON_PAGABILE) - // || - // currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_RIFIUTATA)) - // { - // fineLavori.setPagamentoId(0l); - // fineLavori = updateFineLavori(fineLavori); - // - // pagamento.setUtilizzata(PagamentoConstants.UTILIZZATA_SOSTITUITA); - // pagamentoLocalService.updatePagamento(pagamento); - // - // PagamentiUtil.nuovoPagamento(url, fineLavoriId, - // FineLavori.class.getName(), - // pagamento.getImportoBolli(), - // pagamento.getImportoSpeseIstruttoria(), codiceFiscaleCommittente, - // serviceContext); - // } else { - // throw new PortalException("Creazione pagamento manuale con stato " + - // currentUtilizzata + - // " non possibile"); - // } - // } else if (mezzo.equalsIgnoreCase(PagamentoConstants.MEZZO_IRIS)) { - // if (irisEnable - // && (currentMezzo.equalsIgnoreCase(PagamentoConstants.MEZZO_MANUALE) || - // (currentUtilizzata - // .equalsIgnoreCase(PagamentoConstants.UTILIZZATA_NON_PAGABILE) || - // currentUtilizzata - // .equalsIgnoreCase(PagamentoConstants.UTILIZZATA_RIFIUTATA)))) { - // - // fineLavori.setPagamentoId(0l); - // fineLavori = updateFineLavori(fineLavori); - // - // pagamento.setUtilizzata(PagamentoConstants.UTILIZZATA_SOSTITUITA); - // pagamentoLocalService.updatePagamento(pagamento); - // PagamentiUtil.nuovoPagamento(url, fineLavoriId, - // FineLavori.class.getName(), - // pagamento.getImportoBolli(), - // pagamento.getImportoSpeseIstruttoria(), codiceFiscaleCommittente, - // serviceContext); - // } else { - // throw new PortalException("Pagamento IRIS non sostituibile"); - // } - // - // } else { - // throw new PortalException("Mezzo non presente"); - // } - // - // } - - public void updateEsitoPagamento(long pagamentoId, long fineLavoriId, String stato) - throws SystemException, PortalException { + @Override + public void updateEsitoPagamento(long pagamentoId, long fineLavoriId, String stato) throws SystemException, + PortalException { updateEsitoPagamento(pagamentoId, fineLavoriId, 0l, stato); } + @Override public void updateEsitoPagamento(long pagamentoId, long fineLavoriId, long fileEntryId, String stato) throws SystemException, PortalException { Date now = new Date(); FineLavori fineLavori = fineLavoriPersistence.fetchByPrimaryKey(fineLavoriId); - fineLavori.setModifiedDate(now); if (stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_PAGATA)) { - fineLavori.setCompletata(true); fineLavori.setDataEffettuazione(now); - fineLavori.setNumero(fineLavoriPersistence.countByIntPraticaId_Completata( - fineLavori.getIntPraticaId(), true) + 1); + fineLavori.setNumero(fineLavoriPersistence.countByIntPraticaId_Completata(fineLavori.getIntPraticaId(), + true) + 1); fineLavori = updateFineLavori(fineLavori); - updateIntPraticaStatus(fineLavori, fineLavori.getIntPraticaId()); - docPraticaLocalService.completeInvalidation(fineLavori.getIntPraticaId()); - IntPratica intPratica = intPraticaLocalService.getIntPratica(fineLavori.getIntPraticaId()); if (WorkflowUtil.isWorkflowDisattivabile(fineLavori.getIntPraticaId()) && Validator.isNotNull(intPratica.getStatusByUserId())) { @@ -317,45 +230,37 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { || stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_ANNULLATO)) { pagamentoLocalService.updatePagamentoUtilizzata(pagamentoId, stato); } - } + @Override public FineLavori updateEsito(long fineLavoriId, int stato) throws SystemException, PortalException { Date now = new Date(); FineLavori fineLavori = fineLavoriPersistence.fetchByPrimaryKey(fineLavoriId); fineLavori.setModifiedDate(now); - fineLavori.setCompletata(true); fineLavori.setDataEffettuazione(now); - fineLavori.setNumero(fineLavoriPersistence.countByIntPraticaId_Completata( - fineLavori.getIntPraticaId(), true) + 1); + fineLavori + .setNumero(fineLavoriPersistence.countByIntPraticaId_Completata(fineLavori.getIntPraticaId(), true) + 1); fineLavori = updateFineLavori(fineLavori); - updateIntPraticaStatus(fineLavori, fineLavori.getIntPraticaId()); - docPraticaLocalService.completeInvalidation(fineLavori.getIntPraticaId()); - IntPratica intPratica = intPraticaLocalService.getIntPratica(fineLavori.getIntPraticaId()); if (WorkflowUtil.isWorkflowDisattivabile(fineLavori.getIntPraticaId()) && Validator.isNotNull(intPratica.getStatusByUserId())) { this.inviaMailnotifica(fineLavoriId, intPratica.getStatusByUserId(), now); } - return fineLavori; } - private void inviaMailnotifica(long fineLavoriId, long tecnicoIstruttoreId, Date date) - throws SystemException, PortalException { + private void inviaMailnotifica(long fineLavoriId, long tecnicoIstruttoreId, Date date) throws SystemException, + PortalException { FineLavori fineLavori = fineLavoriPersistence.fetchByPrimaryKey(fineLavoriId); - User tecnicoIstruttore = userLocalService.getUser(tecnicoIstruttoreId); - String[] to = { tecnicoIstruttore.getEmailAddress() }; String[] cc = new String[0]; String[] ccn = new String[0]; - String tipoPratica = StringPool.BLANK; long intPraticaId = fineLavori.getIntPraticaId(); if (AzioniPraticheUtil.isDeposito(intPraticaId)) { @@ -363,29 +268,23 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { } else if (AzioniPraticheUtil.isAutorizzazione(intPraticaId)) { tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-02"); } - JSONObject templateVariables = JSONFactoryUtil.createJSONObject(); templateVariables.put("receiver", tecnicoIstruttore.getFullName()); templateVariables.put("tipoPratica", tipoPratica); - templateVariables.put( - "tipoOggetto", - LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-" - + (fineLavori.getParziale() ? "09" : "07"))); - templateVariables.put("dataInvio", FastDateFormatFactoryUtil.getSimpleDateFormat("dd/MM/yyyy HH:mm") - .format(date)); - + templateVariables.put("tipoOggetto", + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-" + (fineLavori.getParziale() ? "09" : "07"))); + templateVariables.put("dataInvio", + FastDateFormatFactoryUtil.getSimpleDateFormat("dd/MM/yyyy HH:mm").format(date)); ServiceContext serviceContext = new ServiceContext(); serviceContext.setScopeGroupId(fineLavori.getGroupId()); serviceContext.setCompanyId(fineLavori.getCompanyId()); serviceContext.setUserId(fineLavori.getUserId()); - - MailUtil.invioMailNotifica(fineLavori.getIntPraticaId(), 0l, fineLavoriId, - FineLavori.class.getName(), to, cc, ccn, "NOTIFICA-BO", templateVariables, null, - serviceContext); + MailUtil.invioMailNotifica(fineLavori.getIntPraticaId(), 0l, fineLavoriId, FineLavori.class.getName(), to, cc, + ccn, "NOTIFICA-BO", templateVariables, null, serviceContext); } - private IntPratica updateIntPraticaStatus(FineLavori fineLavori, long intPraticaId) - throws PortalException, SystemException { + private IntPratica updateIntPraticaStatus(FineLavori fineLavori, long intPraticaId) throws PortalException, + SystemException { IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId); if (fineLavori.isParziale()) { @@ -397,111 +296,123 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { return intPratica; } - public FineLavori updateFineLavoriProtocollo(long fineLavoriId, String protocollo) - throws PortalException, SystemException { + @Override + public FineLavori updateFineLavoriProtocollo(long fineLavoriId, String protocollo) throws PortalException, + SystemException { FineLavori fineLavori = fineLavoriLocalService.fetchFineLavori(fineLavoriId); fineLavori.setModifiedDate(new Date()); fineLavori.setProtocollo(protocollo); fineLavori.setDtProtocollo(new Date()); fineLavori = fineLavoriLocalService.updateFineLavori(fineLavori); - return fineLavori; } - public FineLavori findByProtocollo(long companyId, long groupId, String protocollo) - throws PortalException, SystemException { + @Override + public FineLavori findByProtocollo(long companyId, long groupId, String protocollo) throws PortalException, + SystemException { return fineLavoriPersistence.findByC_G_Protocollo(companyId, groupId, protocollo); } - public FineLavori fetchByProtocollo(long companyId, long groupId, String protocollo) - throws PortalException, SystemException { + @Override + public FineLavori fetchByProtocollo(long companyId, long groupId, String protocollo) throws PortalException, + SystemException { return fineLavoriPersistence.fetchByC_G_Protocollo(companyId, groupId, protocollo); } + @Override public FineLavori fetchByProtocollo(String protocollo) throws PortalException, SystemException { return fineLavoriPersistence.fetchByProtocollo(protocollo); } + @Override public List findByIntPraticaId(long intPraticaId, int start, int end, OrderByComparator orderByComparator) throws SystemException { return fineLavoriPersistence.findByIntPraticaId(intPraticaId, start, end, orderByComparator); } + @Override public int countByIntPraticaId(long intPraticaId) throws SystemException { return fineLavoriPersistence.countByIntPraticaId(intPraticaId); } - public List findByIntPraticaId_Parziale(long intPraticaId, boolean parziale, int start, - int end, OrderByComparator orderByComparator) throws SystemException { + @Override + public List findByIntPraticaId_Parziale(long intPraticaId, boolean parziale, int start, int end, + OrderByComparator orderByComparator) throws SystemException { - return fineLavoriPersistence.findByIntPraticaId_Parziale(intPraticaId, parziale, start, end, - orderByComparator); + return fineLavoriPersistence.findByIntPraticaId_Parziale(intPraticaId, parziale, start, end, orderByComparator); } + @Override public int countByIntPraticaId_Parziale(long intPraticaId, boolean parziale) throws SystemException { return fineLavoriPersistence.countByIntPraticaId_Parziale(intPraticaId, parziale); } - public List findByIntPraticaId_Completata(long intPraticaId, boolean completata, int start, - int end, OrderByComparator orderByComparator) throws SystemException { + @Override + public List findByIntPraticaId_Completata(long intPraticaId, boolean completata, int start, int end, + OrderByComparator orderByComparator) throws SystemException { return fineLavoriPersistence.findByIntPraticaId_Completata(intPraticaId, completata, start, end, orderByComparator); } + @Override public int countByIntPraticaId_Completata(long intPraticaId, boolean completata) throws SystemException { return fineLavoriPersistence.countByIntPraticaId_Completata(intPraticaId, completata); } + @Override public List findByIntPraticaId_CodiceFiscale(long intPraticaId, String codiceFiscaleDelegato, int start, int end, OrderByComparator orderByComparator) throws SystemException { - return fineLavoriPersistence.findByIntPraticaId_CodiceFiscale(intPraticaId, codiceFiscaleDelegato, - start, end, orderByComparator); + return fineLavoriPersistence.findByIntPraticaId_CodiceFiscale(intPraticaId, codiceFiscaleDelegato, start, end, + orderByComparator); } + @Override public int countByIntPraticaId_CodiceFiscale(long intPraticaId, String codiceFiscaleDelegato) throws SystemException { return fineLavoriPersistence.countByIntPraticaId_CodiceFiscale(intPraticaId, codiceFiscaleDelegato); } - public List findByCodiceFiscale_Completata(String codiceFiscaleDelegato, boolean completata, - int start, int end, OrderByComparator orderByComparator) throws SystemException { + @Override + public List findByCodiceFiscale_Completata(String codiceFiscaleDelegato, boolean completata, int start, + int end, OrderByComparator orderByComparator) throws SystemException { - return fineLavoriPersistence.findByCodiceFiscale_Completata(codiceFiscaleDelegato, completata, start, - end, orderByComparator); + return fineLavoriPersistence.findByCodiceFiscale_Completata(codiceFiscaleDelegato, completata, start, end, + orderByComparator); } - public int countByCodiceFiscale_Completata(String codiceFiscaleDelegato, boolean completata) - throws SystemException { + @Override + public int countByCodiceFiscale_Completata(String codiceFiscaleDelegato, boolean completata) throws SystemException { return fineLavoriPersistence.countByCodiceFiscale_Completata(codiceFiscaleDelegato, completata); } + @Override public List findByIntPraticaId_Parziale_Completata(long intPraticaId, boolean parziale, - boolean completata, int start, int end, OrderByComparator orderByComparator) - throws SystemException { + boolean completata, int start, int end, OrderByComparator orderByComparator) throws SystemException { - return fineLavoriPersistence.findByIntPraticaId_Parziale_Completata(intPraticaId, parziale, - completata, start, end, orderByComparator); + return fineLavoriPersistence.findByIntPraticaId_Parziale_Completata(intPraticaId, parziale, completata, start, + end, orderByComparator); } + @Override public int countByIntPraticaId_Parziale_Completata(long intPraticaId, boolean parziale, boolean completata) throws SystemException { - return fineLavoriPersistence.countByIntPraticaId_Parziale_Completata(intPraticaId, parziale, - completata); + return fineLavoriPersistence.countByIntPraticaId_Parziale_Completata(intPraticaId, parziale, completata); } + @Override public List findByIntPraticaId_Parziale_leFineLavoriId(long fineLavoriId, long intPraticaId, boolean parziale, int start, int end, OrderByComparator orderByComparator) throws SystemException { @@ -509,22 +420,22 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.lt("fineLavoriId", fineLavoriId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("parziale", parziale)); - return dynamicQuery(dynamicQuery, start, end, orderByComparator); } - public int countByIntPraticaId_Parziale_leFineLavoriId(long fineLavoriId, long intPraticaId, - boolean parziale) throws SystemException { + @Override + public int countByIntPraticaId_Parziale_leFineLavoriId(long fineLavoriId, long intPraticaId, boolean parziale) + throws SystemException { DynamicQuery dynamicQuery = dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.lt("fineLavoriId", fineLavoriId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("parziale", parziale)); - List results = dynamicQuery(dynamicQuery); - return results.isEmpty() ? 0 : results.size(); + return results.size(); } + @Override public List findFineLavoriCompleteNotProtocollo(int start, int end) throws SystemException { DynamicQuery dynamicQuery = getDynamicQueryFineLavoriCompleteNotProtocollo(); @@ -532,6 +443,7 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { return fineLavoriPersistence.findWithDynamicQuery(dynamicQuery, start, end); } + @Override public int countFineLavoriCompleteNotProtocollo() throws SystemException { DynamicQuery dynamicQuery = getDynamicQueryFineLavoriCompleteNotProtocollo(); @@ -550,6 +462,7 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { return dynamicQuery; } + @Override public List findFineLavoriCompleteNotGestite(int start, int end) throws SystemException { DynamicQuery dynamicQuery = getDynamicQueryFineLavoriCompleteNotGestite(); @@ -557,6 +470,7 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { return fineLavoriPersistence.findWithDynamicQuery(dynamicQuery, start, end); } + @Override public int countFineLavoriCompleteNotGestite() throws SystemException { DynamicQuery dynamicQuery = getDynamicQueryFineLavoriCompleteNotGestite(); @@ -573,28 +487,25 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { return dynamicQuery; } + @Override public List findIntPraticaByFineLavori() throws PortalException, SystemException { DynamicQuery dynamicQuery = fineLavoriLocalService.dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("completata", true)); - dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil - .property("intPraticaId"))); + dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("intPraticaId"))); List ids = fineLavoriPersistence.findWithDynamicQuery(dynamicQuery); - return ids; } - public List findIntPraticaByFineLavori(String codiceFiscaleDelegatoCollaudo) - throws PortalException, SystemException { + @Override + public List findIntPraticaByFineLavori(String codiceFiscaleDelegatoCollaudo) throws PortalException, + SystemException { DynamicQuery dynamicQuery = fineLavoriLocalService.dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("completata", true)); - dynamicQuery.add(RestrictionsFactoryUtil.ilike("codiceFiscaleDelegatoCollaudo", - codiceFiscaleDelegatoCollaudo)); - dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil - .property("intPraticaId"))); + dynamicQuery.add(RestrictionsFactoryUtil.ilike("codiceFiscaleDelegatoCollaudo", codiceFiscaleDelegatoCollaudo)); + dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("intPraticaId"))); List ids = fineLavoriPersistence.findWithDynamicQuery(dynamicQuery); - return ids; } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/HistoryWorkflowActionLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/HistoryWorkflowActionLocalServiceImpl.java index 91d568eb..b8169489 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/HistoryWorkflowActionLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/HistoryWorkflowActionLocalServiceImpl.java @@ -1,14 +1,12 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ @@ -30,42 +28,41 @@ import com.liferay.portal.kernel.exception.SystemException; * The implementation of the history workflow action local service. * *

- * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.service.HistoryWorkflowActionLocalService} interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.HistoryWorkflowActionLocalService} interface. * *

- * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM. + * This is a local service. Methods of this service will not have security checks based on the propagated JAAS + * credentials because this service can only be accessed from within the same VM. *

* * @author Davide Barbagallo, 3F Consulting * @see it.tref.liferay.portos.bo.service.base.HistoryWorkflowActionLocalServiceBaseImpl * @see it.tref.liferay.portos.bo.service.HistoryWorkflowActionLocalServiceUtil */ -public class HistoryWorkflowActionLocalServiceImpl - extends HistoryWorkflowActionLocalServiceBaseImpl { +public class HistoryWorkflowActionLocalServiceImpl extends HistoryWorkflowActionLocalServiceBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link it.tref.liferay.portos.bo.service.HistoryWorkflowActionLocalServiceUtil} to access the history workflow action local service. + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.HistoryWorkflowActionLocalServiceUtil} to access the history workflow action + * local service. */ - - public List findByIntPratica(long intPraticaId, int sort) throws SystemException{ - + + @Override + public List findByIntPratica(long intPraticaId, int sort) throws SystemException { + DynamicQuery query = DynamicQueryFactoryUtil.forClass(HistoryWorkflowAction.class); query.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); - if (sort == 0) + if (sort == 0) { query.addOrder(OrderFactoryUtil.asc("createDate")); - else + } else { query.addOrder(OrderFactoryUtil.desc("createDate")); + } return HistoryWorkflowActionLocalServiceUtil.dynamicQuery(query); - -// return historyWorkflowActionPersistence.findByIntPratica(intPraticaId); } @Override - public List findByIntPratica(long intPraticaId) - throws SystemException { - // TODO Auto-generated method stub + public List findByIntPratica(long intPraticaId) throws SystemException { + return historyWorkflowActionPersistence.findByIntPratica(intPraticaId); } - -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/InfoFascicoloLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/InfoFascicoloLocalServiceImpl.java index f9d722ce..00c41438 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/InfoFascicoloLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/InfoFascicoloLocalServiceImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.service.impl; @@ -27,13 +27,12 @@ import com.liferay.portal.service.ServiceContext; * The implementation of the info fascicolo local service. * *

- * All custom service methods should be put in this class. Whenever methods are added, rerun - * ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.InfoFascicoloLocalService} interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.InfoFascicoloLocalService} interface. * *

- * This is a local service. Methods of this service will not have security checks based on the - * propagated JAAS credentials because this service can only be accessed from within the same VM. + * This is a local service. Methods of this service will not have security checks based on the propagated JAAS + * credentials because this service can only be accessed from within the same VM. *

* * @author Davide Barbagallo, 3F Consulting @@ -41,56 +40,56 @@ import com.liferay.portal.service.ServiceContext; * @see it.tref.liferay.portos.bo.service.InfoFascicoloLocalServiceUtil */ public class InfoFascicoloLocalServiceImpl extends InfoFascicoloLocalServiceBaseImpl { - /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link - * it.tref.liferay.portos.bo.service.InfoFascicoloLocalServiceUtil} to access the info fascicolo - * local service. - */ - - public InfoFascicolo addInfoFascicolo(long intPraticaId, String numeroProgetto, ServiceContext serviceContext) - throws SystemException, PortalException { - return addInfoFascicolo(intPraticaId, numeroProgetto, false, serviceContext); - } - - public InfoFascicolo addInfoFascicolo(long intPraticaId, String numeroProgetto, boolean alreadyImported, - ServiceContext serviceContext) throws SystemException, PortalException { - - User user = userLocalService.getUser(serviceContext.getUserId()); - Date now = new Date(); - - InfoFascicolo infoFascicolo = - infoFascicoloLocalService.createInfoFascicolo(counterLocalService.increment(InfoFascicolo.class.getName())); - - infoFascicolo.setCompanyId(serviceContext.getCompanyId()); - infoFascicolo.setGroupId(serviceContext.getScopeGroupId()); - infoFascicolo.setUserId(serviceContext.getUserId()); - infoFascicolo.setUserName(user.getScreenName()); - infoFascicolo.setCreateDate(serviceContext.getCreateDate(now)); - infoFascicolo.setModifiedDate(serviceContext.getModifiedDate(now)); - - infoFascicolo.setIntPraticaId(intPraticaId); - infoFascicolo.setNumeroProgetto(numeroProgetto); - infoFascicolo.setAlreadyImported(alreadyImported); - - return infoFascicolo; - - } - - public InfoFascicolo findByIntPratica(long intPraticaId) throws SystemException, NoSuchInfoFascicoloException { - return infoFascicoloPersistence.findByIntPratica(intPraticaId); - } - - public InfoFascicolo fetchByIntPratica(long intPraticaId) throws SystemException, NoSuchInfoFascicoloException { - return infoFascicoloPersistence.fetchByIntPratica(intPraticaId); - } - - public InfoFascicolo updateAlreadyImportedField(long infoFascicoloId) throws NoSuchInfoFascicoloException, - SystemException { - InfoFascicolo infoFascicolo = infoFascicoloPersistence.findByPrimaryKey(infoFascicoloId); - infoFascicolo.setAlreadyImported(true); - return infoFascicoloLocalService.updateInfoFascicolo(infoFascicolo); - } - + /* + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.InfoFascicoloLocalServiceUtil} to access the info fascicolo local service. + */ + + @Override + public InfoFascicolo addInfoFascicolo(long intPraticaId, String numeroProgetto, ServiceContext serviceContext) + throws SystemException, PortalException { + + return addInfoFascicolo(intPraticaId, numeroProgetto, false, serviceContext); + } + + @Override + public InfoFascicolo addInfoFascicolo(long intPraticaId, String numeroProgetto, boolean alreadyImported, + ServiceContext serviceContext) throws SystemException, PortalException { + + User user = userLocalService.getUser(serviceContext.getUserId()); + Date now = new Date(); + InfoFascicolo infoFascicolo = infoFascicoloLocalService.createInfoFascicolo(counterLocalService + .increment(InfoFascicolo.class.getName())); + infoFascicolo.setCompanyId(serviceContext.getCompanyId()); + infoFascicolo.setGroupId(serviceContext.getScopeGroupId()); + infoFascicolo.setUserId(serviceContext.getUserId()); + infoFascicolo.setUserName(user.getScreenName()); + infoFascicolo.setCreateDate(serviceContext.getCreateDate(now)); + infoFascicolo.setModifiedDate(serviceContext.getModifiedDate(now)); + infoFascicolo.setIntPraticaId(intPraticaId); + infoFascicolo.setNumeroProgetto(numeroProgetto); + infoFascicolo.setAlreadyImported(alreadyImported); + return infoFascicolo; + } + + @Override + public InfoFascicolo findByIntPratica(long intPraticaId) throws SystemException, NoSuchInfoFascicoloException { + + return infoFascicoloPersistence.findByIntPratica(intPraticaId); + } + + @Override + public InfoFascicolo fetchByIntPratica(long intPraticaId) throws SystemException, NoSuchInfoFascicoloException { + + return infoFascicoloPersistence.fetchByIntPratica(intPraticaId); + } + + @Override + public InfoFascicolo updateAlreadyImportedField(long infoFascicoloId) throws NoSuchInfoFascicoloException, + SystemException { + + InfoFascicolo infoFascicolo = infoFascicoloPersistence.findByPrimaryKey(infoFascicoloId); + infoFascicolo.setAlreadyImported(true); + return infoFascicoloLocalService.updateInfoFascicolo(infoFascicolo); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java index 6e48bbfc..729d860e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java @@ -15,19 +15,16 @@ package it.tref.liferay.portos.bo.service.impl; import it.mwg.sismica.bo.util.SismicaUtil; import it.tref.liferay.portos.bo.NoSuchIntPraticaException; import it.tref.liferay.portos.bo.model.AllegatoManuale; -import it.tref.liferay.portos.bo.model.Asseverazione; import it.tref.liferay.portos.bo.model.Avviso; import it.tref.liferay.portos.bo.model.Collaudo; import it.tref.liferay.portos.bo.model.Comune; import it.tref.liferay.portos.bo.model.Comunicazione; import it.tref.liferay.portos.bo.model.ControlloPratica; -import it.tref.liferay.portos.bo.model.Delega; import it.tref.liferay.portos.bo.model.DettPratica; import it.tref.liferay.portos.bo.model.DocAggiuntiva; import it.tref.liferay.portos.bo.model.DocPratica; import it.tref.liferay.portos.bo.model.FineLavori; import it.tref.liferay.portos.bo.model.IntPratica; -import it.tref.liferay.portos.bo.model.Pagamento; import it.tref.liferay.portos.bo.model.ParereGeologo; import it.tref.liferay.portos.bo.model.Provincia; import it.tref.liferay.portos.bo.model.Soggetto; @@ -43,7 +40,6 @@ import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.StoricoSoggettoPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; import it.tref.liferay.portos.bo.service.base.IntPraticaLocalServiceBaseImpl; -import it.tref.liferay.portos.bo.service.persistence.IntPraticaActionableDynamicQuery; import it.tref.liferay.portos.bo.service.persistence.IntPraticaFinderUtil; import it.tref.liferay.portos.bo.shared.bean.FirmeBean; import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants; @@ -109,18 +105,11 @@ import com.liferay.portal.kernel.workflow.WorkflowException; import com.liferay.portal.kernel.workflow.WorkflowHandlerRegistryUtil; import com.liferay.portal.kernel.workflow.WorkflowTask; import com.liferay.portal.model.User; -import com.liferay.portal.model.WorkflowInstanceLink; import com.liferay.portal.security.permission.ActionKeys; import com.liferay.portal.security.permission.PermissionThreadLocal; import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil; -import com.liferay.portal.util.PortalUtil; -import com.liferay.portal.workflow.kaleo.model.KaleoInstance; -import com.liferay.portal.workflow.kaleo.model.KaleoInstanceToken; -import com.liferay.portal.workflow.kaleo.model.KaleoLog; -import com.liferay.portal.workflow.kaleo.model.KaleoTaskAssignmentInstance; -import com.liferay.portal.workflow.kaleo.model.KaleoTaskInstanceToken; import com.liferay.portlet.documentlibrary.NoSuchFolderException; /** @@ -156,24 +145,20 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { @Override public Map> findSorteggiabiliNew(long companyId, Date dtSorteggio) throws SystemException, PortalException { + HashMap> ret = new HashMap<>(); List lista = new ArrayList(); - int dow = Integer.parseInt(ConfigurazioneServiceUtil.findByC_ChiaveString(companyId, ConfigurazioneConstants.DAY_OF_WEEK_SORTEGGIO)); - Date[] date = SismicaUtil.getWeekInterval(dow, dtSorteggio); - DynamicQuery dq = intPraticaLocalService.dynamicQuery(); dq.add(PropertyFactoryUtil.forName("companyId").eq(companyId)); dq.add(PropertyFactoryUtil.forName("status").eq(WorkflowConstants.STATUS_DRAFT)); dq.add(PropertyFactoryUtil.forName("statoPratica").eq(StatoPraticaConstants.CONFORME)); - Disjunction or = RestrictionsFactoryUtil.disjunction(); or.add(RestrictionsFactoryUtil.eq("tipoProcedura", Constants.PROCEDURA_B)); or.add(RestrictionsFactoryUtil.eq("tipoProcedura", Constants.PROCEDURA_B1)); dq.add(or); - dq.add(PropertyFactoryUtil.forName("dtPratica").between(date[0], date[1])); dq.add(PropertyFactoryUtil.forName("dtSorteggio").isNull()); try { @@ -212,7 +197,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { ConfigurazioneConstants.DAY_OF_WEEK_SORTEGGIO)); Date[] date = SismicaUtil.getWeekInterval(dow, dtSorteggio); - DynamicQuery dq = intPraticaLocalService.dynamicQuery(); dq.add(PropertyFactoryUtil.forName("companyId").eq(companyId)); dq.add(PropertyFactoryUtil.forName("status").eq(WorkflowConstants.STATUS_DRAFT)); @@ -220,7 +204,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { dq.add(PropertyFactoryUtil.forName("tipoProcedura").eq(Constants.PROCEDURA_B1)); dq.add(PropertyFactoryUtil.forName("dtPratica").between(date[0], date[1])); dq.add(PropertyFactoryUtil.forName("dtSorteggio").isNull()); - try { lista = intPraticaPersistence.findWithDynamicQuery(dq); } catch (SystemException e) { @@ -251,32 +234,23 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { User user = userLocalService.getUser(serviceContext.getUserId()); Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(territorioId); Date now = new Date(); - IntPratica intPratica = intPraticaLocalService.createIntPratica(counterLocalService.increment(IntPratica.class .getName())); - intPratica.setCompanyId(serviceContext.getCompanyId()); - // intPratica.setGroupId(serviceContext.getScopeGroupId()); intPratica.setGroupId(territorio.getGroupId()); intPratica.setUserId(serviceContext.getUserId()); - // intPratica.setUserName(user.getFullName()); intPratica.setUserName(user.getScreenName()); intPratica.setCreateDate(serviceContext.getCreateDate(now)); intPratica.setModifiedDate(serviceContext.getModifiedDate(now)); - // intPratica.setTipoPratica(Constants.PRATICA_ZONE.get(territorio.getZona())); intPratica.setTipoPratica(Constants.PRATICA_ZONE.get(tipoProcedura)); intPratica.setTerritorioId(territorioId); intPratica.setTipoProcedura(tipoProcedura); - // in avvio in draft -> pratiche sempre controllate nella loro vita intPratica.setStatus(WorkflowConstants.STATUS_ANY); intPratica = intPraticaPersistence.update(intPratica); - Indexer indexer = IndexerRegistryUtil.getIndexer(IntPratica.class); indexer.reindex(intPratica); - return intPratica; - } @Override @@ -286,14 +260,8 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { int esitoControllo, Date dtPratica, ServiceContext serviceContext) throws PortalException, SystemException { Date now = new Date(); - Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(territorioId); - - validate(serviceContext.getScopeGroupId(), 0L, tipoPratica, territorioId, dtSorteggio, statoPratica, - numeroProgetto, validata, esitoControllo, dtPratica); - IntPratica intPratica = intPraticaPersistence.create(counterLocalService.increment(IntPratica.class.getName())); - intPratica.setCompanyId(serviceContext.getCompanyId()); intPratica.setUserId(userId); if (userId != 0) { @@ -302,12 +270,9 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { } else { intPratica.setUserName(userName); } - intPratica.setCreateDate(serviceContext.getCreateDate(now)); intPratica.setModifiedDate(serviceContext.getModifiedDate(now)); - // intPratica.setGroupId(serviceContext.getScopeGroupId()); intPratica.setGroupId(territorio.getGroupId()); - intPratica.setTipoPratica(tipoPratica); intPratica.setTerritorioId(territorioId); intPratica.setTipoProcedura(tipoProcedura); @@ -317,63 +282,10 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { intPratica.setValidata(validata); intPratica.setEsitoControllo(esitoControllo); intPratica.setDtPratica(dtPratica); - intPratica = intPraticaPersistence.update(intPratica); - return intPratica; } - @Override - public void clearDb() throws Exception { - - User user = PermissionThreadLocal.getPermissionChecker().getUser(); - if (PortalUtil.isCompanyAdmin(user)) { - IntPraticaActionableDynamicQuery ipadq = new IntPraticaActionableDynamicQuery() { - - @Override - protected void addOrderCriteria(DynamicQuery dynamicQuery) { - - dynamicQuery.addOrder(OrderFactoryUtil.asc("createDate")); - super.addOrderCriteria(dynamicQuery); - } - - @Override - protected void performAction(Object item) throws PortalException, SystemException { - - IntPratica intPratica = (IntPratica) item; - intPraticaLocalService.deleteIntPratica(intPratica, true); - } - }; - ipadq.setCompanyId(user.getCompanyId()); - ipadq.performActions(); - - counterLocalService.reset(AllegatoManuale.class.getName()); - counterLocalService.reset(Asseverazione.class.getName()); - counterLocalService.reset(Avviso.class.getName()); - counterLocalService.reset(Collaudo.class.getName()); - counterLocalService.reset(Comunicazione.class.getName()); - counterLocalService.reset(ControlloPratica.class.getName()); - counterLocalService.reset(Delega.class.getName()); - counterLocalService.reset(DettPratica.class.getName()); - counterLocalService.reset(DocPratica.class.getName()); - counterLocalService.reset(DocAggiuntiva.class.getName()); - counterLocalService.reset(FineLavori.class.getName()); - counterLocalService.reset(IntPratica.class.getName()); - counterLocalService.reset(Pagamento.class.getName()); - counterLocalService.reset(ParereGeologo.class.getName()); - counterLocalService.reset(Sorteggio.class.getName()); - counterLocalService.reset(StoricoSoggettoPratica.class.getName()); - counterLocalService.reset(Tempistica.class.getName()); - counterLocalService.reset(KaleoInstance.class.getName()); - counterLocalService.reset(KaleoInstanceToken.class.getName()); - counterLocalService.reset(KaleoLog.class.getName()); - counterLocalService.reset(KaleoTaskInstanceToken.class.getName()); - counterLocalService.reset(KaleoTaskAssignmentInstance.class.getName()); - counterLocalService.reset(WorkflowInstanceLink.class.getName()); - - } - } - @Override @Indexable(type = IndexableType.DELETE) public IntPratica deleteIntPratica(IntPratica intPratica, boolean forced) throws SystemException, PortalException { @@ -389,112 +301,78 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { dettPraticaLocalService.deleteDettPratica(dettPratica); } _log.info("Deleted dettPraticas"); - - // List soggetti = - // soggettoLocalService.findByIntPratica(intPratica.getIntPraticaId()); - // for (Soggetto soggetto : soggetti) { - // soggettoLocalService.deleteSoggetto(soggetto); - // } - // - // List allegati = - // docPraticaLocalService.findByIntPratica(intPratica.getIntPraticaId()); - // for (DocPratica allegato : allegati) { - // docPraticaLocalService.deleteDocPratica(allegato); - // } - List avvisi = avvisoLocalService.findByIntPratica(intPratica.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); for (Avviso avviso : avvisi) { avvisoLocalService.deleteAvviso(avviso); } _log.info("Deleted avvisi"); - List allegatiManuali = allegatoManualeLocalService.findByIntPratica(intPratica .getIntPraticaId()); for (AllegatoManuale allegatoManuale : allegatiManuali) { allegatoManualeLocalService.deleteAllegatoManuale(allegatoManuale); } _log.info("Deleted avvisi manuali"); - List collaudi = collaudoLocalService.findByIntPraticaId(intPratica.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); for (Collaudo collaudo : collaudi) { collaudoLocalService.deleteCollaudo(collaudo); } _log.info("Deleted collaudi"); - List fineLavori = fineLavoriLocalService.findByIntPraticaId(intPratica.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); for (FineLavori fineLavoro : fineLavori) { fineLavoriLocalService.deleteFineLavori(fineLavoro); } - List comunicazioni = comunicazioneLocalService .findByIntPratica(intPratica.getIntPraticaId()); for (Comunicazione comunicazione : comunicazioni) { comunicazioneLocalService.deleteComunicazione(comunicazione); } _log.info("Deleted comunicazioni"); - List controlloPratiche = controlloPraticaPersistence.findByIntPraticaId(intPratica .getIntPraticaId()); for (ControlloPratica controlloPratica : controlloPratiche) { controlloPraticaLocalService.deleteControlloPratica(controlloPratica); } _log.info("Deleted controlli pratiche"); - List docaggiuntive = docAggiuntivaLocalService.findByIntPratica( intPratica.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); for (DocAggiuntiva docAggiuntiva : docaggiuntive) { docAggiuntivaLocalService.deleteDocAggiuntiva(docAggiuntiva); } _log.info("Deleted doc_aggiuntiva"); - List pareriGeologo = parereGeologoLocalService.findByIntPraticaId( intPratica.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS); for (ParereGeologo parereGeologo : pareriGeologo) { parereGeologoLocalService.deleteParereGeologo(parereGeologo); } _log.info("Deleted pareri_geologo"); - List storicoSoggetti = storicoSoggettoPraticaLocalService.findByIntPratica( intPratica.getCompanyId(), intPratica.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS); for (StoricoSoggettoPratica storicoSoggettoPratica : storicoSoggetti) { storicoSoggettoPraticaLocalService.deleteStoricoSoggettoPratica(storicoSoggettoPratica); } _log.info("Deleted storico_soggetti"); - Sorteggio sorteggio = sorteggioLocalService.findByIntPratica(intPratica.getIntPraticaId()); if (sorteggio != null) { sorteggioLocalService.deleteSorteggio(sorteggio); } _log.info("Deleted sorteggi"); - List tempistiche = tempisticaPersistence.findByIntPratica(intPratica.getIntPraticaId()); for (Tempistica tempistica : tempistiche) { tempisticaLocalService.deleteTempistica(tempistica); } _log.info("Deleted tempistiche"); - _log.info("*************************************"); - return intPraticaPersistence.remove(intPratica); - } - - else { + } else { DettPratica dettPratica = dettPraticaLocalService.getLastEditableByIntPratica(intPratica.getIntPraticaId()); - // if( Validator.isNotNull(dettPratica) && dettPratica.getStatus() - // != - // WorkflowConstants.STATUS_APPROVED){ se lastEditable non puo' - // essere approved if (Validator.isNotNull(dettPratica)) { - dettPratica = dettPraticaLocalService.deleteDettPratica(dettPratica); } - return intPratica; } - } @Override @@ -502,7 +380,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { public IntPratica deleteIntPratica(IntPratica intPratica) throws SystemException, PortalException { return deleteIntPratica(intPratica, false); - } @Override @@ -512,20 +389,16 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { IntPratica intPraticaToClone = intPraticaLocalService.getIntPratica(intPraticaId); IntPratica intPraticaCloned = addIntPratica(intPraticaToClone.getTerritorioId(), intPraticaToClone.getTipoProcedura(), serviceContext); - intPraticaCloned = cloneData(intPraticaCloned, intPraticaToClone); - DettPratica dettPraticaToClone = dettPraticaLocalService.getLastCompletedByIntPratica(intPraticaId); DettPratica dettPraticaCloned = dettPraticaLocalService.addDettPraticaClonedToIntPratica( intPraticaCloned.getIntPraticaId(), dettPraticaToClone.getDettPraticaId(), StringPool.BLANK, serviceContext); - List soggettiValidi = soggettoLocalService.getValidByIntPratica(intPraticaId); for (Soggetto soggettoToClone : soggettiValidi) { soggettoLocalService.cloneSoggetto(serviceContext.getUserId(), dettPraticaCloned.getDettPraticaId(), intPraticaCloned.getIntPraticaId(), soggettoToClone, serviceContext); } - return intPraticaCloned; } @@ -533,11 +406,8 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { intPraticaCloned.setCodiceFiscaleDelegatoFineLavori(intPraticaToClone.getCodiceFiscaleDelegatoFineLavori()); intPraticaCloned.setCodiceFiscaleDelegatoCollaudo(intPraticaToClone.getCodiceFiscaleDelegatoCollaudo()); - intPraticaCloned = intPraticaPersistence.update(intPraticaCloned); - return intPraticaCloned; - } @Override @@ -549,48 +419,10 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { intPratica.setCodiceFiscaleDelegatoFineLavori(codiceFiscaleDelegatoFineLavori); intPratica.setCodiceFiscaleDelegatoCollaudo(codiceFiscaleDelegatoCollaudo); intPratica.setControlloObbligatorio(isControlloObbligatorio); - intPratica = intPraticaLocalService.updateIntPratica(intPratica); - return intPratica; } - // public IntPratica pagaInvia(long intPraticaId, int pagAdeguamentoSismico, - // int pagAltro, int - // pagMiglioramentoSismico, - // int pagNuovaCostruzione, boolean pagNuoveCostruzioni, boolean - // pagRiparazioneInterventoLocale, - // boolean pagVarianti, String importoSpeseIstruttoria, String - // codiceFiscaleCommittente, String - // currentURL, - // ServiceContext serviceContext) throws SystemException, PortalException { - // - // DettPratica dettPratica = - // dettPraticaLocalService.getLastEditableByIntPratica(intPraticaId); - // dettPratica = - // dettPraticaLocalService.updateDettPraticaPagamento(dettPratica.getDettPraticaId(), - // pagAdeguamentoSismico, - // pagAltro, pagMiglioramentoSismico, pagNuovaCostruzione, - // pagNuoveCostruzioni, - // pagRiparazioneInterventoLocale, pagVarianti, importoSpeseIstruttoria, - // serviceContext); - // intPraticaLocalService.updateStatus(intPraticaId, - // WorkflowConstants.STATUS_INCOMPLETE); - // dettPratica.setStatus(WorkflowConstants.STATUS_INCOMPLETE); - // dettPraticaLocalService.updateDettPratica(dettPratica); - // - // BigDecimal importoBolli = - // PagamentiUtil.getImportoBolli(dettPratica.getCompanyId(), - // dettPratica.getDettPraticaId(), - // dettPratica.getTipoIntegrazione()); - // PagamentiUtil.nuovoPagamento(currentURL, dettPratica.getDettPraticaId(), - // importoBolli.toString(), - // importoSpeseIstruttoria, codiceFiscaleCommittente, serviceContext); - // IntPratica intPratica = - // intPraticaLocalService.getIntPratica(intPraticaId); - // return intPratica; - // } - @Override public IntPratica fetchIntPratica(long intPraticaId) throws SystemException, PortalException { @@ -615,8 +447,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { private DynamicQuery getDynamicQueryFascicoliNotProgetto() { DynamicQuery dynamicQuery = intPraticaLocalService.dynamicQuery(); - // dynamicQuery.add(RestrictionsFactoryUtil.eq("status", - // WorkflowConstants.STATUS_INCOMPLETE)); dynamicQuery.add(RestrictionsFactoryUtil.eq("validata", true)); Disjunction or = RestrictionsFactoryUtil.disjunction(); or.add(RestrictionsFactoryUtil.eq("numeroProgetto", StringPool.BLANK)); @@ -636,10 +466,7 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { intPratica.setStatus(WorkflowConstants.STATUS_DRAFT); intPratica.setStatoPratica(StatoPraticaConstants.VIDIMATA); intPratica = updateIntPratica(intPratica); - - // inviaMailNotifica(intPratica); // SUAP } - return intPratica; } @@ -647,35 +474,28 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId()); - DettPratica dettPratica = dettPraticaLocalService.getLastCompletedByIntPratica(intPratica.getIntPraticaId()); - String eMail = StringPool.BLANK; if (dettPratica.getSuap()) { eMail = comune.getMailSuap(); } else { eMail = comune.getMailSue(); } - String[] to = { eMail }; String[] cc = new String[0]; String[] ccn = new String[0]; - String url = FascicoloURLUtil.getFascicoloFEViewURL(intPratica.getCompanyId(), intPratica.getIntPraticaId(), StringPool.BLANK, StringPool.BLANK); - JSONObject templateVariables = JSONFactoryUtil.createJSONObject(); templateVariables.put("cont", StringPool.BLANK); templateVariables.put("anno", StringPool.BLANK); templateVariables.put("dataVidimazione", FastDateFormatFactoryUtil.getSimpleDateFormat("dd/MM/yyyy HH:mm") .format(intPratica.getDtPratica())); templateVariables.put("link", url); - ServiceContext serviceContext = new ServiceContext(); serviceContext.setScopeGroupId(intPratica.getGroupId()); serviceContext.setCompanyId(intPratica.getCompanyId()); serviceContext.setUserId(intPratica.getUserId()); - MailUtil.invioMailNotifica(intPratica.getIntPraticaId(), 0l, intPratica.getIntPraticaId(), IntPratica.class.getName(), to, cc, ccn, "INVIO-SUAP", templateVariables, null, serviceContext); } @@ -690,7 +510,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { } else { intPratica.setDtSospensione(null); } - return intPraticaLocalService.updateIntPratica(intPratica); } @@ -701,40 +520,25 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId); intPratica.setModifiedDate(new Date()); - User oldUser = UserLocalServiceUtil.getUser(intPratica.getUserId()); User newUser = UserLocalServiceUtil.getUser(soggettoId); - // sostituisci int pratica intPratica.setUserId(soggettoId); intPratica.setUserName(newUser.getFullName()); - /* * TODO: verificare che sia veramente come implementato sotto oppure bisogna cambiare il titolare anche di tutti * i dettPratica */ - // sostituisci dett pratica - // List dettPratiche = - // DettPraticaLocalServiceUtil.findByIntPraticaId(intPraticaId); - // for (DettPratica dettPratica : dettPratiche) { - // dettPratica.setUserId(soggettoId); - // DettPraticaLocalServiceUtil.updateDettPratica(dettPratica); - // } - DettPratica dettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPraticaId); dettPratica.setCodiceFiscaleDelegatoCommittente(newUser.getScreenName()); DettPraticaLocalServiceUtil.updateDettPratica(dettPratica); - // registra storico StoricoSoggettoPraticaLocalServiceUtil.addStoricoSoggettoPratica(intPraticaId, oldUser.getFirstName(), oldUser.getLastName(), oldUser.getScreenName(), serviceContext); - Indexer indexer = IndexerRegistryUtil.getIndexer(IntPratica.class); intPratica = updateIntPratica(intPratica); indexer.reindex(intPratica); - return intPratica; - } @Override @@ -748,12 +552,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { return intPraticaLocalService.updateIntPratica(intPratica); } - private void validate(long scopeGroupId, long l, String tipoPratica, long territorioId, Date dtSorteggio, - String statoPratica, String numeroProgetto, boolean validata, int esitoControllo, Date dtPratica) { - - // TODO Auto-generated method stub - } - @Override public IntPratica updateIntPraticaSorteggio(long intPraticaId, Date dtSorteggio) throws SystemException { @@ -765,6 +563,7 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { @Indexable(type = IndexableType.REINDEX) public IntPratica updateIntPraticaSorteggio(long intPraticaId, Date dtSorteggio, String statoPratica) throws SystemException { + IntPratica intPratica = intPraticaPersistence.fetchByPrimaryKey(intPraticaId); intPratica.setDtSorteggio(dtSorteggio); intPratica.setModifiedDate(new Date()); @@ -790,7 +589,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { public void updateStatus(long intPraticaId, int status) throws PortalException, SystemException { IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId); - if (status == WorkflowConstants.STATUS_INCOMPLETE) { intPratica.setStatus(status); } else if (status == WorkflowConstants.STATUS_APPROVED) { @@ -830,7 +628,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { PortalException { DynamicQuery dynamicQuery = createQueryProgetti(companyId, soggettoId); - return intPraticaPersistence.findWithDynamicQuery(dynamicQuery); } @@ -839,7 +636,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { PortalException { DynamicQuery dynamicQuery = createQueryProgetti(companyId, soggettoId); - return (int) intPraticaPersistence.countWithDynamicQuery(dynamicQuery); } @@ -852,10 +648,7 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { Disjunction disjunction = RestrictionsFactoryUtil.disjunction(); disjunction.add(RestrictionsFactoryUtil.eq("status", WorkflowConstants.STATUS_ANY)); disjunction.add(RestrictionsFactoryUtil.eq("status", WorkflowConstants.STATUS_INCOMPLETE)); - // disjunction.add(RestrictionsFactoryUtil.eq("status", - // WorkflowConstants.STATUS_DRAFT)); dynamicQuery.add(disjunction); - return dynamicQuery; } @@ -867,9 +660,7 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { if (ids.isEmpty()) { return Collections.emptyList(); } - DynamicQuery dynamicQuery = createQueryArchivio(companyId, soggettoId, ids); - return intPraticaPersistence.findWithDynamicQuery(dynamicQuery); } @@ -881,9 +672,7 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { if (ids.isEmpty()) { return 0; } - DynamicQuery dynamicQuery = createQueryArchivio(companyId, soggettoId, ids); - return (int) intPraticaPersistence.countWithDynamicQuery(dynamicQuery); } @@ -892,19 +681,16 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { DynamicQuery dynamicQuery = intPraticaLocalService.dynamicQuery(); dynamicQuery.add(PropertyFactoryUtil.forName("companyId").eq(companyId)); - Disjunction disjunction = RestrictionsFactoryUtil.disjunction(); disjunction.add(RestrictionsFactoryUtil.eq("status", WorkflowConstants.STATUS_EXPIRED)); disjunction.add(RestrictionsFactoryUtil.eq("status", WorkflowConstants.STATUS_IN_TRASH)); disjunction.add(RestrictionsFactoryUtil.eq("status", WorkflowConstants.STATUS_APPROVED)); disjunction.add(RestrictionsFactoryUtil.eq("statoPratica", StatoPraticaConstants.ANNULLATA)); dynamicQuery.add(disjunction); - Disjunction disjunctionSoggetti = RestrictionsFactoryUtil.disjunction(); disjunctionSoggetti.add(RestrictionsFactoryUtil.eq("userId", soggettoId)); disjunctionSoggetti.add(RestrictionsFactoryUtil.in("intPraticaId", ids)); dynamicQuery.add(disjunctionSoggetti); - return dynamicQuery; } @@ -916,9 +702,7 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { if (ids.isEmpty()) { return Collections.EMPTY_LIST; } - DynamicQuery dynamicQuery = createQueryAltriProgetti(companyId, ids); - return intPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end); } @@ -930,9 +714,7 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { if (ids.isEmpty()) { return 0; } - DynamicQuery dynamicQuery = createQueryAltriProgetti(companyId, ids); - return (int) intPraticaPersistence.countWithDynamicQuery(dynamicQuery); } @@ -941,13 +723,10 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { DynamicQuery dynamicQuery = intPraticaLocalService.dynamicQuery(); dynamicQuery.add(PropertyFactoryUtil.forName("companyId").eq(companyId)); - dynamicQuery.add(RestrictionsFactoryUtil.ne("status", WorkflowConstants.STATUS_ANY)); dynamicQuery.add(RestrictionsFactoryUtil.ne("status", WorkflowConstants.STATUS_INCOMPLETE)); dynamicQuery.add(RestrictionsFactoryUtil.ne("statoPratica", StatoPraticaConstants.ANNULLATA)); - dynamicQuery.add(RestrictionsFactoryUtil.in("intPraticaId", ids)); - return dynamicQuery; } @@ -955,42 +734,14 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { public List findByCanAddFineLavori(long companyId, String codiceFiscale, int start, int end) throws SystemException, PortalException { - // List ids = - // new - // ArrayList<>(dettPraticaLocalService.findIntPraticaByCodiceFiscaleDelegatoFineLavori(codiceFiscale)); - // if (ids.isEmpty()) { - // return Collections.emptyList(); - // } - // ids.removeAll(fineLavoriLocalService.findIntPraticaByFineLavoriParziale(false, - // ids)); - // - // if (ids.isEmpty()) { - // return Collections.emptyList(); - // } - DynamicQuery dynamicQuery = createQueryFineLavori(companyId, codiceFiscale); - return intPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end); - } @Override public int countByCanAddFineLavori(long companyId, String codiceFiscale) throws SystemException, PortalException { - // List ids = - // new - // ArrayList<>(dettPraticaLocalService.findIntPraticaByCodiceFiscaleDelegatoFineLavori(codiceFiscale)); - // if (ids.isEmpty()) { - // return 0; - // } - // ids.removeAll(fineLavoriLocalService.findIntPraticaByFineLavoriParziale(false, - // ids)); - // if (ids.isEmpty()) { - // return 0; - // } - DynamicQuery dynamicQuery = createQueryFineLavori(companyId, codiceFiscale); - return (int) intPraticaPersistence.countWithDynamicQuery(dynamicQuery); } @@ -999,15 +750,12 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { DynamicQuery dynamicQuery = intPraticaLocalService.dynamicQuery(); dynamicQuery.add(PropertyFactoryUtil.forName("companyId").eq(companyId)); - dynamicQuery.add(RestrictionsFactoryUtil.ne("status", WorkflowConstants.STATUS_ANY)); dynamicQuery.add(RestrictionsFactoryUtil.ne("status", WorkflowConstants.STATUS_INCOMPLETE)); dynamicQuery.add(RestrictionsFactoryUtil.eq("sospesa", false)); dynamicQuery.add(RestrictionsFactoryUtil.ne("statoPratica", StatoPraticaConstants.ANNULLATA)); - dynamicQuery.add(RestrictionsFactoryUtil.ilike("codiceFiscaleDelegatoFineLavori", codiceFiscale)); dynamicQuery.add(RestrictionsFactoryUtil.eq("fineLavoriTotale", false)); - return dynamicQuery; } @@ -1015,20 +763,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { public List findByCanAddCollaudo(long companyId, String codiceFiscale, int start, int end) throws SystemException, PortalException { - // List ids = fineLavoriLocalService.findIntPraticaByFineLavori(); - // if (ids.isEmpty()) { - // return Collections.emptyList(); - // } - // - // System.out.println(ids.size()); - // - // - // DynamicQuery dynamicQuery = createQueryCollaudi(companyId, - // codiceFiscale, ids); - - // return intPraticaPersistence.findWithDynamicQuery(dynamicQuery, - // start, end); - return intPraticaFinder.canAddCollaudo(codiceFiscale, start, end); } @@ -1036,17 +770,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { @Override public int countByCanAddCollaudo(long companyId, String codiceFiscale) throws SystemException, PortalException { - // List ids = fineLavoriLocalService.findIntPraticaByFineLavori(); - // if (ids.isEmpty()) { - // return 0; - // } - // - // DynamicQuery dynamicQuery = createQueryCollaudi(companyId, - // codiceFiscale, ids); - // - // return (int) - // intPraticaPersistence.countWithDynamicQuery(dynamicQuery); - return intPraticaFinder.canAddCollaudoCount(codiceFiscale); } @@ -1055,13 +778,9 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { // TODO Modificare tramite Indexer DynamicQuery dynamicQuery = intPraticaLocalService.dynamicQuery(); - // query.add(RestrictionsFactoryUtil.eq("validata", true)); - // query.add(RestrictionsFactoryUtil.eq("gestita", true)); dynamicQuery.add(RestrictionsFactoryUtil.isNotNull("dtPratica")); dynamicQuery.add(RestrictionsFactoryUtil.ne("statoPratica", StatoPraticaConstants.ANNULLATA)); - return intPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end); - } @Override @@ -1069,13 +788,9 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { // TODO Modificare tramite Indexer DynamicQuery dynamicQuery = intPraticaLocalService.dynamicQuery(); - // query.add(RestrictionsFactoryUtil.eq("validata", true)); - // query.add(RestrictionsFactoryUtil.eq("gestita", true)); dynamicQuery.add(RestrictionsFactoryUtil.isNotNull("dtPratica")); dynamicQuery.add(RestrictionsFactoryUtil.ne("statoPratica", StatoPraticaConstants.ANNULLATA)); - return (int) intPraticaPersistence.countWithDynamicQuery(dynamicQuery); - } @Override @@ -1085,13 +800,9 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { // TODO Modificare tramite Indexer DynamicQuery dynamicQuery = intPraticaLocalService.dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); - // query.add(RestrictionsFactoryUtil.eq("validata", true)); - // query.add(RestrictionsFactoryUtil.eq("gestita", true)); dynamicQuery.add(RestrictionsFactoryUtil.isNotNull("dtPratica")); dynamicQuery.add(RestrictionsFactoryUtil.ne("statoPratica", StatoPraticaConstants.ANNULLATA)); - return intPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end); - } @Override @@ -1100,13 +811,9 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { // TODO Modificare tramite Indexer DynamicQuery dynamicQuery = intPraticaLocalService.dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); - // query.add(RestrictionsFactoryUtil.eq("validata", true)); - // query.add(RestrictionsFactoryUtil.eq("gestita", true)); dynamicQuery.add(RestrictionsFactoryUtil.isNotNull("dtPratica")); dynamicQuery.add(RestrictionsFactoryUtil.ne("statoPratica", StatoPraticaConstants.ANNULLATA)); - return (int) intPraticaPersistence.countWithDynamicQuery(dynamicQuery); - } @Override @@ -1118,16 +825,11 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { if (Validator.isNull(dettPratica)) { dettPratica = dettPraticaLocalService.getLastCompletedByIntPratica(intPraticaId); } - FileEntry fileEntry = null; - long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); - Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId); - String folderName = PraticaUtil.getFolderName(dettPratica.getDettPraticaId()); - serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); Folder folder = null; try { @@ -1146,24 +848,14 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { String sha256 = DigestUtils.sha256Hex(content); String changeLog = StringPool.BLANK; fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(), - folder.getFolderId(), now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog, - content, serviceContext); - - /* - * DocPratica allegatoAnnullamento = docPraticaLocalService.addDocPratica(serviceContext.getUserId(), - * IntPratica.class.getName(), intPraticaId, intPraticaId, fileEntry.getFileEntryId(), sourceFileName, - * DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_ANNULLAMENTO_FASCICOLO, jsonFirmatari, serviceContext); - */ - // ADT BUG FE ID = 9 + folder.getFolderId(), now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title, + description, changeLog, content, serviceContext); DocPratica allegatoAnnullamento = docPraticaLocalService.addDocPraticaAnnullamento(serviceContext.getUserId(), IntPratica.class.getName(), intPraticaId, intPraticaId, fileEntry.getFileEntryId(), sourceFileName, DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_ANNULLAMENTO_FASCICOLO, sha256, jsonFirmatari, serviceContext); - intPratica.setModifiedDate(now); intPratica.setDocPraticaAnnullamentoId(allegatoAnnullamento.getDocPraticaId()); - intPratica = intPraticaLocalService.updateIntPratica(intPratica); - return fileEntry; } @@ -1175,10 +867,8 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { if (Validator.isNotNull(intPratica.getDocPraticaAnnullamentoId())) { throw new SystemException("label.error.file.annullamento.already.exist"); } - Date now = new Date(); long userId = serviceContext.getUserId(); - String tipoDocumento = "AIF"; String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(tipoDocumento); long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(intPratica.getCompanyId(), @@ -1187,22 +877,18 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { String propertiesFolder = AvvisoUtil.getAllTipoDocumentoFolderProps().get(tipoDocumento); long fileEntryIdFolder = configurazioneLocalService.findByC_ChiaveLong(intPratica.getCompanyId(), propertiesFolder); - String fileName = StringUtils.leftPad(String.valueOf(intPratica.getIntPraticaId()), 10, '0') + (Validator.isNotNull(tipoDocumento) ? StringPool.UNDERLINE + tipoDocumento : StringPool.BLANK) + StringPool.UNDERLINE + System.currentTimeMillis() + ".pdf"; - ReportDto reportDto = new ReportDto(); reportDto.setFileEntryIds(new long[] { fileEntryIdTemplate }); reportDto.setFolderId(fileEntryIdFolder); reportDto.setFileName(fileName); - reportDto.setHeader(""); + reportDto.setHeader(StringPool.BLANK); reportDto.setHeaderHeight(1); - reportDto.setFooter(""); + reportDto.setFooter(StringPool.BLANK); reportDto.setFooterHeight(1); Map parameters = new HashMap(); - - // if (Validator.isNotNull(userId)) { User user = userLocalService.getUser(userId); Soggetto titolareDigitale = soggettoLocalService.getValidByIntPratica_CodiceFiscale(intPraticaId, user.getScreenName()).get(0); @@ -1210,40 +896,24 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { "html", LanguageUtil.format(LocaleUtil.ITALIAN, "label.firma-annullamento", titolareDigitale.getDescrizioneCompleta())); - // } - reportDto.setParameters(parameters); reportDto.setShowNumberOfPage(true); reportDto.setType(ReportConstants.ReportType.VELOCITY_TO_PDF.toString()); ReportResultDto result = ReportUtil.generateReport(intPratica.getCompanyId(), userId, reportDto, null); long fileEntryId = result.getFileEntryIds()[0]; - // intPratica.setFileEntryIdAnnullamento(fileEntryId); - FirmeBean firmeBean = new FirmeBean(); String jsonFirmatari = FirmeUtil.addFirma(firmeBean, user.getScreenName()); - - // //////////////////ADT BUG FE ID = 31 - String sha256 = ""; + String sha256 = StringPool.BLANK; try { sha256 = DigestUtils.sha256Hex(dlAppLocalService.getFileEntry(fileEntryId).getContentStream()); } catch (Exception e) { } - // //////////////////// - /* - * DocPratica allegatoAnnullamento = docPraticaLocalService.addDocPratica(userId, IntPratica.class.getName(), - * intPraticaId, intPraticaId, fileEntryId, fileName, - * DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_ANNULLAMENTO_FASCICOLO, jsonFirmatari, serviceContext); - */ - DocPratica allegatoAnnullamento = docPraticaLocalService.addDocPraticaAnnullamento(userId, IntPratica.class.getName(), intPraticaId, intPraticaId, fileEntryId, fileName, DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_ANNULLAMENTO_FASCICOLO, sha256, jsonFirmatari, serviceContext); - intPratica.setModifiedDate(now); intPratica.setDocPraticaAnnullamentoId(allegatoAnnullamento.getDocPraticaId()); - intPratica = intPraticaPersistence.update(intPratica); - return intPratica; } @@ -1252,13 +922,10 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaAnnullamentoId); IntPratica intPratica = intPraticaPersistence.findByPrimaryKey(docPratica.getIntPraticaId()); - docPraticaLocalService.deleteDocPratica(docPraticaAnnullamentoId); - intPratica.setModifiedDate(new Date()); intPratica.setDtAnnullamento(null); intPratica.setDocPraticaAnnullamentoId(0l); - intPratica = intPraticaPersistence.update(intPratica); } @@ -1266,47 +933,28 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { public void completeAnnullamento(long intPraticaId) throws PortalException, SystemException { IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId); - if (Validator.isNull(intPratica.getDocPraticaAnnullamentoId())) { throw new SystemException("error.annullamento.file.not.exist"); } - Date now = new Date(); intPratica.setModifiedDate(now); intPratica.setStatoPratica(StatoPraticaConstants.ANNULLATA); intPratica.setDtAnnullamento(now); - intPratica = intPraticaLocalService.updateIntPratica(intPratica); - DettPratica dettPratica = dettPraticaLocalService.getLastCompletedByIntPratica(intPraticaId); User user = PermissionThreadLocal.getPermissionChecker().getUser(); - Territorio territorio = territorioLocalService.getTerritorio(intPratica.getTerritorioId()); - ServiceContext serviceContext = new ServiceContext(); serviceContext.setUserId(user.getUserId()); serviceContext.setScopeGroupId(territorio.getGroupId()); serviceContext.setCompanyId(territorio.getCompanyId()); - - // BUG BO ID= 9 -- ANNULLAMENTO ISTANZA - Disattivo il workflow - // boolean isWorkFlowSospendibile = - // WorkflowUtil.isWorkflowDisattivabile(intPraticaId); - // if(isWorkFlowSospendibile){ - // WorkflowUtil.attivaWorkflow(intPraticaId, territorio.getGroupId(), - // serviceContext.getUserId(), - // dettPratica.getDettPraticaId(), serviceContext, false); - // } try { DynamicQuery queryCP = DynamicQueryFactoryUtil.forClass(ControlloPratica.class); queryCP.add(RestrictionsFactoryUtil.eq("intPraticaId", intPratica.getIntPraticaId())); queryCP.addOrder(OrderFactoryUtil.desc("controlloPraticaId")); - - // queryCP.add(RestrictionsFactoryUtil.eq("dettPraticaId", - // intPratica.getIntPraticaId())); List appList = ControlloPraticaLocalServiceUtil.dynamicQuery(queryCP, QueryUtil.ALL_POS, QueryUtil.ALL_POS); if (appList != null && !appList.isEmpty()) { - for (ControlloPratica controlloPratica : appList) { _log.info("disattivazione - ControlloPraticaId=" + controlloPratica.getControlloPraticaId()); try { @@ -1321,18 +969,15 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { } } } - } catch (Exception e) { _log.error("Errore in annullamento pratica - Impossibile disattivare workflow per intPraticaId=" + intPraticaId); } - String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get( StatoPraticaConstants.ANNULLA_ISTANZA); _log.info("debugAvviso: " + propertiesTemplate); long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), propertiesTemplate); - avvisoLocalService.addAvviso(intPraticaId, StringPool.BLANK, new Date(), AvvisoUtil.TIPO_AVVISO_DIRETTO, StatoPraticaConstants.ANNULLA_ISTANZA, fileEntryIdTemplate, dettPratica.getDettPraticaId(), DettPratica.class.getName(), StringPool.BLANK, 0l, 0l, StringPool.BLANK, 0l, serviceContext); @@ -1350,30 +995,25 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { intPratica = intPraticaLocalService.updateIntPratica(intPratica); DettPratica dettPratica = dettPraticaLocalService.getLastCompletedByIntPratica(intPraticaId); User user = PermissionThreadLocal.getPermissionChecker().getUser(); - ServiceContext serviceContext = new ServiceContext(); serviceContext.setUserId(user.getUserId()); serviceContext.setScopeGroupId(controlloPratica.getGroupId()); serviceContext.setCompanyId(controlloPratica.getCompanyId()); - String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get( StatoPraticaConstants.CAMBIO_ISTRUTTORE); _log.info("debugAvviso: " + propertiesTemplate); long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), propertiesTemplate); - avvisoLocalService.addAvviso(intPraticaId, StringPool.BLANK, new Date(), AvvisoUtil.TIPO_AVVISO_DIRETTO, StatoPraticaConstants.CAMBIO_ISTRUTTORE, fileEntryIdTemplate, dettPratica.getDettPraticaId(), DettPratica.class.getName(), StringPool.BLANK, 0l, 0l, StringPool.BLANK, controlloPraticaId, serviceContext); WorkflowTask lastTask = WorkflowUtil.getLastTask(controlloPratica.getCompanyId(), controlloPratica.getGroupId(), null, controlloPratica); - if (lastTask != null && lastTask.getName().equalsIgnoreCase("Esito")) { WorkflowUtil.assegnaUltimoTask(controlloPratica.getCompanyId(), controlloPratica.getGroupId(), istruttoreId, user.getUserId(), controlloPratica); } - String jsonFormParameters = null; Map parametri = new HashMap(); parametri.put("istruttore", String.valueOf(istruttoreId)); @@ -1396,13 +1036,11 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { if (Validator.isNotNull(ispettoreId)) { dynamicQuery.add(RestrictionsFactoryUtil.eq("statusByUserId", ispettoreId)); } - dynamicQuery.add(RestrictionsFactoryUtil.eq("status", WorkflowConstants.STATUS_PENDING)); if (sorteggio != null) { if (sorteggio) { dynamicQuery.add(RestrictionsFactoryUtil.isNotNull("dtSorteggio")); } else { - dynamicQuery.add(RestrictionsFactoryUtil.isNull("dtSorteggio")); } @@ -1413,7 +1051,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { if (intPraticaIds.length > 0) { dynamicQuery.add(RestrictionsFactoryUtil.in("intPraticaId", intPraticaIds)); } - return (int) intPraticaPersistence.countWithDynamicQuery(dynamicQuery); } @@ -1431,26 +1068,20 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { } else { dynamicQuery.add(RestrictionsFactoryUtil.isNull("dtSorteggio")); - } } if (Validator.isNotNull(tipoPratica)) { dynamicQuery.add(RestrictionsFactoryUtil.eq("tipoPratica", tipoPratica)); } - Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.DAY_OF_MONTH, 1); calendar.set(Calendar.MONTH, Calendar.JANUARY); calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR)); - Date nowDate = new Date(); Date fromDate = calendar.getTime(); - Property createDateProperty = PropertyFactoryUtil.forName("statusDate"); dynamicQuery.add(createDateProperty.between(fromDate, nowDate)); - return (int) intPraticaPersistence.countWithDynamicQuery(dynamicQuery); - } @Override @@ -1461,11 +1092,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { Comune comune = comuneLocalService.getComune(territorio.getComuneId()); Provincia provincia = provinciaLocalService.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia()); - - // if (Validator.isNotNull(intPratica.getFileEntryId())) { - // dlAppLocalService.deleteFileEntry(intPratica.getFileEntryId()); - // } - String tipoDocumento = "DOM"; String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(tipoDocumento); _log.info("debugAvviso: " + propertiesTemplate); @@ -1474,30 +1100,25 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { String propertiesFolder = AvvisoUtil.getAllTipoDocumentoFolderProps().get(tipoDocumento); long fileEntryIdFolder = configurazioneLocalService.findByC_ChiaveLong(intPratica.getCompanyId(), propertiesFolder); - String fileName = StringUtils.leftPad(String.valueOf(intPratica.getIntPraticaId()), 10, '0') + StringPool.UNDERLINE + tipoDocumento; - ReportDto reportDto = new ReportDto(); reportDto.setFileEntryIds(new long[] { fileEntryIdTemplate }); reportDto.setFolderId(fileEntryIdFolder); reportDto.setFileName(fileName); - reportDto.setHeader(""); + reportDto.setHeader(StringPool.BLANK); reportDto.setHeaderHeight(1); - reportDto.setFooter(""); + reportDto.setFooter(StringPool.BLANK); reportDto.setFooterHeight(1); Map parameters = new HashMap(); - if (Validator.isNotNull(userId)) { - // User user = userLocalService.getUser(userId); - // parameters.put("html", - // PraticaUtil.retrievePraticaText(intPratica, - // user.getScreenName())); parameters.put("headerTitle", intPratica.getTitle(LocaleUtil.ITALIAN, false)); parameters.put("zona", territorio.getZona()); parameters.put("fascia", territorio.getFascia()); - parameters.put("range", (Validator.isNotNull(territorio.getAgMin()) ? territorio.getAgMin() : "") + " - " - + (Validator.isNotNull(territorio.getAgMax()) ? territorio.getAgMax() : "")); + parameters.put("range", (Validator.isNotNull(territorio.getAgMin()) ? territorio.getAgMin() + : StringPool.BLANK) + + " - " + + (Validator.isNotNull(territorio.getAgMax()) ? territorio.getAgMax() : StringPool.BLANK)); parameters.put("ag", dettPratica.getAg()); if (AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId())) { parameters.put("normDpr01", @@ -1535,48 +1156,40 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { parameters.put("lavoriPubblici", dettPratica.getLavoriPubblici() ? "" : ""); - parameters.put("normEsenteBollo", dettPratica.getNormEsenteBollo() ? "" : ""); parameters.put("normEsenteSpese", dettPratica.getNormEsenteSpese() ? "" : ""); - parameters.put("collaudoStatico", dettPratica.getCollaudoStatico() ? "" : ""); - parameters.put("normArt3com3", dettPratica.getNormEsenteSpese() ? "" : ""); parameters.put("normArt3com4", dettPratica.getNormEsenteSpese() ? "" : ""); - parameters.put("descLongIntervento", dettPratica.getDescLongIntervento()); - parameters.put("provincia", provincia.getProvincia()); parameters.put("comune", comune.getDenominazione()); parameters.put("localita", dettPratica.getLocalita()); parameters.put("via", dettPratica.getVia()); parameters.put("foglio", dettPratica.getDcFoglio()); - parameters.put("particelle", dettPratica.getDcParticelle().replace("|", " ")); + parameters.put("particelle", dettPratica.getDcParticelle().replace(StringPool.PIPE, StringPool.SPACE)); parameters.put("allegato", dettPratica.getDcAllegato()); parameters.put("estremiPratCom", dettPratica.getEstremiPratCom()); parameters.put("estremiCatastali", dettPratica.getEstremiCatastali()); - - String label = ""; + String label = StringPool.BLANK; if (dettPratica.getDestinazione().length() > 1) { String title = dettPratica.getDestinazione().substring(0, dettPratica.getDestinazione().length() - 1); String uso = title.substring(title.length() - 1); - label = LanguageUtil.get(LocaleUtil.ITALIAN, "destinazione-uso-" + uso) + ":"; + label = LanguageUtil.get(LocaleUtil.ITALIAN, "destinazione-uso-" + uso) + StringPool.COLON; label += StringPool.NEW_LINE; - label = LanguageUtil.get(LocaleUtil.ITALIAN, "destinazione-" + title) + ":"; + label = LanguageUtil.get(LocaleUtil.ITALIAN, "destinazione-" + title) + StringPool.COLON; } - parameters.put("destinazione", label + dettPratica.getDestinazione()); - parameters.put("nuovaCostruzione", dettPratica.getTcNuovaCostruzione() ? "" : ""); @@ -1593,7 +1206,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { parameters.put("riparazioneLocale", dettPratica.getTcRiparazioneInterventoLocale() ? "" : ""); - parameters.put("inCa", dettPratica.getTcInCA() ? "" : ""); parameters.put("inOpera", dettPratica.getTcInOpera() ? "" @@ -1601,7 +1213,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { parameters.put("prefabbricato", dettPratica.getTcPrefabbricato() ? "" : ""); - parameters.put("inMuratura", dettPratica.getTcInMuratura() ? "" : ""); parameters.put("inMuraturaOrdinaria", @@ -1613,15 +1224,12 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { parameters.put("inMuraturaMista", dettPratica.getTcInMuraturaMista() ? "" : ""); - parameters.put("inLegno", dettPratica.getTcInLegno() ? "" : ""); - parameters.put("tcAltro", dettPratica.getTcAltroDescrizione()); parameters.put("tcDispositivi", dettPratica.getTcConDispositivi() ? "" : ""); - parameters.put("dePiani", LanguageUtil.get(Locale.ITALIAN, "de-piani-" + dettPratica.getDePiani())); parameters.put("deAltezza", LanguageUtil.get(Locale.ITALIAN, "de-altezza-" + dettPratica.getDeAltezza())); parameters.put("deInterrati", @@ -1639,16 +1247,13 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { LanguageUtil.get(Locale.ITALIAN, "de-posizione-edificio-" + dettPratica.getDePosizioneEdificio())); parameters.put("dePubblica", dettPratica.getDePubblica() + LanguageUtil.get(Locale.ITALIAN, "de-pubblica")); parameters.put("dePrivata", dettPratica.getDePrivata() + LanguageUtil.get(Locale.ITALIAN, "de-privata")); - } String[] css = new String[] { "http://localhost:8080/portos-private-fe-theme/css/main.css" }; reportDto.setCss(css); reportDto.setParameters(parameters); reportDto.setShowNumberOfPage(true); reportDto.setType(ReportConstants.ReportType.VELOCITY_TO_PDF.toString()); - ReportResultDto result = ReportUtil.generateReport(intPratica.getCompanyId(), userId, reportDto, null); - return result.getFileEntryIds()[0]; } @@ -1687,7 +1292,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { return IntPraticaFinderUtil.countDeposito(dtMin, dtMax, groupId, controlloOblligatorio); } - // Bug 33463 @Override public int countVidimate(Date dtMin, Date dtMax, long groupId, String type, boolean isControlloObbligatorio) throws SystemException { @@ -1695,7 +1299,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { return IntPraticaFinderUtil.countVidimate(dtMin, dtMax, groupId, type, isControlloObbligatorio); } - // Bug 33463 @Override public List countControllo(Date dtMin, Date dtMax, long groupId, String type, boolean isControlloObbligatorio) throws SystemException { @@ -1711,16 +1314,19 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { @Override public List findIntPraticaNotExist() throws SystemException { + return IntPraticaFinderUtil.findIntPraticaNotExist(); } @Override public List riparaWorkflow() throws SystemException { + return IntPraticaFinderUtil.riparaWorkflow(); } @Override public void reIndexFascicolo(IntPratica intPratica, long companyId) { + try { Indexer intIndexer = IndexerRegistryUtil.getIndexer(IntPratica.class); Indexer controlloIndexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class); @@ -1744,18 +1350,20 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { @Override public void reIndexFasciolo(String numeroProgetto, long companyId) throws SystemException { - IntPratica intPratica = null; - intPratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto); + + IntPratica intPratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto); reIndexFascicolo(intPratica, companyId); } @Override public void reIndexFasciolo(long intPraticaId, long companyId) throws PortalException, SystemException { + reIndexFascicolo(IntPraticaLocalServiceUtil.getIntPratica(intPraticaId), companyId); } @Override public List trovaDoppioni() throws SystemException { + return IntPraticaFinderUtil.trovaDoppioni(); } @@ -1764,73 +1372,63 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { DynamicQuery dq = intPraticaLocalService.dynamicQuery(); dq.add(RestrictionsFactoryUtil.eq("numeroProgetto", numeroProgetto)); - List lista = intPraticaLocalService.dynamicQuery(dq); if (lista != null && !lista.isEmpty()) { return lista.get(0); } - return null; } @Override public List findByTerritorioId(long territorioId) throws SystemException { + return intPraticaPersistence.findByTerritorioId(territorioId); } - /** - * ADT: report tempistiche istruttorie - */ + // ADT: report tempistiche istruttorie @Override public List reportTempisticheIstruttorieAvvisiAutorizzazioni(Date dtMin, Date dtMax, long groupId, String type) throws SystemException { return IntPraticaFinderUtil.reportTempisticheIstruttorieAvvisiAutorizzazioni(dtMin, dtMax, groupId, type); } - /** - * - * @param dtMin - * @param dtMax - * @param groupId - * @return - * @throws SystemException - */ @Override public Map reportTempisticheIstruttorieCalcolaDataSorteggio(Date dtMin, Date dtMax, long groupId) throws SystemException { + return IntPraticaFinderUtil.reportTempisticheIstruttorieCalcolaDataSorteggio(dtMin, dtMax, groupId); } - /** - * - * ADT: report pratiche vidimate - * - */ + // ADT: report pratiche vidimate @Override public List reportPraticheVidimate(Date dtMin, Date dtMax, long groupId, String type) throws SystemException { + return IntPraticaFinderUtil.reportPraticheVidimate(dtMin, dtMax, groupId, type); } @Override public Map reportPraticheVidimateCalcolaDataSorteggio(Date dtMin, Date dtMax, long groupId) throws SystemException { + return IntPraticaFinderUtil.reportPraticheVidimateCalcolaDataSorteggio(dtMin, dtMax, groupId); } @Override public int countIngressiAutorizzazioni(Date dtMin, Date dtMax, long groupId) throws SystemException { + return IntPraticaFinderUtil.countIngressiAutorizzazioni(dtMin, dtMax, groupId); } @Override public int countIngressiDepositi(Date dtMin, Date dtMax, long groupId) throws SystemException { + return IntPraticaFinderUtil.countIngressiDepositi(dtMin, dtMax, groupId); } @Override public int countIngressiCO(Date dtMin, Date dtMax, long groupId) throws SystemException { + return IntPraticaFinderUtil.countIngressiCO(dtMin, dtMax, groupId); } - } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/PagamentoLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/PagamentoLocalServiceImpl.java index fb396aaa..a790bb9d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/PagamentoLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/PagamentoLocalServiceImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.service.impl; @@ -51,14 +51,12 @@ import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil; * The implementation of the pagamento local service. * *

- * All custom service methods should be put in this class. Whenever methods are - * added, rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.PagamentoLocalService} interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.PagamentoLocalService} interface. * *

- * This is a local service. Methods of this service will not have security - * checks based on the propagated JAAS credentials because this service can only - * be accessed from within the same VM. + * This is a local service. Methods of this service will not have security checks based on the propagated JAAS + * credentials because this service can only be accessed from within the same VM. *

* * @author Davide Barbagallo, 3F Consulting @@ -67,9 +65,8 @@ import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil; */ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { /* - * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use - * {@link it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil} to - * access the pagamento local service. + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil} to access the pagamento local service. */ @Override public long createPagamentoId() throws SystemException { @@ -78,79 +75,65 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { } @Override - public Pagamento addPagamento(String codice, String causale, String mezzo, - String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, - long classPk, String className, long oldPagamentoId, ServiceContext serviceContext) - throws PortalException, SystemException { + public Pagamento addPagamento(String codice, String causale, String mezzo, String codiceFiscaleCommittente, + String tipoPagamento, String importo, String utilizzata, long classPk, String className, + long oldPagamentoId, ServiceContext serviceContext) throws PortalException, SystemException { - return addPagamentoAndUpdate(null, codice, causale, mezzo, codiceFiscaleCommittente, tipoPagamento, - importo, utilizzata, classPk, className, false, oldPagamentoId, StringPool.BLANK, null, - serviceContext); + return addPagamentoAndUpdate(null, codice, causale, mezzo, codiceFiscaleCommittente, tipoPagamento, importo, + utilizzata, classPk, className, false, oldPagamentoId, StringPool.BLANK, null, serviceContext); } @Override public Pagamento addPagamentoAndUpdate(String codice, String causale, String mezzo, - String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, - long classPk, String className, long oldPagamentoId, ServiceContext serviceContext) - throws PortalException, SystemException { + String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, long classPk, + String className, long oldPagamentoId, ServiceContext serviceContext) throws PortalException, + SystemException { - return addPagamentoAndUpdate(null, codice, causale, mezzo, codiceFiscaleCommittente, tipoPagamento, - importo, utilizzata, classPk, className, true, oldPagamentoId, StringPool.BLANK, null, - serviceContext); + return addPagamentoAndUpdate(null, codice, causale, mezzo, codiceFiscaleCommittente, tipoPagamento, importo, + utilizzata, classPk, className, true, oldPagamentoId, StringPool.BLANK, null, serviceContext); } @Override public Pagamento addPagamentoAndUpdate(long pagamentoId, String codice, String causale, String mezzo, - String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, - long classPk, String className, long oldPagamentoId, ServiceContext serviceContext) - throws PortalException, SystemException { + String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, long classPk, + String className, long oldPagamentoId, ServiceContext serviceContext) throws PortalException, + SystemException { - return addPagamentoAndUpdate(pagamentoId, codice, causale, mezzo, codiceFiscaleCommittente, - tipoPagamento, importo, utilizzata, classPk, className, true, oldPagamentoId, - StringPool.BLANK, null, serviceContext); + return addPagamentoAndUpdate(pagamentoId, codice, causale, mezzo, codiceFiscaleCommittente, tipoPagamento, + importo, utilizzata, classPk, className, true, oldPagamentoId, StringPool.BLANK, null, serviceContext); } @Override public Pagamento addPagamentoAndUpdate(long pagamentoId, String codice, String causale, String mezzo, - String codiceFiscaleCommittente, String tipoImporto, String importo, String utilizzata, - long classPk, String className, long oldPagamentoId, String url, - List iuvs, ServiceContext serviceContext) throws PortalException, - SystemException { + String codiceFiscaleCommittente, String tipoImporto, String importo, String utilizzata, long classPk, + String className, long oldPagamentoId, String url, List iuvs, + ServiceContext serviceContext) throws PortalException, SystemException { - return addPagamentoAndUpdate(pagamentoId, codice, causale, mezzo, codiceFiscaleCommittente, - tipoImporto, importo, utilizzata, classPk, className, true, oldPagamentoId, url, iuvs, - serviceContext); + return addPagamentoAndUpdate(pagamentoId, codice, causale, mezzo, codiceFiscaleCommittente, tipoImporto, + importo, utilizzata, classPk, className, true, oldPagamentoId, url, iuvs, serviceContext); } private Pagamento addPagamentoAndUpdate(Long pagamentoId, String codice, String causale, String mezzo, - String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, - long classPk, String className, boolean updateReference, long oldPagamentoId, String url, - List iuvs, ServiceContext serviceContext) throws PortalException, - SystemException { + String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, long classPk, + String className, boolean updateReference, long oldPagamentoId, String url, + List iuvs, ServiceContext serviceContext) throws PortalException, SystemException { Date now = new Date(); - if (Validator.isNull(pagamentoId)) { pagamentoId = createPagamentoId(); } - Pagamento pagamento = createPagamento(pagamentoId); - pagamento.setCompanyId(serviceContext.getCompanyId()); - pagamento.setUserId(serviceContext.getUserId()); - if (serviceContext.getUserId() > 0) { User user = userPersistence.findByPrimaryKey(serviceContext.getUserId()); pagamento.setUserName(user.getFullName()); } - pagamento.setGroupId(serviceContext.getScopeGroupId()); pagamento.setCreateDate(serviceContext.getCreateDate(now)); pagamento.setModifiedDate(serviceContext.getModifiedDate(now)); pagamento.setClassPk(classPk); pagamento.setClassName(className); - pagamento.setTipoPagamento(tipoPagamento); pagamento.setUrl(url); pagamento.setCodice(codice); @@ -170,8 +153,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { codiceBolli = StringUtil.replaceLast(codiceBolli, StringPool.PIPE, StringPool.BLANK); pagamento.setCodice(codiceBolli); } - - long intPraticaId = 0l; + long intPraticaId = 0L; if (DettPratica.class.getName().equals(className)) { DettPratica dettPratica = dettPraticaPersistence.findByPrimaryKey(classPk); intPraticaId = dettPratica.getIntPraticaId(); @@ -188,10 +170,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { dettPratica.setCodicePagamentoBolli(pagamento.getCodice()); dettPratica.setCausalePagamentoBolli(pagamento.getCausale()); dettPratica.setMezzoPagamentoBolli(mezzo); - default: - break; } - dettPratica = dettPraticaLocalService.updateDettPratica(dettPratica); } } else if (FineLavori.class.getName().equals(className)) { @@ -206,10 +185,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { fineLavori.setCodicePagamento(pagamento.getCodice()); fineLavori.setCausalePagamento(pagamento.getCausale()); fineLavori.setMezzoPagamento(mezzo); - default: - break; } - fineLavori = fineLavoriLocalService.updateFineLavori(fineLavori); } } else if (Collaudo.class.getName().equals(className)) { @@ -224,27 +200,19 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { collaudo.setCodicePagamento(pagamento.getCodice()); collaudo.setCausalePagamento(pagamento.getCausale()); collaudo.setMezzoPagamento(mezzo); - default: - break; } - collaudo = collaudoLocalService.updateCollaudo(collaudo); } } else { - throw new PortalException("unable to update pagamento for entity type " + className + " with id " - + classPk); + throw new PortalException("unable to update pagamento for entity type " + className + " with id " + classPk); } - pagamento.setIntPraticaId(intPraticaId); - pagamento = addPagamento(pagamento); - return pagamento; } @Override - public Pagamento updatePagamento(long pagamentoId, String importo) throws PortalException, - SystemException { + public Pagamento updatePagamento(long pagamentoId, String importo) throws PortalException, SystemException { Pagamento pagamento = pagamentoPersistence.findByPrimaryKey(pagamentoId); pagamento.setImporto(importo); @@ -275,16 +243,15 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { Pagamento pagamento = pagamentoPersistence.findByPrimaryKey(pagamentoId); pagamento.setUtilizzata(PagamentoConstants.UTILIZZATA_ANNULLATO); - return updatePagamento(pagamento); } @Override - public List findByCommittente_Mezzo(String codiceFiscaleCommittente, String mezzo, int start, - int end) throws SystemException { + public List findByCommittente_Mezzo(String codiceFiscaleCommittente, String mezzo, int start, int end) + throws SystemException { - DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, - mezzo, null); + DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, mezzo, + null); return pagamentoPersistence.findWithDynamicQuery(dynamicQuery, start, end, OrderByComparatorFactoryUtil.create(PagamentoModelImpl.TABLE_NAME, "createDate", true)); } @@ -292,8 +259,8 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { @Override public int countByCommittente_Mezzo(String codiceFiscaleCommittente, String mezzo) throws SystemException { - DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, - mezzo, null); + DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, mezzo, + null); return (int) pagamentoPersistence.countWithDynamicQuery(dynamicQuery); } @@ -301,18 +268,18 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { public List findByCommittente_Mezzo_Utilizzata(String codiceFiscaleCommittente, String mezzo, String utilizzata, int start, int end) throws SystemException { - DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, - mezzo, utilizzata); + DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, mezzo, + utilizzata); return pagamentoPersistence.findWithDynamicQuery(dynamicQuery, start, end, OrderByComparatorFactoryUtil.create(PagamentoModelImpl.TABLE_NAME, "createDate", true)); } @Override - public int countByCommittente_Mezzo_Utilizzata(String codiceFiscaleCommittente, String mezzo, - String utilizzata) throws SystemException { + public int countByCommittente_Mezzo_Utilizzata(String codiceFiscaleCommittente, String mezzo, String utilizzata) + throws SystemException { - DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, - mezzo, utilizzata); + DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, mezzo, + utilizzata); return (int) pagamentoPersistence.countWithDynamicQuery(dynamicQuery); } @@ -337,27 +304,27 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { } @Override - public List findByMezzo_Utilizzata_CreateDate(String mezzo, String utilizzata, Date date, - int start, int end) throws SystemException { + public List findByMezzo_Utilizzata_CreateDate(String mezzo, String utilizzata, Date date, int start, + int end) throws SystemException { return pagamentoPersistence.findByMezzo_Utilizzata_CreateDate(mezzo, utilizzata, date, start, end, OrderByComparatorFactoryUtil.create(PagamentoModelImpl.TABLE_NAME, "createDate", true)); } @Override - public int countByMezzo_Utilizzata_EmailPending_CreateDate(String mezzo, String utilizzata, - boolean emailPending, Date date) throws SystemException { + public int countByMezzo_Utilizzata_EmailPending_CreateDate(String mezzo, String utilizzata, boolean emailPending, + Date date) throws SystemException { - return pagamentoPersistence.countByMezzo_Utilizzata_EmailPending_CreateDate(mezzo, utilizzata, - emailPending, date); + return pagamentoPersistence.countByMezzo_Utilizzata_EmailPending_CreateDate(mezzo, utilizzata, emailPending, + date); } @Override public List findByMezzo_Utilizzata_EmailPending_CreateDate(String mezzo, String utilizzata, boolean emailPending, Date date, int start, int end) throws SystemException { - return pagamentoPersistence.findByMezzo_Utilizzata_EmailPending_CreateDate(mezzo, utilizzata, - emailPending, date, start, end, + return pagamentoPersistence.findByMezzo_Utilizzata_EmailPending_CreateDate(mezzo, utilizzata, emailPending, + date, start, end, OrderByComparatorFactoryUtil.create(PagamentoModelImpl.TABLE_NAME, "createDate", true)); } @@ -385,8 +352,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { } @Override - public int countByMezzo_Utilizzata_CreateDate(String mezzo, String utilizzata, Date date) - throws SystemException { + public int countByMezzo_Utilizzata_CreateDate(String mezzo, String utilizzata, Date date) throws SystemException { return pagamentoPersistence.countByMezzo_Utilizzata_CreateDate(mezzo, utilizzata, date); } @@ -412,8 +378,8 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { } @Override - public Pagamento updateEmailPendingPagamento(long pagamentoId, boolean emailPending) - throws PortalException, SystemException { + public Pagamento updateEmailPendingPagamento(long pagamentoId, boolean emailPending) throws PortalException, + SystemException { Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId); pagamento.setModifiedDate(new Date()); @@ -423,8 +389,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { private void deleteDettPraticaPagamento(Pagamento pagamento) throws SystemException { - List dettPraticas = dettPraticaLocalService - .findByPagamentoId(pagamento.getPagamentoId()); + List dettPraticas = dettPraticaLocalService.findByPagamentoId(pagamento.getPagamentoId()); for (DettPratica dettPratica : dettPraticas) { if (PagamentoConstants.PAGAMENTO_ONERI.equals(pagamento.getTipoPagamento())) { dettPratica.setPagamentoIdOneri(0L); @@ -435,8 +400,8 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { } } - private DynamicQuery dynamicQueryFindByCommittente_Mezzo_Utilizzata(String codiceFiscaleCommittente, - String mezzo, String utilizzata) { + private DynamicQuery dynamicQueryFindByCommittente_Mezzo_Utilizzata(String codiceFiscaleCommittente, String mezzo, + String utilizzata) { DynamicQuery dynamicQuery = pagamentoLocalService.dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.ilike("codiceFiscaleCommittente", codiceFiscaleCommittente)); @@ -467,17 +432,20 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { @Override public int countByIntPratica(long intPraticaId) throws SystemException { + return pagamentoPersistence.countByIntPratica(intPraticaId); } @Override public List findByIntPratica_Visible(long intPraticaId) throws SystemException { + DynamicQuery dynamicQuery = createPagamentiVisibleByIntPratica(intPraticaId); return pagamentoPersistence.findWithDynamicQuery(dynamicQuery); } @Override public int countByIntPratica_Visible(long intPraticaId) throws SystemException { + DynamicQuery dynamicQuery = createPagamentiVisibleByIntPratica(intPraticaId); return (int) pagamentoPersistence.countWithDynamicQuery(dynamicQuery); } @@ -485,59 +453,52 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { private DynamicQuery createPagamentiVisibleByIntPratica(long intPraticaId) { DynamicQuery dynamicQuery = pagamentoLocalService.dynamicQuery(); - dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.ne("utilizzata", PagamentoConstants.UTILIZZATA_IN_CORSO)); - return dynamicQuery; } @Override - public void sostituisciPagamento(long pagamentoId, String codiceFiscaleCommittente, String mezzo, - String url, ServiceContext serviceContext) throws PortalException, SystemException { + public void sostituisciPagamento(long pagamentoId, String codiceFiscaleCommittente, String mezzo, String url, + ServiceContext serviceContext) throws PortalException, SystemException { Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId); long intPraticaId = pagamento.getIntPraticaId(); String currentUtilizzata = pagamento.getUtilizzata(); String currentMezzo = pagamento.getMezzo(); String tipoPagamento = pagamento.getTipoPagamento(); - boolean irisEnable = PagamentiCommonUtil.irisIsEnable(pagamento.getCompanyId()); - if (mezzo.equalsIgnoreCase(PagamentoConstants.MEZZO_MANUALE)) { if (irisEnable) { throw new PortalException("Creazione pagamento manuale con iris enable non possibile"); } else if (currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_NON_PAGABILE) || currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_RIFIUTATA) || currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_ANNULLATO)) { - if (DettPratica.class.getName().equals(pagamento.getClassName())) { DettPratica dettPratica = dettPraticaLocalService.getDettPratica(pagamento.getClassPk()); if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) { - dettPratica.setPagamentoIdOneri(0l); + dettPratica.setPagamentoIdOneri(0L); } else { - dettPratica.setPagamentoIdBolli(0l); + dettPratica.setPagamentoIdBolli(0L); } dettPratica = dettPraticaLocalService.updateDettPratica(dettPratica); } else if (FineLavori.class.getName().equals(pagamento.getClassName())) { FineLavori fineLavori = fineLavoriLocalService.getFineLavori(pagamento.getClassPk()); - fineLavori.setPagamentoId(0l); + fineLavori.setPagamentoId(0L); fineLavori = fineLavoriLocalService.updateFineLavori(fineLavori); } else if (Collaudo.class.getName().equals(pagamento.getClassName())) { Collaudo collaudo = collaudoLocalService.getCollaudo(pagamento.getClassPk()); - collaudo.setPagamentoId(0l); + collaudo.setPagamentoId(0L); collaudo = collaudoLocalService.updateCollaudo(collaudo); } else { throw new RuntimeException("unable to replace pagamento for entity type " + pagamento.getClassName() + " with id " + pagamento.getClassPk()); } - pagamento.setUtilizzata(PagamentoConstants.UTILIZZATA_SOSTITUITA); pagamento.setUtilizzataSostituita(currentUtilizzata); pagamentoLocalService.updatePagamento(pagamento); - - PagamentiUtil.nuovoPagamento(url, pagamento.getClassPk(), pagamento.getClassName(), - tipoPagamento, pagamento.getImporto(), codiceFiscaleCommittente, serviceContext); + PagamentiUtil.nuovoPagamento(url, pagamento.getClassPk(), pagamento.getClassName(), tipoPagamento, + pagamento.getImporto(), codiceFiscaleCommittente, serviceContext); } else { throw new PortalException("Creazione pagamento manuale con stato " + currentUtilizzata + " non possibile"); @@ -548,43 +509,37 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { .equalsIgnoreCase(PagamentoConstants.UTILIZZATA_NON_PAGABILE) || currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_RIFIUTATA) || currentUtilizzata .equalsIgnoreCase(PagamentoConstants.UTILIZZATA_ANNULLATO)))) { - if (DettPratica.class.getName().equals(pagamento.getClassName())) { DettPratica dettPratica = dettPraticaLocalService.getDettPratica(pagamento.getClassPk()); if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) { - dettPratica.setPagamentoIdOneri(0l); + dettPratica.setPagamentoIdOneri(0L); } else { - dettPratica.setPagamentoIdBolli(0l); + dettPratica.setPagamentoIdBolli(0L); } dettPratica = dettPraticaLocalService.updateDettPratica(dettPratica); } else if (FineLavori.class.getName().equals(pagamento.getClassName())) { FineLavori fineLavori = fineLavoriLocalService.getFineLavori(pagamento.getClassPk()); - fineLavori.setPagamentoId(0l); + fineLavori.setPagamentoId(0L); fineLavori = fineLavoriLocalService.updateFineLavori(fineLavori); } else if (Collaudo.class.getName().equals(pagamento.getClassName())) { Collaudo collaudo = collaudoLocalService.getCollaudo(pagamento.getClassPk()); - collaudo.setPagamentoId(0l); + collaudo.setPagamentoId(0L); collaudo = collaudoLocalService.updateCollaudo(collaudo); } else { throw new RuntimeException("unable to replace pagamento for entity type " + pagamento.getClassName() + " with id " + pagamento.getClassPk()); } - pagamento.setUtilizzata(PagamentoConstants.UTILIZZATA_SOSTITUITA); pagamento.setUtilizzataSostituita(currentUtilizzata); pagamentoLocalService.updatePagamento(pagamento); - PagamentiUtil.nuovoPagamento(url, pagamento.getClassPk(), pagamento.getClassName(), - pagamento.getTipoPagamento(), pagamento.getImporto(), codiceFiscaleCommittente, - serviceContext); + pagamento.getTipoPagamento(), pagamento.getImporto(), codiceFiscaleCommittente, serviceContext); } else { throw new PortalException("Pagamento IRIS non sostituibile per intPratica " + intPraticaId); } - } else { throw new PortalException("Mezzo non presente"); } - } @Override @@ -592,49 +547,38 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { ServiceContext serviceContext) throws IOException, PortalException, SystemException { Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId); - // if (dettPratica.getPagamentoId() != pagamentoId) { - // throw new PortalException("Pagamento non abbinato al dettpratica"); - // } if (pagamento.getMezzo().equalsIgnoreCase(PagamentoConstants.MEZZO_MANUALE) && pagamento.getUtilizzata().equalsIgnoreCase(PagamentoConstants.UTILIZZATA_IN_CORSO)) { - long fileEntryId = 0l; - - long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong( - serviceContext.getCompanyId(), ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); - + long fileEntryId = 0L; + long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), + ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId); - String folderName = PraticaUtil.getFolderName(pagamento.getClassPk()); - serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); Folder folder = null; try { - folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), - defaultFolder.getFolderId(), folderName); + folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), defaultFolder.getFolderId(), + folderName); } catch (NoSuchFolderException e) { // cartella non presente -> creo cartella - folder = dlAppLocalService.addFolder(serviceContext.getUserId(), - defaultFolder.getRepositoryId(), defaultFolder.getFolderId(), folderName, - StringPool.BLANK, serviceContext); + folder = dlAppLocalService.addFolder(serviceContext.getUserId(), defaultFolder.getRepositoryId(), + defaultFolder.getFolderId(), folderName, StringPool.BLANK, serviceContext); } Date now = new Date(); String title = now.getTime() + StringPool.UNDERLINE + "pagamento_manuale" + StringPool.UNDERLINE + pagamento.getPagamentoId() + StringPool.UNDERLINE + sourceFileName; - String description = ""; + String description = StringPool.BLANK; String mimeType = MimeTypesUtil.getContentType(sourceFileName); - String changeLog = StringPool.BLANK; - FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), - folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" + sourceFileName, - mimeType, title, description, changeLog, content, serviceContext); + FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(), + folder.getFolderId(), now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title, + description, changeLog, content, serviceContext); fileEntryId = fileEntry.getFileEntryId(); - pagamento.setFileEntryId(fileEntryId); pagamento = pagamentoLocalService.updatePagamento(pagamento); - if (DettPratica.class.getName().equals(pagamento.getClassName())) { - dettPraticaLocalService.updateEsitoPagamento(pagamentoId, pagamento.getClassPk(), - fileEntryId, PagamentoConstants.UTILIZZATA_PAGATA); + dettPraticaLocalService.updateEsitoPagamento(pagamentoId, pagamento.getClassPk(), fileEntryId, + PagamentoConstants.UTILIZZATA_PAGATA); } else if (FineLavori.class.getName().equals(pagamento.getClassName())) { fineLavoriLocalService.updateEsitoPagamento(pagamentoId, pagamento.getClassPk(), fileEntryId, PagamentoConstants.UTILIZZATA_PAGATA); @@ -645,7 +589,6 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { throw new RuntimeException("unable to update pagamento manuale for entity type " + pagamento.getClassName() + " with id " + pagamento.getClassPk()); } - } else { throw new SystemException("pagamento manuale non aggiornabile"); } @@ -656,43 +599,34 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { ServiceContext serviceContext) throws PortalException, SystemException { Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId); - if (pagamento.getMezzo().equalsIgnoreCase(PagamentoConstants.MEZZO_MANUALE)) { - long fileEntryId = 0l; - - long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong( - serviceContext.getCompanyId(), ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); - + long fileEntryId = 0L; + long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), + ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId); - String folderName = PraticaUtil.getFolderName(pagamento.getClassPk()); - serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); Folder folder = null; try { - folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), - defaultFolder.getFolderId(), folderName); + folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), defaultFolder.getFolderId(), + folderName); } catch (NoSuchFolderException e) { // cartella non presente -> creo cartella - folder = dlAppLocalService.addFolder(serviceContext.getUserId(), - defaultFolder.getRepositoryId(), defaultFolder.getFolderId(), folderName, - StringPool.BLANK, serviceContext); + folder = dlAppLocalService.addFolder(serviceContext.getUserId(), defaultFolder.getRepositoryId(), + defaultFolder.getFolderId(), folderName, StringPool.BLANK, serviceContext); } Date now = new Date(); String title = now.getTime() + StringPool.UNDERLINE + "pagamento_manuale" + StringPool.UNDERLINE + pagamento.getPagamentoId() + StringPool.UNDERLINE + sourceFileName; - String description = ""; + String description = StringPool.BLANK; String mimeType = MimeTypesUtil.getContentType(sourceFileName); - String changeLog = StringPool.BLANK; - FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), - folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" + sourceFileName, - mimeType, title, description, changeLog, content, serviceContext); + FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(), + folder.getFolderId(), now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title, + description, changeLog, content, serviceContext); fileEntryId = fileEntry.getFileEntryId(); - pagamento.setFileEntryId(fileEntryId); pagamento = pagamentoLocalService.updatePagamento(pagamento); - } else { throw new SystemException("pagamento manuale non aggiornabile"); } @@ -706,6 +640,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { @Override public Pagamento updateOtf(long pagamentoId, boolean otf) throws PortalException, SystemException { + Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId); pagamento.setOtf(otf); if (otf) { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/Constants.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/Constants.java index 234c9d49..d84da7ea 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/Constants.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/Constants.java @@ -1,7 +1,9 @@ package it.tref.liferay.portos.bo.util; public class Constants extends it.tref.liferay.portos.bo.shared.util.Constants { + public static final String NUMERO_PROGETTO_KEY_DB = "numero.progetto.key.db"; + public static final String[] AMMINISTRAZIONE_CSV_HEADERS_COMUNI = { "Codice Regione", "Codice Città Metropolitana", "Codice Provincia (1)", "Progressivo del Comune (2)", "Codice Comune formato alfanumerico", "Denominazione in italiano", "Denominazione in tedesco", @@ -13,6 +15,7 @@ public class Constants extends it.tref.liferay.portos.bo.shared.util.Constants { "Codice Comune numerico con 103 province (dal 1995 al 2005)", "Codice Catastale del comune", "Popolazione legale 2011 (09/10/2011)", "Codice NUTS1 2010", "Codice NUTS2 2010 (3) ", "Codice NUTS3 2010", "Codice NUTS1 2006", "Codice NUTS2 2006 (3)", "Codice NUTS3 2006" }; + public static final String[] AMMINISTRAZIONE_CSV_HEADERS_PROVINCE = { "codice_provincia", "provincia", "regione", "sigla" }; } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/ContentType.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/ContentType.java index 5fb9e2a4..89391f58 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/ContentType.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/ContentType.java @@ -8,10 +8,12 @@ public enum ContentType { private String contentType; ContentType(String contentType) { + this.contentType = contentType; } public String getContentType() { + return contentType; } @@ -22,9 +24,6 @@ public enum ContentType { return value; } } - throw new IllegalArgumentException("Invalid value for ContentType: " + contentType); - } - } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/FestivitaUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/FestivitaUtil.java deleted file mode 100644 index 725256cb..00000000 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/FestivitaUtil.java +++ /dev/null @@ -1,147 +0,0 @@ -package it.tref.liferay.portos.bo.util; - -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; - -import org.apache.commons.lang.time.DateUtils; - -public class FestivitaUtil { - - public final static boolean isFestivo(Date date) { - - int year = DateUtils.toCalendar(date).get(Calendar.YEAR); - - boolean isCapodanno = is(date, 1, 1); - boolean isBefana = is(date, 6, 1); - boolean isPasqua = isPasqua(date); - - boolean isPasquetta = false; - Date dtPasqua = findPasqua(year); - if (dtPasqua != null) { - Calendar calendar = DateUtils.toCalendar(dtPasqua); - while (calendar.get(Calendar.DAY_OF_WEEK) != Calendar.MONDAY) { - calendar.add(Calendar.DATE, 1); - } - isPasquetta = is(date, calendar.getTime()); - } - - boolean isFestaDellaLiberazione = is(date, 25, 4); - boolean isFestaDeiLavoratori = is(date, 1, 5); - boolean isFestaDellaRepubblica = is(date, 2, 6); - boolean isFerragosto = is(date, 15, 8); - boolean isOgnissanti = is(date, 1, 11); - boolean isImmacolataConcezione = is(date, 8, 12); - boolean isNatale = is(date, 25, 12); - boolean isSantoStefano = is(date, 26, 12); - - return isCapodanno || isBefana || isPasqua || isPasquetta || isFestaDellaLiberazione - || isFestaDeiLavoratori || isFestaDellaRepubblica || isFerragosto || isOgnissanti - || isImmacolataConcezione || isNatale || isSantoStefano; - } - - private final static boolean isPasqua(Date date) { - - Calendar calendar = new GregorianCalendar(); - calendar.setTime(date); - - int year = calendar.get(Calendar.YEAR); - int dateYMD = year * 10000 + calendar.get(Calendar.MONTH) * 100 + calendar.get(Calendar.DAY_OF_MONTH); - - Date pasqua = findPasqua(year); - if (pasqua != null) { - calendar.setTime(pasqua); - int pasquaYMD = year * 10000 + calendar.get(Calendar.MONTH) * 100 - + calendar.get(Calendar.DAY_OF_MONTH); - return (pasquaYMD == dateYMD); - } - - return false; - } - - private final static boolean is(Date date, int day, int month) { - Calendar calendar = DateUtils.toCalendar(date); - return calendar.get(Calendar.DATE) == day && (calendar.get(Calendar.MONTH) + 1) == month; - } - - private final static boolean is(Date date, Date date2) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - Calendar calendar2 = Calendar.getInstance(); - calendar2.setTime(date2); - return calendar.get(Calendar.DATE) == calendar2.get(Calendar.DATE) - && calendar.get(Calendar.MONTH) == calendar2.get(Calendar.MONTH); - } - - private final static Date findPasqua(int year) { - - if ((year < 1573) || (year > 2499)) { - throw null; - } - - int a = year % 19; - int b = year % 4; - int c = year % 7; - - int m = 0; - int n = 0; - - if ((year >= 1583) && (year <= 1699)) { - m = 22; - n = 2; - } - if ((year >= 1700) && (year <= 1799)) { - m = 23; - n = 3; - } - if ((year >= 1800) && (year <= 1899)) { - m = 23; - n = 4; - } - if ((year >= 1900) && (year <= 2099)) { - m = 24; - n = 5; - } - if ((year >= 2100) && (year <= 2199)) { - m = 24; - n = 6; - } - if ((year >= 2200) && (year <= 2299)) { - m = 25; - n = 0; - } - if ((year >= 2300) && (year <= 2399)) { - m = 26; - n = 1; - } - if ((year >= 2400) && (year <= 2499)) { - m = 25; - n = 1; - } - - int d = (19 * a + m) % 30; - int e = (2 * b + 4 * c + 6 * d + n) % 7; - - Calendar calendar = new GregorianCalendar(); - calendar.set(Calendar.YEAR, year); - - if (d + e < 10) { - calendar.set(Calendar.YEAR, year); - calendar.set(Calendar.MONTH, Calendar.MARCH); - calendar.set(Calendar.DAY_OF_MONTH, d + e + 22); - } else { - calendar.set(Calendar.MONTH, Calendar.APRIL); - int day = d + e - 9; - if (26 == day) { - day = 19; - } - if ((25 == day) && (28 == d) && (e == 6) && (a > 10)) { - day = 18; - } - calendar.set(Calendar.DAY_OF_MONTH, day); - } - - return calendar.getTime(); - } - -} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/GenioCivileBaseUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/GenioCivileBaseUtil.java index 02e49fcb..78e3e67e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/GenioCivileBaseUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/GenioCivileBaseUtil.java @@ -22,6 +22,7 @@ public class GenioCivileBaseUtil { public static String getDettPraticaURL(long plid, long resourcePrimKey, int status, String portalURL, boolean maximized) { + return getDettPraticaURL(plid, resourcePrimKey, status, portalURL, maximized, null); } @@ -29,63 +30,46 @@ public class GenioCivileBaseUtil { boolean maximized, String redirect) { StringBundler sb = new StringBundler(11); - - sb.append(portalURL); - sb.append(PortalUtil.getPathMain()); - sb.append("/portal/dettaglio_pratica/find_entry"); - sb.append(StringPool.QUESTION); - sb.append("p_l_id"); - sb.append(StringPool.EQUAL); - sb.append(String.valueOf(plid)); - sb.append(StringPool.AMPERSAND); + sb.append(portalURL).append(PortalUtil.getPathMain()).append("/portal/dettaglio_pratica/find_entry?p_l_id=") + .append(String.valueOf(plid)).append(StringPool.AMPERSAND); // control panel if (Validator.isNotNull(redirect)) { - sb.append("doAsGroupId"); - sb.append(StringPool.EQUAL); - sb.append(HttpUtil.getParameter(redirect, "doAsGroupId", false)); - sb.append(StringPool.AMPERSAND); + sb.append("doAsGroupId=").append(HttpUtil.getParameter(redirect, "doAsGroupId", false)) + .append(StringPool.AMPERSAND); } - sb.append("resourcePrimKey"); - sb.append(StringPool.EQUAL); - sb.append(String.valueOf(resourcePrimKey)); - + sb.append("resourcePrimKey=").append(String.valueOf(resourcePrimKey)); String url = sb.toString(); - if (status != WorkflowConstants.STATUS_APPROVED) { url = HttpUtil.addParameter(url, "status", String.valueOf(status)); } - if (maximized) { url = HttpUtil.addParameter(url, "maximized", String.valueOf(maximized)); } - if (Validator.isNotNull(redirect)) { url = HttpUtil.addParameter(url, "redirect", redirect); } - return url; } - public static String getDettPraticaURL(HttpServletRequest request, long plid, long resourcePrimKey, - int status) throws PortletModeException, WindowStateException { + public static String getDettPraticaURL(HttpServletRequest request, long plid, long resourcePrimKey, int status) + throws PortletModeException, WindowStateException { + return getDettPraticaURL(request, plid, resourcePrimKey, status, null); } - public static String getDettPraticaURL(HttpServletRequest request, long plid, long resourcePrimKey, - int status, String redirect) throws PortletModeException, WindowStateException { + public static String getDettPraticaURL(HttpServletRequest request, long plid, long resourcePrimKey, int status, + String redirect) throws PortletModeException, WindowStateException { - PortletURL url = PortletURLFactoryUtil.create(request, PortletKeys.FASCICOLO, plid, - PortletRequest.RENDER_PHASE); + PortletURL url = PortletURLFactoryUtil + .create(request, PortletKeys.FASCICOLO, plid, PortletRequest.RENDER_PHASE); url.setParameter("mvcPath", "/html/pratichegeniocivile/view.jsp"); url.setParameter("resourcePrimKey", String.valueOf(resourcePrimKey)); url.setParameter("redirect", redirect); url.setPortletMode(PortletMode.VIEW); url.setWindowState(LiferayWindowState.POP_UP); - if (status != WorkflowConstants.STATUS_APPROVED) { url.setParameter("status", String.valueOf(status)); } - return url.toString(); } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/GestioneFirmeUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/GestioneFirmeUtil.java index 807f8ff3..67f55a39 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/GestioneFirmeUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/GestioneFirmeUtil.java @@ -29,22 +29,24 @@ public class GestioneFirmeUtil { public static boolean hasFirmaPermision(long userId, long groupId) throws PortalException, SystemException { + return UserGroupRoleLocalServiceUtil.hasUserGroupRole(userId, groupId, Constants.ROLE_NAME_FIRMA, true); } public static boolean hasFirmaPermisionDirigente(long userId, long groupId) throws PortalException, SystemException { + return UserGroupRoleLocalServiceUtil.hasUserGroupRole(userId, groupId, Constants.ROLE_NAME_FIRMA_DIRIGENTE, true); } public static boolean userCanSignAvviso(long userId, long groupId, long avvisoId) throws PortalException, SystemException { + Avviso avviso = AvvisoLocalServiceUtil.getAvviso(avvisoId); boolean firma = hasFirmaPermision(userId, groupId); boolean firmaDirigente = hasFirmaPermisionDirigente(userId, groupId); - return firmaDirigente || (firma && tipoDocumentoFirmaBase.contains(avviso.getTipoDocumento())); } @@ -53,7 +55,6 @@ public class GestioneFirmeUtil { Role role = RoleLocalServiceUtil.getRole(companyId, Constants.ROLE_NAME_FIRMA_DIRIGENTE); String codiceFiscaleFirma = StringPool.BLANK; - if (tipoDocumentoFirmaBase.contains(tipoDocumento)) { role = RoleLocalServiceUtil.getRole(companyId, Constants.ROLE_NAME_FIRMA_PO); } else { @@ -61,7 +62,6 @@ public class GestioneFirmeUtil { } List UserGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole( groupId, role.getRoleId()); - if (UserGroupRoles.size() == 1) { User user = UserLocalServiceUtil.getUser(UserGroupRoles.get(0).getUserId()); codiceFiscaleFirma = user.getScreenName(); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/MockAllegato.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/MockAllegato.java index cb3c2b37..37c6ee35 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/MockAllegato.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/MockAllegato.java @@ -5,6 +5,7 @@ public class MockAllegato { public String status, name, tipo, invalidato; public MockAllegato(boolean checked, String status, String name, String tipo, String invalidato) { + super(); this.checked = checked; this.status = status; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/PagamentiUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/PagamentiUtil.java index d34bd00f..e5277cbc 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/PagamentiUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/PagamentiUtil.java @@ -49,58 +49,48 @@ public abstract class PagamentiUtil { private static final Log _log = LogFactoryUtil.getLog(PagamentiUtil.class); - public static void verificaPagamentoIRIS(Pagamento pagamento) throws IOException, SystemException, - PortalException { + public static void verificaPagamentoIRIS(Pagamento pagamento) throws IOException, SystemException, PortalException { String statoPagamento = callVerificaPagamenti(pagamento); if (Validator.isNotNull(statoPagamento)) { if (DettPratica.class.getName().equals(pagamento.getClassName())) { - DettPraticaLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), - pagamento.getClassPk(), statoPagamento); + DettPraticaLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), pagamento.getClassPk(), + statoPagamento); } else if (FineLavori.class.getName().equals(pagamento.getClassName())) { - FineLavoriLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), - pagamento.getClassPk(), statoPagamento); + FineLavoriLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), pagamento.getClassPk(), + statoPagamento); } else if (Collaudo.class.getName().equals(pagamento.getClassName())) { - CollaudoLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), - pagamento.getClassPk(), statoPagamento); + CollaudoLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), pagamento.getClassPk(), + statoPagamento); } else { throw new RuntimeException("unable to update pagamento esito for entity type " + pagamento.getClassName() + " with id " + pagamento.getClassPk()); } } - } private static String callVerificaPagamenti(Pagamento pagamento) throws SystemException { long companyId = pagamento.getCompanyId(); long groupId = pagamento.getGroupId(); - if (PagamentoConstants.PAGAMENTO_ONERI.equals(pagamento.getTipoPagamento())) { - InformazioniPagamentoType[] statoPagamentiType = IrisVerificaPagamenti.verificaPagamenti( - companyId, groupId, pagamento.getCodice(), pagamento.getTipoPagamento()); - + InformazioniPagamentoType[] statoPagamentiType = IrisVerificaPagamenti.verificaPagamenti(companyId, + groupId, pagamento.getCodice(), pagamento.getTipoPagamento()); return checkStatoPagamento(statoPagamentiType); - } else if (PagamentoConstants.PAGAMENTO_BOLLI.equals(pagamento.getTipoPagamento())) { List iuvs = IUVLocalServiceUtil.findByPagamento(pagamento.getPagamentoId()); List statiPagamento = new ArrayList(); for (IUV iuv : iuvs) { - InformazioniPagamentoType[] statoPagamentiType = IrisVerificaPagamenti.verificaPagamenti( - companyId, groupId, iuv.getCodice(), pagamento.getTipoPagamento()); + InformazioniPagamentoType[] statoPagamentiType = IrisVerificaPagamenti.verificaPagamenti(companyId, + groupId, iuv.getCodice(), pagamento.getTipoPagamento()); GenericUtils.addIfnotExist(statiPagamento, checkStatoPagamento(statoPagamentiType)); } - if (statiPagamento.size() > 1) { - // return - // VerificaStatoPagamentoDettagliato._POSIZIONE_CON_PAG_IN_CORSO; return StringPool.BLANK; } return statiPagamento.get(0); } - throw new SystemException("error.geniocivile.tipopagamento.notexist"); - } private static String checkStatoPagamento(InformazioniPagamentoType[] statoPagamentiType) { @@ -108,10 +98,8 @@ public abstract class PagamentiUtil { if (statoPagamentiType == null) { return null; } - InformazioniPagamentoType statoPagamentoType = statoPagamentiType[0]; String statoPendenza = statoPagamentoType.getStato().getValue(); - String statoPagamento = StringPool.BLANK; if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGATA)) { if (statoPagamentoType.getDescrizioneStato().equalsIgnoreCase( @@ -127,26 +115,17 @@ public abstract class PagamentiUtil { } else if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGABILE)) { // "Posizione non pagabile" -> esito negativo statoPagamento = PagamentoConstants.UTILIZZATA_NON_PAGABILE; - // } else if (statoPendenza.equals(StatoPagamentoType._value3)) { - // "Pagamento non ancora eseguito" -> si riprova successivamente - // if (!pagamento.getOtf()) { - // return; - // } - // "Pagamento non eseguito" -> esito negativo - // statoPagamento = PagamentoConstants.UTILIZZATA_RIFIUTATA; _log.debug(statoPagamento); } else if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_PAGATA) || statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_PAGATA_SBF)) { // "Pagamento eseguito" -> esito positivo statoPagamento = PagamentoConstants.UTILIZZATA_PAGATA; _log.debug(statoPagamento); - } else if (statoPendenza - .equalsIgnoreCase(VerificaStatoPagamentoDettagliato._POSIZIONE_CON_PAG_IN_CORSO)) { + } else if (statoPendenza.equalsIgnoreCase(VerificaStatoPagamentoDettagliato._POSIZIONE_CON_PAG_IN_CORSO)) { // "Pagamento non eseguito" -> esito in corso statoPagamento = PagamentoConstants.UTILIZZATA_IN_CORSO; return StringPool.BLANK; } - return statoPagamento; } @@ -169,18 +148,16 @@ public abstract class PagamentiUtil { return pagamento.getCreateDate().compareTo(getScadenzaPending()) < 0; } - public static Pagamento nuovoPagamento(String currentURL, long classPk, String className, - String tipoPagamento, String importo, String codiceFiscaleCommittente, - ServiceContext serviceContext) throws PortalException, SystemException { + public static Pagamento nuovoPagamento(String currentURL, long classPk, String className, String tipoPagamento, + String importo, String codiceFiscaleCommittente, ServiceContext serviceContext) throws PortalException, + SystemException { boolean irisDisabled = !PagamentiCommonUtil.irisIsEnable(serviceContext.getCompanyId()); - boolean esenzioneBolli = false; boolean esenzioneSpeseIstruttoria = false; String tipoIntegrazione = StringPool.BLANK; - long pagamentoId = 0l; - long intPraticaId = 0l; - + long pagamentoId = 0L; + long intPraticaId = 0L; if (DettPratica.class.getName().equals(className)) { DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(classPk); esenzioneBolli = dettPratica.isNormEsenteBollo(); @@ -217,15 +194,12 @@ public abstract class PagamentiUtil { } else { throw new SystemException("error.fields.pratica.pagamento.classPk.invalid"); } - List importi = new ArrayList<>(); - if (esenzioneSpeseIstruttoria && esenzioneBolli) { throw new SystemException("error.fields.pratica.pagamento.esente.oneri.bolli"); } else { if ((PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento) && !esenzioneBolli) || (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento) && !esenzioneSpeseIstruttoria)) { - if (Validator.isNotNull(importo)) { importo = importo.replaceAll(StringPool.COMMA, StringPool.PERIOD); try { @@ -240,7 +214,6 @@ public abstract class PagamentiUtil { } else if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) { importi.add(importo); } - } catch (NumberFormatException e) { throw new SystemException("error.fields.pratica.pagamento." + (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento) ? "bolli" @@ -258,10 +231,8 @@ public abstract class PagamentiUtil { return null; } } - if (!irisDisabled) { if (Validator.isNull(pagamentoId)) { - Soggetto committente = SoggettoLocalServiceUtil .getValidTmpByIntPratica_CodiceFiscale_TipologiaSoggetto(intPraticaId, codiceFiscaleCommittente, TipoSoggettoUtil.COMMITTENTE); @@ -270,59 +241,44 @@ public abstract class PagamentiUtil { if (codiceProvincia.equalsIgnoreCase("ee")) { provincia = "EE"; } else { - Provincia provinciaEntity = ProvinciaLocalServiceUtil.fetchByC_C( - serviceContext.getCompanyId(), codiceProvincia); + Provincia provinciaEntity = ProvinciaLocalServiceUtil.fetchByC_C(serviceContext.getCompanyId(), + codiceProvincia); if (Validator.isNotNull(provinciaEntity)) { provincia = provinciaEntity.getSigla(); } } - String codice = IrisCommonUtil.createCodicePendenza(); String causale = IrisCommonUtil.getDescrizioneCausale(tipoPagamento); - long irisPagamentoId = PagamentoLocalServiceUtil.createPagamentoId(); - currentURL = StringUtil.replaceLast(currentURL, "/0", StringPool.SLASH + irisPagamentoId); - String auth = HttpUtil.getParameter(currentURL, "p_auth", false); - // XXX Se non li rimuovi non funziona più - Map parameters = HttpUtil.getParameterMap(HttpUtil - .getQueryString(currentURL)); + Map parameters = HttpUtil.getParameterMap(HttpUtil.getQueryString(currentURL)); for (String key : parameters.keySet()) { currentURL = HttpUtil.removeParameter(currentURL, key); } - if (Validator.isNotNull(auth)) { currentURL = HttpUtil.addParameter(currentURL, "p_auth", auth); } - if (Validator.isNull(codiceFiscaleCommittente)) { throw new SystemException("error.fields.pratica.pagamento.codicefiscale.richiesto"); } - List iuvs = new ArrayList(); if (PagamentoConstants.PAGAMENTO_BOLLI.equalsIgnoreCase(tipoPagamento)) { - iuvs = IrisComunicaPosizioniDebitorie.generaIUV(serviceContext.getCompanyId(), - importi.size()); + iuvs = IrisComunicaPosizioniDebitorie.generaIUV(serviceContext.getCompanyId(), importi.size()); } - IdpOTFType idpOTFType = IrisComunicaPosizioniDebitorie.comunicaPosizioniDebitorieOTF( - serviceContext.getCompanyId(), serviceContext.getScopeGroupId(), - serviceContext.getUserId(), codice, causale, codiceFiscaleCommittente, tipoPagamento, - importi, iuvs, currentURL, currentURL, provincia); - + serviceContext.getCompanyId(), serviceContext.getScopeGroupId(), serviceContext.getUserId(), + codice, causale, codiceFiscaleCommittente, tipoPagamento, importi, iuvs, currentURL, + currentURL, provincia); String urlPagamento = StringPool.BLANK; - if (idpOTFType == null) { urlPagamento = currentURL; - throw new SystemException("error.geniocivilefe.pratica.pagamento | intPraticaId=" - + intPraticaId + " | classPk=" + classPk + " | className=" + className); - + throw new SystemException("error.geniocivilefe.pratica.pagamento | intPraticaId=" + intPraticaId + + " | classPk=" + classPk + " | className=" + className); } else { urlPagamento = idpOTFType.getUrlGW().toString(); } - return PagamentoLocalServiceUtil.addPagamentoAndUpdate(irisPagamentoId, codice, causale, PagamentoConstants.MEZZO_IRIS, codiceFiscaleCommittente, tipoPagamento, importo, PagamentoConstants.UTILIZZATA_IN_CORSO, classPk, className, 0l, urlPagamento, iuvs, @@ -347,6 +303,5 @@ public abstract class PagamentiUtil { } return null; } - } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/workflow/ControlloPraticaWorkflowHandler.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/workflow/ControlloPraticaWorkflowHandler.java index 84fe0be8..1537ec0e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/workflow/ControlloPraticaWorkflowHandler.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/workflow/ControlloPraticaWorkflowHandler.java @@ -26,11 +26,13 @@ public class ControlloPraticaWorkflowHandler extends BaseWorkflowHandler { @Override public String getClassName() { + return ControlloPratica.class.getName(); } @Override public String getType(Locale locale) { + return "controlloPratica"; } @@ -41,91 +43,25 @@ public class ControlloPraticaWorkflowHandler extends BaseWorkflowHandler { if (Validator.isNull(workflowContext)) { workflowContext = new HashMap(); } - - // ControlloPratica issueEvent = (ControlloPratica) model; - // - // - // Issue issue = - // IssueLocalServiceUtil.getIssue(issueEvent.getIssueId()); - // - // - // - // String host = IssueUtil.generateIssueLink(issue); - // // workflowContext.put(WorkflowConstants.ENI_ROLE_LIST, - // issueEvent.getRoleList()); - // - // Organization orgSubsi = - // OrganizationLocalServiceUtil.getOrganization(issue.getSubsidiaryOrgId()); - // Organization orgHq = - // OrganizationLocalServiceUtil.getOrganization(companyId, - // Constants.EMERGENCY_HQ_ORG); - // List orgHqSubsi = new ArrayList(); - // - // String subsidiaryCountry = (String) - // orgSubsi.getExpandoBridge().getAttribute(Constants.CUSTOM_FIELD_ORG_COUNTRY); - // EniGroupUtil.retriveHqbySubsidiary(companyId, orgHqSubsi, - // subsidiaryCountry); - // String orgList = orgHq.getOrganizationId() + "," + - // orgSubsi.getOrganizationId(); - // for (Organization organization : orgHqSubsi) { - // orgList += "," + organization.getOrganizationId(); - // } - // - // workflowContext.put(WorkflowConstants.ENI_ORG_LIST, orgList); - // - // workflowContext.put(WorkflowConstants.ENI_ISSUE_VERSION, - // issue.getIssueVersion()); - // workflowContext.put(WorkflowConstants.ENI_TRAINING, - // issue.getEmTraining()); - // workflowContext.put(WorkflowConstants.ENI_COUNTRY, - // issue.getCountry()); - // workflowContext.put(WorkflowConstants.ENI_SUBSIDIARY, - // OrganizationLocalServiceUtil.getOrganization(issue.getSubsidiaryOrgId()).getName()); - // workflowContext.put(WorkflowConstants.ENI_SITE_NAME, - // issue.getEmSite()); - // workflowContext.put(WorkflowConstants.ENI_SITE_DESCRIPTION, - // issue.getEmSiteDescription()); - // workflowContext.put(WorkflowConstants.ENI_SITE_URL, host); - // workflowContext.put(WorkflowConstants.ENI_ISSUE_DATE, - // DateUtil.getLocalTimeString(issue.getEmTimezone(), Locale.US, - // issue.getIssueDate())); - // workflowContext.put(WorkflowConstants.ENI_ISSUE_STATUS, - // issue.getEmStatus()); - // workflowContext.put(WorkflowConstants.ENI_ISSUE_GROUP_ID, - // issue.getGroupId()); - // workflowContext.put(WorkflowConstants.ENI_ISSUE_EM_LEVEL, - // issue.getEmLevel()); - // workflowContext.put(WorkflowConstants.ENI_FILE_ENTRY_ATTACHMENT_ID, - // issue.getFileEntryAttachmentId()); - // workflowContext.put(WorkflowConstants.ENI_FILE_ENTRY_ATTACHMENT_WELL_ID, - // issue.getFileEntryQuotedWellSketchId()); super.startWorkflowInstance(companyId, groupId, userId, classPK, model, workflowContext); } @Override public Object updateStatus(int status, Map workflowContext) throws PortalException, SystemException { - long userId = GetterUtil.getLong(workflowContext.get(WorkflowConstants.CONTEXT_USER_ID)); - long resourcePrimKey = GetterUtil.getLong(workflowContext - .get(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK)); - - ServiceContext serviceContext = (ServiceContext) workflowContext - .get(WorkflowConstants.CONTEXT_SERVICE_CONTEXT); + long userId = GetterUtil.getLong(workflowContext.get(WorkflowConstants.CONTEXT_USER_ID)); + long resourcePrimKey = GetterUtil.getLong(workflowContext.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK)); + ServiceContext serviceContext = (ServiceContext) workflowContext.get(WorkflowConstants.CONTEXT_SERVICE_CONTEXT); // bug BO id=7 GESTIONE WORKFLOW VARIANTI List wfNewListVarianti = new ArrayList(); ControlloPratica cp = ControlloPraticaLocalServiceUtil.updateStatus(userId, resourcePrimKey, status, serviceContext, wfNewListVarianti); - // E richiamiamo il nostro metodo che farà update dello status sul - // nostro asset! + // E richiamiamo il nostro metodo che farà update dello status sul nostro asset! if (wfNewListVarianti.size() > 0) { _log.info("wfNewListVarianti size >0" + wfNewListVarianti.size()); - ControlloPraticaLocalServiceUtil.gestioneWFVarianti(wfNewListVarianti.get(0)); } - return cp; - } - } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties index 33213889..ca69d34a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=portos_bo - build.number=2574 - build.date=1618926051044 + build.number=2575 + build.date=1619174539111 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-beanutils.jar b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-beanutils.jar deleted file mode 100644 index 6baf5ecb..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-beanutils.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-codec.jar b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-codec.jar deleted file mode 100644 index 1d7417c4..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-codec.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-collections.jar b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-collections.jar deleted file mode 100644 index fa5df82a..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-collections.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-digester.jar b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-digester.jar deleted file mode 100644 index 1110f0aa..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-digester.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-io.jar b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-io.jar deleted file mode 100644 index 00556b11..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-io.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-lang.jar b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-lang.jar deleted file mode 100644 index 98467d3a..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-lang.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-logging.jar b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-logging.jar deleted file mode 100644 index 8758a96b..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-logging.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/jstl-api.jar b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/jstl-api.jar deleted file mode 100644 index 80a5737f..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/jstl-api.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/jstl-impl.jar b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/jstl-impl.jar deleted file mode 100644 index e5a9342f..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/jstl-impl.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/log4j.jar b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/log4j.jar deleted file mode 100644 index 068867eb..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/log4j.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/util-bridges.jar b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/util-bridges.jar deleted file mode 100644 index 7d7435fe..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/util-bridges.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/util-taglib.jar b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/util-taglib.jar deleted file mode 100644 index fbba5f0a..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/util-taglib.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/tld/c.tld b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/tld/c.tld deleted file mode 100644 index 98efa6a6..00000000 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/tld/c.tld +++ /dev/null @@ -1,572 +0,0 @@ - - - - - JSTL 1.2 core library - JSTL core - 1.2 - c - http://java.sun.com/jsp/jstl/core - - - - Provides core validation features for JSTL tags. - - - org.apache.taglibs.standard.tlv.JstlCoreTLV - - - - - - Catches any Throwable that occurs in its body and optionally - exposes it. - - catch - org.apache.taglibs.standard.tag.common.core.CatchTag - JSP - - -Name of the exported scoped variable for the -exception thrown from a nested action. The type of the -scoped variable is the type of the exception thrown. - - var - false - false - - - - - - Simple conditional tag that establishes a context for - mutually exclusive conditional operations, marked by - <when> and <otherwise> - - choose - com.liferay.taglib.core.ChooseTag - JSP - - - - - Simple conditional tag, which evalutes its body if the - supplied condition is true and optionally exposes a Boolean - scripting variable representing the evaluation of this condition - - if - com.liferay.taglib.core.IfTag - JSP - - -The test condition that determines whether or -not the body content should be processed. - - test - true - true - boolean - - - -Name of the exported scoped variable for the -resulting value of the test condition. The type -of the scoped variable is Boolean. - - var - false - false - - - -Scope for var. - - scope - false - false - - - - - - Retrieves an absolute or relative URL and exposes its contents - to either the page, a String in 'var', or a Reader in 'varReader'. - - import - org.apache.taglibs.standard.tag.rt.core.ImportTag - org.apache.taglibs.standard.tei.ImportTEI - JSP - - -The URL of the resource to import. - - url - true - true - - - -Name of the exported scoped variable for the -resource's content. The type of the scoped -variable is String. - - var - false - false - - - -Scope for var. - - scope - false - false - - - -Name of the exported scoped variable for the -resource's content. The type of the scoped -variable is Reader. - - varReader - false - false - - - -Name of the context when accessing a relative -URL resource that belongs to a foreign -context. - - context - false - true - - - -Character encoding of the content at the input -resource. - - charEncoding - false - true - - - - - - The basic iteration tag, accepting many different - collection types and supporting subsetting and other - functionality - - forEach - org.apache.taglibs.standard.tag.rt.core.ForEachTag - org.apache.taglibs.standard.tei.ForEachTEI - JSP - - -Collection of items to iterate over. - - items - false - true - java.lang.Object - - java.lang.Object - - - - -If items specified: -Iteration begins at the item located at the -specified index. First item of the collection has -index 0. -If items not specified: -Iteration begins with index set at the value -specified. - - begin - false - true - int - - - -If items specified: -Iteration ends at the item located at the -specified index (inclusive). -If items not specified: -Iteration ends when index reaches the value -specified. - - end - false - true - int - - - -Iteration will only process every step items of -the collection, starting with the first one. - - step - false - true - int - - - -Name of the exported scoped variable for the -current item of the iteration. This scoped -variable has nested visibility. Its type depends -on the object of the underlying collection. - - var - false - false - - - -Name of the exported scoped variable for the -status of the iteration. Object exported is of type -javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested -visibility. - - varStatus - false - false - - - - - - Iterates over tokens, separated by the supplied delimeters - - forTokens - org.apache.taglibs.standard.tag.rt.core.ForTokensTag - JSP - - -String of tokens to iterate over. - - items - true - true - java.lang.String - - java.lang.String - - - - -The set of delimiters (the characters that -separate the tokens in the string). - - delims - true - true - java.lang.String - - - -Iteration begins at the token located at the -specified index. First token has index 0. - - begin - false - true - int - - - -Iteration ends at the token located at the -specified index (inclusive). - - end - false - true - int - - - -Iteration will only process every step tokens -of the string, starting with the first one. - - step - false - true - int - - - -Name of the exported scoped variable for the -current item of the iteration. This scoped -variable has nested visibility. - - var - false - false - - - -Name of the exported scoped variable for the -status of the iteration. Object exported is of -type -javax.servlet.jsp.jstl.core.LoopTag -Status. This scoped variable has nested -visibility. - - varStatus - false - false - - - - - - Like <%= ... >, but for expressions. - - out - org.apache.taglibs.standard.tag.rt.core.OutTag - JSP - - -Expression to be evaluated. - - value - true - true - - - -Default value if the resulting value is null. - - default - false - true - - - -Determines whether characters <,>,&,'," in the -resulting string should be converted to their -corresponding character entity codes. Default value is -true. - - escapeXml - false - true - - - - - - - Subtag of <choose> that follows <when> tags - and runs only if all of the prior conditions evaluated to - 'false' - - otherwise - com.liferay.taglib.core.OtherwiseTag - JSP - - - - - Adds a parameter to a containing 'import' tag's URL. - - param - org.apache.taglibs.standard.tag.rt.core.ParamTag - JSP - - -Name of the query string parameter. - - name - true - true - - - -Value of the parameter. - - value - false - true - - - - - - Redirects to a new URL. - - redirect - org.apache.taglibs.standard.tag.rt.core.RedirectTag - JSP - - -The URL of the resource to redirect to. - - url - false - true - - - -Name of the context when redirecting to a relative URL -resource that belongs to a foreign context. - - context - false - true - - - - - - Removes a scoped variable (from a particular scope, if specified). - - remove - org.apache.taglibs.standard.tag.common.core.RemoveTag - empty - - -Name of the scoped variable to be removed. - - var - true - false - - - -Scope for var. - - scope - false - false - - - - - - Sets the result of an expression evaluation in a 'scope' - - set - org.apache.taglibs.standard.tag.rt.core.SetTag - JSP - - -Name of the exported scoped variable to hold the value -specified in the action. The type of the scoped variable is -whatever type the value expression evaluates to. - - var - false - false - - - -Expression to be evaluated. - - value - false - true - - java.lang.Object - - - - -Target object whose property will be set. Must evaluate to -a JavaBeans object with setter property property, or to a -java.util.Map object. - - target - false - true - - - -Name of the property to be set in the target object. - - property - false - true - - - -Scope for var. - - scope - false - false - - - - - - Creates a URL with optional query parameters. - - url - org.apache.taglibs.standard.tag.rt.core.UrlTag - JSP - - -Name of the exported scoped variable for the -processed url. The type of the scoped variable is -String. - - var - false - false - - - -Scope for var. - - scope - false - false - - - -URL to be processed. - - value - false - true - - - -Name of the context when specifying a relative URL -resource that belongs to a foreign context. - - context - false - true - - - - - - Subtag of <choose> that includes its body if its - condition evalutes to 'true' - - when - com.liferay.taglib.core.WhenTag - JSP - - -The test condition that determines whether or not the -body content should be processed. - - test - true - true - boolean - - - - diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties index 2b38b8e9..95f7a331 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=Kaleo - build.number=28 - build.date=1616062122215 + build.number=29 + build.date=1619174642482 build.auto.upgrade=true ##