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()
|
||||
.asQueryable().where((builder, root) -> root.get("id").in(dataManagementPlan.getDatasetsToBeFinalized()))
|
||||
.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<>();
|
||||
for (DatasetWizardModel dataset : dataManagementPlan.getDatasets()) {
|
||||
|
@ -894,8 +897,15 @@ public class DataManagementPlanManager {
|
|||
apiContext.getOperationsContext().getDatabaseRepository().getDatasetDao()
|
||||
.asQueryable().where((builder, root) -> root.get("id").in(datasetsToBeFinalized.getUuids()))
|
||||
.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());
|
||||
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);
|
||||
List<UUID> datasetsToBeCanceled = new LinkedList<>();
|
||||
for (Dataset dataset : dmp.getDataset()) {
|
||||
|
|
Loading…
Reference in New Issue