|
|
@ -18,6 +18,8 @@ import com.liferay.portal.model.Company; |
|
|
|
import com.liferay.portal.model.User; |
|
|
|
import com.liferay.portal.model.User; |
|
|
|
import com.liferay.portal.service.CompanyLocalServiceUtil; |
|
|
|
import com.liferay.portal.service.CompanyLocalServiceUtil; |
|
|
|
import com.liferay.portal.service.ServiceContext; |
|
|
|
import com.liferay.portal.service.ServiceContext; |
|
|
|
|
|
|
|
import com.liferay.portlet.expando.model.ExpandoBridge; |
|
|
|
|
|
|
|
import com.liferay.portlet.expando.model.ExpandoColumnConstants; |
|
|
|
|
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.model.Comune; |
|
|
|
import it.tref.liferay.portos.bo.model.Comune; |
|
|
|
import it.tref.liferay.portos.bo.model.DettPratica; |
|
|
|
import it.tref.liferay.portos.bo.model.DettPratica; |
|
|
@ -94,7 +96,6 @@ public class QuarkusBridgeScheduler implements MessageListener { |
|
|
|
// Recupera la procedura della pratica
|
|
|
|
// Recupera la procedura della pratica
|
|
|
|
String tipoProcedura = Sportello.getString(QuarkusBridgeConstants.tipoProcedura); |
|
|
|
String tipoProcedura = Sportello.getString(QuarkusBridgeConstants.tipoProcedura); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ServiceContext serviceContext = new ServiceContext(); |
|
|
|
ServiceContext serviceContext = new ServiceContext(); |
|
|
|
serviceContext.setScopeGroupId(groupId); |
|
|
|
serviceContext.setScopeGroupId(groupId); |
|
|
|
serviceContext.setCompanyId(companyId); |
|
|
|
serviceContext.setCompanyId(companyId); |
|
|
@ -103,9 +104,9 @@ public class QuarkusBridgeScheduler implements MessageListener { |
|
|
|
if(true) continue; |
|
|
|
if(true) continue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Aggiungi DettPratica
|
|
|
|
// Aggiungi DettPratica ed IntPratica
|
|
|
|
long territorioId = territorio.getTerritorioId(); |
|
|
|
long territorioId = territorio.getTerritorioId(); |
|
|
|
//TODO: verifica che la procedura non esista già
|
|
|
|
//TODO: verifica che la pratica non esista già
|
|
|
|
if(!Constants.PRATICA_ZONE.containsKey(tipoProcedura)){ |
|
|
|
if(!Constants.PRATICA_ZONE.containsKey(tipoProcedura)){ |
|
|
|
_log.error("#[!]# " + tipoProcedura + " is not a Valid TipoPratica"); |
|
|
|
_log.error("#[!]# " + tipoProcedura + " is not a Valid TipoPratica"); |
|
|
|
continue; |
|
|
|
continue; |
|
|
@ -113,6 +114,38 @@ public class QuarkusBridgeScheduler implements MessageListener { |
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil |
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil |
|
|
|
.addDettPratica(territorioId, tipoProcedura, serviceContext); |
|
|
|
.addDettPratica(territorioId, tipoProcedura, serviceContext); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add custom fields to IntPratica to fetch future updates from Kafka
|
|
|
|
|
|
|
|
IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(dettPratica.getIntPraticaId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExpandoBridge customFieldsExpando = intPratica.getExpandoBridge(); |
|
|
|
|
|
|
|
customFieldsExpando.addAttribute(QuarkusBridgeConstants.instanceId, |
|
|
|
|
|
|
|
ExpandoColumnConstants.STRING); |
|
|
|
|
|
|
|
customFieldsExpando.addAttribute(QuarkusBridgeConstants.correlationId, |
|
|
|
|
|
|
|
ExpandoColumnConstants.STRING); |
|
|
|
|
|
|
|
customFieldsExpando.addAttribute(QuarkusBridgeConstants.clientId, |
|
|
|
|
|
|
|
ExpandoColumnConstants.STRING); |
|
|
|
|
|
|
|
customFieldsExpando.addAttribute("HeaderSportelloId", ExpandoColumnConstants.LONG); |
|
|
|
|
|
|
|
customFieldsExpando.addAttribute("SportelloId", ExpandoColumnConstants.LONG); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String instanceId = Header.getString(QuarkusBridgeConstants.instanceId); |
|
|
|
|
|
|
|
String correlationId = Header.getString(QuarkusBridgeConstants.correlationId); |
|
|
|
|
|
|
|
String clientId = Header.getString(QuarkusBridgeConstants.clientId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Long headerSportelloId = Header.getLong(QuarkusBridgeConstants.recordId); |
|
|
|
|
|
|
|
Long sportelloId = Sportello.getLong(QuarkusBridgeConstants.recordId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
customFieldsExpando.setAttribute(QuarkusBridgeConstants.correlationId, correlationId); |
|
|
|
|
|
|
|
customFieldsExpando.setAttribute(QuarkusBridgeConstants.instanceId, instanceId); |
|
|
|
|
|
|
|
customFieldsExpando.setAttribute(QuarkusBridgeConstants.clientId, clientId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
customFieldsExpando.setAttribute("HeaderSportelloId", headerSportelloId); |
|
|
|
|
|
|
|
customFieldsExpando.setAttribute("SportelloId", sportelloId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
intPratica.setExpandoBridgeAttributes(customFieldsExpando); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Persist changes to custom fields
|
|
|
|
|
|
|
|
IntPraticaLocalServiceUtil.updateIntPratica(intPratica); |
|
|
|
|
|
|
|
|
|
|
|
} catch (SystemException e) { |
|
|
|
} catch (SystemException e) { |
|
|
|
_log.error(e ,e); |
|
|
|
_log.error(e ,e); |
|
|
|
} catch (PortalException e) { |
|
|
|
} catch (PortalException e) { |
|
|
@ -134,6 +167,8 @@ public class QuarkusBridgeScheduler implements MessageListener { |
|
|
|
try { |
|
|
|
try { |
|
|
|
List<IntPratica> praticheDaAggiornare = IntPraticaLocalServiceUtil.dynamicQuery(query); |
|
|
|
List<IntPratica> praticheDaAggiornare = IntPraticaLocalServiceUtil.dynamicQuery(query); |
|
|
|
//TODO: splittare le pratiche da aggiornare
|
|
|
|
//TODO: splittare le pratiche da aggiornare
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO: ciclare per effettuare gli update delle singole pratiche
|
|
|
|
} catch (SystemException e) { |
|
|
|
} catch (SystemException e) { |
|
|
|
_log.error(e,e); |
|
|
|
_log.error(e,e); |
|
|
|
} |
|
|
|
} |
|
|
|