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. 16
      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);
if (intPraticaId != 0L) {
List<ControlloPratica> controlloPraticaList =
ControlloPraticaLocalServiceUtil.findByIntPratica(intPraticaId);
ControlloPraticaLocalServiceUtil.findByIntPraticaId_Status(intPraticaId, WorkflowConstants.STATUS_APPROVED);
for(ControlloPratica cp : controlloPraticaList){
_log.info("AdvancedOperationPortlet --- Deleting ControlloPratica " + cp.getControlloPraticaId() +
" of IntPraticaId " + intPraticaId);

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

@ -22,19 +22,31 @@ import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil;
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.StatoPraticaConstants;
import java.io.Console;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
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){
if(Constants.PROCEDURA_C.equalsIgnoreCase(intPratica.getTipoProcedura())){
try{
long intPraticaId = intPratica.getIntPraticaId();
List<ControlloPratica> controlloPraticas = ControlloPraticaLocalServiceUtil.findByIntPratica(intPraticaId);
List<ControlloPratica> controlloPraticas =
ControlloPraticaLocalServiceUtil.findByIntPraticaId_Status(intPraticaId, WorkflowConstants.STATUS_APPROVED);
return !controlloPraticas.isEmpty();
} catch (SystemException e){
_log.error(e,e);

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

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

Caricamento…
Annulla
Salva