|
|
|
@ -13,17 +13,12 @@ import com.liferay.portal.service.CompanyLocalServiceUtil;
|
|
|
|
|
import com.liferay.portal.service.RoleLocalServiceUtil; |
|
|
|
|
import com.liferay.portal.service.ServiceContext; |
|
|
|
|
import com.liferay.portal.service.UserLocalServiceUtil; |
|
|
|
|
import com.liferay.portal.util.PortalUtil; |
|
|
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.model.Comune; |
|
|
|
|
import it.tref.liferay.portos.bo.model.DettPratica; |
|
|
|
|
import it.tref.liferay.portos.bo.model.IntPratica; |
|
|
|
|
import it.tref.liferay.portos.bo.model.Territorio; |
|
|
|
|
import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.persistence.DettPraticaUtil; |
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
import portos.nextmind.model.ScheduledActions; |
|
|
|
@ -61,7 +56,6 @@ public class IntegratoreSchedulato implements MessageListener {
|
|
|
|
|
for (ScheduledActions scheduledActions : listSA) { |
|
|
|
|
Sportello sport = SportelloLocalServiceUtil.fetchSportello(scheduledActions.getShopId()); |
|
|
|
|
sport.getContext(); |
|
|
|
|
sport.getIpaCode(); |
|
|
|
|
if (scheduledActions.getRequestAction() == 2){ |
|
|
|
|
Comune comune = ComuneLocalServiceUtil.findByC_CP( |
|
|
|
|
company.getCompanyId(), |
|
|
|
@ -69,7 +63,10 @@ public class IntegratoreSchedulato implements MessageListener {
|
|
|
|
|
long comuneId = comune.getComuneId(); |
|
|
|
|
Territorio territorio = TerritorioLocalServiceUtil.findByComuneId(comuneId, 0, 1).get(0); |
|
|
|
|
String tipoProcedura = sport.getProceedingType(); |
|
|
|
|
User user = UserLocalServiceUtil.fetchUserByScreenName(company.getCompanyId(), sport.getDigitalHolderTaxCode()); |
|
|
|
|
User user = UserLocalServiceUtil |
|
|
|
|
.fetchUserByScreenName( |
|
|
|
|
company.getCompanyId(), |
|
|
|
|
sport.getDigitalHolderTaxCode()); |
|
|
|
|
if (user == null) { |
|
|
|
|
long userIdAdmin = UserLocalServiceUtil.getRoleUsers( |
|
|
|
|
RoleLocalServiceUtil.getRole(company.getCompanyId(), RoleConstants.ADMINISTRATOR).getRoleId()).get(0).getUserId(); |
|
|
|
@ -90,6 +87,23 @@ public class IntegratoreSchedulato implements MessageListener {
|
|
|
|
|
serviceContext.setUserId(user.getUserId()); |
|
|
|
|
IntPratica newIntestazione = IntPraticaLocalServiceUtil.addIntPratica( |
|
|
|
|
territorio.getTerritorioId(), tipoProcedura, new ServiceContext()); |
|
|
|
|
ScheduledActionsLocalServiceUtil |
|
|
|
|
.updateScheduledActions(scheduledActions) |
|
|
|
|
.setIntPraticaId(newIntestazione.getIntPraticaId() |
|
|
|
|
); |
|
|
|
|
Comune comuneDaAggiornare = ComuneLocalServiceUtil.updateComune(comune); |
|
|
|
|
comuneDaAggiornare.setCodiceIstat(sport.getIpaCode()); |
|
|
|
|
comuneDaAggiornare.setCodiceBelfiore(sport.getInstanceId()); |
|
|
|
|
comuneDaAggiornare.setCodiceIstat(sport.getCadastralCode()); |
|
|
|
|
IntPratica intestazioneDaAggiornare = IntPraticaLocalServiceUtil |
|
|
|
|
.updateIntPratica(newIntestazione); |
|
|
|
|
intestazioneDaAggiornare |
|
|
|
|
.setNumeroProgetto(sport.getInstanceId()); |
|
|
|
|
intestazioneDaAggiornare.setCreateDate(sport.getCreationDate()); |
|
|
|
|
intestazioneDaAggiornare.setTipoProcedura(sport.getProceedingType()); |
|
|
|
|
intestazioneDaAggiornare |
|
|
|
|
.setCodiceFiscaleDelegatoCollaudo(sport.getDigitalHolderTaxCode()); |
|
|
|
|
intestazioneDaAggiornare.setModifiedDate(sport.getLastUpdateDate()); |
|
|
|
|
} |
|
|
|
|
System.out.println(scheduledActions.getRequestAction()); |
|
|
|
|
System.out.println(sport.getUrl()); |
|
|
|
|