|
|
@ -7,18 +7,27 @@ import it.tref.liferay.portos.bo.model.ControlloPratica; |
|
|
|
import it.tref.liferay.portos.bo.model.DettPratica; |
|
|
|
import it.tref.liferay.portos.bo.model.DettPratica; |
|
|
|
import it.tref.liferay.portos.bo.model.DocPratica; |
|
|
|
import it.tref.liferay.portos.bo.model.DocPratica; |
|
|
|
import it.tref.liferay.portos.bo.model.Pagamento; |
|
|
|
import it.tref.liferay.portos.bo.model.Pagamento; |
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.model.Soggetto; |
|
|
|
import it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.ConfigurazioneServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.ConfigurazioneServiceUtil; |
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil; |
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; |
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.service.SoggettoServiceUtil; |
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.shared.bean.FirmeBean; |
|
|
|
import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants; |
|
|
|
import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants; |
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.shared.util.FirmeUtil; |
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil; |
|
|
|
import it.tref.liferay.portos.bo.util.PraticaUtil; |
|
|
|
import it.tref.liferay.portos.bo.util.PraticaUtil; |
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.util.ValidazionePraticaUtil; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
import java.io.File; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
@ -34,15 +43,19 @@ import com.liferay.portal.kernel.log.Log; |
|
|
|
import com.liferay.portal.kernel.log.LogFactoryUtil; |
|
|
|
import com.liferay.portal.kernel.log.LogFactoryUtil; |
|
|
|
import com.liferay.portal.kernel.repository.model.FileEntry; |
|
|
|
import com.liferay.portal.kernel.repository.model.FileEntry; |
|
|
|
import com.liferay.portal.kernel.repository.model.Folder; |
|
|
|
import com.liferay.portal.kernel.repository.model.Folder; |
|
|
|
|
|
|
|
import com.liferay.portal.kernel.servlet.SessionErrors; |
|
|
|
import com.liferay.portal.kernel.upload.UploadPortletRequest; |
|
|
|
import com.liferay.portal.kernel.upload.UploadPortletRequest; |
|
|
|
|
|
|
|
import com.liferay.portal.kernel.util.HttpUtil; |
|
|
|
import com.liferay.portal.kernel.util.MimeTypesUtil; |
|
|
|
import com.liferay.portal.kernel.util.MimeTypesUtil; |
|
|
|
import com.liferay.portal.kernel.util.ParamUtil; |
|
|
|
import com.liferay.portal.kernel.util.ParamUtil; |
|
|
|
import com.liferay.portal.kernel.util.FileUtil; |
|
|
|
import com.liferay.portal.kernel.util.FileUtil; |
|
|
|
import com.liferay.portal.kernel.util.StringPool; |
|
|
|
import com.liferay.portal.kernel.util.StringPool; |
|
|
|
import com.liferay.portal.kernel.util.Validator; |
|
|
|
import com.liferay.portal.kernel.util.Validator; |
|
|
|
import com.liferay.portal.kernel.util.WebKeys; |
|
|
|
import com.liferay.portal.kernel.util.WebKeys; |
|
|
|
|
|
|
|
import com.liferay.portal.model.User; |
|
|
|
import com.liferay.portal.service.ServiceContext; |
|
|
|
import com.liferay.portal.service.ServiceContext; |
|
|
|
import com.liferay.portal.service.ServiceContextFactory; |
|
|
|
import com.liferay.portal.service.ServiceContextFactory; |
|
|
|
|
|
|
|
import com.liferay.portal.service.UserLocalServiceUtil; |
|
|
|
import com.liferay.portal.theme.ThemeDisplay; |
|
|
|
import com.liferay.portal.theme.ThemeDisplay; |
|
|
|
import com.liferay.portal.util.PortalUtil; |
|
|
|
import com.liferay.portal.util.PortalUtil; |
|
|
|
import com.liferay.portlet.documentlibrary.NoSuchFolderException; |
|
|
|
import com.liferay.portlet.documentlibrary.NoSuchFolderException; |
|
|
@ -54,10 +67,11 @@ import com.liferay.util.bridges.mvc.MVCPortlet; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class SismicaAdministrationPortlet extends MVCPortlet { |
|
|
|
public class SismicaAdministrationPortlet extends MVCPortlet { |
|
|
|
|
|
|
|
|
|
|
|
private static final Log _log = LogFactoryUtil.getLog(SismicaAdministrationPortlet.class); |
|
|
|
private static final Log _log = LogFactoryUtil |
|
|
|
|
|
|
|
.getLog(SismicaAdministrationPortlet.class); |
|
|
|
|
|
|
|
|
|
|
|
public void mostraConfigurazione(ActionRequest actionRequest, ActionResponse actionResponse) |
|
|
|
public void mostraConfigurazione(ActionRequest actionRequest, |
|
|
|
throws SystemException { |
|
|
|
ActionResponse actionResponse) throws SystemException { |
|
|
|
List<String> esito = new ArrayList<String>(); |
|
|
|
List<String> esito = new ArrayList<String>(); |
|
|
|
|
|
|
|
|
|
|
|
esito.add("<h3>Env</h3>"); |
|
|
|
esito.add("<h3>Env</h3>"); |
|
|
@ -66,25 +80,36 @@ public class SismicaAdministrationPortlet extends MVCPortlet { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
esito.add("<h3>Properties</h3>"); |
|
|
|
esito.add("<h3>Properties</h3>"); |
|
|
|
for (Map.Entry<Object, Object> entry : System.getProperties().entrySet()) { |
|
|
|
for (Map.Entry<Object, Object> entry : System.getProperties() |
|
|
|
|
|
|
|
.entrySet()) { |
|
|
|
esito.add(entry.getKey() + "=" + entry.getValue()); |
|
|
|
esito.add(entry.getKey() + "=" + entry.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); |
|
|
|
actionResponse.setRenderParameter("esito", |
|
|
|
|
|
|
|
esito.toArray(new String[esito.size()])); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void generaDocumenti(ActionRequest actionRequest, ActionResponse actionResponse) { |
|
|
|
public void generaDocumenti(ActionRequest actionRequest, |
|
|
|
ThemeDisplay td = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
ActionResponse actionResponse) { |
|
|
|
|
|
|
|
ThemeDisplay td = (ThemeDisplay) actionRequest |
|
|
|
|
|
|
|
.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
List<String> esito = new ArrayList<>(); |
|
|
|
List<String> esito = new ArrayList<>(); |
|
|
|
try { |
|
|
|
try { |
|
|
|
esito = SismicaUtil.generaDocumenti(td.getCompanyId()); |
|
|
|
esito = SismicaUtil.generaDocumenti(td.getCompanyId()); |
|
|
|
} catch (PortalException | SystemException e) { |
|
|
|
} catch (PortalException | SystemException e) { |
|
|
|
esito.add("Errore durante l'invio " + e.getMessage()); |
|
|
|
esito.add("Errore durante l'invio " + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); |
|
|
|
actionResponse.setRenderParameter("esito", |
|
|
|
|
|
|
|
esito.toArray(new String[esito.size()])); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<<<<<<< HEAD |
|
|
|
public void sostituisciDL(ActionRequest actionRequest, ActionResponse actionResponse) |
|
|
|
public void sostituisciDL(ActionRequest actionRequest, ActionResponse actionResponse) |
|
|
|
throws SystemException, PortalException, IOException { |
|
|
|
throws SystemException, PortalException, IOException { |
|
|
|
|
|
|
|
======= |
|
|
|
|
|
|
|
public void sostituisciDL(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { |
|
|
|
|
|
|
|
SismicaUtil.sostituisciDL(actionRequest, actionResponse); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>>>>>>> 096838dd46c4f289d1b3f53893c6727c14619a1e |
|
|
|
long userId = 0; |
|
|
|
long userId = 0; |
|
|
|
String title = null; |
|
|
|
String title = null; |
|
|
|
String description = null; |
|
|
|
String description = null; |
|
|
@ -110,7 +135,7 @@ public class SismicaAdministrationPortlet extends MVCPortlet { |
|
|
|
File file = uploadRequest.getFile("file"); |
|
|
|
File file = uploadRequest.getFile("file"); |
|
|
|
Folder folder = null; |
|
|
|
Folder folder = null; |
|
|
|
|
|
|
|
|
|
|
|
switch (className) { |
|
|
|
switch(className){ |
|
|
|
case "it.tref.liferay.portos.bo.model.DocPratica": |
|
|
|
case "it.tref.liferay.portos.bo.model.DocPratica": |
|
|
|
DocPratica pratica = DocPraticaLocalServiceUtil.getDocPratica(idOggetto); |
|
|
|
DocPratica pratica = DocPraticaLocalServiceUtil.getDocPratica(idOggetto); |
|
|
|
userId = pratica.getUserId(); |
|
|
|
userId = pratica.getUserId(); |
|
|
@ -121,8 +146,7 @@ public class SismicaAdministrationPortlet extends MVCPortlet { |
|
|
|
serviceContext.setScopeGroupId(groupId); |
|
|
|
serviceContext.setScopeGroupId(groupId); |
|
|
|
serviceContext.setUserId(userId); |
|
|
|
serviceContext.setUserId(userId); |
|
|
|
|
|
|
|
|
|
|
|
defaultFolderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, |
|
|
|
defaultFolderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); |
|
|
|
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); |
|
|
|
|
|
|
|
defaultFolder = DLAppLocalServiceUtil.getFolder(defaultFolderId); |
|
|
|
defaultFolder = DLAppLocalServiceUtil.getFolder(defaultFolderId); |
|
|
|
folderName = PraticaUtil.getFolderName(pratica.getClassPk()); |
|
|
|
folderName = PraticaUtil.getFolderName(pratica.getClassPk()); |
|
|
|
folderId = defaultFolder.getFolderId(); |
|
|
|
folderId = defaultFolder.getFolderId(); |
|
|
@ -140,23 +164,14 @@ public class SismicaAdministrationPortlet extends MVCPortlet { |
|
|
|
description = sourceFileName; |
|
|
|
description = sourceFileName; |
|
|
|
mimeType = MimeTypesUtil.getContentType(sourceFileName); |
|
|
|
mimeType = MimeTypesUtil.getContentType(sourceFileName); |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* try { |
|
|
|
|
|
|
|
* DLAppLocalServiceUtil.deleteFileEntry(pratica.getDlFileEntryId |
|
|
|
|
|
|
|
* ()); } catch(PortalException e){ |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* } |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
fileEntry = DLAppLocalServiceUtil.getFileEntry(pratica.getDlFileEntryId()); |
|
|
|
fileEntry = DLAppLocalServiceUtil.getFileEntry(pratica.getDlFileEntryId()); |
|
|
|
fileEntry = DLAppLocalServiceUtil.updateFileEntry(userId, fileEntry.getFileEntryId(), |
|
|
|
fileEntry = DLAppLocalServiceUtil.updateFileEntry(userId, fileEntry.getFileEntryId(), |
|
|
|
now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog, false, |
|
|
|
now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog, false, bytes, |
|
|
|
bytes, serviceContext); |
|
|
|
serviceContext); |
|
|
|
} catch (PortalException e) { |
|
|
|
} catch (PortalException e) { |
|
|
|
fileEntry = DLAppLocalServiceUtil.addFileEntry(userId, folder.getRepositoryId(), |
|
|
|
fileEntry = DLAppLocalServiceUtil.addFileEntry(userId, folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" + sourceFileName, |
|
|
|
folder.getFolderId(), now.getTime() + "_" + sourceFileName, mimeType, title, |
|
|
|
mimeType, title, description, changeLog, bytes, serviceContext); |
|
|
|
description, changeLog, bytes, serviceContext); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pratica.setDlFileEntryId(fileEntry.getFileEntryId()); |
|
|
|
pratica.setDlFileEntryId(fileEntry.getFileEntryId()); |
|
|
@ -174,8 +189,7 @@ public class SismicaAdministrationPortlet extends MVCPortlet { |
|
|
|
serviceContext.setScopeGroupId(groupId); |
|
|
|
serviceContext.setScopeGroupId(groupId); |
|
|
|
serviceContext.setUserId(userId); |
|
|
|
serviceContext.setUserId(userId); |
|
|
|
|
|
|
|
|
|
|
|
defaultFolderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, |
|
|
|
defaultFolderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); |
|
|
|
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); |
|
|
|
|
|
|
|
defaultFolder = DLAppLocalServiceUtil.getFolder(defaultFolderId); |
|
|
|
defaultFolder = DLAppLocalServiceUtil.getFolder(defaultFolderId); |
|
|
|
folderName = PraticaUtil.getFolderName(pagamento.getClassPk()); |
|
|
|
folderName = PraticaUtil.getFolderName(pagamento.getClassPk()); |
|
|
|
folderId = defaultFolder.getFolderId(); |
|
|
|
folderId = defaultFolder.getFolderId(); |
|
|
@ -194,29 +208,113 @@ public class SismicaAdministrationPortlet extends MVCPortlet { |
|
|
|
description = StringPool.BLANK; |
|
|
|
description = StringPool.BLANK; |
|
|
|
mimeType = MimeTypesUtil.getContentType(sourceFileName); |
|
|
|
mimeType = MimeTypesUtil.getContentType(sourceFileName); |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* try { |
|
|
|
|
|
|
|
* DLAppLocalServiceUtil.deleteFileEntry(pagamento.getFileEntryId |
|
|
|
|
|
|
|
* ()); } catch(PortalException e){ |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* } |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
fileEntry = DLAppLocalServiceUtil.getFileEntry(pagamento.getFileEntryId()); |
|
|
|
fileEntry = DLAppLocalServiceUtil.getFileEntry(pagamento.getFileEntryId()); |
|
|
|
fileEntry = DLAppLocalServiceUtil.updateFileEntry(userId, fileEntry.getFileEntryId(), |
|
|
|
fileEntry = DLAppLocalServiceUtil.updateFileEntry(userId, fileEntry.getFileEntryId(), |
|
|
|
now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog, false, |
|
|
|
now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog, false, bytes, |
|
|
|
bytes, serviceContext); |
|
|
|
serviceContext); |
|
|
|
} catch (PortalException e) { |
|
|
|
} catch (PortalException e) { |
|
|
|
fileEntry = DLAppLocalServiceUtil.addFileEntry(userId, folder.getRepositoryId(), |
|
|
|
fileEntry = DLAppLocalServiceUtil.addFileEntry(userId, folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" + sourceFileName, |
|
|
|
folder.getFolderId(), now.getTime() + "_" + sourceFileName, mimeType, title, |
|
|
|
mimeType, title, description, changeLog, bytes, serviceContext); |
|
|
|
description, changeLog, bytes, serviceContext); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pagamento.setFileEntryId(fileEntry.getFileEntryId()); |
|
|
|
pagamento.setFileEntryId(fileEntry.getFileEntryId()); |
|
|
|
PagamentoLocalServiceUtil.updatePagamento(pagamento); |
|
|
|
PagamentoLocalServiceUtil.updatePagamento(pagamento); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case "var_soggetti_no_docpratica": |
|
|
|
|
|
|
|
Soggetto soggetto = SoggettoLocalServiceUtil.getSoggetto(idOggetto); |
|
|
|
|
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(soggetto.getDettPraticaId()); |
|
|
|
|
|
|
|
long intPraticaId = dettPratica.getIntPraticaId(); |
|
|
|
|
|
|
|
serviceContext = ServiceContextFactory.getInstance(Soggetto.class.getName(), actionRequest); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
byte[] content = null; |
|
|
|
|
|
|
|
String jsonFirmatari = ""; |
|
|
|
|
|
|
|
boolean isSigned = false; |
|
|
|
|
|
|
|
FirmeBean firmeBean = new FirmeBean(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
User user = UserLocalServiceUtil.getUser(serviceContext.getUserId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!firmeBean.allSignatures().contains(user.getScreenName())) { |
|
|
|
|
|
|
|
jsonFirmatari = FirmeUtil.addFirma(firmeBean, user.getScreenName()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
jsonFirmatari = FirmeUtil.serialize(firmeBean); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (file.exists()) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Validator.isNotNull(sourceFileName) && file != null) { |
|
|
|
|
|
|
|
// validazione: solo alcune estensioni
|
|
|
|
|
|
|
|
String ext = FileUtil.getExtension(sourceFileName); |
|
|
|
|
|
|
|
if (!ext.equalsIgnoreCase("p7m") |
|
|
|
|
|
|
|
&& !ext.equalsIgnoreCase("pdf")) { |
|
|
|
|
|
|
|
SessionErrors |
|
|
|
|
|
|
|
.add(actionRequest, |
|
|
|
|
|
|
|
"error.geniocivilefe.variazione-soggetto.allegato.ext.valid"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// lunghezza fissata a 200
|
|
|
|
|
|
|
|
if (sourceFileName.length() > 200) { |
|
|
|
|
|
|
|
SessionErrors |
|
|
|
|
|
|
|
.add(actionRequest, |
|
|
|
|
|
|
|
"error.geniocivilefe.variazione-soggetto.allegato.length.valid"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if (!TipoSoggettoUtil.COMMITTENTE |
|
|
|
|
|
|
|
.equalsIgnoreCase(soggetto.getTipologiaSoggetto())) { |
|
|
|
|
|
|
|
SessionErrors |
|
|
|
|
|
|
|
.add(actionRequest, |
|
|
|
|
|
|
|
"error.geniocivilefe.variazione-soggetto.allegato.is.request"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!SessionErrors.isEmpty(actionRequest)) { |
|
|
|
|
|
|
|
throw new SystemException( |
|
|
|
|
|
|
|
"error.geniocivilefe.variazione-soggetto.allegato"); |
|
|
|
|
|
|
|
} else if (file != null) { |
|
|
|
|
|
|
|
content = FileUtil.getBytes(file); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (TipoSoggettoUtil.COMMITTENTE.equals(soggetto |
|
|
|
|
|
|
|
.getTipologiaSoggetto())) { |
|
|
|
|
|
|
|
String[] titolare = new String[] { dettPratica |
|
|
|
|
|
|
|
.getCodiceFiscaleDelegatoCommittente() }; |
|
|
|
|
|
|
|
isSigned = ValidazionePraticaUtil.isAllegatoSignedBySubjects( |
|
|
|
|
|
|
|
sourceFileName, content, serviceContext.getCompanyId(), |
|
|
|
|
|
|
|
Arrays.asList(titolare), jsonFirmatari); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
List<Soggetto> soggettiValidi = SoggettoServiceUtil |
|
|
|
|
|
|
|
.getValidTmpByIntPratica(intPraticaId); |
|
|
|
|
|
|
|
List<String> codiciFiscaliValidi = new ArrayList<String>(); |
|
|
|
|
|
|
|
for (Soggetto valido : soggettiValidi) { |
|
|
|
|
|
|
|
if (!codiciFiscaliValidi |
|
|
|
|
|
|
|
.contains(valido.getCodiceFiscale()) |
|
|
|
|
|
|
|
&& !valido.getCodiceFiscale().equalsIgnoreCase( |
|
|
|
|
|
|
|
soggetto.getCodiceFiscale())) { |
|
|
|
|
|
|
|
codiciFiscaliValidi.add(valido.getCodiceFiscale()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
isSigned = ValidazionePraticaUtil |
|
|
|
|
|
|
|
.isAllegatoSignedBySubjectsAndPerson(sourceFileName, |
|
|
|
|
|
|
|
content, serviceContext.getCompanyId(), |
|
|
|
|
|
|
|
codiciFiscaliValidi, |
|
|
|
|
|
|
|
soggetto.getCodiceFiscale(), jsonFirmatari); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(isSigned){ |
|
|
|
|
|
|
|
userId = PortalUtil.getUserId(actionRequest); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
SoggettoServiceUtil.allegaFileModifica(soggetto.getSoggettoId(), userId, intPraticaId, content, sourceFileName, jsonFirmatari, |
|
|
|
|
|
|
|
serviceContext); |
|
|
|
|
|
|
|
} catch (PortalException e) { |
|
|
|
|
|
|
|
_log.error(e, e); |
|
|
|
|
|
|
|
throw e; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
@ -225,54 +323,70 @@ public class SismicaAdministrationPortlet extends MVCPortlet { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void resetFirme(ActionRequest actionRequest, ActionResponse actionResponse) { |
|
|
|
public void resetFirme(ActionRequest actionRequest, |
|
|
|
ThemeDisplay td = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
ActionResponse actionResponse) { |
|
|
|
String numeroProgetto = ParamUtil.getString(actionRequest, "numeroProgetto"); |
|
|
|
ThemeDisplay td = (ThemeDisplay) actionRequest |
|
|
|
|
|
|
|
.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
|
|
|
|
String numeroProgetto = ParamUtil.getString(actionRequest, |
|
|
|
|
|
|
|
"numeroProgetto"); |
|
|
|
List<String> esito = new ArrayList<>(); |
|
|
|
List<String> esito = new ArrayList<>(); |
|
|
|
try { |
|
|
|
try { |
|
|
|
esito = SismicaUtil.resetFirme(td.getCompanyId(), numeroProgetto); |
|
|
|
esito = SismicaUtil.resetFirme(td.getCompanyId(), numeroProgetto); |
|
|
|
} catch (SystemException | PortalException e) { |
|
|
|
} catch (SystemException | PortalException e) { |
|
|
|
esito.add("Errore durante l'invio " + e.getMessage()); |
|
|
|
esito.add("Errore durante l'invio " + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); |
|
|
|
actionResponse.setRenderParameter("esito", |
|
|
|
|
|
|
|
esito.toArray(new String[esito.size()])); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void reIndexFasciolo(ActionRequest actionRequest, ActionResponse actionResponse) |
|
|
|
public void reIndexFasciolo(ActionRequest actionRequest, |
|
|
|
throws PortalException, SystemException { |
|
|
|
ActionResponse actionResponse) throws PortalException, |
|
|
|
|
|
|
|
SystemException { |
|
|
|
|
|
|
|
|
|
|
|
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest |
|
|
|
|
|
|
|
.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
|
|
|
|
|
|
|
|
long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId"); |
|
|
|
long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId"); |
|
|
|
if (Validator.isNotNull(intPraticaId)) { |
|
|
|
if (Validator.isNotNull(intPraticaId)) { |
|
|
|
IntPraticaLocalServiceUtil.reIndexFasciolo(intPraticaId, themeDisplay.getCompanyId()); |
|
|
|
IntPraticaLocalServiceUtil.reIndexFasciolo(intPraticaId, |
|
|
|
|
|
|
|
themeDisplay.getCompanyId()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String numeroProgetto = ParamUtil.getString(actionRequest, "numeroProgetto"); |
|
|
|
String numeroProgetto = ParamUtil.getString(actionRequest, |
|
|
|
|
|
|
|
"numeroProgetto"); |
|
|
|
if (Validator.isNotNull(numeroProgetto)) { |
|
|
|
if (Validator.isNotNull(numeroProgetto)) { |
|
|
|
IntPraticaLocalServiceUtil.reIndexFasciolo(numeroProgetto, themeDisplay.getCompanyId()); |
|
|
|
IntPraticaLocalServiceUtil.reIndexFasciolo(numeroProgetto, |
|
|
|
|
|
|
|
themeDisplay.getCompanyId()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void reIndexFascicoli(ActionRequest actionRequest, ActionResponse actionResponse) { |
|
|
|
public void reIndexFascicoli(ActionRequest actionRequest, |
|
|
|
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
ActionResponse actionResponse) { |
|
|
|
|
|
|
|
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest |
|
|
|
|
|
|
|
.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
List<String> esito = null; |
|
|
|
List<String> esito = null; |
|
|
|
esito = SismicaUtil.reIndexFascicoli(themeDisplay.getCompanyId()); |
|
|
|
esito = SismicaUtil.reIndexFascicoli(themeDisplay.getCompanyId()); |
|
|
|
if (esito != null) |
|
|
|
if (esito != null) |
|
|
|
actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); |
|
|
|
actionResponse.setRenderParameter("esito", |
|
|
|
|
|
|
|
esito.toArray(new String[esito.size()])); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void lanciaSorteggio(ActionRequest actionRequest, ActionResponse actionResponse) { |
|
|
|
public void lanciaSorteggio(ActionRequest actionRequest, |
|
|
|
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
ActionResponse actionResponse) { |
|
|
|
|
|
|
|
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest |
|
|
|
|
|
|
|
.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
List<String> esito = null; |
|
|
|
List<String> esito = null; |
|
|
|
_log.info("Sorteggio lanciato manualmente"); |
|
|
|
_log.info("Sorteggio lanciato manualmente"); |
|
|
|
try { |
|
|
|
try { |
|
|
|
esito = SorteggioPraticaUtil.sorteggio(themeDisplay.getCompanyId(), new Date()); |
|
|
|
esito = SorteggioPraticaUtil.sorteggio(themeDisplay.getCompanyId(), |
|
|
|
|
|
|
|
new Date()); |
|
|
|
} catch (PortalException | SystemException e) { |
|
|
|
} catch (PortalException | SystemException e) { |
|
|
|
_log.error("error", e); |
|
|
|
_log.error("error", e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (esito != null) |
|
|
|
if (esito != null) |
|
|
|
actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); |
|
|
|
actionResponse.setRenderParameter("esito", |
|
|
|
|
|
|
|
esito.toArray(new String[esito.size()])); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void testInterno(ActionRequest actionRequest, ActionResponse actionResponse) |
|
|
|
public void testInterno(ActionRequest actionRequest, ActionResponse actionResponse) |
|
|
@ -287,18 +401,22 @@ public class SismicaAdministrationPortlet extends MVCPortlet { |
|
|
|
SismicaUtil.inviaAvviso(actionRequest, actionResponse); |
|
|
|
SismicaUtil.inviaAvviso(actionRequest, actionResponse); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void salvaDataProssimoSorteggio(ActionRequest actionRequest, ActionResponse actionResponse) |
|
|
|
public void salvaDataProssimoSorteggio(ActionRequest actionRequest, |
|
|
|
throws PortalException, SystemException { |
|
|
|
ActionResponse actionResponse) throws PortalException, |
|
|
|
|
|
|
|
SystemException { |
|
|
|
|
|
|
|
|
|
|
|
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); |
|
|
|
ServiceContext serviceContext = ServiceContextFactory |
|
|
|
|
|
|
|
.getInstance(actionRequest); |
|
|
|
serviceContext.setScopeGroupId(-1L); |
|
|
|
serviceContext.setScopeGroupId(-1L); |
|
|
|
serviceContext.setCompanyId(serviceContext.getCompanyId()); |
|
|
|
serviceContext.setCompanyId(serviceContext.getCompanyId()); |
|
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); |
|
|
|
|
|
|
|
|
|
|
|
Date dataProssimoSorteggio = ParamUtil.getDate(actionRequest, "dataProssimoSorteggio", sdf); |
|
|
|
Date dataProssimoSorteggio = ParamUtil.getDate(actionRequest, |
|
|
|
|
|
|
|
"dataProssimoSorteggio", sdf); |
|
|
|
|
|
|
|
|
|
|
|
ConfigurazioneServiceUtil.storeConfig("conf.geniocivile.sorteggio.data.prossimo.sorteggio", |
|
|
|
ConfigurazioneServiceUtil.storeConfig( |
|
|
|
|
|
|
|
"conf.geniocivile.sorteggio.data.prossimo.sorteggio", |
|
|
|
sdf.format(dataProssimoSorteggio), serviceContext); |
|
|
|
sdf.format(dataProssimoSorteggio), serviceContext); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|