|
|
@ -1,13 +1,13 @@ |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. |
|
|
|
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. |
|
|
|
* |
|
|
|
* |
|
|
|
* This library is free software; you can redistribute it and/or modify it under the terms of the |
|
|
|
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General |
|
|
|
* GNU Lesser General Public License as published by the Free Software Foundation; either version |
|
|
|
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) |
|
|
|
* 2.1 of the License, or (at your option) any later version. |
|
|
|
* any later version. |
|
|
|
* |
|
|
|
* |
|
|
|
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without |
|
|
|
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
|
|
|
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
|
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
|
|
|
* Lesser General Public License for more details. |
|
|
|
* details. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
package it.tref.liferay.portos.bo.service.impl; |
|
|
|
package it.tref.liferay.portos.bo.service.impl; |
|
|
@ -23,12 +23,12 @@ import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.TempisticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.TempisticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.base.ControlloPraticaLocalServiceBaseImpl; |
|
|
|
import it.tref.liferay.portos.bo.service.base.ControlloPraticaLocalServiceBaseImpl; |
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.shared.util.Constants; |
|
|
|
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants; |
|
|
|
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants; |
|
|
|
import it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil; |
|
|
|
import it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil; |
|
|
|
import it.tref.liferay.portos.bo.shared.util.UnitaOperativeUtil; |
|
|
|
import it.tref.liferay.portos.bo.shared.util.UnitaOperativeUtil; |
|
|
|
import it.tref.liferay.portos.bo.util.AvvisoUtil; |
|
|
|
import it.tref.liferay.portos.bo.util.AvvisoUtil; |
|
|
|
import it.tref.liferay.portos.bo.util.AzioniPraticheUtil; |
|
|
|
import it.tref.liferay.portos.bo.util.AzioniPraticheUtil; |
|
|
|
import it.tref.liferay.portos.bo.util.Constants; |
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.util.GestioneFirmeUtil; |
|
|
|
import it.tref.liferay.portos.bo.util.GestioneFirmeUtil; |
|
|
|
import it.tref.liferay.portos.bo.util.TempisticaConstants; |
|
|
|
import it.tref.liferay.portos.bo.util.TempisticaConstants; |
|
|
|
import it.tref.liferay.portos.bo.util.WorkflowConstants; |
|
|
|
import it.tref.liferay.portos.bo.util.WorkflowConstants; |
|
|
@ -44,6 +44,7 @@ import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Set; |
|
|
|
import java.util.Set; |
|
|
|
import java.util.TreeMap; |
|
|
|
import java.util.TreeMap; |
|
|
|
|
|
|
|
|
|
|
|
import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil; |
|
|
|
import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil; |
|
|
|
import com.liferay.portal.kernel.dao.orm.DynamicQuery; |
|
|
|
import com.liferay.portal.kernel.dao.orm.DynamicQuery; |
|
|
|
import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil; |
|
|
|
import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil; |
|
|
@ -85,15 +86,12 @@ import com.liferay.portlet.asset.model.AssetLinkConstants; |
|
|
|
* The implementation of the controllo pratica local service. |
|
|
|
* The implementation of the controllo pratica local service. |
|
|
|
* |
|
|
|
* |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* All custom service methods should be put in this class. Whenever methods are |
|
|
|
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy |
|
|
|
* added, rerun ServiceBuilder to copy their definitions into the |
|
|
|
* their definitions into the {@link it.tref.liferay.portos.bo.service.ControlloPraticaLocalService} interface. |
|
|
|
* {@link it.tref.liferay.portos.bo.service.ControlloPraticaLocalService} |
|
|
|
|
|
|
|
* interface. |
|
|
|
|
|
|
|
* |
|
|
|
* |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* This is a local service. Methods of this service will not have security |
|
|
|
* This is a local service. Methods of this service will not have security checks based on the propagated JAAS |
|
|
|
* checks based on the propagated JAAS credentials because this service can only |
|
|
|
* credentials because this service can only be accessed from within the same VM. |
|
|
|
* be accessed from within the same VM. |
|
|
|
|
|
|
|
* </p> |
|
|
|
* </p> |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Davide Barbagallo, 3F Consulting |
|
|
|
* @author Davide Barbagallo, 3F Consulting |
|
|
@ -102,17 +100,17 @@ import com.liferay.portlet.asset.model.AssetLinkConstants; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServiceBaseImpl { |
|
|
|
public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServiceBaseImpl { |
|
|
|
/* |
|
|
|
/* |
|
|
|
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use |
|
|
|
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link |
|
|
|
* {@link |
|
|
|
* it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil} to access the controllo pratica local |
|
|
|
* it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil} to |
|
|
|
* service. |
|
|
|
* access the controllo pratica local service. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
private static final Log _log = LogFactoryUtil.getLog(ControlloPraticaLocalServiceImpl.class); |
|
|
|
private static final Log _log = LogFactoryUtil.getLog(ControlloPraticaLocalServiceImpl.class); |
|
|
|
|
|
|
|
|
|
|
|
public ControlloPratica addControlloPratica(long groupId, long userId, long intPraticaId, |
|
|
|
@Override |
|
|
|
long dettPraticaId, boolean updateFlagControlloObbligatorio, ServiceContext serviceContext) |
|
|
|
public ControlloPratica addControlloPratica(long groupId, long userId, long intPraticaId, long dettPraticaId, |
|
|
|
throws PortalException, SystemException { |
|
|
|
boolean updateFlagControlloObbligatorio, ServiceContext serviceContext) throws PortalException, |
|
|
|
|
|
|
|
SystemException { |
|
|
|
|
|
|
|
|
|
|
|
User user = userPersistence.findByPrimaryKey(userId); |
|
|
|
User user = userPersistence.findByPrimaryKey(userId); |
|
|
|
|
|
|
|
|
|
|
@ -143,8 +141,7 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
// aggiorno int e dett pratica per avvio workflow
|
|
|
|
// aggiorno int e dett pratica per avvio workflow
|
|
|
|
IntPratica intPratica = intPraticaLocalService.updateStatoPratica(intPraticaId, |
|
|
|
IntPratica intPratica = intPraticaLocalService.updateStatoPratica(intPraticaId, |
|
|
|
StatoPraticaConstants.SOTTOPOSTA_A_PARERE); |
|
|
|
StatoPraticaConstants.SOTTOPOSTA_A_PARERE); |
|
|
|
if (updateFlagControlloObbligatorio |
|
|
|
if (updateFlagControlloObbligatorio && Constants.TIPO_PRATICA_DEPOSITO.equals(intPratica.getTipoPratica())) { |
|
|
|
&& Constants.TIPO_PRATICA_DEPOSITO.equals(intPratica.getTipoPratica())) { |
|
|
|
|
|
|
|
intPratica.setControlloObbligatorio(true); |
|
|
|
intPratica.setControlloObbligatorio(true); |
|
|
|
intPratica = intPraticaLocalService.updateIntPratica(intPratica); |
|
|
|
intPratica = intPraticaLocalService.updateIntPratica(intPratica); |
|
|
|
} |
|
|
|
} |
|
|
@ -162,9 +159,8 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
// ///////////
|
|
|
|
// ///////////
|
|
|
|
|
|
|
|
|
|
|
|
// Workflow
|
|
|
|
// Workflow
|
|
|
|
WorkflowHandlerRegistryUtil.startWorkflowInstance(entry.getCompanyId(), entry.getGroupId(), |
|
|
|
WorkflowHandlerRegistryUtil.startWorkflowInstance(entry.getCompanyId(), entry.getGroupId(), entry.getUserId(), |
|
|
|
entry.getUserId(), ControlloPratica.class.getName(), entry.getPrimaryKey(), entry, |
|
|
|
ControlloPratica.class.getName(), entry.getPrimaryKey(), entry, serviceContext, wfContextMap); |
|
|
|
serviceContext, wfContextMap); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date dtInvio = null; |
|
|
|
Date dtInvio = null; |
|
|
|
if (intPratica.getDtSorteggio() != null) { |
|
|
|
if (intPratica.getDtSorteggio() != null) { |
|
|
@ -173,22 +169,22 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
dtInvio = entry.getCreateDate(); |
|
|
|
dtInvio = entry.getCreateDate(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TempisticaLocalServiceUtil.addTempistica(intPraticaId, dettPraticaId, |
|
|
|
TempisticaLocalServiceUtil.addTempistica(intPraticaId, dettPraticaId, TempisticaConstants.TIPO_PRATICA, |
|
|
|
TempisticaConstants.TIPO_PRATICA, dtInvio, serviceContext); |
|
|
|
dtInvio, serviceContext); |
|
|
|
|
|
|
|
|
|
|
|
return entry; |
|
|
|
return entry; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ControlloPratica deleteControlloPratica(long controlloPraticaId) throws PortalException, |
|
|
|
@Override |
|
|
|
SystemException { |
|
|
|
public ControlloPratica deleteControlloPratica(long controlloPraticaId) throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
|
|
ControlloPratica entry = controlloPraticaPersistence.findByPrimaryKey(controlloPraticaId); |
|
|
|
ControlloPratica entry = controlloPraticaPersistence.findByPrimaryKey(controlloPraticaId); |
|
|
|
|
|
|
|
|
|
|
|
return deleteControlloPratica(entry); |
|
|
|
return deleteControlloPratica(entry); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ControlloPratica deleteControlloPratica(ControlloPratica entry) throws SystemException, |
|
|
|
@Override |
|
|
|
PortalException { |
|
|
|
public ControlloPratica deleteControlloPratica(ControlloPratica entry) throws SystemException, PortalException { |
|
|
|
|
|
|
|
|
|
|
|
// Resources
|
|
|
|
// Resources
|
|
|
|
resourceLocalService.deleteResource(entry.getCompanyId(), ControlloPratica.class.getName(), |
|
|
|
resourceLocalService.deleteResource(entry.getCompanyId(), ControlloPratica.class.getName(), |
|
|
@ -200,28 +196,29 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
|
|
|
|
|
|
|
|
// Workflow
|
|
|
|
// Workflow
|
|
|
|
|
|
|
|
|
|
|
|
workflowInstanceLinkLocalService.deleteWorkflowInstanceLinks(entry.getCompanyId(), |
|
|
|
workflowInstanceLinkLocalService.deleteWorkflowInstanceLinks(entry.getCompanyId(), entry.getGroupId(), |
|
|
|
entry.getGroupId(), ControlloPratica.class.getName(), entry.getControlloPraticaId()); |
|
|
|
ControlloPratica.class.getName(), entry.getControlloPraticaId()); |
|
|
|
|
|
|
|
|
|
|
|
controlloPraticaPersistence.remove(entry); |
|
|
|
controlloPraticaPersistence.remove(entry); |
|
|
|
|
|
|
|
|
|
|
|
return entry; |
|
|
|
return entry; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<ControlloPratica> findByIntPraticaId_Status(long intPraticaId, int status) |
|
|
|
@Override |
|
|
|
throws SystemException { |
|
|
|
public List<ControlloPratica> findByIntPraticaId_Status(long intPraticaId, int status) throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
return controlloPraticaPersistence.findByIntPraticaId_Status(intPraticaId, status); |
|
|
|
return controlloPraticaPersistence.findByIntPraticaId_Status(intPraticaId, status); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public int countByIntPraticaId_Status(long intPraticaId, int status) throws SystemException { |
|
|
|
public int countByIntPraticaId_Status(long intPraticaId, int status) throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
return controlloPraticaPersistence.countByIntPraticaId_Status(intPraticaId, status); |
|
|
|
return controlloPraticaPersistence.countByIntPraticaId_Status(intPraticaId, status); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void updateAsset(long userId, ControlloPratica entry, long[] assetCategoryIds, |
|
|
|
@Override |
|
|
|
String[] assetTagNames, long[] assetLinkEntryIds, Date now) throws PortalException, |
|
|
|
public void updateAsset(long userId, ControlloPratica entry, long[] assetCategoryIds, String[] assetTagNames, |
|
|
|
SystemException { |
|
|
|
long[] assetLinkEntryIds, Date now) throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
|
|
boolean visible = false; |
|
|
|
boolean visible = false; |
|
|
|
|
|
|
|
|
|
|
@ -239,23 +236,24 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
AssetEntry assetEntry = assetEntryLocalService.updateEntry(userId, entry.getGroupId(), now, now, |
|
|
|
AssetEntry assetEntry = assetEntryLocalService.updateEntry(userId, entry.getGroupId(), now, now, |
|
|
|
ControlloPratica.class.getName(), entry.getControlloPraticaId(), entry.getUuid(), 0, |
|
|
|
ControlloPratica.class.getName(), entry.getControlloPraticaId(), entry.getUuid(), 0, assetCategoryIds, |
|
|
|
assetCategoryIds, assetTagNames, visible, null, null, null, null, ContentTypes.TEXT_PLAIN, |
|
|
|
assetTagNames, visible, null, null, null, null, ContentTypes.TEXT_PLAIN, |
|
|
|
String.valueOf(entry.getPrimaryKey()), String.valueOf(entry.getPrimaryKey()), null, null, 0, |
|
|
|
String.valueOf(entry.getPrimaryKey()), String.valueOf(entry.getPrimaryKey()), null, null, 0, 0, null, |
|
|
|
0, null, false); |
|
|
|
false); |
|
|
|
|
|
|
|
|
|
|
|
assetLinkLocalService.updateLinks(userId, assetEntry.getEntryId(), assetLinkEntryIds, |
|
|
|
assetLinkLocalService.updateLinks(userId, assetEntry.getEntryId(), assetLinkEntryIds, |
|
|
|
AssetLinkConstants.TYPE_RELATED); |
|
|
|
AssetLinkConstants.TYPE_RELATED); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void deleteAsset(ControlloPratica entry) throws PortalException, SystemException { |
|
|
|
public void deleteAsset(ControlloPratica entry) throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
|
|
assetEntryLocalService.deleteEntry(ControlloPratica.class.getName(), entry.getControlloPraticaId()); |
|
|
|
assetEntryLocalService.deleteEntry(ControlloPratica.class.getName(), entry.getControlloPraticaId()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ControlloPratica updateStatus(long userId, long resourcePrimKey, int status, |
|
|
|
@Override |
|
|
|
ServiceContext serviceContext, List<ControlloPratica> wfNewListVarianti) throws PortalException, |
|
|
|
public ControlloPratica updateStatus(long userId, long resourcePrimKey, int status, ServiceContext serviceContext, |
|
|
|
SystemException { |
|
|
|
List<ControlloPratica> wfNewListVarianti) throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
|
|
User user = userPersistence.findByPrimaryKey(userId); |
|
|
|
User user = userPersistence.findByPrimaryKey(userId); |
|
|
|
Date now = new Date(); |
|
|
|
Date now = new Date(); |
|
|
@ -276,8 +274,8 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
List<DettPratica> successivePratiche = dettPraticaLocalService |
|
|
|
List<DettPratica> successivePratiche = dettPraticaLocalService |
|
|
|
.findCompletedByIntPraticaAndSuccessivoDettPratica(entry.getIntPraticaId(), |
|
|
|
.findCompletedByIntPraticaAndSuccessivoDettPratica(entry.getIntPraticaId(), |
|
|
|
entry.getDettPraticaId()); |
|
|
|
entry.getDettPraticaId()); |
|
|
|
boolean autorizzazione = Constants.TIPO_PRATICA_AUTORIZZAZIONE.equalsIgnoreCase(intPratica |
|
|
|
boolean autorizzazione = Constants.TIPO_PRATICA_AUTORIZZAZIONE |
|
|
|
.getTipoPratica()); |
|
|
|
.equalsIgnoreCase(intPratica.getTipoPratica()); |
|
|
|
boolean avvioWorkflow = false; |
|
|
|
boolean avvioWorkflow = false; |
|
|
|
for (DettPratica dettPraticaSuc : successivePratiche) { |
|
|
|
for (DettPratica dettPraticaSuc : successivePratiche) { |
|
|
|
if (TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPraticaSuc.getTipoIntegrazione()) |
|
|
|
if (TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPraticaSuc.getTipoIntegrazione()) |
|
|
@ -311,14 +309,12 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
return entry; |
|
|
|
return entry; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean generazioneDocumento(long controlloPraticaId, String jsonParams, String tipoAvviso, |
|
|
|
public boolean generazioneDocumento(long controlloPraticaId, String jsonParams, String tipoAvviso, |
|
|
|
long userIdFirma, Map<String, Serializable> workflowContext) throws PortalException, |
|
|
|
long userIdFirma, Map<String, Serializable> workflowContext) throws PortalException, SystemException { |
|
|
|
SystemException { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil |
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId); |
|
|
|
.getControlloPratica(controlloPraticaId); |
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(controlloPratica.getDettPraticaId()); |
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(controlloPratica |
|
|
|
|
|
|
|
.getDettPraticaId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ServiceContext serviceContext = new ServiceContext(); |
|
|
|
ServiceContext serviceContext = new ServiceContext(); |
|
|
|
serviceContext.setCompanyId(controlloPratica.getCompanyId()); |
|
|
|
serviceContext.setCompanyId(controlloPratica.getCompanyId()); |
|
|
@ -339,21 +335,20 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Deprecated |
|
|
|
@Deprecated |
|
|
|
public boolean updateStatoPraticaGeneraDocumentoFinale(long controlloPraticaId, String jsonParams, |
|
|
|
public boolean updateStatoPraticaGeneraDocumentoFinale(long controlloPraticaId, String jsonParams, |
|
|
|
long userIdFirma, Map<String, Serializable> workflowContext) throws PortalException, |
|
|
|
long userIdFirma, Map<String, Serializable> workflowContext) throws PortalException, SystemException { |
|
|
|
SystemException { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return generaDocumentoFinale(controlloPraticaId, jsonParams, userIdFirma, workflowContext); |
|
|
|
return generaDocumentoFinale(controlloPraticaId, jsonParams, userIdFirma, workflowContext); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean generaDocumentoFinale(long controlloPraticaId, String jsonParams, long userIdFirma, |
|
|
|
public boolean generaDocumentoFinale(long controlloPraticaId, String jsonParams, long userIdFirma, |
|
|
|
Map<String, Serializable> workflowContext) throws PortalException, SystemException { |
|
|
|
Map<String, Serializable> workflowContext) throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil |
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId); |
|
|
|
.getControlloPratica(controlloPraticaId); |
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(controlloPratica.getDettPraticaId()); |
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(controlloPratica |
|
|
|
|
|
|
|
.getDettPraticaId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ServiceContext serviceContext = new ServiceContext(); |
|
|
|
ServiceContext serviceContext = new ServiceContext(); |
|
|
|
serviceContext.setCompanyId(controlloPratica.getCompanyId()); |
|
|
|
serviceContext.setCompanyId(controlloPratica.getCompanyId()); |
|
|
@ -385,14 +380,13 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void updateIstruttore(long controlloPraticaId, Map<String, Serializable> workflowContext) |
|
|
|
public void updateIstruttore(long controlloPraticaId, Map<String, Serializable> workflowContext) |
|
|
|
throws PortalException, SystemException { |
|
|
|
throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
|
|
ControlloPratica controlloPratica = controlloPraticaLocalService |
|
|
|
ControlloPratica controlloPratica = controlloPraticaLocalService.getControlloPratica(controlloPraticaId); |
|
|
|
.getControlloPratica(controlloPraticaId); |
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
Map<String, String> parametri = (Map<String, String>) workflowContext |
|
|
|
Map<String, String> parametri = (Map<String, String>) workflowContext.get("CONTEXT_TASK_FORM_PARAMETERS"); |
|
|
|
.get("CONTEXT_TASK_FORM_PARAMETERS"); |
|
|
|
|
|
|
|
IntPratica intPratica = intPraticaLocalService.getIntPratica(controlloPratica.getIntPraticaId()); |
|
|
|
IntPratica intPratica = intPraticaLocalService.getIntPratica(controlloPratica.getIntPraticaId()); |
|
|
|
long istruttore = GetterUtil.getLong(parametri.get("istruttore")); |
|
|
|
long istruttore = GetterUtil.getLong(parametri.get("istruttore")); |
|
|
|
intPratica.setStatusByUserId(istruttore); |
|
|
|
intPratica.setStatusByUserId(istruttore); |
|
|
@ -401,6 +395,7 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Deprecated |
|
|
|
@Deprecated |
|
|
|
public String valutazioneEsitoFinale(long controlloPraticaId, Map<String, Serializable> workflowContext) |
|
|
|
public String valutazioneEsitoFinale(long controlloPraticaId, Map<String, Serializable> workflowContext) |
|
|
|
throws PortalException, SystemException { |
|
|
|
throws PortalException, SystemException { |
|
|
@ -409,22 +404,21 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* I valori di ritorno possibili sono: |
|
|
|
* I valori di ritorno possibili sono: approvato,non_approvato,annullato,richiesta_integrazione |
|
|
|
* approvato,non_approvato,annullato,richiesta_integrazione |
|
|
|
|
|
|
|
* |
|
|
|
* |
|
|
|
* @throws SystemException |
|
|
|
* @throws SystemException |
|
|
|
* @throws PortalException |
|
|
|
* @throws PortalException |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
public String valutazioneEsitoFinaleUpdateStatoPratica(long controlloPraticaId, |
|
|
|
public String valutazioneEsitoFinaleUpdateStatoPratica(long controlloPraticaId, |
|
|
|
Map<String, Serializable> workflowContext) throws PortalException, SystemException { |
|
|
|
Map<String, Serializable> workflowContext) throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
|
|
String esito = getEsitoFinale(controlloPraticaId, workflowContext); |
|
|
|
String esito = getEsitoFinale(controlloPraticaId, workflowContext); |
|
|
|
String ramoWorkflow = StringPool.BLANK; |
|
|
|
String ramoWorkflow = StringPool.BLANK; |
|
|
|
ControlloPratica controlloPratica = controlloPraticaLocalService |
|
|
|
ControlloPratica controlloPratica = controlloPraticaLocalService.getControlloPratica(controlloPraticaId); |
|
|
|
.getControlloPratica(controlloPraticaId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Avviso avviso = avvisoLocalService.fetchLastAvvisoByIntPraticaPerStatoFinale(controlloPratica |
|
|
|
Avviso avviso = avvisoLocalService |
|
|
|
.getIntPraticaId()); |
|
|
|
.fetchLastAvvisoByIntPraticaPerStatoFinale(controlloPratica.getIntPraticaId()); |
|
|
|
if (avviso != null && avviso.getRifiutato()) { |
|
|
|
if (avviso != null && avviso.getRifiutato()) { |
|
|
|
ramoWorkflow = "rifiuto_firma"; |
|
|
|
ramoWorkflow = "rifiuto_firma"; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -467,8 +461,7 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
|
|
|
|
|
|
|
|
// Map<String, String> parametri = (Map<String, String>)
|
|
|
|
// Map<String, String> parametri = (Map<String, String>)
|
|
|
|
// workflowContext.get("CONTEXT_TASK_FORM_PARAMETERS");
|
|
|
|
// workflowContext.get("CONTEXT_TASK_FORM_PARAMETERS");
|
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil |
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId); |
|
|
|
.getControlloPratica(controlloPraticaId); |
|
|
|
|
|
|
|
Map<String, Serializable> parametri = WorkflowUtil.getFormParameters(controlloPratica); |
|
|
|
Map<String, Serializable> parametri = WorkflowUtil.getFormParameters(controlloPratica); |
|
|
|
String esitoScelta = (String) parametri.get("esito"); |
|
|
|
String esitoScelta = (String) parametri.get("esito"); |
|
|
|
|
|
|
|
|
|
|
@ -483,8 +476,9 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
return esitoScelta; |
|
|
|
return esitoScelta; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void aggiornaStatoPerRichiestaIntegrazione(long controlloPraticaId, |
|
|
|
@Override |
|
|
|
Map<String, Serializable> workflowContext) throws PortalException, SystemException { |
|
|
|
public void aggiornaStatoPerRichiestaIntegrazione(long controlloPraticaId, Map<String, Serializable> workflowContext) |
|
|
|
|
|
|
|
throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
|
|
ControlloPratica controllo = controlloPraticaLocalService.getControlloPratica(controlloPraticaId); |
|
|
|
ControlloPratica controllo = controlloPraticaLocalService.getControlloPratica(controlloPraticaId); |
|
|
|
IntPratica pratica = intPraticaLocalService.getIntPratica(controllo.getIntPraticaId()); |
|
|
|
IntPratica pratica = intPraticaLocalService.getIntPratica(controllo.getIntPraticaId()); |
|
|
@ -496,11 +490,11 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
intPraticaLocalService.updateIntPratica(pratica); |
|
|
|
intPraticaLocalService.updateIntPratica(pratica); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public String getJsonListaIstruttori(long controlloPraticaId, Map<String, Serializable> workflowContext) |
|
|
|
public String getJsonListaIstruttori(long controlloPraticaId, Map<String, Serializable> workflowContext) |
|
|
|
throws PortalException, SystemException { |
|
|
|
throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil |
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId); |
|
|
|
.getControlloPratica(controlloPraticaId); |
|
|
|
|
|
|
|
int unitaOperativa = IntPraticaLocalServiceUtil.getIntPratica(controlloPratica.getIntPraticaId()) |
|
|
|
int unitaOperativa = IntPraticaLocalServiceUtil.getIntPratica(controlloPratica.getIntPraticaId()) |
|
|
|
.getUnitaOperativa(); |
|
|
|
.getUnitaOperativa(); |
|
|
|
boolean preassegnazione = (0 == unitaOperativa); |
|
|
|
boolean preassegnazione = (0 == unitaOperativa); |
|
|
@ -551,83 +545,85 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
return jsonObject.toString(); |
|
|
|
return jsonObject.toString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public String getJsonEsitoPratica(long controlloPraticaId, Map<String, Serializable> workflowContext) |
|
|
|
public String getJsonEsitoPratica(long controlloPraticaId, Map<String, Serializable> workflowContext) |
|
|
|
throws PortalException, SystemException { |
|
|
|
throws PortalException, SystemException { |
|
|
|
|
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId); |
|
|
|
|
|
|
|
IntPratica intPratica = intPraticaLocalService.getIntPratica(controlloPratica.getIntPraticaId()); |
|
|
|
|
|
|
|
if (AzioniPraticheUtil.isDeposito(controlloPratica.getIntPraticaId())) { |
|
|
|
|
|
|
|
return jsonDeposito; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
switch (intPratica.getTipoProcedura()) { |
|
|
|
|
|
|
|
case Constants.PROCEDURA_P3: |
|
|
|
|
|
|
|
if (Validator.isNull(intPratica.getDtViarch())) { |
|
|
|
|
|
|
|
return jsonViarchStart; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return jsonViarchEnd; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return jsonAutorizzazione; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil |
|
|
|
private static final String jsonDeposito = StringPool.BLANK; |
|
|
|
.getControlloPratica(controlloPraticaId); |
|
|
|
private static final String jsonAutorizzazione = getJsonAutorizzazione(); |
|
|
|
|
|
|
|
private static final String jsonViarchStart = getJsonViarchStart(); |
|
|
|
|
|
|
|
private static final String jsonViarchEnd = getJsonViarchStart(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static String getJsonAutorizzazione() { |
|
|
|
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); |
|
|
|
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); |
|
|
|
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); |
|
|
|
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); |
|
|
|
jsonObject.put("esito", jsonArray); |
|
|
|
jsonObject.put("esito", jsonArray); |
|
|
|
|
|
|
|
|
|
|
|
if (AzioniPraticheUtil.isDeposito(controlloPratica.getIntPraticaId())) { |
|
|
|
|
|
|
|
JSONObject etichette = JSONFactoryUtil.createJSONObject(); |
|
|
|
JSONObject etichette = JSONFactoryUtil.createJSONObject(); |
|
|
|
etichette.put("label", StatoPraticaConstants.getEsitoDeposito(StatoPraticaConstants.CONFORME)); |
|
|
|
etichette.put("label", StatoPraticaConstants.getEsitoAutorizzazione(StatoPraticaConstants.AUTORIZZATA)); |
|
|
|
etichette.put("value", StatoPraticaConstants.CONFORME); |
|
|
|
etichette.put("value", StatoPraticaConstants.CONFORME); |
|
|
|
etichette.put("default", false); |
|
|
|
etichette.put("default", false); |
|
|
|
jsonArray.put(etichette); |
|
|
|
jsonArray.put(etichette); |
|
|
|
etichette = JSONFactoryUtil.createJSONObject(); |
|
|
|
etichette = JSONFactoryUtil.createJSONObject(); |
|
|
|
etichette |
|
|
|
etichette.put("label", StatoPraticaConstants.getEsitoAutorizzazione(StatoPraticaConstants.NON_CONFORME)); |
|
|
|
.put("label", StatoPraticaConstants.getEsitoDeposito(StatoPraticaConstants.NON_CONFORME)); |
|
|
|
|
|
|
|
etichette.put("value", StatoPraticaConstants.NON_CONFORME); |
|
|
|
etichette.put("value", StatoPraticaConstants.NON_CONFORME); |
|
|
|
etichette.put("default", false); |
|
|
|
etichette.put("default", false); |
|
|
|
jsonArray.put(etichette); |
|
|
|
jsonArray.put(etichette); |
|
|
|
etichette = JSONFactoryUtil.createJSONObject(); |
|
|
|
etichette = JSONFactoryUtil.createJSONObject(); |
|
|
|
etichette |
|
|
|
etichette.put("label", StatoPraticaConstants.getEsitoAutorizzazione(StatoPraticaConstants.INTEGRAZIONE)); |
|
|
|
.put("label", StatoPraticaConstants.getEsitoDeposito(StatoPraticaConstants.INTEGRAZIONE)); |
|
|
|
|
|
|
|
etichette.put("value", StatoPraticaConstants.INTEGRAZIONE); |
|
|
|
etichette.put("value", StatoPraticaConstants.INTEGRAZIONE); |
|
|
|
etichette.put("default", false); |
|
|
|
etichette.put("default", false); |
|
|
|
jsonArray.put(etichette); |
|
|
|
jsonArray.put(etichette); |
|
|
|
etichette = JSONFactoryUtil.createJSONObject(); |
|
|
|
etichette = JSONFactoryUtil.createJSONObject(); |
|
|
|
etichette.put("label", StatoPraticaConstants.getEsitoDeposito(StatoPraticaConstants.ANNULLATA)); |
|
|
|
etichette.put("label", StatoPraticaConstants.getEsitoAutorizzazione(StatoPraticaConstants.PREAVVISO_CONTRARIO)); |
|
|
|
etichette.put("value", StatoPraticaConstants.ANNULLATA); |
|
|
|
etichette.put("value", StatoPraticaConstants.PREAVVISO_CONTRARIO); |
|
|
|
etichette.put("default", false); |
|
|
|
|
|
|
|
jsonArray.put(etichette); |
|
|
|
|
|
|
|
} else if (AzioniPraticheUtil.isAutorizzazione(controlloPratica.getIntPraticaId())) { |
|
|
|
|
|
|
|
JSONObject etichette = JSONFactoryUtil.createJSONObject(); |
|
|
|
|
|
|
|
etichette.put("label", |
|
|
|
|
|
|
|
StatoPraticaConstants.getEsitoAutorizzazione(StatoPraticaConstants.AUTORIZZATA)); |
|
|
|
|
|
|
|
etichette.put("value", StatoPraticaConstants.CONFORME); |
|
|
|
|
|
|
|
etichette.put("default", false); |
|
|
|
|
|
|
|
jsonArray.put(etichette); |
|
|
|
|
|
|
|
etichette = JSONFactoryUtil.createJSONObject(); |
|
|
|
|
|
|
|
etichette.put("label", |
|
|
|
|
|
|
|
StatoPraticaConstants.getEsitoAutorizzazione(StatoPraticaConstants.NON_CONFORME)); |
|
|
|
|
|
|
|
etichette.put("value", StatoPraticaConstants.NON_CONFORME); |
|
|
|
|
|
|
|
etichette.put("default", false); |
|
|
|
etichette.put("default", false); |
|
|
|
jsonArray.put(etichette); |
|
|
|
jsonArray.put(etichette); |
|
|
|
etichette = JSONFactoryUtil.createJSONObject(); |
|
|
|
etichette = JSONFactoryUtil.createJSONObject(); |
|
|
|
etichette.put("label", |
|
|
|
etichette.put("label", StatoPraticaConstants.getEsitoAutorizzazione(StatoPraticaConstants.NO_PARERE)); |
|
|
|
StatoPraticaConstants.getEsitoAutorizzazione(StatoPraticaConstants.INTEGRAZIONE)); |
|
|
|
etichette.put("value", StatoPraticaConstants.NO_PARERE); |
|
|
|
etichette.put("value", StatoPraticaConstants.INTEGRAZIONE); |
|
|
|
|
|
|
|
etichette.put("default", false); |
|
|
|
etichette.put("default", false); |
|
|
|
jsonArray.put(etichette); |
|
|
|
jsonArray.put(etichette); |
|
|
|
etichette = JSONFactoryUtil.createJSONObject(); |
|
|
|
return jsonObject.toString(); |
|
|
|
etichette.put("label", |
|
|
|
} |
|
|
|
StatoPraticaConstants.getEsitoAutorizzazione(StatoPraticaConstants.PREAVVISO_CONTRARIO)); |
|
|
|
|
|
|
|
etichette.put("value", StatoPraticaConstants.PREAVVISO_CONTRARIO); |
|
|
|
private static String getJsonViarchStart() { |
|
|
|
|
|
|
|
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); |
|
|
|
|
|
|
|
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); |
|
|
|
|
|
|
|
jsonObject.put("esito", jsonArray); |
|
|
|
|
|
|
|
JSONObject etichette = JSONFactoryUtil.createJSONObject(); |
|
|
|
|
|
|
|
etichette.put("label", "Attiva VIArch"); |
|
|
|
|
|
|
|
etichette.put("value", StatoPraticaConstants.VIARCH); |
|
|
|
etichette.put("default", false); |
|
|
|
etichette.put("default", false); |
|
|
|
jsonArray.put(etichette); |
|
|
|
jsonArray.put(etichette); |
|
|
|
etichette = JSONFactoryUtil.createJSONObject(); |
|
|
|
etichette = JSONFactoryUtil.createJSONObject(); |
|
|
|
etichette.put("label", |
|
|
|
etichette.put("label", StatoPraticaConstants.getEsitoAutorizzazione(StatoPraticaConstants.INTEGRAZIONE)); |
|
|
|
StatoPraticaConstants.getEsitoAutorizzazione(StatoPraticaConstants.NO_PARERE)); |
|
|
|
etichette.put("value", StatoPraticaConstants.INTEGRAZIONE); |
|
|
|
etichette.put("value", StatoPraticaConstants.NO_PARERE); |
|
|
|
|
|
|
|
etichette.put("default", false); |
|
|
|
etichette.put("default", false); |
|
|
|
jsonArray.put(etichette); |
|
|
|
jsonArray.put(etichette); |
|
|
|
} |
|
|
|
|
|
|
|
return jsonObject.toString(); |
|
|
|
return jsonObject.toString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ControlloPratica addPraticheAlControllo(long controlloPraticaId, long dettPraticaId) |
|
|
|
@Override |
|
|
|
throws PortalException, SystemException { |
|
|
|
public ControlloPratica addPraticheAlControllo(long controlloPraticaId, long dettPraticaId) throws PortalException, |
|
|
|
|
|
|
|
SystemException { |
|
|
|
ControlloPratica controlloPratica = controlloPraticaLocalService |
|
|
|
ControlloPratica controlloPratica = controlloPraticaLocalService.getControlloPratica(controlloPraticaId); |
|
|
|
.getControlloPratica(controlloPraticaId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
controlloPratica.setDettPraticaId(dettPraticaId); |
|
|
|
controlloPratica.setDettPraticaId(dettPraticaId); |
|
|
|
controlloPratica.setModifiedDate(new Date()); |
|
|
|
controlloPratica.setModifiedDate(new Date()); |
|
|
|
|
|
|
|
|
|
|
|
return controlloPraticaPersistence.update(controlloPratica); |
|
|
|
return controlloPraticaPersistence.update(controlloPratica); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -640,11 +636,11 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
* @throws PortalException |
|
|
|
* @throws PortalException |
|
|
|
* @throws SystemException |
|
|
|
* @throws SystemException |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
public ControlloPratica addPraticheAlControlloVarianti(long controlloPraticaId, long dettPraticaId, |
|
|
|
public ControlloPratica addPraticheAlControlloVarianti(long controlloPraticaId, long dettPraticaId, |
|
|
|
ServiceContext serviceContext) throws PortalException, SystemException { |
|
|
|
ServiceContext serviceContext) throws PortalException, SystemException { |
|
|
|
_log.info("start addPraticheAlControlloVarianti per controlloPraticaId=" + controlloPraticaId); |
|
|
|
_log.info("start addPraticheAlControlloVarianti per controlloPraticaId=" + controlloPraticaId); |
|
|
|
ControlloPratica controlloPratica = controlloPraticaLocalService |
|
|
|
ControlloPratica controlloPratica = controlloPraticaLocalService.getControlloPratica(controlloPraticaId); |
|
|
|
.getControlloPratica(controlloPraticaId); |
|
|
|
|
|
|
|
controlloPratica.setDettPraticaId(dettPraticaId); |
|
|
|
controlloPratica.setDettPraticaId(dettPraticaId); |
|
|
|
controlloPratica.setModifiedDate(new Date()); |
|
|
|
controlloPratica.setModifiedDate(new Date()); |
|
|
|
ControlloPratica result = controlloPraticaPersistence.update(controlloPratica); |
|
|
|
ControlloPratica result = controlloPraticaPersistence.update(controlloPratica); |
|
|
@ -660,22 +656,19 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
FormLogLocalServiceUtil.addFormLog(lastTask.getWorkflowInstanceId(), 0l, "cambio-istruttore", |
|
|
|
FormLogLocalServiceUtil.addFormLog(lastTask.getWorkflowInstanceId(), 0l, "cambio-istruttore", |
|
|
|
jsonFormParameters, serviceContext); |
|
|
|
jsonFormParameters, serviceContext); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
_log.error( |
|
|
|
_log.error("Errore in addPraticheAlControlloVarianti - inserimento log non riuscito -controlloPraticaId = " |
|
|
|
"Errore in addPraticheAlControlloVarianti - inserimento log non riuscito -controlloPraticaId = " |
|
|
|
|
|
|
|
+ controlloPraticaId, e); |
|
|
|
+ controlloPraticaId, e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getReturnValueScriptIniziale(long controlloPraticaId) throws PortalException, |
|
|
|
@Override |
|
|
|
SystemException { |
|
|
|
public String getReturnValueScriptIniziale(long controlloPraticaId) throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
|
|
ControlloPratica controlloPratica = controlloPraticaLocalService |
|
|
|
ControlloPratica controlloPratica = controlloPraticaLocalService.getControlloPratica(controlloPraticaId); |
|
|
|
.getControlloPratica(controlloPraticaId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(controlloPratica |
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(controlloPratica.getDettPraticaId()); |
|
|
|
.getDettPraticaId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { |
|
|
|
if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { |
|
|
|
return "portos1_integrazioni"; |
|
|
|
return "portos1_integrazioni"; |
|
|
@ -684,16 +677,15 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public String getTipoEsito(long controlloPraticaId) throws SystemException, PortalException { |
|
|
|
public String getTipoEsito(long controlloPraticaId) throws SystemException, PortalException { |
|
|
|
|
|
|
|
|
|
|
|
String tipoEsito = StringPool.BLANK; |
|
|
|
String tipoEsito = StringPool.BLANK; |
|
|
|
|
|
|
|
|
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil |
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.fetchControlloPratica(controlloPraticaId); |
|
|
|
.fetchControlloPratica(controlloPraticaId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ClassLoader classLoaderKaleo = (ClassLoader) PortletBeanLocatorUtil.locate( |
|
|
|
ClassLoader classLoaderKaleo = (ClassLoader) PortletBeanLocatorUtil.locate( |
|
|
|
com.liferay.portal.workflow.kaleo.service.ClpSerializer.getServletContextName(), |
|
|
|
com.liferay.portal.workflow.kaleo.service.ClpSerializer.getServletContextName(), "portletClassLoader"); |
|
|
|
"portletClassLoader"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DynamicQuery dqKaleo = DynamicQueryFactoryUtil.forClass(KaleoInstance.class, classLoaderKaleo); |
|
|
|
DynamicQuery dqKaleo = DynamicQueryFactoryUtil.forClass(KaleoInstance.class, classLoaderKaleo); |
|
|
|
dqKaleo.add(RestrictionsFactoryUtil.eq("classPK", controlloPraticaId)); |
|
|
|
dqKaleo.add(RestrictionsFactoryUtil.eq("classPK", controlloPraticaId)); |
|
|
@ -708,10 +700,8 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
it.tref.liferay.portos.kaleo.service.ClpSerializer.getServletContextName(), |
|
|
|
it.tref.liferay.portos.kaleo.service.ClpSerializer.getServletContextName(), |
|
|
|
"portletClassLoader"); |
|
|
|
"portletClassLoader"); |
|
|
|
|
|
|
|
|
|
|
|
DynamicQuery dqKaleoLog = DynamicQueryFactoryUtil |
|
|
|
DynamicQuery dqKaleoLog = DynamicQueryFactoryUtil.forClass(FormLog.class, classLoaderKaleoLog); |
|
|
|
.forClass(FormLog.class, classLoaderKaleoLog); |
|
|
|
dqKaleoLog.add(RestrictionsFactoryUtil.eq("workflowInstanceId", kaleoInstance.getKaleoInstanceId())); |
|
|
|
dqKaleoLog.add(RestrictionsFactoryUtil.eq("workflowInstanceId", |
|
|
|
|
|
|
|
kaleoInstance.getKaleoInstanceId())); |
|
|
|
|
|
|
|
dqKaleoLog.add(RestrictionsFactoryUtil.eq("transitionName", "registra-esito")); |
|
|
|
dqKaleoLog.add(RestrictionsFactoryUtil.eq("transitionName", "registra-esito")); |
|
|
|
|
|
|
|
|
|
|
|
Order defaultOrder = OrderFactoryUtil.desc("createDate"); |
|
|
|
Order defaultOrder = OrderFactoryUtil.desc("createDate"); |
|
|
@ -735,26 +725,26 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
return tipoEsito; |
|
|
|
return tipoEsito; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public List<ControlloPratica> findByIntPratica(long intPraticaId) throws SystemException { |
|
|
|
public List<ControlloPratica> findByIntPratica(long intPraticaId) throws SystemException { |
|
|
|
return controlloPraticaPersistence.findByIntPraticaId(intPraticaId); |
|
|
|
return controlloPraticaPersistence.findByIntPraticaId(intPraticaId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Long calculateDateAvvioProcedimento(long controlloPraticaId) throws SystemException, |
|
|
|
@Override |
|
|
|
PortalException { |
|
|
|
public Long calculateDateAvvioProcedimento(long controlloPraticaId) throws SystemException, PortalException { |
|
|
|
ControlloPratica controllo = ControlloPraticaLocalServiceUtil |
|
|
|
ControlloPratica controllo = ControlloPraticaLocalServiceUtil.fetchControlloPratica(controlloPraticaId); |
|
|
|
.fetchControlloPratica(controlloPraticaId); |
|
|
|
|
|
|
|
IntPratica pratica = IntPraticaLocalServiceUtil.fetchIntPratica(controllo.getIntPraticaId()); |
|
|
|
IntPratica pratica = IntPraticaLocalServiceUtil.fetchIntPratica(controllo.getIntPraticaId()); |
|
|
|
|
|
|
|
|
|
|
|
Date apertura = pratica.getDtPratica(); |
|
|
|
Date apertura = pratica.getDtPratica(); |
|
|
|
Date chiusura = null; |
|
|
|
Date chiusura = null; |
|
|
|
long stop = 0; |
|
|
|
long stop = 0; |
|
|
|
|
|
|
|
List<Avviso> avvisi = AvvisoLocalServiceUtil.findByIntPratica( |
|
|
|
List<Avviso> avvisi = AvvisoLocalServiceUtil.findByIntPratica(pratica.getIntPraticaId(), |
|
|
|
pratica.getIntPraticaId(), |
|
|
|
QueryUtil.ALL_POS, QueryUtil.ALL_POS, OrderByComparatorFactoryUtil |
|
|
|
QueryUtil.ALL_POS, |
|
|
|
.getOrderByComparatorFactory().create("portos_bo_Avviso", "createDate", true)); |
|
|
|
QueryUtil.ALL_POS, |
|
|
|
|
|
|
|
OrderByComparatorFactoryUtil.getOrderByComparatorFactory().create("portos_bo_Avviso", "createDate", |
|
|
|
|
|
|
|
true)); |
|
|
|
Date start = null; |
|
|
|
Date start = null; |
|
|
|
Date end = null; |
|
|
|
Date end = null; |
|
|
|
|
|
|
|
|
|
|
|
_log.debug("Pratica " + pratica.getNumeroProgetto()); |
|
|
|
_log.debug("Pratica " + pratica.getNumeroProgetto()); |
|
|
|
for (Avviso avviso : avvisi) { |
|
|
|
for (Avviso avviso : avvisi) { |
|
|
|
if (!avviso.isAnnullato()) { |
|
|
|
if (!avviso.isAnnullato()) { |
|
|
@ -800,139 +790,26 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi |
|
|
|
start = end = null; |
|
|
|
start = end = null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// C'è uno stop ancora attivo
|
|
|
|
// C'è uno stop ancora attivo
|
|
|
|
if (Validator.isNotNull(start)) { |
|
|
|
if (Validator.isNotNull(start)) { |
|
|
|
chiusura = start; |
|
|
|
chiusura = start; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Long giorni = null; |
|
|
|
Long giorni = null; |
|
|
|
if (Validator.isNull(chiusura)) { |
|
|
|
if (Validator.isNull(chiusura)) { |
|
|
|
giorni = SismicaUtil.daysPast(apertura); |
|
|
|
giorni = SismicaUtil.daysPast(apertura); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
giorni = SismicaUtil.daysBetween(apertura, chiusura); |
|
|
|
giorni = SismicaUtil.daysBetween(apertura, chiusura); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return giorni - stop; |
|
|
|
return giorni - stop; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* public long calculateDateAvvioProcedimentoOld(long controlloPraticaId) |
|
|
|
|
|
|
|
* throws SystemException, PortalException { |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* long giorni = 0; |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil |
|
|
|
|
|
|
|
* .fetchControlloPratica(controlloPraticaId); |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Long intPraticaId = controlloPratica.getIntPraticaId(); |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* List<Tempistica> tempisticaList = |
|
|
|
|
|
|
|
* TempisticaLocalServiceUtil.findByIntPratica_Tipo(intPraticaId, |
|
|
|
|
|
|
|
* TempisticaConstants.TIPO_PRATICA); |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* if (tempisticaList != null && tempisticaList.size() > 0) { Tempistica |
|
|
|
|
|
|
|
* temp = null; |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* for (Iterator iterator = tempisticaList.iterator(); iterator.hasNext();) |
|
|
|
|
|
|
|
* { Tempistica tempistica = (Tempistica) iterator.next(); if (temp == null |
|
|
|
|
|
|
|
* || temp.getCreateDate().before(tempistica.getCreateDate())) temp = |
|
|
|
|
|
|
|
* tempistica; } |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* long giorniMillisecFormat = 0; if (temp.getStop() > 0) |
|
|
|
|
|
|
|
* giorniMillisecFormat = temp.getStop() - (temp.getStart() + |
|
|
|
|
|
|
|
* temp.getWait()); else if (temp.getStop() == 0) giorniMillisecFormat = |
|
|
|
|
|
|
|
* System.currentTimeMillis() - (temp.getStart() + temp.getWait()); |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* giorni = TimeUnit.DAYS.convert(giorniMillisecFormat, |
|
|
|
|
|
|
|
* TimeUnit.MILLISECONDS); } |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* return giorni; } |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* ADT: gestione workflow varianti |
|
|
|
* ADT: gestione workflow varianti |
|
|
|
* |
|
|
|
* |
|
|
|
* @param dettPraticaId |
|
|
|
* @param dettPraticaId |
|
|
|
* @throws Exception |
|
|
|
* @throws Exception |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
public void gestioneWFVarianti(ControlloPratica cp) { |
|
|
|
public void gestioneWFVarianti(ControlloPratica cp) { |
|
|
|
try { |
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* DettPratica |
|
|
|
|
|
|
|
* dettPratica=DettPraticaLocalServiceUtil.getDettPratica |
|
|
|
|
|
|
|
* (cp.getDettPraticaId()); |
|
|
|
|
|
|
|
* if(dettPratica.getTipoIntegrazione().equals |
|
|
|
|
|
|
|
* (TipoIntegrazioneUtil.VARIANTE)){ _log.info( |
|
|
|
|
|
|
|
* "gestioneWFVarianti - avviato workflow per variante dettPraticaId=" |
|
|
|
|
|
|
|
* +cp.getDettPraticaId()+" -ControlloPraticaId="+cp. |
|
|
|
|
|
|
|
* getControlloPraticaId()); IntPratica intPratica= |
|
|
|
|
|
|
|
* IntPraticaLocalServiceUtil.fetchIntPratica(cp.getIntPraticaId()); |
|
|
|
|
|
|
|
* long statusByuserId=intPratica.getStatusByUserId(); |
|
|
|
|
|
|
|
* _log.info("gestioneWFVarianti -statusByuserId=" |
|
|
|
|
|
|
|
* +statusByuserId+" per int pratica=" |
|
|
|
|
|
|
|
* +intPratica.getIntPraticaId()); //WorkflowInstanceLink
|
|
|
|
|
|
|
|
* workflowInstanceLink = |
|
|
|
|
|
|
|
* WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink( |
|
|
|
|
|
|
|
* // cp.getCompanyId(),cp.getGroupId(),
|
|
|
|
|
|
|
|
* ControlloPratica.class.getName(),cp.getPrimaryKey()); |
|
|
|
|
|
|
|
* //_log.info(
|
|
|
|
|
|
|
|
* "gestioneWFVarianti - workflowInstanceLink=="+workflowInstanceLink |
|
|
|
|
|
|
|
* .getWorkflowInstanceId()); if (statusByuserId==0){ |
|
|
|
|
|
|
|
* _log.info("gestioneWFVarianti - KO - statusByuserId=" |
|
|
|
|
|
|
|
* +statusByuserId); return; }else{ |
|
|
|
|
|
|
|
* _log.info("gestioneWFVarianti - statusByuserId determinato =" |
|
|
|
|
|
|
|
* +statusByuserId); } long workflowInstanceId = |
|
|
|
|
|
|
|
* WorkflowUtil.getWorkflowInstanceId(cp); |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* //creazione record KaleoTaskInstanceToken di tipo ESITO
|
|
|
|
|
|
|
|
* ServiceContext serviceContext = new ServiceContext(); |
|
|
|
|
|
|
|
* serviceContext.setCompanyId(cp.getCompanyId()); KaleoInstance |
|
|
|
|
|
|
|
* kaleoInstance = |
|
|
|
|
|
|
|
* KaleoInstanceLocalServiceUtil.getKaleoInstance(workflowInstanceId |
|
|
|
|
|
|
|
* ); KaleoInstanceToken rootKaleoInstanceToken = |
|
|
|
|
|
|
|
* kaleoInstance.getRootKaleoInstanceToken(serviceContext); |
|
|
|
|
|
|
|
* _log.info("gestioneWFVarianti - rootKaleoInstanceToken="+ |
|
|
|
|
|
|
|
* rootKaleoInstanceToken.getCurrentKaleoNodeName()); long |
|
|
|
|
|
|
|
* kaleoTaskInstanceTokenID=CounterLocalServiceUtil.increment( |
|
|
|
|
|
|
|
* "com.liferay.counter.model.Counter"); |
|
|
|
|
|
|
|
* _log.info("kaleoTaskInstanceTokenID="+kaleoTaskInstanceTokenID); |
|
|
|
|
|
|
|
* KaleoTaskInstanceToken x = |
|
|
|
|
|
|
|
* KaleoTaskInstanceTokenLocalServiceUtil. |
|
|
|
|
|
|
|
* createKaleoTaskInstanceToken(kaleoTaskInstanceTokenID); |
|
|
|
|
|
|
|
* x.setKaleoTaskId(21642); x.setKaleoTaskName("Esito"); |
|
|
|
|
|
|
|
* x.setCompleted(false); x.setGroupId(cp.getGroupId()); |
|
|
|
|
|
|
|
* x.setClassName |
|
|
|
|
|
|
|
* ("it.tref.liferay.portos.bo.model.ControlloPratica"); |
|
|
|
|
|
|
|
* x.setClassPK(kaleoInstance.getClassPK()); |
|
|
|
|
|
|
|
* x.setCompanyId(kaleoInstance.getCompanyId()); |
|
|
|
|
|
|
|
* x.setUserId(kaleoInstance.getUserId()); |
|
|
|
|
|
|
|
* x.setUserName(kaleoInstance.getUserName()); x.setCreateDate(new |
|
|
|
|
|
|
|
* Date()); |
|
|
|
|
|
|
|
* x.setKaleoInstanceId(kaleoInstance.getKaleoInstanceId()); |
|
|
|
|
|
|
|
* x.setKaleoDefinitionId(kaleoInstance.getKaleoDefinitionId()); |
|
|
|
|
|
|
|
* x.setKaleoInstanceTokenId |
|
|
|
|
|
|
|
* (rootKaleoInstanceToken.getKaleoInstanceTokenId()); |
|
|
|
|
|
|
|
* x.setWorkflowContext(kaleoInstance.getWorkflowContext()); |
|
|
|
|
|
|
|
* x=KaleoTaskInstanceTokenLocalServiceUtil |
|
|
|
|
|
|
|
* .updateKaleoTaskInstanceToken(x); _log.info( |
|
|
|
|
|
|
|
* "gestioneWFVarianti - KaleoTaskInstanceToken di tipo ESITO creato - KaleoTaskInstanceTokenId = " |
|
|
|
|
|
|
|
* +x.getKaleoTaskInstanceTokenId()); _log.info( |
|
|
|
|
|
|
|
* "gestioneWFVarianti - correttamente eseguito - ControlloPraticaId = " |
|
|
|
|
|
|
|
* +cp.getControlloPraticaId()); |
|
|
|
|
|
|
|
* ////////////////////////////////////
|
|
|
|
|
|
|
|
* /////////////////////////////////
|
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* } |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
_log.error( |
|
|
|
|
|
|
|
"gestioneWFVarianti - Errore in gestioneWFVarianti - dettaPratiacaId=" |
|
|
|
|
|
|
|
+ cp.getDettPraticaId(), e); |
|
|
|
|
|
|
|
// throw e;
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|