diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/portos-bo-portlet-service.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/portos-bo-portlet-service.jar index c11270a9..b003b616 100644 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/portos-bo-portlet-service.jar and b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/portos-bo-portlet-service.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties index 5e0419b8..ef14f6b6 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties +++ b/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=3650 - build.date=1683889056799 + build.number=3651 + build.date=1683893966071 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/portlets/schedulatore-portos-pratiche-portlet/docroot/WEB-INF/lib/portos-bo-portlet-service.jar b/liferay-plugins-sdk-6.2/portlets/schedulatore-portos-pratiche-portlet/docroot/WEB-INF/lib/portos-bo-portlet-service.jar index c11270a9..b003b616 100644 Binary files a/liferay-plugins-sdk-6.2/portlets/schedulatore-portos-pratiche-portlet/docroot/WEB-INF/lib/portos-bo-portlet-service.jar and b/liferay-plugins-sdk-6.2/portlets/schedulatore-portos-pratiche-portlet/docroot/WEB-INF/lib/portos-bo-portlet-service.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/schedulatore-portos-pratiche-portlet/docroot/WEB-INF/lib/schedulatore-portos-pratiche-portlet-service.jar b/liferay-plugins-sdk-6.2/portlets/schedulatore-portos-pratiche-portlet/docroot/WEB-INF/lib/schedulatore-portos-pratiche-portlet-service.jar index b689b662..0683e83f 100644 Binary files a/liferay-plugins-sdk-6.2/portlets/schedulatore-portos-pratiche-portlet/docroot/WEB-INF/lib/schedulatore-portos-pratiche-portlet-service.jar and b/liferay-plugins-sdk-6.2/portlets/schedulatore-portos-pratiche-portlet/docroot/WEB-INF/lib/schedulatore-portos-pratiche-portlet-service.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/schedulatore-portos-pratiche-portlet/docroot/WEB-INF/src/integratore/IntegratoreSchedulato.java b/liferay-plugins-sdk-6.2/portlets/schedulatore-portos-pratiche-portlet/docroot/WEB-INF/src/integratore/IntegratoreSchedulato.java index fd1f11d2..ce8790f6 100644 --- a/liferay-plugins-sdk-6.2/portlets/schedulatore-portos-pratiche-portlet/docroot/WEB-INF/src/integratore/IntegratoreSchedulato.java +++ b/liferay-plugins-sdk-6.2/portlets/schedulatore-portos-pratiche-portlet/docroot/WEB-INF/src/integratore/IntegratoreSchedulato.java @@ -3,6 +3,8 @@ package integratore; 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; +import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.messaging.Message; import com.liferay.portal.kernel.messaging.MessageListener; import com.liferay.portal.kernel.messaging.MessageListenerException; @@ -16,9 +18,12 @@ import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.UserLocalServiceUtil; 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.DettPraticaLocalServiceUtil; +import it.tref.liferay.portos.bo.service.DettPraticaServiceUtil; import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; @@ -32,20 +37,20 @@ import portos.nextmind.service.SportelloLocalServiceUtil; public class IntegratoreSchedulato implements MessageListener { + + private static final Log _log = LogFactoryUtil.getLog(IntegratoreSchedulato.class); + @Override public void receive(Message arg0) throws MessageListenerException { // TODO Auto-generated method stub try { getPraticaInformation(arg0); } catch (SystemException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + _log.error(e, e); } catch (PortalException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + _log.error(e, e);; } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); + _log.error(e, e);; } } public enum RequestAction { @@ -55,15 +60,15 @@ public class IntegratoreSchedulato implements MessageListener { List companies = CompanyLocalServiceUtil.getCompanies(); for (Company company : companies) { - System.out.println("get information from db and create an obj"); + _log.info("get information from db and create an obj"); List listSA = ScheduledActionsLocalServiceUtil.findAzioniDaSvolgere("PAESAGGISTICA", QueryUtil.ALL_POS,QueryUtil.ALL_POS); for (ScheduledActions scheduledActions : listSA) { - System.out.println("scheduledaction"+scheduledActions); + _log.info("scheduledaction"+scheduledActions); Sportello sport = SportelloLocalServiceUtil.fetchSportello(scheduledActions.getShopId()); sport.getContext(); if (scheduledActions.getRequestAction() == 2){ - System.out.println("request action"+scheduledActions.getRequestAction()); - System.out.println("cadastral code"+sport.getCadastralCode()); + _log.info("request action"+scheduledActions.getRequestAction()); + _log.info("cadastral code"+sport.getCadastralCode()); Comune comune = ComuneLocalServiceUtil.fetchByC_CI(company.getCompanyId(), sport.getCadastralCode()); //TODO se non c'è il comune tornare errore specifico al wios if (comune == null) { @@ -84,13 +89,11 @@ public class IntegratoreSchedulato implements MessageListener { } Territorio territorio = terriList.get(0); //TODO se non c'è il territorio tornare errore specifico al wios - System.out.println("Territorio"+territorio); + _log.info("Territorio"+territorio); User user = UserLocalServiceUtil - .fetchUserByScreenName( - company.getCompanyId(), - sport.getDigitalHolderTaxCode()); + .fetchUserByScreenName(company.getCompanyId(), sport.getDigitalHolderTaxCode().trim().toLowerCase()); if (user == null) { - System.out.println("user null"); + _log.info("user null"); long userIdAdmin = UserLocalServiceUtil.getRoleUsers( RoleLocalServiceUtil.getRole(company.getCompanyId(), RoleConstants.ADMINISTRATOR).getRoleId() ).get(0).getUserId(); @@ -102,8 +105,8 @@ public class IntegratoreSchedulato implements MessageListener { user = UserLocalServiceUtil.addUser(userIdAdmin, company.getCompanyId(), true, StringPool.BLANK, StringPool.BLANK, false, sport.getDigitalHolderTaxCode(), emailAddress, 0l, StringPool.BLANK, Locale.ITALY, sport.getName(), - StringPool.BLANK, sport.getSurname(), 0, 0, true, 0, - 0, 1980, StringPool.BLANK, new long[]{territorio.getGroupId()}, new long[]{}, + StringPool.BLANK, sport.getSurname(), 0, 0, true, 1, + 1, 1980, StringPool.BLANK, new long[]{territorio.getGroupId()}, new long[]{}, new long[]{}, new long[]{}, false, userServiceContext); } @@ -112,17 +115,21 @@ public class IntegratoreSchedulato implements MessageListener { serviceContext.setCompanyId(company.getCompanyId()); serviceContext.setUserId(user.getUserId()); String tipoProcedura = sport.getProceedingType(); - IntPratica newIntestazione = IntPraticaLocalServiceUtil - .addIntPratica( - territorio.getTerritorioId(), tipoProcedura, serviceContext - ); - ScheduledActionsLocalServiceUtil - .updateIntPraticaId(scheduledActions.getIntPraticaId(), - newIntestazione.getIntPraticaId()); + //TODO cercare se per caso la pratica con id specifico esiste già e non crearla e capire coem gestire al situazione, ma fare comunque agigiornamento sotto dela riga ScheduledActions + //se mail esiste già, non possibile creare utente con cod fisc diverso + + + DettPratica dettPratica = DettPraticaLocalServiceUtil.addDettPratica(territorio.getTerritorioId(), tipoProcedura, + serviceContext); + //come rileva la intpraticaid a cui appartiene la dettpratica? + ScheduledActionsLocalServiceUtil + .updateIntPraticaId(scheduledActions.getPrimaryKey(), + dettPratica.getIntPraticaId()); + _log.info("sportel"+sport); //DettPraticaLocalServiceUtil.addDatiSuap(intpraicaId, codici vari di wios); IntPraticaLocalServiceUtil.addDatiSuap( - newIntestazione.getIntPraticaId(), + dettPratica.getIntPraticaId(), new long[]{}); // IntPratica intestazioneDaAggiornare = IntPraticaLocalServiceUtil // .updateIntPratica(newIntestazione); @@ -130,10 +137,10 @@ public class IntegratoreSchedulato implements MessageListener { // intestazioneDaAggiornare.setCreateDate(sport.getCreationDate()); // intestazioneDaAggiornare.set // intestazioneDaAggiornare.setModifiedDate(sport.getLastUpdateDate()); - System.out.println("intestazione creata"+newIntestazione); + _log.info("dettPratica creata "+dettPratica); } - System.out.println(scheduledActions.getRequestAction()); - System.out.println(sport.getUrl()); + _log.info(scheduledActions.getRequestAction()); + _log.info(sport.getUrl()); } } } diff --git a/liferay-plugins-sdk-6.2/portlets/schedulatore-portos-pratiche-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/schedulatore-portos-pratiche-portlet/docroot/WEB-INF/src/service.properties index 5b43c829..aec73a59 100644 --- a/liferay-plugins-sdk-6.2/portlets/schedulatore-portos-pratiche-portlet/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/portlets/schedulatore-portos-pratiche-portlet/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=portos_ss - build.number=68 - build.date=1683889318479 + build.number=69 + build.date=1683894058834 build.auto.upgrade=true ##