|
|
@ -2,6 +2,7 @@ package portos.nextmind.quarkus.bridge.scheduler; |
|
|
|
|
|
|
|
|
|
|
|
import com.liferay.portal.kernel.dao.orm.DynamicQuery; |
|
|
|
import com.liferay.portal.kernel.dao.orm.DynamicQuery; |
|
|
|
import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; |
|
|
|
import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; |
|
|
|
|
|
|
|
import com.liferay.portal.kernel.exception.PortalException; |
|
|
|
import com.liferay.portal.kernel.exception.SystemException; |
|
|
|
import com.liferay.portal.kernel.exception.SystemException; |
|
|
|
import com.liferay.portal.kernel.json.JSONArray; |
|
|
|
import com.liferay.portal.kernel.json.JSONArray; |
|
|
|
import com.liferay.portal.kernel.json.JSONFactoryUtil; |
|
|
|
import com.liferay.portal.kernel.json.JSONFactoryUtil; |
|
|
@ -24,6 +25,7 @@ import it.tref.liferay.portos.bo.model.IntPratica; |
|
|
|
import it.tref.liferay.portos.bo.model.Territorio; |
|
|
|
import it.tref.liferay.portos.bo.model.Territorio; |
|
|
|
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; |
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.shared.util.Constants; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
@ -51,7 +53,6 @@ public class QuarkusBridgeScheduler implements MessageListener { |
|
|
|
} |
|
|
|
} |
|
|
|
for(Company company : companies){ |
|
|
|
for(Company company : companies){ |
|
|
|
JSONObject createPayload = prepareCreateBatch(company.getCompanyId()); |
|
|
|
JSONObject createPayload = prepareCreateBatch(company.getCompanyId()); |
|
|
|
//TODO: persist pratiche
|
|
|
|
|
|
|
|
JSONObject updatePayload = prepareUpdateBatch(company.getCompanyId()); |
|
|
|
JSONObject updatePayload = prepareUpdateBatch(company.getCompanyId()); |
|
|
|
//TODO: persist pratiche
|
|
|
|
//TODO: persist pratiche
|
|
|
|
} |
|
|
|
} |
|
|
@ -93,23 +94,29 @@ 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); |
|
|
|
|
|
|
|
|
|
|
|
//TODO: verifica che la procedura non esista già
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ServiceContext serviceContext = new ServiceContext(); |
|
|
|
ServiceContext serviceContext = new ServiceContext(); |
|
|
|
serviceContext.setScopeGroupId(groupId); |
|
|
|
serviceContext.setScopeGroupId(groupId); |
|
|
|
serviceContext.setCompanyId(companyId); |
|
|
|
serviceContext.setCompanyId(companyId); |
|
|
|
serviceContext.setUserId(user.getUserId()); |
|
|
|
serviceContext.setUserId(user.getUserId()); |
|
|
|
|
|
|
|
//TODO: remove circuit breaker
|
|
|
|
|
|
|
|
if(true) continue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Aggiungi DettPratica
|
|
|
|
// Aggiungi DettPratica
|
|
|
|
long territorioId = territorio.getTerritorioId(); |
|
|
|
long territorioId = territorio.getTerritorioId(); |
|
|
|
|
|
|
|
//TODO: verifica che la procedura non esista già
|
|
|
|
|
|
|
|
if(!Constants.PRATICA_ZONE.containsKey(tipoProcedura)){ |
|
|
|
|
|
|
|
_log.error("#[!]# " + tipoProcedura + " is not a Valid TipoPratica"); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil |
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil |
|
|
|
.addDettPratica(territorioId, tipoProcedura, serviceContext); |
|
|
|
.addDettPratica(territorioId, tipoProcedura, serviceContext); |
|
|
|
|
|
|
|
|
|
|
|
// Aggiorna IntPratica
|
|
|
|
|
|
|
|
IntPraticaLocalServiceUtil.addDatiSuap(dettPratica.getIntPraticaId(), new long[]{}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (SystemException e) { |
|
|
|
} catch (SystemException e) { |
|
|
|
_log.error(e ,e); |
|
|
|
_log.error(e ,e); |
|
|
|
|
|
|
|
} catch (PortalException e) { |
|
|
|
|
|
|
|
_log.error(e, e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return object; |
|
|
|
return object; |
|
|
|