branch feature/8157-2 created (now 796926f)
This is an automated email from the git hooks/post-receive script. New change to branch feature/8157-2 in repository tutti. See https://gitlab.nuiton.org/codelutin/tutti.git at 796926f ajout du nombre d'observations dans l'export + on n'exporte pas les lignes sans obs ni prelevements (refs #8157) This branch includes the following new commits: new 796926f ajout du nombre d'observations dans l'export + on n'exporte pas les lignes sans obs ni prelevements (refs #8157) 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 796926f64c5e681d04618d0f41db188e98e1be50 Author: Kevin Morin <morin@codelutin.com> Date: Wed Apr 6 14:06:49 2016 +0200 ajout du nombre d'observations dans l'export + on n'exporte pas les lignes sans obs ni prelevements (refs #8157) -- 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/8157-2 in repository tutti. See https://gitlab.nuiton.org/codelutin/tutti.git commit 796926f64c5e681d04618d0f41db188e98e1be50 Author: Kevin Morin <morin@codelutin.com> Date: Wed Apr 6 14:06:49 2016 +0200 ajout du nombre d'observations dans l'export + on n'exporte pas les lignes sans obs ni prelevements (refs #8157) --- .../tutti/service/export/cps/SamplingNumberRowModel.java | 1 + .../fr/ifremer/tutti/service/sampling/CacheExtractedKey.java | 10 ++++++++++ .../fr/ifremer/tutti/service/sampling/CruiseSamplingCache.java | 2 +- .../tutti/service/sampling/CruiseSamplingInternalCache.java | 10 ++++++++-- .../src/main/resources/i18n/tutti-service_en_GB.properties | 1 + .../src/main/resources/i18n/tutti-service_fr_FR.properties | 1 + 6 files changed, 22 insertions(+), 3 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/export/cps/SamplingNumberRowModel.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/export/cps/SamplingNumberRowModel.java index b59333d..ecd6f4e 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/export/cps/SamplingNumberRowModel.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/export/cps/SamplingNumberRowModel.java @@ -54,6 +54,7 @@ public class SamplingNumberRowModel extends AbstractTuttiImportExportModel<Cache return t(sex.getDescription()); } }); + newColumnForExport(t("tutti.service.calcifiedPiecesSamplingReport.header.observationNb"), CacheExtractedKey.PROPERTY_OBSERVATION_NB, TuttiCsvUtil.PRIMITIVE_INTEGER); newColumnForExport(t("tutti.service.calcifiedPiecesSamplingReport.header.samplingNb"), CacheExtractedKey.PROPERTY_SAMPLING_NB, TuttiCsvUtil.PRIMITIVE_INTEGER); newColumnForExport(t("tutti.service.calcifiedPiecesSamplingReport.header.maxByLengthStep"), CacheExtractedKey.PROPERTY_MAX_BY_LENGTH_STEP, TuttiCsvUtil.INTEGER); } diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CacheExtractedKey.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CacheExtractedKey.java index 7b9d064..b49d6d3 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CacheExtractedKey.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CacheExtractedKey.java @@ -15,6 +15,7 @@ public class CacheExtractedKey implements Serializable { public static final String PROPERTY_LENGTH_STEP = "lengthStep"; public static final String PROPERTY_MATURITY = "maturity"; public static final String PROPERTY_SEX = "sex"; + public static final String PROPERTY_OBSERVATION_NB = "observationNb"; public static final String PROPERTY_SAMPLING_NB = "samplingNb"; public static final String PROPERTY_MAX_BY_LENGTH_STEP = "maxByLengthStep"; @@ -22,6 +23,7 @@ public class CacheExtractedKey implements Serializable { protected int lengthStep; protected Boolean maturity; protected QualitativeValueId sex; + protected int observationNb; protected int samplingNb; protected Integer maxByLengthStep; @@ -49,6 +51,14 @@ public class CacheExtractedKey implements Serializable { this.maxByLengthStep = maxByLengthStep; } + public int getObservationNb() { + return observationNb; + } + + public void setObservationNb(int observationNb) { + this.observationNb = observationNb; + } + public int getSamplingNb() { return samplingNb; } diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSamplingCache.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSamplingCache.java index 0420d51..6477871 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSamplingCache.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSamplingCache.java @@ -101,7 +101,7 @@ public class CruiseSamplingCache implements Closeable { /** * L'identifiant de la campagne associée à ce cache. */ - private final Integer cruiseId; + private final int cruiseId; /** * L'identificant du protocol associé à ce cache. */ diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSamplingInternalCache.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSamplingInternalCache.java index 9bd9b1a..f58b0a8 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSamplingInternalCache.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSamplingInternalCache.java @@ -188,7 +188,9 @@ class CruiseSamplingInternalCache implements Closeable { while (iterator.hasNext()) { Map.Entry<String, SamplingData> entry = iterator.next(); - if (entry.getValue() != null) { + SamplingData samplingData = entry.getValue(); + + if (samplingData != null && !samplingData.isEmpty()) { String[] keyTokens = entry.getKey().split(KEY_SEPARATOR); CacheExtractedKey key = new CacheExtractedKey(); @@ -217,7 +219,8 @@ class CruiseSamplingInternalCache implements Closeable { key.setLengthStep(lengthStep); } - key.setSamplingNb(entry.getValue().getSamplingNb()); + key.setSamplingNb(samplingData.getSamplingNb()); + key.setObservationNb(samplingData.getObservationNb()); result.add(key); } @@ -259,6 +262,9 @@ class CruiseSamplingInternalCache implements Closeable { return samplingNb.intValue(); } + public boolean isEmpty() { + return samplingNb.intValue() == 0 && observationNb.intValue() == 0; + } } diff --git a/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties b/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties index 127895d..67f5130 100644 --- a/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties +++ b/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties @@ -86,6 +86,7 @@ tutti.service.calcifiedPiecesSamplingReport.header.geniusName= tutti.service.calcifiedPiecesSamplingReport.header.lengthStep= tutti.service.calcifiedPiecesSamplingReport.header.maturity= tutti.service.calcifiedPiecesSamplingReport.header.maxByLengthStep= +tutti.service.calcifiedPiecesSamplingReport.header.observationNb= tutti.service.calcifiedPiecesSamplingReport.header.samplingNb= tutti.service.calcifiedPiecesSamplingReport.header.surveyCode= tutti.service.compressZipFile.error= diff --git a/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties b/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties index 7eea13f..379dddf 100644 --- a/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties +++ b/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties @@ -78,6 +78,7 @@ tutti.service.calcifiedPiecesSamplingReport.header.geniusName=Nom scientifique tutti.service.calcifiedPiecesSamplingReport.header.lengthStep=Classe de taille (mm) tutti.service.calcifiedPiecesSamplingReport.header.maturity=Maturité tutti.service.calcifiedPiecesSamplingReport.header.maxByLengthStep=Max/classe de taille +tutti.service.calcifiedPiecesSamplingReport.header.observationNb=Nombre d'observations tutti.service.calcifiedPiecesSamplingReport.header.samplingNb=Nombre de prélèvements tutti.service.calcifiedPiecesSamplingReport.header.surveyCode=Code campagne tutti.service.compressZipFile.error=Erreur lors de la compression du dossier %1s dans le fichier %2s -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm