|
|
@ -106,7 +106,8 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException { |
|
|
|
public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException { |
|
|
|
|
|
|
|
|
|
|
|
HttpServletRequest httpReq = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(request)); |
|
|
|
HttpServletRequest httpReq = PortalUtil.getOriginalServletRequest(PortalUtil |
|
|
|
|
|
|
|
.getHttpServletRequest(request)); |
|
|
|
String intPraticaId = httpReq.getParameter("intPraticaId"); |
|
|
|
String intPraticaId = httpReq.getParameter("intPraticaId"); |
|
|
|
|
|
|
|
|
|
|
|
if (Validator.isNotNull(intPraticaId) && !intPraticaId.equals("")) { |
|
|
|
if (Validator.isNotNull(intPraticaId) && !intPraticaId.equals("")) { |
|
|
@ -118,14 +119,13 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
|
|
|
|
|
|
|
|
public void toggleWorkflow(ActionRequest actionRequest, ActionResponse actionResponse) { |
|
|
|
public void toggleWorkflow(ActionRequest actionRequest, ActionResponse actionResponse) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
User user = themeDisplay.getUser(); |
|
|
|
User user = themeDisplay.getUser(); |
|
|
|
|
|
|
|
|
|
|
|
boolean attivare = ParamUtil.getBoolean(actionRequest, "avviare"); |
|
|
|
boolean attivare = ParamUtil.getBoolean(actionRequest, "avviare"); |
|
|
|
boolean sospendere = ParamUtil.getBoolean(actionRequest, "sospendere"); |
|
|
|
boolean sospendere = ParamUtil.getBoolean(actionRequest, "sospendere"); |
|
|
|
long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId", 0); |
|
|
|
long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId", 0); |
|
|
|
String stato_pratica= ParamUtil.getString(actionRequest, "seleziona_stato"); |
|
|
|
String stato_pratica = ParamUtil.getString(actionRequest, "seleziona_stato"); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
@ -135,16 +135,16 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); |
|
|
|
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); |
|
|
|
|
|
|
|
|
|
|
|
if (attivare && !sospendere) { |
|
|
|
if (attivare && !sospendere) { |
|
|
|
WorkflowUtil.attivaWorkflow(intPraticaId, territorio.getGroupId(), serviceContext.getUserId(), |
|
|
|
WorkflowUtil.attivaWorkflow(intPraticaId, territorio.getGroupId(), |
|
|
|
dettPratica.getDettPraticaId(), serviceContext, true); |
|
|
|
serviceContext.getUserId(), dettPratica.getDettPraticaId(), serviceContext, true); |
|
|
|
|
|
|
|
|
|
|
|
addRowHistoryWorkflowAction(intPraticaId, dettPratica.getDettPraticaId(), |
|
|
|
addRowHistoryWorkflowAction(intPraticaId, dettPratica.getDettPraticaId(), |
|
|
|
themeDisplay.getCompanyId(), intPratica.getGroupId(), user, true); |
|
|
|
themeDisplay.getCompanyId(), intPratica.getGroupId(), user, true); |
|
|
|
|
|
|
|
|
|
|
|
SessionMessages.add(actionRequest, "success-workflow-ripreso"); |
|
|
|
SessionMessages.add(actionRequest, "success-workflow-ripreso"); |
|
|
|
} else if (!attivare && sospendere) { |
|
|
|
} else if (!attivare && sospendere) { |
|
|
|
WorkflowUtil.attivaWorkflow(intPraticaId, territorio.getGroupId(), serviceContext.getUserId(), |
|
|
|
WorkflowUtil.attivaWorkflow(intPraticaId, territorio.getGroupId(), |
|
|
|
dettPratica.getDettPraticaId(), serviceContext, false); |
|
|
|
serviceContext.getUserId(), dettPratica.getDettPraticaId(), serviceContext, false); |
|
|
|
|
|
|
|
|
|
|
|
addRowHistoryWorkflowAction(intPraticaId, dettPratica.getDettPraticaId(), |
|
|
|
addRowHistoryWorkflowAction(intPraticaId, dettPratica.getDettPraticaId(), |
|
|
|
themeDisplay.getCompanyId(), intPratica.getGroupId(), user, false); |
|
|
|
themeDisplay.getCompanyId(), intPratica.getGroupId(), user, false); |
|
|
@ -159,15 +159,15 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
actionResponse.sendRedirect(redirectURL); |
|
|
|
actionResponse.sendRedirect(redirectURL); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(!attivare){ |
|
|
|
if (!attivare) { |
|
|
|
intPratica.setStatoPratica(stato_pratica); |
|
|
|
intPratica.setStatoPratica(stato_pratica); |
|
|
|
IntPraticaLocalServiceUtil.updateStatoPratica(intPraticaId, 0, stato_pratica); |
|
|
|
IntPraticaLocalServiceUtil.updateStatoPratica(intPraticaId, 0, stato_pratica); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
intPratica.setStatoPratica(StatoPraticaConstants.SOTTOPOSTA_A_PARERE); |
|
|
|
intPratica.setStatoPratica(StatoPraticaConstants.SOTTOPOSTA_A_PARERE); |
|
|
|
IntPraticaLocalServiceUtil.updateStatoPratica(intPraticaId, 0, StatoPraticaConstants.SOTTOPOSTA_A_PARERE); |
|
|
|
IntPraticaLocalServiceUtil.updateStatoPratica(intPraticaId, 0, |
|
|
|
|
|
|
|
StatoPraticaConstants.SOTTOPOSTA_A_PARERE); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IntPraticaLocalServiceUtil.reIndexFasciolo(intPraticaId, intPratica.getCompanyId()); |
|
|
|
IntPraticaLocalServiceUtil.reIndexFasciolo(intPraticaId, intPratica.getCompanyId()); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
@ -177,10 +177,12 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void addRowHistoryWorkflowAction(long intPraticaId, long dettPraticaId, long companyId, long groupId, User user, boolean attivato) throws SystemException{ |
|
|
|
private void addRowHistoryWorkflowAction(long intPraticaId, long dettPraticaId, long companyId, |
|
|
|
|
|
|
|
long groupId, User user, boolean attivato) throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
HistoryWorkflowAction historyWorkflowAction = HistoryWorkflowActionLocalServiceUtil.createHistoryWorkflowAction( |
|
|
|
HistoryWorkflowAction historyWorkflowAction = HistoryWorkflowActionLocalServiceUtil |
|
|
|
CounterLocalServiceUtil.increment(HistoryWorkflowAction.class.getName())); |
|
|
|
.createHistoryWorkflowAction(CounterLocalServiceUtil.increment(HistoryWorkflowAction.class |
|
|
|
|
|
|
|
.getName())); |
|
|
|
|
|
|
|
|
|
|
|
historyWorkflowAction.setAttivato(attivato); |
|
|
|
historyWorkflowAction.setAttivato(attivato); |
|
|
|
historyWorkflowAction.setCompanyId(companyId); |
|
|
|
historyWorkflowAction.setCompanyId(companyId); |
|
|
@ -253,21 +255,21 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId", 0); |
|
|
|
long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId", 0); |
|
|
|
long companyId = ParamUtil.getLong(actionRequest, "companyId"); |
|
|
|
long companyId = ParamUtil.getLong(actionRequest, "companyId"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); |
|
|
|
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); |
|
|
|
User user = UserLocalServiceUtil.fetchUserByScreenName(companyId, nuovoSoggettoCF); |
|
|
|
User user = UserLocalServiceUtil.fetchUserByScreenName(companyId, nuovoSoggettoCF); |
|
|
|
if (Validator.isNotNull(user)) { |
|
|
|
if (Validator.isNotNull(user)) { |
|
|
|
if (!ValidazionePraticaUtil.praticaInProgress(intPraticaId)) { |
|
|
|
if (!ValidazionePraticaUtil.praticaInProgress(intPraticaId)) { |
|
|
|
_log.info("cambiaTitolare: cfNuovoTitolare " + nuovoSoggettoCF + " intpratica" + intPraticaId); |
|
|
|
_log.info("cambiaTitolare: cfNuovoTitolare " + nuovoSoggettoCF + " intpratica" |
|
|
|
|
|
|
|
+ intPraticaId); |
|
|
|
IntPraticaServiceUtil.cambiaTitolare(intPraticaId, user.getUserId(), serviceContext); |
|
|
|
IntPraticaServiceUtil.cambiaTitolare(intPraticaId, user.getUserId(), serviceContext); |
|
|
|
SessionMessages.add(actionRequest, "success-cambio-titolare"); |
|
|
|
SessionMessages.add(actionRequest, "success-cambio-titolare"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
SessionErrors.add(actionRequest, "error-cambio-titolare-pratica-in-progress"); |
|
|
|
SessionErrors.add(actionRequest, "error-cambio-titolare-pratica-in-progress"); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
_log.error("[FASCICOLO ACTION - CAMBIO TITOLARE] Nessun utente trovato con company " + companyId |
|
|
|
_log.error("[FASCICOLO ACTION - CAMBIO TITOLARE] Nessun utente trovato con company " |
|
|
|
+ " e codice fiscale " + nuovoSoggettoCF); |
|
|
|
+ companyId + " e codice fiscale " + nuovoSoggettoCF); |
|
|
|
SessionErrors.add(actionRequest, "error-cambio-titolare-no-such-user"); |
|
|
|
SessionErrors.add(actionRequest, "error-cambio-titolare-no-such-user"); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (PortalException | SystemException e) { |
|
|
|
} catch (PortalException | SystemException e) { |
|
|
@ -299,24 +301,23 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
if (dataRichiestaInizio != null && !dataRichiestaInizio.equals("")) { |
|
|
|
if (dataRichiestaInizio != null && !dataRichiestaInizio.equals("")) { |
|
|
|
String[] dataRichiestaInizioSplitted = dataRichiestaInizio.split("/"); |
|
|
|
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("dataRichiestaInizioDay", dataRichiestaInizioSplitted[0]); |
|
|
|
actionResponse.setRenderParameter("dataRichiestaInizioMonth", mounth+""); |
|
|
|
actionResponse.setRenderParameter("dataRichiestaInizioMonth", mounth + ""); |
|
|
|
actionResponse.setRenderParameter("dataRichiestaInizioYear", dataRichiestaInizioSplitted[2]); |
|
|
|
actionResponse.setRenderParameter("dataRichiestaInizioYear", dataRichiestaInizioSplitted[2]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (dataRichiestaFine != null && !dataRichiestaFine.equals("")) { |
|
|
|
if (dataRichiestaFine != null && !dataRichiestaFine.equals("")) { |
|
|
|
String[] dataRichiestaFineSplitted = dataRichiestaFine.split("/"); |
|
|
|
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("dataRichiestaFineDay", dataRichiestaFineSplitted[0]); |
|
|
|
actionResponse.setRenderParameter("dataRichiestaFineMonth", mounth+""); |
|
|
|
actionResponse.setRenderParameter("dataRichiestaFineMonth", mounth + ""); |
|
|
|
actionResponse.setRenderParameter("dataRichiestaFineYear", dataRichiestaFineSplitted[2]); |
|
|
|
actionResponse.setRenderParameter("dataRichiestaFineYear", dataRichiestaFineSplitted[2]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String ufficio = actionRequest.getParameter("ufficio"); |
|
|
|
String ufficio = actionRequest.getParameter("ufficio"); |
|
|
|
String ordinaPer = actionRequest.getParameter("ordinaPer"); |
|
|
|
String ordinaPer = actionRequest.getParameter("ordinaPer"); |
|
|
|
String ordinaTipo = actionRequest.getParameter("ordinaTipo"); |
|
|
|
String ordinaTipo = actionRequest.getParameter("ordinaTipo"); |
|
|
@ -334,11 +335,11 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
actionResponse.setRenderParameter("statoPratica", statoPratica); |
|
|
|
actionResponse.setRenderParameter("statoPratica", statoPratica); |
|
|
|
actionResponse.setRenderParameter("committente", committente); |
|
|
|
actionResponse.setRenderParameter("committente", committente); |
|
|
|
|
|
|
|
|
|
|
|
if(provincia != null && !provincia.equals("")){ |
|
|
|
if (provincia != null && !provincia.equals("")) { |
|
|
|
actionResponse.setRenderParameter("provincia", provincia); |
|
|
|
actionResponse.setRenderParameter("provincia", provincia); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(comune != null && !comune.equals("")){ |
|
|
|
if (comune != null && !comune.equals("")) { |
|
|
|
actionResponse.setRenderParameter("comune", comune); |
|
|
|
actionResponse.setRenderParameter("comune", comune); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -361,7 +362,6 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
actionResponse.setRenderParameter("ufficio", -1 + ""); |
|
|
|
actionResponse.setRenderParameter("ufficio", -1 + ""); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
actionResponse.setRenderParameter("ordinaPer", ordinaPer); |
|
|
|
actionResponse.setRenderParameter("ordinaPer", ordinaPer); |
|
|
|
actionResponse.setRenderParameter("ordinaTipo", ordinaTipo); |
|
|
|
actionResponse.setRenderParameter("ordinaTipo", ordinaTipo); |
|
|
|
|
|
|
|
|
|
|
@ -372,11 +372,9 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
long dettPraticaId = ParamUtil.getLong(actionRequest, "dettPraticaId", 0); |
|
|
|
long dettPraticaId = ParamUtil.getLong(actionRequest, "dettPraticaId", 0); |
|
|
|
long companyId = ParamUtil.getLong(actionRequest, "companyId"); |
|
|
|
long companyId = ParamUtil.getLong(actionRequest, "companyId"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
DettPraticaServiceUtil.sendToVersioning(dettPraticaId, companyId); |
|
|
|
DettPraticaServiceUtil.sendToVersioning(dettPraticaId, companyId); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (PortalException | SystemException | IOException | NoSuchFieldException | SecurityException e) { |
|
|
|
|
|
|
|
_log.error("error-versioning", e); |
|
|
|
_log.error("error-versioning", e); |
|
|
|
SessionErrors.add(actionRequest, "error-versioning"); |
|
|
|
SessionErrors.add(actionRequest, "error-versioning"); |
|
|
|
} |
|
|
|
} |
|
|
@ -386,8 +384,8 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, |
|
|
|
public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) |
|
|
|
PortletException { |
|
|
|
throws IOException, PortletException { |
|
|
|
|
|
|
|
|
|
|
|
String id = resourceRequest.getResourceID(); |
|
|
|
String id = resourceRequest.getResourceID(); |
|
|
|
ServiceContext serviceContext; |
|
|
|
ServiceContext serviceContext; |
|
|
@ -416,8 +414,8 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
} else if ("page_collaudo".equals(comingFrom)) { |
|
|
|
} else if ("page_collaudo".equals(comingFrom)) { |
|
|
|
tipologieAllegati = DocumentiPraticaUtil.getDocCollaudo(); |
|
|
|
tipologieAllegati = DocumentiPraticaUtil.getDocCollaudo(); |
|
|
|
} |
|
|
|
} |
|
|
|
docs = |
|
|
|
docs = DocPraticaLocalServiceUtil.findByIntPratica_ClassPk_Tipologie(intPraticaId, |
|
|
|
DocPraticaLocalServiceUtil.findByIntPratica_ClassPk_Tipologie(intPraticaId, classPk, tipologieAllegati); |
|
|
|
classPk, tipologieAllegati); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ZipWriter zipWriter = ZipWriterFactoryUtil.getZipWriter(); |
|
|
|
ZipWriter zipWriter = ZipWriterFactoryUtil.getZipWriter(); |
|
|
@ -430,10 +428,11 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(doc.getDlFileEntryId()); |
|
|
|
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(doc.getDlFileEntryId()); |
|
|
|
inputStream = |
|
|
|
inputStream = DLFileEntryLocalServiceUtil.getFileAsStream(fileEntry.getFileEntryId(), |
|
|
|
DLFileEntryLocalServiceUtil.getFileAsStream(fileEntry.getFileEntryId(), fileEntry.getVersion(), false); |
|
|
|
fileEntry.getVersion(), false); |
|
|
|
|
|
|
|
|
|
|
|
// String name = fileEntry.getTitle() + StringPool.PERIOD + fileEntry.getExtension();
|
|
|
|
// String name = fileEntry.getTitle() +
|
|
|
|
|
|
|
|
// StringPool.PERIOD + fileEntry.getExtension();
|
|
|
|
String name = fileEntry.getTitle(); |
|
|
|
String name = fileEntry.getTitle(); |
|
|
|
zipWriter.addEntry(name, inputStream); |
|
|
|
zipWriter.addEntry(name, inputStream); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
@ -448,8 +447,8 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
|
|
|
|
|
|
|
|
resourceResponse.setContentType(ContentTypes.APPLICATION_ZIP); |
|
|
|
resourceResponse.setContentType(ContentTypes.APPLICATION_ZIP); |
|
|
|
resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate"); |
|
|
|
resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate"); |
|
|
|
resourceResponse |
|
|
|
resourceResponse.addProperty(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" |
|
|
|
.addProperty(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + file.getName() + "\""); |
|
|
|
+ file.getName() + "\""); |
|
|
|
resourceResponse.setContentLength(data.length); |
|
|
|
resourceResponse.setContentLength(data.length); |
|
|
|
|
|
|
|
|
|
|
|
resourceResponse.getPortletOutputStream().write(data); |
|
|
|
resourceResponse.getPortletOutputStream().write(data); |
|
|
@ -464,40 +463,53 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
FilesImporter.importaFile(classPk, className); |
|
|
|
FilesImporter.importaFile(classPk, className); |
|
|
|
|
|
|
|
|
|
|
|
// if (DocPratica.class.getName().equalsIgnoreCase(className)) {
|
|
|
|
// if (DocPratica.class.getName().equalsIgnoreCase(className)) {
|
|
|
|
// DocPratica docPratica = DocPraticaLocalServiceUtil.getDocPratica(classPk);
|
|
|
|
// DocPratica docPratica =
|
|
|
|
// if (docPratica.getDlFileEntryId() == 0L && docPratica.getOldDlFileEntryId() != 0L) {
|
|
|
|
// DocPraticaLocalServiceUtil.getDocPratica(classPk);
|
|
|
|
|
|
|
|
// if (docPratica.getDlFileEntryId() == 0L &&
|
|
|
|
|
|
|
|
// docPratica.getOldDlFileEntryId() != 0L) {
|
|
|
|
// FilesImporter.handleFileImportDocPratica(docPratica);
|
|
|
|
// FilesImporter.handleFileImportDocPratica(docPratica);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// } else if (Avviso.class.getName().equalsIgnoreCase(className)) {
|
|
|
|
// } else if
|
|
|
|
|
|
|
|
// (Avviso.class.getName().equalsIgnoreCase(className)) {
|
|
|
|
// Avviso avviso = AvvisoLocalServiceUtil.getAvviso(classPk);
|
|
|
|
// Avviso avviso = AvvisoLocalServiceUtil.getAvviso(classPk);
|
|
|
|
// if (avviso.getFileEntryIdBase() == 0L && avviso.getOldFileEntryIdBase() != 0L) {
|
|
|
|
// if (avviso.getFileEntryIdBase() == 0L &&
|
|
|
|
|
|
|
|
// avviso.getOldFileEntryIdBase() != 0L) {
|
|
|
|
// FilesImporter.handleFileImportAvviso(avviso, true);
|
|
|
|
// FilesImporter.handleFileImportAvviso(avviso, true);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (avviso.getFileEntryIdInvio() == 0L && avviso.getOldFileEntryIdInvio() != 0L) {
|
|
|
|
// if (avviso.getFileEntryIdInvio() == 0L &&
|
|
|
|
|
|
|
|
// avviso.getOldFileEntryIdInvio() != 0L) {
|
|
|
|
// FilesImporter.handleFileImportAvviso(avviso, false);
|
|
|
|
// FilesImporter.handleFileImportAvviso(avviso, false);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// } else if (Pagamento.class.getName().equalsIgnoreCase(className)) {
|
|
|
|
// } else if
|
|
|
|
// Pagamento pagamento = PagamentoLocalServiceUtil.getPagamento(classPk);
|
|
|
|
// (Pagamento.class.getName().equalsIgnoreCase(className)) {
|
|
|
|
// if (pagamento.getFileEntryId() == 0L && pagamento.getOldFileEntryId() != 0L) {
|
|
|
|
// Pagamento pagamento =
|
|
|
|
|
|
|
|
// PagamentoLocalServiceUtil.getPagamento(classPk);
|
|
|
|
|
|
|
|
// if (pagamento.getFileEntryId() == 0L &&
|
|
|
|
|
|
|
|
// pagamento.getOldFileEntryId() != 0L) {
|
|
|
|
// FilesImporter.handleFileImportPagamento(pagamento);
|
|
|
|
// FilesImporter.handleFileImportPagamento(pagamento);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// } else if (DocAggiuntiva.class.getName().equalsIgnoreCase(className)) {
|
|
|
|
// } else if
|
|
|
|
// DocAggiuntiva docAggiuntiva = DocAggiuntivaLocalServiceUtil.getDocAggiuntiva(classPk);
|
|
|
|
// (DocAggiuntiva.class.getName().equalsIgnoreCase(className)) {
|
|
|
|
// if (docAggiuntiva.getFileEntryId() == 0L && docAggiuntiva.getOldFileEntryId() != 0L) {
|
|
|
|
// DocAggiuntiva docAggiuntiva =
|
|
|
|
|
|
|
|
// DocAggiuntivaLocalServiceUtil.getDocAggiuntiva(classPk);
|
|
|
|
|
|
|
|
// if (docAggiuntiva.getFileEntryId() == 0L &&
|
|
|
|
|
|
|
|
// docAggiuntiva.getOldFileEntryId() != 0L) {
|
|
|
|
// FilesImporter.handleFileImportDocAggiuntiva(docAggiuntiva);
|
|
|
|
// FilesImporter.handleFileImportDocAggiuntiva(docAggiuntiva);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// } else if (AllegatoManuale.class.getName().equalsIgnoreCase(className)) {
|
|
|
|
// } else if
|
|
|
|
|
|
|
|
// (AllegatoManuale.class.getName().equalsIgnoreCase(className))
|
|
|
|
|
|
|
|
// {
|
|
|
|
// AllegatoManuale allegatoManuale =
|
|
|
|
// AllegatoManuale allegatoManuale =
|
|
|
|
// AllegatoManualeLocalServiceUtil.getAllegatoManuale(classPk);
|
|
|
|
// AllegatoManualeLocalServiceUtil.getAllegatoManuale(classPk);
|
|
|
|
// if (allegatoManuale.getFileEntryId() == 0L && allegatoManuale.getOldFileEntryId() != 0L)
|
|
|
|
// if (allegatoManuale.getFileEntryId() == 0L &&
|
|
|
|
|
|
|
|
// allegatoManuale.getOldFileEntryId() != 0L)
|
|
|
|
// {
|
|
|
|
// {
|
|
|
|
// FilesImporter.handleFileImportAllegatoManuale(allegatoManuale);
|
|
|
|
// FilesImporter.handleFileImportAllegatoManuale(allegatoManuale);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
PortletResponseUtil |
|
|
|
PortletResponseUtil |
|
|
|
.write( |
|
|
|
.write(resourceResponse, |
|
|
|
resourceResponse, |
|
|
|
|
|
|
|
"<p style='margin-bottom:20px'><strong>Completato</strong></p><a href='#' class='btn btn-success' onclick=\"Liferay.Portlet.refresh('#p_p_id_" |
|
|
|
"<p style='margin-bottom:20px'><strong>Completato</strong></p><a href='#' class='btn btn-success' onclick=\"Liferay.Portlet.refresh('#p_p_id_" |
|
|
|
+ PortletKeys.FASCICOLO + "_')\">Refresh</a>"); |
|
|
|
+ PortletKeys.FASCICOLO + "_')\">Refresh</a>"); |
|
|
|
|
|
|
|
|
|
|
@ -510,11 +522,11 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String comingFrom = ParamUtil.getString(resourceRequest, "comingFrom", "bo"); |
|
|
|
String comingFrom = ParamUtil.getString(resourceRequest, "comingFrom", "bo"); |
|
|
|
InfoFascicolo infoFascicolo = InfoFascicoloLocalServiceUtil.fetchByIntPratica(intPratica.getIntPraticaId()); |
|
|
|
InfoFascicolo infoFascicolo = InfoFascicoloLocalServiceUtil.fetchByIntPratica(intPratica |
|
|
|
|
|
|
|
.getIntPraticaId()); |
|
|
|
if (Validator.isNull(infoFascicolo)) { |
|
|
|
if (Validator.isNull(infoFascicolo)) { |
|
|
|
infoFascicolo = |
|
|
|
infoFascicolo = InfoFascicoloLocalServiceUtil.addInfoFascicolo( |
|
|
|
InfoFascicoloLocalServiceUtil.addInfoFascicolo(intPratica.getIntPraticaId(), |
|
|
|
intPratica.getIntPraticaId(), intPratica.getNumeroProgetto(), serviceContext); |
|
|
|
intPratica.getNumeroProgetto(), serviceContext); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (infoFascicolo.getAlreadyImported() && comingFrom.equalsIgnoreCase("fe")) { |
|
|
|
if (infoFascicolo.getAlreadyImported() && comingFrom.equalsIgnoreCase("fe")) { |
|
|
|
_log.error("intpratica.import.file.already-clicked with intpraticaid=" + intPraticaId); |
|
|
|
_log.error("intpratica.import.file.already-clicked with intpraticaid=" + intPraticaId); |
|
|
@ -524,19 +536,24 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
|
|
|
|
|
|
|
|
User user = UserLocalServiceUtil.fetchUser(serviceContext.getUserId()); |
|
|
|
User user = UserLocalServiceUtil.fetchUser(serviceContext.getUserId()); |
|
|
|
|
|
|
|
|
|
|
|
_log.debug("************** START IMPORT FILES FASCICOLO : " + intPraticaId + " by user" + user.getFullName()); |
|
|
|
_log.debug("************** START IMPORT FILES FASCICOLO : " + intPraticaId + " by user" |
|
|
|
|
|
|
|
+ user.getFullName()); |
|
|
|
|
|
|
|
|
|
|
|
List<DettPratica> listaDet = DettPraticaLocalServiceUtil.findByIntPraticaId(intPraticaId); |
|
|
|
List<DettPratica> listaDet = DettPraticaLocalServiceUtil.findByIntPraticaId(intPraticaId); |
|
|
|
for (DettPratica dettPratica : listaDet) { |
|
|
|
for (DettPratica dettPratica : listaDet) { |
|
|
|
FilesImporter.importaFilesFascicolo(dettPratica.getDettPraticaId(), DettPratica.class.getName()); |
|
|
|
FilesImporter.importaFilesFascicolo(dettPratica.getDettPraticaId(), |
|
|
|
|
|
|
|
DettPratica.class.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<FineLavori> listaFine = FineLavoriLocalServiceUtil.findByIntPraticaId(intPraticaId, -1, -1, null); |
|
|
|
List<FineLavori> listaFine = FineLavoriLocalServiceUtil.findByIntPraticaId(intPraticaId, -1, |
|
|
|
|
|
|
|
-1, null); |
|
|
|
for (FineLavori fineLavori : listaFine) { |
|
|
|
for (FineLavori fineLavori : listaFine) { |
|
|
|
FilesImporter.importaFilesFascicolo(fineLavori.getFineLavoriId(), FineLavori.class.getName()); |
|
|
|
FilesImporter.importaFilesFascicolo(fineLavori.getFineLavoriId(), |
|
|
|
|
|
|
|
FineLavori.class.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<Collaudo> listaColl = CollaudoLocalServiceUtil.findByIntPraticaId(intPraticaId, -1, -1, null); |
|
|
|
List<Collaudo> listaColl = CollaudoLocalServiceUtil.findByIntPraticaId(intPraticaId, -1, -1, |
|
|
|
|
|
|
|
null); |
|
|
|
for (Collaudo collaudo : listaColl) { |
|
|
|
for (Collaudo collaudo : listaColl) { |
|
|
|
FilesImporter.importaFilesFascicolo(collaudo.getCollaudoId(), Collaudo.class.getName()); |
|
|
|
FilesImporter.importaFilesFascicolo(collaudo.getCollaudoId(), Collaudo.class.getName()); |
|
|
|
} |
|
|
|
} |
|
|
@ -547,17 +564,17 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
infoFascicolo = InfoFascicoloLocalServiceUtil.updateInfoFascicolo(infoFascicolo); |
|
|
|
infoFascicolo = InfoFascicoloLocalServiceUtil.updateInfoFascicolo(infoFascicolo); |
|
|
|
|
|
|
|
|
|
|
|
PortletResponseUtil |
|
|
|
PortletResponseUtil |
|
|
|
.write( |
|
|
|
.write(resourceResponse, |
|
|
|
resourceResponse, |
|
|
|
|
|
|
|
"<p style='margin-bottom:20px'><strong>Completato</strong></p><a href='#' class='btn btn-success' onclick=\"Liferay.Portlet.refresh('#p_p_id_" |
|
|
|
"<p style='margin-bottom:20px'><strong>Completato</strong></p><a href='#' class='btn btn-success' onclick=\"Liferay.Portlet.refresh('#p_p_id_" |
|
|
|
+ PortletKeys.FASCICOLO + "_')\">Refresh</a>"); |
|
|
|
+ PortletKeys.FASCICOLO + "_')\">Refresh</a>"); |
|
|
|
} else if ("comuni".equals(id)) { |
|
|
|
} else if ("comuni".equals(id)) { |
|
|
|
String provinciaId = ParamUtil.getString(resourceRequest, "provinciaId"); |
|
|
|
String provinciaId = ParamUtil.getString(resourceRequest, "provinciaId"); |
|
|
|
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); |
|
|
|
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); |
|
|
|
if (Validator.isNotNull(provinciaId) && !provinciaId.equals("0")) { |
|
|
|
if (Validator.isNotNull(provinciaId) && !provinciaId.equals("0")) { |
|
|
|
List<Long> comuniIds = TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(provinciaId); |
|
|
|
List<Long> comuniIds = TerritorioLocalServiceUtil |
|
|
|
|
|
|
|
.getActiveComuniByCodiceProvincia(provinciaId); |
|
|
|
|
|
|
|
|
|
|
|
//ADT BUG-ID=15 Sezione Ricerca / Ordinamento Filtro
|
|
|
|
// ADT BUG-ID=15 Sezione Ricerca / Ordinamento Filtro
|
|
|
|
List<Comune> comumeList = new ArrayList<Comune>(); |
|
|
|
List<Comune> comumeList = new ArrayList<Comune>(); |
|
|
|
for (long comuneId : comuniIds) { |
|
|
|
for (long comuneId : comuniIds) { |
|
|
|
Comune comune = ComuneLocalServiceUtil.getComune(comuneId); |
|
|
|
Comune comune = ComuneLocalServiceUtil.getComune(comuneId); |
|
|
@ -581,14 +598,14 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
} |
|
|
|
} |
|
|
|
writeJSON(resourceRequest, resourceResponse, jsonArray); |
|
|
|
writeJSON(resourceRequest, resourceResponse, jsonArray); |
|
|
|
|
|
|
|
|
|
|
|
} else if("exportRicerca".equals(id)){ |
|
|
|
} else if ("exportRicerca".equals(id)) { |
|
|
|
|
|
|
|
|
|
|
|
ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest |
|
|
|
|
|
|
|
.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
Locale locale = themeDisplay.getLocale(); |
|
|
|
Locale locale = themeDisplay.getLocale(); |
|
|
|
|
|
|
|
|
|
|
|
User user = themeDisplay.getUser(); |
|
|
|
User user = themeDisplay.getUser(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String csv = StringPool.BLANK; |
|
|
|
String csv = StringPool.BLANK; |
|
|
|
|
|
|
|
|
|
|
|
HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest); |
|
|
|
HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest); |
|
|
@ -596,10 +613,10 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
|
|
|
|
|
|
|
|
csv = exportSearch(locale, resourceRequest, user); |
|
|
|
csv = exportSearch(locale, resourceRequest, user); |
|
|
|
|
|
|
|
|
|
|
|
ServletResponseUtil.sendFile(request, response, "export_ricerca.csv", csv.getBytes(StringPool.UTF8), |
|
|
|
ServletResponseUtil.sendFile(request, response, "export_ricerca.csv", |
|
|
|
ContentTypes.TEXT_CSV_UTF8); |
|
|
|
csv.getBytes(StringPool.UTF8), ContentTypes.TEXT_CSV_UTF8); |
|
|
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
} else { |
|
|
|
super.serveResource(resourceRequest, resourceResponse); |
|
|
|
super.serveResource(resourceRequest, resourceResponse); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
@ -617,7 +634,7 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
|
|
|
|
|
|
|
|
List<IntPratica> lista = new ArrayList<IntPratica>(); |
|
|
|
List<IntPratica> lista = new ArrayList<IntPratica>(); |
|
|
|
|
|
|
|
|
|
|
|
// try {
|
|
|
|
// try {
|
|
|
|
|
|
|
|
|
|
|
|
Hits hits = IntPraticaAdvancedSearch.searchProgettiBO(httpRequest, user, -1, -1); |
|
|
|
Hits hits = IntPraticaAdvancedSearch.searchProgettiBO(httpRequest, user, -1, -1); |
|
|
|
|
|
|
|
|
|
|
@ -625,55 +642,68 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
String intPraticaId = doc.get("intPraticaId"); |
|
|
|
String intPraticaId = doc.get("intPraticaId"); |
|
|
|
try { |
|
|
|
try { |
|
|
|
if (Validator.isNotNull(intPraticaId)) { |
|
|
|
if (Validator.isNotNull(intPraticaId)) { |
|
|
|
IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(GetterUtil.getLong(intPraticaId)); |
|
|
|
IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(GetterUtil |
|
|
|
|
|
|
|
.getLong(intPraticaId)); |
|
|
|
if (Validator.isNotNull(intPratica)) { |
|
|
|
if (Validator.isNotNull(intPratica)) { |
|
|
|
lista.add(intPratica); |
|
|
|
lista.add(intPratica); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} catch(Throwable e){ |
|
|
|
} catch (Throwable e) { |
|
|
|
_log.error(method + " IntPraticaLocalServiceUtil.fetchIntPratica IntPraticaId: " + intPraticaId, e); |
|
|
|
_log.error(method + " IntPraticaLocalServiceUtil.fetchIntPratica IntPraticaId: " |
|
|
|
|
|
|
|
+ intPraticaId, e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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(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(StringPool.SEMICOLON); |
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.titolare"))); |
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
|
|
|
"label.scadenzegeniocivile.titolare"))); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.committenti"))); |
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
|
|
|
"label.scadenzegeniocivile.committenti"))); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
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(StringPool.SEMICOLON); |
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.statoPratica"))); |
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
|
|
|
"label.scadenzegeniocivile.statoPratica"))); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
|
|
//ADT BUG-ID=15 Sezione Ricerca / Export csv
|
|
|
|
// ADT BUG-ID=15 Sezione Ricerca / Export csv
|
|
|
|
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(StringPool.SEMICOLON); |
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.comune"))); |
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
|
|
|
"label.scadenzegeniocivile.comune"))); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.descrizioneIntervento"))); |
|
|
|
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, |
|
|
|
|
|
|
|
"label.scadenzegeniocivile.descrizioneIntervento"))); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
|
|
sb.append(StringPool.NEW_LINE); |
|
|
|
sb.append(StringPool.NEW_LINE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); |
|
|
|
|
|
|
|
|
|
|
|
for (IntPratica intPratica : lista) { |
|
|
|
for (IntPratica intPratica : lista) { |
|
|
|
|
|
|
|
|
|
|
|
try{ |
|
|
|
try { |
|
|
|
DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica.getIntPraticaId()); |
|
|
|
DettPratica lastDettPratica = DettPraticaLocalServiceUtil |
|
|
|
|
|
|
|
.getLastCompletedByIntPratica(intPratica.getIntPraticaId()); |
|
|
|
|
|
|
|
|
|
|
|
Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPratica.getTerritorioId()); |
|
|
|
Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPratica |
|
|
|
|
|
|
|
.getTerritorioId()); |
|
|
|
Comune comune = ComuneLocalServiceUtil.fetchComune(territorio.getComuneId()); |
|
|
|
Comune comune = ComuneLocalServiceUtil.fetchComune(territorio.getComuneId()); |
|
|
|
|
|
|
|
|
|
|
|
Provincia provincia = |
|
|
|
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), |
|
|
|
ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia()); |
|
|
|
territorio.getCodiceProvincia()); |
|
|
|
|
|
|
|
|
|
|
|
boolean sorteggiata = SorteggioLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId()) != null; |
|
|
|
boolean sorteggiata = SorteggioLocalServiceUtil |
|
|
|
|
|
|
|
.findByIntPratica(intPratica.getIntPraticaId()) != null; |
|
|
|
sb.append(CSVUtil.encode((sorteggiata) ? "Si" : "No")); |
|
|
|
sb.append(CSVUtil.encode((sorteggiata) ? "Si" : "No")); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
|
@ -682,70 +712,84 @@ public class FascicoloPortlet extends MVCPortlet { |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
|
|
User titolareUser = UserLocalServiceUtil.getUserById(intPratica.getUserId()); |
|
|
|
User titolareUser = UserLocalServiceUtil.getUserById(intPratica.getUserId()); |
|
|
|
List<Soggetto> titolari = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale(lastDettPratica.getIntPraticaId(), lastDettPratica.getCodiceFiscaleDelegatoCommittente()); |
|
|
|
List<Soggetto> titolari = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale( |
|
|
|
|
|
|
|
lastDettPratica.getIntPraticaId(), |
|
|
|
|
|
|
|
lastDettPratica.getCodiceFiscaleDelegatoCommittente()); |
|
|
|
Soggetto titolare = null; |
|
|
|
Soggetto titolare = null; |
|
|
|
if(!titolari.isEmpty()){ |
|
|
|
if (!titolari.isEmpty()) { |
|
|
|
titolare = titolari.get(0); |
|
|
|
titolare = titolari.get(0); |
|
|
|
} |
|
|
|
} |
|
|
|
if(titolare != null){ |
|
|
|
if (titolare != null) { |
|
|
|
sb.append(titolare.getTitle()+ " - " +titolare.getCodiceFiscale()); |
|
|
|
sb.append(titolare.getTitle() + " - " + titolare.getCodiceFiscale()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
sb.append(""); |
|
|
|
sb.append(""); |
|
|
|
} |
|
|
|
} |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder builder = new StringBuilder(); |
|
|
|
StringBuilder builder = new StringBuilder(); |
|
|
|
|
|
|
|
|
|
|
|
List<Soggetto> committenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(lastDettPratica.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE); |
|
|
|
List<Soggetto> committenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto( |
|
|
|
for(Soggetto committente : committenti){ |
|
|
|
lastDettPratica.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE); |
|
|
|
builder.append(committente.getTitle()+" - "+committente.getCodiceFiscale()) |
|
|
|
for (Soggetto committente : committenti) { |
|
|
|
.append(StringPool.COMMA_AND_SPACE); |
|
|
|
builder.append(committente.getTitle() + " - " + committente.getCodiceFiscale()).append( |
|
|
|
|
|
|
|
StringPool.COMMA_AND_SPACE); |
|
|
|
} |
|
|
|
} |
|
|
|
if(builder.length()>0) |
|
|
|
if (builder.length() > 0) |
|
|
|
builder.setLength(builder.length()-12); |
|
|
|
builder.setLength(builder.length() - 12); |
|
|
|
|
|
|
|
|
|
|
|
sb.append(builder.toString()); |
|
|
|
sb.append(builder.toString()); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
|
|
User istruttore = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId()); |
|
|
|
User istruttore = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId()); |
|
|
|
if(istruttore!=null){ |
|
|
|
if (istruttore != null) { |
|
|
|
sb.append(istruttore.getFullName()); |
|
|
|
sb.append(istruttore.getFullName()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
sb.append(""); |
|
|
|
sb.append(""); |
|
|
|
} |
|
|
|
} |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
|
|
sb.append(LanguageUtil.get(locale, PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), intPratica))); |
|
|
|
sb.append(LanguageUtil.get(locale, |
|
|
|
|
|
|
|
PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), intPratica))); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
|
|
//ADT BUG-ID=15 Sezione Ricerca / Export csv
|
|
|
|
// ADT BUG-ID=15 Sezione Ricerca / Export csv
|
|
|
|
sb.append(provincia != null ? provincia.getProvincia() : ""); |
|
|
|
sb.append(provincia != null ? provincia.getProvincia() : ""); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
sb.append(comune != null ? comune.getDenominazione() : ""); |
|
|
|
sb.append(comune != null ? comune.getDenominazione() : ""); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
|
|
// sb.append("Territorio: " ).append(comune.getDenominazione()).append(!lastDettPratica.getLocalita().isEmpty() ? "(Loc. "+lastDettPratica.getLocalita()+" ) " : "").append(" - ").append(provincia.getProvincia());
|
|
|
|
// sb.append("Territorio: "
|
|
|
|
//ADT BUG-ID=15 Sezione Ricerca / Export csv - Max 30 chars
|
|
|
|
// ).append(comune.getDenominazione()).append(!lastDettPratica.getLocalita().isEmpty()
|
|
|
|
|
|
|
|
// ? "(Loc. "+lastDettPratica.getLocalita()+" ) " :
|
|
|
|
|
|
|
|
// "").append(" - ").append(provincia.getProvincia());
|
|
|
|
|
|
|
|
// ADT BUG-ID=15 Sezione Ricerca / Export csv - Max 30 chars
|
|
|
|
int MAX_LENGHT_DESCR_INTERVENTO = 30; |
|
|
|
int MAX_LENGHT_DESCR_INTERVENTO = 30; |
|
|
|
sb.append(lastDettPratica.getDescLongIntervento() == null ? "": lastDettPratica.getDescLongIntervento().length() > MAX_LENGHT_DESCR_INTERVENTO ? lastDettPratica.getDescLongIntervento().substring(0, MAX_LENGHT_DESCR_INTERVENTO) : lastDettPratica.getDescLongIntervento()); |
|
|
|
sb.append(lastDettPratica.getDescLongIntervento() == null ? "" : lastDettPratica |
|
|
|
|
|
|
|
.getDescLongIntervento().length() > MAX_LENGHT_DESCR_INTERVENTO ? lastDettPratica |
|
|
|
|
|
|
|
.getDescLongIntervento().substring(0, MAX_LENGHT_DESCR_INTERVENTO) : lastDettPratica |
|
|
|
|
|
|
|
.getDescLongIntervento()); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
sb.append(StringPool.SEMICOLON); |
|
|
|
|
|
|
|
|
|
|
|
// Territorio: <strong><%= comune.getDenominazione() %> <%= !lastDettPratica.getLocalita().isEmpty() ? "(Loc. "+lastDettPratica.getLocalita()+" ) " : "" %>- <%= provincia.getProvincia() %></strong><br>
|
|
|
|
// Territorio: <strong><%= comune.getDenominazione() %> <%=
|
|
|
|
// Localizzazione: <strong><%= lastDettPratica.getVia() %></strong><br><br>
|
|
|
|
// !lastDettPratica.getLocalita().isEmpty() ?
|
|
|
|
|
|
|
|
// "(Loc. "+lastDettPratica.getLocalita()+" ) " : "" %>- <%=
|
|
|
|
|
|
|
|
// provincia.getProvincia() %></strong><br>
|
|
|
|
|
|
|
|
// Localizzazione: <strong><%= lastDettPratica.getVia()
|
|
|
|
|
|
|
|
// %></strong><br><br>
|
|
|
|
// <%= lastDettPratica.getDescLongIntervento() %>
|
|
|
|
// <%= lastDettPratica.getDescLongIntervento() %>
|
|
|
|
} catch(Throwable e){ |
|
|
|
} catch (Throwable e) { |
|
|
|
_log.error(method + " IntPraticaId: " + intPratica != null ? intPratica.getIntPraticaId() : "", e); |
|
|
|
_log.error(method + " IntPraticaId: " + intPratica != null ? intPratica.getIntPraticaId() |
|
|
|
} finally{ |
|
|
|
: "", e); |
|
|
|
|
|
|
|
} finally { |
|
|
|
sb.append(StringPool.NEW_LINE); |
|
|
|
sb.append(StringPool.NEW_LINE); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// } catch (PortalException e) {
|
|
|
|
// } catch (PortalException e) {
|
|
|
|
// _log.error(e, e);
|
|
|
|
// _log.error(e, e);
|
|
|
|
// } catch (SystemException e) {
|
|
|
|
// } catch (SystemException e) {
|
|
|
|
// _log.error(e, e);
|
|
|
|
// _log.error(e, e);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
return sb.toString(); |
|
|
|
return sb.toString(); |
|
|
|
|
|
|
|
|
|
|
|