Sfoglia il codice sorgente

fixes funzionalità eliminazione controllo pratica

develop
marcoalderighi 2 anni fa
parent
commit
81fb41da7b
  1. 2
      liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/portlet/AdvancedOperationPortlet.java
  2. 20
      liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/util/AdvancedOperationUtil.java
  3. 3
      liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/html/view.jsp

2
liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/portlet/AdvancedOperationPortlet.java

@ -44,7 +44,7 @@ public class AdvancedOperationPortlet extends MVCPortlet {
long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId", 0L); long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId", 0L);
if (intPraticaId != 0L) { if (intPraticaId != 0L) {
List<ControlloPratica> controlloPraticaList = List<ControlloPratica> controlloPraticaList =
ControlloPraticaLocalServiceUtil.findByIntPratica(intPraticaId); ControlloPraticaLocalServiceUtil.findByIntPraticaId_Status(intPraticaId, WorkflowConstants.STATUS_APPROVED);
for(ControlloPratica cp : controlloPraticaList){ for(ControlloPratica cp : controlloPraticaList){
_log.info("AdvancedOperationPortlet --- Deleting ControlloPratica " + cp.getControlloPraticaId() + _log.info("AdvancedOperationPortlet --- Deleting ControlloPratica " + cp.getControlloPraticaId() +
" of IntPraticaId " + intPraticaId); " of IntPraticaId " + intPraticaId);

20
liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/util/AdvancedOperationUtil.java

@ -22,20 +22,32 @@ import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.util.Constants; import it.tref.liferay.portos.bo.shared.util.Constants;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import java.io.Console;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
public class AdvancedOperationUtil { public class AdvancedOperationUtil {
public static boolean isNotWorkflowManuallyStarted(IntPratica intPratica){
switch (intPratica.getStatoPratica()) {
case StatoPraticaConstants.VIDIMATA :
case StatoPraticaConstants.AUTORIZZATA:
case StatoPraticaConstants.CONFORME:
return true;
default:
return false;
}
}
public static boolean hasControlloPratica_ProceduraC(IntPratica intPratica){ public static boolean hasControlloPratica_ProceduraC(IntPratica intPratica){
if(Constants.PROCEDURA_C.equalsIgnoreCase(intPratica.getTipoProcedura())){ if(Constants.PROCEDURA_C.equalsIgnoreCase(intPratica.getTipoProcedura())){
try{ try{
long intPraticaId = intPratica.getIntPraticaId(); long intPraticaId = intPratica.getIntPraticaId();
List<ControlloPratica> controlloPraticas = ControlloPraticaLocalServiceUtil.findByIntPratica(intPraticaId); List<ControlloPratica> controlloPraticas =
return !controlloPraticas.isEmpty(); ControlloPraticaLocalServiceUtil.findByIntPraticaId_Status(intPraticaId, WorkflowConstants.STATUS_APPROVED);
return !controlloPraticas.isEmpty();
} catch (SystemException e){ } catch (SystemException e){
_log.error(e,e); _log.error(e,e);
return false; return false;

3
liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/html/view.jsp

@ -242,7 +242,8 @@
</div> </div>
<% } %> <% } %>
<% if(AdvancedOperationUtil.hasControlloPratica_ProceduraC(intPratica)){ %> <% if(AdvancedOperationUtil.hasControlloPratica_ProceduraC(intPratica) &&
AdvancedOperationUtil.isNotWorkflowManuallyStarted(intPratica)){ %>
<div style="margin-right: 50px;"> <div style="margin-right: 50px;">
<liferay-portlet:actionURL <liferay-portlet:actionURL
name="deleteControlloPratica" name="deleteControlloPratica"

Caricamento…
Annulla
Salva