Sfoglia il codice sorgente

Reset database

master 20.08
Salvatore La Manna 4 anni fa
parent
commit
ec3300adb7
  1. BIN
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/portal-service.jar
  2. BIN
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/util-java.jar
  3. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalService.java
  4. 520
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalServiceClp.java
  5. 5
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalServiceUtil.java
  6. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalServiceWrapper.java
  7. 132
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/PuliziaDatabase.java
  8. 36
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java
  9. 97
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/PortosAdministrationPortlet.java
  10. 547
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/base/IntPraticaLocalServiceClpInvoker.java
  11. 23
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java
  12. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AllegatoManualePersistenceImpl.java
  13. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AsseverazionePersistenceImpl.java
  14. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AvvisoPersistenceImpl.java
  15. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/CollaudoPersistenceImpl.java
  16. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunePersistenceImpl.java
  17. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunicazionePersistenceImpl.java
  18. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ConfigurazionePersistenceImpl.java
  19. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ControlloPraticaPersistenceImpl.java
  20. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DelegaPersistenceImpl.java
  21. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DettPraticaPersistenceImpl.java
  22. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocAggiuntivaPersistenceImpl.java
  23. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocPraticaPersistenceImpl.java
  24. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/FineLavoriPersistenceImpl.java
  25. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/HistoryWorkflowActionPersistenceImpl.java
  26. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IUVPersistenceImpl.java
  27. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/InfoFascicoloPersistenceImpl.java
  28. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IntPraticaPersistenceImpl.java
  29. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/PagamentoPersistenceImpl.java
  30. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ParereGeologoPersistenceImpl.java
  31. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ProvinciaPersistenceImpl.java
  32. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SoggettoPersistenceImpl.java
  33. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SorteggioPersistenceImpl.java
  34. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/StoricoSoggettoPraticaPersistenceImpl.java
  35. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TempisticaPersistenceImpl.java
  36. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TerritorioPersistenceImpl.java
  37. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/UtentePortosPersistenceImpl.java
  38. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  39. 23
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp
  40. BIN
      liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/lib/portal-service.jar
  41. 3
      liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/impl/ReportTaskManagerServiceImpl.java
  42. BIN
      liferay-plugins-sdk-6.2/shared/portos-report-shared/lib/portal-service.jar
  43. 73
      liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/util/ReportUtil.java

BIN
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/portal-service.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/util-java.jar

File binario non mostrato.

3
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalService.java

@ -355,6 +355,9 @@ public interface IntPraticaLocalService extends BaseLocalService,
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException;
public java.util.List<java.lang.String> svuotaDatabase(long companyId)
throws java.lang.Exception;
public void clearDb() throws java.lang.Exception;
public it.tref.liferay.portos.bo.model.IntPratica deleteIntPratica(

520
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalServiceClp.java

File diff soppresso perché troppo grande Load Diff

5
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalServiceUtil.java

@ -392,6 +392,11 @@ public class IntPraticaLocalServiceUtil {
esitoControllo, dtPratica, oldIntPraticaId, serviceContext);
}
public static java.util.List<java.lang.String> svuotaDatabase(
long companyId) throws java.lang.Exception {
return getService().svuotaDatabase(companyId);
}
public static void clearDb() throws java.lang.Exception {
getService().clearDb();
}

6
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalServiceWrapper.java

@ -417,6 +417,12 @@ public class IntPraticaLocalServiceWrapper implements IntPraticaLocalService,
oldIntPraticaId, serviceContext);
}
@Override
public java.util.List<java.lang.String> svuotaDatabase(long companyId)
throws java.lang.Exception {
return _intPraticaLocalService.svuotaDatabase(companyId);
}
@Override
public void clearDb() throws java.lang.Exception {
_intPraticaLocalService.clearDb();

132
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/PuliziaDatabase.java

@ -1,132 +0,0 @@
package it.mwg.sismica.bo.util;
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.Sorteggio;
import it.tref.liferay.portos.bo.model.Territorio;
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.SorteggioLocalServiceUtil;
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import it.tref.liferay.portos.bo.util.WorkflowConstants;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.UserLocalServiceUtil;
public class PuliziaDatabase {
private static final Log _log = LogFactoryUtil.getLog(PuliziaDatabase.class);
private static final int SLICE = 100;
public static List<String> riparaSorteggio(long companyId) {
List<String> esito = new ArrayList<String>();
List<IntPratica> intPratiche = null;
int index = 0;
do {
try {
intPratiche = IntPraticaLocalServiceUtil.getIntPraticas(index, index + SLICE);
} catch (SystemException e) {
_log.info("Errore caricamento intPratiche", e);
}
for (IntPratica intPratica : intPratiche) {
esito.addAll(riparaSorteggioPratica(intPratica));
}
index += SLICE;
} while (intPratiche.size() > 0);
return esito;
}
private static List<String> riparaSorteggioPratica(IntPratica intPratica) {
List<String> esito = new ArrayList<String>();
long intPraticaId = intPratica.getIntPraticaId();
if (intPratica.getDtSorteggio() != null) {
try {
List<ControlloPratica> controlliPratica = ControlloPraticaLocalServiceUtil
.findByIntPratica(intPraticaId);
if (0 == controlliPratica.size()) {
SimpleDateFormat sdtf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
esito.add("intPraticaId=" + intPraticaId + " sorteggiata il "
+ sdtf.format(intPratica.getDtSorteggio()) + " non ha controlloPratica");
esito.addAll(riparaControlloPratica(intPratica));
}
} catch (SystemException e) {
esito.add("Errore durante la ricerca di ControlloPratica per intPraticaId=" + intPraticaId);
}
}
return esito;
}
private static List<String> riparaControlloPratica(IntPratica intPratica) {
List<String> esito = new ArrayList<String>();
Sorteggio sorteggio = null;
try {
sorteggio = SorteggioLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId());
} catch (SystemException e) {
esito.add("&gt; errore durante la ricerca del sorteggio");
}
long intPraticaId = intPratica.getIntPraticaId();
long companyId = intPratica.getCompanyId();
DettPratica dettPratica = null;
Territorio territorio = null;
long defaultUserId;
try {
dettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica
.getIntPraticaId());
territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
defaultUserId = UserLocalServiceUtil.getDefaultUserId(companyId);
} catch (PortalException | SystemException e1) {
esito.add("&gt; errore durante il recupero di DettPratica, Territorio e defaultUserId");
return esito;
}
ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(companyId);
serviceContext.setScopeGroupId(territorio.getGroupId());
serviceContext.setUserId(defaultUserId);
long dettPraticaId = dettPratica.getDettPraticaId();
try {
if (sorteggio == null) {
esito.add("&gt; non è stata sorteggiata per il controllo, aggiungo controllo fittizio");
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.addControlloPratica(
dettPratica.getGroupId(), dettPratica.getUserId(), intPraticaId, dettPraticaId,
false, serviceContext);
controlloPratica.setStatus(WorkflowConstants.STATUS_APPROVED);
IntPraticaLocalServiceUtil.updateStatoPratica(intPraticaId, dettPraticaId,
StatoPraticaConstants.CONFORME);
} else {
esito.add("&gt; è stata sorteggiata per il controllo, aggiungo controllo");
ControlloPraticaLocalServiceUtil.addControlloPratica(intPratica.getGroupId(),
intPratica.getUserId(), intPratica.getIntPraticaId(), dettPraticaId, true,
serviceContext);
IntPraticaLocalServiceUtil.updateStatoPratica(intPraticaId, dettPraticaId,
StatoPraticaConstants.SOTTOPOSTA_A_PARERE);
}
} catch (PortalException | SystemException e) {
esito.add("&gt; errore durante la creazione del controllo");
}
return esito;
}
public static List<String> pulisci(long companyId) {
List<String> esito = new ArrayList<String>();
esito.add("Funzione non abilitata. Necessita di ulteriore debug.");
return esito;
}
}

36
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java

@ -58,16 +58,13 @@ import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.workflow.kaleo.model.KaleoTaskInstanceToken;
import com.liferay.portal.workflow.kaleo.service.KaleoTaskInstanceTokenLocalServiceUtil;
import com.liferay.portlet.documentlibrary.model.DLFileEntry;
import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil;
import com.liferay.portlet.documentlibrary.service.DLAppServiceUtil;
import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil;
public class SismicaUtil {
private final static Log _log = LogFactoryUtil.getLog(SismicaUtil.class);
private static final SimpleDateFormat dfmt = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss");
private static final SimpleDateFormat dfmtGiorno = new SimpleDateFormat("dd/MM/yyyy");
private static final SimpleDateFormat sdfGiornoDB = new SimpleDateFormat("yyyy-MM-dd");
private final static int SLICE = 200;
@ -176,24 +173,6 @@ public class SismicaUtil {
return esito;
}
public static List<String> dimensioniDL(long companyId) {
List<String> esito = new ArrayList<>();
int start = 0;
List<DLFileEntry> fileEntries = null;
do {
try {
fileEntries = DLFileEntryLocalServiceUtil.getFileEntries(start, start + SLICE);
} catch (SystemException e) {
fileEntries = new ArrayList<>();
}
for (DLFileEntry fileEntry : fileEntries) {
// fileEntry.getFileVersions();
}
} while (fileEntries.size() > 0);
return esito;
}
public static List<String> riparaWorkflow(long companyId, long userId) {
List<String> esito = new ArrayList<>();
esito.addAll(riparaConformita(companyId));
@ -623,21 +602,6 @@ public class SismicaUtil {
return esito;
}
public static List<String> testInterno(long companyId) {
List<String> esito = new ArrayList<>();
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date start = sdf.parse("2020-01-01 13:45:23.1111");
Date end = sdf.parse("2020-12-31 10:45:23.1111");
long diff = Math.round((end.getTime() - start.getTime()) / 86400000.0);
esito.add(diff + " giorni");
} catch (Exception e) {
esito.add("Eccezione: " + e.getMessage());
}
return esito;
}
private static Map<String, String> templateByKey;
private static Map<Long, String> templateById;
private static Map<String, Long> templateIdByKey;

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

@ -1,21 +1,11 @@
package it.tref.liferay.portos.bo.portlet;
import it.mwg.sismica.bo.util.PuliziaDatabase;
import it.mwg.sismica.bo.util.SismicaUtil;
import it.mwg.sismica.bo.util.SorteggioPraticaUtil;
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.Sorteggio;
import it.tref.liferay.portos.bo.model.Territorio;
import it.tref.liferay.portos.bo.service.ConfigurazioneServiceUtil;
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.SorteggioLocalServiceUtil;
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@ -60,20 +50,9 @@ public class PortosAdministrationPortlet extends MVCPortlet {
actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()]));
}
public void riparaSorteggi(ActionRequest actionRequest, ActionResponse actionResponse) {
ThemeDisplay td = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
List<String> esito = PuliziaDatabase.riparaSorteggio(td.getCompanyId());
actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()]));
}
public void inviaComunicazione(ActionRequest actionRequest, ActionResponse actionResponse) {
ThemeDisplay td = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
List<String> esito = new ArrayList<>();
try {
esito = SismicaUtil.inviaComunicazione(td.getCompanyId());
} catch (PortalException | SystemException e) {
esito.add("Errore durante l'invio " + e.getMessage());
}
actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()]));
}
@ -115,9 +94,14 @@ public class PortosAdministrationPortlet extends MVCPortlet {
actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()]));
}
public void testInterno(ActionRequest actionRequest, ActionResponse actionResponse) {
public void svuotaDatabase(ActionRequest actionRequest, ActionResponse actionResponse) {
ThemeDisplay td = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
List<String> esito = SismicaUtil.testInterno(td.getCompanyId());
List<String> esito = new ArrayList<>();
try {
esito = IntPraticaLocalServiceUtil.svuotaDatabase(td.getCompanyId());
} catch (Exception e) {
esito.add("Errore " + e.getMessage());
}
actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()]));
}
@ -137,73 +121,6 @@ public class PortosAdministrationPortlet extends MVCPortlet {
}
private void avvioWorkflowSorteggiate() {
try {
// int count =
// SorteggioLocalServiceUtil.countDettPraticaWorkflowNonAvviato();
// if (count > 0) {
// for (int cursor = 0; cursor <= count; cursor += SIZE) {
List<Long> dettPraticaIds = SorteggioLocalServiceUtil.getDettPraticaWorkflowNonAvviato(-1, -1);
for (Long dettPraticaId : dettPraticaIds) {
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId);
long intPraticaId = dettPratica.getIntPraticaId();
ServiceContext serviceContext = getServiceContext(dettPratica);
avvioWorkflow(intPraticaId, dettPratica, serviceContext);
}
// }
// }
} catch (Exception e) {
_log.error("error", e);
}
}
private void avvioWorkflow(long intPraticaId, DettPratica dettPratica, ServiceContext serviceContext)
throws Exception {
long userId = dettPratica.getUserId();
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.addControlloPratica(
territorio.getGroupId(), userId, intPratica.getIntPraticaId(),
dettPratica.getDettPraticaId(), false, serviceContext);
// ADT: bug id=7 gestione workflow
ControlloPraticaLocalServiceUtil.gestioneWFVarianti(controlloPratica);
//
// Date dtInvio = null;
// if(intPratica.getDtSorteggio() != null){
// dtInvio = intPratica.getDtSorteggio();
// } else {
// dtInvio = controlloPratica.getCreateDate();
// }
//
// //Aggiorno il valore nella tabella delle tempistiche
// ServiceContext serviceContextTempistica =
// getServiceContext(controlloPratica);
// TempisticaLocalServiceUtil.addTempistica(intPraticaId,
// dettPratica.getDettPraticaId(), TempisticaConstants.TIPO_PRATICA,
// dtInvio,
// serviceContext);
Sorteggio sorteggio = SorteggioLocalServiceUtil.findByIntPratica(intPraticaId);
if (sorteggio != null) {
sorteggio.setStatus(0);
if (controlloPratica != null) {
if (controlloPratica.getStatusByUserId() != 0l) {
sorteggio.setStatusByUserId(controlloPratica.getStatusByUserId());
}
if (controlloPratica.getStatusByUserName() != null
&& !controlloPratica.getStatusByUserName().equals("")) {
sorteggio.setStatusByUserName(controlloPratica.getStatusByUserName());
}
}
SorteggioLocalServiceUtil.updateSorteggio(sorteggio);
}
}
private ServiceContext getServiceContext(ControlloPratica controlloPratica) {
ServiceContext serviceContext = new ServiceContext();

547
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/base/IntPraticaLocalServiceClpInvoker.java

File diff soppresso perché troppo grande Load Diff

23
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java

@ -66,6 +66,9 @@ import it.tref.liferay.portos.report.shared.util.ReportUtil;
import java.io.IOException;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
@ -78,6 +81,7 @@ import java.util.Map;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang.StringUtils;
import com.liferay.portal.kernel.dao.jdbc.DataAccess;
import com.liferay.portal.kernel.dao.orm.Disjunction;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
@ -323,6 +327,25 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl {
return intPratica;
}
public List<String> svuotaDatabase(long companyId) throws Exception {
List<String> esito = new ArrayList<>();
Connection connection = DataAccess.getUpgradeOptimizedConnection();
Statement s = connection.createStatement();
for (String tabella : new String[] { "intpratica", "dettpratica", "controllopratica" }) {
s.execute("TRUNCATE TABLE portos_bo_" + tabella);
esito.add("tabella portos_bo_" + tabella + " svuotata");
}
esito.add(resetCounter(IntPratica.class));
esito.add(resetCounter(DettPratica.class));
esito.add(resetCounter(ControlloPratica.class));
return esito;
}
private String resetCounter(Class classRef) throws SystemException {
counterLocalService.reset(classRef.getName());
return "Contatore di " + classRef.getSimpleName() + " azzerato";
}
public void clearDb() throws Exception {
User user = PermissionThreadLocal.getPermissionChecker().getUser();

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AllegatoManualePersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchAllegatoManualeException;
import it.tref.liferay.portos.bo.model.AllegatoManuale;
import it.tref.liferay.portos.bo.model.impl.AllegatoManualeImpl;
import it.tref.liferay.portos.bo.model.impl.AllegatoManualeModelImpl;
import it.tref.liferay.portos.bo.service.persistence.AllegatoManualePersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AsseverazionePersistenceImpl.java

@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchAsseverazioneException;
import it.tref.liferay.portos.bo.model.Asseverazione;
import it.tref.liferay.portos.bo.model.impl.AsseverazioneImpl;
import it.tref.liferay.portos.bo.model.impl.AsseverazioneModelImpl;
import it.tref.liferay.portos.bo.service.persistence.AsseverazionePersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AvvisoPersistenceImpl.java

@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchAvvisoException;
import it.tref.liferay.portos.bo.model.Avviso;
import it.tref.liferay.portos.bo.model.impl.AvvisoImpl;
import it.tref.liferay.portos.bo.model.impl.AvvisoModelImpl;
import it.tref.liferay.portos.bo.service.persistence.AvvisoPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/CollaudoPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchCollaudoException;
import it.tref.liferay.portos.bo.model.Collaudo;
import it.tref.liferay.portos.bo.model.impl.CollaudoImpl;
import it.tref.liferay.portos.bo.model.impl.CollaudoModelImpl;
import it.tref.liferay.portos.bo.service.persistence.CollaudoPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunePersistenceImpl.java

@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchComuneException;
import it.tref.liferay.portos.bo.model.Comune;
import it.tref.liferay.portos.bo.model.impl.ComuneImpl;
import it.tref.liferay.portos.bo.model.impl.ComuneModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ComunePersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunicazionePersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchComunicazioneException;
import it.tref.liferay.portos.bo.model.Comunicazione;
import it.tref.liferay.portos.bo.model.impl.ComunicazioneImpl;
import it.tref.liferay.portos.bo.model.impl.ComunicazioneModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ComunicazionePersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ConfigurazionePersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchConfigurazioneException;
import it.tref.liferay.portos.bo.model.Configurazione;
import it.tref.liferay.portos.bo.model.impl.ConfigurazioneImpl;
import it.tref.liferay.portos.bo.model.impl.ConfigurazioneModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ConfigurazionePersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ControlloPraticaPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchControlloPraticaException;
import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.model.impl.ControlloPraticaImpl;
import it.tref.liferay.portos.bo.model.impl.ControlloPraticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ControlloPraticaPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DelegaPersistenceImpl.java

@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchDelegaException;
import it.tref.liferay.portos.bo.model.Delega;
import it.tref.liferay.portos.bo.model.impl.DelegaImpl;
import it.tref.liferay.portos.bo.model.impl.DelegaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.DelegaPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DettPraticaPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchDettPraticaException;
import it.tref.liferay.portos.bo.model.DettPratica;
import it.tref.liferay.portos.bo.model.impl.DettPraticaImpl;
import it.tref.liferay.portos.bo.model.impl.DettPraticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.DettPraticaPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocAggiuntivaPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchDocAggiuntivaException;
import it.tref.liferay.portos.bo.model.DocAggiuntiva;
import it.tref.liferay.portos.bo.model.impl.DocAggiuntivaImpl;
import it.tref.liferay.portos.bo.model.impl.DocAggiuntivaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.DocAggiuntivaPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocPraticaPersistenceImpl.java

@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchDocPraticaException;
import it.tref.liferay.portos.bo.model.DocPratica;
import it.tref.liferay.portos.bo.model.impl.DocPraticaImpl;
import it.tref.liferay.portos.bo.model.impl.DocPraticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.DocPraticaPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/FineLavoriPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchFineLavoriException;
import it.tref.liferay.portos.bo.model.FineLavori;
import it.tref.liferay.portos.bo.model.impl.FineLavoriImpl;
import it.tref.liferay.portos.bo.model.impl.FineLavoriModelImpl;
import it.tref.liferay.portos.bo.service.persistence.FineLavoriPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/HistoryWorkflowActionPersistenceImpl.java

@ -42,6 +42,7 @@ import it.tref.liferay.portos.bo.NoSuchHistoryWorkflowActionException;
import it.tref.liferay.portos.bo.model.HistoryWorkflowAction;
import it.tref.liferay.portos.bo.model.impl.HistoryWorkflowActionImpl;
import it.tref.liferay.portos.bo.model.impl.HistoryWorkflowActionModelImpl;
import it.tref.liferay.portos.bo.service.persistence.HistoryWorkflowActionPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IUVPersistenceImpl.java

@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchIUVException;
import it.tref.liferay.portos.bo.model.IUV;
import it.tref.liferay.portos.bo.model.impl.IUVImpl;
import it.tref.liferay.portos.bo.model.impl.IUVModelImpl;
import it.tref.liferay.portos.bo.service.persistence.IUVPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/InfoFascicoloPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchInfoFascicoloException;
import it.tref.liferay.portos.bo.model.InfoFascicolo;
import it.tref.liferay.portos.bo.model.impl.InfoFascicoloImpl;
import it.tref.liferay.portos.bo.model.impl.InfoFascicoloModelImpl;
import it.tref.liferay.portos.bo.service.persistence.InfoFascicoloPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IntPraticaPersistenceImpl.java

@ -48,6 +48,7 @@ import it.tref.liferay.portos.bo.NoSuchIntPraticaException;
import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.model.impl.IntPraticaImpl;
import it.tref.liferay.portos.bo.model.impl.IntPraticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.IntPraticaPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/PagamentoPersistenceImpl.java

@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchPagamentoException;
import it.tref.liferay.portos.bo.model.Pagamento;
import it.tref.liferay.portos.bo.model.impl.PagamentoImpl;
import it.tref.liferay.portos.bo.model.impl.PagamentoModelImpl;
import it.tref.liferay.portos.bo.service.persistence.PagamentoPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ParereGeologoPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchParereGeologoException;
import it.tref.liferay.portos.bo.model.ParereGeologo;
import it.tref.liferay.portos.bo.model.impl.ParereGeologoImpl;
import it.tref.liferay.portos.bo.model.impl.ParereGeologoModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ParereGeologoPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ProvinciaPersistenceImpl.java

@ -43,6 +43,7 @@ import it.tref.liferay.portos.bo.NoSuchProvinciaException;
import it.tref.liferay.portos.bo.model.Provincia;
import it.tref.liferay.portos.bo.model.impl.ProvinciaImpl;
import it.tref.liferay.portos.bo.model.impl.ProvinciaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ProvinciaPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SoggettoPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchSoggettoException;
import it.tref.liferay.portos.bo.model.Soggetto;
import it.tref.liferay.portos.bo.model.impl.SoggettoImpl;
import it.tref.liferay.portos.bo.model.impl.SoggettoModelImpl;
import it.tref.liferay.portos.bo.service.persistence.SoggettoPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SorteggioPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchSorteggioException;
import it.tref.liferay.portos.bo.model.Sorteggio;
import it.tref.liferay.portos.bo.model.impl.SorteggioImpl;
import it.tref.liferay.portos.bo.model.impl.SorteggioModelImpl;
import it.tref.liferay.portos.bo.service.persistence.SorteggioPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/StoricoSoggettoPraticaPersistenceImpl.java

@ -42,6 +42,7 @@ import it.tref.liferay.portos.bo.NoSuchStoricoSoggettoPraticaException;
import it.tref.liferay.portos.bo.model.StoricoSoggettoPratica;
import it.tref.liferay.portos.bo.model.impl.StoricoSoggettoPraticaImpl;
import it.tref.liferay.portos.bo.model.impl.StoricoSoggettoPraticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.StoricoSoggettoPraticaPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TempisticaPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchTempisticaException;
import it.tref.liferay.portos.bo.model.Tempistica;
import it.tref.liferay.portos.bo.model.impl.TempisticaImpl;
import it.tref.liferay.portos.bo.model.impl.TempisticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.TempisticaPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TerritorioPersistenceImpl.java

@ -44,6 +44,7 @@ import it.tref.liferay.portos.bo.NoSuchTerritorioException;
import it.tref.liferay.portos.bo.model.Territorio;
import it.tref.liferay.portos.bo.model.impl.TerritorioImpl;
import it.tref.liferay.portos.bo.model.impl.TerritorioModelImpl;
import it.tref.liferay.portos.bo.service.persistence.TerritorioPersistence;
import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/UtentePortosPersistenceImpl.java

@ -43,6 +43,7 @@ import it.tref.liferay.portos.bo.NoSuchUtentePortosException;
import it.tref.liferay.portos.bo.model.UtentePortos;
import it.tref.liferay.portos.bo.model.impl.UtentePortosImpl;
import it.tref.liferay.portos.bo.model.impl.UtentePortosModelImpl;
import it.tref.liferay.portos.bo.service.persistence.UtentePortosPersistence;
import java.io.Serializable;

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=2439
build.date=1596204199242
build.number=2441
build.date=1596283260587
build.auto.upgrade=true
##

23
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp

@ -88,15 +88,14 @@ String dataProssimoSorteggio =
</div>
</div>
<liferay-portlet:actionURL name="testInterno" var="testInternoURL" />
<liferay-portlet:actionURL name="riparaSorteggi" var="riparaSorteggiURL" />
<liferay-portlet:actionURL name="svuotaDatabase" var="svuotaDatabaseURL" />
<liferay-portlet:actionURL name="inviaComunicazione" var="inviaComunicazioneURL" />
<div class="row-fluid" style="margin-top: 10px;">
<div class="span6">
<div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Test interno</div>
<aui:form action="<%=testInternoURL%>" method="post" name="fmTestInterno">
<aui:form action="<%=svuotaDatabaseURL%>" method="post" name="fmSvuotaDatabase">
<div>
<aui:button cssClass="btn-danger" type="submit" value="Test interno" />
<aui:button cssClass="btn-danger" type="submit" value="Svuota Database" />
</div>
</aui:form>
</div>
@ -110,21 +109,7 @@ String dataProssimoSorteggio =
</div>
</div>
<%-- <liferay-portlet:actionURL name="inviaComunicazione" var="inviaComunicazioneUrl" /> --%>
<!-- <div class="row-fluid" style="margin-top: 10px;"> -->
<!-- <div class="span6"> -->
<!-- <div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Invia comunicazione ATAP</div> -->
<%-- <aui:form action="<%=inviaComunicazioneUrl%>" method="post" name="fmInviaComunicazione"> --%>
<!-- <div> -->
<%-- <aui:button cssClass="btn-danger" type="submit" value="Invia" /> --%>
<!-- </div> -->
<%-- </aui:form> --%>
<!-- </div> -->
<!-- </div> -->
<%
String[] esito = renderRequest.getParameterValues("esito");
%>
<% String[] esito = renderRequest.getParameterValues("esito"); %>
<c:if test="<%=(null != esito) && (esito.length > 0)%>">
<h2>Risultato</h2>
<%

BIN
liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/lib/portal-service.jar

File binario non mostrato.

3
liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/impl/ReportTaskManagerServiceImpl.java

@ -201,8 +201,7 @@ public class ReportTaskManagerServiceImpl extends ReportTaskManagerServiceBaseIm
fileEntryIds = ArrayUtil.append(fileEntryIds, fileEntry.getFileEntryId());
}
} catch (Exception e) {
throw new SystemException(e);
_log.error(e);
}
return fileEntryIds;

BIN
liferay-plugins-sdk-6.2/shared/portos-report-shared/lib/portal-service.jar

File binario non mostrato.

73
liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/util/ReportUtil.java

@ -17,38 +17,45 @@ import java.util.concurrent.TimeUnit;
import com.liferay.portal.kernel.json.JSONArray;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONObject;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.messaging.Message;
import com.liferay.portal.kernel.messaging.MessageBusUtil;
public class ReportUtil {
private static final Log _log = LogFactoryUtil.getLog(ReportUtil.class);
/*
* Considerazioni per report generati con <i>modalità asincrona</i>. Il risultato finale sarà
* inviato tramite message bus su una destinazione passata in input. La chiave di legame tra l'ack
* iniziale e il messaggio di esito è il <code>reportTaskId</code>.<br /> <b>LIMITAZIONI</b> Il
* campo <code>parameters</code> non può contenetere <code>Array[]</code> ma solo
* <code>List</code> che saranno gestite dall'engine come <code>ArrayList</code> che chiaramente
* non potranno essere tipati come <code>List&lt;Array[]&gt;</code> ma
* <code>List&lt;List&lt;&gt;&gt;</code> nel caso di matrici. All'interno di template Velocity si
* dovrà rifare rimento al bean direttamente al campo e non con metodi get (es:
* <code>$user.firstName</code> e non <code>$user.getFirstName()</code>). In generale parametri
* "semplici" (come background task).
* Considerazioni per report generati con <i>modalità asincrona</i>. Il
* risultato finale sarà inviato tramite message bus su una destinazione
* passata in input. La chiave di legame tra l'ack iniziale e il messaggio
* di esito è il <code>reportTaskId</code>.<br /> <b>LIMITAZIONI</b> Il
* campo <code>parameters</code> non può contenetere <code>Array[]</code> ma
* solo <code>List</code> che saranno gestite dall'engine come
* <code>ArrayList</code> che chiaramente non potranno essere tipati come
* <code>List&lt;Array[]&gt;</code> ma <code>List&lt;List&lt;&gt;&gt;</code>
* nel caso di matrici. All'interno di template Velocity si dovrà rifare
* rimento al bean direttamente al campo e non con metodi get (es:
* <code>$user.firstName</code> e non <code>$user.getFirstName()</code>). In
* generale parametri "semplici" (come background task).
*/
public static ReportResultDto generateReport(long companyId, long userId, ReportDto reportDto, Object dataSource)
throws ReportGenerationException {
public static ReportResultDto generateReport(long companyId, long userId, ReportDto reportDto,
Object dataSource) throws ReportGenerationException {
try {
Message message = new Message();
setMessage(message, companyId, userId, ReportProcessMode.SYNC, Collections.singletonList(reportDto), dataSource,
null);
setMessage(message, companyId, userId, ReportProcessMode.SYNC,
Collections.singletonList(reportDto), dataSource, null);
String json = (String) MessageBusUtil.sendSynchronousMessage(ReportDestinationNames.SYNC, message, 1);
String json = (String) MessageBusUtil.sendSynchronousMessage(ReportDestinationNames.SYNC,
message, 1);
return JSONFactoryUtil.looseDeserialize(json, ReportResultDto.class);
} catch (Exception e) {
_log.error(e);
throw new ReportGenerationException(e);
}
}
@ -62,7 +69,8 @@ public class ReportUtil {
setMessage(message, companyId, userId, ReportProcessMode.SYNC, reportDtos, dataSource, null);
String json = (String) MessageBusUtil.sendSynchronousMessage(ReportDestinationNames.SYNC, message, 1);
String json = (String) MessageBusUtil.sendSynchronousMessage(ReportDestinationNames.SYNC,
message, 1);
return JSONFactoryUtil.looseDeserialize(json, ReportResultDto.class);
} catch (Exception e) {
@ -70,19 +78,18 @@ public class ReportUtil {
}
}
public static ReportResultDto generateReport(long companyId, long userId, ReportDto reportDto, Object dataSource,
String responseDestinationName) throws ReportGenerationException {
public static ReportResultDto generateReport(long companyId, long userId, ReportDto reportDto,
Object dataSource, String responseDestinationName) throws ReportGenerationException {
try {
Message message = new Message();
setMessage(message, companyId, userId, ReportProcessMode.ASYNC, Collections.singletonList(reportDto), dataSource,
responseDestinationName);
setMessage(message, companyId, userId, ReportProcessMode.ASYNC,
Collections.singletonList(reportDto), dataSource, responseDestinationName);
String json =
(String) MessageBusUtil.sendSynchronousMessage(ReportDestinationNames.SERIAL, message,
TimeUnit.SECONDS.toMillis(60));
String json = (String) MessageBusUtil.sendSynchronousMessage(ReportDestinationNames.SERIAL,
message, TimeUnit.SECONDS.toMillis(60));
return JSONFactoryUtil.looseDeserialize(json, ReportResultDto.class);
} catch (Exception e) {
@ -97,11 +104,11 @@ public class ReportUtil {
Message message = new Message();
setMessage(message, companyId, userId, ReportProcessMode.ASYNC, reportDtos, dataSource, responseDestinationName);
setMessage(message, companyId, userId, ReportProcessMode.ASYNC, reportDtos, dataSource,
responseDestinationName);
String json =
(String) MessageBusUtil.sendSynchronousMessage(ReportDestinationNames.SERIAL, message,
TimeUnit.SECONDS.toMillis(60));
String json = (String) MessageBusUtil.sendSynchronousMessage(ReportDestinationNames.SERIAL,
message, TimeUnit.SECONDS.toMillis(60));
return JSONFactoryUtil.looseDeserialize(json, ReportResultDto.class);
} catch (Exception e) {
@ -116,10 +123,11 @@ public class ReportUtil {
Message message = new Message();
setMessage(message, companyId, userId, ReportProcessMode.SYNC, Collections.singletonList(reportDto), null,
ReportDestinationNames.SYNC_PROTOCOLLO);
setMessage(message, companyId, userId, ReportProcessMode.SYNC,
Collections.singletonList(reportDto), null, ReportDestinationNames.SYNC_PROTOCOLLO);
String json = (String) MessageBusUtil.sendSynchronousMessage(ReportDestinationNames.SYNC_PROTOCOLLO, message, 1);
String json = (String) MessageBusUtil.sendSynchronousMessage(
ReportDestinationNames.SYNC_PROTOCOLLO, message, 1);
return JSONFactoryUtil.looseDeserialize(json, ReportResultDto.class);
} catch (Exception e) {
@ -127,8 +135,9 @@ public class ReportUtil {
}
}
private static void setMessage(Message message, long companyId, long userId, ReportProcessMode processMode,
List<ReportDto> reportDtos, Object dataSource, String responseDestinationName) throws Exception {
private static void setMessage(Message message, long companyId, long userId,
ReportProcessMode processMode, List<ReportDto> reportDtos, Object dataSource,
String responseDestinationName) throws Exception {
message.put(ReportConstants.COMPANY_ID, companyId);
message.put(ReportConstants.USER_ID, userId);

Caricamento…
Annulla
Salva