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. 71
      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. 34
      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.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.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.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.kernel.workflow.WorkflowTask;
import com.liferay.portal.theme.ThemeDisplay;
import com.liferay.portal.util.PortalUtil;
import com.liferay.util.bridges.mvc.MVCPortlet;
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.IntPratica;
import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil;
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 javax.portlet.ActionRequest;
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 {
private static class Privati {
@ -42,6 +59,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{
@ -55,6 +93,40 @@ public class AdvancedOperationPortlet extends MVCPortlet {
} else {
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{
@ -66,6 +138,7 @@ public class AdvancedOperationPortlet extends MVCPortlet {
if(WorkflowConstants.STATUS_INCOMPLETE == intPratica.getStatus()){
Privati.ripristinaPratica(intPratica, WorkflowConstants.STATUS_DRAFT);
actionResponse.setRenderParameter("intPraticaId", String.valueOf(intPraticaId));
} else {
SessionErrors.add(actionRequest, "operazione-impossibile");
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()){
Privati.ripristinaPratica(intPratica, WorkflowConstants.STATUS_APPROVED);
actionResponse.setRenderParameter("intPraticaId", String.valueOf(intPraticaId));
} else {
SessionErrors.add(actionRequest, "operazione-impossibile");
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){
DocPraticaLocalServiceUtil.deleteDocPratica(docPratica);
}
actionResponse.setRenderParameter("intPraticaId", String.valueOf(intPraticaId));
}
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;
import com.liferay.portal.kernel.concurrent.ConcurrentHashSet;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.exception.PortalException;
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.WorkflowTask;
import com.liferay.portal.kernel.workflow.WorkflowTaskManagerUtil;
import com.liferay.portal.model.User;
import com.liferay.portal.model.WorkflowInstanceLink;
import com.liferay.portal.service.UserLocalServiceUtil;
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.DettPratica;
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.IntPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import it.tref.liferay.portos.bo.util.WorkflowUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.SortedSet;
public class AdvancedOperationUtil {
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);
}

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"%>
<%@include file="/html/init.jsp"%>
<%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
%>
<liferay-portlet:actionURL
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.model.DettPratica"%>
<%@page import="com.liferay.portal.model.User"%>
@ -33,11 +34,15 @@
<%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
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);
%>
<liferay-portlet:actionURL
name="findIntPratica"
var="findIntPraticaURL" >
@ -77,9 +82,50 @@
</aui:col>
</aui:row>
</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: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)){ %>
<aui:row style="margin-top: 10px" id="praticaAdminDiv">
<aui:row id="praticaRecapDiv">
@ -123,7 +169,10 @@
</aui:row>
<aui:row>
<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:row>
@ -153,6 +202,30 @@
</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)){ %>
<aui:col span="3">
<liferay-portlet:actionURL
@ -226,6 +299,41 @@
</aui:row>
</liferay-ui:panel>
</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">
<liferay-ui:panel title="IMPERSONAMENTO" extended="true" collapsible="false">
<aui:row>
@ -455,11 +563,54 @@
</div>
<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>
<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)){ %>
A.one('#impersonaSoggettiBtn').on('click', function(){
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)
throws com.liferay.portal.kernel.exception.SystemException;
public int countByIntPratica(long intPraticaId)
throws com.liferay.portal.kernel.exception.SystemException;
public java.lang.Long calculateDateAvvioProcedimento(
long controlloPraticaId)
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" };
_methodName41 = "calculateDateAvvioProcedimento";
_methodName41 = "countByIntPratica";
_methodParameterTypes41 = new String[] { "long" };
_methodName42 = "getOrganizationByControlloPraticaId";
_methodName42 = "calculateDateAvvioProcedimento";
_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
@ -1606,6 +1610,34 @@ public class ControlloPraticaLocalServiceClp
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
public java.lang.Long calculateDateAvvioProcedimento(
long controlloPraticaId)
@ -1614,8 +1646,8 @@ public class ControlloPraticaLocalServiceClp
Object returnObj = null;
try {
returnObj = _invokableLocalService.invokeMethod(_methodName41,
_methodParameterTypes41, new Object[] { controlloPraticaId });
returnObj = _invokableLocalService.invokeMethod(_methodName42,
_methodParameterTypes42, new Object[] { controlloPraticaId });
}
catch (Throwable t) {
t = ClpSerializer.translateThrowable(t);
@ -1648,8 +1680,8 @@ public class ControlloPraticaLocalServiceClp
Object returnObj = null;
try {
returnObj = _invokableLocalService.invokeMethod(_methodName42,
_methodParameterTypes42, new Object[] { controlloPraticaId });
returnObj = _invokableLocalService.invokeMethod(_methodName43,
_methodParameterTypes43, new Object[] { controlloPraticaId });
}
catch (Throwable t) {
t = ClpSerializer.translateThrowable(t);
@ -1682,8 +1714,8 @@ public class ControlloPraticaLocalServiceClp
Object returnObj = null;
try {
returnObj = _invokableLocalService.invokeMethod(_methodName43,
_methodParameterTypes43,
returnObj = _invokableLocalService.invokeMethod(_methodName44,
_methodParameterTypes44,
new Object[] { controlloPraticaId, giorni });
}
catch (Throwable t) {
@ -1796,4 +1828,6 @@ public class ControlloPraticaLocalServiceClp
private String[] _methodParameterTypes42;
private String _methodName43;
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);
}
public static int countByIntPratica(long intPraticaId)
throws com.liferay.portal.kernel.exception.SystemException {
return getService().countByIntPratica(intPraticaId);
}
public static java.lang.Long calculateDateAvvioProcedimento(
long controlloPraticaId)
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);
}
@Override
public int countByIntPratica(long intPraticaId)
throws com.liferay.portal.kernel.exception.SystemException {
return _controlloPraticaLocalService.countByIntPratica(intPraticaId);
}
@Override
public java.lang.Long calculateDateAvvioProcedimento(
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
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" };
_methodName228 = "calculateDateAvvioProcedimento";
_methodName228 = "countByIntPratica";
_methodParameterTypes228 = new String[] { "long" };
_methodName229 = "getOrganizationByControlloPraticaId";
_methodName229 = "calculateDateAvvioProcedimento";
_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,
@ -506,16 +510,21 @@ public class ControlloPraticaLocalServiceClpInvoker {
if (_methodName228.equals(name) &&
Arrays.deepEquals(_methodParameterTypes228, parameterTypes)) {
return ControlloPraticaLocalServiceUtil.calculateDateAvvioProcedimento(((Long)arguments[0]).longValue());
return ControlloPraticaLocalServiceUtil.countByIntPratica(((Long)arguments[0]).longValue());
}
if (_methodName229.equals(name) &&
Arrays.deepEquals(_methodParameterTypes229, parameterTypes)) {
return ControlloPraticaLocalServiceUtil.getOrganizationByControlloPraticaId(((Long)arguments[0]).longValue());
return ControlloPraticaLocalServiceUtil.calculateDateAvvioProcedimento(((Long)arguments[0]).longValue());
}
if (_methodName230.equals(name) &&
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(),
((Integer)arguments[1]).intValue());
}
@ -613,4 +622,6 @@ public class ControlloPraticaLocalServiceClpInvoker {
private String[] _methodParameterTypes229;
private String _methodName230;
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

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

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

@ -941,42 +941,45 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl {
SystemException {
ControlloPratica controlloPratica = controlloPraticaLocalService.getControlloPratica(controlloPraticaId);
IntPratica intPratica = getIntPratica(intPraticaId);
intPratica.setStatusByUserId(istruttoreId);
intPratica.setStatusDate(new Date());
User istruttore = userLocalService.getUser(istruttoreId);
intPratica.setUnitaOperativa(UserUtil.getUnitaOperative(istruttore).last());
intPratica = updateIntPratica(intPratica);
DettPratica dettPratica = dettPraticaLocalService.getLastCompletedByIntPratica(intPraticaId);
User user = PermissionThreadLocal.getPermissionChecker().getUser();
ServiceContext serviceContext = new ServiceContext();
serviceContext.setUserId(user.getUserId());
serviceContext.setScopeGroupId(controlloPratica.getGroupId());
serviceContext.setCompanyId(controlloPratica.getCompanyId());
String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(
StatoPraticaConstants.CAMBIO_ISTRUTTORE);
long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(),
propertiesTemplate);
avvisoLocalService.addAvviso(intPraticaId, StringPool.BLANK, new Date(), AvvisoUtil.TIPO_AVVISO_DIRETTO,
StatoPraticaConstants.CAMBIO_ISTRUTTORE, fileEntryIdTemplate, dettPratica.getDettPraticaId(),
DettPratica.class.getName(), StringPool.BLANK, 0L, 0L, StringPool.BLANK, controlloPraticaId,
serviceContext);
WorkflowTask lastTask = WorkflowUtil.getLastTask(controlloPratica.getCompanyId(),
controlloPratica.getGroupId(), null, controlloPratica);
if (lastTask != null && lastTask.getName().equalsIgnoreCase("Esito")) {
WorkflowUtil.assegnaUltimoTask(controlloPratica.getCompanyId(), controlloPratica.getGroupId(),
istruttoreId, user.getUserId(), controlloPratica);
}
String jsonFormParameters = null;
Map<String, Serializable> parametri = new HashMap<String, Serializable>();
parametri.put("istruttore", String.valueOf(istruttoreId));
JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer();
jsonFormParameters = jsonSerializer.serialize(parametri);
try {
FormLogLocalServiceUtil.addFormLog(lastTask.getWorkflowInstanceId(), 0L, "cambio-istruttore",
jsonFormParameters, serviceContext);
} catch (Exception e) {
_log.error(e, e);
if(lastTask.getName().equalsIgnoreCase("assegnazione")){
IntPratica intPratica = getIntPratica(intPraticaId);
intPratica.setStatusByUserId(istruttoreId);
intPratica.setStatusDate(new Date());
User istruttore = userLocalService.getUser(istruttoreId);
intPratica.setUnitaOperativa(UserUtil.getUnitaOperative(istruttore).last());
intPratica = updateIntPratica(intPratica);
DettPratica dettPratica = dettPraticaLocalService.getLastCompletedByIntPratica(intPraticaId);
User user = PermissionThreadLocal.getPermissionChecker().getUser();
ServiceContext serviceContext = new ServiceContext();
serviceContext.setUserId(user.getUserId());
serviceContext.setScopeGroupId(controlloPratica.getGroupId());
serviceContext.setCompanyId(controlloPratica.getCompanyId());
String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(
StatoPraticaConstants.CAMBIO_ISTRUTTORE);
long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(),
propertiesTemplate);
avvisoLocalService.addAvviso(intPraticaId, StringPool.BLANK, new Date(), AvvisoUtil.TIPO_AVVISO_DIRETTO,
StatoPraticaConstants.CAMBIO_ISTRUTTORE, fileEntryIdTemplate, dettPratica.getDettPraticaId(),
DettPratica.class.getName(), StringPool.BLANK, 0L, 0L, StringPool.BLANK, controlloPraticaId,
serviceContext);
if (lastTask != null && lastTask.getName().equalsIgnoreCase("Esito")) {
WorkflowUtil.assegnaUltimoTask(controlloPratica.getCompanyId(), controlloPratica.getGroupId(),
istruttoreId, user.getUserId(), controlloPratica);
}
String jsonFormParameters = null;
Map<String, Serializable> parametri = new HashMap<String, Serializable>();
parametri.put("istruttore", String.valueOf(istruttoreId));
JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer();
jsonFormParameters = jsonSerializer.serialize(parametri);
try {
FormLogLocalServiceUtil.addFormLog(lastTask.getWorkflowInstanceId(), 0L, "cambio-istruttore",
jsonFormParameters, serviceContext);
} catch (Exception e) {
_log.error(e, e);
}
}
}

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.number=3665
build.date=1683533611843
build.number=3666
build.date=1684145442317
build.auto.upgrade=true
##

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

@ -98,22 +98,24 @@ long territorioGroupId = territorio.getGroupId();
}
%>
</c:if>
<c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId,
ActionKeys.CAMBIO_ISTRUTTORE) %>">
<c:if test="<%= Validator.isNotNull(intPratica.getStatusByUserId()) %>">
<liferay-util:include page="/html/gestioneattivita/actions/action_cambio_istruttore.jsp"
servletContext="<%= application %>" >
<liferay-util:param name="intPraticaId"
value="<%= String.valueOf(intPratica.getIntPraticaId()) %>" />
<liferay-util:param name="controlloPraticaId"
value="<%= String.valueOf(controlloPratica.getControlloPraticaId()) %>" />
<liferay-util:param name="buttonIdCambioIstruttore" value="<%= buttonIdCambioIstruttore %>" />
</liferay-util:include>
<div title='<%= LanguageUtil.get(pageContext, "workflow-action-cambia-istruttore") %>'
class="tooltip-info">
<liferay-ui:icon id="<%= buttonIdCambioIstruttore %>" iconCssClass="fa fa-user-circle"
linkCssClass="btn btn-action" message="" url="#" />
</div>
<c:if test ='<%= listaTask.get(0).getName().equalsIgnoreCase("assegnazione") %>'>
<c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId,
ActionKeys.CAMBIO_ISTRUTTORE) %>">
<c:if test="<%= Validator.isNotNull(intPratica.getStatusByUserId()) %>">
<liferay-util:include page="/html/gestioneattivita/actions/action_cambio_istruttore.jsp"
servletContext="<%= application %>" >
<liferay-util:param name="intPraticaId"
value="<%= String.valueOf(intPratica.getIntPraticaId()) %>" />
<liferay-util:param name="controlloPraticaId"
value="<%= String.valueOf(controlloPratica.getControlloPraticaId()) %>" />
<liferay-util:param name="buttonIdCambioIstruttore" value="<%= buttonIdCambioIstruttore %>" />
</liferay-util:include>
<div title='<%= LanguageUtil.get(pageContext, "workflow-action-cambia-istruttore") %>'
class="tooltip-info">
<liferay-ui:icon id="<%= buttonIdCambioIstruttore %>" iconCssClass="fa fa-user-circle"
linkCssClass="btn btn-action" message="" url="#" />
</div>
</c:if>
</c:if>
</c:if>
<c:if test="<%= IntPraticaPermission.contains(permissionChecker, territorioGroupId,

Caricamento…
Annulla
Salva