|
|
|
@ -13,11 +13,13 @@ import it.tref.liferay.portos.bo.model.ControlloPratica;
|
|
|
|
|
import it.tref.liferay.portos.bo.model.DettPratica; |
|
|
|
|
import it.tref.liferay.portos.bo.model.DocAggiuntiva; |
|
|
|
|
import it.tref.liferay.portos.bo.model.DocPratica; |
|
|
|
|
import it.tref.liferay.portos.bo.model.FineLavori; |
|
|
|
|
import it.tref.liferay.portos.bo.model.IntPratica; |
|
|
|
|
import it.tref.liferay.portos.bo.model.Pagamento; |
|
|
|
|
import it.tref.liferay.portos.bo.model.ParereGeologo; |
|
|
|
|
import it.tref.liferay.portos.bo.model.Territorio; |
|
|
|
|
import it.tref.liferay.portos.bo.model.impl.CollaudoImpl; |
|
|
|
|
import it.tref.liferay.portos.bo.model.impl.FineLavoriImpl; |
|
|
|
|
import it.tref.liferay.portos.bo.service.AllegatoManualeLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.AsseverazioneLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil; |
|
|
|
@ -27,6 +29,7 @@ import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil;
|
|
|
|
|
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.DocAggiuntivaLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.ParereGeologoLocalServiceUtil; |
|
|
|
@ -274,28 +277,47 @@ public class SismicaUtil {
|
|
|
|
|
long classPk = 0; |
|
|
|
|
|
|
|
|
|
switch (tipoAvviso) { |
|
|
|
|
case StatoPraticaConstants.COLLAUDO: |
|
|
|
|
List<Collaudo> collaudi = CollaudoLocalServiceUtil.findByIntPraticaId_Completata(intPraticaId, |
|
|
|
|
true, QueryUtil.ALL_POS, QueryUtil.ALL_POS, |
|
|
|
|
OrderByComparatorFactoryUtil.create(CollaudoImpl.TABLE_NAME, "dtProtocollo", true)); |
|
|
|
|
Collaudo collaudo = null; |
|
|
|
|
for (Collaudo el : collaudi) { |
|
|
|
|
if (Validator.isNotNull(el.getDtProtocollo())) { |
|
|
|
|
collaudo = el; |
|
|
|
|
case StatoPraticaConstants.COLLAUDO: |
|
|
|
|
List<Collaudo> collaudi = CollaudoLocalServiceUtil.findByIntPraticaId_Completata(intPraticaId, |
|
|
|
|
true, QueryUtil.ALL_POS, QueryUtil.ALL_POS, |
|
|
|
|
OrderByComparatorFactoryUtil.create(CollaudoImpl.TABLE_NAME, "dtProtocollo", true)); |
|
|
|
|
Collaudo collaudo = null; |
|
|
|
|
for (Collaudo el : collaudi) { |
|
|
|
|
if (Validator.isNotNull(el.getDtProtocollo())) { |
|
|
|
|
collaudo = el; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (Validator.isNull(collaudo)) { |
|
|
|
|
SessionErrors.add(actionRequest, "invia-avviso-collaudo-non-trovato"); |
|
|
|
|
if (Validator.isNull(collaudo)) { |
|
|
|
|
SessionErrors.add(actionRequest, "invia-avviso-collaudo-non-trovato"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
tipoDocumento = StatoPraticaConstants.VIDIMATA; |
|
|
|
|
className = Collaudo.class.getName(); |
|
|
|
|
classPk = collaudo.getPrimaryKey(); |
|
|
|
|
controlloPraticaId = 0; |
|
|
|
|
break; |
|
|
|
|
case StatoPraticaConstants.FINE_LAVORI: |
|
|
|
|
List<FineLavori> fineLavori = FineLavoriLocalServiceUtil.findByIntPraticaId_Completata(intPraticaId, |
|
|
|
|
true, QueryUtil.ALL_POS, QueryUtil.ALL_POS, |
|
|
|
|
OrderByComparatorFactoryUtil.create(FineLavoriImpl.TABLE_NAME, "dtProtocollo", true)); |
|
|
|
|
FineLavori fineLavoro = null; |
|
|
|
|
for (FineLavori el : fineLavori) { |
|
|
|
|
if (Validator.isNotNull(el.getDtProtocollo())) { |
|
|
|
|
fineLavoro = el; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (Validator.isNull(fineLavoro)) { |
|
|
|
|
SessionErrors.add(actionRequest, "invia-avviso-finelavori-non-trovato"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
tipoDocumento = StatoPraticaConstants.VIDIMATA; |
|
|
|
|
className = FineLavori.class.getName(); |
|
|
|
|
classPk = fineLavoro.getPrimaryKey(); |
|
|
|
|
controlloPraticaId = 0; |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
SessionErrors.add(actionRequest, "operazione-non-supportata"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
tipoDocumento = StatoPraticaConstants.VIDIMATA; |
|
|
|
|
className = Collaudo.class.getName(); |
|
|
|
|
classPk = collaudo.getPrimaryKey(); |
|
|
|
|
controlloPraticaId = 0; |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
SessionErrors.add(actionRequest, "operazione-non-supportata"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String templateName = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(tipoAvviso); |
|
|
|
|