branch develop updated (6cc03ae -> 87462ee)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository tutti. See http://git.codelutin.com/tutti.git from 6cc03ae [jgitflow-maven-plugin]Updating develop poms back to pre merge state new a2be354 Ne proposer que les espèces (benthos) définis dans le protocole lors de la création d'un nouveau lot (See #7490) new 87462ee Ne proposer que la liste des espèces (benthos) définies dans le protocole lors de la création d'un nouveau lot. Si le protocole n'est pas défini, alors on continue à utiliser la liste exhaustive des espèces référentes. termine #7490 Merge branch 'feature/7490' into develop The 2 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 87462eee9aca1385d57a08178fcc60a70627f854 Merge: 6cc03ae a2be354 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Sep 1 12:46:12 2015 +0200 Ne proposer que la liste des espèces (benthos) définies dans le protocole lors de la création d'un nouveau lot. Si le protocole n'est pas défini, alors on continue à utiliser la liste exhaustive des espèces référentes. termine #7490 Merge branch 'feature/7490' into develop commit a2be35407932c291f74decff51ca8a4e11a09658 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Sep 1 12:45:10 2015 +0200 Ne proposer que les espèces (benthos) définis dans le protocole lors de la création d'un nouveau lot (See #7490) Summary of changes: .../fr/ifremer/tutti/service/TuttiDataContext.java | 61 ++++++++++++++++++++-- .../create/CreateBenthosBatchUIHandler.java | 3 +- .../create/CreateSpeciesBatchUIHandler.java | 2 +- 3 files changed, 60 insertions(+), 6 deletions(-) -- 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 develop in repository tutti. See http://git.codelutin.com/tutti.git commit a2be35407932c291f74decff51ca8a4e11a09658 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Sep 1 12:45:10 2015 +0200 Ne proposer que les espèces (benthos) définis dans le protocole lors de la création d'un nouveau lot (See #7490) --- .../fr/ifremer/tutti/service/TuttiDataContext.java | 61 ++++++++++++++++++++-- .../create/CreateBenthosBatchUIHandler.java | 3 +- .../create/CreateSpeciesBatchUIHandler.java | 2 +- 3 files changed, 60 insertions(+), 6 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java index 52b26f8..2f55fd7 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java @@ -31,6 +31,7 @@ import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel; import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry; import fr.ifremer.tutti.persistence.entities.protocol.SpeciesProtocol; import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol; +import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocols; import fr.ifremer.tutti.persistence.entities.referential.Caracteristic; import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue; import fr.ifremer.tutti.persistence.entities.referential.Gear; @@ -49,6 +50,7 @@ import java.beans.PropertyChangeListener; import java.io.Closeable; import java.util.ArrayList; import java.util.List; +import java.util.Map; /** * Data context of ui. @@ -161,18 +163,21 @@ public class TuttiDataContext extends AbstractBean implements Closeable { TuttiDataContext() { addPropertyChangeListener(PROPERTY_PROGRAM_ID, new PropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent evt) { program = null; } }); addPropertyChangeListener(PROPERTY_CRUISE_ID, new PropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent evt) { cruise = null; } }); addPropertyChangeListener(PROPERTY_PROTOCOL_ID, new PropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent evt) { resetProtocol(); @@ -180,6 +185,7 @@ public class TuttiDataContext extends AbstractBean implements Closeable { } }); addPropertyChangeListener(PROPERTY_FISHING_OPERATION_ID, new PropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent evt) { fishingOperation = null; @@ -558,7 +564,7 @@ public class TuttiDataContext extends AbstractBean implements Closeable { log.info("Reloading fishingOperation: " + id); } fishingOperation = service.getFishingOperation(id); - return fishingOperation ; + return fishingOperation; } public List<Caracteristic> getCaracteristics() { @@ -718,6 +724,10 @@ public class TuttiDataContext extends AbstractBean implements Closeable { } public List<Species> getReferentSpeciesWithSurveyCode() { + return getReferentSpeciesWithSurveyCode(false); + } + + public List<Species> getReferentSpeciesWithSurveyCode(boolean restrictToProtocol) { checkOpened(); if (referentSpeciesWithSurveyCode == null) { @@ -729,10 +739,35 @@ public class TuttiDataContext extends AbstractBean implements Closeable { referentSpeciesWithSurveyCode = new ArrayList<>(getReferentSpecies()); taxonCache.load(referentSpeciesWithSurveyCode); } - return referentSpeciesWithSurveyCode; + + List<Species> result; + if (restrictToProtocol && isProtocolFilled()) { + + // On restreint uniquement aux espèces définies dans le protocole + + result = new ArrayList<>(); + Map<Integer, SpeciesProtocol> speciesProtocolMap = TuttiProtocols.toSpeciesProtocolMap(getProtocol()); + for (Species aSpecies : referentSpeciesWithSurveyCode) { + if (speciesProtocolMap.containsKey(aSpecies.getReferenceTaxonId())) { + result.add(aSpecies); + } + } + + } else { + + // On utilise la liste complete des espèces référentes + result = referentSpeciesWithSurveyCode; + + } + return result; + } public List<Species> getReferentBenthosWithSurveyCode() { + return getReferentBenthosWithSurveyCode(false); + } + + public List<Species> getReferentBenthosWithSurveyCode(boolean restrictToProtocol) { checkOpened(); if (referentBenthosWithSurveyCode == null) { @@ -743,7 +778,27 @@ public class TuttiDataContext extends AbstractBean implements Closeable { referentBenthosWithSurveyCode = new ArrayList<>(getReferentSpecies()); taxonCache.load(referentBenthosWithSurveyCode); } - return referentBenthosWithSurveyCode; + + List<Species> result; + if (restrictToProtocol && isProtocolFilled()) { + + // On restreint uniquement aux espèces définies dans le protocole + + result = new ArrayList<>(); + Map<Integer, SpeciesProtocol> speciesProtocolMap = TuttiProtocols.toBenthosProtocolMap(getProtocol()); + for (Species aSpecies : referentBenthosWithSurveyCode) { + if (speciesProtocolMap.containsKey(aSpecies.getReferenceTaxonId())) { + result.add(aSpecies); + } + } + + } else { + + // On utilise la liste complete des espèces référentes + result = referentBenthosWithSurveyCode; + + } + return result; } public List<Species> getSpecies() { diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java index bd099e8..744865d 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java @@ -358,8 +358,7 @@ public class CreateBenthosBatchUIHandler extends AbstractTuttiTableUIHandler<Spl // compute which species can still be used - List<Species> allSpecies = - getDataContext().getReferentBenthosWithSurveyCode(); + List<Species> allSpecies = getDataContext().getReferentBenthosWithSurveyCode(true); speciesToUse.addAll(allSpecies); } diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java index bc5830a..ac4f29b 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java @@ -358,7 +358,7 @@ public class CreateSpeciesBatchUIHandler extends AbstractTuttiTableUIHandler<Spl // compute which species can still be used - List<Species> allSpecies = getDataContext().getReferentSpeciesWithSurveyCode(); + List<Species> allSpecies = getDataContext().getReferentSpeciesWithSurveyCode(true); speciesToUse.addAll(allSpecies); } -- 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 develop in repository tutti. See http://git.codelutin.com/tutti.git commit 87462eee9aca1385d57a08178fcc60a70627f854 Merge: 6cc03ae a2be354 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Sep 1 12:46:12 2015 +0200 Ne proposer que la liste des espèces (benthos) définies dans le protocole lors de la création d'un nouveau lot. Si le protocole n'est pas défini, alors on continue à utiliser la liste exhaustive des espèces référentes. termine #7490 Merge branch 'feature/7490' into develop .../fr/ifremer/tutti/service/TuttiDataContext.java | 61 ++++++++++++++++++++-- .../create/CreateBenthosBatchUIHandler.java | 3 +- .../create/CreateSpeciesBatchUIHandler.java | 2 +- 3 files changed, 60 insertions(+), 6 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm