diff --git a/pom.xml b/pom.xml
index 17e30a7e..dda1e240 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
fr.progilone.numahop
numahop
- 2.1.1
+ 2.2.0
war
NumaHOP
NumaHOP
diff --git a/src/main/java/fr/progilone/pgcn/domain/administration/digitallibrary/DigitalLibraryConfiguration.java b/src/main/java/fr/progilone/pgcn/domain/administration/digitallibrary/DigitalLibraryConfiguration.java
index b689b554..dcbb3d2b 100644
--- a/src/main/java/fr/progilone/pgcn/domain/administration/digitallibrary/DigitalLibraryConfiguration.java
+++ b/src/main/java/fr/progilone/pgcn/domain/administration/digitallibrary/DigitalLibraryConfiguration.java
@@ -75,6 +75,12 @@ public class DigitalLibraryConfiguration extends AbstractDomainObject {
@Column(name = "mail")
private String mail;
+ /**
+ * envoi des fichiers en SFTP
+ */
+ @Column(name = "sftp")
+ private boolean sftp;
+
/* Types de fichiers à exporter */
@Column(name = "export_view")
private boolean exportView;
@@ -239,6 +245,14 @@ public void setDefaultValue(final String defaultValue) {
this.defaultValue = defaultValue;
}
+ public boolean isSftp() {
+ return sftp;
+ }
+
+ public void setSftp(final boolean sftp) {
+ this.sftp = sftp;
+ }
+
@Override
public String toString() {
return "DigitalLibraryConfiguration{" + "label='"
diff --git a/src/main/java/fr/progilone/pgcn/repository/document/conditionreport/DescriptionValueRepository.java b/src/main/java/fr/progilone/pgcn/repository/document/conditionreport/DescriptionValueRepository.java
index 6de526a4..06d837e1 100644
--- a/src/main/java/fr/progilone/pgcn/repository/document/conditionreport/DescriptionValueRepository.java
+++ b/src/main/java/fr/progilone/pgcn/repository/document/conditionreport/DescriptionValueRepository.java
@@ -1,5 +1,6 @@
package fr.progilone.pgcn.repository.document.conditionreport;
+import fr.progilone.pgcn.domain.document.conditionreport.DescriptionProperty;
import fr.progilone.pgcn.domain.document.conditionreport.DescriptionValue;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
@@ -9,6 +10,8 @@ public interface DescriptionValueRepository extends JpaRepository findByPropertyIdentifier(String propertyId);
+ List findByProperty(DescriptionProperty property);
+
@Modifying
void deleteByPropertyIdentifier(String propertyId);
}
diff --git a/src/main/java/fr/progilone/pgcn/repository/workflow/DocUnitWorkflowRepositoryCustom.java b/src/main/java/fr/progilone/pgcn/repository/workflow/DocUnitWorkflowRepositoryCustom.java
index fa7a811e..8fe37f73 100644
--- a/src/main/java/fr/progilone/pgcn/repository/workflow/DocUnitWorkflowRepositoryCustom.java
+++ b/src/main/java/fr/progilone/pgcn/repository/workflow/DocUnitWorkflowRepositoryCustom.java
@@ -38,30 +38,6 @@ Page findDocUnitProgressStats(List libraries,
LocalDate toDate,
Pageable pageable);
- /**
- * Recherche paginée
- *
- * @param libraries
- * @param projects
- * @param pgcnId
- * @param states
- * @param users
- * @param fromDate
- * @param toDate
- * @return
- */
- List findDocUnitProgressStatsPending(List libraries,
- List projects,
- boolean projetActive,
- List lots,
- List trains,
- String pgcnId,
- List states,
- final List status,
- List users,
- LocalDate fromDate,
- LocalDate toDate);
-
/**
* Recherche de DocUnitWorkflow
*
diff --git a/src/main/java/fr/progilone/pgcn/repository/workflow/DocUnitWorkflowRepositoryImpl.java b/src/main/java/fr/progilone/pgcn/repository/workflow/DocUnitWorkflowRepositoryImpl.java
index eb701552..08b307c6 100644
--- a/src/main/java/fr/progilone/pgcn/repository/workflow/DocUnitWorkflowRepositoryImpl.java
+++ b/src/main/java/fr/progilone/pgcn/repository/workflow/DocUnitWorkflowRepositoryImpl.java
@@ -3,7 +3,6 @@
import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.Tuple;
import com.querydsl.core.types.Predicate;
-import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.jpa.JPAExpressions;
import com.querydsl.jpa.impl.JPAQuery;
import com.querydsl.jpa.impl.JPAQueryFactory;
@@ -61,7 +60,8 @@ public Page findDocUnitProgressStats(final List librari
final QDocUnitWorkflow qDocUnitWorkflow = QDocUnitWorkflow.docUnitWorkflow;
- final JPAQuery baseQuery = createQueryToFindDocUnitWorkFlows(libraries,
+ final JPAQuery baseQuery = createQueryToFindDocUnitWorkFlows(qDocUnitWorkflow,
+ libraries,
projects,
projetActive,
lots,
@@ -80,46 +80,13 @@ public Page findDocUnitProgressStats(final List librari
if (pageable != null) {
baseQuery.offset(pageable.getOffset()).limit(pageable.getPageSize());
}
- // Tri
- baseQuery.orderBy(qDocUnitWorkflow.docUnit.pgcnId.asc());
- // Résultats
- return new PageImpl<>(baseQuery.fetch(), pageable, total);
- }
-
- @Override
- public List findDocUnitProgressStatsPending(final List libraries,
- final List projects,
- final boolean projetActive,
- final List lots,
- final List trains,
- final String pgcnId,
- final List states,
- final List status,
- final List users,
- final LocalDate fromDate,
- final LocalDate toDate) {
- final QDocUnitWorkflow qDocUnitWorkflow = QDocUnitWorkflow.docUnitWorkflow;
- final JPAQuery baseQuery = createQueryToFindDocUnitWorkFlows(libraries,
- projects,
- projetActive,
- lots,
- trains,
- pgcnId,
- states,
- status,
- users,
- fromDate,
- toDate);
- // Tri
- baseQuery.orderBy(qDocUnitWorkflow.docUnit.pgcnId.asc());
// Résultats
- final List results = baseQuery.fetch();
-
- return results;
+ return new PageImpl<>(baseQuery.fetch(), pageable, total);
}
- private JPAQuery createQueryToFindDocUnitWorkFlows(final List libraries,
+ private JPAQuery createQueryToFindDocUnitWorkFlows(final QDocUnitWorkflow qDocUnitWorkflow,
+ final List libraries,
final List projects,
final boolean projetActive,
final List lots,
@@ -130,19 +97,17 @@ private JPAQuery createQueryToFindDocUnitWorkFlows(final List users,
final LocalDate fromDate,
final LocalDate toDate) {
- final QDocUnitWorkflow qDocUnitWorkflow = QDocUnitWorkflow.docUnitWorkflow;
final QDocUnitState qDocUnitState = QDocUnitState.docUnitState;
final QWorkflowModelState qWorkflowModelState = QWorkflowModelState.workflowModelState;
final QDocUnit qDocUnit = QDocUnit.docUnit;
- final QLibrary qAssociatedLibrary = QLibrary.library;
+ final QLibrary qAssociatedLibrary = new QLibrary("associatedLibrary");
+ final QLibrary qLibrary = QLibrary.library;
final QUser qAssociatedUser = QUser.user;
final QProject qProject = QProject.project;
final QLot qLot = QLot.lot;
+ final QPhysicalDocument qPhysicalDocument = QPhysicalDocument.physicalDocument;
final BooleanBuilder builder = new BooleanBuilder();
- // Droits d'accès
- // QueryDSLBuilderUtils.addAccessFilters(builder, qDocUnit.library, qDocUnit.project, libraries, null);
-
// UD
if (StringUtils.isNotBlank(pgcnId)) {
builder.and(qDocUnit.pgcnId.like('%' + pgcnId
@@ -150,20 +115,18 @@ private JPAQuery createQueryToFindDocUnitWorkFlows(final List createQueryToFindDocUnitWorkFlows(final List createQueryToFindDocUnitWorkFlows(final List createQueryToFindDocUnitWorkFlows(final List findPendingDocUnitWorkflows(final List libr
final QDocUnitWorkflow qDocUnitWorkflow = QDocUnitWorkflow.docUnitWorkflow;
final QDocUnit qDocUnit = QDocUnit.docUnit;
+ final QLibrary qLibrary = QLibrary.library;
+ final QProject qProject = QProject.project;
final QDocUnitState qDocUnitState = QDocUnitState.docUnitState;
final BooleanBuilder builder = new BooleanBuilder();
// Droits d'accès
- QueryDSLBuilderUtils.addAccessFilters(builder, qDocUnit.library, qDocUnit.project, libraries, null);
+ QueryDSLBuilderUtils.addAccessFilters(builder, qLibrary, qProject, libraries, null);
// Projets
if (CollectionUtils.isNotEmpty(projects)) {
- builder.and(qDocUnit.project.identifier.in(projects));
+ builder.and(qProject.identifier.in(projects));
}
// Lots
if (CollectionUtils.isNotEmpty(lots)) {
@@ -277,7 +244,14 @@ public List findPendingDocUnitWorkflows(final List libr
builder.and(JPAExpressions.select(qDocUnitState).from(qDocUnitState).where(stateBuilder).exists());
// Requête
- return queryFactory.selectDistinct(qDocUnitWorkflow).from(qDocUnitWorkflow).innerJoin(qDocUnitWorkflow.docUnit, qDocUnit).fetchJoin().where(builder).fetch();
+ return queryFactory.selectDistinct(qDocUnitWorkflow)
+ .from(qDocUnitWorkflow)
+ .innerJoin(qDocUnitWorkflow.docUnit, qDocUnit)
+ .fetchJoin()
+ .leftJoin(qDocUnit.library, qLibrary)
+ .leftJoin(qDocUnit.project, qProject)
+ .where(builder)
+ .fetch();
}
@Override
@@ -285,14 +259,16 @@ public List findDocUnitWorkflowsInControl(final List li
final QDocUnitWorkflow qDocUnitWorkflow = QDocUnitWorkflow.docUnitWorkflow;
final QDocUnit qDocUnit = QDocUnit.docUnit;
+ final QLibrary qLibrary = QLibrary.library;
+ final QProject qProject = QProject.project;
final BooleanBuilder builder = new BooleanBuilder();
// Droits d'accès
- QueryDSLBuilderUtils.addAccessFilters(builder, qDocUnit.library, qDocUnit.project, libraries, null);
+ QueryDSLBuilderUtils.addAccessFilters(builder, qLibrary, qProject, libraries, null);
// Projets
if (CollectionUtils.isNotEmpty(projects)) {
- builder.and(qDocUnit.project.identifier.in(projects));
+ builder.and(qProject.identifier.in(projects));
}
// Lots
if (CollectionUtils.isNotEmpty(lots)) {
@@ -308,6 +284,8 @@ public List findDocUnitWorkflowsInControl(final List li
final Predicate subQuery = JPAExpressions.select(qDeliveredDocument)
.from(qDeliveredDocument)
.innerJoin(qDeliveredDocument.digitalDocument, qDigitalDocument)
+ .leftJoin(qDocUnit.library, qLibrary)
+ .leftJoin(qDocUnit.project, qProject)
.where(subBuilder)
.exists();
builder.and(subQuery);
@@ -367,14 +345,16 @@ public List