branch feature/8255 created (now 7533282)
This is an automated email from the git hooks/post-receive script. New change to branch feature/8255 in repository tutti. See https://gitlab.nuiton.org/codelutin/tutti.git at 7533282 si on modifie la catégorie vrac/hors vrac, on met à jour le compte de lots vrac/hors vrac (fixes #8255) This branch includes the following new commits: new 7533282 si on modifie la catégorie vrac/hors vrac, on met à jour le compte de lots vrac/hors vrac (fixes #8255) The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 753328207cfcd9b7e922b24a146d4c465c89dcf6 Author: Kevin Morin <morin@codelutin.com> Date: Tue Apr 19 10:28:01 2016 +0200 si on modifie la catégorie vrac/hors vrac, on met à jour le compte de lots vrac/hors vrac (fixes #8255) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/8255 in repository tutti. See https://gitlab.nuiton.org/codelutin/tutti.git commit 753328207cfcd9b7e922b24a146d4c465c89dcf6 Author: Kevin Morin <morin@codelutin.com> Date: Tue Apr 19 10:28:01 2016 +0200 si on modifie la catégorie vrac/hors vrac, on met à jour le compte de lots vrac/hors vrac (fixes #8255) --- .../ChangeSpeciesBatchSampleCategoryAction.java | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/edit/actions/ChangeSpeciesBatchSampleCategoryAction.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/edit/actions/ChangeSpeciesBatchSampleCategoryAction.java index 1b0139f..06f1d54 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/edit/actions/ChangeSpeciesBatchSampleCategoryAction.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/edit/actions/ChangeSpeciesBatchSampleCategoryAction.java @@ -24,6 +24,8 @@ package fr.ifremer.tutti.ui.swing.content.operation.catches.species.edit.actions * #L% */ +import fr.ifremer.adagio.core.dao.referential.pmfm.PmfmId; +import fr.ifremer.adagio.core.dao.referential.pmfm.QualitativeValueId; import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel; import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry; import fr.ifremer.tutti.persistence.entities.referential.Caracteristic; @@ -35,6 +37,7 @@ import fr.ifremer.tutti.ui.swing.content.operation.catches.species.edit.SpeciesB import fr.ifremer.tutti.ui.swing.content.operation.catches.species.edit.SpeciesBatchTableModel; import fr.ifremer.tutti.ui.swing.content.operation.catches.species.edit.SpeciesBatchUI; import fr.ifremer.tutti.ui.swing.content.operation.catches.species.edit.SpeciesBatchUIHandler; +import fr.ifremer.tutti.ui.swing.content.operation.catches.species.edit.SpeciesBatchUIModel; import fr.ifremer.tutti.ui.swing.util.TuttiUI; import fr.ifremer.tutti.ui.swing.util.actions.SimpleActionSupport; import jaxx.runtime.SwingUtil; @@ -176,10 +179,27 @@ public class ChangeSpeciesBatchSampleCategoryAction extends SimpleActionSupport< // save the first ancestor row with the modified category value handler.saveRow(firstAncestorRow); + SpeciesBatchUIModel model = ui.getModel(); + + // if the user modifies the sorted/unsorted category, update the count of species batches for the categories + // cf https://forge.codelutin.com/issues/8255 + if (PmfmId.SORTED_UNSORTED.getValue().equals(sampleCategoryId)) { + + // if the new value is sorted, the previous value was unsorted + if (QualitativeValueId.SORTED_VRAC.getValue().equals(((CaracteristicQualitativeValue) selectedItem).getIdAsInt())) { + model.decDistinctUnsortedSpeciesCount(); + model.incDistinctSortedSpeciesCount(); + + } else { // if the new value is unsorted, the previous value was sorted + model.decDistinctSortedSpeciesCount(); + model.incDistinctUnsortedSpeciesCount(); + } + } + if (!numericType) { // update speciesUsed cache - EditCatchesUIModel createBatchModel = ui.getModel().getCatchesUIModel(); + EditCatchesUIModel createBatchModel = model.getCatchesUIModel(); createBatchModel.replaceCaracteristicValue(firstAncestorRow.getSpecies(), (CaracteristicQualitativeValue) oldValue, (CaracteristicQualitativeValue) selectedItem); } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm