Sfoglia il codice sorgente

filtri bo e fe

master
Mattia Gosetto 3 anni fa
parent
commit
e6ac396db5
  1. 16
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/ControlloPraticaAdvancedSearch.java
  2. 15
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/IntPraticaAdvancedSearch.java
  3. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PortosIndexField.java
  4. 20
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java
  5. 16
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java
  6. 65
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/FascicoloPortlet.java
  7. 211
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaIstruttorePortlet.java
  8. 66
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java
  9. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  10. 22
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp
  11. 23
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/advanced_search.jsp
  12. 173
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/advanced_search.jsp
  13. 44
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp

16
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/ControlloPraticaAdvancedSearch.java

@ -522,6 +522,8 @@ public class ControlloPraticaAdvancedSearch {
String dataAl = ParamUtil.getString(request, "dataRichiestaFine");
String comune = ParamUtil.getString(request, "comune");
String tipoAttivita = ParamUtil.getString(request, "tipoAttivita");
Long geologi = ParamUtil.getLong(request, "geologi");
Long parereGeologo = ParamUtil.getLong(request, "parereGeologo");
// ADT - BUG-11 Aggiunta filtro ricerca
String controlloObbligatorioSearch = ParamUtil.getString(request, "controlloObbligatorio");
try {
@ -596,6 +598,18 @@ public class ControlloPraticaAdvancedSearch {
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(geologi) && !geologi.equals(-1L) && !geologi.equals(0L)) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "geologi",
geologi);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(parereGeologo) && !parereGeologo.equals(-1L)) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "parereGeologo",
parereGeologo);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(unitaOperativa) && !unitaOperativa.equals("-1")) {
TermQuery uoQuery = TermQueryFactoryUtil.create(searchContext, "unitaOperativa",
unitaOperativa);
@ -633,8 +647,6 @@ public class ControlloPraticaAdvancedSearch {
booleanQuery.add(controlloObbligatorioTermQuery, BooleanClauseOccur.MUST);
}
_log.info("Query backend" + booleanQuery.toString());
} catch (ParseException | java.text.ParseException e) {
_log.error(e, e);
}

15
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/search/IntPraticaAdvancedSearch.java

@ -271,6 +271,8 @@ public class IntPraticaAdvancedSearch {
String istruttoreId = ParamUtil.getString(request, "istruttore");
String unitaOperativa = ParamUtil.getString(request, "unitaOperativa");
Long geologi = ParamUtil.getLong(request, "geologi");
Long parereGeologo = ParamUtil.getLong(request, "parereGeologo");
try {
TermQuery termQuery;
@ -332,7 +334,18 @@ public class IntPraticaAdvancedSearch {
booleanQuery.add(uoQuery, BooleanClauseOccur.MUST);
}
_log.info("Query frontend" + booleanQuery.toString());
if (Validator.isNotNull(geologi) && !geologi.equals(-1L) && !geologi.equals(0L)) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "geologi",
geologi);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(parereGeologo) && !parereGeologo.equals(-1L)) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "parereGeologo",
parereGeologo);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
} catch (ParseException | java.text.ParseException e) {
_log.error(e, e);
}

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/PortosIndexField.java

@ -48,6 +48,7 @@ public class PortosIndexField implements Serializable {
public static final String PROPRIETARIO_DIGITALE_FULL_NAME = "proprietarioDigitaleFullName";
public static final String ISTRUTTORE_USERNAME = "istruttoreUsername";
public static final String PARERE_GEOLOGO = "parereGeologo";
public static final String GEOLOGI = "geologi";
public static final String COMUNE_ID = "comuneId";
public static final String COMUNE_DENOMINAZIONE = "comuneDenominazione";
public static final String PROVINCIA_ID = "provinciaId";

20
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java

@ -4,6 +4,7 @@ import it.tref.liferay.portos.bo.model.Comune;
import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.model.DettPratica;
import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.model.ParereGeologo;
import it.tref.liferay.portos.bo.model.Provincia;
import it.tref.liferay.portos.bo.model.Soggetto;
import it.tref.liferay.portos.bo.model.Territorio;
@ -11,6 +12,7 @@ import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ParereGeologoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil;
@ -114,7 +116,7 @@ public class ControlloPraticaIndexer extends BaseIndexer {
document.addKeyword("entryClassName", ControlloPratica.class.getName());
document.addKeyword(PortosIndexField.CONTROLLO_PRATICA_ID, controlloPraticaFromDB.getControlloPraticaId());
document.addKeyword(PortosIndexField.DETT_PRATICA_ID, controlloPraticaFromDB.getDettPraticaId());
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, controlloPraticaFromDB.getParereGeologo());
//document.addKeyword(PortosIndexField.PARERE_GEOLOGO, controlloPraticaFromDB.getParereGeologo());
document.addKeyword(PortosIndexField.STATUS, controlloPraticaFromDB.getStatus());
document.addKeyword(PortosIndexField.STATUS_BY_USERID, controlloPraticaFromDB.getStatusByUserId());
document.addKeyword(PortosIndexField.STATUS_BY_USERNAME, controlloPraticaFromDB.getStatusByUserName());
@ -124,6 +126,22 @@ public class ControlloPraticaIndexer extends BaseIndexer {
} else {
document.addKeyword(PortosIndexField.STATUS_DATE, 0);
}
List<ParereGeologo> listaParereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId(
controlloPraticaFromDB.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS);
List<Long> idGeologi = new ArrayList<Long>();
for(ParereGeologo geo : listaParereGeologo){
idGeologi.add(geo.getGeologoUserId());
}
if (Validator.isNotNull(listaParereGeologo) && !listaParereGeologo.isEmpty()) {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, 1L);
} else {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, 0L);
}
document.addNumber(PortosIndexField.GEOLOGI, idGeologi.toArray(new Long[0]));
document.addKeyword(PortosIndexField.DATA_INIZIO_PROCEDIMENTO,
DATE_FORMAT.format(controlloPraticaFromDB.getCreateDate()));
document.addKeywordSortable(PortosIndexField.DATA_INIZIO_PROCEDIMENTO,

16
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java

@ -29,6 +29,7 @@ import java.util.Locale;
import javax.portlet.PortletURL;
import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log;
@ -252,12 +253,21 @@ public class IntPraticaIndexer extends BaseIndexer {
document.addKeyword(PortosIndexField.UNITA_OPERATIVA, intPraticaFromDB.getUnitaOperativa());
// Gestione Parere Geologo
List<ParereGeologo> listaParereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId(
intPratica.getIntPraticaId(), 0, 1);
intPratica.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS);
List<Long> idGeologi = new ArrayList<Long>();
for(ParereGeologo geo : listaParereGeologo){
idGeologi.add(geo.getGeologoUserId());
}
document.addNumber(PortosIndexField.GEOLOGI, idGeologi.toArray(new Long[0]));
if (Validator.isNotNull(listaParereGeologo) && !listaParereGeologo.isEmpty()) {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, StringPool.TRUE);
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, 1L);
} else {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, StringPool.FALSE);
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, 0L);
}
// Gestione pratica sospesa
document.addKeyword(PortosIndexField.STATUS_SOSPESA, intPraticaFromDB.isSospesa());
// Gestione Diverse tipologie di IntPratica MIEI PROGETTI && ARCHIVIO PROGETTI

65
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/FascicoloPortlet.java

@ -260,7 +260,8 @@ public class FascicoloPortlet extends MVCPortlet {
String tipoIntervento = actionRequest.getParameter("tipoIntervento");
String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura");
String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa");
String geologo = ParamUtil.getString(actionRequest, "geologo");
String geologi = ParamUtil.getString(actionRequest, "geologi");
String parereGeologo = ParamUtil.getString(actionRequest, "parereGeologo");
String istruttore = ParamUtil.getString(actionRequest, "istruttore");
if (Validator.isNotNull(dataRichiestaInizio)) {
@ -316,7 +317,8 @@ public class FascicoloPortlet extends MVCPortlet {
actionResponse.setRenderParameter("tipoProcedura", tipoProcedura);
actionResponse.setRenderParameter("unitaOperativa", unitaOperativa);
actionResponse.setRenderParameter("geologo", geologo);
actionResponse.setRenderParameter("geologi", geologi);
actionResponse.setRenderParameter("parereGeologo", parereGeologo);
actionResponse.setRenderParameter("istruttore", istruttore);
}
@ -481,44 +483,39 @@ public class FascicoloPortlet extends MVCPortlet {
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("geologo".equals(id)) {
Integer uoId = ParamUtil.getInteger(resourceRequest, "uoId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
if (Validator.isNotNull(uoId) && !uoId.equals("-1")) {
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
List<User> geologi = new ArrayList<User>();
for(Organization org : organizationList) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo");
List<User> geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId());
for (User userGroupRole : geologiUsers) {
List<Integer> unitaOperativeGeologo = UnitaOperativeUtil.getUnitaOperative(userGroupRole);
if(unitaOperativeGeologo.contains(uoId)){
if (geologi.isEmpty()) {
geologi.add(userGroupRole);
} else {
boolean isPresent = false;
for(User geo : geologi) {
if (geo.getUserId() == userGroupRole.getUserId()) {
isPresent = true;
break;
}
}
if(!isPresent){
geologi.add(userGroupRole);
}
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
List<User> geologi = new ArrayList<User>();
for(Organization org : organizationList) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo");
List<User> geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId());
for (User userGroupRole : geologiUsers) {
if (geologi.isEmpty()) {
geologi.add(userGroupRole);
} else {
boolean isPresent = false;
for(User geo : geologi) {
if (geo.getUserId() == userGroupRole.getUserId()) {
isPresent = true;
break;
}
}
if(!isPresent){
geologi.add(userGroupRole);
}
}
}
for (User geo : geologi) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("geologoId", geo.getUserId());
jsonObject.put("descLong", geo.getFullName());
jsonArray.put(jsonObject);
}
}
for (User geo : geologi) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("geologoId", geo.getUserId());
jsonObject.put("descLong", geo.getFullName());
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);

211
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaIstruttorePortlet.java

@ -15,13 +15,17 @@ import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.bean.IstruttoreBean;
import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil;
import it.tref.liferay.portos.bo.shared.util.UnitaOperativeUtil;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
@ -52,7 +56,14 @@ import com.liferay.portal.kernel.util.PropsUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.model.Organization;
import com.liferay.portal.model.Role;
import com.liferay.portal.model.User;
import com.liferay.portal.model.UserGroupRole;
import com.liferay.portal.service.OrganizationLocalServiceUtil;
import com.liferay.portal.service.RoleLocalServiceUtil;
import com.liferay.portal.service.UserGroupRoleLocalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.theme.ThemeDisplay;
import com.liferay.portal.util.PortalUtil;
import com.liferay.util.bridges.mvc.MVCPortlet;
@ -91,7 +102,8 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura");
String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa");
String provincia = ParamUtil.getString(actionRequest, "provincia");
String geologo = ParamUtil.getString(actionRequest, "geologo");
String geologi = ParamUtil.getString(actionRequest, "geologi");
String parereGeologo = ParamUtil.getString(actionRequest, "parereGeologo");
String istruttore = ParamUtil.getString(actionRequest, "istruttore");
actionResponse.setRenderParameter("numeroProgetto", numeroProgetto);
@ -117,7 +129,8 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
actionResponse.setRenderParameter("tipoProcedura", tipoProcedura);
actionResponse.setRenderParameter("unitaOperativa", unitaOperativa);
actionResponse.setRenderParameter("provincia", provincia);
actionResponse.setRenderParameter("geologo", geologo);
actionResponse.setRenderParameter("geologi", geologi);
actionResponse.setRenderParameter("parereGeologo", parereGeologo);
actionResponse.setRenderParameter("istruttore", istruttore);
}
@ -251,38 +264,180 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
}
// ADT BUG-ID=16 Sezione Pratiche Assegnate
User user = themeDisplay.getUser();
if ("comuniForUfficio".equals(resourceId)) {
String ufficio = ParamUtil.getString(resourceRequest, "ufficioId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
List<Comune> comuni;
if (Validator.isNotNull(ufficio) && !ufficio.equals("0")) {
try {
if (!ufficio.equals("-1")) {
long ufficioId = Long.parseLong(ufficio);
comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserIdUfficioId(user.getUserId(),
ufficioId);
for (Comune comune : comuni) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("comuneId", comune.getComuneId());
jsonObject.put("descLong", comune.getDenominazione());
jsonArray.put(jsonObject);
try{
if ("comuniForUfficio".equals(resourceId)) {
String ufficio = ParamUtil.getString(resourceRequest, "ufficioId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
List<Comune> comuni;
if (Validator.isNotNull(ufficio) && !ufficio.equals("0")) {
try {
if (!ufficio.equals("-1")) {
long ufficioId = Long.parseLong(ufficio);
comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserIdUfficioId(user.getUserId(),
ufficioId);
for (Comune comune : comuni) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("comuneId", comune.getComuneId());
jsonObject.put("descLong", comune.getDenominazione());
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
} else {
comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserId(user.getUserId());
for (Comune comune : comuni) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("comuneId", comune.getComuneId());
jsonObject.put("descLong", comune.getDenominazione());
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
} else {
comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserId(user.getUserId());
for (Comune comune : comuni) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("comuneId", comune.getComuneId());
jsonObject.put("descLong", comune.getDenominazione());
jsonArray.put(jsonObject);
} catch (Exception e) {
e.printStackTrace();
}
}
}else if ("province".equals(resourceId)) {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
List<String> province = TerritorioLocalServiceUtil.getActiveProvince();
for (String codiceProvincia : province) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(themeDisplay.getCompanyId(), codiceProvincia);
jsonObject.put("provinciaId", provincia.getCodiceProvincia());
jsonObject.put("descLong", provincia.getSigla() + " - " + provincia.getProvincia());
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("unitaOperative".equals(resourceId)) {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
for(int i=1; i<11; i++) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("uoId", i);
jsonObject.put("descLong", i);
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("comuni".equals(resourceId)) {
String provinciaId = ParamUtil.getString(resourceRequest, "provinciaId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
if (Validator.isNotNull(provinciaId) && !provinciaId.equals("0")) {
List<Long> comuniIds = TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(provinciaId);
List<Comune> comumeList = new ArrayList<Comune>();
for (long comuneId : comuniIds) {
Comune comune = ComuneLocalServiceUtil.getComune(comuneId);
comumeList.add(comune);
}
Collections.sort(comumeList, new Comparator<Comune>() {
@Override
public int compare(Comune o1, Comune o2) {
return o1.getDenominazione().compareTo(o2.getDenominazione());
}
});
for (Comune comune : comumeList) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("comuneId", comune.getComuneId());
jsonObject.put("descLong", comune.getDenominazione());
jsonArray.put(jsonObject);
}
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("istruttore".equals(resourceId)) {
Integer uoId = ParamUtil.getInteger(resourceRequest, "uoId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
if (Validator.isNotNull(uoId) && !uoId.equals("-1")) {
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
List<UserGroupRole> tecniciIstruttori = new ArrayList<UserGroupRole>();
for(Organization org : organizationList) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_istruttore");
List<UserGroupRole> istruttori = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(
org.getGroupId(), role.getRoleId());
for (UserGroupRole userGroupRole : istruttori) {
User istruttore = userGroupRole.getUser();
List<Integer> unitaOperativeIstruttore = UnitaOperativeUtil.getUnitaOperative(istruttore);
if(unitaOperativeIstruttore.contains(uoId)){
if (tecniciIstruttori.isEmpty()) {
tecniciIstruttori.add(userGroupRole);
} else {
boolean isPresent = false;
for(UserGroupRole tecnico : tecniciIstruttori) {
if (tecnico.getUserId() == userGroupRole.getUserId()) {
isPresent = true;
break;
}
}
if(!isPresent){
tecniciIstruttori.add(userGroupRole);
}
}
}
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}
} catch (Exception e) {
e.printStackTrace();
List<IstruttoreBean> tecniciIstruttoriSorted = new ArrayList<IstruttoreBean>();
for (UserGroupRole tecnico : tecniciIstruttori) {
IstruttoreBean istruttore = new IstruttoreBean();
istruttore.setIdIstruttore(tecnico.getUserId());
istruttore.setDenominazione(tecnico.getUser().getFullName());
tecniciIstruttoriSorted.add(istruttore);
}
Collections.sort(tecniciIstruttoriSorted);
for (IstruttoreBean istruttore : tecniciIstruttoriSorted) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("istruttoreId", istruttore.getIdIstruttore());
jsonObject.put("descLong", istruttore.getDenominazione());
jsonArray.put(jsonObject);
}
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("geologo".equals(resourceId)) {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
List<User> geologi = new ArrayList<User>();
for(Organization org : organizationList) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo");
List<User> geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId());
for (User userGroupRole : geologiUsers) {
if (geologi.isEmpty()) {
geologi.add(userGroupRole);
} else {
boolean isPresent = false;
for(User geo : geologi) {
if (geo.getUserId() == userGroupRole.getUserId()) {
isPresent = true;
break;
}
}
if(!isPresent){
geologi.add(userGroupRole);
}
}
}
}
for (User geo : geologi) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("geologoId", geo.getUserId());
jsonObject.put("descLong", geo.getFullName());
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}
}catch (Exception e) {
_log.error(e, e);
throw new IOException(e);
}
super.serveResource(resourceRequest, resourceResponse);
}
}

66
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java

@ -108,7 +108,9 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura");
String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa");
String provincia = ParamUtil.getString(actionRequest, "provincia");
String geologo = ParamUtil.getString(actionRequest, "geologo");
String geologi = ParamUtil.getString(actionRequest, "geologi");
String parereGeologo = ParamUtil.getString(actionRequest, "parereGeologo");
actionResponse.setRenderParameter("tabs1", tabs1);
actionResponse.setRenderParameter("numeroProgetto", numeroProgetto);
actionResponse.setRenderParameter("protocollo", protocollo);
@ -148,7 +150,8 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
actionResponse.setRenderParameter("tipoProcedura", tipoProcedura);
actionResponse.setRenderParameter("unitaOperativa", unitaOperativa);
actionResponse.setRenderParameter("provincia", provincia);
actionResponse.setRenderParameter("geologo", geologo);
actionResponse.setRenderParameter("geologi", geologi);
actionResponse.setRenderParameter("parereGeologo", parereGeologo);
}
public void cambioIstruttore(ActionRequest actionRequest, ActionResponse actionResponse) {
@ -424,44 +427,39 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
writeJSON(resourceRequest, resourceResponse, jsonArray);
}else if ("geologo".equals(id)) {
Integer uoId = ParamUtil.getInteger(resourceRequest, "uoId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
if (Validator.isNotNull(uoId) && !uoId.equals("-1")) {
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
List<User> geologi = new ArrayList<User>();
for(Organization org : organizationList) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo");
List<User> geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId());
for (User userGroupRole : geologiUsers) {
List<Integer> unitaOperativeGeologo = UnitaOperativeUtil.getUnitaOperative(userGroupRole);
if(unitaOperativeGeologo.contains(uoId)){
if (geologi.isEmpty()) {
geologi.add(userGroupRole);
} else {
boolean isPresent = false;
for(User geo : geologi) {
if (geo.getUserId() == userGroupRole.getUserId()) {
isPresent = true;
break;
}
}
if(!isPresent){
geologi.add(userGroupRole);
}
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
List<User> geologi = new ArrayList<User>();
for(Organization org : organizationList) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo");
List<User> geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId());
for (User userGroupRole : geologiUsers) {
if (geologi.isEmpty()) {
geologi.add(userGroupRole);
} else {
boolean isPresent = false;
for(User geo : geologi) {
if (geo.getUserId() == userGroupRole.getUserId()) {
isPresent = true;
break;
}
}
if(!isPresent){
geologi.add(userGroupRole);
}
}
}
for (User geo : geologi) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("geologoId", geo.getUserId());
jsonObject.put("descLong", geo.getFullName());
jsonArray.put(jsonObject);
}
}
for (User geo : geologi) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("geologoId", geo.getUserId());
jsonObject.put("descLong", geo.getFullName());
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);

4
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties

@ -13,8 +13,8 @@
##
build.namespace=portos_bo
build.number=3277
build.date=1629883670001
build.number=3294
build.date=1629903256819
build.auto.upgrade=true
##

22
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp

@ -16,7 +16,7 @@ String provinciaSelect = ParamUtil.getString(renderRequest, "provincia");
String comuneSelect = ParamUtil.getString(renderRequest, "comune");
String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore");
String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa");
String geologoSelect = ParamUtil.getString(renderRequest, "geologo");
String geologoSelect = ParamUtil.getString(renderRequest, "geologi");
%>
<liferay-ui:panel title="filters" defaultState="closed"
id='<%= renderResponse.getNamespace() + scopeGroupId + "ricercaSaiPanel" %>' collapsible="true" extended="false"
@ -71,18 +71,21 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologo");
<aui:select name="istruttore" label="Istruttore" cssClass="istruttoreSelect" />
</div>
<!--
<div class="col-xs-12 col-md-3">
<aui:select name="geologo" label="Parere endoprocedimentale" cssClass="geologoSelect" />
<aui:select name="geologi" label="Parere endoprocedimentale" cssClass="geologoSelect" />
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="parereGeologo" label="Parere fornito">
<aui:option value="-1">Tutte</aui:option>
<aui:option value="1">Si</aui:option>
<aui:option value="0">No</aui:option>
</aui:select>
</div>
-->
</div>
<div class="row">
<div class="col-xs-12 col-md-4">
<div class="col-xs-12 col-md-12">
<aui:field-wrapper label="Data richiesta da" inlineField="true">
<liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>">
<liferay-util:param name="field" value="dataRichiestaInizio" />
@ -211,11 +214,8 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologo");
});
};
var getGeologo = function(callback, uoId) {
var getGeologo = function(callback) {
A.io.request('<%= getGeologoUrl %>', {
data: {
<portlet:namespace />uoId: uoId
},
dataType: 'json',
on: {
success: function() {
@ -260,7 +260,7 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologo");
selectVal: '<%= (Validator.isNotNull(istruttoreSelect) ? istruttoreSelect : "") %>'
},
{
select: '<portlet:namespace />geologo',
select: '<portlet:namespace />geologi',
selectData: getGeologo,
selectDesc: 'descLong',
selectId: 'geologoId',

23
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/advanced_search.jsp

@ -21,7 +21,7 @@ String provinciaSelect = ParamUtil.getString(renderRequest, "provincia");
String comuneSelect = ParamUtil.getString(renderRequest, "comune");
String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore");
String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa");
String geologoSelect = ParamUtil.getString(renderRequest, "geologo");
String geologoSelect = ParamUtil.getString(renderRequest, "geologi");
%>
<liferay-ui:panel title="filters" defaultState="closed"
id='<%= renderResponse.getNamespace() + scopeGroupId + "ricercaSaiPanel" %>' collapsible="true" extended="false"
@ -123,18 +123,22 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologo");
<aui:select name="istruttore" label="Istruttore" cssClass="istruttoreSelect" />
</div>
<!--
<div class="col-xs-12 col-md-3">
<aui:select name="geologo" label="Parere endoprocedimentale" cssClass="geologoSelect" />
<aui:select name="geologi" label="Parere endoprocedimentale" cssClass="geologoSelect" />
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="parereGeologo" label="Parere fornito">
<aui:option value="-1">Tutte</aui:option>
<aui:option value="1">Si</aui:option>
<aui:option value="0">No</aui:option>
</aui:select>
</div>
-->
</div>
<div class="row">
<div class="col-xs-12 col-md-4">
<div class="col-xs-12 col-md-12">
<aui:field-wrapper label="Data richiesta da" inlineField="true">
<liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>">
<liferay-util:param name="field" value="dataRichiestaInizio" />
@ -270,11 +274,8 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologo");
});
};
var getGeologo = function(callback, uoId) {
var getGeologo = function(callback) {
A.io.request('<%= getGeologoUrl %>', {
data: {
<portlet:namespace />uoId: uoId
},
dataType: 'json',
on: {
success: function() {
@ -319,7 +320,7 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologo");
selectVal: '<%= (Validator.isNotNull(istruttoreSelect) ? istruttoreSelect : "") %>'
},
{
select: '<portlet:namespace />geologo',
select: '<portlet:namespace />geologi',
selectData: getGeologo,
selectDesc: 'descLong',
selectId: 'geologoId',

173
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivitaistruttore/advanced_search.jsp

@ -33,6 +33,11 @@
</liferay-portlet:resourceURL>
<%
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
String provinciaSelect = ParamUtil.getString(renderRequest, "provincia");
String comuneSelect = ParamUtil.getString(renderRequest, "comune");
String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore");
String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa");
String geologoSelect = ParamUtil.getString(renderRequest, "geologi");
%>
<liferay-ui:panel title="filters" defaultState="closed" id='<%= renderResponse.getNamespace() + scopeGroupId +
"ricercaSaiPanel" %>' collapsible="true" extended="false" persistState="true">
@ -86,18 +91,21 @@ List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrgani
<aui:select name="istruttore" label="Istruttore" cssClass="istruttoreSelect" />
</div>
<!--
<div class="col-xs-12 col-md-3">
<aui:select name="geologo" label="Parere endoprocedimentale" cssClass="geologoSelect" />
<aui:select name="geologi" label="Parere endoprocedimentale" cssClass="geologoSelect" />
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="parereGeologo" label="Parere fornito">
<aui:option value="-1">Tutte</aui:option>
<aui:option value="1">Si</aui:option>
<aui:option value="0">No</aui:option>
</aui:select>
</div>
-->
</div>
<div class="row">
<div class="col-xs-12 col-md-4">
<div class="col-xs-12 col-md-12">
<aui:field-wrapper label="Data richiesta da" inlineField="true">
<liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>">
<liferay-util:param name="field" value="dataRichiestaInizio" />
@ -160,46 +168,125 @@ List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrgani
<aui:button type="button" href="<%= exportCVS.toString() %>" value="export" />
</div>
</liferay-ui:panel>
<%-- ADT BUG-ID=16 Sezione Pratiche Assegnate --%>
<liferay-portlet:resourceURL id="comuniForUfficio" var="getComuniURL" />
<aui:script use="aui-io-request">
$(".add-new-project__ufficio select").change(function() {
var comuni = '';
var val = $(this).val();
$(".add-new-project__comune select").empty();
A.io.request('<%= getComuniURL %>', {
data: {
<portlet:namespace />ufficioId: val
},
dataType: 'json',
on: {
success: function() {
$(".add-new-project__comune select").empty();
$(".add-new-project__comune select").append($('<option>').val('-1').text('Tutti'));
var response = this.get('responseData');
<%
String csParam = ParamUtil.getString(renderRequest, "comune");
String cs = "null";
if (csParam != null && !csParam.equals(StringPool.BLANK)) {
cs = csParam;
<liferay-portlet:resourceURL id="unitaOperative" var="getUnitaOperativeUrl" />
<liferay-portlet:resourceURL id="province" var="getProvinceURL" />
<liferay-portlet:resourceURL id="comuni" var="getComuniURL" />
<liferay-portlet:resourceURL id="istruttore" var="getIstruttoriUrl" />
<liferay-portlet:resourceURL id="geologo" var="getGeologoUrl" />
<aui:script use="aui-io-request,liferay-dynamic-select">
var getUnitaOperative = function(callback) {
A.io.request(
'<%= getUnitaOperativeUrl %>',
{
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
}
}
%>
var cs = <%= cs %>;
var checkIfExists = false;
for (index in response) {
$(".add-new-project__comune select").append($('<option>').val(response[index].comuneId)
.text(response[index].descLong));
if (cs != 'null') {
if (response[index].comuneId == cs) {
checkIfExists = true;
}
}
);
};
var getProvince = function(callback) {
A.io.request(
'<%= getProvinceURL %>',
{
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
}
}
if (checkIfExists) {
$(".add-new-project__comune select").val(cs);
}
);
};
var getComuni = function(callback, provinciaId) {
A.io.request(
'<%= getComuniURL %>',
{
data: {
<portlet:namespace />provinciaId: provinciaId
},dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
}
}
}
);
};
var getIstruttori = function(callback, uoId) {
A.io.request('<%= getIstruttoriUrl %>', {
data: {
<portlet:namespace />uoId: uoId
},
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
}
}
}
});
}).trigger("change");
</aui:script>
});
};
var getGeologo = function(callback) {
A.io.request('<%= getGeologoUrl %>', {
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
}
}
});
};
new Liferay.DynamicSelect(
[
{
select: '<portlet:namespace />provincia',
selectData: getProvince,
selectDesc: 'descLong',
selectId: 'provinciaId',
selectSort: true,
selectVal: '<%= (Validator.isNotNull(provinciaSelect) ? provinciaSelect : "") %>'
},
{
select: '<portlet:namespace />comune',
selectData: getComuni,
selectDesc: 'descLong',
selectId: 'comuneId',
selectSort: true,
selectVal: '<%= (Validator.isNotNull(comuneSelect) ? comuneSelect : "") %>'
},
{
select: '<portlet:namespace />unitaOperativa',
selectData: getUnitaOperative,
selectDesc: 'descLong',
selectId: 'uoId',
selectSort: false,
selectVal: '<%= (Validator.isNotNull(uoSelect) ? uoSelect : "") %>'
},
{
select: '<portlet:namespace />istruttore',
selectData: getIstruttori,
selectDesc: 'descLong',
selectId: 'istruttoreId',
selectSort: true,
selectVal: '<%= (Validator.isNotNull(istruttoreSelect) ? istruttoreSelect : "") %>'
},
{
select: '<portlet:namespace />geologi',
selectData: getGeologo,
selectDesc: 'descLong',
selectId: 'geologoId',
selectSort: true,
selectVal: '<%= (Validator.isNotNull(geologoSelect) ? geologoSelect : "") %>'
}
]
);
</aui:script>

44
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/advanced_search.jsp

@ -32,43 +32,47 @@
<aui:select name="statoPratica" label="Stato Pratica">
<aui:option value="-1">Stato Pratica</aui:option>
<aui:option value="<%= StatoPraticaConstants.ANNULLATA %>">
<liferay-ui:message key="annullata" />
<liferay-ui:message key="Annullata" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.COLLAUDO %>">
<liferay-ui:message key="collaudo" />
<liferay-ui:message key="Collaudo" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.COLLAUDO_PARZIALE %>">
<liferay-ui:message key="Collaudo parziale" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.CONFORME %>">
<liferay-ui:message key="conforme" />
<liferay-ui:message key="Conforme" />
</aui:option>
<aui:option value="sospesa"><liferay-ui:message key="sospesa" /></aui:option>
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI %>">
<liferay-ui:message key="fine lavori" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.COLLAUDO_PARZIALE %>">
<liferay-ui:message key="collaudo parziale" />
<liferay-ui:message key="Fine lavori" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.FINE_LAVORI_PARZIALE %>">
<liferay-ui:message key="fine lavori parziali" />
<liferay-ui:message key="Fine lavori parziali" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.VARIATA %>">
<liferay-ui:message key="variata" />
<aui:option value="IC">
<liferay-ui:message key="In compilazione" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.VIDIMATA %>">
<liferay-ui:message key="vidimata" />
<aui:option value="<%= StatoPraticaConstants.INTEGRAZIONE %>">
<liferay-ui:message key="Integrazione in corso" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.NON_CONFORME %>">
<liferay-ui:message key="nonConforme" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.INTEGRAZIONE %>">
<liferay-ui:message key="integrazione in corso" />
<liferay-ui:message key="Non conforme" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.RIFIUTATA %>">
<liferay-ui:message key="rifiutata" />
<liferay-ui:message key="Rifiutata" />
</aui:option>
<aui:option value="sospesa">
<liferay-ui:message key="Sospesa" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.SOTTOPOSTA_A_PARERE %>">
<liferay-ui:message key="sottoposta a parere" />
<liferay-ui:message key="Sottoposta a parere" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.VARIATA %>">
<liferay-ui:message key="Variata" />
</aui:option>
<aui:option value="<%= StatoPraticaConstants.VIDIMATA %>">
<liferay-ui:message key="Vidimata" />
</aui:option>
<aui:option value="IC"><liferay-ui:message key="in compilazione" /></aui:option>
</aui:select>
</div>
</div>

Caricamento…
Annulla
Salva