From 2224591c4d499d77ac8272b949f710e44a807d7d Mon Sep 17 00:00:00 2001 From: Mattia Gosetto Date: Wed, 26 May 2021 10:05:15 +0200 Subject: [PATCH] soggetto cancellazione fix issue --- .../impl/SoggettoLocalServiceImpl.java | 19 ++++++++++++++++++- .../docroot/WEB-INF/src/service.properties | 4 ++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/SoggettoLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/SoggettoLocalServiceImpl.java index e72e474d..6a2fb4a7 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/SoggettoLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/SoggettoLocalServiceImpl.java @@ -364,8 +364,25 @@ public class SoggettoLocalServiceImpl extends SoggettoLocalServiceBaseImpl { docPraticaLocalService.deleteDocPratica(soggetto.getFileVariazioneId()); } } catch (PortalException e) { + } - return super.deleteSoggetto(soggetto); + + Soggetto ret = super.deleteSoggetto(soggetto); + + long intPraticaId = soggetto.getIntPraticaId(); + long idSoggetto = soggetto.getSoggettoId(); + List soggettiIntPratica = soggettoLocalService.findByIntPratica(intPraticaId); + for (Soggetto sgt : soggettiIntPratica) { + long sostituitoDa = sgt.getSostituitoDa(); + if(Validator.isNotNull(sostituitoDa) && sostituitoDa > 0 && idSoggetto == sostituitoDa){ + sgt.setSostituitoDa(0); + sgt.setDettPraticaIdRimozione(0); + soggettoPersistence.update(sgt); + } + } + + return ret; + } @Override 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 f4003a82..f6a7f98d 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=2642 - build.date=1621844976128 + build.number=2643 + build.date=1622015040932 build.auto.upgrade=true ##