|
|
|
@ -88,7 +88,7 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
String statoPratica = ParamUtil.getString(actionRequest, "statoPratica"); |
|
|
|
|
String committente = ParamUtil.getString(actionRequest, "committente"); |
|
|
|
|
String soggettiInterconnessi = ParamUtil.getString(actionRequest, "soggettiInterconnessi"); |
|
|
|
|
//ADT BUG BO ID = 8
|
|
|
|
|
// ADT BUG BO ID = 8
|
|
|
|
|
String istruttore = ParamUtil.getString(actionRequest, "istruttore"); |
|
|
|
|
String dataRichiestaInizio = ParamUtil.getString(actionRequest, "dataRichiestaInizio"); |
|
|
|
|
String dataRichiestaFine = ParamUtil.getString(actionRequest, "dataRichiestaFine"); |
|
|
|
@ -103,12 +103,12 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
actionResponse.setRenderParameter("numeroProgetto", numeroProgetto); |
|
|
|
|
actionResponse.setRenderParameter("protocollo", protocollo); |
|
|
|
|
|
|
|
|
|
//ADT - BUG-11 Aggiunta filtro ricerca
|
|
|
|
|
if(Validator.isNotNull(tipoPratica)){ |
|
|
|
|
if("co".equalsIgnoreCase(tipoPratica)){ |
|
|
|
|
// ADT - BUG-11 Aggiunta filtro ricerca
|
|
|
|
|
if (Validator.isNotNull(tipoPratica)) { |
|
|
|
|
if ("co".equalsIgnoreCase(tipoPratica)) { |
|
|
|
|
tipoPratica = Constants.TIPO_PRATICA_DEPOSITO; |
|
|
|
|
actionResponse.setRenderParameter("controlloObbligatorio", Boolean.TRUE.toString()); |
|
|
|
|
} else if("sorteggio".equalsIgnoreCase(tipoPratica)){ |
|
|
|
|
} else if ("sorteggio".equalsIgnoreCase(tipoPratica)) { |
|
|
|
|
tipoPratica = Constants.TIPO_PRATICA_DEPOSITO; |
|
|
|
|
actionResponse.setRenderParameter("sorteggiata", Boolean.TRUE.toString()); |
|
|
|
|
} |
|
|
|
@ -126,20 +126,20 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
if (dataRichiestaInizio != null && !dataRichiestaInizio.equals("")) { |
|
|
|
|
String[] dataRichiestaInizioSplitted = dataRichiestaInizio.split("/"); |
|
|
|
|
|
|
|
|
|
int mounth = Integer.valueOf(dataRichiestaInizioSplitted[1]) -1; |
|
|
|
|
int mounth = Integer.valueOf(dataRichiestaInizioSplitted[1]) - 1; |
|
|
|
|
|
|
|
|
|
actionResponse.setRenderParameter("dataRichiestaInizioDay", dataRichiestaInizioSplitted[0]); |
|
|
|
|
actionResponse.setRenderParameter("dataRichiestaInizioMonth", mounth+""); |
|
|
|
|
actionResponse.setRenderParameter("dataRichiestaInizioMonth", mounth + ""); |
|
|
|
|
actionResponse.setRenderParameter("dataRichiestaInizioYear", dataRichiestaInizioSplitted[2]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (dataRichiestaFine != null && !dataRichiestaFine.equals("")) { |
|
|
|
|
String[] dataRichiestaFineSplitted = dataRichiestaFine.split("/"); |
|
|
|
|
|
|
|
|
|
int mounth = Integer.valueOf(dataRichiestaFineSplitted[1]) -1; |
|
|
|
|
int mounth = Integer.valueOf(dataRichiestaFineSplitted[1]) - 1; |
|
|
|
|
|
|
|
|
|
actionResponse.setRenderParameter("dataRichiestaFineDay", dataRichiestaFineSplitted[0]); |
|
|
|
|
actionResponse.setRenderParameter("dataRichiestaFineMonth", mounth+""); |
|
|
|
|
actionResponse.setRenderParameter("dataRichiestaFineMonth", mounth + ""); |
|
|
|
|
actionResponse.setRenderParameter("dataRichiestaFineYear", dataRichiestaFineSplitted[2]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -158,7 +158,8 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
long istruttoreId = ParamUtil.getLong(actionRequest, "istruttoreId"); |
|
|
|
|
try { |
|
|
|
|
IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); |
|
|
|
|
if (Validator.isNotNull(intPratica.getStatusByUserId()) && intPratica.getStatusByUserId() != istruttoreId) { |
|
|
|
|
if (Validator.isNotNull(intPratica.getStatusByUserId()) |
|
|
|
|
&& intPratica.getStatusByUserId() != istruttoreId) { |
|
|
|
|
IntPraticaServiceUtil.cambiaIstruttore(intPraticaId, controlloPraticaId, istruttoreId); |
|
|
|
|
} else { |
|
|
|
|
throw new SystemException("cambio istruttore non possibile"); |
|
|
|
@ -169,35 +170,45 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// public void assegnamiTask(ActionRequest actionRequest, ActionResponse actionResponse) {
|
|
|
|
|
// public void assegnamiTask(ActionRequest actionRequest, ActionResponse
|
|
|
|
|
// actionResponse) {
|
|
|
|
|
//
|
|
|
|
|
// long controlloPraticaId = ParamUtil.getLong(actionRequest, "controlloPraticaId");
|
|
|
|
|
// long controlloPraticaId = ParamUtil.getLong(actionRequest,
|
|
|
|
|
// "controlloPraticaId");
|
|
|
|
|
// long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId");
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// try {
|
|
|
|
|
// ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
|
|
|
|
|
// ServiceContext serviceContext =
|
|
|
|
|
// ServiceContextFactory.getInstance(actionRequest);
|
|
|
|
|
// ControlloPratica controlloPratica =
|
|
|
|
|
// ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId);
|
|
|
|
|
//
|
|
|
|
|
// IntPratica intPratica =
|
|
|
|
|
// IntPraticaLocalServiceUtil.getIntPratica(controlloPratica.getIntPraticaId());
|
|
|
|
|
// Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
|
|
|
|
|
// Territorio territorio =
|
|
|
|
|
// TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
|
|
|
|
|
// IntPraticaPermission.check(PermissionThreadLocal.getPermissionChecker(),
|
|
|
|
|
// territorio.getGroupId(),
|
|
|
|
|
// ActionKeys.ASSEGNA_A_ME);
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// WorkflowTask lastWorkflowTask =
|
|
|
|
|
// WorkflowUtil.getLastTask(controlloPratica.getCompanyId(), controlloPratica.getGroupId(), null,
|
|
|
|
|
// WorkflowUtil.getLastTask(controlloPratica.getCompanyId(),
|
|
|
|
|
// controlloPratica.getGroupId(), null,
|
|
|
|
|
// controlloPratica);
|
|
|
|
|
// if (lastWorkflowTask != null && lastWorkflowTask.getWorkflowTaskId() == workflowTaskId
|
|
|
|
|
// if (lastWorkflowTask != null && lastWorkflowTask.getWorkflowTaskId() ==
|
|
|
|
|
// workflowTaskId
|
|
|
|
|
// && !lastWorkflowTask.getWorkflowTaskAssignees().isEmpty()) {
|
|
|
|
|
// boolean assegnazionePossibile = false;
|
|
|
|
|
// for (WorkflowTaskAssignee workflowTaskAssignee : lastWorkflowTask.getWorkflowTaskAssignees()) {
|
|
|
|
|
// if (workflowTaskAssignee.getAssigneeClassName().equalsIgnoreCase(Role.class.getName())
|
|
|
|
|
// && UserGroupRoleLocalServiceUtil.hasUserGroupRole(serviceContext.getUserId(),
|
|
|
|
|
// controlloPratica.getGroupId(), workflowTaskAssignee.getAssigneeClassPK(), true)) {
|
|
|
|
|
// for (WorkflowTaskAssignee workflowTaskAssignee :
|
|
|
|
|
// lastWorkflowTask.getWorkflowTaskAssignees()) {
|
|
|
|
|
// if
|
|
|
|
|
// (workflowTaskAssignee.getAssigneeClassName().equalsIgnoreCase(Role.class.getName())
|
|
|
|
|
// &&
|
|
|
|
|
// UserGroupRoleLocalServiceUtil.hasUserGroupRole(serviceContext.getUserId(),
|
|
|
|
|
// controlloPratica.getGroupId(), workflowTaskAssignee.getAssigneeClassPK(),
|
|
|
|
|
// true)) {
|
|
|
|
|
// assegnazionePossibile = true;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
@ -207,7 +218,8 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
// workflowTaskId, serviceContext.getUserId(), StringPool.BLANK, null,
|
|
|
|
|
// WorkflowUtil.getWorkflowContext(controlloPratica));
|
|
|
|
|
// } else {
|
|
|
|
|
// throw new SystemException("assegnazione task non possibile per il ruolo");
|
|
|
|
|
// throw new
|
|
|
|
|
// SystemException("assegnazione task non possibile per il ruolo");
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// throw new SystemException("assegnazione task non possibile");
|
|
|
|
@ -225,14 +237,15 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); |
|
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId); |
|
|
|
|
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(controlloPratica.getIntPraticaId()); |
|
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil |
|
|
|
|
.getControlloPratica(controlloPraticaId); |
|
|
|
|
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(controlloPratica |
|
|
|
|
.getIntPraticaId()); |
|
|
|
|
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); |
|
|
|
|
IntPraticaPermission.check(PermissionThreadLocal.getPermissionChecker(), territorio.getGroupId(), |
|
|
|
|
ActionKeys.ASSEGNA_AL_RUOLO); |
|
|
|
|
WorkflowTask lastWorkflowTask = |
|
|
|
|
WorkflowUtil.getLastTask(controlloPratica.getCompanyId(), controlloPratica.getGroupId(), null, |
|
|
|
|
controlloPratica); |
|
|
|
|
WorkflowTask lastWorkflowTask = WorkflowUtil.getLastTask(controlloPratica.getCompanyId(), |
|
|
|
|
controlloPratica.getGroupId(), null, controlloPratica); |
|
|
|
|
if (lastWorkflowTask != null && lastWorkflowTask.getWorkflowTaskId() == workflowTaskId |
|
|
|
|
&& !lastWorkflowTask.getWorkflowTaskAssignees().isEmpty()) { |
|
|
|
|
Role role = null; |
|
|
|
@ -251,8 +264,9 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
WorkflowTaskManagerUtil.assignWorkflowTaskToRole(controlloPratica.getCompanyId(), serviceContext.getUserId(), |
|
|
|
|
workflowTaskId, role.getRoleId(), StringPool.BLANK, null, WorkflowUtil.getWorkflowContext(controlloPratica)); |
|
|
|
|
WorkflowTaskManagerUtil.assignWorkflowTaskToRole(controlloPratica.getCompanyId(), |
|
|
|
|
serviceContext.getUserId(), workflowTaskId, role.getRoleId(), StringPool.BLANK, null, |
|
|
|
|
WorkflowUtil.getWorkflowContext(controlloPratica)); |
|
|
|
|
} else { |
|
|
|
|
throw new SystemException("riassegnare al ruolo non possibile"); |
|
|
|
|
} |
|
|
|
@ -293,8 +307,9 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
serviceContext.setCreateDate(new Date()); |
|
|
|
|
serviceContext.setModifiedDate(new Date()); |
|
|
|
|
if (ParereGeologoLocalServiceUtil.countByIntPraticaIdParereVuoto(intPraticaId) == 0) { |
|
|
|
|
ParereGeologo parereGeologo=ParereGeologoServiceUtil.addParereGeologo(geologoId, intPraticaId, dettPraticaId, serviceContext); |
|
|
|
|
//ADT: aggiunta notifica geologo
|
|
|
|
|
ParereGeologo parereGeologo = ParereGeologoServiceUtil.addParereGeologo(geologoId, |
|
|
|
|
intPraticaId, dettPraticaId, serviceContext); |
|
|
|
|
// ADT: aggiunta notifica geologo
|
|
|
|
|
MailUtil.invioNotificaGeologo(parereGeologo, serviceContext); |
|
|
|
|
} else { |
|
|
|
|
throw new PortalException("parere geologo gia presente"); |
|
|
|
@ -312,20 +327,22 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId"); |
|
|
|
|
long controlloPraticaId = ParamUtil.getLong(actionRequest, "controlloPraticaId"); |
|
|
|
|
long lastDettPraticaId = ParamUtil.getLong(actionRequest, "lastDettPraticaId"); |
|
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId); |
|
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil |
|
|
|
|
.getControlloPratica(controlloPraticaId); |
|
|
|
|
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); |
|
|
|
|
if (lastDettPraticaId != controlloPratica.getDettPraticaId() |
|
|
|
|
&& intPratica.getStatusByUserId() == serviceContext.getUserId()) { |
|
|
|
|
//ADT: BUG ID=5
|
|
|
|
|
ControlloPraticaLocalServiceUtil.addPraticheAlControlloVarianti(controlloPraticaId, lastDettPraticaId,serviceContext); |
|
|
|
|
// ADT: BUG ID=5
|
|
|
|
|
ControlloPraticaLocalServiceUtil.addPraticheAlControlloVarianti(controlloPraticaId, |
|
|
|
|
lastDettPraticaId, serviceContext); |
|
|
|
|
} else { |
|
|
|
|
SessionErrors.add(actionRequest, "error-aggiunta-pratiche-al-controllo"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, |
|
|
|
|
PortletException { |
|
|
|
|
public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) |
|
|
|
|
throws IOException, PortletException { |
|
|
|
|
|
|
|
|
|
ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
|
Locale locale = themeDisplay.getLocale(); |
|
|
|
@ -344,19 +361,21 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
csv = exportToCSV(locale, resourceRequest, true, user); |
|
|
|
|
} else if (cmd.equals("po")) { |
|
|
|
|
csv = exportToCSV(locale, resourceRequest, false, user); |
|
|
|
|
} else if (cmd.equals("exportRicercaMieAttivita") || cmd.equals("exportRicercaMieiRuoli") || cmd.equals("exportRicercaAltreAttivita") || cmd.equals("exportRicercaAttivitaConcluse")) { |
|
|
|
|
} else if (cmd.equals("exportRicercaMieAttivita") || cmd.equals("exportRicercaMieiRuoli") |
|
|
|
|
|| cmd.equals("exportRicercaAltreAttivita") || cmd.equals("exportRicercaAttivitaConcluse")) { |
|
|
|
|
csv = exportSearch(locale, resourceRequest, user, cmd); |
|
|
|
|
} |
|
|
|
|
//ADT BUG BO ID= 1 SEZIONE ATTIVIT<EFBFBD>
|
|
|
|
|
// ADT BUG BO ID= 1 SEZIONE ATTIVIT<EFBFBD>
|
|
|
|
|
if ("comuniForUfficio".equals(id)) { |
|
|
|
|
String ufficio = ParamUtil.getString(resourceRequest, "ufficioId"); |
|
|
|
|
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); |
|
|
|
|
List<Comune> comuni; |
|
|
|
|
if (Validator.isNotNull(ufficio) && !ufficio.equals("0")) { |
|
|
|
|
try { |
|
|
|
|
if(!ufficio.equals("-1")){ |
|
|
|
|
if (!ufficio.equals("-1")) { |
|
|
|
|
long ufficioId = Long.parseLong(ufficio); |
|
|
|
|
comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserIdUfficioId(user.getUserId(), ufficioId); |
|
|
|
|
comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserIdUfficioId( |
|
|
|
|
user.getUserId(), ufficioId); |
|
|
|
|
for (Comune comune : comuni) { |
|
|
|
|
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); |
|
|
|
|
jsonObject.put("comuneId", comune.getComuneId()); |
|
|
|
@ -377,11 +396,7 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
writeJSON(resourceRequest, resourceResponse, jsonArray); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
catch (Exception e) { |
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -390,11 +405,9 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
} |
|
|
|
|
ServletResponseUtil.sendFile(request, response, "export_pratiche.csv", csv.getBytes(StringPool.UTF8), |
|
|
|
|
ContentTypes.TEXT_CSV_UTF8); |
|
|
|
|
|
|
|
|
|
// super.serveResource(resourceRequest, resourceResponse);
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String exportSearch(Locale locale, ResourceRequest resourceRequest, User user, String cmd) { |
|
|
|
|
|
|
|
|
|
HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(resourceRequest); |
|
|
|
@ -406,13 +419,13 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
|
|
|
|
|
Hits hits = null; |
|
|
|
|
|
|
|
|
|
if(cmd.equals("exportRicercaMieAttivita")){ |
|
|
|
|
if (cmd.equals("exportRicercaMieAttivita")) { |
|
|
|
|
hits = ControlloPraticaAdvancedSearch.searchMieiTask(httpRequest, user, -1, -1); |
|
|
|
|
} else if(cmd.equals("exportRicercaMieiRuoli")){ |
|
|
|
|
} else if (cmd.equals("exportRicercaMieiRuoli")) { |
|
|
|
|
hits = ControlloPraticaAdvancedSearch.searchTaskMieiRuoli(httpRequest, user, -1, -1); |
|
|
|
|
} else if(cmd.equals("exportRicercaAltreAttivita")){ |
|
|
|
|
} else if (cmd.equals("exportRicercaAltreAttivita")) { |
|
|
|
|
hits = ControlloPraticaAdvancedSearch.searchAltriTask(httpRequest, user, -1, -1); |
|
|
|
|
} else if(cmd.equals("exportRicercaAttivitaConcluse")){ |
|
|
|
|
} else if (cmd.equals("exportRicercaAttivitaConcluse")) { |
|
|
|
|
hits = ControlloPraticaAdvancedSearch.searchTaskConclusi(httpRequest, user, -1, -1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -421,8 +434,8 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
String controlloPraticaId = doc.get("controlloPraticaId"); |
|
|
|
|
if (Validator.isNotNull(controlloPraticaId)) { |
|
|
|
|
|
|
|
|
|
ControlloPratica controlloPratica = |
|
|
|
|
ControlloPraticaLocalServiceUtil.fetchControlloPratica(GetterUtil.getLong(controlloPraticaId)); |
|
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil |
|
|
|
|
.fetchControlloPratica(GetterUtil.getLong(controlloPraticaId)); |
|
|
|
|
if (Validator.isNotNull(controlloPratica)) { |
|
|
|
|
lista.add(controlloPratica); |
|
|
|
|
} |
|
|
|
@ -430,60 +443,72 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.attivita"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.attivita"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.esito"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.esito"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
//ADT - BUG-13 Aggiunta colonna Data Esito
|
|
|
|
|
//Bug 33264
|
|
|
|
|
if(cmd.equals("exportRicercaAttivitaConcluse")){ |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.dataesito"))); |
|
|
|
|
// ADT - BUG-13 Aggiunta colonna Data Esito
|
|
|
|
|
// Bug 33264
|
|
|
|
|
if (cmd.equals("exportRicercaAttivitaConcluse")) { |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.dataesito"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.sorteggiata"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.sorteggiata"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.pratica"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.pratica"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.istruttore"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.istruttore"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.provenienza"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.provenienza"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.avvioprocedimento"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.avvioprocedimento"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.provincia"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.provincia"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.gg"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.gg"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
sb.append(StringPool.NEW_LINE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); |
|
|
|
|
|
|
|
|
|
for (ControlloPratica controlloPratica : lista) { |
|
|
|
|
|
|
|
|
|
IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(controlloPratica.getIntPraticaId()); |
|
|
|
|
IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(controlloPratica |
|
|
|
|
.getIntPraticaId()); |
|
|
|
|
|
|
|
|
|
Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPratica.getTerritorioId()); |
|
|
|
|
Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPratica |
|
|
|
|
.getTerritorioId()); |
|
|
|
|
Comune comune = ComuneLocalServiceUtil.fetchComune(territorio.getComuneId()); |
|
|
|
|
|
|
|
|
|
Provincia provincia = |
|
|
|
|
ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia()); |
|
|
|
|
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), |
|
|
|
|
territorio.getCodiceProvincia()); |
|
|
|
|
|
|
|
|
|
// Informazioni relative al workflow
|
|
|
|
|
WorkflowInstanceLink workflowInstanceLink = |
|
|
|
|
WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink(controlloPratica.getCompanyId(), |
|
|
|
|
controlloPratica.getGroupId(), ControlloPratica.class.getName(), controlloPratica.getPrimaryKey()); |
|
|
|
|
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil |
|
|
|
|
.fetchWorkflowInstanceLink(controlloPratica.getCompanyId(), |
|
|
|
|
controlloPratica.getGroupId(), ControlloPratica.class.getName(), |
|
|
|
|
controlloPratica.getPrimaryKey()); |
|
|
|
|
|
|
|
|
|
long workflowInstanceId = workflowInstanceLink.getWorkflowInstanceId(); |
|
|
|
|
WorkflowInstance workflowInstance = |
|
|
|
|
WorkflowInstanceManagerUtil.getWorkflowInstance(controlloPratica.getCompanyId(), workflowInstanceId); |
|
|
|
|
WorkflowInstance workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance( |
|
|
|
|
controlloPratica.getCompanyId(), workflowInstanceId); |
|
|
|
|
|
|
|
|
|
List<WorkflowTask> listaTask = |
|
|
|
|
WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance(controlloPratica.getCompanyId(), null, |
|
|
|
|
workflowInstance.getWorkflowInstanceId(), false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); |
|
|
|
|
List<WorkflowTask> listaTask = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance( |
|
|
|
|
controlloPratica.getCompanyId(), null, workflowInstance.getWorkflowInstanceId(), |
|
|
|
|
false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); |
|
|
|
|
|
|
|
|
|
WorkflowTask task = null; |
|
|
|
|
if (listaTask != null && !listaTask.isEmpty()) { |
|
|
|
@ -493,30 +518,33 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
String taskName = StringPool.BLANK; |
|
|
|
|
if (task != null) { |
|
|
|
|
User userTask = UserLocalServiceUtil.fetchUser(task.getAssigneeUserId()); |
|
|
|
|
//Bug 33264
|
|
|
|
|
// Bug 33264
|
|
|
|
|
taskName = LanguageUtil.get(getPortletConfig(), locale, task.getName()); |
|
|
|
|
if (userTask != null) { |
|
|
|
|
taskName += " (" + userTask.getFullName() + ")"; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
//Bug 33264
|
|
|
|
|
// Bug 33264
|
|
|
|
|
taskName = LanguageUtil.get(getPortletConfig(), locale, workflowInstance.getState()); |
|
|
|
|
} |
|
|
|
|
sb.append(CSVUtil.encode(taskName)); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
String tipoEsito = ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica.getControlloPraticaId()); |
|
|
|
|
String tipoEsito = ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica |
|
|
|
|
.getControlloPraticaId()); |
|
|
|
|
sb.append(CSVUtil.encode(tipoEsito)); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
//ADT - BUG-13 Aggiunta colonna Data Esito
|
|
|
|
|
//Bug 33264
|
|
|
|
|
if(cmd.equals("exportRicercaAttivitaConcluse")){ |
|
|
|
|
sb.append(CSVUtil.encode(controlloPratica.getStatusDate() != null ? sdf.format(controlloPratica.getStatusDate()) : "" )); |
|
|
|
|
// ADT - BUG-13 Aggiunta colonna Data Esito
|
|
|
|
|
// Bug 33264
|
|
|
|
|
if (cmd.equals("exportRicercaAttivitaConcluse")) { |
|
|
|
|
sb.append(CSVUtil.encode(controlloPratica.getStatusDate() != null ? sdf |
|
|
|
|
.format(controlloPratica.getStatusDate()) : "")); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
boolean sorteggiata = SorteggioLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId()) != null; |
|
|
|
|
boolean sorteggiata = SorteggioLocalServiceUtil |
|
|
|
|
.findByIntPratica(intPratica.getIntPraticaId()) != null; |
|
|
|
|
sb.append(CSVUtil.encode((sorteggiata) ? "Si" : "No")); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
@ -527,7 +555,7 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
String istruttore = "-"; |
|
|
|
|
if (intPratica.getStatusByUserId() != 0l) { |
|
|
|
|
User istruttoreUser = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId()); |
|
|
|
|
if (istruttore != null) { |
|
|
|
|
if (istruttoreUser != null) { |
|
|
|
|
istruttore = istruttoreUser.getFullName(); |
|
|
|
|
} else { |
|
|
|
|
istruttore = " [" + intPratica.getStatusByUserId() + "]"; |
|
|
|
@ -537,8 +565,8 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
StringBuilder provenienzaLabel = new StringBuilder(); |
|
|
|
|
WorkflowTask workflowTask = |
|
|
|
|
WorkflowUtil.getLastCompletedTask(controlloPratica.getCompanyId(), controlloPratica.getGroupId(), null, |
|
|
|
|
WorkflowTask workflowTask = WorkflowUtil.getLastCompletedTask( |
|
|
|
|
controlloPratica.getCompanyId(), controlloPratica.getGroupId(), null, |
|
|
|
|
controlloPratica); |
|
|
|
|
|
|
|
|
|
if (workflowTask != null) { |
|
|
|
@ -597,38 +625,45 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
List<ControlloPratica> listaControlloPratica = new ArrayList<ControlloPratica>(); |
|
|
|
|
|
|
|
|
|
if (dirigente) { |
|
|
|
|
listaControlloPratica = |
|
|
|
|
ControlloPraticaAdvancedSearch.searchTaskPerEsportazioneDirigente(httpRequest, user, QueryUtil.ALL_POS, |
|
|
|
|
QueryUtil.ALL_POS); |
|
|
|
|
listaControlloPratica = ControlloPraticaAdvancedSearch.searchTaskPerEsportazioneDirigente( |
|
|
|
|
httpRequest, user, QueryUtil.ALL_POS, QueryUtil.ALL_POS); |
|
|
|
|
} else { |
|
|
|
|
listaControlloPratica = |
|
|
|
|
ControlloPraticaAdvancedSearch.searchTaskPerEsportazionePO(httpRequest, user, QueryUtil.ALL_POS, |
|
|
|
|
QueryUtil.ALL_POS); |
|
|
|
|
listaControlloPratica = ControlloPraticaAdvancedSearch.searchTaskPerEsportazionePO(httpRequest, |
|
|
|
|
user, QueryUtil.ALL_POS, QueryUtil.ALL_POS); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.attivita"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.attivita"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.esito"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.esito"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
//ADT - BUG-13 Aggiunta colonna Data Esito
|
|
|
|
|
//Bug 33264
|
|
|
|
|
if("Tab_TaskCompletati".equals(currentTab)){ |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.dataesito"))); |
|
|
|
|
// ADT - BUG-13 Aggiunta colonna Data Esito
|
|
|
|
|
// Bug 33264
|
|
|
|
|
if ("Tab_TaskCompletati".equals(currentTab)) { |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.dataesito"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.sorteggiata"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.sorteggiata"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.pratica"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.pratica"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.istruttore"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.istruttore"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.provenienza"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.provenienza"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.avvioprocedimento"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.avvioprocedimento"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.provincia"))); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
"label.scadenzegeniocivile.provincia"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.gg"))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
@ -641,26 +676,29 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
|
|
|
|
|
for (ControlloPratica controlloPratica : listaControlloPratica) { |
|
|
|
|
|
|
|
|
|
IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(controlloPratica.getIntPraticaId()); |
|
|
|
|
IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(controlloPratica |
|
|
|
|
.getIntPraticaId()); |
|
|
|
|
|
|
|
|
|
Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPratica.getTerritorioId()); |
|
|
|
|
Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPratica |
|
|
|
|
.getTerritorioId()); |
|
|
|
|
Comune comune = ComuneLocalServiceUtil.fetchComune(territorio.getComuneId()); |
|
|
|
|
|
|
|
|
|
Provincia provincia = |
|
|
|
|
ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia()); |
|
|
|
|
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), |
|
|
|
|
territorio.getCodiceProvincia()); |
|
|
|
|
|
|
|
|
|
// Informazioni relative al workflow
|
|
|
|
|
WorkflowInstanceLink workflowInstanceLink = |
|
|
|
|
WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink(controlloPratica.getCompanyId(), |
|
|
|
|
controlloPratica.getGroupId(), ControlloPratica.class.getName(), controlloPratica.getPrimaryKey()); |
|
|
|
|
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil |
|
|
|
|
.fetchWorkflowInstanceLink(controlloPratica.getCompanyId(), |
|
|
|
|
controlloPratica.getGroupId(), ControlloPratica.class.getName(), |
|
|
|
|
controlloPratica.getPrimaryKey()); |
|
|
|
|
|
|
|
|
|
long workflowInstanceId = workflowInstanceLink.getWorkflowInstanceId(); |
|
|
|
|
WorkflowInstance workflowInstance = |
|
|
|
|
WorkflowInstanceManagerUtil.getWorkflowInstance(controlloPratica.getCompanyId(), workflowInstanceId); |
|
|
|
|
WorkflowInstance workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance( |
|
|
|
|
controlloPratica.getCompanyId(), workflowInstanceId); |
|
|
|
|
|
|
|
|
|
List<WorkflowTask> listaTask = |
|
|
|
|
WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance(controlloPratica.getCompanyId(), null, |
|
|
|
|
workflowInstance.getWorkflowInstanceId(), false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); |
|
|
|
|
List<WorkflowTask> listaTask = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance( |
|
|
|
|
controlloPratica.getCompanyId(), null, workflowInstance.getWorkflowInstanceId(), |
|
|
|
|
false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); |
|
|
|
|
|
|
|
|
|
WorkflowTask task = null; |
|
|
|
|
if (listaTask != null && !listaTask.isEmpty()) { |
|
|
|
@ -680,18 +718,20 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
sb.append(CSVUtil.encode(taskName)); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
String tipoEsito = ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica.getControlloPraticaId()); |
|
|
|
|
String tipoEsito = ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica |
|
|
|
|
.getControlloPraticaId()); |
|
|
|
|
sb.append(CSVUtil.encode(tipoEsito)); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
//ADT - BUG-13 Aggiunta colonna Data Esito
|
|
|
|
|
//Bug 33264
|
|
|
|
|
if("Tab_TaskCompletati".equals(currentTab)){ |
|
|
|
|
// ADT - BUG-13 Aggiunta colonna Data Esito
|
|
|
|
|
// Bug 33264
|
|
|
|
|
if ("Tab_TaskCompletati".equals(currentTab)) { |
|
|
|
|
sb.append(CSVUtil.encode(sdf.format(controlloPratica.getStatusDate()))); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
boolean sorteggiata = SorteggioLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId()) != null; |
|
|
|
|
boolean sorteggiata = SorteggioLocalServiceUtil |
|
|
|
|
.findByIntPratica(intPratica.getIntPraticaId()) != null; |
|
|
|
|
sb.append(CSVUtil.encode((sorteggiata) ? "Si" : "No")); |
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
@ -702,7 +742,7 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
String istruttore = "-"; |
|
|
|
|
if (intPratica.getStatusByUserId() != 0l) { |
|
|
|
|
User istruttoreUser = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId()); |
|
|
|
|
if (istruttore != null) { |
|
|
|
|
if (istruttoreUser != null) { |
|
|
|
|
istruttore = istruttoreUser.getFullName(); |
|
|
|
|
} else { |
|
|
|
|
istruttore = " [" + intPratica.getStatusByUserId() + "]"; |
|
|
|
@ -712,8 +752,8 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
StringBuilder provenienzaLabel = new StringBuilder(); |
|
|
|
|
WorkflowTask workflowTask = |
|
|
|
|
WorkflowUtil.getLastCompletedTask(controlloPratica.getCompanyId(), controlloPratica.getGroupId(), null, |
|
|
|
|
WorkflowTask workflowTask = WorkflowUtil.getLastCompletedTask( |
|
|
|
|
controlloPratica.getCompanyId(), controlloPratica.getGroupId(), null, |
|
|
|
|
controlloPratica); |
|
|
|
|
|
|
|
|
|
if (workflowTask != null) { |
|
|
|
|