|
|
|
@ -10,14 +10,10 @@ import com.liferay.portal.kernel.util.ParamUtil;
|
|
|
|
|
import com.liferay.portal.kernel.util.Validator; |
|
|
|
|
import com.liferay.portal.kernel.util.WebKeys; |
|
|
|
|
import com.liferay.portal.kernel.workflow.WorkflowConstants; |
|
|
|
|
import com.liferay.portal.service.UserLocalServiceUtil; |
|
|
|
|
import com.liferay.portal.theme.ThemeDisplay; |
|
|
|
|
import com.liferay.portal.util.PortalUtil; |
|
|
|
|
import com.liferay.util.bridges.mvc.MVCPortlet; |
|
|
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
import it.nextmind.liferay.portos.advanced.operation.util.AdvancedOperationUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.model.ControlloPratica; |
|
|
|
|
import it.tref.liferay.portos.bo.model.DettPratica; |
|
|
|
@ -28,6 +24,10 @@ import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil;
|
|
|
|
|
import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; |
|
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
import javax.portlet.ActionRequest; |
|
|
|
|
import javax.portlet.ActionResponse; |
|
|
|
|
|
|
|
|
@ -39,16 +39,16 @@ public class AdvancedOperationPortlet extends MVCPortlet {
|
|
|
|
|
|
|
|
|
|
_checkIfUserIsCompanyAdmin(actionRequest); |
|
|
|
|
|
|
|
|
|
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
|
|
|
|
|
|
long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId", 0L); |
|
|
|
|
if (intPraticaId != 0L) { |
|
|
|
|
List<ControlloPratica> controlloPraticaList = |
|
|
|
|
ControlloPraticaLocalServiceUtil.findByIntPraticaId_Status(intPraticaId, WorkflowConstants.STATUS_APPROVED); |
|
|
|
|
ControlloPraticaLocalServiceUtil.findByIntPratica(intPraticaId); |
|
|
|
|
for(ControlloPratica cp : controlloPraticaList){ |
|
|
|
|
_log.info("AdvancedOperationPortlet --- Deleting ControlloPratica " + cp.getControlloPraticaId() + |
|
|
|
|
" of IntPraticaId " + intPraticaId); |
|
|
|
|
ControlloPraticaLocalServiceUtil.deleteControlloPratica(cp); |
|
|
|
|
if(Arrays.asList(AdvancedOperationUtil.STATUS_ARRAY).contains(cp.getStatus())){ |
|
|
|
|
_log.info("AdvancedOperationPortlet --- Deleting ControlloPratica " + cp.getControlloPraticaId() + |
|
|
|
|
" with Status " + cp.getStatus() +" of IntPraticaId " + intPraticaId); |
|
|
|
|
ControlloPraticaLocalServiceUtil.deleteControlloPratica(cp); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
actionResponse.setRenderParameter("intPraticaId", String.valueOf(intPraticaId)); |
|
|
|
|