diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SorteggioPraticaUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SorteggioPraticaUtil.java index ed1edb44..82a0c3f1 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SorteggioPraticaUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SorteggioPraticaUtil.java @@ -134,21 +134,23 @@ public class SorteggioPraticaUtil { if (Validator.isNull(dettPratica)) { dettPratica =DettPraticaLocalServiceUtil.getLastEditableByIntPratica(intPraticaId); } - _log.info("Pratica " + pratica.getNumeroProgetto() + " id " + pratica.getIntPraticaId() - + " dettPratica " + (dettPratica == null ? 0 : dettPratica.getDettPraticaId())); - ServiceContext serviceContext = new ServiceContext(); - serviceContext.setCompanyId(dettPratica.getCompanyId()); - serviceContext.setScopeGroupId(dettPratica.getGroupId()); - serviceContext.setUserId(dettPratica.getUserId()); - if (contatore++ < numeroSorteggiate) { - sorteggiate.add(pratica); - esito.add("
  • Sorteggiata: " + pratica.getNumeroProgetto() + " (id " + intPraticaId + ") del " - + sdf.format(pratica.getDtPratica()) + " (" + m.getKey() + ")
  • "); - } else { - pratica.setDtSorteggio(dtSorteggio); - IntPraticaLocalServiceUtil.updateIntPratica(pratica); - esito.add("
  • Non sorteggiata: " + pratica.getNumeroProgetto() + " (id " + intPraticaId - + ") del " + sdf.format(pratica.getDtPratica()) + " (" + m.getKey() + ")
  • "); + if(Validator.isNotNull(dettPratica){ + _log.info("Pratica " + pratica.getNumeroProgetto() + " id " + pratica.getIntPraticaId() + + " dettPratica " + (dettPratica == null ? 0 : dettPratica.getDettPraticaId())); + ServiceContext serviceContext = new ServiceContext(); + serviceContext.setCompanyId(dettPratica.getCompanyId()); + serviceContext.setScopeGroupId(dettPratica.getGroupId()); + serviceContext.setUserId(dettPratica.getUserId()); + if (contatore++ < numeroSorteggiate) { + sorteggiate.add(pratica); + esito.add("
  • Sorteggiata: " + pratica.getNumeroProgetto() + " (id " + intPraticaId + ") del " + + sdf.format(pratica.getDtPratica()) + " (" + m.getKey() + ")
  • "); + } else { + pratica.setDtSorteggio(dtSorteggio); + IntPraticaLocalServiceUtil.updateIntPratica(pratica); + esito.add("
  • Non sorteggiata: " + pratica.getNumeroProgetto() + " (id " + intPraticaId + + ") del " + sdf.format(pratica.getDtPratica()) + " (" + m.getKey() + ")
  • "); + } } } esito.add("");