Fixed issue when finalizing datasets from the DMP Overview.
This commit is contained in:
parent
feee5b49e9
commit
5d44d8bf45
|
@ -419,6 +419,9 @@ public class DataManagementPlanManager {
|
||||||
apiContext.getOperationsContext().getDatabaseRepository().getDatasetDao()
|
apiContext.getOperationsContext().getDatabaseRepository().getDatasetDao()
|
||||||
.asQueryable().where((builder, root) -> root.get("id").in(dataManagementPlan.getDatasetsToBeFinalized()))
|
.asQueryable().where((builder, root) -> root.get("id").in(dataManagementPlan.getDatasetsToBeFinalized()))
|
||||||
.update(root -> root.<Integer>get("status"), Dataset.Status.FINALISED.getValue());
|
.update(root -> root.<Integer>get("status"), Dataset.Status.FINALISED.getValue());
|
||||||
|
apiContext.getOperationsContext().getDatabaseRepository().getDatasetDao()
|
||||||
|
.asQueryable().where((builder, root) -> root.get("id").in(dataManagementPlan.getDatasetsToBeFinalized()))
|
||||||
|
.update(root -> root.<Date>get("finalizedat"), new Date());
|
||||||
|
|
||||||
List<UUID> datasetsToBeCanceled = new LinkedList<>();
|
List<UUID> datasetsToBeCanceled = new LinkedList<>();
|
||||||
for (DatasetWizardModel dataset : dataManagementPlan.getDatasets()) {
|
for (DatasetWizardModel dataset : dataManagementPlan.getDatasets()) {
|
||||||
|
@ -894,8 +897,15 @@ public class DataManagementPlanManager {
|
||||||
apiContext.getOperationsContext().getDatabaseRepository().getDatasetDao()
|
apiContext.getOperationsContext().getDatabaseRepository().getDatasetDao()
|
||||||
.asQueryable().where((builder, root) -> root.get("id").in(datasetsToBeFinalized.getUuids()))
|
.asQueryable().where((builder, root) -> root.get("id").in(datasetsToBeFinalized.getUuids()))
|
||||||
.update(root -> root.<Integer>get("status"), Dataset.Status.FINALISED.getValue());
|
.update(root -> root.<Integer>get("status"), Dataset.Status.FINALISED.getValue());
|
||||||
|
apiContext.getOperationsContext().getDatabaseRepository().getDatasetDao()
|
||||||
|
.asQueryable().where((builder, root) -> root.get("id").in(datasetsToBeFinalized.getUuids()))
|
||||||
|
.update(root -> root.<Date>get("finalizedAt"), new Date());
|
||||||
List<Dataset> finalizedDatasets = dmp.getDataset().stream().filter(dataset -> datasetsToBeFinalized.getUuids().contains(dataset.getId())).collect(Collectors.toList());
|
List<Dataset> finalizedDatasets = dmp.getDataset().stream().filter(dataset -> datasetsToBeFinalized.getUuids().contains(dataset.getId())).collect(Collectors.toList());
|
||||||
finalizedDatasets.forEach(dataset -> dataset.setStatus(Dataset.Status.FINALISED.getValue()));
|
finalizedDatasets.forEach(dataset ->{
|
||||||
|
dataset.setStatus(Dataset.Status.FINALISED.getValue());
|
||||||
|
dataset.setFinalizedAt(new Date());
|
||||||
|
dataset.setModified(new Date());
|
||||||
|
} );
|
||||||
indexDatasets.addAll(finalizedDatasets);
|
indexDatasets.addAll(finalizedDatasets);
|
||||||
List<UUID> datasetsToBeCanceled = new LinkedList<>();
|
List<UUID> datasetsToBeCanceled = new LinkedList<>();
|
||||||
for (Dataset dataset : dmp.getDataset()) {
|
for (Dataset dataset : dmp.getDataset()) {
|
||||||
|
|
Loading…
Reference in New Issue