From c4b4bef0280163e5e0e1f0ab6641465352031f45 Mon Sep 17 00:00:00 2001 From: Mattia Gosetto Date: Tue, 24 Aug 2021 10:29:21 +0200 Subject: [PATCH 1/5] iniziato lavoro filtri bo e fe --- .../WEB-INF/src/content/Portal.properties | 2 + .../bo/portlet/GestioneAttivitaPortlet.java | 90 ++++-- .../AllegatoManualePersistenceImpl.java | 1 - .../AsseverazionePersistenceImpl.java | 1 - .../persistence/AvvisoPersistenceImpl.java | 1 - .../persistence/CollaudoPersistenceImpl.java | 1 - .../persistence/ComunePersistenceImpl.java | 1 - .../ComunicazionePersistenceImpl.java | 1 - .../ConfigurazionePersistenceImpl.java | 1 - .../ControlloPraticaPersistenceImpl.java | 1 - .../persistence/DelegaPersistenceImpl.java | 1 - .../DettPraticaPersistenceImpl.java | 1 - .../DocAggiuntivaPersistenceImpl.java | 1 - .../DocPraticaPersistenceImpl.java | 1 - .../FineLavoriPersistenceImpl.java | 1 - .../HistoryWorkflowActionPersistenceImpl.java | 1 - .../IntPraticaPersistenceImpl.java | 1 - .../persistence/PagamentoPersistenceImpl.java | 1 - .../ParereGeologoPersistenceImpl.java | 1 - .../persistence/ProvinciaPersistenceImpl.java | 1 - .../persistence/SoggettoPersistenceImpl.java | 1 - ...StoricoSoggettoPraticaPersistenceImpl.java | 1 - .../TempisticaPersistenceImpl.java | 1 - .../TerritorioPersistenceImpl.java | 1 - .../docroot/WEB-INF/src/service.properties | 4 +- .../html/gestioneattivita/advanced_search.jsp | 269 ++++++++++-------- .../html/gestioneattivita/view_columns.jspf | 14 +- .../html/fascicolofe/advanced_search.jsp | 3 - 28 files changed, 228 insertions(+), 176 deletions(-) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties index 9463f45e..143dd9fa 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties @@ -17,6 +17,8 @@ tipo-pratica-01 = Deposito tipo-pratica-02 = Autorizzazione tipo-pratica-03 = Sanatoria +in-corso = In corso + stato-pratica-AL = Annullata stato-pratica-AU = Autorizzata stato-pratica-AV = Attestazione vincoli diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java index d7371d3d..050cadaf 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java @@ -25,6 +25,8 @@ import it.tref.liferay.portos.bo.util.WorkflowUtil; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.Date; import java.util.List; import java.util.Locale; @@ -253,7 +255,7 @@ public class GestioneAttivitaPortlet extends MVCPortlet { } @Override - public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, + public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, PortletException { ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY); @@ -273,38 +275,70 @@ public class GestioneAttivitaPortlet extends MVCPortlet { csv = exportSearch(locale, resourceRequest, user, cmd); } // ADT BUG BO ID= 1 SEZIONE ATTIVITÀ - if ("comuniForUfficio".equals(id)) { - String ufficio = ParamUtil.getString(resourceRequest, "ufficioId"); - JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); - List comuni; - if (Validator.isNotNull(ufficio) && !ufficio.equals("0")) { - try { - if (!ufficio.equals("-1")) { - long ufficioId = Long.parseLong(ufficio); - comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserIdUfficioId(user.getUserId(), - ufficioId); - for (Comune comune : comuni) { - JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); - jsonObject.put("comuneId", comune.getComuneId()); - jsonObject.put("descLong", comune.getDenominazione()); - - jsonArray.put(jsonObject); + + try{ + if ("comuniForUfficio".equals(id)) { + + String ufficio = ParamUtil.getString(resourceRequest, "ufficioId"); + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + List comuni; + if (Validator.isNotNull(ufficio) && !ufficio.equals("0")) { + try { + if (!ufficio.equals("-1")) { + long ufficioId = Long.parseLong(ufficio); + comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserIdUfficioId(user.getUserId(), + ufficioId); + for (Comune comune : comuni) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("comuneId", comune.getComuneId()); + jsonObject.put("descLong", comune.getDenominazione()); + + jsonArray.put(jsonObject); + } + writeJSON(resourceRequest, resourceResponse, jsonArray); + } else { + comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserId(user.getUserId()); + for (Comune comune : comuni) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("comuneId", comune.getComuneId()); + jsonObject.put("descLong", comune.getDenominazione()); + jsonArray.put(jsonObject); + } + writeJSON(resourceRequest, resourceResponse, jsonArray); } - writeJSON(resourceRequest, resourceResponse, jsonArray); - } else { - comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserId(user.getUserId()); - for (Comune comune : comuni) { - JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); - jsonObject.put("comuneId", comune.getComuneId()); - jsonObject.put("descLong", comune.getDenominazione()); - jsonArray.put(jsonObject); + } catch (Exception e) { + e.printStackTrace(); + } + } + }else if ("comuni".equals(id)) { + String provinciaId = ParamUtil.getString(resourceRequest, "provinciaId"); + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + if (Validator.isNotNull(provinciaId) && !provinciaId.equals("0")) { + List comuniIds = TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(provinciaId); + // ADT BUG-ID=15 Sezione Ricerca / Ordinamento Filtro + List comumeList = new ArrayList(); + for (long comuneId : comuniIds) { + Comune comune = ComuneLocalServiceUtil.getComune(comuneId); + comumeList.add(comune); + } + Collections.sort(comumeList, new Comparator() { + @Override + public int compare(Comune o1, Comune o2) { + return o1.getDenominazione().compareTo(o2.getDenominazione()); } - writeJSON(resourceRequest, resourceResponse, jsonArray); + }); + for (Comune comune : comumeList) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("comuneId", comune.getComuneId()); + jsonObject.put("descLong", comune.getDenominazione()); + jsonArray.put(jsonObject); } - } catch (Exception e) { - e.printStackTrace(); } + writeJSON(resourceRequest, resourceResponse, jsonArray); } + }catch (Exception e) { + _log.error(e, e); + throw new IOException(e); } ServletResponseUtil.sendFile(request, response, "export_pratiche.csv", csv.getBytes(StringPool.UTF8), ContentTypes.TEXT_CSV_UTF8); 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 3e5128f0..73a46094 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,7 +45,6 @@ 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 15633d6f..63caa01d 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,7 +46,6 @@ 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 d73613ab..8f8bd310 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,7 +46,6 @@ 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 02dcaba3..0b546e1a 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,7 +45,6 @@ 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 4a23bffd..b0b64b21 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,7 +46,6 @@ 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 f5b8166f..0b7f9ee2 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,7 +45,6 @@ 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 32809343..66507dd0 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,7 +45,6 @@ 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 a4fa6f91..48cf51eb 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,7 +45,6 @@ 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 8c56fb32..402cecd0 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,7 +46,6 @@ 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 36e82c84..bef23f56 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,7 +45,6 @@ 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 3adff95b..689264dd 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,7 +45,6 @@ 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 13bd7b4f..f4a4b84a 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,7 +46,6 @@ 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 15f0504f..41c1b2be 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,7 +45,6 @@ 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 f80406ab..ad50d7ea 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,7 +42,6 @@ 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/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 b2d8fab5..35a1b793 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,7 +48,6 @@ 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 863e32df..12fb36d2 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,7 +46,6 @@ 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 c0aa0a79..9a0ac9b3 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,7 +45,6 @@ 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 2c7a846f..daa33e1b 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,7 +43,6 @@ 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 90251acb..35a48fdf 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,7 +45,6 @@ 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/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 26f13dda..da5af496 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,7 +42,6 @@ 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 de92727b..90d5b692 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,7 +45,6 @@ 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 030778b4..6e60848d 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,7 +44,6 @@ 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/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties index 3f6e6ba7..1be3e575 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=3251 - build.date=1628156859254 + build.number=3252 + build.date=1629790064644 build.auto.upgrade=true ## 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 cd82c6ee..d231c02d 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 @@ -25,9 +25,6 @@ List organizationList = OrganizationLocalServiceUtil.getUserOrgani
-
- -
Seleziona il tipo di pratica @@ -44,7 +41,7 @@ List organizationList = OrganizationLocalServiceUtil.getUserOrgani
-
+ +
+
+
+ + + <% + List province = TerritorioLocalServiceUtil.getActiveProvince(); + //ADT BUG-ID=15 Sezione Ricerca / Ordinamento Filtro + List provinceList = new ArrayList(); + for (String codiceProvincia : province) { + Provincia provinciaToStamp = ProvinciaLocalServiceUtil.fetchByC_C(company.getCompanyId(), + codiceProvincia); + provinceList.add(provinciaToStamp); + } + Collections.sort(provinceList, new Comparator() { + public int compare(Provincia o1, Provincia o2){ + return o1.getProvincia().compareTo(o2.getProvincia()); + } + }); + for (Provincia provincia : provinceList) { + %> + + <%= provincia.getProvincia() %> + + <% + } + %> + +
+
+ <% + String comuneSelect = ParamUtil.getString(renderRequest, "comune"); + %> +
-
+
+ +
+
-
- +
+
-
- <%-- ADT BUG BO ID = 8 SEZIONE ATTIVITÀ --%> - - - Tutti - <% - List tecniciIstruttori = new ArrayList(); - for(Organization org : organizationList) { - Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_istruttore"); - List istruttori = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole( - org.getGroupId(), role.getRoleId()); - for (UserGroupRole userGroupRole : istruttori) { - if (tecniciIstruttori.isEmpty()) { - tecniciIstruttori.add(userGroupRole); - } else { - boolean isPresent = false; - for(UserGroupRole tecnico : tecniciIstruttori) { - if (tecnico.getUserId() == userGroupRole.getUserId()) { - isPresent = true; - break; - } - } - if(!isPresent){ +
+
+
+ +
+
+ + + Tutti + <% + List tecniciIstruttori = new ArrayList(); + for(Organization org : organizationList) { + Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_istruttore"); + List istruttori = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole( + org.getGroupId(), role.getRoleId()); + for (UserGroupRole userGroupRole : istruttori) { + if (tecniciIstruttori.isEmpty()) { tecniciIstruttori.add(userGroupRole); + } else { + boolean isPresent = false; + for(UserGroupRole tecnico : tecniciIstruttori) { + if (tecnico.getUserId() == userGroupRole.getUserId()) { + isPresent = true; + break; + } + } + if(!isPresent){ + tecniciIstruttori.add(userGroupRole); + } } } } - } - List tecniciIstruttoriSorted = new ArrayList(); - for (UserGroupRole tecnico : tecniciIstruttori) { - IstruttoreBean istruttore = new IstruttoreBean(); - istruttore.setIdIstruttore(tecnico.getUserId()); - istruttore.setDenominazione(tecnico.getUser().getFullName()); - tecniciIstruttoriSorted.add(istruttore); - } - Collections.sort(tecniciIstruttoriSorted); - for (IstruttoreBean istruttore : tecniciIstruttoriSorted) { - %> - <%= istruttore.getDenominazione() %> - <% - } + List tecniciIstruttoriSorted = new ArrayList(); + for (UserGroupRole tecnico : tecniciIstruttori) { + IstruttoreBean istruttore = new IstruttoreBean(); + istruttore.setIdIstruttore(tecnico.getUserId()); + istruttore.setDenominazione(tecnico.getUser().getFullName()); + tecniciIstruttoriSorted.add(istruttore); + } + Collections.sort(tecniciIstruttoriSorted); + for (IstruttoreBean istruttore : tecniciIstruttoriSorted) { + %> + <%= istruttore.getDenominazione() %> + <% + } %>
+ +
+ +
+ +
+ +
@@ -159,28 +205,8 @@ List organizationList = OrganizationLocalServiceUtil.getUserOrgani
-
- - - Tutte - <% - for (Organization org : organizationList) { - if (org.getParentOrganizationId() != 0) { - %> - <%= org.getName() %> - <% - } - } - %> - - -
-
- <% - String comuneSelect = ParamUtil.getString(renderRequest, "comune"); - %> - -
+
+
-
- +
+ Tutte Assegnazione Approvazione @@ -203,73 +229,76 @@ List organizationList = OrganizationLocalServiceUtil.getUserOrgani Firma
+
+ + Tutti + Autorizzata + Non autorizzata + Non si rilascia parere + +
-
-
-
- - Nome Task - Numero Progetto - Protocollo - Data Invio - Tipo Pratica - -
-
- - Dec - Asc - -
-
+
+ + Nome Task + Numero Progetto + Protocollo + Data Invio + Tipo Pratica + +
+
+ + Dec + Asc +
+ <%-- ADT BUG BO ID = 1 SEZIONE ATTIVITÀ --%> - - -$(".add-new-project__ufficio select").change(function() { - var comuni = ''; - var val = $(this).val(); - $(".add-new-project__comune select").empty(); - A.io.request( - '<%= getComuniURL %>', - { + + +var getComuni = function(provinciaId, comuneId, comuneValue) { + var comuneSelect = A.one("#"+comuneId); + if (provinciaId == "" || provinciaId == "000") { + comuneSelect.html("") + comuneSelect.addClass("disabled").set("disabled", true); + } else { + A.io.request('<%= getComuniURL %>', { data: { - ufficioId: val + provinciaId: provinciaId }, dataType: 'json', on: { success: function() { - $(".add-new-project__comune select").empty(); - $(".add-new-project__comune select").append($('") for (index in response) { - $(".add-new-project__comune select").append($(''; + comuneSelect.append(code); } - if (checkIfExists) { - $(".add-new-project__comune select").val(cs); + if (provinciaId != "" && provinciaId != "000") { + comuneSelect.removeClass("disabled").set("disabled", false); } } } - } - ); -}).trigger("change"); + }); + } +}; + +A.ready(function() { + A.one(".provinciaSelect").on('change', function(event) { + var provinciaId = event.currentTarget.get('value'), + comuneId = event.currentTarget.attr("id").replace("provincia","comune"), + comuneValue = "000"; + getComuni(provinciaId, comuneId, comuneValue) + }); +}); \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf index e6eed721..e14b01e6 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf @@ -1,3 +1,4 @@ +<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.kernel.dao.orm.QueryUtil"%> <%@page import="com.liferay.portal.kernel.language.LanguageUtil"%> @@ -80,11 +81,22 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP } } } + + if(intPratica.getStatoPratica().equals(StatoPraticaConstants.INTEGRAZIONE)){ + taskName += " " + LanguageUtil.get(pageContext, "in-corso"); + } out.print(taskName); %> - <%= ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica.getControlloPraticaId()) %> + <% + String esito = StringPool.BLANK; + esito += ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica.getControlloPraticaId()); + if(intPratica.getStatoPratica().equals(StatoPraticaConstants.INTEGRAZIONE)){ + esito += " " + LanguageUtil.get(pageContext, "in-corso"); + } + out.print(esito); + %> <%-- ADT - BUG-12 Aggiunta colonna Data Esito --%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp index 6ac9ebed..cd1f07fa 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp @@ -9,9 +9,6 @@
-
- -
Seleziona il tipo di pratica From a964d4700f9754dd8afca90a5d4cad994b9e3129 Mon Sep 17 00:00:00 2001 From: Mattia Gosetto Date: Wed, 25 Aug 2021 12:28:26 +0200 Subject: [PATCH 2/5] paesaggistica search --- .../ControlloPraticaAdvancedSearch.java | 42 ++- .../bo/search/IntPraticaAdvancedSearch.java | 42 ++- .../WEB-INF/src/content/Portal.properties | 2 +- .../portos/bo/indexer/IntPraticaIndexer.java | 2 + .../portos/bo/portlet/FascicoloPortlet.java | 162 ++++++++- .../GestioneAttivitaIstruttorePortlet.java | 15 +- .../bo/portlet/GestioneAttivitaPortlet.java | 133 ++++++- .../docroot/WEB-INF/src/service.properties | 4 +- .../html/fascicolo/advanced_search.jsp | 336 ++++++++++-------- .../html/gestioneattivita/advanced_search.jsp | 275 +++++++------- .../advanced_search.jsp | 171 ++++----- .../html/fascicolofe/advanced_search.jsp | 25 +- 12 files changed, 797 insertions(+), 412 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 77b9bd15..5681e1d3 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 @@ -17,6 +17,8 @@ import java.util.Properties; import javax.servlet.http.HttpServletRequest; +import org.apache.commons.lang.StringUtils; + import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; @@ -54,7 +56,7 @@ 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"); @@ -515,10 +517,10 @@ public class ControlloPraticaAdvancedSearch { String committenteSearch = ParamUtil.getString(request, "committente"); String soggettiInterconnessiSearch = ParamUtil.getString(request, "soggettiInterconnessi"); String istruttoreId = ParamUtil.getString(request, "istruttore"); + String unitaOperativa = ParamUtil.getString(request, "unitaOperativa"); String dataDa = ParamUtil.getString(request, "dataRichiestaInizio"); String dataAl = ParamUtil.getString(request, "dataRichiestaFine"); String comune = ParamUtil.getString(request, "comune"); - String tipoProcedura = ParamUtil.getString(request, "tipoProcedura"); String tipoAttivita = ParamUtil.getString(request, "tipoAttivita"); // ADT - BUG-11 Aggiunta filtro ricerca String controlloObbligatorioSearch = ParamUtil.getString(request, "controlloObbligatorio"); @@ -575,6 +577,9 @@ public class ControlloPraticaAdvancedSearch { booleanQuery.add(statoPraticaSearchTermQuery, BooleanClauseOccur.MUST); } } + + queryTipoProcedura(request, booleanQuery, searchContext); + if (Validator.isNotNull(committenteSearch)) { TermQuery committenteSearchTermQuery = TermQueryFactoryUtil.create(searchContext, "committenti", committenteSearch.toUpperCase()); @@ -585,11 +590,18 @@ public class ControlloPraticaAdvancedSearch { "soggettiInterconnessi", soggettiInterconnessiSearch.toUpperCase()); booleanQuery.add(soggettiInterconnessiSearchTermQuery, BooleanClauseOccur.MUST); } - if (Validator.isNotNull(istruttoreId) && !istruttoreId.equals("-1")) { + if (Validator.isNotNull(istruttoreId) && !istruttoreId.equals("-1") && !istruttoreId.equals("0")) { TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "istruttoreUserId", istruttoreId); booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST); } + + if (Validator.isNotNull(unitaOperativa) && !unitaOperativa.equals("-1")) { + TermQuery uoQuery = TermQueryFactoryUtil.create(searchContext, "unitaOperativa", + unitaOperativa); + booleanQuery.add(uoQuery, BooleanClauseOccur.MUST); + } + if (Validator.isNotNull(dataDa) && Validator.isNotNull(dataAl)) { Date dataDaApp = DATE_FORMAT_STRING.parse(dataDa); Date dataAlApp = DATE_FORMAT_STRING.parse(dataAl); @@ -614,20 +626,36 @@ public class ControlloPraticaAdvancedSearch { booleanQuery.add(comuneTermQuery, BooleanClauseOccur.MUST); } - if (Validator.isNotNull(tipoProcedura)) { - TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, "tipoProcedura", tipoProcedura); - booleanQuery.add(termQuery, BooleanClauseOccur.MUST); - } // ADT - BUG-11 Aggiunta filtro ricerca if (Validator.isNotNull(controlloObbligatorioSearch)) { TermQuery controlloObbligatorioTermQuery = TermQueryFactoryUtil.create(searchContext, "controlloObbligatorio", controlloObbligatorioSearch); booleanQuery.add(controlloObbligatorioTermQuery, BooleanClauseOccur.MUST); } + + _log.info("Query backend" + booleanQuery.toString()); + } catch (ParseException | java.text.ParseException e) { _log.error(e, e); } } + + private static void queryTipoProcedura(HttpServletRequest request, BooleanQuery booleanQuery, + SearchContext searchContext) throws ParseException { + + String tipoProcedura = ParamUtil.getString(request, PortosIndexField.TIPO_PROCEDURA); + if (Validator.isNotNull(tipoProcedura) && !tipoProcedura.equals("-1")) { + String[] procSplit = StringUtils.split(tipoProcedura, "|"); + if(procSplit.length > 0){ + for(String proc : procSplit){ + BooleanQuery bq = BooleanQueryFactoryUtil.create(searchContext); + TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.TIPO_PROCEDURA, proc); + bq.add(termQuery, BooleanClauseOccur.SHOULD); + booleanQuery.add(bq, BooleanClauseOccur.MUST); + } + } + } + } private static Sort[] getOrderedQuery(HttpServletRequest request) { Properties properties = PropsUtil.getProperties("elasticsearch.", true); 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 42f0d11d..9d34694f 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 @@ -14,6 +14,8 @@ import java.util.Properties; import javax.servlet.http.HttpServletRequest; +import org.apache.commons.lang.StringUtils; + import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; @@ -51,7 +53,8 @@ public class IntPraticaAdvancedSearch { public static final String[] OVERRIDE_KEYWORDS = { PortosIndexField.INT_PRATICA_ID, PortosIndexField.NUMERO_PROGETTO, PortosIndexField.TIPO_PRATICA, PortosIndexField.STATO_PRATICA, PortosIndexField.DATA_RICHIESTA, PortosIndexField.COMMITTENTE, PortosIndexField.SOGGETTI_INTERESSATI, - PortosIndexField.STATUS, Field.ENTRY_CLASS_NAME, Field.USER_ID, PortosIndexField.DESC_INTERVENTO }; + PortosIndexField.STATUS, Field.ENTRY_CLASS_NAME, Field.USER_ID, PortosIndexField.DESC_INTERVENTO, + PortosIndexField.TIPO_PROCEDURA }; public static final Format DATE_FORMAT_LUCENE = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyyMMdd"); @@ -81,6 +84,7 @@ public class IntPraticaAdvancedSearch { booleanQuery.add(termQuery, BooleanClauseOccur.MUST); // Condizioni aggiuntive query(request, user, booleanQuery, searchContext); + hits = SearchEngineUtil.search(searchContext, booleanQuery); logResults(user, booleanQuery, hits); } catch (SearchException | ParseException e) { @@ -264,6 +268,9 @@ public class IntPraticaAdvancedSearch { */ private static void query(HttpServletRequest request, User user, BooleanQuery booleanQuery, SearchContext searchContext) { + + String istruttoreId = ParamUtil.getString(request, "istruttore"); + String unitaOperativa = ParamUtil.getString(request, "unitaOperativa"); try { TermQuery termQuery; @@ -275,6 +282,7 @@ public class IntPraticaAdvancedSearch { booleanQuery.add(termQuery, BooleanClauseOccur.MUST); } queryTipoPratica(request, booleanQuery, searchContext); + queryTipoProcedura(request, booleanQuery, searchContext); String tipoIntervento = ParamUtil.getString(request, "tipoIntervento"); if (Validator.isNotNull(tipoIntervento)) { if (tipoIntervento.equals("interventoLocale")) { @@ -296,6 +304,7 @@ public class IntPraticaAdvancedSearch { } queryStatoPratica(request, booleanQuery, searchContext); addRequiredTerms(booleanQuery, PortosIndexField.COMMITTENTI, ParamUtil.getString(request, "committente")); + addRequiredTerms(booleanQuery, PortosIndexField.ISTRUTTORE_FULL_NAME, ParamUtil.getString(request, "tecnicoIstruttore")); addRequiredTerms(booleanQuery, PortosIndexField.PROPRIETARIO_DIGITALE_FULL_NAME, @@ -310,6 +319,20 @@ public class IntPraticaAdvancedSearch { } queryComune(request, booleanQuery, searchContext); queryDate(request, booleanQuery, searchContext); + + if (Validator.isNotNull(istruttoreId) && !istruttoreId.equals("-1") && !istruttoreId.equals("0")) { + TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "istruttoreUserId", + istruttoreId); + booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST); + } + + if (Validator.isNotNull(unitaOperativa) && !unitaOperativa.equals("-1")) { + TermQuery uoQuery = TermQueryFactoryUtil.create(searchContext, "unitaOperativa", + unitaOperativa); + booleanQuery.add(uoQuery, BooleanClauseOccur.MUST); + } + + _log.info("Query frontend" + booleanQuery.toString()); } catch (ParseException | java.text.ParseException e) { _log.error(e, e); } @@ -446,6 +469,23 @@ 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) && !tipoProcedura.equals("-1")) { + String[] procSplit = StringUtils.split(tipoProcedura, "|"); + if(procSplit.length > 0){ + for(String proc : procSplit){ + BooleanQuery bq = BooleanQueryFactoryUtil.create(searchContext); + TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.TIPO_PROCEDURA, proc); + bq.add(termQuery, BooleanClauseOccur.SHOULD); + booleanQuery.add(bq, BooleanClauseOccur.MUST); + } + } + } + } private static void queryStatoPratica(HttpServletRequest request, BooleanQuery booleanQuery, SearchContext searchContext) throws ParseException { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties index 143dd9fa..f8cc87e1 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties @@ -1336,4 +1336,4 @@ mappe-openstreetmap = OpenStreetmap #tipo_procedura_Q19 = 9) Condono Edilizio sanatoria-edilizia = Sanatoria edilizia -intervento-voce-p7 = L.R. 5/2019, art. 3, allegato B: intervento alla voce B +intervento-voce-p7 = L.R. 5/2019, art. 3, allegato B: intervento alla voce B \ 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/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 c708ef2d..71ede575 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 @@ -136,6 +136,7 @@ public class IntPraticaIndexer extends BaseIndexer { document.addNumberSortable(PortosIndexField.NUMERO_PROGETTO, Integer.valueOf(intPraticaFromDB.getNumeroProgetto())); } + document.addKeyword(PortosIndexField.TIPO_PROCEDURA, intPraticaFromDB.getTipoProcedura()); document.addKeyword(PortosIndexField.IN_LAVORAZIONE_SUE, intPraticaFromDB.getInLavorazioneSue()); if (lastDettPratica != null) { document.addKeyword("nuovaCostruzione", lastDettPratica.getTcNuovaCostruzione()); @@ -248,6 +249,7 @@ public class IntPraticaIndexer extends BaseIndexer { } document.addKeyword(PortosIndexField.TIPO_PRATICA, intPraticaFromDB.getTipoPratica()); document.addKeywordSortable(PortosIndexField.TIPO_PRATICA, intPraticaFromDB.getTipoPratica()); + document.addKeyword(PortosIndexField.UNITA_OPERATIVA, intPraticaFromDB.getUnitaOperativa()); // Gestione Parere Geologo List listaParereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId( intPratica.getIntPraticaId(), 0, 1); 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 7625a915..99cfa4a9 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 @@ -21,8 +21,10 @@ import it.tref.liferay.portos.bo.service.ParereGeologoServiceUtil; import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil; import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; +import it.tref.liferay.portos.bo.shared.bean.IstruttoreBean; import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants; import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil; +import it.tref.liferay.portos.bo.shared.util.UnitaOperativeUtil; import it.tref.liferay.portos.bo.util.DocumentiPraticaUtil; import it.tref.liferay.portos.bo.util.PraticaUtil; import it.tref.liferay.portos.bo.util.ValidazionePraticaUtil; @@ -77,9 +79,15 @@ import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.WebKeys; import com.liferay.portal.kernel.zip.ZipWriter; import com.liferay.portal.kernel.zip.ZipWriterFactoryUtil; +import com.liferay.portal.model.Organization; +import com.liferay.portal.model.Role; import com.liferay.portal.model.User; +import com.liferay.portal.model.UserGroupRole; +import com.liferay.portal.service.OrganizationLocalServiceUtil; +import com.liferay.portal.service.RoleLocalServiceUtil; import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContextFactory; +import com.liferay.portal.service.UserGroupRoleLocalServiceUtil; import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.theme.ThemeDisplay; import com.liferay.portal.util.PortalUtil; @@ -240,21 +248,21 @@ 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 statoPratica = actionRequest.getParameter("statoPratica"); String committente = actionRequest.getParameter("committente"); - String descInterventoSearch = actionRequest.getParameter("descIntervento"); String tecnicoIstruttore = actionRequest.getParameter("tecnicoIstruttore"); String titolareDigitale = actionRequest.getParameter("titolareDigitale"); String soggettiInterconnessi = actionRequest.getParameter("soggettiInterconnessi"); String dataRichiestaInizio = actionRequest.getParameter("dataRichiestaInizio"); String dataRichiestaFine = actionRequest.getParameter("dataRichiestaFine"); String provincia = actionRequest.getParameter("provincia"); - String praticaAperta = actionRequest.getParameter("praticaAperta"); String comune = actionRequest.getParameter("comune"); String tipoIntervento = actionRequest.getParameter("tipoIntervento"); - String indirizzo = actionRequest.getParameter("indirizzo"); + String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura"); + String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa"); + String geologo = ParamUtil.getString(actionRequest, "geologo"); + String istruttore = ParamUtil.getString(actionRequest, "istruttore"); + if (Validator.isNotNull(dataRichiestaInizio)) { String[] dataRichiestaInizioSplitted = dataRichiestaInizio.split(StringPool.FORWARD_SLASH); actionResponse.setRenderParameter("dataRichiestaInizioDay", dataRichiestaInizioSplitted[0]); @@ -276,11 +284,10 @@ public class FascicoloPortlet extends MVCPortlet { actionResponse.setRenderParameter("tipoIntervento", tipoIntervento); } actionResponse.setRenderParameter("numeroProgetto", numeroProgetto); - actionResponse.setRenderParameter("praticaAperta", praticaAperta); - actionResponse.setRenderParameter("descIntervento", descInterventoSearch); - actionResponse.setRenderParameter("protocollo", protocollo); - actionResponse.setRenderParameter("tipoPratica", tipoPratica); - actionResponse.setRenderParameter("tipoPratica", tipoPratica); + //actionResponse.setRenderParameter("praticaAperta", praticaAperta); + //actionResponse.setRenderParameter("descIntervento", descInterventoSearch); + //actionResponse.setRenderParameter("protocollo", protocollo); + //actionResponse.setRenderParameter("tipoPratica", tipoPratica); actionResponse.setRenderParameter("statoPratica", statoPratica); actionResponse.setRenderParameter("committente", committente); if (Validator.isNotNull(provincia)) { @@ -289,7 +296,7 @@ public class FascicoloPortlet extends MVCPortlet { if (Validator.isNotNull(comune)) { actionResponse.setRenderParameter("comune", comune); } - actionResponse.setRenderParameter("indirizzo", indirizzo); + //actionResponse.setRenderParameter("indirizzo", indirizzo); if (Validator.isNull(tecnicoIstruttore)) { actionResponse.setRenderParameter("tecnicoIstruttore", StringPool.BLANK); } else { @@ -306,11 +313,21 @@ public class FascicoloPortlet extends MVCPortlet { } actionResponse.setRenderParameter("ordinaPer", ordinaPer); actionResponse.setRenderParameter("ordinaTipo", ordinaTipo); + + actionResponse.setRenderParameter("tipoProcedura", tipoProcedura); + actionResponse.setRenderParameter("unitaOperativa", unitaOperativa); + actionResponse.setRenderParameter("geologo", geologo); + actionResponse.setRenderParameter("istruttore", istruttore); } @Override public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, PortletException { + + ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY); + + Locale locale = themeDisplay.getLocale(); + User user = themeDisplay.getUser(); String id = resourceRequest.getResourceID(); try { @@ -364,12 +381,33 @@ public class FascicoloPortlet extends MVCPortlet { resourceResponse.getPortletOutputStream().write(data); resourceResponse.getPortletOutputStream().flush(); resourceResponse.getPortletOutputStream().close(); - } else if ("comuni".equals(id)) { + } else if ("province".equals(id)) { + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + List province = TerritorioLocalServiceUtil.getActiveProvince(); + for (String codiceProvincia : province) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(themeDisplay.getCompanyId(), codiceProvincia); + jsonObject.put("provinciaId", provincia.getCodiceProvincia()); + jsonObject.put("descLong", provincia.getSigla() + " - " + provincia.getProvincia()); + jsonArray.put(jsonObject); + } + writeJSON(resourceRequest, resourceResponse, jsonArray); + }else if ("unitaOperative".equals(id)) { + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + + for(int i=1; i<11; i++) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("uoId", i); + jsonObject.put("descLong", i); + jsonArray.put(jsonObject); + } + + writeJSON(resourceRequest, resourceResponse, jsonArray); + }else if ("comuni".equals(id)) { String provinciaId = ParamUtil.getString(resourceRequest, "provinciaId"); JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); if (Validator.isNotNull(provinciaId) && !provinciaId.equals("0")) { List comuniIds = TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(provinciaId); - // ADT BUG-ID=15 Sezione Ricerca / Ordinamento Filtro List comumeList = new ArrayList(); for (long comuneId : comuniIds) { Comune comune = ComuneLocalServiceUtil.getComune(comuneId); @@ -389,10 +427,102 @@ public class FascicoloPortlet extends MVCPortlet { } } writeJSON(resourceRequest, resourceResponse, jsonArray); + }else if ("istruttore".equals(id)) { + Integer uoId = ParamUtil.getInteger(resourceRequest, "uoId"); + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + if (Validator.isNotNull(uoId) && !uoId.equals("-1")) { + List organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); + List tecniciIstruttori = new ArrayList(); + + for(Organization org : organizationList) { + Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_istruttore"); + List istruttori = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole( + org.getGroupId(), role.getRoleId()); + for (UserGroupRole userGroupRole : istruttori) { + User istruttore = userGroupRole.getUser(); + List unitaOperativeIstruttore = UnitaOperativeUtil.getUnitaOperative(istruttore); + if(unitaOperativeIstruttore.contains(uoId)){ + if (tecniciIstruttori.isEmpty()) { + tecniciIstruttori.add(userGroupRole); + } else { + boolean isPresent = false; + for(UserGroupRole tecnico : tecniciIstruttori) { + if (tecnico.getUserId() == userGroupRole.getUserId()) { + isPresent = true; + break; + } + } + if(!isPresent){ + tecniciIstruttori.add(userGroupRole); + } + } + } + } + } + + List tecniciIstruttoriSorted = new ArrayList(); + for (UserGroupRole tecnico : tecniciIstruttori) { + IstruttoreBean istruttore = new IstruttoreBean(); + istruttore.setIdIstruttore(tecnico.getUserId()); + istruttore.setDenominazione(tecnico.getUser().getFullName()); + tecniciIstruttoriSorted.add(istruttore); + } + + Collections.sort(tecniciIstruttoriSorted); + + for (IstruttoreBean istruttore : tecniciIstruttoriSorted) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("istruttoreId", istruttore.getIdIstruttore()); + jsonObject.put("descLong", istruttore.getDenominazione()); + jsonArray.put(jsonObject); + } + } + + writeJSON(resourceRequest, resourceResponse, jsonArray); + + }else if ("geologo".equals(id)) { + Integer uoId = ParamUtil.getInteger(resourceRequest, "uoId"); + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + if (Validator.isNotNull(uoId) && !uoId.equals("-1")) { + List organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); + List geologi = new ArrayList(); + + for(Organization org : organizationList) { + Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo"); + List geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId()); + + for (User userGroupRole : geologiUsers) { + List unitaOperativeGeologo = UnitaOperativeUtil.getUnitaOperative(userGroupRole); + if(unitaOperativeGeologo.contains(uoId)){ + if (geologi.isEmpty()) { + geologi.add(userGroupRole); + } else { + boolean isPresent = false; + for(User geo : geologi) { + if (geo.getUserId() == userGroupRole.getUserId()) { + isPresent = true; + break; + } + } + if(!isPresent){ + geologi.add(userGroupRole); + } + } + } + } + } + + for (User geo : geologi) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("geologoId", geo.getUserId()); + jsonObject.put("descLong", geo.getFullName()); + jsonArray.put(jsonObject); + } + } + + writeJSON(resourceRequest, resourceResponse, jsonArray); + } else if ("exportRicerca".equals(id)) { - ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY); - Locale locale = themeDisplay.getLocale(); - User user = themeDisplay.getUser(); String csv = StringPool.BLANK; HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest); HttpServletResponse response = PortalUtil.getHttpServletResponse(resourceResponse); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaIstruttorePortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaIstruttorePortlet.java index 1c0113ce..eb396eb7 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaIstruttorePortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaIstruttorePortlet.java @@ -79,7 +79,6 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet { String ufficio = ParamUtil.getString(actionRequest, "ufficio"); String ordinaPer = ParamUtil.getString(actionRequest, "ordinaPer"); String ordinaTipo = ParamUtil.getString(actionRequest, "ordinaTipo"); - String comune = ParamUtil.getString(actionRequest, "comune"); String praticaAperta = ParamUtil.getString(actionRequest, "praticaAperta"); String interventoTutti = ParamUtil.getString(actionRequest, "interventoTutti"); String interventoNuovaCostruzione = ParamUtil.getString(actionRequest, "interventoNuovaCostruzione"); @@ -87,6 +86,14 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet { String interventoMiglioramentoSismico = ParamUtil.getString(actionRequest, "interventoMiglioramentoSismico"); String interventoRiparazioneInterventoLocale = ParamUtil.getString(actionRequest, "interventoRiparazioneInterventoLocale"); + String comune = ParamUtil.getString(actionRequest, "comune"); + String tipoAttivita = ParamUtil.getString(actionRequest, "tipoAttivita"); + String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura"); + String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa"); + String provincia = ParamUtil.getString(actionRequest, "provincia"); + String geologo = ParamUtil.getString(actionRequest, "geologo"); + String istruttore = ParamUtil.getString(actionRequest, "istruttore"); + actionResponse.setRenderParameter("numeroProgetto", numeroProgetto); actionResponse.setRenderParameter("tipoPratica", tipoPratica); actionResponse.setRenderParameter("statoPratica", statoPratica); @@ -106,6 +113,12 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet { actionResponse.setRenderParameter("interventoMiglioramentoSismico", interventoMiglioramentoSismico); actionResponse.setRenderParameter("interventoRiparazioneInterventoLocale", interventoRiparazioneInterventoLocale); + actionResponse.setRenderParameter("tipoAttivita", tipoAttivita); + actionResponse.setRenderParameter("tipoProcedura", tipoProcedura); + actionResponse.setRenderParameter("unitaOperativa", unitaOperativa); + actionResponse.setRenderParameter("provincia", provincia); + actionResponse.setRenderParameter("geologo", geologo); + actionResponse.setRenderParameter("istruttore", istruttore); } @Override diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java index 050cadaf..674d36ed 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java @@ -16,8 +16,11 @@ import it.tref.liferay.portos.bo.service.ParereGeologoServiceUtil; import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil; import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; import it.tref.liferay.portos.bo.service.permission.IntPraticaPermission; +import it.tref.liferay.portos.bo.shared.bean.IstruttoreBean; +import it.tref.liferay.portos.bo.shared.bean.ParereGeologoBean; import it.tref.liferay.portos.bo.shared.util.ActionKeys; import it.tref.liferay.portos.bo.shared.util.Constants; +import it.tref.liferay.portos.bo.shared.util.UnitaOperativeUtil; import it.tref.liferay.portos.bo.util.AvvisoUtil; import it.tref.liferay.portos.bo.util.MailUtil; import it.tref.liferay.portos.bo.util.WorkflowUtil; @@ -64,13 +67,17 @@ import com.liferay.portal.kernel.workflow.WorkflowInstance; import com.liferay.portal.kernel.workflow.WorkflowInstanceManagerUtil; import com.liferay.portal.kernel.workflow.WorkflowTask; import com.liferay.portal.kernel.workflow.WorkflowTaskManagerUtil; +import com.liferay.portal.model.Organization; import com.liferay.portal.model.Role; import com.liferay.portal.model.User; +import com.liferay.portal.model.UserGroupRole; import com.liferay.portal.model.WorkflowInstanceLink; import com.liferay.portal.security.permission.PermissionThreadLocal; +import com.liferay.portal.service.OrganizationLocalServiceUtil; import com.liferay.portal.service.RoleLocalServiceUtil; import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContextFactory; +import com.liferay.portal.service.UserGroupRoleLocalServiceUtil; import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil; import com.liferay.portal.theme.ThemeDisplay; @@ -99,6 +106,9 @@ public class GestioneAttivitaPortlet extends MVCPortlet { String comune = ParamUtil.getString(actionRequest, "comune"); String tipoAttivita = ParamUtil.getString(actionRequest, "tipoAttivita"); String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura"); + String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa"); + String provincia = ParamUtil.getString(actionRequest, "provincia"); + String geologo = ParamUtil.getString(actionRequest, "geologo"); actionResponse.setRenderParameter("tabs1", tabs1); actionResponse.setRenderParameter("numeroProgetto", numeroProgetto); actionResponse.setRenderParameter("protocollo", protocollo); @@ -136,6 +146,9 @@ public class GestioneAttivitaPortlet extends MVCPortlet { actionResponse.setRenderParameter("comune", comune); actionResponse.setRenderParameter("tipoAttivita", tipoAttivita); actionResponse.setRenderParameter("tipoProcedura", tipoProcedura); + actionResponse.setRenderParameter("unitaOperativa", unitaOperativa); + actionResponse.setRenderParameter("provincia", provincia); + actionResponse.setRenderParameter("geologo", geologo); } public void cambioIstruttore(ActionRequest actionRequest, ActionResponse actionResponse) { @@ -259,6 +272,7 @@ public class GestioneAttivitaPortlet extends MVCPortlet { PortletException { ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY); + Locale locale = themeDisplay.getLocale(); User user = themeDisplay.getUser(); String cmd = ParamUtil.getString(resourceRequest, Constants.CMD); @@ -310,12 +324,33 @@ public class GestioneAttivitaPortlet extends MVCPortlet { e.printStackTrace(); } } + }else if ("province".equals(id)) { + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + List province = TerritorioLocalServiceUtil.getActiveProvince(); + for (String codiceProvincia : province) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(themeDisplay.getCompanyId(), codiceProvincia); + jsonObject.put("provinciaId", provincia.getCodiceProvincia()); + jsonObject.put("descLong", provincia.getSigla() + " - " + provincia.getProvincia()); + jsonArray.put(jsonObject); + } + writeJSON(resourceRequest, resourceResponse, jsonArray); + }else if ("unitaOperative".equals(id)) { + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + + for(int i=1; i<11; i++) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("uoId", i); + jsonObject.put("descLong", i); + jsonArray.put(jsonObject); + } + + writeJSON(resourceRequest, resourceResponse, jsonArray); }else if ("comuni".equals(id)) { String provinciaId = ParamUtil.getString(resourceRequest, "provinciaId"); JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); if (Validator.isNotNull(provinciaId) && !provinciaId.equals("0")) { List comuniIds = TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(provinciaId); - // ADT BUG-ID=15 Sezione Ricerca / Ordinamento Filtro List comumeList = new ArrayList(); for (long comuneId : comuniIds) { Comune comune = ComuneLocalServiceUtil.getComune(comuneId); @@ -335,11 +370,107 @@ public class GestioneAttivitaPortlet extends MVCPortlet { } } writeJSON(resourceRequest, resourceResponse, jsonArray); + }else if ("istruttore".equals(id)) { + Integer uoId = ParamUtil.getInteger(resourceRequest, "uoId"); + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + if (Validator.isNotNull(uoId) && !uoId.equals("-1")) { + List organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); + List tecniciIstruttori = new ArrayList(); + + for(Organization org : organizationList) { + Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_istruttore"); + List istruttori = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole( + org.getGroupId(), role.getRoleId()); + for (UserGroupRole userGroupRole : istruttori) { + User istruttore = userGroupRole.getUser(); + List unitaOperativeIstruttore = UnitaOperativeUtil.getUnitaOperative(istruttore); + if(unitaOperativeIstruttore.contains(uoId)){ + if (tecniciIstruttori.isEmpty()) { + tecniciIstruttori.add(userGroupRole); + } else { + boolean isPresent = false; + for(UserGroupRole tecnico : tecniciIstruttori) { + if (tecnico.getUserId() == userGroupRole.getUserId()) { + isPresent = true; + break; + } + } + if(!isPresent){ + tecniciIstruttori.add(userGroupRole); + } + } + } + } + } + + List tecniciIstruttoriSorted = new ArrayList(); + for (UserGroupRole tecnico : tecniciIstruttori) { + IstruttoreBean istruttore = new IstruttoreBean(); + istruttore.setIdIstruttore(tecnico.getUserId()); + istruttore.setDenominazione(tecnico.getUser().getFullName()); + tecniciIstruttoriSorted.add(istruttore); + } + + Collections.sort(tecniciIstruttoriSorted); + + for (IstruttoreBean istruttore : tecniciIstruttoriSorted) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("istruttoreId", istruttore.getIdIstruttore()); + jsonObject.put("descLong", istruttore.getDenominazione()); + jsonArray.put(jsonObject); + } + } + + writeJSON(resourceRequest, resourceResponse, jsonArray); + + }else if ("geologo".equals(id)) { + Integer uoId = ParamUtil.getInteger(resourceRequest, "uoId"); + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + if (Validator.isNotNull(uoId) && !uoId.equals("-1")) { + List organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); + List geologi = new ArrayList(); + + for(Organization org : organizationList) { + Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo"); + List geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId()); + + for (User userGroupRole : geologiUsers) { + List unitaOperativeGeologo = UnitaOperativeUtil.getUnitaOperative(userGroupRole); + if(unitaOperativeGeologo.contains(uoId)){ + if (geologi.isEmpty()) { + geologi.add(userGroupRole); + } else { + boolean isPresent = false; + for(User geo : geologi) { + if (geo.getUserId() == userGroupRole.getUserId()) { + isPresent = true; + break; + } + } + if(!isPresent){ + geologi.add(userGroupRole); + } + } + } + } + } + + for (User geo : geologi) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("geologoId", geo.getUserId()); + jsonObject.put("descLong", geo.getFullName()); + jsonArray.put(jsonObject); + } + } + + writeJSON(resourceRequest, resourceResponse, jsonArray); + } }catch (Exception e) { _log.error(e, e); throw new IOException(e); } + ServletResponseUtil.sendFile(request, response, "export_pratiche.csv", csv.getBytes(StringPool.UTF8), ContentTypes.TEXT_CSV_UTF8); } 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 1be3e575..6c22bc37 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=3252 - build.date=1629790064644 + build.number=3277 + build.date=1629883670001 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 c7bfaa8c..51a613bf 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 @@ -1,5 +1,7 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> +<%@page import="java.util.Map.Entry"%> <%@page import="java.util.ArrayList"%> <%@page import="java.util.Collections"%> <%@page import="java.util.Comparator"%> @@ -10,8 +12,11 @@ } <% -String comune = ParamUtil.getString(request, "comune"); -String provinciaJS = ParamUtil.getString(request, "provinciaJS"); +String provinciaSelect = ParamUtil.getString(renderRequest, "provincia"); +String comuneSelect = ParamUtil.getString(renderRequest, "comune"); +String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore"); +String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa"); +String geologoSelect = ParamUtil.getString(renderRequest, "geologo"); %>
- -
-
- + Seleziona il tipo di pratica - - - - -
-
- - Stato Pratica - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + <% + for (Entry procedura : IntPraticaLocalServiceUtil.getTipiProcedure().entrySet()) { + String tipo = procedura.getKey(); + String label = procedura.getValue(); + String nomeProcedura = LanguageUtil.get(pageContext, "label_procedura_"+tipo) + ") " + label; + if(nomeProcedura.length() > 90) + nomeProcedura = nomeProcedura.substring(0, 90) + "..."; + %> + <%= nomeProcedura %> + <% + } + %>
-
- -
- - Tipo Intervento - - - - - +
-
- - Pratica Aperta : - - - - +
+
- - - <% - List province = TerritorioLocalServiceUtil.getActiveProvince(); - //ADT BUG-ID=15 Sezione Ricerca / Ordinamento Filtro - List provinceList = new ArrayList(); - for (String codiceProvincia : province) { - Provincia provinciaToStamp = ProvinciaLocalServiceUtil.fetchByC_C(company.getCompanyId(), - codiceProvincia); - provinceList.add(provinciaToStamp); - } - Collections.sort(provinceList, new Comparator() { - public int compare(Provincia o1, Provincia o2){ - return o1.getProvincia().compareTo(o2.getProvincia()); - } - }); - for (Provincia provincia : provinceList) { - %> - - <%= provincia.getProvincia() %> - - <% - } - %> - +
- - - <% - if (Validator.isNotNull(provinciaJS) && !provinciaJS.equals("000")) { - List comuni = TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(provinciaJS); - for (long comuneId : comuni) { - Comune comuneToStamp = ComuneLocalServiceUtil.getComune(comuneId); - %> - - <%= comuneToStamp.getDenominazione() %> - - <% - } - } - %> - +
- +
-
- +
+
-
- +
+
+ +
@@ -177,16 +96,43 @@ String provinciaJS = ParamUtil.getString(request, "provinciaJS");
-
+
+ + Tutte + Assegnazione + Approvazione + Annullato + Esito + Non Approvato + Richiesta Integrazione + Firma + +
+
+ + Tutti + Autorizzata + Annullata + Conforme + Integrazione + Nessun parere + Non autorizzata + Non conforme + Preavviso contrario + +
+
+
+
-
+
Numero Progetto Protocollo Data Invio
-
+
Dec Asc @@ -198,45 +144,129 @@ String provinciaJS = ParamUtil.getString(request, "provinciaJS");
+ + + + - -var getComuni = function(provinciaId, comuneId, comuneValue) { - var comuneSelect = A.one("#"+comuneId); - if (provinciaId == "" || provinciaId == "000") { - comuneSelect.html("") - comuneSelect.addClass("disabled").set("disabled", true); - } else { - A.io.request('<%= getComuniURL %>', { + + 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 d231c02d..605ab5c8 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 @@ -1,4 +1,5 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> <%@page import="com.liferay.portal.kernel.json.JSONFactoryUtil"%> @@ -7,6 +8,7 @@ <%@page import="com.liferay.portal.model.UserGroupRole"%> <%@page import="com.liferay.portal.service.RoleLocalServiceUtil"%> <%@page import="com.liferay.portal.model.Role"%> +<%@page import="java.util.Map.Entry"%> <%@page import="java.util.Collections"%> <%@page import="java.util.Comparator"%> <%@page import="java.util.ArrayList"%> @@ -15,7 +17,11 @@ <%@page import="org.apache.commons.lang.StringEscapeUtils"%> <%@include file="/html/fascicolo/init.jsp"%> <% -List organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); +String provinciaSelect = ParamUtil.getString(renderRequest, "provincia"); +String comuneSelect = ParamUtil.getString(renderRequest, "comune"); +String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore"); +String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa"); +String geologoSelect = ParamUtil.getString(renderRequest, "geologo"); %> organizationList = OrganizationLocalServiceUtil.getUserOrgani
- + Seleziona il tipo di pratica - - - - - - - - - - <%-- ADT - BUG-11 Aggiunta filtro ricerca --%> - + <% + for (Entry procedura : IntPraticaLocalServiceUtil.getTipiProcedure().entrySet()) { + String tipo = procedura.getKey(); + String label = procedura.getValue(); + String nomeProcedura = LanguageUtil.get(pageContext, "label_procedura_"+tipo) + ") " + label; + if(nomeProcedura.length() > 90) + nomeProcedura = nomeProcedura.substring(0, 90) + "..."; + %> + <%= nomeProcedura %> + <% + } + %>
@@ -230,11 +171,16 @@ List organizationList = OrganizationLocalServiceUtil.getUserOrgani
- - Tutti - Autorizzata - Non autorizzata - Non si rilascia parere + + Tutti + Autorizzata + Annullata + Conforme + Integrazione + Nessun parere + Non autorizzata + Non conforme + Preavviso contrario
@@ -259,46 +205,127 @@ List organizationList = OrganizationLocalServiceUtil.getUserOrgani
-<%-- ADT BUG BO ID = 1 SEZIONE ATTIVITÀ --%> + + - -var getComuni = function(provinciaId, comuneId, comuneValue) { - var comuneSelect = A.one("#"+comuneId); - if (provinciaId == "" || provinciaId == "000") { - comuneSelect.html("") - comuneSelect.addClass("disabled").set("disabled", true); - } else { - A.io.request('<%= getComuniURL %>', { + + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/advanced_search.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/advanced_search.jsp index b2c5e487..dc7bee9d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/advanced_search.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/advanced_search.jsp @@ -1,5 +1,7 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> +<%@page import="java.util.Map.Entry"%> <%@page import="com.liferay.portal.model.Organization"%> <%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%> <%@include file="/html/fascicolo/init.jsp"%> @@ -35,90 +37,68 @@ List organizationList = OrganizationLocalServiceUtil.getUserOrgani
-
+
- + Seleziona il tipo di pratica - - - + <% + for (Entry procedura : IntPraticaLocalServiceUtil.getTipiProcedure().entrySet()) { + String tipo = procedura.getKey(); + String label = procedura.getValue(); + String nomeProcedura = LanguageUtil.get(pageContext, "label_procedura_"+tipo) + ") " + label; + if(nomeProcedura.length() > 90) + nomeProcedura = nomeProcedura.substring(0, 90) + "..."; + %> + <%= nomeProcedura %> + <% + } + %>
+
+
- - Stato Pratica - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
+
+
-
- +
+
-
- +
+
-
+
-
- - - Tutte - <% - for (Organization org : organizationList) { - %> - <%= org.getName() %> - <% - } - %> - - +
+
-
- <% - String comuneSelect = ParamUtil.getString(renderRequest, "comune"); - %> - +
+
+ + +
+
- + @@ -131,47 +111,46 @@ List organizationList = OrganizationLocalServiceUtil.getUserOrgani
-
- - Pratica Aperta : - - - - +
+ + Tutte + Assegnazione + Approvazione + Annullato + Esito + Non Approvato + Richiesta Integrazione + Firma +
-
-
-
- - Tipologia Intervento : - - - - - - +
+ + Tutti + Autorizzata + Annullata + Conforme + Integrazione + Nessun parere + Non autorizzata + Non conforme + Preavviso contrario +
-
+
-
+
- Nome Task - Numero Progetto - Data Invio - Tipo Pratica + Numero Progetto + Protocollo + Data Invio
-
+
- Asc - Dec + Dec + Asc
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp index cd1f07fa..6ad6e04d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp @@ -1,4 +1,5 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> <%@include file="/html/fascicolofe/init.jsp"%>
- + Seleziona il tipo di pratica - - - - - - - - - + <% + for (Entry procedura : IntPraticaLocalServiceUtil.getTipiProcedure() + .entrySet()) { + String tipo = procedura.getKey(); + String label = procedura.getValue(); + String nomeProcedura = LanguageUtil.get(pageContext, "label_procedura_"+tipo) + ") " + label; + if(nomeProcedura.length() > 90) + nomeProcedura = nomeProcedura.substring(0, 90) + "..."; + %> + <%= nomeProcedura %> + <% + } + %>
From e6ac396db548077c5c6554edbc082279792dcead Mon Sep 17 00:00:00 2001 From: Mattia Gosetto Date: Wed, 25 Aug 2021 16:55:59 +0200 Subject: [PATCH 3/5] filtri bo e fe --- .../ControlloPraticaAdvancedSearch.java | 16 +- .../bo/search/IntPraticaAdvancedSearch.java | 15 +- .../portos/bo/util/PortosIndexField.java | 1 + .../bo/indexer/ControlloPraticaIndexer.java | 20 +- .../portos/bo/indexer/IntPraticaIndexer.java | 16 +- .../portos/bo/portlet/FascicoloPortlet.java | 65 +++--- .../GestioneAttivitaIstruttorePortlet.java | 211 +++++++++++++++--- .../bo/portlet/GestioneAttivitaPortlet.java | 66 +++--- .../docroot/WEB-INF/src/service.properties | 4 +- .../html/fascicolo/advanced_search.jsp | 22 +- .../html/gestioneattivita/advanced_search.jsp | 23 +- .../advanced_search.jsp | 173 ++++++++++---- .../html/fascicolofe/advanced_search.jsp | 44 ++-- 13 files changed, 486 insertions(+), 190 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 5681e1d3..1b951492 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 @@ -522,6 +522,8 @@ public class ControlloPraticaAdvancedSearch { String dataAl = ParamUtil.getString(request, "dataRichiestaFine"); String comune = ParamUtil.getString(request, "comune"); String tipoAttivita = ParamUtil.getString(request, "tipoAttivita"); + Long geologi = ParamUtil.getLong(request, "geologi"); + Long parereGeologo = ParamUtil.getLong(request, "parereGeologo"); // ADT - BUG-11 Aggiunta filtro ricerca String controlloObbligatorioSearch = ParamUtil.getString(request, "controlloObbligatorio"); try { @@ -596,6 +598,18 @@ public class ControlloPraticaAdvancedSearch { booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST); } + if (Validator.isNotNull(geologi) && !geologi.equals(-1L) && !geologi.equals(0L)) { + TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "geologi", + geologi); + booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST); + } + + if (Validator.isNotNull(parereGeologo) && !parereGeologo.equals(-1L)) { + TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "parereGeologo", + parereGeologo); + booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST); + } + if (Validator.isNotNull(unitaOperativa) && !unitaOperativa.equals("-1")) { TermQuery uoQuery = TermQueryFactoryUtil.create(searchContext, "unitaOperativa", unitaOperativa); @@ -633,8 +647,6 @@ public class ControlloPraticaAdvancedSearch { booleanQuery.add(controlloObbligatorioTermQuery, BooleanClauseOccur.MUST); } - _log.info("Query backend" + booleanQuery.toString()); - } catch (ParseException | java.text.ParseException e) { _log.error(e, e); } 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 9d34694f..5c4a58c7 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 @@ -271,6 +271,8 @@ public class IntPraticaAdvancedSearch { String istruttoreId = ParamUtil.getString(request, "istruttore"); String unitaOperativa = ParamUtil.getString(request, "unitaOperativa"); + Long geologi = ParamUtil.getLong(request, "geologi"); + Long parereGeologo = ParamUtil.getLong(request, "parereGeologo"); try { TermQuery termQuery; @@ -332,7 +334,18 @@ public class IntPraticaAdvancedSearch { booleanQuery.add(uoQuery, BooleanClauseOccur.MUST); } - _log.info("Query frontend" + booleanQuery.toString()); + if (Validator.isNotNull(geologi) && !geologi.equals(-1L) && !geologi.equals(0L)) { + TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "geologi", + geologi); + booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST); + } + + if (Validator.isNotNull(parereGeologo) && !parereGeologo.equals(-1L)) { + TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "parereGeologo", + parereGeologo); + booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST); + } + } catch (ParseException | java.text.ParseException e) { _log.error(e, e); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PortosIndexField.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PortosIndexField.java index 49306644..0e351b4c 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PortosIndexField.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PortosIndexField.java @@ -48,6 +48,7 @@ public class PortosIndexField implements Serializable { public static final String PROPRIETARIO_DIGITALE_FULL_NAME = "proprietarioDigitaleFullName"; public static final String ISTRUTTORE_USERNAME = "istruttoreUsername"; public static final String PARERE_GEOLOGO = "parereGeologo"; + public static final String GEOLOGI = "geologi"; public static final String COMUNE_ID = "comuneId"; public static final String COMUNE_DENOMINAZIONE = "comuneDenominazione"; public static final String PROVINCIA_ID = "provinciaId"; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java index 6a862672..edba5fac 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java @@ -4,6 +4,7 @@ import it.tref.liferay.portos.bo.model.Comune; import it.tref.liferay.portos.bo.model.ControlloPratica; import it.tref.liferay.portos.bo.model.DettPratica; import it.tref.liferay.portos.bo.model.IntPratica; +import it.tref.liferay.portos.bo.model.ParereGeologo; import it.tref.liferay.portos.bo.model.Provincia; import it.tref.liferay.portos.bo.model.Soggetto; import it.tref.liferay.portos.bo.model.Territorio; @@ -11,6 +12,7 @@ import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil; import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; +import it.tref.liferay.portos.bo.service.ParereGeologoLocalServiceUtil; import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil; import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; @@ -114,7 +116,7 @@ public class ControlloPraticaIndexer extends BaseIndexer { document.addKeyword("entryClassName", ControlloPratica.class.getName()); document.addKeyword(PortosIndexField.CONTROLLO_PRATICA_ID, controlloPraticaFromDB.getControlloPraticaId()); document.addKeyword(PortosIndexField.DETT_PRATICA_ID, controlloPraticaFromDB.getDettPraticaId()); - document.addKeyword(PortosIndexField.PARERE_GEOLOGO, controlloPraticaFromDB.getParereGeologo()); + //document.addKeyword(PortosIndexField.PARERE_GEOLOGO, controlloPraticaFromDB.getParereGeologo()); document.addKeyword(PortosIndexField.STATUS, controlloPraticaFromDB.getStatus()); document.addKeyword(PortosIndexField.STATUS_BY_USERID, controlloPraticaFromDB.getStatusByUserId()); document.addKeyword(PortosIndexField.STATUS_BY_USERNAME, controlloPraticaFromDB.getStatusByUserName()); @@ -124,6 +126,22 @@ public class ControlloPraticaIndexer extends BaseIndexer { } else { document.addKeyword(PortosIndexField.STATUS_DATE, 0); } + + List listaParereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId( + controlloPraticaFromDB.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS); + + List idGeologi = new ArrayList(); + for(ParereGeologo geo : listaParereGeologo){ + idGeologi.add(geo.getGeologoUserId()); + } + + if (Validator.isNotNull(listaParereGeologo) && !listaParereGeologo.isEmpty()) { + document.addKeyword(PortosIndexField.PARERE_GEOLOGO, 1L); + } else { + document.addKeyword(PortosIndexField.PARERE_GEOLOGO, 0L); + } + + document.addNumber(PortosIndexField.GEOLOGI, idGeologi.toArray(new Long[0])); document.addKeyword(PortosIndexField.DATA_INIZIO_PROCEDIMENTO, DATE_FORMAT.format(controlloPraticaFromDB.getCreateDate())); document.addKeywordSortable(PortosIndexField.DATA_INIZIO_PROCEDIMENTO, 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 71ede575..0cc6aabf 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 @@ -29,6 +29,7 @@ import java.util.Locale; import javax.portlet.PortletURL; import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery; +import com.liferay.portal.kernel.dao.orm.QueryUtil; import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.log.Log; @@ -252,12 +253,21 @@ public class IntPraticaIndexer extends BaseIndexer { document.addKeyword(PortosIndexField.UNITA_OPERATIVA, intPraticaFromDB.getUnitaOperativa()); // Gestione Parere Geologo List listaParereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId( - intPratica.getIntPraticaId(), 0, 1); + intPratica.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS); + + List idGeologi = new ArrayList(); + for(ParereGeologo geo : listaParereGeologo){ + idGeologi.add(geo.getGeologoUserId()); + } + + document.addNumber(PortosIndexField.GEOLOGI, idGeologi.toArray(new Long[0])); + if (Validator.isNotNull(listaParereGeologo) && !listaParereGeologo.isEmpty()) { - document.addKeyword(PortosIndexField.PARERE_GEOLOGO, StringPool.TRUE); + document.addKeyword(PortosIndexField.PARERE_GEOLOGO, 1L); } else { - document.addKeyword(PortosIndexField.PARERE_GEOLOGO, StringPool.FALSE); + document.addKeyword(PortosIndexField.PARERE_GEOLOGO, 0L); } + // Gestione pratica sospesa document.addKeyword(PortosIndexField.STATUS_SOSPESA, intPraticaFromDB.isSospesa()); // Gestione Diverse tipologie di IntPratica MIEI PROGETTI && ARCHIVIO PROGETTI 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 99cfa4a9..e8c440ed 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 @@ -260,7 +260,8 @@ public class FascicoloPortlet extends MVCPortlet { String tipoIntervento = actionRequest.getParameter("tipoIntervento"); String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura"); String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa"); - String geologo = ParamUtil.getString(actionRequest, "geologo"); + String geologi = ParamUtil.getString(actionRequest, "geologi"); + String parereGeologo = ParamUtil.getString(actionRequest, "parereGeologo"); String istruttore = ParamUtil.getString(actionRequest, "istruttore"); if (Validator.isNotNull(dataRichiestaInizio)) { @@ -316,7 +317,8 @@ public class FascicoloPortlet extends MVCPortlet { actionResponse.setRenderParameter("tipoProcedura", tipoProcedura); actionResponse.setRenderParameter("unitaOperativa", unitaOperativa); - actionResponse.setRenderParameter("geologo", geologo); + actionResponse.setRenderParameter("geologi", geologi); + actionResponse.setRenderParameter("parereGeologo", parereGeologo); actionResponse.setRenderParameter("istruttore", istruttore); } @@ -481,44 +483,39 @@ public class FascicoloPortlet extends MVCPortlet { writeJSON(resourceRequest, resourceResponse, jsonArray); }else if ("geologo".equals(id)) { - Integer uoId = ParamUtil.getInteger(resourceRequest, "uoId"); JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); - if (Validator.isNotNull(uoId) && !uoId.equals("-1")) { - List organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); - List geologi = new ArrayList(); - - for(Organization org : organizationList) { - Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo"); - List geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId()); - - for (User userGroupRole : geologiUsers) { - List unitaOperativeGeologo = UnitaOperativeUtil.getUnitaOperative(userGroupRole); - if(unitaOperativeGeologo.contains(uoId)){ - if (geologi.isEmpty()) { - geologi.add(userGroupRole); - } else { - boolean isPresent = false; - for(User geo : geologi) { - if (geo.getUserId() == userGroupRole.getUserId()) { - isPresent = true; - break; - } - } - if(!isPresent){ - geologi.add(userGroupRole); - } + List organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); + List geologi = new ArrayList(); + + for(Organization org : organizationList) { + Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo"); + List geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId()); + + for (User userGroupRole : geologiUsers) { + if (geologi.isEmpty()) { + geologi.add(userGroupRole); + } else { + boolean isPresent = false; + for(User geo : geologi) { + if (geo.getUserId() == userGroupRole.getUserId()) { + isPresent = true; + break; } } + if(!isPresent){ + geologi.add(userGroupRole); + } } } - - for (User geo : geologi) { - JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); - jsonObject.put("geologoId", geo.getUserId()); - jsonObject.put("descLong", geo.getFullName()); - jsonArray.put(jsonObject); - } } + + for (User geo : geologi) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("geologoId", geo.getUserId()); + jsonObject.put("descLong", geo.getFullName()); + jsonArray.put(jsonObject); + } + writeJSON(resourceRequest, resourceResponse, jsonArray); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaIstruttorePortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaIstruttorePortlet.java index eb396eb7..795b3ae6 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaIstruttorePortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaIstruttorePortlet.java @@ -15,13 +15,17 @@ import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil; import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; +import it.tref.liferay.portos.bo.shared.bean.IstruttoreBean; import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil; +import it.tref.liferay.portos.bo.shared.util.UnitaOperativeUtil; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.Date; import java.util.List; @@ -52,7 +56,14 @@ import com.liferay.portal.kernel.util.PropsUtil; import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.WebKeys; +import com.liferay.portal.model.Organization; +import com.liferay.portal.model.Role; import com.liferay.portal.model.User; +import com.liferay.portal.model.UserGroupRole; +import com.liferay.portal.service.OrganizationLocalServiceUtil; +import com.liferay.portal.service.RoleLocalServiceUtil; +import com.liferay.portal.service.UserGroupRoleLocalServiceUtil; +import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.theme.ThemeDisplay; import com.liferay.portal.util.PortalUtil; import com.liferay.util.bridges.mvc.MVCPortlet; @@ -91,7 +102,8 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet { String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura"); String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa"); String provincia = ParamUtil.getString(actionRequest, "provincia"); - String geologo = ParamUtil.getString(actionRequest, "geologo"); + String geologi = ParamUtil.getString(actionRequest, "geologi"); + String parereGeologo = ParamUtil.getString(actionRequest, "parereGeologo"); String istruttore = ParamUtil.getString(actionRequest, "istruttore"); actionResponse.setRenderParameter("numeroProgetto", numeroProgetto); @@ -117,7 +129,8 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet { actionResponse.setRenderParameter("tipoProcedura", tipoProcedura); actionResponse.setRenderParameter("unitaOperativa", unitaOperativa); actionResponse.setRenderParameter("provincia", provincia); - actionResponse.setRenderParameter("geologo", geologo); + actionResponse.setRenderParameter("geologi", geologi); + actionResponse.setRenderParameter("parereGeologo", parereGeologo); actionResponse.setRenderParameter("istruttore", istruttore); } @@ -251,38 +264,180 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet { } // ADT BUG-ID=16 Sezione Pratiche Assegnate User user = themeDisplay.getUser(); - if ("comuniForUfficio".equals(resourceId)) { - String ufficio = ParamUtil.getString(resourceRequest, "ufficioId"); - JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); - List comuni; - if (Validator.isNotNull(ufficio) && !ufficio.equals("0")) { - try { - if (!ufficio.equals("-1")) { - long ufficioId = Long.parseLong(ufficio); - comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserIdUfficioId(user.getUserId(), - ufficioId); - for (Comune comune : comuni) { - JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); - jsonObject.put("comuneId", comune.getComuneId()); - jsonObject.put("descLong", comune.getDenominazione()); - jsonArray.put(jsonObject); + try{ + if ("comuniForUfficio".equals(resourceId)) { + String ufficio = ParamUtil.getString(resourceRequest, "ufficioId"); + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + List comuni; + if (Validator.isNotNull(ufficio) && !ufficio.equals("0")) { + try { + if (!ufficio.equals("-1")) { + long ufficioId = Long.parseLong(ufficio); + comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserIdUfficioId(user.getUserId(), + ufficioId); + for (Comune comune : comuni) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("comuneId", comune.getComuneId()); + jsonObject.put("descLong", comune.getDenominazione()); + jsonArray.put(jsonObject); + } + writeJSON(resourceRequest, resourceResponse, jsonArray); + } else { + comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserId(user.getUserId()); + for (Comune comune : comuni) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("comuneId", comune.getComuneId()); + jsonObject.put("descLong", comune.getDenominazione()); + jsonArray.put(jsonObject); + } + writeJSON(resourceRequest, resourceResponse, jsonArray); } - writeJSON(resourceRequest, resourceResponse, jsonArray); - } else { - comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserId(user.getUserId()); - for (Comune comune : comuni) { - JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); - jsonObject.put("comuneId", comune.getComuneId()); - jsonObject.put("descLong", comune.getDenominazione()); - jsonArray.put(jsonObject); + } catch (Exception e) { + e.printStackTrace(); + } + } + }else if ("province".equals(resourceId)) { + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + List province = TerritorioLocalServiceUtil.getActiveProvince(); + for (String codiceProvincia : province) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(themeDisplay.getCompanyId(), codiceProvincia); + jsonObject.put("provinciaId", provincia.getCodiceProvincia()); + jsonObject.put("descLong", provincia.getSigla() + " - " + provincia.getProvincia()); + jsonArray.put(jsonObject); + } + writeJSON(resourceRequest, resourceResponse, jsonArray); + }else if ("unitaOperative".equals(resourceId)) { + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + + for(int i=1; i<11; i++) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("uoId", i); + jsonObject.put("descLong", i); + jsonArray.put(jsonObject); + } + + writeJSON(resourceRequest, resourceResponse, jsonArray); + }else if ("comuni".equals(resourceId)) { + String provinciaId = ParamUtil.getString(resourceRequest, "provinciaId"); + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + if (Validator.isNotNull(provinciaId) && !provinciaId.equals("0")) { + List comuniIds = TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(provinciaId); + List comumeList = new ArrayList(); + for (long comuneId : comuniIds) { + Comune comune = ComuneLocalServiceUtil.getComune(comuneId); + comumeList.add(comune); + } + Collections.sort(comumeList, new Comparator() { + @Override + public int compare(Comune o1, Comune o2) { + return o1.getDenominazione().compareTo(o2.getDenominazione()); + } + }); + for (Comune comune : comumeList) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("comuneId", comune.getComuneId()); + jsonObject.put("descLong", comune.getDenominazione()); + jsonArray.put(jsonObject); + } + } + writeJSON(resourceRequest, resourceResponse, jsonArray); + }else if ("istruttore".equals(resourceId)) { + Integer uoId = ParamUtil.getInteger(resourceRequest, "uoId"); + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + if (Validator.isNotNull(uoId) && !uoId.equals("-1")) { + List organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); + List tecniciIstruttori = new ArrayList(); + + for(Organization org : organizationList) { + Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_istruttore"); + List istruttori = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole( + org.getGroupId(), role.getRoleId()); + for (UserGroupRole userGroupRole : istruttori) { + User istruttore = userGroupRole.getUser(); + List unitaOperativeIstruttore = UnitaOperativeUtil.getUnitaOperative(istruttore); + if(unitaOperativeIstruttore.contains(uoId)){ + if (tecniciIstruttori.isEmpty()) { + tecniciIstruttori.add(userGroupRole); + } else { + boolean isPresent = false; + for(UserGroupRole tecnico : tecniciIstruttori) { + if (tecnico.getUserId() == userGroupRole.getUserId()) { + isPresent = true; + break; + } + } + if(!isPresent){ + tecniciIstruttori.add(userGroupRole); + } + } + } } - writeJSON(resourceRequest, resourceResponse, jsonArray); } - } catch (Exception e) { - e.printStackTrace(); + + List tecniciIstruttoriSorted = new ArrayList(); + for (UserGroupRole tecnico : tecniciIstruttori) { + IstruttoreBean istruttore = new IstruttoreBean(); + istruttore.setIdIstruttore(tecnico.getUserId()); + istruttore.setDenominazione(tecnico.getUser().getFullName()); + tecniciIstruttoriSorted.add(istruttore); + } + + Collections.sort(tecniciIstruttoriSorted); + + for (IstruttoreBean istruttore : tecniciIstruttoriSorted) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("istruttoreId", istruttore.getIdIstruttore()); + jsonObject.put("descLong", istruttore.getDenominazione()); + jsonArray.put(jsonObject); + } } + + writeJSON(resourceRequest, resourceResponse, jsonArray); + + }else if ("geologo".equals(resourceId)) { + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + List organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); + List geologi = new ArrayList(); + + for(Organization org : organizationList) { + Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo"); + List geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId()); + + for (User userGroupRole : geologiUsers) { + if (geologi.isEmpty()) { + geologi.add(userGroupRole); + } else { + boolean isPresent = false; + for(User geo : geologi) { + if (geo.getUserId() == userGroupRole.getUserId()) { + isPresent = true; + break; + } + } + if(!isPresent){ + geologi.add(userGroupRole); + } + } + } + } + + for (User geo : geologi) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("geologoId", geo.getUserId()); + jsonObject.put("descLong", geo.getFullName()); + jsonArray.put(jsonObject); + } + + + writeJSON(resourceRequest, resourceResponse, jsonArray); + } + }catch (Exception e) { + _log.error(e, e); + throw new IOException(e); } + super.serveResource(resourceRequest, resourceResponse); } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java index 674d36ed..39e1dcfa 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java @@ -108,7 +108,9 @@ public class GestioneAttivitaPortlet extends MVCPortlet { String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura"); String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa"); String provincia = ParamUtil.getString(actionRequest, "provincia"); - String geologo = ParamUtil.getString(actionRequest, "geologo"); + String geologi = ParamUtil.getString(actionRequest, "geologi"); + String parereGeologo = ParamUtil.getString(actionRequest, "parereGeologo"); + actionResponse.setRenderParameter("tabs1", tabs1); actionResponse.setRenderParameter("numeroProgetto", numeroProgetto); actionResponse.setRenderParameter("protocollo", protocollo); @@ -148,7 +150,8 @@ public class GestioneAttivitaPortlet extends MVCPortlet { actionResponse.setRenderParameter("tipoProcedura", tipoProcedura); actionResponse.setRenderParameter("unitaOperativa", unitaOperativa); actionResponse.setRenderParameter("provincia", provincia); - actionResponse.setRenderParameter("geologo", geologo); + actionResponse.setRenderParameter("geologi", geologi); + actionResponse.setRenderParameter("parereGeologo", parereGeologo); } public void cambioIstruttore(ActionRequest actionRequest, ActionResponse actionResponse) { @@ -424,44 +427,39 @@ public class GestioneAttivitaPortlet extends MVCPortlet { writeJSON(resourceRequest, resourceResponse, jsonArray); }else if ("geologo".equals(id)) { - Integer uoId = ParamUtil.getInteger(resourceRequest, "uoId"); JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); - if (Validator.isNotNull(uoId) && !uoId.equals("-1")) { - List organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); - List geologi = new ArrayList(); - - for(Organization org : organizationList) { - Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo"); - List geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId()); - - for (User userGroupRole : geologiUsers) { - List unitaOperativeGeologo = UnitaOperativeUtil.getUnitaOperative(userGroupRole); - if(unitaOperativeGeologo.contains(uoId)){ - if (geologi.isEmpty()) { - geologi.add(userGroupRole); - } else { - boolean isPresent = false; - for(User geo : geologi) { - if (geo.getUserId() == userGroupRole.getUserId()) { - isPresent = true; - break; - } - } - if(!isPresent){ - geologi.add(userGroupRole); - } + List organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); + List geologi = new ArrayList(); + + for(Organization org : organizationList) { + Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo"); + List geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId()); + + for (User userGroupRole : geologiUsers) { + if (geologi.isEmpty()) { + geologi.add(userGroupRole); + } else { + boolean isPresent = false; + for(User geo : geologi) { + if (geo.getUserId() == userGroupRole.getUserId()) { + isPresent = true; + break; } } + if(!isPresent){ + geologi.add(userGroupRole); + } } } - - for (User geo : geologi) { - JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); - jsonObject.put("geologoId", geo.getUserId()); - jsonObject.put("descLong", geo.getFullName()); - jsonArray.put(jsonObject); - } } + + for (User geo : geologi) { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("geologoId", geo.getUserId()); + jsonObject.put("descLong", geo.getFullName()); + jsonArray.put(jsonObject); + } + writeJSON(resourceRequest, resourceResponse, jsonArray); 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 6c22bc37..46ccbe0e 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=3277 - build.date=1629883670001 + build.number=3294 + build.date=1629903256819 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 51a613bf..70d904a6 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 @@ -16,7 +16,7 @@ String provinciaSelect = ParamUtil.getString(renderRequest, "provincia"); String comuneSelect = ParamUtil.getString(renderRequest, "comune"); String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore"); String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa"); -String geologoSelect = ParamUtil.getString(renderRequest, "geologo"); +String geologoSelect = ParamUtil.getString(renderRequest, "geologi"); %>
- +
-
+
@@ -211,11 +214,8 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologo"); }); }; - var getGeologo = function(callback, uoId) { + var getGeologo = function(callback) { A.io.request('<%= getGeologoUrl %>', { - data: { - uoId: uoId - }, dataType: 'json', on: { success: function() { @@ -260,7 +260,7 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologo"); selectVal: '<%= (Validator.isNotNull(istruttoreSelect) ? istruttoreSelect : "") %>' }, { - select: 'geologo', + select: 'geologi', selectData: getGeologo, selectDesc: 'descLong', selectId: 'geologoId', 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 605ab5c8..559b7328 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 @@ -21,7 +21,7 @@ String provinciaSelect = ParamUtil.getString(renderRequest, "provincia"); String comuneSelect = ParamUtil.getString(renderRequest, "comune"); String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore"); String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa"); -String geologoSelect = ParamUtil.getString(renderRequest, "geologo"); +String geologoSelect = ParamUtil.getString(renderRequest, "geologi"); %>
- +
-
+
@@ -270,11 +274,8 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologo"); }); }; - var getGeologo = function(callback, uoId) { + var getGeologo = function(callback) { A.io.request('<%= getGeologoUrl %>', { - data: { - uoId: uoId - }, dataType: 'json', on: { success: function() { @@ -319,7 +320,7 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologo"); selectVal: '<%= (Validator.isNotNull(istruttoreSelect) ? istruttoreSelect : "") %>' }, { - select: 'geologo', + select: 'geologi', selectData: getGeologo, selectDesc: 'descLong', selectId: 'geologoId', diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/advanced_search.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/advanced_search.jsp index dc7bee9d..af4bb9ad 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/advanced_search.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/advanced_search.jsp @@ -33,6 +33,11 @@ <% List organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); +String provinciaSelect = ParamUtil.getString(renderRequest, "provincia"); +String comuneSelect = ParamUtil.getString(renderRequest, "comune"); +String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore"); +String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa"); +String geologoSelect = ParamUtil.getString(renderRequest, "geologi"); %> @@ -86,18 +91,21 @@ List organizationList = OrganizationLocalServiceUtil.getUserOrgani
- +
-
+
@@ -160,46 +168,125 @@ List organizationList = OrganizationLocalServiceUtil.getUserOrgani
-<%-- ADT BUG-ID=16 Sezione Pratiche Assegnate --%> - - -$(".add-new-project__ufficio select").change(function() { - var comuni = ''; - var val = $(this).val(); - $(".add-new-project__comune select").empty(); - A.io.request('<%= getComuniURL %>', { - data: { - ufficioId: val - }, - dataType: 'json', - on: { - success: function() { - $(".add-new-project__comune select").empty(); - $(".add-new-project__comune select").append($(' diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp index 6ad6e04d..e63576fa 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp @@ -32,43 +32,47 @@ Stato Pratica - + - + + + + - + - - - - - + - + - - + + - - + + - - - - + - + + + + - + + + + + + + -
From cca57a29cb5529f08b45d8865ed9a59bfef2ccc3 Mon Sep 17 00:00:00 2001 From: Mattia Gosetto Date: Thu, 26 Aug 2021 09:35:01 +0200 Subject: [PATCH 4/5] filtri bo e fe, manca assegnata ad istruttore --- .../liferay/portos/bo/search/IntPraticaAdvancedSearch.java | 2 ++ .../it/tref/liferay/portos/bo/util/PortosIndexField.java | 1 + .../liferay/portos/bo/indexer/ControlloPraticaIndexer.java | 4 ++++ .../it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java | 5 +++++ .../portos-bo-portlet/docroot/WEB-INF/src/service.properties | 4 ++-- .../docroot/html/fascicolofe/advanced_search.jsp | 4 ++++ 6 files changed, 18 insertions(+), 2 deletions(-) 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 5c4a58c7..2c51961b 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 @@ -528,6 +528,8 @@ public class IntPraticaAdvancedSearch { termQuery = TermQueryFactoryUtil.create(searchContext, "dtPratica", "0"); else if (statoPratica.equals(StatoPraticaConstants.VARIATA)) termQuery = TermQueryFactoryUtil.create(searchContext, "variata", StringPool.TRUE); + else if(statoPratica.equals(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE)) + termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 1L); else if (!statoPratica.equals("-1")) termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.STATO_PRATICA, statoPratica); if (Validator.isNotNull(termQuery)) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PortosIndexField.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PortosIndexField.java index 0e351b4c..704fbade 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PortosIndexField.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PortosIndexField.java @@ -72,4 +72,5 @@ public class PortosIndexField implements Serializable { public static final String TIPO_PROCEDURA = "tipoProcedura"; public static final String UNITA_OPERATIVA = "unitaOperativa"; public static final String IN_LAVORAZIONE_SUE = "inLavorazioneSue"; + public static final String ASSEGNATA_AD_ISTRUTTORE = "assegnataAdIstruttore"; } \ 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/indexer/ControlloPraticaIndexer.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java index edba5fac..8998d106 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java @@ -159,7 +159,11 @@ public class ControlloPraticaIndexer extends BaseIndexer { document.addKeyword(PortosIndexField.ISTRUTTORE_FULL_NAME, userIstruttore.getFullName() .toUpperCase()); } + document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 1L); + }else{ + document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 0L); } + if (intPratica.getUserId() != 0L) { User proprietarioDigitale = UserLocalServiceUtil.fetchUser(intPratica.getUserId()); if (Validator.isNotNull(proprietarioDigitale)) { 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 0cc6aabf..644cdf8c 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 @@ -196,13 +196,18 @@ public class IntPraticaIndexer extends BaseIndexer { document.addKeyword(PortosIndexField.ISTRUTTORE_USERNAME, UserLocalServiceUtil.getUser(intPraticaFromDB.getStatusByUserId()).getScreenName() .toUpperCase()); + } if (intPratica.getStatusByUserId() != 0L) { User userIstruttore = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId()); if (userIstruttore != null) { document.addText(PortosIndexField.ISTRUTTORE_FULL_NAME, userIstruttore.getFullName()); } + document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 1L); + }else{ + document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 0L); } + if (intPratica.getUserId() != 0L) { User proprietarioDigitale = UserLocalServiceUtil.fetchUser(intPratica.getUserId()); if (proprietarioDigitale != null) { 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 46ccbe0e..49df706b 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=3294 - build.date=1629903256819 + build.number=3295 + build.date=1629962832872 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp index e63576fa..bee2007a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp @@ -1,3 +1,4 @@ +<%@page import="it.tref.liferay.portos.bo.util.PortosIndexField"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> @@ -31,6 +32,9 @@
Stato Pratica + + + From 4b319cd0bec4c78004f9518ae4ae39744ea9d6aa Mon Sep 17 00:00:00 2001 From: Mattia Gosetto Date: Thu, 26 Aug 2021 12:37:44 +0200 Subject: [PATCH 5/5] finiti filtri bo e fe --- .../it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java | 5 ++++- .../portos-bo-portlet/docroot/WEB-INF/src/service.properties | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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 644cdf8c..b510286e 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 @@ -203,7 +203,10 @@ public class IntPraticaIndexer extends BaseIndexer { if (userIstruttore != null) { document.addText(PortosIndexField.ISTRUTTORE_FULL_NAME, userIstruttore.getFullName()); } - document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 1L); + if(intPratica.getStatoPratica().equals(StatoPraticaConstants.SOTTOPOSTA_A_PARERE)) + document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 1L); + else + document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 0L); }else{ document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 0L); } 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 49df706b..893644ce 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=3295 - build.date=1629962832872 + build.number=3298 + build.date=1629973940370 build.auto.upgrade=true ##