diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/httpclient.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/httpclient.jar deleted file mode 100644 index 970c9891..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/httpclient.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/util-java.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/util-java.jar deleted file mode 100644 index 6b5d95f8..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/util-java.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DocPraticaLocalService.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DocPraticaLocalService.java index f32da7df..9f14d37b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DocPraticaLocalService.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DocPraticaLocalService.java @@ -472,6 +472,11 @@ public interface DocPraticaLocalService extends BaseLocalService, java.lang.String tipologia) throws com.liferay.portal.kernel.exception.SystemException; + @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) + public java.util.List getValidTmpByIntPratica( + long intPraticaId, int start, int end) + throws com.liferay.portal.kernel.exception.SystemException; + @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public java.util.List getValidTmpByIntPratica_Tipologia( long intPraticaId, java.lang.String tipologia, int start, int end) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DocPraticaLocalServiceClp.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DocPraticaLocalServiceClp.java index 92508af8..05b015e9 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DocPraticaLocalServiceClp.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DocPraticaLocalServiceClp.java @@ -297,61 +297,65 @@ public class DocPraticaLocalServiceClp implements DocPraticaLocalService { _methodParameterTypes54 = new String[] { "long", "java.lang.String" }; - _methodName55 = "getValidTmpByIntPratica_Tipologia"; + _methodName55 = "getValidTmpByIntPratica"; - _methodParameterTypes55 = new String[] { + _methodParameterTypes55 = new String[] { "long", "int", "int" }; + + _methodName56 = "getValidTmpByIntPratica_Tipologia"; + + _methodParameterTypes56 = new String[] { "long", "java.lang.String", "int", "int" }; - _methodName56 = "getValidTmpByIntPratica_DettPratica_Tipologia"; + _methodName57 = "getValidTmpByIntPratica_DettPratica_Tipologia"; - _methodParameterTypes56 = new String[] { + _methodParameterTypes57 = new String[] { "long", "long", "java.lang.String", "int", "int" }; - _methodName57 = "getValidTmpByIntPratica_Tipologie"; + _methodName58 = "getValidTmpByIntPratica_Tipologie"; - _methodParameterTypes57 = new String[] { + _methodParameterTypes58 = new String[] { "long", "java.lang.String[][]", "int", "int" }; - _methodName58 = "countValidTmpByIntPratica_Tipologie"; + _methodName59 = "countValidTmpByIntPratica_Tipologie"; - _methodParameterTypes58 = new String[] { "long", "java.lang.String[][]" }; + _methodParameterTypes59 = new String[] { "long", "java.lang.String[][]" }; - _methodName59 = "getInvalidByIntPratica"; + _methodName60 = "getInvalidByIntPratica"; - _methodParameterTypes59 = new String[] { "long" }; + _methodParameterTypes60 = new String[] { "long" }; - _methodName60 = "getInvalidTmpByIntPratica"; + _methodName61 = "getInvalidTmpByIntPratica"; - _methodParameterTypes60 = new String[] { "long" }; + _methodParameterTypes61 = new String[] { "long" }; - _methodName61 = "getValidUntilClassPkByIntPratica"; + _methodName62 = "getValidUntilClassPkByIntPratica"; - _methodParameterTypes61 = new String[] { + _methodParameterTypes62 = new String[] { "long", "long", "java.lang.String", "int", "int" }; - _methodName62 = "completeInvalidation"; + _methodName63 = "completeInvalidation"; - _methodParameterTypes62 = new String[] { "long" }; + _methodParameterTypes63 = new String[] { "long" }; - _methodName63 = "getDocPraticaWithOldFileEntryId"; + _methodName64 = "getDocPraticaWithOldFileEntryId"; - _methodParameterTypes63 = new String[] { "int", "int" }; + _methodParameterTypes64 = new String[] { "int", "int" }; - _methodName64 = "addDocPraticaAnnullamento"; + _methodName65 = "addDocPraticaAnnullamento"; - _methodParameterTypes64 = new String[] { + _methodParameterTypes65 = new String[] { "long", "java.lang.String", "long", "long", "long", "java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String", "com.liferay.portal.service.ServiceContext" }; - _methodName65 = "findByIntPratica_ClassPk_TipologiaNew"; + _methodName66 = "findByIntPratica_ClassPk_TipologiaNew"; - _methodParameterTypes65 = new String[] { + _methodParameterTypes66 = new String[] { "long", "long", "java.lang.String", "int", "int" }; } @@ -2252,14 +2256,44 @@ public class DocPraticaLocalServiceClp implements DocPraticaLocalService { } @Override - public java.util.List getValidTmpByIntPratica_Tipologia( - long intPraticaId, java.lang.String tipologia, int start, int end) + public java.util.List getValidTmpByIntPratica( + long intPraticaId, int start, int end) throws com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; try { returnObj = _invokableLocalService.invokeMethod(_methodName55, _methodParameterTypes55, + new Object[] { intPraticaId, start, end }); + } + catch (Throwable t) { + t = ClpSerializer.translateThrowable(t); + + if (t instanceof com.liferay.portal.kernel.exception.SystemException) { + throw (com.liferay.portal.kernel.exception.SystemException)t; + } + + if (t instanceof RuntimeException) { + throw (RuntimeException)t; + } + else { + throw new RuntimeException(t.getClass().getName() + + " is not a valid exception"); + } + } + + return (java.util.List)ClpSerializer.translateOutput(returnObj); + } + + @Override + public java.util.List getValidTmpByIntPratica_Tipologia( + long intPraticaId, java.lang.String tipologia, int start, int end) + throws com.liferay.portal.kernel.exception.SystemException { + Object returnObj = null; + + try { + returnObj = _invokableLocalService.invokeMethod(_methodName56, + _methodParameterTypes56, new Object[] { intPraticaId, @@ -2297,8 +2331,8 @@ public class DocPraticaLocalServiceClp implements DocPraticaLocalService { Object returnObj = null; try { - returnObj = _invokableLocalService.invokeMethod(_methodName56, - _methodParameterTypes56, + returnObj = _invokableLocalService.invokeMethod(_methodName57, + _methodParameterTypes57, new Object[] { intPraticaId, @@ -2337,8 +2371,8 @@ public class DocPraticaLocalServiceClp implements DocPraticaLocalService { Object returnObj = null; try { - returnObj = _invokableLocalService.invokeMethod(_methodName57, - _methodParameterTypes57, + returnObj = _invokableLocalService.invokeMethod(_methodName58, + _methodParameterTypes58, new Object[] { intPraticaId, @@ -2375,8 +2409,8 @@ public class DocPraticaLocalServiceClp implements DocPraticaLocalService { Object returnObj = null; try { - returnObj = _invokableLocalService.invokeMethod(_methodName58, - _methodParameterTypes58, + returnObj = _invokableLocalService.invokeMethod(_methodName59, + _methodParameterTypes59, new Object[] { intPraticaId, @@ -2409,8 +2443,8 @@ public class DocPraticaLocalServiceClp implements DocPraticaLocalService { Object returnObj = null; try { - returnObj = _invokableLocalService.invokeMethod(_methodName59, - _methodParameterTypes59, new Object[] { intPraticaId }); + returnObj = _invokableLocalService.invokeMethod(_methodName60, + _methodParameterTypes60, new Object[] { intPraticaId }); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); @@ -2438,8 +2472,8 @@ public class DocPraticaLocalServiceClp implements DocPraticaLocalService { Object returnObj = null; try { - returnObj = _invokableLocalService.invokeMethod(_methodName60, - _methodParameterTypes60, new Object[] { intPraticaId }); + returnObj = _invokableLocalService.invokeMethod(_methodName61, + _methodParameterTypes61, new Object[] { intPraticaId }); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); @@ -2467,8 +2501,8 @@ public class DocPraticaLocalServiceClp implements DocPraticaLocalService { Object returnObj = null; try { - returnObj = _invokableLocalService.invokeMethod(_methodName61, - _methodParameterTypes61, + returnObj = _invokableLocalService.invokeMethod(_methodName62, + _methodParameterTypes62, new Object[] { intPraticaId, @@ -2504,8 +2538,8 @@ public class DocPraticaLocalServiceClp implements DocPraticaLocalService { public void completeInvalidation(long intPraticaId) throws com.liferay.portal.kernel.exception.SystemException { try { - _invokableLocalService.invokeMethod(_methodName62, - _methodParameterTypes62, new Object[] { intPraticaId }); + _invokableLocalService.invokeMethod(_methodName63, + _methodParameterTypes63, new Object[] { intPraticaId }); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); @@ -2531,8 +2565,8 @@ public class DocPraticaLocalServiceClp implements DocPraticaLocalService { Object returnObj = null; try { - returnObj = _invokableLocalService.invokeMethod(_methodName63, - _methodParameterTypes63, new Object[] { start, end }); + returnObj = _invokableLocalService.invokeMethod(_methodName64, + _methodParameterTypes64, new Object[] { start, end }); } catch (Throwable t) { t = ClpSerializer.translateThrowable(t); @@ -2565,8 +2599,8 @@ public class DocPraticaLocalServiceClp implements DocPraticaLocalService { Object returnObj = null; try { - returnObj = _invokableLocalService.invokeMethod(_methodName64, - _methodParameterTypes64, + returnObj = _invokableLocalService.invokeMethod(_methodName65, + _methodParameterTypes65, new Object[] { userId, @@ -2619,8 +2653,8 @@ public class DocPraticaLocalServiceClp implements DocPraticaLocalService { Object returnObj = null; try { - returnObj = _invokableLocalService.invokeMethod(_methodName65, - _methodParameterTypes65, + returnObj = _invokableLocalService.invokeMethod(_methodName66, + _methodParameterTypes66, new Object[] { intPraticaId, @@ -2783,4 +2817,6 @@ public class DocPraticaLocalServiceClp implements DocPraticaLocalService { private String[] _methodParameterTypes64; private String _methodName65; private String[] _methodParameterTypes65; + private String _methodName66; + private String[] _methodParameterTypes66; } \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DocPraticaLocalServiceUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DocPraticaLocalServiceUtil.java index c025c5a9..71b4d638 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DocPraticaLocalServiceUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DocPraticaLocalServiceUtil.java @@ -589,6 +589,12 @@ public class DocPraticaLocalServiceUtil { .countValidTmpByIntPratica_Tipologia(intPraticaId, tipologia); } + public static java.util.List getValidTmpByIntPratica( + long intPraticaId, int start, int end) + throws com.liferay.portal.kernel.exception.SystemException { + return getService().getValidTmpByIntPratica(intPraticaId, start, end); + } + public static java.util.List getValidTmpByIntPratica_Tipologia( long intPraticaId, java.lang.String tipologia, int start, int end) throws com.liferay.portal.kernel.exception.SystemException { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DocPraticaLocalServiceWrapper.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DocPraticaLocalServiceWrapper.java index 0e22f4ed..5fd5ff36 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DocPraticaLocalServiceWrapper.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/DocPraticaLocalServiceWrapper.java @@ -632,6 +632,14 @@ public class DocPraticaLocalServiceWrapper implements DocPraticaLocalService, tipologia); } + @Override + public java.util.List getValidTmpByIntPratica( + long intPraticaId, int start, int end) + throws com.liferay.portal.kernel.exception.SystemException { + return _docPraticaLocalService.getValidTmpByIntPratica(intPraticaId, + start, end); + } + @Override public java.util.List getValidTmpByIntPratica_Tipologia( long intPraticaId, java.lang.String tipologia, int start, int end) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/DocumentiPraticaUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/DocumentiPraticaUtil.java index ea8c97b5..1a681ed2 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/DocumentiPraticaUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/DocumentiPraticaUtil.java @@ -86,7 +86,6 @@ public class DocumentiPraticaUtil { doc.add(TIPOLOGIA_ALLEGATO_A02); doc.add(TIPOLOGIA_ALLEGATO_A03); doc.add(TIPOLOGIA_ALLEGATO_A04); - doc.add(TIPOLOGIA_ALLEGATO_A05); doc.add(TIPOLOGIA_ALLEGATO_A08); doc.add(TIPOLOGIA_ALLEGATO_A09); doc.add(TIPOLOGIA_ALLEGATO_A10); @@ -100,8 +99,6 @@ public class DocumentiPraticaUtil { doc.add(TIPOLOGIA_ALLEGATO_A19); doc.add(TIPOLOGIA_ALLEGATO_A20); doc.add(TIPOLOGIA_ALLEGATO_A21); - doc.add(TIPOLOGIA_ALLEGATO_A22); - doc.add(TIPOLOGIA_ALLEGATO_A23); doc.add(TIPOLOGIA_ALLEGATO_A24); doc.add(TIPOLOGIA_ALLEGATO_A25); doc.add(TIPOLOGIA_ALLEGATO_A26); @@ -142,7 +139,8 @@ public class DocumentiPraticaUtil { if (dettPratica.getTcOperaA25()) { docObbligatori.add(TIPOLOGIA_ALLEGATO_A25); } - if (dettPratica.getTcCostruzioniEsistenti() || dettPratica.getTcNuovaCostruzionePertinenza()) { + if (dettPratica.getTcCostruzioniEsistenti() || dettPratica.getTcNuovaCostruzionePertinenza() + || (dettPratica.getDestinazione().equals("3") && dettPratica.getTcManutOrdStraord())) { docObbligatori.add(TIPOLOGIA_ALLEGATO_A26); } if (dettPratica.getNoCollaudo()) { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/ValidazionePraticaUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/ValidazionePraticaUtil.java index 6384d0bf..ac24aa01 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/ValidazionePraticaUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/ValidazionePraticaUtil.java @@ -32,10 +32,19 @@ import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Map.Entry; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.mime.HttpMultipartMode; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.entity.mime.content.ByteArrayBody; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.util.EntityUtils; import com.liferay.portal.kernel.dao.orm.QueryUtil; import com.liferay.portal.kernel.exception.PortalException; @@ -45,10 +54,8 @@ import com.liferay.portal.kernel.json.JSONFactoryUtil; import com.liferay.portal.kernel.language.LanguageUtil; import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; -import com.liferay.portal.kernel.util.Http.FilePart; -import com.liferay.portal.kernel.util.Http.Options; -import com.liferay.portal.kernel.util.HttpUtil; import com.liferay.portal.kernel.util.LocaleUtil; +import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.UniqueList; import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.workflow.WorkflowConstants; @@ -230,16 +237,6 @@ public class ValidazionePraticaUtil { DettPratica dettPratica = DettPraticaServiceUtil.getLastCompletedByIntPratica(intPraticaId); - // return Validator.isNotNull(dettPratica) - // && - // userScreenName.equalsIgnoreCase(dettPratica.getCodiceFiscaleDelegatoFineLavori()) - // && - // FineLavoriLocalServiceUtil.countByIntPraticaId_Parziale(intPraticaId, - // false) == 0 - // && !praticaHasFineLavoriInProgress(intPraticaId) && - // !praticaHasVarianteInProgress(intPraticaId) - // && !praticaHasIntegrazioneInProgress(intPraticaId); - return Validator.isNotNull(dettPratica) && userScreenName.equalsIgnoreCase(dettPratica.getCodiceFiscaleDelegatoFineLavori()) && FineLavoriLocalServiceUtil.countByIntPraticaId_Parziale_Completata(intPraticaId, false, @@ -452,21 +449,6 @@ public class ValidazionePraticaUtil { } - public static boolean isDelegaGeologoCompleted(long dettPraticaId) throws PortalException, - SystemException { - - return hasDelegaGeologoCompleted(dettPraticaId).isEmpty(); - } - - public static List hasDelegaGeologoCompleted(long dettPraticaId) throws PortalException, - SystemException { - - List notCompleted = notCompletedDatiSezionGeologica(dettPraticaId); - notCompleted.addAll(notCompletedAllegatiSezionGeologicaDelega(dettPraticaId)); - - return notCompleted; - } - private static List notCompletedDettagliPrincipali(long dettPraticaId) throws PortalException, SystemException { @@ -830,7 +812,7 @@ public class ValidazionePraticaUtil { return notCompleted; } - private static List notCompletedSezioneGeologica(long dettPraticaId) throws PortalException, + public static List notCompletedSezioneGeologica(long dettPraticaId) throws PortalException, SystemException { DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); @@ -864,128 +846,119 @@ public class ValidazionePraticaUtil { + LanguageUtil.get(LocaleUtil.getDefault(), "label-documenti-tipologia-A23")); } + int indaginiGeologiche = DocPraticaLocalServiceUtil.countValidTmpByIntPratica_Tipologie( + dettPratica.getIntPraticaId(), + DocumentiPraticaUtil.getIndaginiGeologiche().toArray(new String[0])); + if (indaginiGeologiche == 0) { + notCompleted.add("Indagini Geologoche non presenti"); + } + + IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); + + notCompleted.addAll(firmeMancanti(intPratica, dettPratica, DocumentiPraticaUtil.getDocGeologo())); + return notCompleted; } - private static List notCompletedDatiSezionGeologica(long dettPraticaId) throws PortalException, - SystemException { - - DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); + private static List firmeMancanti(IntPratica intPratica, DettPratica dettPratica, + List tipologie) throws SystemException { List notCompleted = new ArrayList<>(); - /*if (Validator.isNull(dettPratica.getGeoDtRelazione())) { - notCompleted.add("geo-dt-relazione"); - } - if (Validator.isNull(dettPratica.getGeoClasseIndagine())) { - notCompleted.add("geo-classe-indagine"); - } - if (Validator.isNull(dettPratica.getGeoOperaRilevante())) { - notCompleted.add("geo-opera-rilevante"); - } - if (Validator.isNull(dettPratica.getGeoCategoriaSottosuolo())) { - notCompleted.add("geo-categoria-sottosuolo"); - } - if (Validator.isNull(dettPratica.getGeoCategoriaTopografica())) { - notCompleted.add("geo-categoria-topografica"); - } - if (Validator.isNull(dettPratica.getGeoOpereDiSostegno())) { - notCompleted.add("geo-opere-di-sostegno"); - } - if (Validator.isNull(dettPratica.getGeoConsolidamento())) { - notCompleted.add("geo-consolidamento"); - } - if (Validator.isNull(dettPratica.getGeoOpereInSotterranea())) { - notCompleted.add("geo-opere-in-sotterranea"); - } - if (Validator.isNull(dettPratica.getGeoPericolositaGeologica())) { - notCompleted.add("geo-pericolosita-geologica"); - } - if (Validator.isNull(dettPratica.getGeoPericolositaGeomorfica())) { - notCompleted.add("geo-pericolosita-geomorfica"); - } - if (Validator.isNull(dettPratica.getGeoRischioGeomorfologicoPai())) { - notCompleted.add("geo-rischio-geomorfologico"); - }*/ - if (Validator.isNull(dettPratica.getGeoPericolositaIdraulicaPai())) { - notCompleted.add("geo-pericolosita-idraulica-pai"); - } - if (Validator.isNull(dettPratica.getGeoRischioIdraulicoPai())) { - notCompleted.add("geo-rischio-idraulico-pai"); - } - /*if (Validator.isNull(dettPratica.getGeoPericolositaSismica())) { - notCompleted.add("geo-pericolosita-sismica"); - } - if (Validator.isNull(dettPratica.getGeoFattibilitaSismica())) { - notCompleted.add("geo-fattibilita-sismica"); - } - if (Validator.isNull(dettPratica.getGeoPericolositaIdraulica())) { - notCompleted.add("geo-pericolosita-idraulica"); - } - if (Validator.isNull(dettPratica.getGeoFattibilitaIdraulica())) { - notCompleted.add("geo-fattibilita-idraulica"); - } - if (Validator.isNull(dettPratica.getGeoFattibilitaGeologica())) { - notCompleted.add("geo-fattibilita-geologica"); - } - if (Validator.isNull(dettPratica.getGeoPresenzaPrescrizioni())) { - notCompleted.add("geo-presenza-prescrizioni"); - } - if (Validator.isNull(dettPratica.getGeoEvidenzeGeologiche())) { - notCompleted.add("geo-evidenze-geologiche-short"); + List soggetti = SoggettoLocalServiceUtil.getValidTmpByDettPratica(dettPratica + .getDettPraticaId()); + String cfTitolare = intPratica.getUserName(); + long intPraticaId = intPratica.getIntPraticaId(); + for (String tipologia : tipologie) { + List docs = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologia( + intPraticaId, tipologia, QueryUtil.ALL_POS, QueryUtil.ALL_POS); + List firmeMancanti = new UniqueList<>(); + for (DocPratica doc : docs) { + List firmeObbligatorie = getFirmeObbligatorie(tipologia); + FirmeBean firmeBean = FirmeUtil.deserialize(doc.getJsonFirmatari()); + List firmePresenti = firmeBean.allSignatures(); + + for (Soggetto soggetto : soggetti) { + if (firmePresenti.contains(soggetto.getCodiceFiscale().toLowerCase())) { + firmeObbligatorie.remove(soggetto.getTipologiaSoggetto()); + } + } + if (firmePresenti.contains(cfTitolare)) { + firmeObbligatorie.remove(TipoSoggettoUtil.TITOLARE_DIGITALE); + } + for (String firma : firmeObbligatorie) { + firmeMancanti.add(firma); + } + } + if (!firmeMancanti.isEmpty()) { + List tipologieMancanti = new ArrayList<>(); + for (String firmaMancante : firmeMancanti) { + tipologieMancanti.add(LanguageUtil.get(Locale.getDefault(), "gc-soggetto-" + + firmaMancante)); + } + notCompleted.add(LanguageUtil.get(LocaleUtil.getDefault(), "label-documenti-tipologia-" + + tipologia) + + ", firme mancanti: " + StringUtils.join(tipologieMancanti, ", ")); + } } - if (Validator.isNull(dettPratica.getGeoEvidenzeGeomorfiche())) { - notCompleted.add("geo-evidenze-geomorfiche-short"); - }*/ return notCompleted; + } - private static List notCompletedAllegatiSezionGeologicaDelega(long dettPraticaId) - throws PortalException, SystemException { + private static List notCompletedDatiSezionGeologica(long dettPraticaId) throws PortalException, + SystemException { DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); List notCompleted = new ArrayList<>(); - // Allegati obbligatori devono essere presenti /* - * int a05 = - * DocPraticaLocalServiceUtil.countValidTmpByIntPratica_Tipologia( - * dettPratica.getIntPraticaId(), - * DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A05); + * if (Validator.isNull(dettPratica.getGeoDtRelazione())) { + * notCompleted.add("geo-dt-relazione"); } if + * (Validator.isNull(dettPratica.getGeoClasseIndagine())) { + * notCompleted.add("geo-classe-indagine"); } if + * (Validator.isNull(dettPratica.getGeoOperaRilevante())) { + * notCompleted.add("geo-opera-rilevante"); } if + * (Validator.isNull(dettPratica.getGeoCategoriaSottosuolo())) { + * notCompleted.add("geo-categoria-sottosuolo"); } if + * (Validator.isNull(dettPratica.getGeoCategoriaTopografica())) { + * notCompleted.add("geo-categoria-topografica"); } if + * (Validator.isNull(dettPratica.getGeoOpereDiSostegno())) { + * notCompleted.add("geo-opere-di-sostegno"); } if + * (Validator.isNull(dettPratica.getGeoConsolidamento())) { + * notCompleted.add("geo-consolidamento"); } if + * (Validator.isNull(dettPratica.getGeoOpereInSotterranea())) { + * notCompleted.add("geo-opere-in-sotterranea"); } if + * (Validator.isNull(dettPratica.getGeoPericolositaGeologica())) { + * notCompleted.add("geo-pericolosita-geologica"); } if + * (Validator.isNull(dettPratica.getGeoPericolositaGeomorfica())) { + * notCompleted.add("geo-pericolosita-geomorfica"); } if + * (Validator.isNull(dettPratica.getGeoRischioGeomorfologicoPai())) { + * notCompleted.add("geo-rischio-geomorfologico"); } */ - + if (Validator.isNull(dettPratica.getGeoPericolositaIdraulicaPai())) { + notCompleted.add("geo-pericolosita-idraulica-pai"); + } + if (Validator.isNull(dettPratica.getGeoRischioIdraulicoPai())) { + notCompleted.add("geo-rischio-idraulico-pai"); + } /* - * int a05 = 0; if (a05 == 0) { - * notCompleted.add(LanguageUtil.get(LocaleUtil.getDefault(), - * "label-documenti-tipologia-" + - * DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A05) + " non presente"); } + * if (Validator.isNull(dettPratica.getGeoPericolositaSismica())) { + * notCompleted.add("geo-pericolosita-sismica"); } if + * (Validator.isNull(dettPratica.getGeoFattibilitaSismica())) { + * notCompleted.add("geo-fattibilita-sismica"); } if + * (Validator.isNull(dettPratica.getGeoPericolositaIdraulica())) { + * notCompleted.add("geo-pericolosita-idraulica"); } if + * (Validator.isNull(dettPratica.getGeoFattibilitaIdraulica())) { + * notCompleted.add("geo-fattibilita-idraulica"); } if + * (Validator.isNull(dettPratica.getGeoFattibilitaGeologica())) { + * notCompleted.add("geo-fattibilita-geologica"); } if + * (Validator.isNull(dettPratica.getGeoPresenzaPrescrizioni())) { + * notCompleted.add("geo-presenza-prescrizioni"); } if + * (Validator.isNull(dettPratica.getGeoEvidenzeGeologiche())) { + * notCompleted.add("geo-evidenze-geologiche-short"); } if + * (Validator.isNull(dettPratica.getGeoEvidenzeGeomorfiche())) { + * notCompleted.add("geo-evidenze-geomorfiche-short"); } */ - // int a06 = - // DocPraticaLocalServiceUtil.countValidTmpByIntPratica_Tipologia(dettPratica.getIntPraticaId(), - // DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A06); - // if (a06 == 0) { - // notCompleted.add(LanguageUtil.get(LocaleUtil.getDefault(), - // "label-documenti-tipologia-" - // + DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A06) - // + " non presente"); - // } - - // int a14 = - // DocPraticaLocalServiceUtil.countValidTmpByIntPratica_Tipologia(dettPratica.getIntPraticaId(), - // DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A14); - // if (a14 == 0) { - // notCompleted.add(LanguageUtil.get(LocaleUtil.getDefault(), - // "label-documenti-tipologia-" - // + DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A14) - // + " non presente"); - // } - - int indaginiGeologiche = DocPraticaLocalServiceUtil.countValidTmpByIntPratica_Tipologie( - dettPratica.getIntPraticaId(), - DocumentiPraticaUtil.getIndaginiGeologiche().toArray(new String[0])); - if (indaginiGeologiche == 0) { - notCompleted.add("Indagini Geologoche non presenti"); - } return notCompleted; } @@ -999,7 +972,6 @@ public class ValidazionePraticaUtil { List docObbligatori = DocumentiPraticaUtil.getDocObbligatoriDomanda(intPratica, dettPratica); List soggetti = SoggettoLocalServiceUtil.getValidTmpByDettPratica(dettPraticaId); - String cfTitolare = intPratica.getUserName(); for (String docObbligatorio : docObbligatori) { List docs = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologia( @@ -1008,38 +980,11 @@ public class ValidazionePraticaUtil { notCompleted.add("Nessun allegato per " + LanguageUtil.get(LocaleUtil.getDefault(), "label-documenti-tipologia-" + docObbligatorio)); - } else { - List firmeMancanti = new UniqueList<>(); - for (DocPratica doc : docs) { - List firmeObbligatorie = getFirmeObbligatorie(doc.getTipologia()); - FirmeBean firmeBean = FirmeUtil.deserialize(doc.getJsonFirmatari()); - List firmePresenti = firmeBean.allSignatures(); - - for (Soggetto soggetto : soggetti) { - if (firmePresenti.contains(soggetto.getCodiceFiscale().toLowerCase())) { - firmeObbligatorie.remove(soggetto.getTipologiaSoggetto()); - } - } - if (firmePresenti.contains(cfTitolare)) { - firmeObbligatorie.remove(TipoSoggettoUtil.TITOLARE_DIGITALE); - } - for (String firma : firmeObbligatorie) { - firmeMancanti.add(firma); - } - } - if (!firmeMancanti.isEmpty()) { - List tipologieMancanti = new ArrayList<>(); - for (String firmaMancante : firmeMancanti) { - tipologieMancanti.add(LanguageUtil.get(Locale.getDefault(), "gc-soggetto-" - + firmaMancante)); - } - notCompleted.add(LanguageUtil.get(LocaleUtil.getDefault(), "label-documenti-tipologia-" - + docObbligatorio) - + ", firme mancanti: " + StringUtils.join(tipologieMancanti, ", ")); - } } } + notCompleted.addAll(firmeMancanti(intPratica, dettPratica, DocumentiPraticaUtil.getDocDomanda())); + return notCompleted; } @@ -1296,27 +1241,23 @@ public class ValidazionePraticaUtil { Company company = CompanyLocalServiceUtil.getCompany(companyId); String urlPdfExtractor = (String) company.getExpandoBridge().getAttribute("url_pdf_extractor", false); - Options options = new Options(); - options.setLocation(urlPdfExtractor); - options.setPost(true); - List fileParts = new ArrayList<>(); - // Amo l'ignoto autore di questo TODO! - // TODO perché cazzo non funziona il contentType??? - FilePart filePart = new FilePart("file", fileName, fileBytes, "application/pkcs7-signature", "UTF-8"); - fileParts.add(filePart); - options.setFileParts(fileParts); - - String responseBody = HttpUtil.URLtoString(options); - - if (options.getResponse().getResponseCode() == HttpServletResponse.SC_OK - || options.getResponse().getResponseCode() == HttpServletResponse.SC_CREATED) { - + HttpPost request = new HttpPost(urlPdfExtractor); + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE); + builder.addPart("file", new ByteArrayBody(fileBytes, fileName)); + request.setEntity(builder.build()); + CloseableHttpClient client = HttpClientBuilder.create().build(); + HttpResponse httpResponse = client.execute(request); + int statusCode = httpResponse.getStatusLine().getStatusCode(); + String responseBody = EntityUtils.toString(httpResponse.getEntity(), StringPool.UTF8); + client.close(); + + if (statusCode == HttpServletResponse.SC_OK || statusCode == HttpServletResponse.SC_CREATED) { JSONArray arrayFirme = JSONFactoryUtil.createJSONObject(responseBody).getJSONArray("cf"); List cf = new UniqueList(); for (int i = 0; i < arrayFirme.length(); i++) { cf.add(arrayFirme.getString(i)); } - return cf; } else { @@ -1334,7 +1275,7 @@ public class ValidazionePraticaUtil { return firme; } - private static final Map> firmeObbligatorie = new HashMap>() { + private static final Map> firmeObbligatorie = new HashMap>(24) { private static final long serialVersionUID = 1L; { put(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A01, new ArrayList() { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/base/DocPraticaLocalServiceClpInvoker.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/base/DocPraticaLocalServiceClpInvoker.java index 808f0f73..a357f3de 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/base/DocPraticaLocalServiceClpInvoker.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/base/DocPraticaLocalServiceClpInvoker.java @@ -306,61 +306,65 @@ public class DocPraticaLocalServiceClpInvoker { _methodParameterTypes239 = new String[] { "long", "java.lang.String" }; - _methodName240 = "getValidTmpByIntPratica_Tipologia"; + _methodName240 = "getValidTmpByIntPratica"; - _methodParameterTypes240 = new String[] { + _methodParameterTypes240 = new String[] { "long", "int", "int" }; + + _methodName241 = "getValidTmpByIntPratica_Tipologia"; + + _methodParameterTypes241 = new String[] { "long", "java.lang.String", "int", "int" }; - _methodName241 = "getValidTmpByIntPratica_DettPratica_Tipologia"; + _methodName242 = "getValidTmpByIntPratica_DettPratica_Tipologia"; - _methodParameterTypes241 = new String[] { + _methodParameterTypes242 = new String[] { "long", "long", "java.lang.String", "int", "int" }; - _methodName242 = "getValidTmpByIntPratica_Tipologie"; + _methodName243 = "getValidTmpByIntPratica_Tipologie"; - _methodParameterTypes242 = new String[] { + _methodParameterTypes243 = new String[] { "long", "java.lang.String[][]", "int", "int" }; - _methodName243 = "countValidTmpByIntPratica_Tipologie"; + _methodName244 = "countValidTmpByIntPratica_Tipologie"; - _methodParameterTypes243 = new String[] { "long", "java.lang.String[][]" }; + _methodParameterTypes244 = new String[] { "long", "java.lang.String[][]" }; - _methodName245 = "getInvalidByIntPratica"; + _methodName246 = "getInvalidByIntPratica"; - _methodParameterTypes245 = new String[] { "long" }; + _methodParameterTypes246 = new String[] { "long" }; - _methodName246 = "getInvalidTmpByIntPratica"; + _methodName247 = "getInvalidTmpByIntPratica"; - _methodParameterTypes246 = new String[] { "long" }; + _methodParameterTypes247 = new String[] { "long" }; - _methodName247 = "getValidUntilClassPkByIntPratica"; + _methodName248 = "getValidUntilClassPkByIntPratica"; - _methodParameterTypes247 = new String[] { + _methodParameterTypes248 = new String[] { "long", "long", "java.lang.String", "int", "int" }; - _methodName248 = "completeInvalidation"; + _methodName249 = "completeInvalidation"; - _methodParameterTypes248 = new String[] { "long" }; + _methodParameterTypes249 = new String[] { "long" }; - _methodName249 = "getDocPraticaWithOldFileEntryId"; + _methodName250 = "getDocPraticaWithOldFileEntryId"; - _methodParameterTypes249 = new String[] { "int", "int" }; + _methodParameterTypes250 = new String[] { "int", "int" }; - _methodName250 = "addDocPraticaAnnullamento"; + _methodName251 = "addDocPraticaAnnullamento"; - _methodParameterTypes250 = new String[] { + _methodParameterTypes251 = new String[] { "long", "java.lang.String", "long", "long", "long", "java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String", "com.liferay.portal.service.ServiceContext" }; - _methodName251 = "findByIntPratica_ClassPk_TipologiaNew"; + _methodName252 = "findByIntPratica_ClassPk_TipologiaNew"; - _methodParameterTypes251 = new String[] { + _methodParameterTypes252 = new String[] { "long", "long", "java.lang.String", "int", "int" }; } @@ -749,14 +753,21 @@ public class DocPraticaLocalServiceClpInvoker { if (_methodName240.equals(name) && Arrays.deepEquals(_methodParameterTypes240, parameterTypes)) { + return DocPraticaLocalServiceUtil.getValidTmpByIntPratica(((Long)arguments[0]).longValue(), + ((Integer)arguments[1]).intValue(), + ((Integer)arguments[2]).intValue()); + } + + if (_methodName241.equals(name) && + Arrays.deepEquals(_methodParameterTypes241, parameterTypes)) { return DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologia(((Long)arguments[0]).longValue(), (java.lang.String)arguments[1], ((Integer)arguments[2]).intValue(), ((Integer)arguments[3]).intValue()); } - if (_methodName241.equals(name) && - Arrays.deepEquals(_methodParameterTypes241, parameterTypes)) { + if (_methodName242.equals(name) && + Arrays.deepEquals(_methodParameterTypes242, parameterTypes)) { return DocPraticaLocalServiceUtil.getValidTmpByIntPratica_DettPratica_Tipologia(((Long)arguments[0]).longValue(), ((Long)arguments[1]).longValue(), (java.lang.String)arguments[2], @@ -764,32 +775,32 @@ public class DocPraticaLocalServiceClpInvoker { ((Integer)arguments[4]).intValue()); } - if (_methodName242.equals(name) && - Arrays.deepEquals(_methodParameterTypes242, parameterTypes)) { + if (_methodName243.equals(name) && + Arrays.deepEquals(_methodParameterTypes243, parameterTypes)) { return DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologie(((Long)arguments[0]).longValue(), (java.lang.String[])arguments[1], ((Integer)arguments[2]).intValue(), ((Integer)arguments[3]).intValue()); } - if (_methodName243.equals(name) && - Arrays.deepEquals(_methodParameterTypes243, parameterTypes)) { + if (_methodName244.equals(name) && + Arrays.deepEquals(_methodParameterTypes244, parameterTypes)) { return DocPraticaLocalServiceUtil.countValidTmpByIntPratica_Tipologie(((Long)arguments[0]).longValue(), (java.lang.String[])arguments[1]); } - if (_methodName245.equals(name) && - Arrays.deepEquals(_methodParameterTypes245, parameterTypes)) { - return DocPraticaLocalServiceUtil.getInvalidByIntPratica(((Long)arguments[0]).longValue()); - } - if (_methodName246.equals(name) && Arrays.deepEquals(_methodParameterTypes246, parameterTypes)) { - return DocPraticaLocalServiceUtil.getInvalidTmpByIntPratica(((Long)arguments[0]).longValue()); + return DocPraticaLocalServiceUtil.getInvalidByIntPratica(((Long)arguments[0]).longValue()); } if (_methodName247.equals(name) && Arrays.deepEquals(_methodParameterTypes247, parameterTypes)) { + return DocPraticaLocalServiceUtil.getInvalidTmpByIntPratica(((Long)arguments[0]).longValue()); + } + + if (_methodName248.equals(name) && + Arrays.deepEquals(_methodParameterTypes248, parameterTypes)) { return DocPraticaLocalServiceUtil.getValidUntilClassPkByIntPratica(((Long)arguments[0]).longValue(), ((Long)arguments[1]).longValue(), (java.lang.String)arguments[2], @@ -797,21 +808,21 @@ public class DocPraticaLocalServiceClpInvoker { ((Integer)arguments[4]).intValue()); } - if (_methodName248.equals(name) && - Arrays.deepEquals(_methodParameterTypes248, parameterTypes)) { + if (_methodName249.equals(name) && + Arrays.deepEquals(_methodParameterTypes249, parameterTypes)) { DocPraticaLocalServiceUtil.completeInvalidation(((Long)arguments[0]).longValue()); return null; } - if (_methodName249.equals(name) && - Arrays.deepEquals(_methodParameterTypes249, parameterTypes)) { + if (_methodName250.equals(name) && + Arrays.deepEquals(_methodParameterTypes250, parameterTypes)) { return DocPraticaLocalServiceUtil.getDocPraticaWithOldFileEntryId(((Integer)arguments[0]).intValue(), ((Integer)arguments[1]).intValue()); } - if (_methodName250.equals(name) && - Arrays.deepEquals(_methodParameterTypes250, parameterTypes)) { + if (_methodName251.equals(name) && + Arrays.deepEquals(_methodParameterTypes251, parameterTypes)) { return DocPraticaLocalServiceUtil.addDocPraticaAnnullamento(((Long)arguments[0]).longValue(), (java.lang.String)arguments[1], ((Long)arguments[2]).longValue(), @@ -822,8 +833,8 @@ public class DocPraticaLocalServiceClpInvoker { (com.liferay.portal.service.ServiceContext)arguments[9]); } - if (_methodName251.equals(name) && - Arrays.deepEquals(_methodParameterTypes251, parameterTypes)) { + if (_methodName252.equals(name) && + Arrays.deepEquals(_methodParameterTypes252, parameterTypes)) { return DocPraticaLocalServiceUtil.findByIntPratica_ClassPk_TipologiaNew(((Long)arguments[0]).longValue(), ((Long)arguments[1]).longValue(), (java.lang.String)arguments[2], @@ -954,8 +965,8 @@ public class DocPraticaLocalServiceClpInvoker { private String[] _methodParameterTypes242; private String _methodName243; private String[] _methodParameterTypes243; - private String _methodName245; - private String[] _methodParameterTypes245; + private String _methodName244; + private String[] _methodParameterTypes244; private String _methodName246; private String[] _methodParameterTypes246; private String _methodName247; @@ -968,4 +979,6 @@ public class DocPraticaLocalServiceClpInvoker { private String[] _methodParameterTypes250; private String _methodName251; private String[] _methodParameterTypes251; + private String _methodName252; + private String[] _methodParameterTypes252; } \ 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/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 54824b32..d6f6a651 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 @@ -57,13 +57,14 @@ 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 + * 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 @@ -71,655 +72,675 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException; * @see it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil */ 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. - */ - - private Log _log = LogFactoryUtil.getLog(DocPraticaLocalServiceImpl.class); - - @Override - public DocPratica deleteDocPratica(DocPratica docPratica) throws SystemException { + /* + * 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. + */ + + private Log _log = LogFactoryUtil.getLog(DocPraticaLocalServiceImpl.class); + + @Override + public DocPratica deleteDocPratica(DocPratica docPratica) throws SystemException { + + try { + if (Validator.isNotNull(docPratica.getDlFileEntryId())) { + dlAppLocalService.deleteFileEntry(docPratica.getDlFileEntryId()); + } + } catch (NoSuchFileEntryException | NoSuchRepositoryEntryException e) { + + } catch (PortalException e) { + throw new SystemException(e); + } + return super.deleteDocPratica(docPratica); + } - try { - if (Validator.isNotNull(docPratica.getDlFileEntryId())) { - dlAppLocalService.deleteFileEntry(docPratica.getDlFileEntryId()); - } - } catch (NoSuchFileEntryException | NoSuchRepositoryEntryException e) { + @Override + public DocPratica deleteDocPratica(long docPraticaId) throws PortalException, SystemException { - } catch (PortalException e) { - throw new SystemException(e); - } - return super.deleteDocPratica(docPratica); - } + return deleteDocPratica(docPraticaLocalService.getDocPratica(docPraticaId)); + } - @Override - public DocPratica deleteDocPratica(long docPraticaId) throws PortalException, SystemException { + 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 { - return deleteDocPratica(docPraticaLocalService.getDocPratica(docPraticaId)); - } + 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())); + + 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); + docPratica.setDlFileEntryId(fileEntry.getFileEntryId()); + docPratica.setVersion(version); + docPratica.setPraticaValidata(praticaValidata); + docPratica.setDescLong(descLong); + docPratica.setTipologia(tipologia); + docPratica.setSha256(sha256); + docPratica.setAggiornato(aggiornato); + 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 { + + User user = userPersistence.findByPrimaryKey(userId); + + Date now = new Date(); + + 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); + docPratica.setDlFileEntryId(fileEntry.getFileEntryId()); + docPratica.setVersion("0"); + docPratica.setPraticaValidata(false); + docPratica.setDescLong(fileName); + docPratica.setTipologia(tipologia); + docPratica.setAggiornato(false); + 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 { + + User user = userPersistence.findByPrimaryKey(userId); + + Date now = new Date(); + + 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); + docPratica.setDlFileEntryId(fileEntryId); + docPratica.setVersion("0"); + docPratica.setPraticaValidata(false); + docPratica.setDescLong(fileName); + docPratica.setTipologia(tipologia); + docPratica.setAggiornato(false); + docPratica.setJsonFirmatari(jsonFirmatari); + docPratica.setDettPraticaIdRimozione(0l); + docPratica.setDtDataRimozione(null); + + docPratica.setStatus(WorkflowConstants.STATUS_PENDING); + + docPratica = docPraticaPersistence.update(docPratica); + + return docPratica; + } + + 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 { + + 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.setCompanyId(serviceContext.getCompanyId()); + docPratica.setUserId(userId); + if (userId > 0) { + User user = userPersistence.findByPrimaryKey(userId); + 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); + docPratica.setVersion(version); + docPratica.setPraticaValidata(praticaValidata); + docPratica.setDescLong(descLong); + docPratica.setTipologia(tipologia); + docPratica.setSha256(sha256); + docPratica.setAggiornato(aggiornato); + docPratica.setJsonFirmatari(jsonFirmatari); + docPratica.setDettPraticaIdRimozione(dettPraticaIdRimozione); + docPratica.setDtDataRimozione(dtDataRimozione); + docPratica.setOldDocPraticaId(oldDocPraticaId); + + docPratica.setStatus(WorkflowConstants.STATUS_APPROVED); + + return docPraticaPersistence.update(docPratica); + } + + 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); + 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); + + // TODO forse mettiamo i permesssi ma non mi pare sicuro. + + 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); + } catch (NoSuchFolderException e) { + // cartella non presente -> creo cartella + 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); + + try { + PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil + .create(UserLocalServiceUtil.getUser(delegaUserId))); + } catch (Exception e) { + throw new SystemException(e); + + } + return fileEntry; + } + + public FileEntry getAttachment(long classPk) throws SystemException, PortalException { + + DocPratica fileAllegato = docPraticaPersistence.findByPrimaryKey(classPk); + return dlAppLocalService.getFileEntry(fileAllegato.getDlFileEntryId()); + } + + public void addFirma(long docPraticaId, String codiceFiscale) throws PortalException, SystemException { + + DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); + docPratica.setJsonFirmatari(FirmeUtil.addFirma(docPratica.getJsonFirmatari(), codiceFiscale)); + docPraticaLocalService.updateDocPratica(docPratica); + } + + public void addFirmeAndApprova(long docPraticaId, List codiciFiscali) throws PortalException, + SystemException { - 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 { + DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); + String jsonFirmatari = docPratica.getJsonFirmatari(); + for (String codiceFiscale : codiciFiscali) { + jsonFirmatari = FirmeUtil.addFirmaDigitale(jsonFirmatari, codiceFiscale); + } + docPratica.setJsonFirmatari(jsonFirmatari); + docPratica.setModifiedDate(new Date()); + docPratica.setStatus(WorkflowConstants.STATUS_APPROVED); + docPraticaLocalService.updateDocPratica(docPratica); + } - User user = userPersistence.findByPrimaryKey(userId); + public void addErrorAndApprova(long docPraticaId, String errorCode) throws PortalException, + SystemException { - Date now = new Date(); + DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); + docPratica.setModifiedDate(new Date()); + docPratica.setErrorCode(errorCode); + if ("400".equalsIgnoreCase(errorCode)) { + docPratica.setStatus(WorkflowConstants.STATUS_DENIED); + } + docPraticaLocalService.updateDocPratica(docPratica); + } - 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())); - - FileEntry fileEntry = addAttachment(classPk, intPraticaId, userId, fileName, dlFileEntry, tipologia); + public void removeFirma(long docPraticaId, String codiceFiscale) throws PortalException, SystemException { - 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 docPratica = docPraticaLocalService.getDocPratica(docPraticaId); + docPratica.setJsonFirmatari(FirmeUtil.removeFirma(docPratica.getJsonFirmatari(), codiceFiscale)); + docPraticaLocalService.updateDocPratica(docPratica); + } - docPratica.setClassName(className); - docPratica.setClassPk(classPk); - docPratica.setIntPraticaId(intPraticaId); - docPratica.setDlFileEntryId(fileEntry.getFileEntryId()); - docPratica.setVersion(version); - docPratica.setPraticaValidata(praticaValidata); - docPratica.setDescLong(descLong); - docPratica.setTipologia(tipologia); - docPratica.setSha256(sha256); - docPratica.setAggiornato(aggiornato); - docPratica.setJsonFirmatari(jsonFirmatari); - docPratica.setDettPraticaIdRimozione(dettPraticaIdRimozione); - docPratica.setDtDataRimozione(dtDataRimozione); + 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 { - docPratica.setStatus(WorkflowConstants.STATUS_PENDING); + // TODO Write your own validation code - docPratica = docPraticaPersistence.update(docPratica); + } - return docPratica; - } + public DocPratica updateDocPraticaAggiornato(long docPraticaId, boolean aggiornato) + throws SystemException { - 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())); - - 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); - docPratica.setDlFileEntryId(fileEntry.getFileEntryId()); - docPratica.setVersion("0"); - docPratica.setPraticaValidata(false); - docPratica.setDescLong(fileName); - docPratica.setTipologia(tipologia); - docPratica.setAggiornato(false); - 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 { - - User user = userPersistence.findByPrimaryKey(userId); - - Date now = new Date(); - - 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 docPratica = docPraticaPersistence.fetchByPrimaryKey(docPraticaId); + docPratica.setAggiornato(aggiornato); + docPratica.setModifiedDate(new Date()); + return docPraticaLocalService.updateDocPratica(docPratica); + } - docPratica.setClassName(className); - docPratica.setClassPk(classPk); - docPratica.setIntPraticaId(intPraticaId); - docPratica.setDlFileEntryId(fileEntryId); - docPratica.setVersion("0"); - docPratica.setPraticaValidata(false); - docPratica.setDescLong(fileName); - docPratica.setTipologia(tipologia); - docPratica.setAggiornato(false); - docPratica.setJsonFirmatari(jsonFirmatari); - docPratica.setDettPraticaIdRimozione(0l); - docPratica.setDtDataRimozione(null); - - docPratica.setStatus(WorkflowConstants.STATUS_PENDING); - - docPratica = docPraticaPersistence.update(docPratica); - - return docPratica; - } - - 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 { - - 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.setCompanyId(serviceContext.getCompanyId()); - docPratica.setUserId(userId); - if (userId > 0) { - User user = userPersistence.findByPrimaryKey(userId); - 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); - docPratica.setVersion(version); - docPratica.setPraticaValidata(praticaValidata); - docPratica.setDescLong(descLong); - docPratica.setTipologia(tipologia); - docPratica.setSha256(sha256); - docPratica.setAggiornato(aggiornato); - docPratica.setJsonFirmatari(jsonFirmatari); - docPratica.setDettPraticaIdRimozione(dettPraticaIdRimozione); - docPratica.setDtDataRimozione(dtDataRimozione); - docPratica.setOldDocPraticaId(oldDocPraticaId); - - docPratica.setStatus(WorkflowConstants.STATUS_APPROVED); - - return docPraticaPersistence.update(docPratica); - } - - 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); - 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); - - // TODO forse mettiamo i permesssi ma non mi pare sicuro. - - 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); - } catch (NoSuchFolderException e) { - // cartella non presente -> creo cartella - 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); - - try { - PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(UserLocalServiceUtil - .getUser(delegaUserId))); - } catch (Exception e) { - throw new SystemException(e); - - } - return fileEntry; - } - - public FileEntry getAttachment(long classPk) throws SystemException, PortalException { + public int countDocPraticaDaInviareDax() throws SystemException { - DocPratica fileAllegato = docPraticaPersistence.findByPrimaryKey(classPk); - return dlAppLocalService.getFileEntry(fileAllegato.getDlFileEntryId()); - } - - public void addFirma(long docPraticaId, String codiceFiscale) throws PortalException, SystemException { - - DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); - docPratica.setJsonFirmatari(FirmeUtil.addFirma(docPratica.getJsonFirmatari(), codiceFiscale)); - docPraticaLocalService.updateDocPratica(docPratica); - } + DynamicQuery dynamicQuery = dynamicQueryDocPraticaDaInviareDax(); + return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery); + } + + public List getDocPraticaDaInviareDax(int start, int end) throws SystemException { + + DynamicQuery dynamicQuery = dynamicQueryDocPraticaDaInviareDax(); + return docPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end); + } - public void addFirmeAndApprova(long docPraticaId, List codiciFiscali) throws PortalException, SystemException { + private DynamicQuery dynamicQueryDocPraticaDaInviareDax() { - DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); - String jsonFirmatari = docPratica.getJsonFirmatari(); - for (String codiceFiscale : codiciFiscali) { - jsonFirmatari = FirmeUtil.addFirmaDigitale(jsonFirmatari, codiceFiscale); - } - docPratica.setJsonFirmatari(jsonFirmatari); - docPratica.setModifiedDate(new Date()); - docPratica.setStatus(WorkflowConstants.STATUS_APPROVED); - docPraticaLocalService.updateDocPratica(docPratica); - } + DynamicQuery dynamicQuery = docPraticaLocalService.dynamicQuery(); + dynamicQuery.add(PropertyFactoryUtil.forName("dtInvioDax").isNull()); + dynamicQuery.add(PropertyFactoryUtil.forName("daxId").eq(0L)); + dynamicQuery.add(PropertyFactoryUtil.forName("praticaValidata").eq(true)); + dynamicQuery.addOrder(OrderFactoryUtil.asc("createDate")); + return dynamicQuery; + } - public void addErrorAndApprova(long docPraticaId, String errorCode) throws PortalException, SystemException { + public int countByClassPk(long classPk) throws SystemException { - DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); - docPratica.setModifiedDate(new Date()); - docPratica.setErrorCode(errorCode); - if ("400".equalsIgnoreCase(errorCode)) { - docPratica.setStatus(WorkflowConstants.STATUS_DENIED); - } - docPraticaLocalService.updateDocPratica(docPratica); - } + return docPraticaPersistence.countByClassPk(classPk); + } - public void removeFirma(long docPraticaId, String codiceFiscale) throws PortalException, SystemException { + public List findByClassPk(long classPk, int start, int end) throws SystemException { - DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); - docPratica.setJsonFirmatari(FirmeUtil.removeFirma(docPratica.getJsonFirmatari(), codiceFiscale)); - docPraticaLocalService.updateDocPratica(docPratica); - } + return docPraticaPersistence.findByClassPk(classPk, start, end); + } - 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 { + public List findByIntPratica(long intPraticaId) throws SystemException { - // TODO Write your own validation code + return docPraticaPersistence.findByIntPratica(intPraticaId); + } + public List findByClassPk(long classPk) throws SystemException { - } + return docPraticaPersistence.findByClassPk(classPk); + } - public DocPratica updateDocPraticaAggiornato(long docPraticaId, boolean aggiornato) throws SystemException { + public List findByStaus(int status, int start, int end, OrderByComparator order) + throws SystemException { - DocPratica docPratica = docPraticaPersistence.fetchByPrimaryKey(docPraticaId); - docPratica.setAggiornato(aggiornato); - docPratica.setModifiedDate(new Date()); - return docPraticaLocalService.updateDocPratica(docPratica); - } + return docPraticaPersistence.findByStatus(status, start, end, order); + } - public int countDocPraticaDaInviareDax() throws SystemException { + public int countByStatus(long status) throws SystemException { - DynamicQuery dynamicQuery = dynamicQueryDocPraticaDaInviareDax(); - return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery); - } + return docPraticaPersistence.countByStatus(status); + } - @SuppressWarnings("unchecked") - public List getDocPraticaDaInviareDax(int start, int end) throws SystemException { + public int countByClassPk_Tipologia(long classPk, String tipologia) throws SystemException { - DynamicQuery dynamicQuery = dynamicQueryDocPraticaDaInviareDax(); - return docPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end); - } + return docPraticaPersistence.countByClassPk_Tipologia(classPk, tipologia); + } - private DynamicQuery dynamicQueryDocPraticaDaInviareDax() { + public List findByClassPk_Tipologia(long classPk, String tipologia, int start, int end) + throws SystemException { - DynamicQuery dynamicQuery = docPraticaLocalService.dynamicQuery(); - dynamicQuery.add(PropertyFactoryUtil.forName("dtInvioDax").isNull()); - dynamicQuery.add(PropertyFactoryUtil.forName("daxId").eq(0L)); - dynamicQuery.add(PropertyFactoryUtil.forName("praticaValidata").eq(true)); - dynamicQuery.addOrder(OrderFactoryUtil.asc("createDate")); - return dynamicQuery; - } + return docPraticaPersistence.findByClassPk_Tipologia(classPk, tipologia, start, end); + } - public int countByClassPk(long classPk) throws SystemException { + public List findByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) + throws SystemException { - return docPraticaPersistence.countByClassPk(classPk); - } + DynamicQuery dynamicQuery = dynamicQuery(); + dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); + dynamicQuery.add(PropertyFactoryUtil.forName("tipologia").eq(tipologia)); + dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk")); + return soggettoPersistence.findWithDynamicQuery(dynamicQuery, start, end); + } - public List findByClassPk(long classPk, int start, int end) throws SystemException { + public List findByIntPratica_ClassPk_Tipologia(long intPraticaId, long classPk, + String tipologia, int start, int end) throws SystemException { - return docPraticaPersistence.findByClassPk(classPk, start, end); - } + DynamicQuery dynamicQuery = dynamicQuery(); + dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); + dynamicQuery.add(RestrictionsFactoryUtil.le("classPk", classPk)); + dynamicQuery.add(PropertyFactoryUtil.forName("tipologia").eq(tipologia)); + dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk")); + return dynamicQuery(dynamicQuery, start, end); + } - public List findByIntPratica(long intPraticaId) throws SystemException { + public List findByIntPratica_ClassPk_Tipologie(long intPraticaId, long classPk, + List tipologie) throws SystemException { - return docPraticaPersistence.findByIntPratica(intPraticaId); - } + DynamicQuery dynamicQuery = dynamicQuery(); + dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); + dynamicQuery.add(RestrictionsFactoryUtil.le("classPk", classPk)); + dynamicQuery.add(PropertyFactoryUtil.forName("tipologia").in(tipologie)); + dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk")); + return dynamicQuery(dynamicQuery); + } - public List findByClassPk(long classPk) throws SystemException { + public List findByIntPratica_ClassPkEqual_Tipologie(long intPraticaId, long classPk, + List tipologie) throws SystemException { - return docPraticaPersistence.findByClassPk(classPk); - } + DynamicQuery dynamicQuery = dynamicQuery(); + dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); + dynamicQuery.add(RestrictionsFactoryUtil.eq("classPk", classPk)); + dynamicQuery.add(PropertyFactoryUtil.forName("tipologia").in(tipologie)); + dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk")); + return dynamicQuery(dynamicQuery); + } - public List findByStaus(int status, int start, int end, OrderByComparator order) throws SystemException { + public DocPratica fetchByC_Group_DlFileEntry_Version(long dlFileEntryId, String version) + throws SystemException { - return docPraticaPersistence.findByStatus(status, start, end, order); - } + return docPraticaPersistence.fetchByDlFileEntry_Version(dlFileEntryId, version); + } - public int countByStatus(long status) throws SystemException { + public DocPratica fetchByOldDocPraticaId(long oldDocPraticaId) throws SystemException { - return docPraticaPersistence.countByStatus(status); - } + return docPraticaPersistence.fetchByOldDocPratica(oldDocPraticaId); + } - public int countByClassPk_Tipologia(long classPk, String tipologia) throws SystemException { + public List findDistinctDlFileEntryId(long classPk, String tipologia, int start, int end) + throws SystemException { - return docPraticaPersistence.countByClassPk_Tipologia(classPk, tipologia); - } + return findDistinctDlFileEntryId(new long[] { classPk }, tipologia, start, end); + } - public List findByClassPk_Tipologia(long classPk, String tipologia, int start, int end) - throws SystemException { + public List findDistinctDlFileEntryId(long[] classPks, String tipologia, int start, int end) + throws SystemException { - return docPraticaPersistence.findByClassPk_Tipologia(classPk, tipologia, start, end); - } + DynamicQuery dynamicQuery = docPraticaLocalService.dynamicQuery(); + dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil + .property("dlFileEntryId"))); + dynamicQuery.add(PropertyFactoryUtil.forName("tipologia").eq(tipologia)); + Junction or = RestrictionsFactoryUtil.disjunction(); + for (long classPk : classPks) { + or.add(PropertyFactoryUtil.forName("classPk").eq(classPk)); + } + dynamicQuery.add(or); + dynamicQuery.addOrder(OrderFactoryUtil.desc("dlFileEntryId")); + return docPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end); + } - public List findByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) - throws SystemException { + public List getValidByIntPratica(long intPraticaId) throws SystemException { - DynamicQuery dynamicQuery = dynamicQuery(); - dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); - dynamicQuery.add(PropertyFactoryUtil.forName("tipologia").eq(tipologia)); - dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk")); - return soggettoPersistence.findWithDynamicQuery(dynamicQuery, start, end); - } + DynamicQuery dynamicQuery = dynamicQuery(); + dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); + dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaIdRimozione", null)); + dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione")); + return dynamicQuery(dynamicQuery); + } - public List findByIntPratica_ClassPk_Tipologia(long intPraticaId, long classPk, String tipologia, - int start, int end) throws SystemException { + public List getValidByIntPratica_Tipologia(long intPraticaId, 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(PropertyFactoryUtil.forName("tipologia").eq(tipologia)); - dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk")); - return dynamicQuery(dynamicQuery, start, end); - } + DynamicQuery dynamicQuery = dynamicQuery(); + dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); + dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); + dynamicQuery.add(RestrictionsFactoryUtil.eq("rimosso", false)); + dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione")); + return dynamicQuery(dynamicQuery, start, end); + } + + 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(long intPraticaId, int start, int end) + throws SystemException { + DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); + + dynamicQuery.addOrder(OrderFactoryUtil.asc("tipologia")); + return dynamicQuery(dynamicQuery, start, end); + } + + 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 findByIntPratica_ClassPk_Tipologie(long intPraticaId, long classPk, List tipologie) - throws SystemException { + public List getValidTmpByIntPratica_DettPratica_Tipologia(long intPraticaId, + long dettPraticaId, 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(PropertyFactoryUtil.forName("tipologia").in(tipologie)); - dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk")); - return dynamicQuery(dynamicQuery); - } + DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); + dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); + dynamicQuery.add(RestrictionsFactoryUtil.eq("classPk", dettPraticaId)); + dynamicQuery.add(RestrictionsFactoryUtil.eq("className", DettPratica.class.getName())); - public List findByIntPratica_ClassPkEqual_Tipologie(long intPraticaId, long classPk, - List tipologie) throws SystemException { + dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione")); + return dynamicQuery(dynamicQuery, start, end); + } - DynamicQuery dynamicQuery = dynamicQuery(); - dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); - dynamicQuery.add(RestrictionsFactoryUtil.eq("classPk", classPk)); - dynamicQuery.add(PropertyFactoryUtil.forName("tipologia").in(tipologie)); - dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk")); - return dynamicQuery(dynamicQuery); - } + public List getValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie, + int start, int end) throws SystemException { - public DocPratica fetchByC_Group_DlFileEntry_Version(long dlFileEntryId, String version) throws SystemException { + DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); + dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie)); - return docPraticaPersistence.fetchByDlFileEntry_Version(dlFileEntryId, version); - } + dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione")); + return dynamicQuery(dynamicQuery, start, end); + } + + 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); + } + + private DynamicQuery createvalidTmpQueryByIntPratica(long intPraticaId) { + + DynamicQuery dynamicQuery = dynamicQuery(); + dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); + dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaIdRimozione", null)); + + return dynamicQuery; + } + + public List getInvalidByIntPratica(long intPraticaId) throws SystemException { + + DynamicQuery dynamicQuery = dynamicQuery(); + dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); + dynamicQuery.add(RestrictionsFactoryUtil.ne("rimosso", false)); + dynamicQuery.addOrder(OrderFactoryUtil.desc("dettPraticaIdRimozione")); + return dynamicQuery(dynamicQuery); + } + + public List getInvalidTmpByIntPratica(long intPraticaId) throws SystemException { + + DynamicQuery dynamicQuery = dynamicQuery(); + dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); + dynamicQuery.add(RestrictionsFactoryUtil.ne("dettPraticaIdRimozione", null)); + dynamicQuery.addOrder(OrderFactoryUtil.desc("dettPraticaIdRimozione")); + return dynamicQuery(dynamicQuery); + } + + 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); + } + + public void completeInvalidation(long intPraticaId) throws SystemException { + + Date now = new Date(); + List allegatiDaInvalidare = getInvalidTmpByIntPratica(intPraticaId); + for (DocPratica docPratica : allegatiDaInvalidare) { + docPratica.setRimosso(true); + docPratica.setDtDataRimozione(now); + + docPratica = updateDocPratica(docPratica); + } + } + + 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 { + + User user = userPersistence.findByPrimaryKey(userId); + + Date now = new Date(); + + 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); + docPratica.setDlFileEntryId(fileEntryId); + docPratica.setVersion("0"); + docPratica.setPraticaValidata(false); + docPratica.setDescLong(fileName); + docPratica.setTipologia(tipologia); + docPratica.setSha256(sha256); + docPratica.setAggiornato(false); + 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 { + + DynamicQuery dynamicQuery = dynamicQuery(); + dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); + dynamicQuery.add(RestrictionsFactoryUtil.eq("classPk", classPk)); + dynamicQuery.add(PropertyFactoryUtil.forName("tipologia").eq(tipologia)); + dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk")); + return dynamicQuery(dynamicQuery, start, end); + } - public DocPratica fetchByOldDocPraticaId(long oldDocPraticaId) throws SystemException { - - return docPraticaPersistence.fetchByOldDocPratica(oldDocPraticaId); - } - - public List findDistinctDlFileEntryId(long classPk, String tipologia, int start, int end) - throws SystemException { - - return findDistinctDlFileEntryId(new long[] {classPk}, tipologia, start, end); - } - - 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.add(PropertyFactoryUtil.forName("tipologia").eq(tipologia)); - Junction or = RestrictionsFactoryUtil.disjunction(); - for (long classPk : classPks) { - or.add(PropertyFactoryUtil.forName("classPk").eq(classPk)); - } - dynamicQuery.add(or); - dynamicQuery.addOrder(OrderFactoryUtil.desc("dlFileEntryId")); - return docPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end); - } - - public List getValidByIntPratica(long intPraticaId) throws SystemException { - - DynamicQuery dynamicQuery = dynamicQuery(); - dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); - dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaIdRimozione", null)); - dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione")); - return dynamicQuery(dynamicQuery); - } - - public List getValidByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) - throws SystemException { - - DynamicQuery dynamicQuery = dynamicQuery(); - dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); - dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); - dynamicQuery.add(RestrictionsFactoryUtil.eq("rimosso", false)); - dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione")); - return dynamicQuery(dynamicQuery, start, end); - } - - 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 { - - 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 { - - 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 { - - 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 { - - DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); - dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie)); - - return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery); - } - - private DynamicQuery createvalidTmpQueryByIntPratica(long intPraticaId) { - - DynamicQuery dynamicQuery = dynamicQuery(); - dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); - dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaIdRimozione", null)); - - return dynamicQuery; - } - - public List getInvalidByIntPratica(long intPraticaId) throws SystemException { - - DynamicQuery dynamicQuery = dynamicQuery(); - dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); - dynamicQuery.add(RestrictionsFactoryUtil.ne("rimosso", false)); - dynamicQuery.addOrder(OrderFactoryUtil.desc("dettPraticaIdRimozione")); - return dynamicQuery(dynamicQuery); - } - - public List getInvalidTmpByIntPratica(long intPraticaId) throws SystemException { - - DynamicQuery dynamicQuery = dynamicQuery(); - dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); - dynamicQuery.add(RestrictionsFactoryUtil.ne("dettPraticaIdRimozione", null)); - dynamicQuery.addOrder(OrderFactoryUtil.desc("dettPraticaIdRimozione")); - return dynamicQuery(dynamicQuery); - } - - 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); - } - - public void completeInvalidation(long intPraticaId) throws SystemException { - - Date now = new Date(); - List allegatiDaInvalidare = getInvalidTmpByIntPratica(intPraticaId); - for (DocPratica docPratica : allegatiDaInvalidare) { - docPratica.setRimosso(true); - docPratica.setDtDataRimozione(now); - - docPratica = updateDocPratica(docPratica); - } - } - - 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 { - - User user = userPersistence.findByPrimaryKey(userId); - - Date now = new Date(); - - 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); - docPratica.setDlFileEntryId(fileEntryId); - docPratica.setVersion("0"); - docPratica.setPraticaValidata(false); - docPratica.setDescLong(fileName); - docPratica.setTipologia(tipologia); - docPratica.setSha256(sha256); - docPratica.setAggiornato(false); - 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 { - - DynamicQuery dynamicQuery = dynamicQuery(); - dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); - dynamicQuery.add(RestrictionsFactoryUtil.eq("classPk", classPk)); - dynamicQuery.add(PropertyFactoryUtil.forName("tipologia").eq(tipologia)); - 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/persistence/AllegatoManualePersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AllegatoManualePersistenceImpl.java index b040f227..5c96356f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AllegatoManualePersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AllegatoManualePersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchAllegatoManualeException; import it.tref.liferay.portos.bo.model.AllegatoManuale; import it.tref.liferay.portos.bo.model.impl.AllegatoManualeImpl; import it.tref.liferay.portos.bo.model.impl.AllegatoManualeModelImpl; +import it.tref.liferay.portos.bo.service.persistence.AllegatoManualePersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AsseverazionePersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AsseverazionePersistenceImpl.java index 63caa01d..15633d6f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AsseverazionePersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AsseverazionePersistenceImpl.java @@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchAsseverazioneException; import it.tref.liferay.portos.bo.model.Asseverazione; import it.tref.liferay.portos.bo.model.impl.AsseverazioneImpl; import it.tref.liferay.portos.bo.model.impl.AsseverazioneModelImpl; +import it.tref.liferay.portos.bo.service.persistence.AsseverazionePersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AvvisoPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AvvisoPersistenceImpl.java index b95c271d..38e33edc 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AvvisoPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AvvisoPersistenceImpl.java @@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchAvvisoException; import it.tref.liferay.portos.bo.model.Avviso; import it.tref.liferay.portos.bo.model.impl.AvvisoImpl; import it.tref.liferay.portos.bo.model.impl.AvvisoModelImpl; +import it.tref.liferay.portos.bo.service.persistence.AvvisoPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/CollaudoPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/CollaudoPersistenceImpl.java index a0e6a43b..4ce032ca 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/CollaudoPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/CollaudoPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchCollaudoException; import it.tref.liferay.portos.bo.model.Collaudo; import it.tref.liferay.portos.bo.model.impl.CollaudoImpl; import it.tref.liferay.portos.bo.model.impl.CollaudoModelImpl; +import it.tref.liferay.portos.bo.service.persistence.CollaudoPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunePersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunePersistenceImpl.java index b0b64b21..4a23bffd 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunePersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunePersistenceImpl.java @@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchComuneException; import it.tref.liferay.portos.bo.model.Comune; import it.tref.liferay.portos.bo.model.impl.ComuneImpl; import it.tref.liferay.portos.bo.model.impl.ComuneModelImpl; +import it.tref.liferay.portos.bo.service.persistence.ComunePersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunicazionePersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunicazionePersistenceImpl.java index 0b7f9ee2..f5b8166f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunicazionePersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunicazionePersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchComunicazioneException; import it.tref.liferay.portos.bo.model.Comunicazione; import it.tref.liferay.portos.bo.model.impl.ComunicazioneImpl; import it.tref.liferay.portos.bo.model.impl.ComunicazioneModelImpl; +import it.tref.liferay.portos.bo.service.persistence.ComunicazionePersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ConfigurazionePersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ConfigurazionePersistenceImpl.java index 66507dd0..32809343 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ConfigurazionePersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ConfigurazionePersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchConfigurazioneException; import it.tref.liferay.portos.bo.model.Configurazione; import it.tref.liferay.portos.bo.model.impl.ConfigurazioneImpl; import it.tref.liferay.portos.bo.model.impl.ConfigurazioneModelImpl; +import it.tref.liferay.portos.bo.service.persistence.ConfigurazionePersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ControlloPraticaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ControlloPraticaPersistenceImpl.java index 48cf51eb..a4fa6f91 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ControlloPraticaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ControlloPraticaPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchControlloPraticaException; import it.tref.liferay.portos.bo.model.ControlloPratica; import it.tref.liferay.portos.bo.model.impl.ControlloPraticaImpl; import it.tref.liferay.portos.bo.model.impl.ControlloPraticaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.ControlloPraticaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DelegaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DelegaPersistenceImpl.java index 402cecd0..8c56fb32 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DelegaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DelegaPersistenceImpl.java @@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchDelegaException; import it.tref.liferay.portos.bo.model.Delega; import it.tref.liferay.portos.bo.model.impl.DelegaImpl; import it.tref.liferay.portos.bo.model.impl.DelegaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.DelegaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DettPraticaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DettPraticaPersistenceImpl.java index 25ae6f5c..a023a69e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DettPraticaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DettPraticaPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchDettPraticaException; import it.tref.liferay.portos.bo.model.DettPratica; import it.tref.liferay.portos.bo.model.impl.DettPraticaImpl; import it.tref.liferay.portos.bo.model.impl.DettPraticaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.DettPraticaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocAggiuntivaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocAggiuntivaPersistenceImpl.java index 649a5476..c25ae1dc 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocAggiuntivaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocAggiuntivaPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchDocAggiuntivaException; import it.tref.liferay.portos.bo.model.DocAggiuntiva; import it.tref.liferay.portos.bo.model.impl.DocAggiuntivaImpl; import it.tref.liferay.portos.bo.model.impl.DocAggiuntivaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.DocAggiuntivaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocPraticaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocPraticaPersistenceImpl.java index 42630357..255330f7 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocPraticaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocPraticaPersistenceImpl.java @@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchDocPraticaException; import it.tref.liferay.portos.bo.model.DocPratica; import it.tref.liferay.portos.bo.model.impl.DocPraticaImpl; import it.tref.liferay.portos.bo.model.impl.DocPraticaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.DocPraticaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/FineLavoriPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/FineLavoriPersistenceImpl.java index a5f79405..7ba24480 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/FineLavoriPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/FineLavoriPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchFineLavoriException; import it.tref.liferay.portos.bo.model.FineLavori; import it.tref.liferay.portos.bo.model.impl.FineLavoriImpl; import it.tref.liferay.portos.bo.model.impl.FineLavoriModelImpl; +import it.tref.liferay.portos.bo.service.persistence.FineLavoriPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/HistoryWorkflowActionPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/HistoryWorkflowActionPersistenceImpl.java index ad50d7ea..f80406ab 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/HistoryWorkflowActionPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/HistoryWorkflowActionPersistenceImpl.java @@ -42,6 +42,7 @@ import it.tref.liferay.portos.bo.NoSuchHistoryWorkflowActionException; import it.tref.liferay.portos.bo.model.HistoryWorkflowAction; import it.tref.liferay.portos.bo.model.impl.HistoryWorkflowActionImpl; import it.tref.liferay.portos.bo.model.impl.HistoryWorkflowActionModelImpl; +import it.tref.liferay.portos.bo.service.persistence.HistoryWorkflowActionPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IUVPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IUVPersistenceImpl.java index a6ba54ac..6f469f0e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IUVPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IUVPersistenceImpl.java @@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchIUVException; import it.tref.liferay.portos.bo.model.IUV; import it.tref.liferay.portos.bo.model.impl.IUVImpl; import it.tref.liferay.portos.bo.model.impl.IUVModelImpl; +import it.tref.liferay.portos.bo.service.persistence.IUVPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/InfoFascicoloPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/InfoFascicoloPersistenceImpl.java index 12f22a0a..b85535de 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/InfoFascicoloPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/InfoFascicoloPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchInfoFascicoloException; import it.tref.liferay.portos.bo.model.InfoFascicolo; import it.tref.liferay.portos.bo.model.impl.InfoFascicoloImpl; import it.tref.liferay.portos.bo.model.impl.InfoFascicoloModelImpl; +import it.tref.liferay.portos.bo.service.persistence.InfoFascicoloPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IntPraticaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IntPraticaPersistenceImpl.java index 307036e1..ee52c9b7 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IntPraticaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IntPraticaPersistenceImpl.java @@ -48,6 +48,7 @@ import it.tref.liferay.portos.bo.NoSuchIntPraticaException; import it.tref.liferay.portos.bo.model.IntPratica; import it.tref.liferay.portos.bo.model.impl.IntPraticaImpl; import it.tref.liferay.portos.bo.model.impl.IntPraticaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.IntPraticaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/PagamentoPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/PagamentoPersistenceImpl.java index 8dbf29df..ee3b3b9b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/PagamentoPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/PagamentoPersistenceImpl.java @@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchPagamentoException; import it.tref.liferay.portos.bo.model.Pagamento; import it.tref.liferay.portos.bo.model.impl.PagamentoImpl; import it.tref.liferay.portos.bo.model.impl.PagamentoModelImpl; +import it.tref.liferay.portos.bo.service.persistence.PagamentoPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ParereGeologoPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ParereGeologoPersistenceImpl.java index c6ce3907..e4133c60 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ParereGeologoPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ParereGeologoPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchParereGeologoException; import it.tref.liferay.portos.bo.model.ParereGeologo; import it.tref.liferay.portos.bo.model.impl.ParereGeologoImpl; import it.tref.liferay.portos.bo.model.impl.ParereGeologoModelImpl; +import it.tref.liferay.portos.bo.service.persistence.ParereGeologoPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ProvinciaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ProvinciaPersistenceImpl.java index daa33e1b..2c7a846f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ProvinciaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ProvinciaPersistenceImpl.java @@ -43,6 +43,7 @@ import it.tref.liferay.portos.bo.NoSuchProvinciaException; import it.tref.liferay.portos.bo.model.Provincia; import it.tref.liferay.portos.bo.model.impl.ProvinciaImpl; import it.tref.liferay.portos.bo.model.impl.ProvinciaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.ProvinciaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SoggettoPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SoggettoPersistenceImpl.java index 29c4a390..ef2db5f2 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SoggettoPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SoggettoPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchSoggettoException; import it.tref.liferay.portos.bo.model.Soggetto; import it.tref.liferay.portos.bo.model.impl.SoggettoImpl; import it.tref.liferay.portos.bo.model.impl.SoggettoModelImpl; +import it.tref.liferay.portos.bo.service.persistence.SoggettoPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SorteggioPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SorteggioPersistenceImpl.java index ec8a983f..fc566b28 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SorteggioPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SorteggioPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchSorteggioException; import it.tref.liferay.portos.bo.model.Sorteggio; import it.tref.liferay.portos.bo.model.impl.SorteggioImpl; import it.tref.liferay.portos.bo.model.impl.SorteggioModelImpl; +import it.tref.liferay.portos.bo.service.persistence.SorteggioPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/StoricoSoggettoPraticaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/StoricoSoggettoPraticaPersistenceImpl.java index 78333501..0c095d3d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/StoricoSoggettoPraticaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/StoricoSoggettoPraticaPersistenceImpl.java @@ -42,6 +42,7 @@ import it.tref.liferay.portos.bo.NoSuchStoricoSoggettoPraticaException; import it.tref.liferay.portos.bo.model.StoricoSoggettoPratica; import it.tref.liferay.portos.bo.model.impl.StoricoSoggettoPraticaImpl; import it.tref.liferay.portos.bo.model.impl.StoricoSoggettoPraticaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.StoricoSoggettoPraticaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TempisticaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TempisticaPersistenceImpl.java index 720078c4..252fc452 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TempisticaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TempisticaPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchTempisticaException; import it.tref.liferay.portos.bo.model.Tempistica; import it.tref.liferay.portos.bo.model.impl.TempisticaImpl; import it.tref.liferay.portos.bo.model.impl.TempisticaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.TempisticaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TerritorioPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TerritorioPersistenceImpl.java index a9c7f7d5..c8e0dee9 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TerritorioPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TerritorioPersistenceImpl.java @@ -44,6 +44,7 @@ import it.tref.liferay.portos.bo.NoSuchTerritorioException; import it.tref.liferay.portos.bo.model.Territorio; import it.tref.liferay.portos.bo.model.impl.TerritorioImpl; import it.tref.liferay.portos.bo.model.impl.TerritorioModelImpl; +import it.tref.liferay.portos.bo.service.persistence.TerritorioPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/UtentePortosPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/UtentePortosPersistenceImpl.java index 89f06b61..83b7ed61 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/UtentePortosPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/UtentePortosPersistenceImpl.java @@ -43,6 +43,7 @@ import it.tref.liferay.portos.bo.NoSuchUtentePortosException; import it.tref.liferay.portos.bo.model.UtentePortos; import it.tref.liferay.portos.bo.model.impl.UtentePortosImpl; import it.tref.liferay.portos.bo.model.impl.UtentePortosModelImpl; +import it.tref.liferay.portos.bo.service.persistence.UtentePortosPersistence; import java.io.Serializable; 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 455cdd8a..3595c3be 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=2601 - build.date=1600763424994 + build.number=2613 + build.date=1600787107922 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java index ac38e091..b6a26493 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java @@ -326,7 +326,7 @@ public class FascicoloFePortlet extends MVCPortlet { long classPk = ParamUtil.getLong(resourceRequest, "classPk"); JSONObject json = JSONFactoryUtil.createJSONObject(); - json.put("isCompleted", ValidazionePraticaUtil.isDelegaGeologoCompleted(classPk)); + json.put("isCompleted", ValidazionePraticaUtil.notCompletedSezioneGeologica(classPk).isEmpty()); writeJSON(resourceRequest, resourceResponse, json); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/save_actions.jspf b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/save_actions.jspf index 429cb50f..a03fe18f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/save_actions.jspf +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/save_actions.jspf @@ -165,7 +165,7 @@ StringBuilder tooltipSection = new StringBuilder(); if(delega.getTipologia().equalsIgnoreCase(DelegheUtil.TIPO_GEOLOGO)){ //List notCompleted = ValidazionePraticaUtil.notCompletedSection(SezioniUtil.SEZIONE_GEOLOGICA, dettPraticaId); - List notCompleted = ValidazionePraticaUtil.hasDelegaGeologoCompleted(dettPraticaId); + List notCompleted = ValidazionePraticaUtil.notCompletedSezioneGeologica(dettPraticaId); if(!notCompleted.isEmpty()){ validated = false; tooltipSection.append("
    ");