Sfoglia il codice sorgente

- funzione unita operative su AOP

- fix cambio istruttore
feature/advanced-operation
marcoalderighi 2 anni fa
parent
commit
38ab684998
  1. BIN
      liferay-plugins-sdk-6.2/dist/portos-bo-shared-6.2.0.1.jar
  2. BIN
      liferay-plugins-sdk-6.2/dist/portos-kaleo-shared-6.2.0.1.jar
  3. BIN
      liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/lib/portos-bo-portlet-service.jar
  4. BIN
      liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/lib/portos-bo-shared.jar
  5. BIN
      liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/lib/portos-kaleo-shared.jar
  6. 75
      liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/portlet/AdvancedOperationPortlet.java
  7. 98
      liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/util/AdvancedOperationUtil.java
  8. 3
      liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/html/azione_correttiva.jsp
  9. 157
      liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/html/view.jsp
  10. BIN
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/portos-bo-portlet-service.jar
  11. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/ControlloPraticaLocalService.java
  12. 54
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/ControlloPraticaLocalServiceClp.java
  13. 5
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/ControlloPraticaLocalServiceUtil.java
  14. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/ControlloPraticaLocalServiceWrapper.java
  15. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties
  16. 23
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/base/ControlloPraticaLocalServiceClpInvoker.java
  17. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java
  18. 7
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java
  19. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  20. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/action_button.jsp

BIN
liferay-plugins-sdk-6.2/dist/portos-bo-shared-6.2.0.1.jar vendored

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/dist/portos-kaleo-shared-6.2.0.1.jar vendored

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/lib/portos-bo-portlet-service.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/lib/portos-bo-shared.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/lib/portos-kaleo-shared.jar

File binario non mostrato.

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

@ -2,27 +2,44 @@ package it.nextmind.liferay.portos.advanced.operation.portlet;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.json.JSONArray;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONObject;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.search.Indexer;
import com.liferay.portal.kernel.search.IndexerRegistryUtil;
import com.liferay.portal.kernel.search.SearchException;
import com.liferay.portal.kernel.servlet.SessionErrors; import com.liferay.portal.kernel.servlet.SessionErrors;
import com.liferay.portal.kernel.util.ParamUtil; import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.util.WebKeys; import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.kernel.workflow.WorkflowConstants; import com.liferay.portal.kernel.workflow.WorkflowConstants;
import com.liferay.portal.kernel.workflow.WorkflowTask;
import com.liferay.portal.theme.ThemeDisplay; import com.liferay.portal.theme.ThemeDisplay;
import com.liferay.portal.util.PortalUtil; import com.liferay.portal.util.PortalUtil;
import com.liferay.util.bridges.mvc.MVCPortlet; import com.liferay.util.bridges.mvc.MVCPortlet;
import it.nextmind.liferay.portos.advanced.operation.util.AdvancedOperationUtil; import it.nextmind.liferay.portos.advanced.operation.util.AdvancedOperationUtil;
import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.model.DocPratica; import it.tref.liferay.portos.bo.model.DocPratica;
import it.tref.liferay.portos.bo.model.IntPratica; import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.util.WorkflowUtil;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.portlet.ActionRequest; import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse; import javax.portlet.ActionResponse;
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.ResourceRequest;
import javax.portlet.ResourceResponse;
public class AdvancedOperationPortlet extends MVCPortlet { public class AdvancedOperationPortlet extends MVCPortlet {
private static class Privati { private static class Privati {
@ -43,6 +60,27 @@ public class AdvancedOperationPortlet extends MVCPortlet {
} }
@Override
public void serveResource(ResourceRequest resourceRequest,
ResourceResponse resourceResponse) throws IOException,
PortletException {
String id = resourceRequest.getResourceID();
if ("brokenUO".equals(id)) {
List<IntPratica> brokenUOList = AdvancedOperationUtil.getBrokenUOList();
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
for(IntPratica intPratica : brokenUOList){
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("id", intPratica.getIntPraticaId());
jsonObject.put("UO", intPratica.getUnitaOperativa());
jsonObject.put("destUO", AdvancedOperationUtil.getDestinationUO(intPratica));
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray);
}
}
public void fixStatusPratica(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception{ public void fixStatusPratica(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception{
Privati.checkIfUserIsCompanyAdmin(actionRequest); Privati.checkIfUserIsCompanyAdmin(actionRequest);
@ -55,6 +93,40 @@ public class AdvancedOperationPortlet extends MVCPortlet {
} else { } else {
SessionErrors.add(actionRequest, "operazione-impossibile"); SessionErrors.add(actionRequest, "operazione-impossibile");
} }
actionResponse.setRenderParameter("intPraticaId", String.valueOf(intPraticaId));
}
public void fixUO(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception{
Privati.checkIfUserIsCompanyAdmin(actionRequest);
long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId", -1L);
IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(intPraticaId);
int destinationUO = AdvancedOperationUtil.getDestinationUO(intPratica);
if (AdvancedOperationUtil.evalUO(intPratica)) {
_setUO(intPratica, destinationUO);
}
actionResponse.setRenderParameter("intPraticaId", String.valueOf(intPraticaId));
}
private void _setUO(IntPratica intPratica, int uo) throws SystemException, SearchException{
intPratica.setUnitaOperativa(uo);
IntPraticaLocalServiceUtil.updateIntPratica(intPratica);
Indexer intPraticaIndexer = IndexerRegistryUtil.getIndexer(IntPratica.class);
intPraticaIndexer.reindex(intPratica);
Indexer controlloPraticaIndexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
List<ControlloPratica> controlloPraticas = ControlloPraticaLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId());
if(!controlloPraticas.isEmpty()){
for(ControlloPratica controlloPratica : controlloPraticas){
if(controlloPratica.getStatus() == WorkflowConstants.STATUS_PENDING){
controlloPraticaIndexer.reindex(intPratica);
}
}
}
} }
public void ripristinaPraticaVidimata(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception{ public void ripristinaPraticaVidimata(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception{
@ -66,6 +138,7 @@ public class AdvancedOperationPortlet extends MVCPortlet {
if(WorkflowConstants.STATUS_INCOMPLETE == intPratica.getStatus()){ if(WorkflowConstants.STATUS_INCOMPLETE == intPratica.getStatus()){
Privati.ripristinaPratica(intPratica, WorkflowConstants.STATUS_DRAFT); Privati.ripristinaPratica(intPratica, WorkflowConstants.STATUS_DRAFT);
actionResponse.setRenderParameter("intPraticaId", String.valueOf(intPraticaId));
} else { } else {
SessionErrors.add(actionRequest, "operazione-impossibile"); SessionErrors.add(actionRequest, "operazione-impossibile");
throw new Exception("This Pratica is not in status=5, action RIPRISTINA is not available"); throw new Exception("This Pratica is not in status=5, action RIPRISTINA is not available");
@ -81,6 +154,7 @@ public class AdvancedOperationPortlet extends MVCPortlet {
if(WorkflowConstants.STATUS_INCOMPLETE == intPratica.getStatus()){ if(WorkflowConstants.STATUS_INCOMPLETE == intPratica.getStatus()){
Privati.ripristinaPratica(intPratica, WorkflowConstants.STATUS_APPROVED); Privati.ripristinaPratica(intPratica, WorkflowConstants.STATUS_APPROVED);
actionResponse.setRenderParameter("intPraticaId", String.valueOf(intPraticaId));
} else { } else {
SessionErrors.add(actionRequest, "operazione-impossibile"); SessionErrors.add(actionRequest, "operazione-impossibile");
throw new Exception("This Pratica is not in status=5, action RIPRISTINA is not available"); throw new Exception("This Pratica is not in status=5, action RIPRISTINA is not available");
@ -97,6 +171,7 @@ public class AdvancedOperationPortlet extends MVCPortlet {
for(DocPratica docPratica : docPraticaOrfani){ for(DocPratica docPratica : docPraticaOrfani){
DocPraticaLocalServiceUtil.deleteDocPratica(docPratica); DocPraticaLocalServiceUtil.deleteDocPratica(docPratica);
} }
actionResponse.setRenderParameter("intPraticaId", String.valueOf(intPraticaId));
} }
public void findIntPratica(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception{ public void findIntPratica(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception{

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

@ -1,5 +1,6 @@
package it.nextmind.liferay.portos.advanced.operation.util; package it.nextmind.liferay.portos.advanced.operation.util;
import com.liferay.portal.kernel.concurrent.ConcurrentHashSet;
import com.liferay.portal.kernel.dao.orm.QueryUtil; import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
@ -9,9 +10,13 @@ import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.workflow.WorkflowConstants; import com.liferay.portal.kernel.workflow.WorkflowConstants;
import com.liferay.portal.kernel.workflow.WorkflowTask; import com.liferay.portal.kernel.workflow.WorkflowTask;
import com.liferay.portal.kernel.workflow.WorkflowTaskManagerUtil; import com.liferay.portal.kernel.workflow.WorkflowTaskManagerUtil;
import com.liferay.portal.model.User;
import com.liferay.portal.model.WorkflowInstanceLink; import com.liferay.portal.model.WorkflowInstanceLink;
import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil; import com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil;
import it.mwg.sismica.bo.shared.util.UnitaOperativeUtil;
import it.mwg.sismica.bo.shared.util.UserUtil;
import it.tref.liferay.portos.bo.model.ControlloPratica; import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.model.DettPratica; import it.tref.liferay.portos.bo.model.DettPratica;
import it.tref.liferay.portos.bo.model.DocPratica; import it.tref.liferay.portos.bo.model.DocPratica;
@ -21,9 +26,11 @@ 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.service.IntPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants; import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import it.tref.liferay.portos.bo.util.WorkflowUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.SortedSet;
public class AdvancedOperationUtil { public class AdvancedOperationUtil {
private static class P_ { private static class P_ {
@ -184,6 +191,97 @@ public class AdvancedOperationUtil {
} }
} }
public static long getCurrentAssignee(IntPratica intPratica){
long currentAssignee = 0;
WorkflowTask lastTask = getLastTask(intPratica);
if(Validator.isNotNull(lastTask)){
if(it.mwg.sismica.bo.shared.util.WorkflowConstants.WORKFLOW_TASKNAME_ESITO.equalsIgnoreCase(lastTask.getName())){
currentAssignee = lastTask.getAssigneeUserId();
}
}
return currentAssignee;
}
public static WorkflowTask getLastTask(IntPratica intPratica){
if(Validator.isNotNull(intPratica)){
try {
List<ControlloPratica> controlloPraticas = ControlloPraticaLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId());
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);
}
}
return null;
}
public static List<IntPratica> getBrokenUOList(){
List<IntPratica> brokenUoList = new ArrayList<IntPratica>();
try {
List<IntPratica> intPraticasList = IntPraticaLocalServiceUtil.getIntPraticas(QueryUtil.ALL_POS, QueryUtil.ALL_POS);
for(IntPratica intPratica : intPraticasList){
if(evalUO(intPratica)){
brokenUoList.add(intPratica);
}
}
} catch (SystemException e) {
_log.error(e,e);
}
return brokenUoList;
}
public static boolean evalCurrentAssignee(IntPratica intPratica, User tecnico){
WorkflowTask lastTask = getLastTask(intPratica);
if(Validator.isNotNull(lastTask) && lastTask.getName().equalsIgnoreCase("Esito")){
return tecnico.getUserId() != lastTask.getAssigneeUserId() || lastTask.getAssigneeUserId() == 0;
}
return false;
}
public static boolean evalUO(IntPratica intPratica){
int uo = intPratica.getUnitaOperativa();
SortedSet<Integer> istruttoreUOs = getIstruttoreUOs(intPratica);
if(Validator.isNotNull(istruttoreUOs)){
return getDestinationUO(intPratica) != uo;
}
return false;
}
public static int getDestinationUO(IntPratica intPratica){
int destination = 0;
SortedSet<Integer> istruttoreUOs = getIstruttoreUOs(intPratica);
if(Validator.isNotNull(istruttoreUOs)){
for(int uo : istruttoreUOs){
if (uo > destination) {
destination = uo;
}
}
}
return destination;
}
public static SortedSet<Integer> getIstruttoreUOs(IntPratica intPratica){
WorkflowTask lastTask = getLastTask(intPratica);
if(Validator.isNotNull(lastTask)){
long assigneeUserId = lastTask.getAssigneeUserId();
try {
User assignee = UserLocalServiceUtil.getUser(assigneeUserId);
return UserUtil.getUnitaOperative(assignee);
} catch (SystemException | PortalException e){
_log.error("AOP ==> Error while analyzing IntPratica: " + intPratica.getIntPraticaId());
_log.error(e,e);
}
}
return null;
}
private static final Log _log = LogFactoryUtil.getLog(AdvancedOperationUtil.class); private static final Log _log = LogFactoryUtil.getLog(AdvancedOperationUtil.class);
} }

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

@ -1,8 +1,9 @@
<%@page import="com.liferay.portal.kernel.util.ParamUtil"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/html/init.jsp"%> <%@include file="/html/init.jsp"%>
<% <%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
%> %>
<liferay-portlet:actionURL <liferay-portlet:actionURL
name="correggiBug" name="correggiBug"

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

@ -1,3 +1,4 @@
<%@page import="it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@page import="com.liferay.portal.model.User"%> <%@page import="com.liferay.portal.model.User"%>
@ -33,11 +34,15 @@
<% <%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
String numeroProgetto = ParamUtil.getString(request, "numeroProgetto", StringPool.BLANK); String numeroProgetto = ParamUtil.getString(request, "numeroProgetto", StringPool.BLANK);
boolean isBrokenUO = ParamUtil.getBoolean(request, "brokenUO", false);
List<IntPratica> brokenUOList = null;
if(isBrokenUO){
brokenUOList = AdvancedOperationUtil.getBrokenUOList();
}
IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(intPraticaId); IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(intPraticaId);
%> %>
<liferay-portlet:actionURL <liferay-portlet:actionURL
name="findIntPratica" name="findIntPratica"
var="findIntPraticaURL" > var="findIntPraticaURL" >
@ -77,9 +82,50 @@
</aui:col> </aui:col>
</aui:row> </aui:row>
</aui:form> </aui:form>
<aui:row>
<liferay-portlet:renderURL varImpl="brokenUOURL" />
<aui:form action="<%= brokenUOURL %>" name="brokenUOfm">
<aui:input name="brokenUO" type="hidden" value="<%= true %>"></aui:input>
<aui:button
name="brokenUOBtn"
type="submit"
value="Trova Problemi Unità Operative" />
</aui:form>
</aui:row>
</aui:col> </aui:col>
</aui:row> </aui:row>
<c:if test="<%= isBrokenUO %>">
<liferay-ui:panel title="UNITA OPERATIVE" defaultState="closed" collapsible="true" extended="true">
<aui:row>
<p>
<b>Numero IntPratica con problemi di Unità Operativa:</b>
<span id="brokenUOnum"><%= brokenUOList.size() %></span>
</p>
<div id="brokenUOList">
<liferay-ui:search-container emptyResultsMessage="Nessun soggetto disponibile">
<liferay-ui:search-container-results
results="<%= brokenUOList %>"
total="<%= brokenUOList.size() %>"
/>
<liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.IntPratica" modelVar="scIntPratica">
<liferay-ui:search-container-column-text name="ID">
<%= scIntPratica.getIntPraticaId() %>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="UNITA OPERATIVA PRATICA">
<%= scIntPratica.getUnitaOperativa() %>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="UNITA OPERATIVA ISTRUTTORE">
<%= AdvancedOperationUtil.getDestinationUO(scIntPratica) %>
</liferay-ui:search-container-column-text>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="false" />
</liferay-ui:search-container>
</div>
</aui:row>
</liferay-ui:panel>
</c:if>
<% if(Validator.isNotNull(intPratica)){ %> <% if(Validator.isNotNull(intPratica)){ %>
<aui:row style="margin-top: 10px" id="praticaAdminDiv"> <aui:row style="margin-top: 10px" id="praticaAdminDiv">
<aui:row id="praticaRecapDiv"> <aui:row id="praticaRecapDiv">
@ -123,7 +169,10 @@
</aui:row> </aui:row>
<aui:row> <aui:row>
<aui:col span="2"> <aui:col span="2">
<p><b>Status:</b> <%= intPratica.getStatus() %></p> <p><b>Status:</b>
<aui:workflow-status status="<%= intPratica.getStatus() %>"></aui:workflow-status>
(<%= intPratica.getStatus() %>)
</p>
</aui:col> </aui:col>
</aui:row> </aui:row>
@ -153,6 +202,30 @@
</aui:col> </aui:col>
<% } %> <% } %>
<% if(AdvancedOperationUtil.evalUO(intPratica)){ %>
<aui:col span="3">
<liferay-portlet:actionURL
name="fixUO"
var="fixUOURL" >
<liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>"/>
<liferay-portlet:param name="mvcPath" value="/html/view.jsp"/>
</liferay-portlet:actionURL>
<%
String functionfixUO = "javascript:"+renderResponse.getNamespace()+"openConfirmationDialog('"+renderResponse.getNamespace()+"fixUO','Sei sicuro di voler cambiare l unita operativa di questa pratica?')";
%>
<aui:form action="<%= fixUOURL %>" method="post" name="fixUO">
<aui:button
type="button"
cssClass="btn-primary"
name="fixUOBtn"
onClick='<%= functionfixUO %>'
value="Fixa l'unita operativa"
>
</aui:button>
</aui:form>
</aui:col>
<% } %>
<% if(AdvancedOperationUtil.isPraticaAnnullata(intPratica)){ %> <% if(AdvancedOperationUtil.isPraticaAnnullata(intPratica)){ %>
<aui:col span="3"> <aui:col span="3">
<liferay-portlet:actionURL <liferay-portlet:actionURL
@ -226,6 +299,41 @@
</aui:row> </aui:row>
</liferay-ui:panel> </liferay-ui:panel>
</div> </div>
<% if(AdvancedOperationUtil.evalUO(intPratica)){ %>
<div class="module-group">
<liferay-ui:panel title="UNITA OPERATIVA" extended="true" collapsible="false">
<aui:row>
<aui:col span="3">
<p><b>UO pratica</b> <%= intPratica.getUnitaOperativa() %></p>
</aui:col>
<aui:col span="3">
<p><b>UO istruttore:</b> <%= AdvancedOperationUtil.getDestinationUO(intPratica) %></p>
</aui:col>
</aui:row>
<aui:row>
<liferay-portlet:actionURL
name="fixUO"
var="fixUOURL" >
<liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>"/>
<liferay-portlet:param name="mvcPath" value="/html/view.jsp"/>
</liferay-portlet:actionURL>
<%
String functionfixUO = "javascript:"+renderResponse.getNamespace()+"openConfirmationDialog('"+renderResponse.getNamespace()+"fixUO','Sei sicuro di voler cambiare l unita operativa di questa pratica?')";
%>
<aui:form action="<%= fixUOURL %>" method="post" name="fixUO">
<aui:button
type="button"
cssClass="btn-primary"
name="fixUOBtn"
onClick='<%= functionfixUO %>'
value="Fixa l'unita operativa"
>
</aui:button>
</aui:form>
</aui:row>
</liferay-ui:panel>
</div>
<% } %>
<div class="module-group"> <div class="module-group">
<liferay-ui:panel title="IMPERSONAMENTO" extended="true" collapsible="false"> <liferay-ui:panel title="IMPERSONAMENTO" extended="true" collapsible="false">
<aui:row> <aui:row>
@ -455,11 +563,54 @@
</div> </div>
<div id="<portlet:namespace/>gestioneAttivitaId"> <div id="<portlet:namespace/>gestioneAttivitaId">
<jsp:include page='/html/altri_task.jsp'/> <liferay-util:include page="/html/altri_task.jsp">
<liferay-util:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>"></liferay-util:param>
</liferay-util:include>
<%-- <jsp:include page='/html/altri_task.jsp'/> --%>
</div> </div>
<aui:script use="event-valuechange,aui-modal,aui-io-request"> <aui:script use="event-valuechange,aui-modal,aui-io-request">
/*
var getBrokenUO = function (url) {
A.io.request(url, {
on: {
success: function () {
var responseData = this.get('responseData');
var brokenUOList = JSON.parse(responseData);
var brokenUOnum = Object.keys(intPraticaList).length;
A.one('#brokenUOnum').text(brokenUOnum);
if(0 < brokenUOnum){
$each(brokenUOList, function(i, value){
var rowId = createRow(A.one('#brokenUOList'), value.id);
createCol(rowId, 'UO', value.UO);
createCol(rowId, 'UO', value.UO);
createCol(rowId, 'destUO', value.destUO);
});
};
},
},
});
};
var createRow = function(container, UOid){
var id = 'brokenUO-'+ UOid ;
container.append('<aui:row id="'+ id +'"></aui:row>');
return id;
};
var createCol = function(container, colName, colVal){
container.append('<aui:col span="2" id="brokenUO-'colName + '">' +
'<p><b>'+ colName +':</b> '+ colVal +'</p>' +
'</aui:col>');
};
A.one('#brokenUOBtn').on('click', function(){
this.preventDefault();
var url = this.attr('href');
// getBrokenUO(url);
});
*/
<% if(Validator.isNotNull(intPratica)){ %> <% if(Validator.isNotNull(intPratica)){ %>
A.one('#impersonaSoggettiBtn').on('click', function(){ A.one('#impersonaSoggettiBtn').on('click', function(){
var soggettoDiv = A.one('#sc-soggetti-da-impersonare'); var soggettoDiv = A.one('#sc-soggetti-da-impersonare');

BIN
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/portos-bo-portlet-service.jar

File binario non mostrato.

3
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/ControlloPraticaLocalService.java

@ -416,6 +416,9 @@ public interface ControlloPraticaLocalService extends BaseLocalService,
long intPraticaId) long intPraticaId)
throws com.liferay.portal.kernel.exception.SystemException; throws com.liferay.portal.kernel.exception.SystemException;
public int countByIntPratica(long intPraticaId)
throws com.liferay.portal.kernel.exception.SystemException;
public java.lang.Long calculateDateAvvioProcedimento( public java.lang.Long calculateDateAvvioProcedimento(
long controlloPraticaId) long controlloPraticaId)
throws com.liferay.portal.kernel.exception.PortalException, throws com.liferay.portal.kernel.exception.PortalException,

54
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/ControlloPraticaLocalServiceClp.java

@ -222,17 +222,21 @@ public class ControlloPraticaLocalServiceClp
_methodParameterTypes40 = new String[] { "long" }; _methodParameterTypes40 = new String[] { "long" };
_methodName41 = "calculateDateAvvioProcedimento"; _methodName41 = "countByIntPratica";
_methodParameterTypes41 = new String[] { "long" }; _methodParameterTypes41 = new String[] { "long" };
_methodName42 = "getOrganizationByControlloPraticaId"; _methodName42 = "calculateDateAvvioProcedimento";
_methodParameterTypes42 = new String[] { "long" }; _methodParameterTypes42 = new String[] { "long" };
_methodName43 = "getCarichiLavoro"; _methodName43 = "getOrganizationByControlloPraticaId";
_methodParameterTypes43 = new String[] { "long", "int" }; _methodParameterTypes43 = new String[] { "long" };
_methodName44 = "getCarichiLavoro";
_methodParameterTypes44 = new String[] { "long", "int" };
} }
@Override @Override
@ -1606,6 +1610,34 @@ public class ControlloPraticaLocalServiceClp
return (java.util.List<it.tref.liferay.portos.bo.model.ControlloPratica>)ClpSerializer.translateOutput(returnObj); return (java.util.List<it.tref.liferay.portos.bo.model.ControlloPratica>)ClpSerializer.translateOutput(returnObj);
} }
@Override
public int countByIntPratica(long intPraticaId)
throws com.liferay.portal.kernel.exception.SystemException {
Object returnObj = null;
try {
returnObj = _invokableLocalService.invokeMethod(_methodName41,
_methodParameterTypes41, new Object[] { intPraticaId });
}
catch (Throwable t) {
t = ClpSerializer.translateThrowable(t);
if (t instanceof com.liferay.portal.kernel.exception.SystemException) {
throw (com.liferay.portal.kernel.exception.SystemException)t;
}
if (t instanceof RuntimeException) {
throw (RuntimeException)t;
}
else {
throw new RuntimeException(t.getClass().getName() +
" is not a valid exception");
}
}
return ((Integer)returnObj).intValue();
}
@Override @Override
public java.lang.Long calculateDateAvvioProcedimento( public java.lang.Long calculateDateAvvioProcedimento(
long controlloPraticaId) long controlloPraticaId)
@ -1614,8 +1646,8 @@ public class ControlloPraticaLocalServiceClp
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName41, returnObj = _invokableLocalService.invokeMethod(_methodName42,
_methodParameterTypes41, new Object[] { controlloPraticaId }); _methodParameterTypes42, new Object[] { controlloPraticaId });
} }
catch (Throwable t) { catch (Throwable t) {
t = ClpSerializer.translateThrowable(t); t = ClpSerializer.translateThrowable(t);
@ -1648,8 +1680,8 @@ public class ControlloPraticaLocalServiceClp
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName42, returnObj = _invokableLocalService.invokeMethod(_methodName43,
_methodParameterTypes42, new Object[] { controlloPraticaId }); _methodParameterTypes43, new Object[] { controlloPraticaId });
} }
catch (Throwable t) { catch (Throwable t) {
t = ClpSerializer.translateThrowable(t); t = ClpSerializer.translateThrowable(t);
@ -1682,8 +1714,8 @@ public class ControlloPraticaLocalServiceClp
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName43, returnObj = _invokableLocalService.invokeMethod(_methodName44,
_methodParameterTypes43, _methodParameterTypes44,
new Object[] { controlloPraticaId, giorni }); new Object[] { controlloPraticaId, giorni });
} }
catch (Throwable t) { catch (Throwable t) {
@ -1796,4 +1828,6 @@ public class ControlloPraticaLocalServiceClp
private String[] _methodParameterTypes42; private String[] _methodParameterTypes42;
private String _methodName43; private String _methodName43;
private String[] _methodParameterTypes43; private String[] _methodParameterTypes43;
private String _methodName44;
private String[] _methodParameterTypes44;
} }

5
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/ControlloPraticaLocalServiceUtil.java

@ -493,6 +493,11 @@ public class ControlloPraticaLocalServiceUtil {
return getService().findByIntPratica(intPraticaId); return getService().findByIntPratica(intPraticaId);
} }
public static int countByIntPratica(long intPraticaId)
throws com.liferay.portal.kernel.exception.SystemException {
return getService().countByIntPratica(intPraticaId);
}
public static java.lang.Long calculateDateAvvioProcedimento( public static java.lang.Long calculateDateAvvioProcedimento(
long controlloPraticaId) long controlloPraticaId)
throws com.liferay.portal.kernel.exception.PortalException, throws com.liferay.portal.kernel.exception.PortalException,

6
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/ControlloPraticaLocalServiceWrapper.java

@ -524,6 +524,12 @@ public class ControlloPraticaLocalServiceWrapper
return _controlloPraticaLocalService.findByIntPratica(intPraticaId); return _controlloPraticaLocalService.findByIntPratica(intPraticaId);
} }
@Override
public int countByIntPratica(long intPraticaId)
throws com.liferay.portal.kernel.exception.SystemException {
return _controlloPraticaLocalService.countByIntPratica(intPraticaId);
}
@Override @Override
public java.lang.Long calculateDateAvvioProcedimento( public java.lang.Long calculateDateAvvioProcedimento(
long controlloPraticaId) long controlloPraticaId)

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties

@ -1390,3 +1390,5 @@ note-assegnatore = Note dell'assegnatore
note-approvatore = Note dell'approvatore note-approvatore = Note dell'approvatore
pratica-ospedali = P.R. Ospedaliera pratica-ospedali = P.R. Ospedaliera
upload = Carica
attach = Allega

23
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/base/ControlloPraticaLocalServiceClpInvoker.java

@ -230,17 +230,21 @@ public class ControlloPraticaLocalServiceClpInvoker {
_methodParameterTypes227 = new String[] { "long" }; _methodParameterTypes227 = new String[] { "long" };
_methodName228 = "calculateDateAvvioProcedimento"; _methodName228 = "countByIntPratica";
_methodParameterTypes228 = new String[] { "long" }; _methodParameterTypes228 = new String[] { "long" };
_methodName229 = "getOrganizationByControlloPraticaId"; _methodName229 = "calculateDateAvvioProcedimento";
_methodParameterTypes229 = new String[] { "long" }; _methodParameterTypes229 = new String[] { "long" };
_methodName230 = "getCarichiLavoro"; _methodName230 = "getOrganizationByControlloPraticaId";
_methodParameterTypes230 = new String[] { "long", "int" }; _methodParameterTypes230 = new String[] { "long" };
_methodName231 = "getCarichiLavoro";
_methodParameterTypes231 = new String[] { "long", "int" };
} }
public Object invokeMethod(String name, String[] parameterTypes, public Object invokeMethod(String name, String[] parameterTypes,
@ -506,16 +510,21 @@ public class ControlloPraticaLocalServiceClpInvoker {
if (_methodName228.equals(name) && if (_methodName228.equals(name) &&
Arrays.deepEquals(_methodParameterTypes228, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes228, parameterTypes)) {
return ControlloPraticaLocalServiceUtil.calculateDateAvvioProcedimento(((Long)arguments[0]).longValue()); return ControlloPraticaLocalServiceUtil.countByIntPratica(((Long)arguments[0]).longValue());
} }
if (_methodName229.equals(name) && if (_methodName229.equals(name) &&
Arrays.deepEquals(_methodParameterTypes229, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes229, parameterTypes)) {
return ControlloPraticaLocalServiceUtil.getOrganizationByControlloPraticaId(((Long)arguments[0]).longValue()); return ControlloPraticaLocalServiceUtil.calculateDateAvvioProcedimento(((Long)arguments[0]).longValue());
} }
if (_methodName230.equals(name) && if (_methodName230.equals(name) &&
Arrays.deepEquals(_methodParameterTypes230, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes230, parameterTypes)) {
return ControlloPraticaLocalServiceUtil.getOrganizationByControlloPraticaId(((Long)arguments[0]).longValue());
}
if (_methodName231.equals(name) &&
Arrays.deepEquals(_methodParameterTypes231, parameterTypes)) {
return ControlloPraticaLocalServiceUtil.getCarichiLavoro(((Long)arguments[0]).longValue(), return ControlloPraticaLocalServiceUtil.getCarichiLavoro(((Long)arguments[0]).longValue(),
((Integer)arguments[1]).intValue()); ((Integer)arguments[1]).intValue());
} }
@ -613,4 +622,6 @@ public class ControlloPraticaLocalServiceClpInvoker {
private String[] _methodParameterTypes229; private String[] _methodParameterTypes229;
private String _methodName230; private String _methodName230;
private String[] _methodParameterTypes230; private String[] _methodParameterTypes230;
private String _methodName231;
private String[] _methodParameterTypes231;
} }

6
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java

@ -689,6 +689,12 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
return controlloPraticaPersistence.findByIntPraticaId(intPraticaId); return controlloPraticaPersistence.findByIntPraticaId(intPraticaId);
} }
@Override
public int countByIntPratica(long intPraticaId) throws SystemException {
return controlloPraticaPersistence.countByIntPraticaId(intPraticaId);
}
@Override @Override
public Long calculateDateAvvioProcedimento(long controlloPraticaId) throws SystemException, PortalException { public Long calculateDateAvvioProcedimento(long controlloPraticaId) throws SystemException, PortalException {

7
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java

@ -941,6 +941,10 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl {
SystemException { SystemException {
ControlloPratica controlloPratica = controlloPraticaLocalService.getControlloPratica(controlloPraticaId); ControlloPratica controlloPratica = controlloPraticaLocalService.getControlloPratica(controlloPraticaId);
WorkflowTask lastTask = WorkflowUtil.getLastTask(controlloPratica.getCompanyId(),
controlloPratica.getGroupId(), null, controlloPratica);
if(lastTask.getName().equalsIgnoreCase("assegnazione")){
IntPratica intPratica = getIntPratica(intPraticaId); IntPratica intPratica = getIntPratica(intPraticaId);
intPratica.setStatusByUserId(istruttoreId); intPratica.setStatusByUserId(istruttoreId);
intPratica.setStatusDate(new Date()); intPratica.setStatusDate(new Date());
@ -961,8 +965,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl {
StatoPraticaConstants.CAMBIO_ISTRUTTORE, fileEntryIdTemplate, dettPratica.getDettPraticaId(), StatoPraticaConstants.CAMBIO_ISTRUTTORE, fileEntryIdTemplate, dettPratica.getDettPraticaId(),
DettPratica.class.getName(), StringPool.BLANK, 0L, 0L, StringPool.BLANK, controlloPraticaId, DettPratica.class.getName(), StringPool.BLANK, 0L, 0L, StringPool.BLANK, controlloPraticaId,
serviceContext); serviceContext);
WorkflowTask lastTask = WorkflowUtil.getLastTask(controlloPratica.getCompanyId(),
controlloPratica.getGroupId(), null, controlloPratica);
if (lastTask != null && lastTask.getName().equalsIgnoreCase("Esito")) { if (lastTask != null && lastTask.getName().equalsIgnoreCase("Esito")) {
WorkflowUtil.assegnaUltimoTask(controlloPratica.getCompanyId(), controlloPratica.getGroupId(), WorkflowUtil.assegnaUltimoTask(controlloPratica.getCompanyId(), controlloPratica.getGroupId(),
istruttoreId, user.getUserId(), controlloPratica); istruttoreId, user.getUserId(), controlloPratica);
@ -979,6 +981,7 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl {
_log.error(e, e); _log.error(e, e);
} }
} }
}
@Override @Override
public int countCaricoLavoroCF(long ispettoreId, String tipoPratica, Long[] intPraticaIds) throws SystemException, public int countCaricoLavoroCF(long ispettoreId, String tipoPratica, Long[] intPraticaIds) throws SystemException,

4
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties

@ -13,8 +13,8 @@
## ##
build.namespace=portos_bo build.namespace=portos_bo
build.number=3665 build.number=3666
build.date=1683533611843 build.date=1684145442317
build.auto.upgrade=true build.auto.upgrade=true
## ##

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/action_button.jsp

@ -98,6 +98,7 @@ long territorioGroupId = territorio.getGroupId();
} }
%> %>
</c:if> </c:if>
<c:if test ='<%= listaTask.get(0).getName().equalsIgnoreCase("assegnazione") %>'>
<c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId, <c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId,
ActionKeys.CAMBIO_ISTRUTTORE) %>"> ActionKeys.CAMBIO_ISTRUTTORE) %>">
<c:if test="<%= Validator.isNotNull(intPratica.getStatusByUserId()) %>"> <c:if test="<%= Validator.isNotNull(intPratica.getStatusByUserId()) %>">
@ -116,6 +117,7 @@ long territorioGroupId = territorio.getGroupId();
</div> </div>
</c:if> </c:if>
</c:if> </c:if>
</c:if>
<c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId, <c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId,
ActionKeys.RICHIEDI_PARERE_GEOLOGO) || intPratica.getStatusByUserId() == user.getUserId() %>"> ActionKeys.RICHIEDI_PARERE_GEOLOGO) || intPratica.getStatusByUserId() == user.getUserId() %>">
<c:if test="<%= !listaTask.isEmpty() %>"> <c:if test="<%= !listaTask.isEmpty() %>">

Caricamento…
Annulla
Salva