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