Sfoglia il codice sorgente

fix funzionalità per cambio assegnatario workflow

feature/fix_soggetti
marcoalderighi 2 anni fa
parent
commit
77fc41e292
  1. 15
      liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/portlet/AdvancedOperationPortlet.java
  2. 11
      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

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

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

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

@ -174,10 +174,13 @@ public class AdvancedOperationUtil {
if(Validator.isNotNull(intPratica)){
try {
List<ControlloPratica> controlloPraticas = ControlloPraticaLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId());
if(!controlloPraticas.isEmpty() && Validator.isNotNull(controlloPraticas.get(0))){
ControlloPratica controlloPratica = controlloPraticas.get(0);
return WorkflowUtil.getLastTask(controlloPratica.getCompanyId(),
controlloPratica.getGroupId(), null, controlloPratica);
if(!controlloPraticas.isEmpty()){
for(ControlloPratica controlloPratica : controlloPraticas){
if(controlloPratica.getStatus() == WorkflowConstants.STATUS_PENDING){
return WorkflowUtil.getLastTask(controlloPratica.getCompanyId(),
controlloPratica.getGroupId(), null, controlloPratica);
}
}
}
}catch (SystemException | PortalException 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.model.User"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
@ -475,7 +476,6 @@
if(intPratica.getStatusByUserId() != 0L ){
User tecnico = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId());
if (Validator.isNotNull(tecnico)) {
%>
<aui:row>
<div style="display:flex;">
@ -511,7 +511,7 @@
<liferay-portlet:param name="mvcPath" value="/html/view.jsp"/>
</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:button
@ -616,6 +616,13 @@
}
%>
</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>
<% } %>

Caricamento…
Annulla
Salva