|
|
|
@ -726,13 +726,15 @@ public class SismicaUtil {
|
|
|
|
|
+ pratica.getNumeroProgetto() + ": " + e2.getMessage()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
controllo.setStatus(WorkflowConstants.STATUS_APPROVED); |
|
|
|
|
AvvisoLocalServiceUtil.addAvviso(pratica.getIntPraticaId(), |
|
|
|
|
"Attestazione di deposito progetto", new Date(), AvvisoUtil.TIPO_AVVISO_DIRETTO, |
|
|
|
|
StatoPraticaConstants.CONFORME, fileEntryIdTemplate, dettPratica.getDettPraticaId(), |
|
|
|
|
DettPratica.class.getName(), controllo.getControlloPraticaId(), serviceContext); |
|
|
|
|
pratica.setStatoPratica(StatoPraticaConstants.CONFORME); |
|
|
|
|
IntPraticaLocalServiceUtil.updateIntPratica(pratica); |
|
|
|
|
if(controllo != null){ |
|
|
|
|
controllo.setStatus(WorkflowConstants.STATUS_APPROVED); |
|
|
|
|
AvvisoLocalServiceUtil.addAvviso(pratica.getIntPraticaId(), |
|
|
|
|
"Attestazione di deposito progetto", new Date(), AvvisoUtil.TIPO_AVVISO_DIRETTO, |
|
|
|
|
StatoPraticaConstants.CONFORME, fileEntryIdTemplate, dettPratica.getDettPraticaId(), |
|
|
|
|
DettPratica.class.getName(), controllo.getControlloPraticaId(), serviceContext); |
|
|
|
|
pratica.setStatoPratica(StatoPraticaConstants.CONFORME); |
|
|
|
|
IntPraticaLocalServiceUtil.updateIntPratica(pratica); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} catch (PortalException | SystemException e) { |
|
|
|
@ -958,7 +960,7 @@ public class SismicaUtil {
|
|
|
|
|
if (tokens.contains(controllo.getControlloPraticaId())) |
|
|
|
|
tokenCount++; |
|
|
|
|
} |
|
|
|
|
if (0 == tokenCount) { |
|
|
|
|
if (0 == tokenCount && Validator.isNotNull(last)) { |
|
|
|
|
ServiceContext serviceContext = new ServiceContext(); |
|
|
|
|
serviceContext.setCompanyId(last.getCompanyId()); |
|
|
|
|
serviceContext.setScopeGroupId(last.getGroupId()); |
|
|
|
@ -1266,53 +1268,56 @@ public class SismicaUtil {
|
|
|
|
|
|
|
|
|
|
public static List<String> resetFirme(long companyId, String numeroProgetto) throws SystemException, |
|
|
|
|
PortalException { |
|
|
|
|
|
|
|
|
|
List<String> esito = new ArrayList<>(); |
|
|
|
|
if (Validator.isNull(numeroProgetto)) { |
|
|
|
|
esito.addAll(firmeBloccate(companyId)); |
|
|
|
|
} else { |
|
|
|
|
IntPratica pratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto); |
|
|
|
|
ControlloPratica controllo = getLastControlloPratica(pratica.getIntPraticaId()); |
|
|
|
|
KaleoInstanceToken instanceToken = findInstanceToken(controllo.getControlloPraticaId()); |
|
|
|
|
if (Validator.isNotNull(instanceToken)) { |
|
|
|
|
esitoLog(esito, "Trovato KaleoInstanceToken " + instanceToken.getKaleoInstanceTokenId() |
|
|
|
|
+ ", currentKaleoNodeName = \"" + instanceToken.getCurrentKaleoNodeName() + StringPool.QUOTE); |
|
|
|
|
if (instanceToken.getCurrentKaleoNodeName().equalsIgnoreCase("signal_ff")) { |
|
|
|
|
List<KaleoTaskInstanceToken> taskInstanceTokens = findTaskInstanceTokens(instanceToken |
|
|
|
|
.getKaleoInstanceTokenId()); |
|
|
|
|
esitoLog(esito, "Trovati " + taskInstanceTokens.size() + " KaleoTaskInstanceToken"); |
|
|
|
|
List<KaleoTaskAssignmentInstance> taskAssignmentInstances = findTaskAssignmentInstances(instanceToken |
|
|
|
|
.getKaleoInstanceId()); |
|
|
|
|
esitoLog(esito, "Trovati " + taskAssignmentInstances.size() + " KaleoTaskAssignmentInstance"); |
|
|
|
|
|
|
|
|
|
KaleoTaskInstanceToken taskInstanceToken = taskInstanceTokens.get(taskInstanceTokens.size() - 1); |
|
|
|
|
KaleoTaskAssignmentInstance taskAssignmentInstance = taskAssignmentInstances |
|
|
|
|
.get(taskAssignmentInstances.size() - 1); |
|
|
|
|
|
|
|
|
|
esitoLog(esito, |
|
|
|
|
"Cancello KaleoTaskInstanceToken " + taskInstanceToken.getKaleoTaskInstanceTokenId()); |
|
|
|
|
KaleoTaskInstanceTokenLocalServiceUtil.deleteKaleoTaskInstanceToken(taskInstanceToken); |
|
|
|
|
esitoLog( |
|
|
|
|
esito, |
|
|
|
|
"Cancello KaleoTaskAssignmentInstance " |
|
|
|
|
+ taskAssignmentInstance.getKaleoTaskAssignmentInstanceId()); |
|
|
|
|
KaleoTaskAssignmentInstanceLocalServiceUtil |
|
|
|
|
.deleteKaleoTaskAssignmentInstance(taskAssignmentInstance); |
|
|
|
|
|
|
|
|
|
taskInstanceToken = taskInstanceTokens.get(taskInstanceTokens.size() - 2); |
|
|
|
|
esitoLog(esito, |
|
|
|
|
"Aggiorno KaleoTaskInstanceToken " + taskInstanceToken.getKaleoTaskInstanceTokenId()); |
|
|
|
|
taskInstanceToken.setCompleted(false); |
|
|
|
|
taskInstanceToken.setCompletionUserId(0); |
|
|
|
|
taskInstanceToken.setCompletionDate(null); |
|
|
|
|
KaleoTaskInstanceTokenLocalServiceUtil.updateKaleoTaskInstanceToken(taskInstanceToken); |
|
|
|
|
|
|
|
|
|
esitoLog(esito, "Aggiorno KaleoInstanceToken " + instanceToken.getKaleoInstanceTokenId()); |
|
|
|
|
instanceToken.setCurrentKaleoNodeId(21639); |
|
|
|
|
instanceToken.setCurrentKaleoNodeName("Esito"); |
|
|
|
|
KaleoInstanceTokenLocalServiceUtil.updateKaleoInstanceToken(instanceToken); |
|
|
|
|
try{ |
|
|
|
|
List<String> esito = new ArrayList<>(); |
|
|
|
|
if (Validator.isNull(numeroProgetto)) { |
|
|
|
|
esito.addAll(firmeBloccate(companyId)); |
|
|
|
|
} else { |
|
|
|
|
IntPratica pratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto); |
|
|
|
|
ControlloPratica controllo = getLastControlloPratica(pratica.getIntPraticaId()); |
|
|
|
|
KaleoInstanceToken instanceToken = findInstanceToken(controllo.getControlloPraticaId()); |
|
|
|
|
if (Validator.isNotNull(instanceToken)) { |
|
|
|
|
esitoLog(esito, "Trovato KaleoInstanceToken " + instanceToken.getKaleoInstanceTokenId() |
|
|
|
|
+ ", currentKaleoNodeName = \"" + instanceToken.getCurrentKaleoNodeName() + StringPool.QUOTE); |
|
|
|
|
if (instanceToken.getCurrentKaleoNodeName().equalsIgnoreCase("signal_ff")) { |
|
|
|
|
List<KaleoTaskInstanceToken> taskInstanceTokens = findTaskInstanceTokens(instanceToken |
|
|
|
|
.getKaleoInstanceTokenId()); |
|
|
|
|
esitoLog(esito, "Trovati " + taskInstanceTokens.size() + " KaleoTaskInstanceToken"); |
|
|
|
|
List<KaleoTaskAssignmentInstance> taskAssignmentInstances = findTaskAssignmentInstances(instanceToken |
|
|
|
|
.getKaleoInstanceId()); |
|
|
|
|
esitoLog(esito, "Trovati " + taskAssignmentInstances.size() + " KaleoTaskAssignmentInstance"); |
|
|
|
|
|
|
|
|
|
KaleoTaskInstanceToken taskInstanceToken = taskInstanceTokens.get(taskInstanceTokens.size() - 1); |
|
|
|
|
KaleoTaskAssignmentInstance taskAssignmentInstance = taskAssignmentInstances |
|
|
|
|
.get(taskAssignmentInstances.size() - 1); |
|
|
|
|
|
|
|
|
|
esitoLog(esito, |
|
|
|
|
"Cancello KaleoTaskInstanceToken " + taskInstanceToken.getKaleoTaskInstanceTokenId()); |
|
|
|
|
KaleoTaskInstanceTokenLocalServiceUtil.deleteKaleoTaskInstanceToken(taskInstanceToken); |
|
|
|
|
esitoLog( |
|
|
|
|
esito, |
|
|
|
|
"Cancello KaleoTaskAssignmentInstance " |
|
|
|
|
+ taskAssignmentInstance.getKaleoTaskAssignmentInstanceId()); |
|
|
|
|
KaleoTaskAssignmentInstanceLocalServiceUtil |
|
|
|
|
.deleteKaleoTaskAssignmentInstance(taskAssignmentInstance); |
|
|
|
|
|
|
|
|
|
taskInstanceToken = taskInstanceTokens.get(taskInstanceTokens.size() - 2); |
|
|
|
|
esitoLog(esito, |
|
|
|
|
"Aggiorno KaleoTaskInstanceToken " + taskInstanceToken.getKaleoTaskInstanceTokenId()); |
|
|
|
|
taskInstanceToken.setCompleted(false); |
|
|
|
|
taskInstanceToken.setCompletionUserId(0); |
|
|
|
|
taskInstanceToken.setCompletionDate(null); |
|
|
|
|
KaleoTaskInstanceTokenLocalServiceUtil.updateKaleoTaskInstanceToken(taskInstanceToken); |
|
|
|
|
|
|
|
|
|
esitoLog(esito, "Aggiorno KaleoInstanceToken " + instanceToken.getKaleoInstanceTokenId()); |
|
|
|
|
instanceToken.setCurrentKaleoNodeId(21639); |
|
|
|
|
instanceToken.setCurrentKaleoNodeName("Esito"); |
|
|
|
|
KaleoInstanceTokenLocalServiceUtil.updateKaleoInstanceToken(instanceToken); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}catch(Exception e){ |
|
|
|
|
_log.error(e, e); |
|
|
|
|
} |
|
|
|
|
return esito; |
|
|
|
|
} |
|
|
|
@ -1452,18 +1457,22 @@ public class SismicaUtil {
|
|
|
|
|
IntPratica pratica = null; |
|
|
|
|
try { |
|
|
|
|
pratica = IntPraticaLocalServiceUtil.getIntPratica(documento.getIntPraticaId()); |
|
|
|
|
} catch (PortalException e) {} |
|
|
|
|
} catch (PortalException e) { |
|
|
|
|
_log.error(e,e); |
|
|
|
|
} |
|
|
|
|
if (Validator.isNotNull(pratica) && (documento.getFileEntryId() != 0)) { |
|
|
|
|
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(pratica.getTerritorioId()); |
|
|
|
|
FileEntry fileEntry = null; |
|
|
|
|
try { |
|
|
|
|
fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
// _log.info(e.getClass() + ": " + e.getMessage());
|
|
|
|
|
_log.error(e,e); |
|
|
|
|
} |
|
|
|
|
if(Validator.isNotNull(fileEntry)){ |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
inizio += SLICE; |
|
|
|
@ -1499,10 +1508,14 @@ public class SismicaUtil {
|
|
|
|
|
FileEntry fileEntry = null; |
|
|
|
|
try { |
|
|
|
|
fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId()); |
|
|
|
|
} catch (Exception e) {} |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
_log.error(e,e); |
|
|
|
|
} |
|
|
|
|
if(Validator.isNotNull(fileEntry)){ |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
inizio += SLICE; |
|
|
|
@ -1538,10 +1551,14 @@ public class SismicaUtil {
|
|
|
|
|
FileEntry fileEntry = null; |
|
|
|
|
try { |
|
|
|
|
fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryIdBase()); |
|
|
|
|
} catch (Exception e) {} |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
_log.error(e,e); |
|
|
|
|
} |
|
|
|
|
if(Validator.isNotNull(fileEntry)){ |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if (Validator.isNotNull(pratica) && (documento.getFileEntryIdInvio() != 0)) { |
|
|
|
@ -1549,20 +1566,28 @@ public class SismicaUtil {
|
|
|
|
|
FileEntry fileEntry = null; |
|
|
|
|
try { |
|
|
|
|
fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryIdInvio()); |
|
|
|
|
} catch (Exception e) {} |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
_log.error(e,e); |
|
|
|
|
} |
|
|
|
|
if(Validator.isNotNull(fileEntry)){ |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (Validator.isNotNull(pratica) && (documento.getFileEntryIdProtocollo() != 0)) { |
|
|
|
|
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(pratica.getTerritorioId()); |
|
|
|
|
FileEntry fileEntry = null; |
|
|
|
|
try { |
|
|
|
|
fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryIdProtocollo()); |
|
|
|
|
} catch (Exception e) {} |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
_log.error(e,e); |
|
|
|
|
} |
|
|
|
|
if(Validator.isNotNull(fileEntry)){ |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
inizio += SLICE; |
|
|
|
@ -1599,11 +1624,13 @@ public class SismicaUtil {
|
|
|
|
|
try { |
|
|
|
|
fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
// _log.info(e.getClass() + ": " + e.getMessage());
|
|
|
|
|
_log.error(e,e); |
|
|
|
|
} |
|
|
|
|
if(Validator.isNotNull(fileEntry){ |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
inizio += SLICE; |
|
|
|
@ -1640,11 +1667,13 @@ public class SismicaUtil {
|
|
|
|
|
try { |
|
|
|
|
fileEntry = DLAppServiceUtil.getFileEntry(documento.getDlFileEntryId()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
// _log.info(e.getClass() + ": " + e.getMessage());
|
|
|
|
|
_log.error(e,e); |
|
|
|
|
} |
|
|
|
|
if(Validator.isNotNull(fileEntry)){ |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
inizio += SLICE; |
|
|
|
@ -1681,11 +1710,13 @@ public class SismicaUtil {
|
|
|
|
|
try { |
|
|
|
|
fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
// _log.info(e.getClass() + ": " + e.getMessage());
|
|
|
|
|
_log.error(e,e); |
|
|
|
|
} |
|
|
|
|
if(Validator.isNotNull(fileEntry)){ |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
inizio += SLICE; |
|
|
|
@ -1722,11 +1753,13 @@ public class SismicaUtil {
|
|
|
|
|
try { |
|
|
|
|
fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
// _log.info(e.getClass() + ": " + e.getMessage());
|
|
|
|
|
_log.error(e,e); |
|
|
|
|
} |
|
|
|
|
if(Validator.isNotNull(fileEntry)){ |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} |
|
|
|
|
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, "Pratica " |
|
|
|
|
+ pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + "), " + tipoDocumento |
|
|
|
|
+ StringPool.SPACE + documento.getPrimaryKey()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
inizio += SLICE; |
|
|
|
|