From d22339cfd780639b694181870cc3f8e24980e83c Mon Sep 17 00:00:00 2001 From: Mattia Gosetto Date: Thu, 24 Jun 2021 10:08:35 +0200 Subject: [PATCH] filtri tipo pratica --- .../ControlloPraticaAdvancedSearch.java | 5 +++- .../bo/search/IntPraticaAdvancedSearch.java | 11 +++++++++ .../portos/bo/indexer/IntPraticaIndexer.java | 7 ++++++ .../portos/bo/portlet/FascicoloPortlet.java | 8 +++---- .../docroot/WEB-INF/src/service.properties | 4 ++-- .../html/fascicolo/advanced_search.jsp | 13 +++++----- .../html/gestioneattivita/advanced_search.jsp | 24 +++++-------------- 7 files changed, 40 insertions(+), 32 deletions(-) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/ControlloPraticaAdvancedSearch.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/ControlloPraticaAdvancedSearch.java index 9637aa1e..0f92a271 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/ControlloPraticaAdvancedSearch.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/ControlloPraticaAdvancedSearch.java @@ -48,7 +48,7 @@ import com.liferay.portal.service.RoleLocalServiceUtil; public class ControlloPraticaAdvancedSearch { public static final String[] OVERRIDE_KEYWORDS = { "controlloPraticaId", "numeroProgetto", "tipoPratica", "statoPratica", "dataRichiesta", "committente", "soggettiInteressati", "status", "entryClassName", - "userId", "descIntervento" }; + "userId", "descIntervento", "tipoProcedura" }; public static final Format DATE_FORMAT_LUCENE = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyyMMdd"); public static final DateFormat DATE_FORMAT_STRING = new SimpleDateFormat("dd/MM/yyyy"); @@ -518,6 +518,9 @@ public class ControlloPraticaAdvancedSearch { String tipoAttivita = ParamUtil.getString(request, "tipoAttivita"); String controlloObbligatorioSearch = ParamUtil.getString(request, "controlloObbligatorio"); String sorteggiataSearch = ParamUtil.getString(request, "sorteggiata"); + + _log.info(tipoProcedura); + try { if (Validator.isNotNull(tipoAttivita) && !tipoAttivita.equals("-1")) { TermQuery tipoAttivitaTermQuery = TermQueryFactoryUtil.create(searchContext, "workflowState", diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/IntPraticaAdvancedSearch.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/IntPraticaAdvancedSearch.java index 3294a66f..8aa501d6 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/IntPraticaAdvancedSearch.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/IntPraticaAdvancedSearch.java @@ -376,6 +376,7 @@ public class IntPraticaAdvancedSearch { } queryStatoPratica(request, booleanQuery, searchContext); + queryTipoProcedura(request, booleanQuery, searchContext); addRequiredTerms(booleanQuery, PortosIndexField.COMMITTENTI, ParamUtil.getString(request, "committente")); @@ -615,6 +616,16 @@ public class IntPraticaAdvancedSearch { booleanQuery.add(termQuery, BooleanClauseOccur.MUST); } } + + private static void queryTipoProcedura(HttpServletRequest request, BooleanQuery booleanQuery, + SearchContext searchContext) throws ParseException { + String tipoProcedura = ParamUtil.getString(request, PortosIndexField.TIPO_PROCEDURA); + if (Validator.isNotNull(tipoProcedura)) { + TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.TIPO_PROCEDURA, tipoProcedura); + if (Validator.isNotNull(termQuery)) + booleanQuery.add(termQuery, BooleanClauseOccur.MUST); + } + } private static void logResults(User user, BooleanQuery booleanQuery, Hits hits) { if (_log.isDebugEnabled()) { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java index 940b9d85..e41a5a40 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java @@ -16,6 +16,7 @@ import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; import it.tref.liferay.portos.bo.service.SorteggioLocalServiceUtil; import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; import it.tref.liferay.portos.bo.service.persistence.IntPraticaActionableDynamicQuery; +import it.tref.liferay.portos.bo.shared.util.Constants; import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants; import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil; import it.tref.liferay.portos.bo.util.PortosIndexField; @@ -162,6 +163,12 @@ public class IntPraticaIndexer extends BaseIndexer { boolean sorteggiata = SorteggioLocalServiceUtil.findByIntPratica(intPraticaFromDB.getIntPraticaId()) != null; document.addKeyword("sorteggiata", sorteggiata); document.addKeyword("controlloObbligatorio", intPraticaFromDB.isControlloObbligatorio()); + String tipoProcedura = intPratica.getTipoProcedura(); + if (Validator.isNotNull(tipoProcedura)) { + if (tipoProcedura.equalsIgnoreCase(Constants.PROCEDURA_B1)) + tipoProcedura = Constants.PROCEDURA_B; + document.addKeyword(PortosIndexField.TIPO_PROCEDURA, tipoProcedura); + } // Gestione pratica aperta/chiusa fine lavori if (intPraticaFromDB.getCollaudoTotale()) { document.addKeyword(PortosIndexField.PRATICA_APERTA, false); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/FascicoloPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/FascicoloPortlet.java index fdd7c042..15699fa2 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/FascicoloPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/FascicoloPortlet.java @@ -236,10 +236,10 @@ public class FascicoloPortlet extends MVCPortlet { } public void searchURL(ActionRequest actionRequest, ActionResponse actionResponse) { - String numeroProgetto = actionRequest.getParameter("numeroProgetto"); String protocollo = actionRequest.getParameter("protocollo"); - String tipoPratica = actionRequest.getParameter("tipoPratica"); + //String tipoPratica = actionRequest.getParameter("tipoPratica"); + String tipoProcedura = actionRequest.getParameter("tipoProcedura"); String statoPratica = actionRequest.getParameter("statoPratica"); String committente = actionRequest.getParameter("committente"); String descInterventoSearch = actionRequest.getParameter("descIntervento"); @@ -277,8 +277,8 @@ public class FascicoloPortlet extends MVCPortlet { actionResponse.setRenderParameter("praticaAperta", praticaAperta); actionResponse.setRenderParameter("descIntervento", descInterventoSearch); actionResponse.setRenderParameter("protocollo", protocollo); - actionResponse.setRenderParameter("tipoPratica", tipoPratica); - actionResponse.setRenderParameter("tipoPratica", tipoPratica); + //actionResponse.setRenderParameter("tipoPratica", tipoPratica); + actionResponse.setRenderParameter("tipoProcedura", tipoProcedura); actionResponse.setRenderParameter("statoPratica", statoPratica); actionResponse.setRenderParameter("committente", committente); if (Validator.isNotNull(provincia)) { 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 8a4df545..96f70be3 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=2661 - build.date=1624456745283 + build.number=2668 + build.date=1624463936907 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp index d29a4cb5..00b80b64 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp @@ -34,12 +34,11 @@
- - Seleziona il tipo di pratica - - - - + + Tutte + INTERVENTO A (Autorizzazione) + INTERVENTO B (Deposito) + INTERVENTO C (Privo di rilevanza)
@@ -57,7 +56,7 @@ - +
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/advanced_search.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/advanced_search.jsp index e47c3fcd..f537ff76 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/advanced_search.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/advanced_search.jsp @@ -23,13 +23,11 @@ List organizationList = OrganizationLocalServiceUtil.getUserOrgani
- - Seleziona il tipo di pratica - - - - - + + Tutte + INTERVENTO A (Autorizzazione) + INTERVENTO B (Deposito) + INTERVENTO C (Privo di rilevanza)
@@ -43,7 +41,7 @@ List organizationList = OrganizationLocalServiceUtil.getUserOrgani - + @@ -140,16 +138,6 @@ List organizationList = OrganizationLocalServiceUtil.getUserOrgani
- - Tutte - Procedura A - Procedura B - Procedura C - -
- -
-
Tutte Assegnazione