diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service.xml b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service.xml
index e841c881..e65f5f94 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service.xml
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service.xml
@@ -986,6 +986,7 @@
+
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/IntPraticaClp.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/IntPraticaClp.java
index 499f2a92..af136c8a 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/IntPraticaClp.java
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/IntPraticaClp.java
@@ -89,6 +89,7 @@ public class IntPraticaClp extends BaseModelImpl
attributes.put("tipoProcedura", getTipoProcedura());
attributes.put("dtAnnullamento", getDtAnnullamento());
attributes.put("docPraticaAnnullamentoId", getDocPraticaAnnullamentoId());
+ attributes.put("unitaOperativa", getUnitaOperativa());
attributes.put("dtSorteggio", getDtSorteggio());
attributes.put("statoPratica", getStatoPratica());
attributes.put("numeroProgetto", getNumeroProgetto());
@@ -195,6 +196,12 @@ public class IntPraticaClp extends BaseModelImpl
setDocPraticaAnnullamentoId(docPraticaAnnullamentoId);
}
+ Integer unitaOperativa = (Integer)attributes.get("unitaOperativa");
+
+ if (unitaOperativa != null) {
+ setUnitaOperativa(unitaOperativa);
+ }
+
Date dtSorteggio = (Date)attributes.get("dtSorteggio");
if (dtSorteggio != null) {
@@ -624,6 +631,29 @@ public class IntPraticaClp extends BaseModelImpl
}
}
+ @Override
+ public int getUnitaOperativa() {
+ return _unitaOperativa;
+ }
+
+ @Override
+ public void setUnitaOperativa(int unitaOperativa) {
+ _unitaOperativa = unitaOperativa;
+
+ if (_intPraticaRemoteModel != null) {
+ try {
+ Class> clazz = _intPraticaRemoteModel.getClass();
+
+ Method method = clazz.getMethod("setUnitaOperativa", int.class);
+
+ method.invoke(_intPraticaRemoteModel, unitaOperativa);
+ }
+ catch (Exception e) {
+ throw new UnsupportedOperationException(e);
+ }
+ }
+ }
+
@Override
public Date getDtSorteggio() {
return _dtSorteggio;
@@ -1285,6 +1315,7 @@ public class IntPraticaClp extends BaseModelImpl
clone.setTipoProcedura(getTipoProcedura());
clone.setDtAnnullamento(getDtAnnullamento());
clone.setDocPraticaAnnullamentoId(getDocPraticaAnnullamentoId());
+ clone.setUnitaOperativa(getUnitaOperativa());
clone.setDtSorteggio(getDtSorteggio());
clone.setStatoPratica(getStatoPratica());
clone.setNumeroProgetto(getNumeroProgetto());
@@ -1356,7 +1387,7 @@ public class IntPraticaClp extends BaseModelImpl
@Override
public String toString() {
- StringBundler sb = new StringBundler(65);
+ StringBundler sb = new StringBundler(67);
sb.append("{uuid=");
sb.append(getUuid());
@@ -1384,6 +1415,8 @@ public class IntPraticaClp extends BaseModelImpl
sb.append(getDtAnnullamento());
sb.append(", docPraticaAnnullamentoId=");
sb.append(getDocPraticaAnnullamentoId());
+ sb.append(", unitaOperativa=");
+ sb.append(getUnitaOperativa());
sb.append(", dtSorteggio=");
sb.append(getDtSorteggio());
sb.append(", statoPratica=");
@@ -1429,7 +1462,7 @@ public class IntPraticaClp extends BaseModelImpl
@Override
public String toXmlString() {
- StringBundler sb = new StringBundler(100);
+ StringBundler sb = new StringBundler(103);
sb.append("");
sb.append("it.tref.liferay.portos.bo.model.IntPratica");
@@ -1487,6 +1520,10 @@ public class IntPraticaClp extends BaseModelImpl
"docPraticaAnnullamentoId");
+ sb.append(
+ "unitaOperativa");
sb.append(
"dtSorteggio
private String _tipoProcedura;
private Date _dtAnnullamento;
private long _docPraticaAnnullamentoId;
+ private int _unitaOperativa;
private Date _dtSorteggio;
private String _statoPratica;
private String _numeroProgetto;
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/IntPraticaModel.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/IntPraticaModel.java
index ef7ea04b..d1a7f3e5 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/IntPraticaModel.java
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/IntPraticaModel.java
@@ -279,6 +279,20 @@ public interface IntPraticaModel extends BaseModel,
*/
public void setDocPraticaAnnullamentoId(long docPraticaAnnullamentoId);
+ /**
+ * Returns the unita operativa of this int pratica.
+ *
+ * @return the unita operativa of this int pratica
+ */
+ public int getUnitaOperativa();
+
+ /**
+ * Sets the unita operativa of this int pratica.
+ *
+ * @param unitaOperativa the unita operativa of this int pratica
+ */
+ public void setUnitaOperativa(int unitaOperativa);
+
/**
* Returns the dt sorteggio of this int pratica.
*
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/IntPraticaSoap.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/IntPraticaSoap.java
index 4ce74405..c7d3ad3a 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/IntPraticaSoap.java
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/IntPraticaSoap.java
@@ -44,6 +44,7 @@ public class IntPraticaSoap implements Serializable {
soapModel.setTipoProcedura(model.getTipoProcedura());
soapModel.setDtAnnullamento(model.getDtAnnullamento());
soapModel.setDocPraticaAnnullamentoId(model.getDocPraticaAnnullamentoId());
+ soapModel.setUnitaOperativa(model.getUnitaOperativa());
soapModel.setDtSorteggio(model.getDtSorteggio());
soapModel.setStatoPratica(model.getStatoPratica());
soapModel.setNumeroProgetto(model.getNumeroProgetto());
@@ -219,6 +220,14 @@ public class IntPraticaSoap implements Serializable {
_docPraticaAnnullamentoId = docPraticaAnnullamentoId;
}
+ public int getUnitaOperativa() {
+ return _unitaOperativa;
+ }
+
+ public void setUnitaOperativa(int unitaOperativa) {
+ _unitaOperativa = unitaOperativa;
+ }
+
public Date getDtSorteggio() {
return _dtSorteggio;
}
@@ -414,6 +423,7 @@ public class IntPraticaSoap implements Serializable {
private String _tipoProcedura;
private Date _dtAnnullamento;
private long _docPraticaAnnullamentoId;
+ private int _unitaOperativa;
private Date _dtSorteggio;
private String _statoPratica;
private String _numeroProgetto;
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/IntPraticaWrapper.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/IntPraticaWrapper.java
index 4ed2114e..29f414b4 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/IntPraticaWrapper.java
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/model/IntPraticaWrapper.java
@@ -63,6 +63,7 @@ public class IntPraticaWrapper implements IntPratica, ModelWrapper {
attributes.put("tipoProcedura", getTipoProcedura());
attributes.put("dtAnnullamento", getDtAnnullamento());
attributes.put("docPraticaAnnullamentoId", getDocPraticaAnnullamentoId());
+ attributes.put("unitaOperativa", getUnitaOperativa());
attributes.put("dtSorteggio", getDtSorteggio());
attributes.put("statoPratica", getStatoPratica());
attributes.put("numeroProgetto", getNumeroProgetto());
@@ -169,6 +170,12 @@ public class IntPraticaWrapper implements IntPratica, ModelWrapper {
setDocPraticaAnnullamentoId(docPraticaAnnullamentoId);
}
+ Integer unitaOperativa = (Integer)attributes.get("unitaOperativa");
+
+ if (unitaOperativa != null) {
+ setUnitaOperativa(unitaOperativa);
+ }
+
Date dtSorteggio = (Date)attributes.get("dtSorteggio");
if (dtSorteggio != null) {
@@ -590,6 +597,26 @@ public class IntPraticaWrapper implements IntPratica, ModelWrapper {
_intPratica.setDocPraticaAnnullamentoId(docPraticaAnnullamentoId);
}
+ /**
+ * Returns the unita operativa of this int pratica.
+ *
+ * @return the unita operativa of this int pratica
+ */
+ @Override
+ public int getUnitaOperativa() {
+ return _intPratica.getUnitaOperativa();
+ }
+
+ /**
+ * Sets the unita operativa of this int pratica.
+ *
+ * @param unitaOperativa the unita operativa of this int pratica
+ */
+ @Override
+ public void setUnitaOperativa(int unitaOperativa) {
+ _intPratica.setUnitaOperativa(unitaOperativa);
+ }
+
/**
* Returns the dt sorteggio of this int pratica.
*
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 b338728f..f4870983 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
@@ -3,6 +3,8 @@ package it.tref.liferay.portos.bo.search;
import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
+import it.tref.liferay.portos.bo.shared.util.UnitaOperativeUtil;
+import it.tref.liferay.portos.bo.util.PortosIndexField;
import it.tref.liferay.portos.bo.util.WorkflowConstants;
import java.text.DateFormat;
@@ -11,7 +13,6 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-import java.util.Map.Entry;
import java.util.Properties;
import javax.servlet.http.HttpServletRequest;
@@ -59,24 +60,13 @@ public class ControlloPraticaAdvancedSearch {
public static final DateFormat DATE_FORMAT_STRING = new SimpleDateFormat("dd/MM/yyyy");
public static Hits searchMieiTask(HttpServletRequest request, User user, int start, int end) {
-
- // Parametro proveniente dalla ricerca
- int ufficioSearch = ParamUtil.getInteger(request, "ufficio");
-
- boolean searchForExport = ParamUtil.getBoolean(request, "searchForExport", false);
-
SearchContext searchContext = SearchContextFactory.getInstance(request);
-
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
-
- if (searchForExport) {
-
+ if (ParamUtil.getBoolean(request, "searchForExport", false)) {
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
-
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
-
} else {
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
@@ -85,7 +75,6 @@ public class ControlloPraticaAdvancedSearch {
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
-
Hits hits = null;
try {
// Condizioni necessarie per questa ricerca :
@@ -104,50 +93,36 @@ public class ControlloPraticaAdvancedSearch {
// Ricavo i groupId relativi all utente che effettua la ricerca per
// filtrare
-
- if (ufficioSearch != 0 && ufficioSearch != -1) {
-
- TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId",
- ufficioSearch);
+ long ufficio = ParamUtil.getLong(request, "ufficio");
+ if (ufficio != 0 && ufficio != -1) {
+ TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", ufficio);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
-
} else {
-
List organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId());
-
BooleanQuery groupIdsQuery = BooleanQueryFactoryUtil.create(searchContext);
-
if (Validator.isNotNull(organizationList) && !organizationList.isEmpty()) {
for (Organization org : organizationList) {
-
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId",
org.getGroupId());
groupIdsQuery.add(singleGroupIdQuery, BooleanClauseOccur.SHOULD);
}
-
booleanQuery.add(groupIdsQuery, BooleanClauseOccur.MUST);
-
} else {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", 0L);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
-
}
// Condizioni aggiuntive
retrieveQuery(request, user, booleanQuery, searchContext);
-
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
}
-
hits = SearchEngineUtil.search(searchContext, booleanQuery);
-
if (_log.isDebugEnabled()) {
_log.debug("Number of hint find : " + hits.getLength());
}
-
} catch (ParseException | SearchException | SystemException e) {
_log.error(e, e);
}
@@ -156,24 +131,13 @@ public class ControlloPraticaAdvancedSearch {
}
public static Hits searchTaskMieiRuoli(HttpServletRequest request, User user, int start, int end) {
-
- // Parametro proveniente dalla ricerca
- int ufficioSearch = ParamUtil.getInteger(request, "ufficio");
-
SearchContext searchContext = SearchContextFactory.getInstance(request);
-
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
-
- boolean searchForExport = ParamUtil.getBoolean(request, "searchForExport", false);
-
- if (searchForExport) {
-
+ if (ParamUtil.getBoolean(request, "searchForExport", false)) {
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
-
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
-
} else {
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
@@ -184,29 +148,24 @@ public class ControlloPraticaAdvancedSearch {
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
-
// Condizioni necessarie per questa ricerca :
// entryClassName=ControlloPratica & roleIds tra i taskAssigneeIds
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName",
ControlloPratica.class.getName());
TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, "status",
WorkflowConstants.STATUS_PENDING);
-
BooleanQuery booleanQueryRoleIds = BooleanQueryFactoryUtil.create(searchContext);
List organizationUserList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId());
List organizationRoleList = null;
-
for (Organization org : organizationUserList) {
organizationRoleList = RoleLocalServiceUtil.getUserGroupRoles(user.getUserId(),
org.getGroupId());
-
for (Role role : organizationRoleList) {
TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext, "taskAssigneeRoleIds",
("R" + role.getRoleId() + "G" + org.getGroupId()));
booleanQueryRoleIds.add(roleIdTerm, BooleanClauseOccur.SHOULD);
}
-
}
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
@@ -226,42 +185,45 @@ public class ControlloPraticaAdvancedSearch {
// Ricavo i groupId relativi all utente che effettua la ricerca per
// filtrare
-
- if (ufficioSearch != 0 && ufficioSearch != -1) {
-
- TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId",
- ufficioSearch);
+ long ufficio = ParamUtil.getLong(request, "ufficio");
+ if (ufficio != 0 && ufficio != -1) {
+ TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", ufficio);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
-
} else {
-
List organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId());
-
BooleanQuery groupIdsQuery = BooleanQueryFactoryUtil.create(searchContext);
-
if (Validator.isNotNull(organizationList) && !organizationList.isEmpty()) {
for (Organization org : organizationList) {
-
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId",
org.getGroupId());
groupIdsQuery.add(singleGroupIdQuery, BooleanClauseOccur.SHOULD);
}
-
booleanQuery.add(groupIdsQuery, BooleanClauseOccur.MUST);
-
} else {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", 0L);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
}
+ List uos = UnitaOperativeUtil.getUnitaOperative(user);
+ if ((uos.size() > 0) && !uos.contains(0)) {
+ BooleanQuery uoQuery = BooleanQueryFactoryUtil.create(searchContext);
+ for (int uo : uos) {
+ TermQuery tq = TermQueryFactoryUtil.create(searchContext,
+ PortosIndexField.UNITA_OPERATIVA, uo);
+ uoQuery.add(tq, BooleanClauseOccur.SHOULD);
+ }
+ booleanQuery.add(uoQuery, BooleanClauseOccur.MUST);
+ }
+
// Condizioni aggiuntive
retrieveQuery(request, user, booleanQuery, searchContext);
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
}
+ _log.info("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
hits = SearchEngineUtil.search(searchContext, booleanQuery);
@@ -276,26 +238,14 @@ public class ControlloPraticaAdvancedSearch {
}
public static Hits searchAltriTask(HttpServletRequest request, User user, int start, int end) {
-
- // List lista = new ArrayList();
-
- // Parametro proveniente dalla ricerca
- int ufficioSearch = ParamUtil.getInteger(request, "ufficio");
-
SearchContext searchContext = SearchContextFactory.getInstance(request);
-
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
-
boolean searchForExport = ParamUtil.getBoolean(request, "searchForExport", false);
-
if (searchForExport) {
-
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
-
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
-
} else {
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
@@ -306,7 +256,6 @@ public class ControlloPraticaAdvancedSearch {
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
-
// Condizioni necessarie per questa ricerca :
// entryClassName=ControlloPratica &
// roleIds non e tra i taskAssigneeIds
@@ -323,7 +272,6 @@ public class ControlloPraticaAdvancedSearch {
for (Organization org : organizationUserList) {
organizationRoleList = RoleLocalServiceUtil.getUserGroupRoles(user.getUserId(),
org.getGroupId());
-
for (Role role : organizationRoleList) {
TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext, "taskAssigneeRoleIds",
(role.getRoleId() + "-" + org.getGroupId()));
@@ -348,72 +296,39 @@ public class ControlloPraticaAdvancedSearch {
// Ricavo i groupId relativi all utente che effettua la ricerca per
// filtrare
-
- if (ufficioSearch != 0 && ufficioSearch != -1) {
-
- TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId",
- ufficioSearch);
+ long ufficio = ParamUtil.getLong(request, "ufficio");
+ if (ufficio != 0 && ufficio != -1) {
+ TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", ufficio);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
-
} else {
-
List organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId());
-
BooleanQuery groupIdsQuery = BooleanQueryFactoryUtil.create(searchContext);
-
if (Validator.isNotNull(organizationList) && !organizationList.isEmpty()) {
for (Organization org : organizationList) {
-
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId",
org.getGroupId());
groupIdsQuery.add(singleGroupIdQuery, BooleanClauseOccur.SHOULD);
}
-
booleanQuery.add(groupIdsQuery, BooleanClauseOccur.MUST);
-
} else {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", 0L);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
-
}
-
// Condizioni aggiuntive
retrieveQuery(request, user, booleanQuery, searchContext);
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
}
-
hits = SearchEngineUtil.search(searchContext, booleanQuery);
-
if (_log.isDebugEnabled()) {
_log.debug("Number of hint find : " + hits.getLength());
}
-
- // for (Document doc : hits.toList()) {
- //
- // String controlloPraticaId = doc.get("controlloPraticaId");
- // if (Validator.isNotNull(controlloPraticaId)) {
- //
- // ControlloPratica controlloPratica =
- // ControlloPraticaLocalServiceUtil.fetchControlloPratica(GetterUtil.getLong(controlloPraticaId));
- // if (Validator.isNotNull(controlloPratica)) {
- // lista.add(controlloPratica);
- // }
- // }
- //
- // }
-
- } catch (ParseException e) {
- _log.error(e, e);
- } catch (SearchException e) {
- _log.error(e, e);
- } catch (SystemException e) {
+ } catch (ParseException | SearchException | SystemException e) {
_log.error(e, e);
}
-
return hits;
}
@@ -421,119 +336,62 @@ public class ControlloPraticaAdvancedSearch {
User user, int start, int end) {
List lista = new ArrayList();
-
SearchContext searchContext = SearchContextFactory.getInstance(request);
-
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
-
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
-
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
-
searchContext.setAttribute("paginationType", "none");
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
-
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName",
ControlloPratica.class.getName());
-
TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, "status",
WorkflowConstants.STATUS_PENDING);
-
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST);
- // BooleanQuery booleanQueryAttivita =
- // BooleanQueryFactoryUtil.create(searchContext);
- // TermQuery assegnazioneTerm =
- // TermQueryFactoryUtil.create(searchContext, "workflowState",
- // " Assegnazione");
- // TermQuery approvazioneTerm =
- // TermQueryFactoryUtil.create(searchContext, "workflowState",
- // "Approvazione");
- //
- // booleanQueryAttivita.add(assegnazioneTerm,
- // BooleanClauseOccur.SHOULD);
- // booleanQueryAttivita.add(approvazioneTerm,
- // BooleanClauseOccur.SHOULD);
- //
- // booleanQuery.add(booleanQueryAttivita, BooleanClauseOccur.MUST);
-
- String dataDaSearch = ParamUtil.getString(request, "dataRichiestaInizio");
- String dataAlSearch = ParamUtil.getString(request, "dataRichiestaFine");
-
- if ((dataDaSearch != null && !dataDaSearch.equals(""))
- && (dataAlSearch != null && !dataAlSearch.equals(""))) {
-
- Date dataDaApp = DATE_FORMAT_STRING.parse(dataDaSearch);
- Date dataAlApp = DATE_FORMAT_STRING.parse(dataAlSearch);
-
- TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
- "dataInizioProcedimento", DATE_FORMAT_LUCENE.format(dataDaApp),
- DATE_FORMAT_LUCENE.format(dataAlApp), true, true);
- booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
- }
-
- if ((dataDaSearch == null || dataDaSearch.equals(""))
- && (dataAlSearch != null && !dataDaSearch.equals(""))) {
-
- Date dataAlApp = DATE_FORMAT_STRING.parse(dataAlSearch);
-
- TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
- "dataInizioProcedimento", "00000000", DATE_FORMAT_LUCENE.format(dataAlApp), true,
- true);
- booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
-
- }
-
- if ((dataDaSearch != null && !dataDaSearch.equals(""))
- && (dataAlSearch == null || dataAlSearch.equals(""))) {
-
- Date dataDaApp = DATE_FORMAT_STRING.parse(dataDaSearch);
-
+ String dataDa = ParamUtil.getString(request, "dataRichiestaInizio");
+ String dataAl = ParamUtil.getString(request, "dataRichiestaFine");
+ if (Validator.isNotNull(dataDa) || Validator.isNotNull(dataAl)) {
+ if (Validator.isNull(dataDa)) {
+ dataDa = "00000000";
+ } else {
+ dataDa = DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING.parse(dataDa));
+ }
+ if (Validator.isNull(dataAl)) {
+ dataAl = DATE_FORMAT_LUCENE.format(new Date());
+ } else {
+ dataAl = DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING.parse(dataAl));
+ }
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
- "dataInizioProcedimento", DATE_FORMAT_LUCENE.format(dataDaApp),
- DATE_FORMAT_LUCENE.format(new Date()), true, true);
+ "dataInizioProcedimento", dataDa, dataAl, true, true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
-
}
-
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
}
-
hits = SearchEngineUtil.search(searchContext, booleanQuery);
-
if (_log.isDebugEnabled()) {
- _log.debug("Number of hint find : " + hits.getLength());
+ _log.debug("Number of hints found : " + hits.getLength());
}
for (Document doc : hits.toList()) {
-
String controlloPraticaId = doc.get("controlloPraticaId");
if (Validator.isNotNull(controlloPraticaId)) {
-
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil
.fetchControlloPratica(GetterUtil.getLong(controlloPraticaId));
if (Validator.isNotNull(controlloPratica)) {
lista.add(controlloPratica);
}
}
-
}
- } catch (ParseException e) {
- _log.error(e, e);
- } catch (SearchException e) {
- _log.error(e, e);
- } catch (SystemException e) {
- _log.error(e, e);
- } catch (java.text.ParseException e) {
+ } catch (ParseException | SearchException | SystemException | java.text.ParseException e) {
_log.error(e, e);
}
@@ -542,19 +400,13 @@ public class ControlloPraticaAdvancedSearch {
public static List searchTaskPerEsportazionePO(HttpServletRequest request, User user,
int start, int end) {
-
List lista = new ArrayList();
-
SearchContext searchContext = SearchContextFactory.getInstance(request);
-
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
-
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
-
searchContext.setAttribute("paginationType", "none");
-
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
@@ -562,128 +414,63 @@ public class ControlloPraticaAdvancedSearch {
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName",
ControlloPratica.class.getName());
-
TermQuery userIdTermQuery = TermQueryFactoryUtil.create(searchContext, "taskAssigneeUserId",
user.getUserId());
-
TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, "status",
WorkflowConstants.STATUS_PENDING);
-
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(userIdTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST);
- // BooleanQuery booleanQueryAttivita =
- // BooleanQueryFactoryUtil.create(searchContext);
- // TermQuery assegnazioneTerm =
- // TermQueryFactoryUtil.create(searchContext, "workflowState",
- // " Assegnazione");
- // TermQuery approvazioneTerm =
- // TermQueryFactoryUtil.create(searchContext, "workflowState",
- // "Approvazione");
- //
- // booleanQueryAttivita.add(assegnazioneTerm,
- // BooleanClauseOccur.SHOULD);
- // booleanQueryAttivita.add(approvazioneTerm,
- // BooleanClauseOccur.SHOULD);
- //
- // booleanQuery.add(booleanQueryAttivita, BooleanClauseOccur.MUST);
-
- String dataDaSearch = ParamUtil.getString(request, "dataRichiestaInizio");
- String dataAlSearch = ParamUtil.getString(request, "dataRichiestaFine");
-
- if ((dataDaSearch != null && !dataDaSearch.equals(""))
- && (dataAlSearch != null && !dataAlSearch.equals(""))) {
-
- Date dataDaApp = DATE_FORMAT_STRING.parse(dataDaSearch);
- Date dataAlApp = DATE_FORMAT_STRING.parse(dataAlSearch);
-
- TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
- "dataInizioProcedimento", DATE_FORMAT_LUCENE.format(dataDaApp),
- DATE_FORMAT_LUCENE.format(dataAlApp), true, true);
- booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
- }
-
- if ((dataDaSearch == null || dataDaSearch.equals(""))
- && (dataAlSearch != null && !dataDaSearch.equals(""))) {
-
- Date dataAlApp = DATE_FORMAT_STRING.parse(dataAlSearch);
-
- TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
- "dataInizioProcedimento", "00000000", DATE_FORMAT_LUCENE.format(dataAlApp), true,
- true);
- booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
-
- }
-
- if ((dataDaSearch != null && !dataDaSearch.equals(""))
- && (dataAlSearch == null || dataAlSearch.equals(""))) {
-
- Date dataDaApp = DATE_FORMAT_STRING.parse(dataDaSearch);
-
+ String dataDa = ParamUtil.getString(request, "dataRichiestaInizio");
+ String dataAl = ParamUtil.getString(request, "dataRichiestaFine");
+ if (Validator.isNotNull(dataDa) || Validator.isNotNull(dataAl)) {
+ if (Validator.isNull(dataDa)) {
+ dataDa = "00000000";
+ } else {
+ dataDa = DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING.parse(dataDa));
+ }
+ if (Validator.isNull(dataAl)) {
+ dataAl = DATE_FORMAT_LUCENE.format(new Date());
+ } else {
+ dataAl = DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING.parse(dataAl));
+ }
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
- "dataInizioProcedimento", DATE_FORMAT_LUCENE.format(dataDaApp),
- DATE_FORMAT_LUCENE.format(new Date()), true, true);
+ "dataInizioProcedimento", dataDa, dataAl, true, true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
-
}
-
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
}
-
hits = SearchEngineUtil.search(searchContext, booleanQuery);
-
if (_log.isDebugEnabled()) {
_log.debug("Number of hint find : " + hits.getLength());
}
-
for (Document doc : hits.toList()) {
-
String controlloPraticaId = doc.get("controlloPraticaId");
if (Validator.isNotNull(controlloPraticaId)) {
-
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil
.fetchControlloPratica(GetterUtil.getLong(controlloPraticaId));
if (Validator.isNotNull(controlloPratica)) {
lista.add(controlloPratica);
}
}
-
}
-
- } catch (ParseException e) {
- _log.error(e, e);
- } catch (SearchException e) {
- _log.error(e, e);
- } catch (SystemException e) {
- _log.error(e, e);
- } catch (java.text.ParseException e) {
+ } catch (ParseException | SearchException | SystemException | java.text.ParseException e) {
_log.error(e, e);
}
-
return lista;
}
public static Hits searchTaskConclusi(HttpServletRequest request, User user, int start, int end) {
-
- // List lista = new ArrayList();
-
SearchContext searchContext = SearchContextFactory.getInstance(request);
-
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
-
- boolean searchForExport = ParamUtil.getBoolean(request, "searchForExport", false);
-
- if (searchForExport) {
-
+ if (ParamUtil.getBoolean(request, "searchForExport", false)) {
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
-
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
-
} else {
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
@@ -709,17 +496,13 @@ public class ControlloPraticaAdvancedSearch {
for (Organization org : organizationUserList) {
organizationRoleList = RoleLocalServiceUtil.getUserGroupRoles(user.getUserId(),
org.getGroupId());
-
for (Role role : organizationRoleList) {
TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext, "taskAssigneeRoleIds",
(role.getRoleId() + "-" + org.getGroupId()));
booleanQueryRoleIds.add(roleIdTerm, BooleanClauseOccur.SHOULD);
}
-
}
-
BooleanQuery booleanQueryStatus = BooleanQueryFactoryUtil.create(searchContext);
-
TermQuery statusDenied = TermQueryFactoryUtil.create(searchContext, "status",
WorkflowConstants.STATUS_DENIED);
booleanQueryStatus.add(statusDenied, BooleanClauseOccur.SHOULD);
@@ -729,10 +512,8 @@ public class ControlloPraticaAdvancedSearch {
TermQuery statusIncomplete = TermQueryFactoryUtil.create(searchContext, "status",
WorkflowConstants.STATUS_INCOMPLETE);
booleanQueryStatus.add(statusIncomplete, BooleanClauseOccur.SHOULD);
-
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
-
if (organizationUserList != null && !organizationUserList.isEmpty()
&& organizationRoleList != null && !organizationRoleList.isEmpty()) {
booleanQuery.add(booleanQueryRoleIds, BooleanClauseOccur.MUST_NOT);
@@ -744,19 +525,14 @@ public class ControlloPraticaAdvancedSearch {
// filtrare
List organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId());
-
BooleanQuery groupIdsQuery = BooleanQueryFactoryUtil.create(searchContext);
-
if (Validator.isNotNull(organizationList) && !organizationList.isEmpty()) {
for (Organization org : organizationList) {
-
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId",
org.getGroupId());
groupIdsQuery.add(singleGroupIdQuery, BooleanClauseOccur.SHOULD);
}
-
booleanQuery.add(groupIdsQuery, BooleanClauseOccur.MUST);
-
} else {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", 0L);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
@@ -768,18 +544,11 @@ public class ControlloPraticaAdvancedSearch {
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
}
-
hits = SearchEngineUtil.search(searchContext, booleanQuery);
-
if (_log.isDebugEnabled()) {
_log.debug("Number of hint find : " + hits.getLength());
}
-
- } catch (ParseException e) {
- _log.error(e, e);
- } catch (SearchException e) {
- _log.error(e, e);
- } catch (SystemException e) {
+ } catch (ParseException | SearchException | SystemException e) {
_log.error(e, e);
}
@@ -799,8 +568,8 @@ public class ControlloPraticaAdvancedSearch {
// ADT ADT BUG BO ID = 8
String istruttoreId = ParamUtil.getString(request, "istruttore");
- String dataDaSearch = ParamUtil.getString(request, "dataRichiestaInizio");
- String dataAlSearch = ParamUtil.getString(request, "dataRichiestaFine");
+ 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");
@@ -808,28 +577,22 @@ public class ControlloPraticaAdvancedSearch {
// ADT - BUG-11 Aggiunta filtro ricerca
String controlloObbligatorioSearch = ParamUtil.getString(request, "controlloObbligatorio");
String sorteggiataSearch = ParamUtil.getString(request, "sorteggiata");
-
try {
-
if (tipoAttivita != null && !tipoAttivita.equals("") && !tipoAttivita.equals("-1")) {
TermQuery tipoAttivitaTermQuery = TermQueryFactoryUtil.create(searchContext, "workflowState",
tipoAttivita);
booleanQuery.add(tipoAttivitaTermQuery, BooleanClauseOccur.MUST);
}
-
if (numeroProgettoSearch != null && !numeroProgettoSearch.equals("")) {
TermQuery numeroProgettoTermQuery = TermQueryFactoryUtil.create(searchContext,
"numeroProgetto", numeroProgettoSearch);
booleanQuery.add(numeroProgettoTermQuery, BooleanClauseOccur.MUST);
-
}
-
if (protocolloSearch != null && !protocolloSearch.equals("")) {
TermQuery protocolloSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"protocollo", protocolloSearch);
booleanQuery.add(protocolloSearchTermQuery, BooleanClauseOccur.MUST);
}
-
if (tipoPraticaSearch != null && !tipoPraticaSearch.equals("") && !tipoPraticaSearch.equals("-1")) {
TermQuery tipoPraticaSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"tipoPratica", tipoPraticaSearch);
@@ -839,118 +602,84 @@ public class ControlloPraticaAdvancedSearch {
// Gestione StatoPratica
if (statoPraticaSearch != null && !statoPraticaSearch.equals("")
&& !statoPraticaSearch.equals("-1")) {
-
if (statoPraticaSearch.equals(StatoPraticaConstants.COLLAUDO_PARZIALE)) {
-
TermQuery collaudoParzialeSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"collaudoParziale", "true");
booleanQuery.add(collaudoParzialeSearchTermQuery, BooleanClauseOccur.MUST);
-
} else if (statoPraticaSearch.equals(StatoPraticaConstants.COLLAUDO)) {
-
TermQuery collaudoSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"collaudoCompletato", "true");
booleanQuery.add(collaudoSearchTermQuery, BooleanClauseOccur.MUST);
-
} else if (statoPraticaSearch.equals(StatoPraticaConstants.FINE_LAVORI)) {
-
TermQuery fineLavoriSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"fineLavoriCompletati", "true");
booleanQuery.add(fineLavoriSearchTermQuery, BooleanClauseOccur.MUST);
-
} else if (statoPraticaSearch.equals(StatoPraticaConstants.FINE_LAVORI_PARZIALE)) {
-
TermQuery fineLavoriParzialiSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"fineLavoriParziali", "true");
booleanQuery.add(fineLavoriParzialiSearchTermQuery, BooleanClauseOccur.MUST);
-
} else if (statoPraticaSearch.equals(StatoPraticaConstants.SORTEGGIATA)) {
-
TermQuery sorteggiataSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"lavorazioneSorteggiata", "true");
booleanQuery.add(sorteggiataSearchTermQuery, BooleanClauseOccur.MUST);
-
} else if (statoPraticaSearch.equals(StatoPraticaConstants.SOTTOPOSTA_A_PARERE)) {
-
TermQuery sottopostaParereSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"sottopostoAParere", "true");
booleanQuery.add(sottopostaParereSearchTermQuery, BooleanClauseOccur.MUST);
-
} else if (statoPraticaSearch.equals(StatoPraticaConstants.VARIATA)) {
-
TermQuery sottopostaParereSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"variata", "true");
booleanQuery.add(sottopostaParereSearchTermQuery, BooleanClauseOccur.MUST);
-
} else {
-
TermQuery statoPraticaSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"statoPratica", statoPraticaSearch);
booleanQuery.add(statoPraticaSearchTermQuery, BooleanClauseOccur.MUST);
-
}
}
-
if (committenteSearch != null && !committenteSearch.equals("")) {
TermQuery committenteSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"committenti", committenteSearch.toUpperCase());
booleanQuery.add(committenteSearchTermQuery, BooleanClauseOccur.MUST);
}
-
if (soggettiInterconnessiSearch != null && !soggettiInterconnessiSearch.equals("")) {
TermQuery soggettiInterconnessiSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"soggettiInterconnessi", soggettiInterconnessiSearch.toUpperCase());
booleanQuery.add(soggettiInterconnessiSearchTermQuery, BooleanClauseOccur.MUST);
}
-
if (istruttoreId != null && !istruttoreId.equals("") && !istruttoreId.equals("-1")) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "istruttoreUserId",
istruttoreId);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
+ if ((dataDa != null && !dataDa.equals("")) && (dataAl != null && !dataAl.equals(""))) {
- if ((dataDaSearch != null && !dataDaSearch.equals(""))
- && (dataAlSearch != null && !dataAlSearch.equals(""))) {
-
- Date dataDaApp = DATE_FORMAT_STRING.parse(dataDaSearch);
- Date dataAlApp = DATE_FORMAT_STRING.parse(dataAlSearch);
+ Date dataDaApp = DATE_FORMAT_STRING.parse(dataDa);
+ Date dataAlApp = DATE_FORMAT_STRING.parse(dataAl);
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
"dataInizioProcedimento", DATE_FORMAT_LUCENE.format(dataDaApp),
DATE_FORMAT_LUCENE.format(dataAlApp), true, true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
}
-
- if ((dataDaSearch == null || dataDaSearch.equals(""))
- && (dataAlSearch != null && !dataDaSearch.equals(""))) {
-
- Date dataAlApp = DATE_FORMAT_STRING.parse(dataAlSearch);
-
+ if ((dataDa == null || dataDa.equals("")) && (dataAl != null && !dataDa.equals(""))) {
+ Date dataAlApp = DATE_FORMAT_STRING.parse(dataAl);
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
"dataInizioProcedimento", "00000000", DATE_FORMAT_LUCENE.format(dataAlApp), true,
true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
-
}
-
- if ((dataDaSearch != null && !dataDaSearch.equals(""))
- && (dataAlSearch == null || dataAlSearch.equals(""))) {
-
- Date dataDaApp = DATE_FORMAT_STRING.parse(dataDaSearch);
-
+ if ((dataDa != null && !dataDa.equals("")) && (dataAl == null || dataAl.equals(""))) {
+ Date dataDaApp = DATE_FORMAT_STRING.parse(dataDa);
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
"dataInizioProcedimento", DATE_FORMAT_LUCENE.format(dataDaApp),
DATE_FORMAT_LUCENE.format(new Date()), true, true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
-
}
-
if (comune != null && !comune.equals("") && !comune.equals("-1")) {
TermQuery comuneTermQuery = TermQueryFactoryUtil.create(searchContext, "comuneId", comune);
booleanQuery.add(comuneTermQuery, BooleanClauseOccur.MUST);
}
-
if (Validator.isNotNull(tipoProcedura)) {
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, "tipoProcedura",
tipoProcedura);
@@ -970,33 +699,24 @@ public class ControlloPraticaAdvancedSearch {
sorteggiataSearch);
booleanQuery.add(sorteggiataTermQuery, BooleanClauseOccur.MUST);
}
-
- } catch (ParseException e) {
- _log.error(e, e);
- } catch (java.text.ParseException e) {
+ } catch (ParseException | java.text.ParseException e) {
_log.error(e, e);
}
}
private static Sort[] getOrderedQuery(HttpServletRequest request) {
-
Properties properties = PropsUtil.getProperties("elasticsearch.", true);
-
String orderField = ParamUtil.getString(request, "ordinaPer", "numeroProgetto");
String orderType = ParamUtil.getString(request, "ordinaTipo", "desc");
-
List sortes = new ArrayList();
Sort sort = new Sort();
-
if (orderField != null && !orderField.equals("") && !orderField.equals("-1")) {
-
if (properties.size() > 0) {
sort.setFieldName(orderField + "_sortable");
} else {
sort.setFieldName(orderField);
}
-
if (orderField.equals("numeroProgetto")) {
sort.setType(Sort.INT_TYPE);
} else if (orderField.equals("protocollo")) {
@@ -1008,9 +728,7 @@ public class ControlloPraticaAdvancedSearch {
} else if (orderField.equals("tipoPratica")) {
sort.setType(Sort.INT_TYPE);
}
-
}
-
if (orderType != null && !orderType.equals("") && !orderType.equals("-1")) {
if (orderType.equals("desc")) {
sort.setReverse(false);
@@ -1018,9 +736,7 @@ public class ControlloPraticaAdvancedSearch {
sort.setReverse(true);
}
}
-
sortes.add(sort);
-
return sortes.toArray(new Sort[0]);
}
}
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 13738f31..a346d0ce 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
@@ -28,7 +28,7 @@ public class PortosIndexField implements Serializable {
public static final String STATO_PRATICA = "statoPratica";
public static final String DESC_INTERVENTO = "descIntervento";
-
+
public static final String COMMITTENTE = "committente";
public static final String COMMITTENTI = "committenti";
@@ -126,7 +126,9 @@ public class PortosIndexField implements Serializable {
public static final String PROVINCIA = "provincia";
public static final String COMUNE = "comune";
-
+
public static final String TIPO_PROCEDURA = "tipoProcedura";
+ public static final String UNITA_OPERATIVA = "unitaOperativa";
+
}
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/WorkflowUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/WorkflowUtil.java
index f061ae32..23b56ae4 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/WorkflowUtil.java
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/WorkflowUtil.java
@@ -16,15 +16,12 @@ import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-
import com.liferay.portal.NoSuchWorkflowInstanceLinkException;
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.json.JSONDeserializer;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
-import com.liferay.portal.kernel.log.Log;
-import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.workflow.WorkflowException;
@@ -41,8 +38,6 @@ import com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil;
public class WorkflowUtil {
- private static final Log _log = LogFactoryUtil.getLog(WorkflowUtil.class);
-
public static WorkflowTask getLastTask(long companyId, long groupId, Long userId, ControlloPratica bean)
throws PortalException, SystemException {
@@ -246,6 +241,7 @@ public class WorkflowUtil {
/*
* Verificare corretta corrispondenza con AvvisoUtil.getAllTipoDocumento()
*/
+ @SuppressWarnings("serial")
private final static Map tipoDocumentoToSignal = new HashMap() {
{
put(StatoPraticaConstants.SOTTOPOSTA_A_PARERE, WorkflowConstants.WORKFLOW_SIGNAL_ASSEGNAZIONE);
@@ -326,7 +322,7 @@ public class WorkflowUtil {
// if (workflowInstanceLink == null) {
// throw new NoSuchWorkflowInstanceLinkException();
// }
- Map parameters = new HashMap();
+ Map parameters = new HashMap<>();
;
if (workflowInstanceLink != null) {
long workflowInstanceId = workflowInstanceLink.getWorkflowInstanceId();
@@ -349,7 +345,6 @@ public class WorkflowUtil {
public static void valutaEffettiInvioVariante(DettPratica dettPratica) throws Exception {
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
- boolean isDeposito = AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId());
if (TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())
&& needToStartWorkflow(dettPratica)) {
ServiceContext serviceContext = new ServiceContext();
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/sql/tables.sql b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/sql/tables.sql
index b2db0fe9..e3dbdf9b 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/sql/tables.sql
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/sql/tables.sql
@@ -601,6 +601,7 @@ create table portos_bo_IntPratica (
tipoProcedura VARCHAR(75) null,
dtAnnullamento DATE null,
docPraticaAnnullamentoId LONG,
+ unitaOperativa INTEGER,
dtSorteggio DATE null,
statoPratica VARCHAR(10) null,
numeroProgetto VARCHAR(75) null,
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/META-INF/portlet-hbm.xml b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/META-INF/portlet-hbm.xml
index d832718b..219aa0c6 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/META-INF/portlet-hbm.xml
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/META-INF/portlet-hbm.xml
@@ -648,6 +648,7 @@
+
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/META-INF/portlet-model-hints.xml b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/META-INF/portlet-model-hints.xml
index 7875fff0..a57d8e1c 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/META-INF/portlet-model-hints.xml
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/META-INF/portlet-model-hints.xml
@@ -687,6 +687,7 @@
+
10
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/META-INF/portlet-orm.xml b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/META-INF/portlet-orm.xml
index b9e425aa..f271e2cf 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/META-INF/portlet-orm.xml
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/META-INF/portlet-orm.xml
@@ -822,6 +822,7 @@
TIMESTAMP
+
TIMESTAMP
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Language.properties b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Language.properties
index 66429369..8c95efc3 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Language.properties
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Language.properties
@@ -271,6 +271,7 @@ Tab_TaskMieiRuoli = Attività dei miei ruoli
Tab_AtriTask = Altre attività
Tab_TaskCompletati = Attività completate
data-inizio-procedimento = Avvio procedimento
+unita-operativa = U.O.
tipoPratica = Tipo
numeroProgetto = Progetto
taskName = Attivitá
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java
index ae70caa6..4465907d 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java
@@ -42,6 +42,7 @@ import it.tref.liferay.portos.bo.service.StoricoSoggettoPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.TempisticaLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
+import it.tref.liferay.portos.bo.shared.util.UnitaOperativeUtil;
import it.tref.liferay.portos.bo.util.AvvisoUtil;
import it.tref.liferay.portos.bo.util.Constants;
import it.tref.liferay.portos.mailmanager.model.Email;
@@ -152,6 +153,11 @@ public class ManutenzioneDatabase {
PortalException {
List esito = new ArrayList<>();
long companyId = serviceContext.getCompanyId();
+
+ if (mode.contains("!UnitaOperative!")) {
+ esito.addAll(fixUnitaOperative());
+ }
+
if (mode.contains("!Pulisci!")) {
esito.addAll(puliziaDocumentLibrary(companyId));
esitoLog(
@@ -196,6 +202,40 @@ public class ManutenzioneDatabase {
}
}
+ private static List fixUnitaOperative() throws SystemException {
+ List esito = new ArrayList<>();
+ esitoLog(esito, "fixUnitaOperative");
+ int start = 0;
+ List pratiche = null;
+ do {
+ pratiche = IntPraticaLocalServiceUtil.getIntPraticas(start, start + SLICE);
+ if (pratiche.size() > 0) {
+ for (IntPratica pratica : pratiche) {
+ int destinazione = 0;
+ try {
+ User user = UserLocalServiceUtil.getUser(pratica.getStatusByUserId());
+ List uos = UnitaOperativeUtil.getUnitaOperative(user);
+ for (int uo : uos) {
+ if (uo > destinazione) {
+ destinazione = uo;
+ }
+ }
+ } catch (PortalException e) {
+ }
+ if (destinazione != pratica.getUnitaOperativa()) {
+ esitoLog(esito,
+ "Pratica " + pratica.getIntPraticaId() + ", " + pratica.getUnitaOperativa()
+ + " -> " + destinazione);
+ pratica.setUnitaOperativa(destinazione);
+ IntPraticaLocalServiceUtil.updateIntPratica(pratica);
+ }
+ }
+ start += pratiche.size();
+ }
+ } while (pratiche.size() > 0);
+ return esito;
+ }
+
private static List svuotaDatabase(long companyId) throws SystemException, PortalException {
List esito = new ArrayList<>();
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java
index f06c7db7..60372c23 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java
@@ -153,7 +153,6 @@ public class SismicaUtil {
List esito = new ArrayList<>();
int start = 0;
- int totale = 0;
List pratiche = null;
do {
try {
@@ -161,14 +160,15 @@ public class SismicaUtil {
} catch (SystemException e) {
pratiche = new ArrayList<>();
}
- for (IntPratica pratica : pratiche) {
- IntPraticaLocalServiceUtil.reIndexFascicolo(pratica, companyId);
+ if (pratiche.size() > 0) {
+ for (IntPratica pratica : pratiche) {
+ IntPraticaLocalServiceUtil.reIndexFascicolo(pratica, companyId);
+ }
+ start += pratiche.size();
+ _log.info("Reindicizzate " + start + " pratiche");
}
- totale += pratiche.size();
- start += SLICE;
- _log.info("Reindicizzate " + start + " pratiche");
} while (pratiche.size() > 0);
- esito.add("" + totale + " pratiche reindicizzate.");
+ esito.add("" + start + " pratiche reindicizzate.");
return esito;
}
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 6a28f271..88541f97 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
@@ -208,6 +208,7 @@ public class ControlloPraticaIndexer extends BaseIndexer {
if (Validator.isNotNull(intPratica.getTipoProcedura())) {
document.addKeyword(PortosIndexField.TIPO_PROCEDURA, intPratica.getTipoProcedura());
}
+ document.addKeyword(PortosIndexField.UNITA_OPERATIVA, intPratica.getUnitaOperativa());
// Prendo l ultimo DettPratica legato a IntPratica
DettPratica lastDettPratica = DettPraticaLocalServiceUtil
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IntPraticaCacheModel.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IntPraticaCacheModel.java
index 342267d7..63263971 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IntPraticaCacheModel.java
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IntPraticaCacheModel.java
@@ -38,7 +38,7 @@ public class IntPraticaCacheModel implements CacheModel,
Externalizable {
@Override
public String toString() {
- StringBundler sb = new StringBundler(65);
+ StringBundler sb = new StringBundler(67);
sb.append("{uuid=");
sb.append(uuid);
@@ -66,6 +66,8 @@ public class IntPraticaCacheModel implements CacheModel,
sb.append(dtAnnullamento);
sb.append(", docPraticaAnnullamentoId=");
sb.append(docPraticaAnnullamentoId);
+ sb.append(", unitaOperativa=");
+ sb.append(unitaOperativa);
sb.append(", dtSorteggio=");
sb.append(dtSorteggio);
sb.append(", statoPratica=");
@@ -171,6 +173,7 @@ public class IntPraticaCacheModel implements CacheModel,
}
intPraticaImpl.setDocPraticaAnnullamentoId(docPraticaAnnullamentoId);
+ intPraticaImpl.setUnitaOperativa(unitaOperativa);
if (dtSorteggio == Long.MIN_VALUE) {
intPraticaImpl.setDtSorteggio(null);
@@ -263,6 +266,7 @@ public class IntPraticaCacheModel implements CacheModel,
tipoProcedura = objectInput.readUTF();
dtAnnullamento = objectInput.readLong();
docPraticaAnnullamentoId = objectInput.readLong();
+ unitaOperativa = objectInput.readInt();
dtSorteggio = objectInput.readLong();
statoPratica = objectInput.readUTF();
numeroProgetto = objectInput.readUTF();
@@ -327,6 +331,7 @@ public class IntPraticaCacheModel implements CacheModel,
objectOutput.writeLong(dtAnnullamento);
objectOutput.writeLong(docPraticaAnnullamentoId);
+ objectOutput.writeInt(unitaOperativa);
objectOutput.writeLong(dtSorteggio);
if (statoPratica == null) {
@@ -387,6 +392,7 @@ public class IntPraticaCacheModel implements CacheModel,
public String tipoProcedura;
public long dtAnnullamento;
public long docPraticaAnnullamentoId;
+ public int unitaOperativa;
public long dtSorteggio;
public String statoPratica;
public String numeroProgetto;
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IntPraticaModelImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IntPraticaModelImpl.java
index 68e601df..290ba389 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IntPraticaModelImpl.java
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IntPraticaModelImpl.java
@@ -80,6 +80,7 @@ public class IntPraticaModelImpl extends BaseModelImpl
{ "tipoProcedura", Types.VARCHAR },
{ "dtAnnullamento", Types.TIMESTAMP },
{ "docPraticaAnnullamentoId", Types.BIGINT },
+ { "unitaOperativa", Types.INTEGER },
{ "dtSorteggio", Types.TIMESTAMP },
{ "statoPratica", Types.VARCHAR },
{ "numeroProgetto", Types.VARCHAR },
@@ -100,7 +101,7 @@ public class IntPraticaModelImpl extends BaseModelImpl
{ "collaudoTotale", Types.BOOLEAN },
{ "controlloObbligatorio", Types.BOOLEAN }
};
- public static final String TABLE_SQL_CREATE = "create table portos_bo_IntPratica (uuid_ VARCHAR(75) null,intPraticaId LONG not null primary key,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,groupId LONG,tipoPratica VARCHAR(75) null,territorioId LONG,tipoProcedura VARCHAR(75) null,dtAnnullamento DATE null,docPraticaAnnullamentoId LONG,dtSorteggio DATE null,statoPratica VARCHAR(10) null,numeroProgetto VARCHAR(75) null,validata BOOLEAN,status INTEGER,statusByUserId LONG,statusDate DATE null,esitoControllo INTEGER,dtPratica DATE null,oldIntPraticaId LONG,sospesa BOOLEAN,dtSospensione DATE null,codiceFiscaleDelegatoFineLavori VARCHAR(75) null,codiceFiscaleDelegatoCollaudo VARCHAR(75) null,fineLavoriParziale BOOLEAN,fineLavoriTotale BOOLEAN,collaudoParziale BOOLEAN,collaudoTotale BOOLEAN,controlloObbligatorio BOOLEAN)";
+ public static final String TABLE_SQL_CREATE = "create table portos_bo_IntPratica (uuid_ VARCHAR(75) null,intPraticaId LONG not null primary key,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,groupId LONG,tipoPratica VARCHAR(75) null,territorioId LONG,tipoProcedura VARCHAR(75) null,dtAnnullamento DATE null,docPraticaAnnullamentoId LONG,unitaOperativa INTEGER,dtSorteggio DATE null,statoPratica VARCHAR(10) null,numeroProgetto VARCHAR(75) null,validata BOOLEAN,status INTEGER,statusByUserId LONG,statusDate DATE null,esitoControllo INTEGER,dtPratica DATE null,oldIntPraticaId LONG,sospesa BOOLEAN,dtSospensione DATE null,codiceFiscaleDelegatoFineLavori VARCHAR(75) null,codiceFiscaleDelegatoCollaudo VARCHAR(75) null,fineLavoriParziale BOOLEAN,fineLavoriTotale BOOLEAN,collaudoParziale BOOLEAN,collaudoTotale BOOLEAN,controlloObbligatorio BOOLEAN)";
public static final String TABLE_SQL_DROP = "drop table portos_bo_IntPratica";
public static final String ORDER_BY_JPQL = " ORDER BY intPratica.intPraticaId ASC";
public static final String ORDER_BY_SQL = " ORDER BY portos_bo_IntPratica.intPraticaId ASC";
@@ -152,6 +153,7 @@ public class IntPraticaModelImpl extends BaseModelImpl
model.setTipoProcedura(soapModel.getTipoProcedura());
model.setDtAnnullamento(soapModel.getDtAnnullamento());
model.setDocPraticaAnnullamentoId(soapModel.getDocPraticaAnnullamentoId());
+ model.setUnitaOperativa(soapModel.getUnitaOperativa());
model.setDtSorteggio(soapModel.getDtSorteggio());
model.setStatoPratica(soapModel.getStatoPratica());
model.setNumeroProgetto(soapModel.getNumeroProgetto());
@@ -248,6 +250,7 @@ public class IntPraticaModelImpl extends BaseModelImpl
attributes.put("tipoProcedura", getTipoProcedura());
attributes.put("dtAnnullamento", getDtAnnullamento());
attributes.put("docPraticaAnnullamentoId", getDocPraticaAnnullamentoId());
+ attributes.put("unitaOperativa", getUnitaOperativa());
attributes.put("dtSorteggio", getDtSorteggio());
attributes.put("statoPratica", getStatoPratica());
attributes.put("numeroProgetto", getNumeroProgetto());
@@ -354,6 +357,12 @@ public class IntPraticaModelImpl extends BaseModelImpl
setDocPraticaAnnullamentoId(docPraticaAnnullamentoId);
}
+ Integer unitaOperativa = (Integer)attributes.get("unitaOperativa");
+
+ if (unitaOperativa != null) {
+ setUnitaOperativa(unitaOperativa);
+ }
+
Date dtSorteggio = (Date)attributes.get("dtSorteggio");
if (dtSorteggio != null) {
@@ -702,6 +711,17 @@ public class IntPraticaModelImpl extends BaseModelImpl
_docPraticaAnnullamentoId = docPraticaAnnullamentoId;
}
+ @JSON
+ @Override
+ public int getUnitaOperativa() {
+ return _unitaOperativa;
+ }
+
+ @Override
+ public void setUnitaOperativa(int unitaOperativa) {
+ _unitaOperativa = unitaOperativa;
+ }
+
@JSON
@Override
public Date getDtSorteggio() {
@@ -1063,6 +1083,7 @@ public class IntPraticaModelImpl extends BaseModelImpl
intPraticaImpl.setTipoProcedura(getTipoProcedura());
intPraticaImpl.setDtAnnullamento(getDtAnnullamento());
intPraticaImpl.setDocPraticaAnnullamentoId(getDocPraticaAnnullamentoId());
+ intPraticaImpl.setUnitaOperativa(getUnitaOperativa());
intPraticaImpl.setDtSorteggio(getDtSorteggio());
intPraticaImpl.setStatoPratica(getStatoPratica());
intPraticaImpl.setNumeroProgetto(getNumeroProgetto());
@@ -1240,6 +1261,8 @@ public class IntPraticaModelImpl extends BaseModelImpl
intPraticaCacheModel.docPraticaAnnullamentoId = getDocPraticaAnnullamentoId();
+ intPraticaCacheModel.unitaOperativa = getUnitaOperativa();
+
Date dtSorteggio = getDtSorteggio();
if (dtSorteggio != null) {
@@ -1337,7 +1360,7 @@ public class IntPraticaModelImpl extends BaseModelImpl
@Override
public String toString() {
- StringBundler sb = new StringBundler(65);
+ StringBundler sb = new StringBundler(67);
sb.append("{uuid=");
sb.append(getUuid());
@@ -1365,6 +1388,8 @@ public class IntPraticaModelImpl extends BaseModelImpl
sb.append(getDtAnnullamento());
sb.append(", docPraticaAnnullamentoId=");
sb.append(getDocPraticaAnnullamentoId());
+ sb.append(", unitaOperativa=");
+ sb.append(getUnitaOperativa());
sb.append(", dtSorteggio=");
sb.append(getDtSorteggio());
sb.append(", statoPratica=");
@@ -1410,7 +1435,7 @@ public class IntPraticaModelImpl extends BaseModelImpl
@Override
public String toXmlString() {
- StringBundler sb = new StringBundler(100);
+ StringBundler sb = new StringBundler(103);
sb.append("");
sb.append("it.tref.liferay.portos.bo.model.IntPratica");
@@ -1468,6 +1493,10 @@ public class IntPraticaModelImpl extends BaseModelImpl
"docPraticaAnnullamentoId");
+ sb.append(
+ "unitaOperativa");
sb.append(
"dtSorteggio
private String _tipoProcedura;
private Date _dtAnnullamento;
private long _docPraticaAnnullamentoId;
+ private int _unitaOperativa;
private Date _dtSorteggio;
private String _statoPratica;
private String _numeroProgetto;
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java
index 9e30608c..f7ab63dd 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java
@@ -25,6 +25,7 @@ import it.tref.liferay.portos.bo.service.TempisticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.base.ControlloPraticaLocalServiceBaseImpl;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil;
+import it.tref.liferay.portos.bo.shared.util.UnitaOperativeUtil;
import it.tref.liferay.portos.bo.util.AvvisoUtil;
import it.tref.liferay.portos.bo.util.AzioniPraticheUtil;
import it.tref.liferay.portos.bo.util.Constants;
@@ -36,12 +37,11 @@ import it.tref.liferay.portos.kaleo.model.FormLog;
import it.tref.liferay.portos.kaleo.service.FormLogLocalServiceUtil;
import java.io.Serializable;
-import java.util.Collections;
-import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.TreeMap;
import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
@@ -389,6 +389,7 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
ControlloPratica controlloPratica = controlloPraticaLocalService
.getControlloPratica(controlloPraticaId);
+ @SuppressWarnings("unchecked")
Map parametri = (Map) workflowContext
.get("CONTEXT_TASK_FORM_PARAMETERS");
IntPratica intPratica = intPraticaLocalService.getIntPratica(controlloPratica.getIntPraticaId());
@@ -499,25 +500,44 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil
.getControlloPratica(controlloPraticaId);
+ boolean preassegnazione = (0 == IntPraticaLocalServiceUtil.getIntPratica(
+ controlloPratica.getIntPraticaId()).getUnitaOperativa());
+ long companyId = controlloPratica.getCompanyId();
- JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
- JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
- jsonObject.put("istruttore", jsonArray);
-
- Role role = RoleLocalServiceUtil.getRole(controlloPratica.getCompanyId(), "portos_istruttore");
+ long role = RoleLocalServiceUtil.getRole(companyId,
+ preassegnazione ? "portos_assegnatore" : "portos_istruttore").getRoleId();
List userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(
- controlloPratica.getGroupId(), role.getRoleId());
+ controlloPratica.getGroupId(), role);
+
+ _log.info("preassegnazione=" + preassegnazione + ", roleid=" + role);
Map sorted = new TreeMap<>();
for (UserGroupRole userGroupRole : userGroupRoles) {
User user = userGroupRole.getUser();
- JSONObject istruttore = JSONFactoryUtil.createJSONObject();
- istruttore.put("label", user.getFullName());
- istruttore.put("value", user.getUserId());
- istruttore.put("default", false);
- sorted.put((user.getLastName() + user.getFirstName()).toUpperCase(), istruttore);
+ long userId = user.getUserId();
+
+ if (preassegnazione) {
+ for (int uo : UnitaOperativeUtil.getUnitaOperative(user)) {
+ String label = ("U.O. " + uo + ": " + user.getFullName()).toUpperCase();
+ JSONObject istruttore = JSONFactoryUtil.createJSONObject();
+ istruttore.put("label", label);
+ istruttore.put("value", userId);
+ istruttore.put("default", false);
+ sorted.put(label, istruttore);
+ }
+ } else {
+ String label = user.getFullName().toUpperCase();
+ JSONObject istruttore = JSONFactoryUtil.createJSONObject();
+ istruttore.put("label", label);
+ istruttore.put("value", userId);
+ istruttore.put("default", false);
+ sorted.put(label, istruttore);
+ }
}
+ JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
+ JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
+ jsonObject.put("istruttore", jsonArray);
for (JSONObject istruttore : sorted.values()) {
jsonArray.put(istruttore);
}
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 ee52c9b7..a902c64f 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
@@ -4655,6 +4655,7 @@ public class IntPraticaPersistenceImpl extends BasePersistenceImpl
intPraticaImpl.setTipoProcedura(intPratica.getTipoProcedura());
intPraticaImpl.setDtAnnullamento(intPratica.getDtAnnullamento());
intPraticaImpl.setDocPraticaAnnullamentoId(intPratica.getDocPraticaAnnullamentoId());
+ intPraticaImpl.setUnitaOperativa(intPratica.getUnitaOperativa());
intPraticaImpl.setDtSorteggio(intPratica.getDtSorteggio());
intPraticaImpl.setStatoPratica(intPratica.getStatoPratica());
intPraticaImpl.setNumeroProgetto(intPratica.getNumeroProgetto());
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 6ac8f3ec..346b2335 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=2805
- build.date=1608631312513
+ build.number=2833
+ build.date=1610446715034
build.auto.upgrade=true
##
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/miei_task.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/miei_task.jsp
index 5e8d4f09..8c1c8323 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/miei_task.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/miei_task.jsp
@@ -1,5 +1,4 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
-
<%@page import="com.liferay.portal.kernel.search.IndexerRegistryUtil"%>
<%@page import="com.liferay.portal.kernel.search.Indexer"%>
<%@page import="com.liferay.portal.kernel.search.Hits"%>
@@ -92,7 +91,7 @@ request.setAttribute("tabs1", "Tab_MieiTask");
>
<%
List listaControlloPratica = new ArrayList();
-
+
Hits hits = ControlloPraticaAdvancedSearch.searchMieiTask(request, user, searchContainer.getStart(), searchContainer.getEnd());
for (Document doc : hits.toList()) {
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 412df5b9..cc0ed900 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
@@ -182,6 +182,10 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP
+
+ <%= intPratica.getUnitaOperativa() > 0 ? String.valueOf(intPratica.getUnitaOperativa()) : StringPool.BLANK %>
+
+
<%
WorkflowTask workflowTask = WorkflowUtil.getLastCompletedTask(controlloPratica.getCompanyId(),controlloPratica.getGroupId(), null, controlloPratica);
diff --git a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/Constants.java b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/Constants.java
index 8e7fe62b..aff11256 100644
--- a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/Constants.java
+++ b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/Constants.java
@@ -1,128 +1,118 @@
package it.tref.liferay.portos.bo.shared.util;
import java.util.HashMap;
+import java.util.Map;
public class Constants implements com.liferay.portal.kernel.util.Constants {
- public static final String ZONA_1 = "1";
- public static final String ZONA_2 = "2";
- public static final String ZONA_3 = "3";
- public static final String ZONA_4 = "4";
-
- public static final String FASCIA_A = "A";
- public static final String FASCIA_B = "B";
- public static final String FASCIA_C = "C";
-
- public static final String PROCEDURA_P0 = "P0";
- public static final String PROCEDURA_P1 = "P1";
- public static final String PROCEDURA_P2 = "P2";
- public static final String PROCEDURA_P3 = "P3";
- public static final String PROCEDURA_P4 = "P4";
- public static final String PROCEDURA_P5 = "P5";
- public static final String PROCEDURA_P6 = "P6";
- public static final String PROCEDURA_P7 = "P7";
- public static final String PROCEDURA_P8 = "P8";
- public static final String PROCEDURA_P9 = "P9";
- public static final String PROCEDURA_P10 = "P10";
-
- public static final String TIPO_PRATICA_DEPOSITO = "01";
- public static final String TIPO_PRATICA_AUTORIZZAZIONE = "02";
- public static final String TIPO_PRATICA_SANATORIA = "03";
-
- //Bug 33461
-// public static final String TIPO_PRATICA_OPERE_MINORE_IMPORTANZA = "05";
-
- public static final HashMap PRATICA_ZONE = new HashMap() {
- {
- put(ZONA_3, TIPO_PRATICA_DEPOSITO);
- put(ZONA_4, TIPO_PRATICA_DEPOSITO);
- put(ZONA_2, TIPO_PRATICA_AUTORIZZAZIONE);
- put(ZONA_1, TIPO_PRATICA_AUTORIZZAZIONE);
-
- put(PROCEDURA_P0, TIPO_PRATICA_AUTORIZZAZIONE);
- put(PROCEDURA_P1, TIPO_PRATICA_AUTORIZZAZIONE);
- put(PROCEDURA_P2, TIPO_PRATICA_AUTORIZZAZIONE);
- put(PROCEDURA_P3, TIPO_PRATICA_AUTORIZZAZIONE);
- put(PROCEDURA_P4, TIPO_PRATICA_AUTORIZZAZIONE);
- put(PROCEDURA_P5, TIPO_PRATICA_AUTORIZZAZIONE);
- put(PROCEDURA_P6, TIPO_PRATICA_AUTORIZZAZIONE);
- put(PROCEDURA_P7, TIPO_PRATICA_AUTORIZZAZIONE);
- put(PROCEDURA_P8, TIPO_PRATICA_AUTORIZZAZIONE);
- put(PROCEDURA_P9, TIPO_PRATICA_AUTORIZZAZIONE);
- put(PROCEDURA_P10, TIPO_PRATICA_AUTORIZZAZIONE);
-
- }
- };
-
-// public static final String TIPO_PRATICA_DEPOSITO_CO = TIPO_PRATICA_DEPOSITO + "_CO";
-
- public static final String FIRMA = "FIRMA";
-
- public static final String[] AMMINISTRAZIONE_CSV_HEADERS_COMUNI = {"Codice Regione", "Codice Città Metropolitana",
- "Codice Provincia (1)", "Progressivo del Comune (2)", "Codice Comune formato alfanumerico",
- "Denominazione in italiano", "Denominazione in tedesco", "Codice Ripartizione Geografica",
- "Ripartizione geografica", "Denominazione regione", "Denominazione Città metropolitana",
- "Denominazione provincia", "Flag Comune capoluogo di provincia", "Sigla automobilistica",
- "Codice Comune formato numerico", "Codice Comune numerico con 110 province (dal 2010 al 2016)",
- "Codice Comune numerico con 107 province (dal 2006 al 2009)",
- "Codice Comune numerico con 103 province (dal 1995 al 2005)", "Codice Catastale del comune",
- "Popolazione legale 2011 (09/10/2011)", "Codice NUTS1 2010", "Codice NUTS2 2010 (3) ", "Codice NUTS3 2010",
- "Codice NUTS1 2006", "Codice NUTS2 2006 (3)", "Codice NUTS3 2006"};
-
- public static final String[] AMMINISTRAZIONE_CSV_HEADERS_PROVINCE = {"codice_provincia", "provincia", "regione",
- "sigla"};
- // public static final String CHECK_FIRMA = "checkFirma";
- // public static final String ASSOCIATE_WITH_WORKFLOW = "associateWithWorkflow";
- // public static final String ADD_UPLOAD_FILE_AVVISO = "addUploadFileAvviso";
- //
- // public static final String PROTOCOLLO_KEY_DB = "protocollo.key.db";
- // public static final String PROTOCOLLO_AVVISO_KEY_DB = "protocollo.avviso.key.db";
-
- // public static final String NOME_VOCABOLARIO = "Genio Civile";
- // public static final String NOME_VOCABOLARIO_STATO = "Stato Attuale";
- //
- // public static final String CUSTOM_FIELD_TABLE_NAME = ExpandoTableConstants.DEFAULT_TABLE_NAME;
- // public static final String CUSTOM_FIELD_GC_USERID = "GC_USERID";
-
- public static final String ROLE_NAME_GEOLOGO = "portos_geologo";
- public static final String ROLE_NAME_FIRMA = "portos_firma";
- public static final String ROLE_NAME_FIRMA_DIRIGENTE = "portos_firma_dirigente";
- public static final String ROLE_NAME_FIRMA_PO = "portos_firma_po";
- public static final String ROLE_NAME_ASSEGNATORE = "portos_assegnatore";
- public static final String ROLE_NAME_APPROVATORE = "portos_approvatore";
- public static final String ROLE_NAME_ISTRUTTORE = "portos_istruttore";
-
-
- public static final String COMPANY_CUSTOM_FIELD_VERSIONING_CHANGES = "VERSIONING CHANGES URL";
- public static final String COMPANY_CUSTOM_FIELD_VERSIONING_SNAPSHOTS = "VERSIONING SNAPSHOT URL";
- public static final String COMPANY_CUSTOM_FIELD_VERSIONING_SNAPSHOTS_COUNT = "VERSIONING SNAPSHOT COUNT URL";
- public static final String COMPANY_CUSTOM_FIELD_VERSIONING_COMMIT = "VERSIONING COMMIT URL";
- public static final String COMPANY_CUSTOM_FIELD_VERSIONING_CHANGES_URL = "http://172.16.20.148:8080/portos-versioning/v1/fascicolo/changes/";
- public static final String COMPANY_CUSTOM_FIELD_VERSIONING_SNAPSHOTS_URL = "http://172.16.20.148:8080/portos-versioning/v1/fascicolo/snapshots/";
- public static final String COMPANY_CUSTOM_FIELD_VERSIONING_SNAPSHOTS_COUNT_URL = "http://172.16.20.148:8080/portos-versioning/v1/fascicolo/snapshots/count/";
- public static final String COMPANY_CUSTOM_FIELD_VERSIONING_COMMIT_URL = "http://172.16.20.148:8080/portos-versioning/v1/fascicolo/commit/";
-
- // Manifattura Web Group, mofidica per rendere la dimensione massima degli allegati configurabile
- // da pannello di controllo. In origine era hardcoded a 20971520 byte.
- public static final String COMPANY_CUSTOM_FIELD_DIMENSIONE_MASSIMA_ALLEGATI_IN_MIB = "DIMENSIONE MASSIMA ALLEGATI IN MIB";
- public static final String COMPANY_CUSTOM_FIELD_DIMENSIONE_MASSIMA_ALLEGATI_DEFAULT = "100";
-
- public static final String COMPANY_CUSTOM_FIELD_LINK_SEED = "SEED PER LINK DINAMICI";
-
- public static final int DETTPRATICA_VERSION_IMPL = 1;
-
- public static final String COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_INIZIALE_LABEL = "CODICE PROTOCOLLAZIONE INZIALE";
- public static final String COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_SEGUENTE_LABEL = "CODICE PROTOCOLLAZIONE SEGUENTE";
-
- public static final String COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_INIZIALE_VALUE = "AOOGRT/SISMICA";
-
- public static final String COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_SEGUENTE_VALUE = "N.060.100";
-
- public static final String ORG_CUSTOM_FIELD_PO = "nome_cognome_po";
-
- public static final String CF_ORGANIZATION_MEMBERSHIP = "cf_organization_membership";
-
- public static final String GESTIONE_PRATICA_URL_FE = "url-fe-gestione-pratica";
- public static final String GESTIONE_PRATICA_URL_BO = "url-bo-gestione-pratica";
-
+ public static final String ZONA_1 = "1";
+ public static final String ZONA_2 = "2";
+ public static final String ZONA_3 = "3";
+ public static final String ZONA_4 = "4";
+
+ public static final String FASCIA_A = "A";
+ public static final String FASCIA_B = "B";
+ public static final String FASCIA_C = "C";
+
+ public static final String PROCEDURA_P0 = "P0";
+ public static final String PROCEDURA_P1 = "P1";
+ public static final String PROCEDURA_P2 = "P2";
+ public static final String PROCEDURA_P3 = "P3";
+ public static final String PROCEDURA_P4 = "P4";
+ public static final String PROCEDURA_P5 = "P5";
+ public static final String PROCEDURA_P6 = "P6";
+ public static final String PROCEDURA_P7 = "P7";
+ public static final String PROCEDURA_P8 = "P8";
+ public static final String PROCEDURA_P9 = "P9";
+ public static final String PROCEDURA_P10 = "P10";
+
+ public static final String TIPO_PRATICA_DEPOSITO = "01";
+ public static final String TIPO_PRATICA_AUTORIZZAZIONE = "02";
+ public static final String TIPO_PRATICA_SANATORIA = "03";
+
+ @SuppressWarnings("serial")
+ public static final Map PRATICA_ZONE = new HashMap() {
+ {
+ put(ZONA_3, TIPO_PRATICA_DEPOSITO);
+ put(ZONA_4, TIPO_PRATICA_DEPOSITO);
+ put(ZONA_2, TIPO_PRATICA_AUTORIZZAZIONE);
+ put(ZONA_1, TIPO_PRATICA_AUTORIZZAZIONE);
+
+ put(PROCEDURA_P0, TIPO_PRATICA_AUTORIZZAZIONE);
+ put(PROCEDURA_P1, TIPO_PRATICA_AUTORIZZAZIONE);
+ put(PROCEDURA_P2, TIPO_PRATICA_AUTORIZZAZIONE);
+ put(PROCEDURA_P3, TIPO_PRATICA_AUTORIZZAZIONE);
+ put(PROCEDURA_P4, TIPO_PRATICA_AUTORIZZAZIONE);
+ put(PROCEDURA_P5, TIPO_PRATICA_AUTORIZZAZIONE);
+ put(PROCEDURA_P6, TIPO_PRATICA_AUTORIZZAZIONE);
+ put(PROCEDURA_P7, TIPO_PRATICA_AUTORIZZAZIONE);
+ put(PROCEDURA_P8, TIPO_PRATICA_AUTORIZZAZIONE);
+ put(PROCEDURA_P9, TIPO_PRATICA_AUTORIZZAZIONE);
+ put(PROCEDURA_P10, TIPO_PRATICA_AUTORIZZAZIONE);
+
+ }
+ };
+
+ // public static final String TIPO_PRATICA_DEPOSITO_CO =
+ // TIPO_PRATICA_DEPOSITO + "_CO";
+
+ public static final String FIRMA = "FIRMA";
+
+ public static final String[] AMMINISTRAZIONE_CSV_HEADERS_COMUNI = { "Codice Regione",
+ "Codice Città Metropolitana", "Codice Provincia (1)", "Progressivo del Comune (2)",
+ "Codice Comune formato alfanumerico", "Denominazione in italiano", "Denominazione in tedesco",
+ "Codice Ripartizione Geografica", "Ripartizione geografica", "Denominazione regione",
+ "Denominazione Città metropolitana", "Denominazione provincia",
+ "Flag Comune capoluogo di provincia", "Sigla automobilistica", "Codice Comune formato numerico",
+ "Codice Comune numerico con 110 province (dal 2010 al 2016)",
+ "Codice Comune numerico con 107 province (dal 2006 al 2009)",
+ "Codice Comune numerico con 103 province (dal 1995 al 2005)", "Codice Catastale del comune",
+ "Popolazione legale 2011 (09/10/2011)", "Codice NUTS1 2010", "Codice NUTS2 2010 (3) ",
+ "Codice NUTS3 2010", "Codice NUTS1 2006", "Codice NUTS2 2006 (3)", "Codice NUTS3 2006" };
+
+ public static final String[] AMMINISTRAZIONE_CSV_HEADERS_PROVINCE = { "codice_provincia", "provincia",
+ "regione", "sigla" };
+
+ public static final String ROLE_NAME_GEOLOGO = "portos_geologo";
+ public static final String ROLE_NAME_FIRMA = "portos_firma";
+ public static final String ROLE_NAME_FIRMA_DIRIGENTE = "portos_firma_dirigente";
+ public static final String ROLE_NAME_FIRMA_PO = "portos_firma_po";
+ public static final String ROLE_NAME_ASSEGNATORE = "portos_assegnatore";
+ public static final String ROLE_NAME_APPROVATORE = "portos_approvatore";
+ public static final String ROLE_NAME_ISTRUTTORE = "portos_istruttore";
+
+ public static final String COMPANY_CUSTOM_FIELD_VERSIONING_CHANGES = "VERSIONING CHANGES URL";
+ public static final String COMPANY_CUSTOM_FIELD_VERSIONING_SNAPSHOTS = "VERSIONING SNAPSHOT URL";
+ public static final String COMPANY_CUSTOM_FIELD_VERSIONING_SNAPSHOTS_COUNT = "VERSIONING SNAPSHOT COUNT URL";
+ public static final String COMPANY_CUSTOM_FIELD_VERSIONING_COMMIT = "VERSIONING COMMIT URL";
+ public static final String COMPANY_CUSTOM_FIELD_VERSIONING_CHANGES_URL = "http://172.16.20.148:8080/portos-versioning/v1/fascicolo/changes/";
+ public static final String COMPANY_CUSTOM_FIELD_VERSIONING_SNAPSHOTS_URL = "http://172.16.20.148:8080/portos-versioning/v1/fascicolo/snapshots/";
+ public static final String COMPANY_CUSTOM_FIELD_VERSIONING_SNAPSHOTS_COUNT_URL = "http://172.16.20.148:8080/portos-versioning/v1/fascicolo/snapshots/count/";
+ public static final String COMPANY_CUSTOM_FIELD_VERSIONING_COMMIT_URL = "http://172.16.20.148:8080/portos-versioning/v1/fascicolo/commit/";
+
+ // Manifattura Web Group, mofidica per rendere la dimensione massima degli
+ // allegati configurabile da pannello di controllo. In origine era hardcoded
+ // a 20971520 byte.
+ public static final String COMPANY_CUSTOM_FIELD_DIMENSIONE_MASSIMA_ALLEGATI_IN_MIB = "DIMENSIONE MASSIMA ALLEGATI IN MIB";
+ public static final String COMPANY_CUSTOM_FIELD_DIMENSIONE_MASSIMA_ALLEGATI_DEFAULT = "100";
+
+ public static final String COMPANY_CUSTOM_FIELD_LINK_SEED = "SEED PER LINK DINAMICI";
+
+ public static final int DETTPRATICA_VERSION_IMPL = 1;
+
+ public static final String COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_INIZIALE_LABEL = "CODICE PROTOCOLLAZIONE INZIALE";
+ public static final String COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_SEGUENTE_LABEL = "CODICE PROTOCOLLAZIONE SEGUENTE";
+
+ public static final String COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_INIZIALE_VALUE = "AOOGRT/SISMICA";
+
+ public static final String COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_SEGUENTE_VALUE = "N.060.100";
+
+ public static final String ORG_CUSTOM_FIELD_PO = "nome_cognome_po";
+
+ public static final String CF_ORGANIZATION_MEMBERSHIP = "cf_organization_membership";
+
+ public static final String GESTIONE_PRATICA_URL_FE = "url-fe-gestione-pratica";
+ public static final String GESTIONE_PRATICA_URL_BO = "url-bo-gestione-pratica";
+
+ public static final String USER_CUSTOM_FIELD_UNITA_OPERATIVE = "unita_operative";
}
diff --git a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/UnitaOperativeUtil.java b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/UnitaOperativeUtil.java
new file mode 100644
index 00000000..8fb04cd8
--- /dev/null
+++ b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/UnitaOperativeUtil.java
@@ -0,0 +1,18 @@
+package it.tref.liferay.portos.bo.shared.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.liferay.portal.model.User;
+
+public class UnitaOperativeUtil {
+ public static List getUnitaOperative(User user) {
+ List ret = new ArrayList<>();
+ short uo[] = (short[]) user.getExpandoBridge().getAttribute(
+ Constants.USER_CUSTOM_FIELD_UNITA_OPERATIVE);
+ for (int i = 0; i < uo.length; i++) {
+ ret.add((int) uo[i]);
+ }
+ return ret;
+ }
+}
diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.classpath b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.classpath
index 9befaa9a..2a003476 100644
--- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.classpath
+++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.classpath
@@ -22,7 +22,7 @@
-
-
+
+
diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp
index 3fc0a917..78199622 100644
--- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp
+++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp
@@ -1,12 +1,7 @@
-<%@page import="com.liferay.portal.kernel.util.HtmlUtil"%>
-<%@page import="java.io.Serializable"%>
-<%@page import="java.nio.file.Files"%>
-<%@page import="java.nio.file.Path"%>
-<%@page import="java.io.File"%>
-<%@page import="com.liferay.portal.kernel.log.LogFactoryUtil"%>
-<%@page import="com.liferay.portal.kernel.log.Log"%>
-<%@page import="java.nio.file.Paths"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@page import="java.io.Serializable"%>
+<%@page import="java.util.List"%>
+<%@page import="java.util.Map"%>
<%@page import="com.liferay.portal.kernel.util.MapUtil"%>
<%@page import="com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalServiceUtil"%>
<%@page import="java.util.Map.Entry"%>
diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java
index 890600aa..87bf9fe2 100644
--- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java
+++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java
@@ -170,6 +170,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
.getParameter("kaleo--esito--").trim() : "";
String testoDocumento = httpServletRequest.getParameter("kaleo--testo_del_documento--") != null ? httpServletRequest
.getParameter("kaleo--testo_del_documento--") : "";
+
if (!valoriAmmessi.contains(esito)
|| ((esito.equalsIgnoreCase(StatoPraticaConstants.INTEGRAZIONE) || esito
.equalsIgnoreCase(StatoPraticaConstants.PREAVVISO_CONTRARIO)) && testoDocumento
diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/RenderFormTaskPortletAction.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/RenderFormTaskPortletAction.java
index a47a1e6c..9750effd 100644
--- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/RenderFormTaskPortletAction.java
+++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/RenderFormTaskPortletAction.java
@@ -53,8 +53,6 @@ import com.liferay.portlet.dynamicdatamapping.util.DDMXSDUtil;
public class RenderFormTaskPortletAction extends BaseStrutsPortletAction {
- private static Log _log = LogFactoryUtil.getLog(RenderFormTaskPortletAction.class);
-
@Override
public String render(PortletConfig portletConfig, RenderRequest renderRequest,
RenderResponse renderResponse) throws Exception {
@@ -115,7 +113,6 @@ public class RenderFormTaskPortletAction extends BaseStrutsPortletAction {
// ADT BUG BO id = 27
String classPkForCarichiLavoro = ParamUtil.getString(renderRequest, "classPkForCarichiLavoro");
- _log.info("classPkForCarichiLavoro = " + classPkForCarichiLavoro);
boolean checkVisualizzaCarichiLavoro = (ddmTemplateId == 21699 || ddmTemplateId == 21705);
if (checkVisualizzaCarichiLavoro) {
renderRequest.setAttribute("classPkForCarichiLavoro", classPkForCarichiLavoro);
@@ -125,7 +122,6 @@ public class RenderFormTaskPortletAction extends BaseStrutsPortletAction {
parameters.remove("esito");
parameters.remove("testo_del_documento");
}
- // ///////////////
return "/portlet/workflow_tasks/render_form_task.jsp";
}
diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java
index c0ab224f..73ca910b 100644
--- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java
+++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java
@@ -21,6 +21,8 @@ import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.json.JSONDeserializer;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
+import com.liferay.portal.kernel.log.Log;
+import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.StringUtil;
@@ -40,6 +42,7 @@ import com.liferay.portal.workflow.kaleo.runtime.action.ActionExecutorUtil;
import com.liferay.portal.workflow.kaleo.service.KaleoTaskInstanceTokenLocalServiceUtil;
public class WorkflowUtil {
+ private static Log _log = LogFactoryUtil.getLog(WorkflowUtil.class);
public static Map executeOnOpenForm(long companyId, long workflowTaskId,
long assigneeUserId, String transitionName) throws PortalException, SystemException {
@@ -202,7 +205,12 @@ public class WorkflowUtil {
String parameterName = name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(),
name.length() - WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length());
+ String[] values = ParamUtil.getParameterValues(portletRequest, name);
+ for (int i = 0; i < values.length; i++) {
+ _log.info(name + "[" + i + "] = \"" + values[i] + "\"");
+ }
String value = StringUtil.merge(ParamUtil.getParameterValues(portletRequest, name));
+ _log.info("Finale \"" + value + "\"");
formParameters.put(parameterName, value);
}
diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties
index 0217ce0b..a62e53ab 100644
--- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties
+++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties
@@ -13,8 +13,8 @@
##
build.namespace=Kaleo
- build.number=14
- build.date=1607618436751
+ build.number=15
+ build.date=1610444335225
build.auto.upgrade=true
##