|
|
@ -34,8 +34,6 @@ import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; |
|
|
|
import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; |
|
|
|
import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; |
|
|
|
import com.liferay.portal.kernel.exception.PortalException; |
|
|
|
import com.liferay.portal.kernel.exception.PortalException; |
|
|
|
import com.liferay.portal.kernel.exception.SystemException; |
|
|
|
import com.liferay.portal.kernel.exception.SystemException; |
|
|
|
import com.liferay.portal.kernel.log.Log; |
|
|
|
|
|
|
|
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.util.MimeTypesUtil; |
|
|
|
import com.liferay.portal.kernel.util.MimeTypesUtil; |
|
|
@ -45,6 +43,7 @@ import com.liferay.portal.kernel.util.Validator; |
|
|
|
import com.liferay.portal.kernel.workflow.WorkflowConstants; |
|
|
|
import com.liferay.portal.kernel.workflow.WorkflowConstants; |
|
|
|
import com.liferay.portal.model.RoleConstants; |
|
|
|
import com.liferay.portal.model.RoleConstants; |
|
|
|
import com.liferay.portal.model.User; |
|
|
|
import com.liferay.portal.model.User; |
|
|
|
|
|
|
|
import com.liferay.portal.security.permission.ActionKeys; |
|
|
|
import com.liferay.portal.security.permission.PermissionCheckerFactoryUtil; |
|
|
|
import com.liferay.portal.security.permission.PermissionCheckerFactoryUtil; |
|
|
|
import com.liferay.portal.security.permission.PermissionThreadLocal; |
|
|
|
import com.liferay.portal.security.permission.PermissionThreadLocal; |
|
|
|
import com.liferay.portal.service.RoleLocalServiceUtil; |
|
|
|
import com.liferay.portal.service.RoleLocalServiceUtil; |
|
|
@ -57,13 +56,14 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException; |
|
|
|
* The implementation of the doc pratica local service. |
|
|
|
* The implementation of the doc pratica local service. |
|
|
|
* |
|
|
|
* |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* All custom service methods should be put in this class. Whenever methods are added, rerun |
|
|
|
* All custom service methods should be put in this class. Whenever methods are |
|
|
|
* ServiceBuilder to copy their definitions into the |
|
|
|
* added, rerun ServiceBuilder to copy their definitions into the |
|
|
|
* {@link it.tref.liferay.portos.bo.service.DocPraticaLocalService} interface. |
|
|
|
* {@link it.tref.liferay.portos.bo.service.DocPraticaLocalService} interface. |
|
|
|
* |
|
|
|
* |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* This is a local service. Methods of this service will not have security checks based on the |
|
|
|
* This is a local service. Methods of this service will not have security |
|
|
|
* propagated JAAS credentials because this service can only be accessed from within the same VM. |
|
|
|
* checks based on the propagated JAAS credentials because this service can only |
|
|
|
|
|
|
|
* be accessed from within the same VM. |
|
|
|
* </p> |
|
|
|
* </p> |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Davide Barbagallo, 3F Consulting |
|
|
|
* @author Davide Barbagallo, 3F Consulting |
|
|
@ -72,13 +72,11 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
/* |
|
|
|
/* |
|
|
|
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link |
|
|
|
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use |
|
|
|
* it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil} to access the doc pratica local |
|
|
|
* {@link it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil} to |
|
|
|
* service. |
|
|
|
* access the doc pratica local service. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
private Log _log = LogFactoryUtil.getLog(DocPraticaLocalServiceImpl.class); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public DocPratica deleteDocPratica(DocPratica docPratica) throws SystemException { |
|
|
|
public DocPratica deleteDocPratica(DocPratica docPratica) throws SystemException { |
|
|
|
|
|
|
|
|
|
|
@ -100,21 +98,22 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
return deleteDocPratica(docPraticaLocalService.getDocPratica(docPraticaId)); |
|
|
|
return deleteDocPratica(docPraticaLocalService.getDocPratica(docPraticaId)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, byte[] dlFileEntry, |
|
|
|
public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, |
|
|
|
String fileName, String version, boolean praticaValidata, String descLong, String tipologia, String sha256, |
|
|
|
byte[] dlFileEntry, String fileName, String version, boolean praticaValidata, String descLong, |
|
|
|
boolean aggiornato, String jsonFirmatari, long dettPraticaIdRimozione, Date dtDataRimozione, |
|
|
|
String tipologia, String sha256, boolean aggiornato, String jsonFirmatari, |
|
|
|
ServiceContext serviceContext) throws PortalException, SystemException { |
|
|
|
long dettPraticaIdRimozione, Date dtDataRimozione, ServiceContext serviceContext) |
|
|
|
|
|
|
|
throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
|
|
User user = userPersistence.findByPrimaryKey(userId); |
|
|
|
User user = userPersistence.findByPrimaryKey(userId); |
|
|
|
|
|
|
|
|
|
|
|
Date now = new Date(); |
|
|
|
Date now = new Date(); |
|
|
|
|
|
|
|
|
|
|
|
validate(serviceContext.getScopeGroupId(), 0L, className, classPk, intPraticaId, dlFileEntry, fileName, version, |
|
|
|
validate(serviceContext.getScopeGroupId(), 0L, className, classPk, intPraticaId, dlFileEntry, |
|
|
|
praticaValidata, descLong, tipologia, sha256, aggiornato, jsonFirmatari, dettPraticaIdRimozione, |
|
|
|
fileName, version, praticaValidata, descLong, tipologia, sha256, aggiornato, jsonFirmatari, |
|
|
|
dtDataRimozione); |
|
|
|
dettPraticaIdRimozione, dtDataRimozione); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class |
|
|
|
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName())); |
|
|
|
.getName())); |
|
|
|
|
|
|
|
|
|
|
|
FileEntry fileEntry = addAttachment(classPk, intPraticaId, userId, fileName, dlFileEntry, tipologia); |
|
|
|
FileEntry fileEntry = addAttachment(classPk, intPraticaId, userId, fileName, dlFileEntry, tipologia); |
|
|
|
|
|
|
|
|
|
|
@ -146,15 +145,16 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
return docPratica; |
|
|
|
return docPratica; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, byte[] dlFileEntry, |
|
|
|
public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, |
|
|
|
String fileName, String tipologia, String jsonFirmatari, ServiceContext serviceContext) throws PortalException, |
|
|
|
byte[] dlFileEntry, String fileName, String tipologia, String jsonFirmatari, |
|
|
|
SystemException { |
|
|
|
ServiceContext serviceContext) throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
|
|
User user = userPersistence.findByPrimaryKey(userId); |
|
|
|
User user = userPersistence.findByPrimaryKey(userId); |
|
|
|
|
|
|
|
|
|
|
|
Date now = new Date(); |
|
|
|
Date now = new Date(); |
|
|
|
|
|
|
|
|
|
|
|
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName())); |
|
|
|
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class |
|
|
|
|
|
|
|
.getName())); |
|
|
|
|
|
|
|
|
|
|
|
FileEntry fileEntry = addAttachment(classPk, intPraticaId, userId, fileName, dlFileEntry, tipologia); |
|
|
|
FileEntry fileEntry = addAttachment(classPk, intPraticaId, userId, fileName, dlFileEntry, tipologia); |
|
|
|
|
|
|
|
|
|
|
@ -185,15 +185,16 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
return docPratica; |
|
|
|
return docPratica; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, long fileEntryId, |
|
|
|
public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, |
|
|
|
String fileName, String tipologia, String jsonFirmatari, ServiceContext serviceContext) throws PortalException, |
|
|
|
long fileEntryId, String fileName, String tipologia, String jsonFirmatari, |
|
|
|
SystemException { |
|
|
|
ServiceContext serviceContext) throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
|
|
User user = userPersistence.findByPrimaryKey(userId); |
|
|
|
User user = userPersistence.findByPrimaryKey(userId); |
|
|
|
|
|
|
|
|
|
|
|
Date now = new Date(); |
|
|
|
Date now = new Date(); |
|
|
|
|
|
|
|
|
|
|
|
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName())); |
|
|
|
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class |
|
|
|
|
|
|
|
.getName())); |
|
|
|
|
|
|
|
|
|
|
|
docPratica.setCompanyId(serviceContext.getCompanyId()); |
|
|
|
docPratica.setCompanyId(serviceContext.getCompanyId()); |
|
|
|
docPratica.setUserId(user.getUserId()); |
|
|
|
docPratica.setUserId(user.getUserId()); |
|
|
@ -223,18 +224,19 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public DocPratica addDocPraticaForImport(long userId, String className, long classPk, long intPraticaId, |
|
|
|
public DocPratica addDocPraticaForImport(long userId, String className, long classPk, long intPraticaId, |
|
|
|
byte[] dlFileEntry, String fileName, String version, boolean praticaValidata, String descLong, String tipologia, |
|
|
|
byte[] dlFileEntry, String fileName, String version, boolean praticaValidata, String descLong, |
|
|
|
String sha256, boolean aggiornato, String jsonFirmatari, long dettPraticaIdRimozione, Date dtDataRimozione, |
|
|
|
String tipologia, String sha256, boolean aggiornato, String jsonFirmatari, |
|
|
|
long oldDocPraticaId, ServiceContext serviceContext) throws PortalException, SystemException { |
|
|
|
long dettPraticaIdRimozione, Date dtDataRimozione, long oldDocPraticaId, |
|
|
|
|
|
|
|
ServiceContext serviceContext) throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
|
|
Date now = new Date(); |
|
|
|
Date now = new Date(); |
|
|
|
|
|
|
|
|
|
|
|
validate(serviceContext.getScopeGroupId(), 0L, className, classPk, intPraticaId, dlFileEntry, fileName, version, |
|
|
|
validate(serviceContext.getScopeGroupId(), 0L, className, classPk, intPraticaId, dlFileEntry, |
|
|
|
praticaValidata, descLong, tipologia, sha256, aggiornato, jsonFirmatari, dettPraticaIdRimozione, |
|
|
|
fileName, version, praticaValidata, descLong, tipologia, sha256, aggiornato, jsonFirmatari, |
|
|
|
dtDataRimozione); |
|
|
|
dettPraticaIdRimozione, dtDataRimozione); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class |
|
|
|
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName())); |
|
|
|
.getName())); |
|
|
|
|
|
|
|
|
|
|
|
docPratica.setCompanyId(serviceContext.getCompanyId()); |
|
|
|
docPratica.setCompanyId(serviceContext.getCompanyId()); |
|
|
|
docPratica.setUserId(userId); |
|
|
|
docPratica.setUserId(userId); |
|
|
@ -269,7 +271,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
|
|
|
|
|
|
|
|
FileEntry fileEntry = null; |
|
|
|
FileEntry fileEntry = null; |
|
|
|
|
|
|
|
|
|
|
|
// DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId);
|
|
|
|
// DettPratica dettPratica =
|
|
|
|
|
|
|
|
// dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId);
|
|
|
|
IntPratica intPratica = intPraticaPersistence.fetchByPrimaryKey(intPraticaId); |
|
|
|
IntPratica intPratica = intPraticaPersistence.fetchByPrimaryKey(intPraticaId); |
|
|
|
Territorio territorio = territorioPersistence.fetchByPrimaryKey(intPratica.getTerritorioId()); |
|
|
|
Territorio territorio = territorioPersistence.fetchByPrimaryKey(intPratica.getTerritorioId()); |
|
|
|
|
|
|
|
|
|
|
@ -277,9 +280,9 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
long groupId = territorio.getGroupId(); |
|
|
|
long groupId = territorio.getGroupId(); |
|
|
|
|
|
|
|
|
|
|
|
// TODO forse è meglio ragionare con un'altra logica per i permessi
|
|
|
|
// TODO forse è meglio ragionare con un'altra logica per i permessi
|
|
|
|
User user = |
|
|
|
User user = UserLocalServiceUtil.getRoleUsers( |
|
|
|
UserLocalServiceUtil.getRoleUsers( |
|
|
|
RoleLocalServiceUtil.getRole(intPratica.getCompanyId(), RoleConstants.ADMINISTRATOR) |
|
|
|
RoleLocalServiceUtil.getRole(intPratica.getCompanyId(), RoleConstants.ADMINISTRATOR).getRoleId()).get(0); |
|
|
|
.getRoleId()).get(0); |
|
|
|
try { |
|
|
|
try { |
|
|
|
PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(user)); |
|
|
|
PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(user)); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
@ -292,11 +295,10 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
serviceContext.setCompanyId(companyId); |
|
|
|
serviceContext.setCompanyId(companyId); |
|
|
|
serviceContext.setScopeGroupId(groupId); |
|
|
|
serviceContext.setScopeGroupId(groupId); |
|
|
|
serviceContext.setUserId(userId); |
|
|
|
serviceContext.setUserId(userId); |
|
|
|
|
|
|
|
serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); |
|
|
|
|
|
|
|
|
|
|
|
// TODO forse mettiamo i permesssi ma non mi pare sicuro.
|
|
|
|
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(companyId, |
|
|
|
|
|
|
|
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); |
|
|
|
long defaultFolderId = |
|
|
|
|
|
|
|
configurazioneLocalService.findByC_ChiaveLong(companyId, ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId); |
|
|
|
Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId); |
|
|
|
|
|
|
|
|
|
|
@ -304,12 +306,12 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
|
|
|
|
|
|
|
|
Folder folder = null; |
|
|
|
Folder folder = null; |
|
|
|
try { |
|
|
|
try { |
|
|
|
folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), defaultFolder.getFolderId(), folderName); |
|
|
|
folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), |
|
|
|
|
|
|
|
defaultFolder.getFolderId(), folderName); |
|
|
|
} catch (NoSuchFolderException e) { |
|
|
|
} catch (NoSuchFolderException e) { |
|
|
|
// cartella non presente -> creo cartella
|
|
|
|
// cartella non presente -> creo cartella
|
|
|
|
folder = |
|
|
|
folder = dlAppLocalService.addFolder(userId, defaultFolder.getRepositoryId(), |
|
|
|
dlAppLocalService.addFolder(userId, defaultFolder.getRepositoryId(), defaultFolder.getFolderId(), folderName, |
|
|
|
defaultFolder.getFolderId(), folderName, StringPool.BLANK, serviceContext); |
|
|
|
StringPool.BLANK, serviceContext); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
Date now = new Date(); |
|
|
|
Date now = new Date(); |
|
|
|
String title = tipoAllegato + StringPool.UNDERLINE + sourceFileName; |
|
|
|
String title = tipoAllegato + StringPool.UNDERLINE + sourceFileName; |
|
|
@ -317,13 +319,13 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
String mimeType = MimeTypesUtil.getContentType(sourceFileName); |
|
|
|
String mimeType = MimeTypesUtil.getContentType(sourceFileName); |
|
|
|
|
|
|
|
|
|
|
|
String changeLog = StringPool.BLANK; |
|
|
|
String changeLog = StringPool.BLANK; |
|
|
|
fileEntry = |
|
|
|
fileEntry = dlAppLocalService.addFileEntry(userId, folder.getRepositoryId(), folder.getFolderId(), |
|
|
|
dlAppLocalService.addFileEntry(userId, folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" |
|
|
|
now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog, content, |
|
|
|
+ sourceFileName, mimeType, title, description, changeLog, content, serviceContext); |
|
|
|
serviceContext); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(UserLocalServiceUtil |
|
|
|
PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil |
|
|
|
.getUser(delegaUserId))); |
|
|
|
.create(UserLocalServiceUtil.getUser(delegaUserId))); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
throw new SystemException(e); |
|
|
|
throw new SystemException(e); |
|
|
|
|
|
|
|
|
|
|
@ -344,7 +346,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
docPraticaLocalService.updateDocPratica(docPratica); |
|
|
|
docPraticaLocalService.updateDocPratica(docPratica); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void addFirmeAndApprova(long docPraticaId, List<String> codiciFiscali) throws PortalException, SystemException { |
|
|
|
public void addFirmeAndApprova(long docPraticaId, List<String> codiciFiscali) throws PortalException, |
|
|
|
|
|
|
|
SystemException { |
|
|
|
|
|
|
|
|
|
|
|
DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); |
|
|
|
DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); |
|
|
|
String jsonFirmatari = docPratica.getJsonFirmatari(); |
|
|
|
String jsonFirmatari = docPratica.getJsonFirmatari(); |
|
|
@ -357,7 +360,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
docPraticaLocalService.updateDocPratica(docPratica); |
|
|
|
docPraticaLocalService.updateDocPratica(docPratica); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void addErrorAndApprova(long docPraticaId, String errorCode) throws PortalException, SystemException { |
|
|
|
public void addErrorAndApprova(long docPraticaId, String errorCode) throws PortalException, |
|
|
|
|
|
|
|
SystemException { |
|
|
|
|
|
|
|
|
|
|
|
DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); |
|
|
|
DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); |
|
|
|
docPratica.setModifiedDate(new Date()); |
|
|
|
docPratica.setModifiedDate(new Date()); |
|
|
@ -376,16 +380,16 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void validate(long groupId, long docPraticaId, String className, long classPk, long intPraticaId, |
|
|
|
private void validate(long groupId, long docPraticaId, String className, long classPk, long intPraticaId, |
|
|
|
byte[] dlFileEntry, String fileName, String version, boolean praticaValidata, String descLong, String tipologia, |
|
|
|
byte[] dlFileEntry, String fileName, String version, boolean praticaValidata, String descLong, |
|
|
|
String sha256, boolean aggiornato, String jsonFirmatari, long dettPraticaIdRimozione, Date dtDataRimozione) |
|
|
|
String tipologia, String sha256, boolean aggiornato, String jsonFirmatari, |
|
|
|
throws PortalException, SystemException { |
|
|
|
long dettPraticaIdRimozione, Date dtDataRimozione) throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
|
|
// TODO Write your own validation code
|
|
|
|
// TODO Write your own validation code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public DocPratica updateDocPraticaAggiornato(long docPraticaId, boolean aggiornato) throws SystemException { |
|
|
|
public DocPratica updateDocPraticaAggiornato(long docPraticaId, boolean aggiornato) |
|
|
|
|
|
|
|
throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
DocPratica docPratica = docPraticaPersistence.fetchByPrimaryKey(docPraticaId); |
|
|
|
DocPratica docPratica = docPraticaPersistence.fetchByPrimaryKey(docPraticaId); |
|
|
|
docPratica.setAggiornato(aggiornato); |
|
|
|
docPratica.setAggiornato(aggiornato); |
|
|
@ -399,15 +403,12 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery); |
|
|
|
return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
|
|
|
|
public List<DocPratica> getDocPraticaDaInviareDax(int start, int end) throws SystemException { |
|
|
|
public List<DocPratica> getDocPraticaDaInviareDax(int start, int end) throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
DynamicQuery dynamicQuery = dynamicQueryDocPraticaDaInviareDax(); |
|
|
|
DynamicQuery dynamicQuery = dynamicQueryDocPraticaDaInviareDax(); |
|
|
|
return docPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end); |
|
|
|
return docPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private DynamicQuery dynamicQueryDocPraticaDaInviareDax() { |
|
|
|
private DynamicQuery dynamicQueryDocPraticaDaInviareDax() { |
|
|
|
|
|
|
|
|
|
|
|
DynamicQuery dynamicQuery = docPraticaLocalService.dynamicQuery(); |
|
|
|
DynamicQuery dynamicQuery = docPraticaLocalService.dynamicQuery(); |
|
|
|
dynamicQuery.add(PropertyFactoryUtil.forName("dtInvioDax").isNull()); |
|
|
|
dynamicQuery.add(PropertyFactoryUtil.forName("dtInvioDax").isNull()); |
|
|
|
dynamicQuery.add(PropertyFactoryUtil.forName("daxId").eq(0L)); |
|
|
|
dynamicQuery.add(PropertyFactoryUtil.forName("daxId").eq(0L)); |
|
|
@ -417,7 +418,6 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public int countByClassPk(long classPk) throws SystemException { |
|
|
|
public int countByClassPk(long classPk) throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
return docPraticaPersistence.countByClassPk(classPk); |
|
|
|
return docPraticaPersistence.countByClassPk(classPk); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -436,7 +436,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
return docPraticaPersistence.findByClassPk(classPk); |
|
|
|
return docPraticaPersistence.findByClassPk(classPk); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<DocPratica> findByStaus(int status, int start, int end, OrderByComparator order) throws SystemException { |
|
|
|
public List<DocPratica> findByStaus(int status, int start, int end, OrderByComparator order) |
|
|
|
|
|
|
|
throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
return docPraticaPersistence.findByStatus(status, start, end, order); |
|
|
|
return docPraticaPersistence.findByStatus(status, start, end, order); |
|
|
|
} |
|
|
|
} |
|
|
@ -467,8 +468,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
return soggettoPersistence.findWithDynamicQuery(dynamicQuery, start, end); |
|
|
|
return soggettoPersistence.findWithDynamicQuery(dynamicQuery, start, end); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<DocPratica> findByIntPratica_ClassPk_Tipologia(long intPraticaId, long classPk, String tipologia, |
|
|
|
public List<DocPratica> findByIntPratica_ClassPk_Tipologia(long intPraticaId, long classPk, |
|
|
|
int start, int end) throws SystemException { |
|
|
|
String tipologia, int start, int end) throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
DynamicQuery dynamicQuery = dynamicQuery(); |
|
|
|
DynamicQuery dynamicQuery = dynamicQuery(); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); |
|
|
@ -478,8 +479,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
return dynamicQuery(dynamicQuery, start, end); |
|
|
|
return dynamicQuery(dynamicQuery, start, end); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<DocPratica> findByIntPratica_ClassPk_Tipologie(long intPraticaId, long classPk, List<String> tipologie) |
|
|
|
public List<DocPratica> findByIntPratica_ClassPk_Tipologie(long intPraticaId, long classPk, |
|
|
|
throws SystemException { |
|
|
|
List<String> tipologie) throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
DynamicQuery dynamicQuery = dynamicQuery(); |
|
|
|
DynamicQuery dynamicQuery = dynamicQuery(); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); |
|
|
@ -500,7 +501,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
return dynamicQuery(dynamicQuery); |
|
|
|
return dynamicQuery(dynamicQuery); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public DocPratica fetchByC_Group_DlFileEntry_Version(long dlFileEntryId, String version) throws SystemException { |
|
|
|
public DocPratica fetchByC_Group_DlFileEntry_Version(long dlFileEntryId, String version) |
|
|
|
|
|
|
|
throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
return docPraticaPersistence.fetchByDlFileEntry_Version(dlFileEntryId, version); |
|
|
|
return docPraticaPersistence.fetchByDlFileEntry_Version(dlFileEntryId, version); |
|
|
|
} |
|
|
|
} |
|
|
@ -520,7 +522,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
throws SystemException { |
|
|
|
throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
DynamicQuery dynamicQuery = docPraticaLocalService.dynamicQuery(); |
|
|
|
DynamicQuery dynamicQuery = docPraticaLocalService.dynamicQuery(); |
|
|
|
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("dlFileEntryId"))); |
|
|
|
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil |
|
|
|
|
|
|
|
.property("dlFileEntryId"))); |
|
|
|
dynamicQuery.add(PropertyFactoryUtil.forName("tipologia").eq(tipologia)); |
|
|
|
dynamicQuery.add(PropertyFactoryUtil.forName("tipologia").eq(tipologia)); |
|
|
|
Junction or = RestrictionsFactoryUtil.disjunction(); |
|
|
|
Junction or = RestrictionsFactoryUtil.disjunction(); |
|
|
|
for (long classPk : classPks) { |
|
|
|
for (long classPk : classPks) { |
|
|
@ -540,8 +543,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
return dynamicQuery(dynamicQuery); |
|
|
|
return dynamicQuery(dynamicQuery); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<DocPratica> getValidByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) |
|
|
|
public List<DocPratica> getValidByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, |
|
|
|
throws SystemException { |
|
|
|
int end) throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
DynamicQuery dynamicQuery = dynamicQuery(); |
|
|
|
DynamicQuery dynamicQuery = dynamicQuery(); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); |
|
|
@ -551,7 +554,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
return dynamicQuery(dynamicQuery, start, end); |
|
|
|
return dynamicQuery(dynamicQuery, start, end); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public int countValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia) throws SystemException { |
|
|
|
public int countValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia) |
|
|
|
|
|
|
|
throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); |
|
|
|
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); |
|
|
@ -559,8 +563,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery); |
|
|
|
return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<DocPratica> getValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) |
|
|
|
public List<DocPratica> getValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, |
|
|
|
throws SystemException { |
|
|
|
int end) throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); |
|
|
|
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); |
|
|
@ -569,8 +573,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
return dynamicQuery(dynamicQuery, start, end); |
|
|
|
return dynamicQuery(dynamicQuery, start, end); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<DocPratica> getValidTmpByIntPratica_DettPratica_Tipologia(long intPraticaId, long dettPraticaId, String tipologia, int start, int end) |
|
|
|
public List<DocPratica> getValidTmpByIntPratica_DettPratica_Tipologia(long intPraticaId, |
|
|
|
throws SystemException { |
|
|
|
long dettPraticaId, String tipologia, int start, int end) throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); |
|
|
|
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); |
|
|
@ -581,8 +585,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
return dynamicQuery(dynamicQuery, start, end); |
|
|
|
return dynamicQuery(dynamicQuery, start, end); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<DocPratica> getValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie, int start, int end) |
|
|
|
public List<DocPratica> getValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie, |
|
|
|
throws SystemException { |
|
|
|
int start, int end) throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); |
|
|
|
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie)); |
|
|
@ -591,7 +595,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
return dynamicQuery(dynamicQuery, start, end); |
|
|
|
return dynamicQuery(dynamicQuery, start, end); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public int countValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie) throws SystemException { |
|
|
|
public int countValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie) |
|
|
|
|
|
|
|
throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); |
|
|
|
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie)); |
|
|
@ -626,14 +631,15 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
return dynamicQuery(dynamicQuery); |
|
|
|
return dynamicQuery(dynamicQuery); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<DocPratica> getValidUntilClassPkByIntPratica(long intPraticaId, long classPk, String tipologia, |
|
|
|
public List<DocPratica> getValidUntilClassPkByIntPratica(long intPraticaId, long classPk, |
|
|
|
int start, int end) throws SystemException { |
|
|
|
String tipologia, int start, int end) throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
DynamicQuery dynamicQuery = dynamicQuery(); |
|
|
|
DynamicQuery dynamicQuery = dynamicQuery(); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.le("classPk", classPk)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.le("classPk", classPk)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); |
|
|
|
// dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaIdRimozione", null));
|
|
|
|
// dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaIdRimozione",
|
|
|
|
|
|
|
|
// null));
|
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("rimosso", false)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("rimosso", false)); |
|
|
|
dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk")); |
|
|
|
dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk")); |
|
|
|
return dynamicQuery(dynamicQuery, start, end); |
|
|
|
return dynamicQuery(dynamicQuery, start, end); |
|
|
@ -661,15 +667,16 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ADT BUG FE ID = 9
|
|
|
|
// ADT BUG FE ID = 9
|
|
|
|
public DocPratica addDocPraticaAnnullamento(long userId, String className, long classPk, long intPraticaId, long fileEntryId, |
|
|
|
public DocPratica addDocPraticaAnnullamento(long userId, String className, long classPk, |
|
|
|
String fileName, String tipologia, String sha256, String jsonFirmatari, ServiceContext serviceContext) throws PortalException, |
|
|
|
long intPraticaId, long fileEntryId, String fileName, String tipologia, String sha256, |
|
|
|
SystemException { |
|
|
|
String jsonFirmatari, ServiceContext serviceContext) throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
|
|
User user = userPersistence.findByPrimaryKey(userId); |
|
|
|
User user = userPersistence.findByPrimaryKey(userId); |
|
|
|
|
|
|
|
|
|
|
|
Date now = new Date(); |
|
|
|
Date now = new Date(); |
|
|
|
|
|
|
|
|
|
|
|
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName())); |
|
|
|
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class |
|
|
|
|
|
|
|
.getName())); |
|
|
|
|
|
|
|
|
|
|
|
docPratica.setCompanyId(serviceContext.getCompanyId()); |
|
|
|
docPratica.setCompanyId(serviceContext.getCompanyId()); |
|
|
|
docPratica.setUserId(user.getUserId()); |
|
|
|
docPratica.setUserId(user.getUserId()); |
|
|
@ -699,7 +706,6 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
return docPratica; |
|
|
|
return docPratica; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Metodo nuovo ADT |
|
|
|
* Metodo nuovo ADT |
|
|
|
* |
|
|
|
* |
|
|
@ -711,8 +717,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
* @throws SystemException |
|
|
|
* @throws SystemException |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public List<DocPratica> findByIntPratica_ClassPk_TipologiaNew(long intPraticaId, long classPk, String tipologia, |
|
|
|
public List<DocPratica> findByIntPratica_ClassPk_TipologiaNew(long intPraticaId, long classPk, |
|
|
|
int start, int end) throws SystemException { |
|
|
|
String tipologia, int start, int end) throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
DynamicQuery dynamicQuery = dynamicQuery(); |
|
|
|
DynamicQuery dynamicQuery = dynamicQuery(); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); |
|
|
|