Sfoglia il codice sorgente

fix funzionalità per cambio assegnatario workflow

feature/fix_soggetti
marcoalderighi 2 anni fa
parent
commit
77fc41e292
  1. 11
      liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/portlet/AdvancedOperationPortlet.java
  2. 7
      liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/util/AdvancedOperationUtil.java
  3. 11
      liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/html/view.jsp

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

@ -174,22 +174,21 @@ public class AdvancedOperationPortlet extends MVCPortlet {
public void cambiaIstruttore(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception{ public void cambiaIstruttore(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception{
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
_log.info("== cambiaIstruttore == dentro");
long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId", -1L); long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId", -1L);
long istruttoreId = ParamUtil.getLong(actionRequest, "istruttoreId", -1L); long istruttoreId = ParamUtil.getLong(actionRequest, "istruttoreId", -1L);
IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(intPraticaId); IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(intPraticaId);
WorkflowTask lastTask = AdvancedOperationUtil.getLastTask(intPratica); WorkflowTask lastTask = AdvancedOperationUtil.getLastTask(intPratica);
if (lastTask != null && lastTask.getName().equalsIgnoreCase("Esito")) { if (lastTask != null && lastTask.getName().equalsIgnoreCase("Esito")) {
_log.info("== cambiaIstruttore == lastTask è esito");
List<ControlloPratica> controlloPraticas = ControlloPraticaLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId()); List<ControlloPratica> controlloPraticas = ControlloPraticaLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId());
if(!controlloPraticas.isEmpty() && Validator.isNotNull(controlloPraticas.get(0))){ if(!controlloPraticas.isEmpty()){
_log.info("== cambiaIstruttore == controlloPratica trovato"); for(ControlloPratica controlloPratica : controlloPraticas){
_log.info("== cambiaIstruttore == istruttoreId: "+istruttoreId); if(controlloPratica.getStatus() == WorkflowConstants.STATUS_PENDING){
ControlloPratica controlloPratica = controlloPraticas.get(0);
WorkflowUtil.assegnaUltimoTask(intPratica.getCompanyId(), intPratica.getGroupId(), WorkflowUtil.assegnaUltimoTask(intPratica.getCompanyId(), intPratica.getGroupId(),
istruttoreId, themeDisplay.getUserId(), controlloPratica); istruttoreId, themeDisplay.getUserId(), controlloPratica);
} }
} }
}
}
actionResponse.setRenderParameter("intPraticaId", String.valueOf(intPraticaId)); actionResponse.setRenderParameter("intPraticaId", String.valueOf(intPraticaId));
} }

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

@ -174,11 +174,14 @@ public class AdvancedOperationUtil {
if(Validator.isNotNull(intPratica)){ if(Validator.isNotNull(intPratica)){
try { try {
List<ControlloPratica> controlloPraticas = ControlloPraticaLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId()); List<ControlloPratica> controlloPraticas = ControlloPraticaLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId());
if(!controlloPraticas.isEmpty() && Validator.isNotNull(controlloPraticas.get(0))){ if(!controlloPraticas.isEmpty()){
ControlloPratica controlloPratica = controlloPraticas.get(0); for(ControlloPratica controlloPratica : controlloPraticas){
if(controlloPratica.getStatus() == WorkflowConstants.STATUS_PENDING){
return WorkflowUtil.getLastTask(controlloPratica.getCompanyId(), return WorkflowUtil.getLastTask(controlloPratica.getCompanyId(),
controlloPratica.getGroupId(), null, controlloPratica); controlloPratica.getGroupId(), null, controlloPratica);
} }
}
}
}catch (SystemException | PortalException e){ }catch (SystemException | PortalException e){
_log.error(e,e); _log.error(e,e);
} }

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

@ -1,3 +1,4 @@
<%@page import="com.liferay.portal.kernel.util.HtmlUtil"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.User"%> <%@page import="com.liferay.portal.model.User"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
@ -475,7 +476,6 @@
if(intPratica.getStatusByUserId() != 0L ){ if(intPratica.getStatusByUserId() != 0L ){
User tecnico = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId()); User tecnico = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId());
if (Validator.isNotNull(tecnico)) { if (Validator.isNotNull(tecnico)) {
%> %>
<aui:row> <aui:row>
<div style="display:flex;"> <div style="display:flex;">
@ -511,7 +511,7 @@
<liferay-portlet:param name="mvcPath" value="/html/view.jsp"/> <liferay-portlet:param name="mvcPath" value="/html/view.jsp"/>
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<% <%
String functionCambiaIstruttore = "javascript:"+renderResponse.getNamespace()+"openConfirmationDialog('"+renderResponse.getNamespace()+"cambiaIstruttore','Sei sicuro di voler riassegnare la pratica all istruttore " + tecnico.getFullName() + " ?')"; String functionCambiaIstruttore = "javascript:"+renderResponse.getNamespace()+"openConfirmationDialog('"+renderResponse.getNamespace()+"cambiaIstruttore','Sei sicuro di voler riassegnare la pratica all istruttore?')";
%> %>
<aui:form action="<%= cambiaIstruttoreURL %>" method="post" name="cambiaIstruttore"> <aui:form action="<%= cambiaIstruttoreURL %>" method="post" name="cambiaIstruttore">
<aui:button <aui:button
@ -616,6 +616,13 @@
} }
%> %>
</aui:row> </aui:row>
<aui:row id="controlloPraticaDiv">
<div class="module-group">
<liferay-ui:panel title="CONTROLLO PRATICA" collapsible="false" extended="true">
</liferay-ui:panel>
</div>
</aui:row>
</aui:row> </aui:row>
</aui:row> </aui:row>
<% } %> <% } %>

Caricamento…
Annulla
Salva