|
|
|
@ -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,7 +307,8 @@ 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); |
|
|
|
|
ParereGeologo parereGeologo = ParereGeologoServiceUtil.addParereGeologo(geologoId, |
|
|
|
|
intPraticaId, dettPraticaId, serviceContext); |
|
|
|
|
// ADT: aggiunta notifica geologo
|
|
|
|
|
MailUtil.invioNotificaGeologo(parereGeologo, serviceContext); |
|
|
|
|
} else { |
|
|
|
@ -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); |
|
|
|
|
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,7 +361,8 @@ 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>
|
|
|
|
@ -356,7 +374,8 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
try { |
|
|
|
|
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); |
|
|
|
@ -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"))); |
|
|
|
|
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()) { |
|
|
|
@ -505,18 +530,21 @@ 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 (cmd.equals("exportRicercaAttivitaConcluse")) { |
|
|
|
|
sb.append(CSVUtil.encode(controlloPratica.getStatusDate() != null ? sdf.format(controlloPratica.getStatusDate()) : "" )); |
|
|
|
|
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"))); |
|
|
|
|
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,7 +718,8 @@ 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); |
|
|
|
|
|
|
|
|
@ -691,7 +730,8 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
|
|
|
|
|
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) { |
|
|
|
|