This is an automated email from the git hooks/post-receive script. New commit to branch feature/6157 in repository tutti. See http://git.codelutin.com/tutti.git commit 83eb615d0c71bdbba64df8b74312ad425f02b343 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Nov 27 11:37:39 2014 +0100 refs #6174 (ajout d'une exception si le poids est null (et aussi le poids calcule)) --- .../tutti/service/export/generic/CatchExportModel.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic/CatchExportModel.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic/CatchExportModel.java index f2b077f..4c729c7 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic/CatchExportModel.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic/CatchExportModel.java @@ -41,6 +41,7 @@ import fr.ifremer.tutti.service.TuttiCsvUtil; import fr.ifremer.tutti.util.Numbers; import fr.ifremer.tutti.util.Weights; import org.apache.commons.collections4.CollectionUtils; +import org.nuiton.jaxx.application.ApplicationTechnicalException; import java.io.Serializable; import java.util.List; @@ -326,9 +327,15 @@ public class CatchExportModel extends TuttiCsvUtil.AbstractTuttiExportModel<Catc ExportSampleCategory exportSampleCategory = childRow.getSampleCategory().get(categoryIndex); if (exportSampleCategory != null) { - float categoryWeight = Numbers.getValueOrComputedValue( + Float categoryWeight = Numbers.getValueOrComputedValue( exportSampleCategory.getCategoryWeight(), exportSampleCategory.getComputedWeight()); + + if (categoryWeight == null) { + + throw new ApplicationTechnicalException("Il existe une catégorie de poids non renseignée pour l'espèce " + speciesBatch.getSpecies().getSurveyCode()); + } + sampleComputedWeight += categoryWeight; } } @@ -451,9 +458,13 @@ public class CatchExportModel extends TuttiCsvUtil.AbstractTuttiExportModel<Catc totalBatchWeight); ExportSampleCategory exportSampleCategory = childRow.getSampleCategory().get(categoryIndex); - float categoryWeight = Numbers.getValueOrComputedValue( + Float categoryWeight = Numbers.getValueOrComputedValue( exportSampleCategory.getCategoryWeight(), exportSampleCategory.getComputedWeight()); + if (categoryWeight == null) { + + throw new ApplicationTechnicalException("Il existe une catégorie de poids non renseignée pour le benthos " + benthosBatch.getSpecies().getSurveyCode()); + } sampleComputedWeight += categoryWeight; } currentRow.getSampleCategory().get(categoryIndex - 1).setSampleComputedWeight(sampleComputedWeight); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.