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 1ced07ee8f9648f770e2153d8b00bdb478bd64f5 Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Apr 15 15:48:35 2015 +0200 refs #6890 Permettre l'export même si il y a des erreurs d'élévation de poids --- .../genericformat/producer/CsvProducerForCatch.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java index 29c40cc..cbcd40f 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java @@ -40,7 +40,8 @@ import fr.ifremer.tutti.service.genericformat.csv.ExportSampleCategory; 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 org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.io.Serializable; import java.nio.file.Path; @@ -55,6 +56,9 @@ import java.util.List; */ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { + /** Logger. */ + private static final Log log = LogFactory.getLog(CsvProducerForCatch.class); + public CsvProducerForCatch(Path file, CatchModel model) { super(file, model); } @@ -321,7 +325,10 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { if (categoryWeight == null) { - throw new ApplicationTechnicalException(String.format("Campagne %s - Trait %s : Il existe une catégorie de poids non renseignée (lot %s)", operationExportContext.getCruise().getName(), operationExportContext.getOperationLabel(), childBatch.getId())); + if (log.isWarnEnabled()) { + log.warn(String.format("Campagne %s - Trait %s : Il existe une catégorie de poids non renseignée (lot espèce %s)", operationExportContext.getCruise().getName(), operationExportContext.getOperationLabel(), childBatch.getId())); + } + categoryWeight = 0f; } @@ -443,10 +450,16 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { 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()); + if (log.isWarnEnabled()) { + log.warn(String.format("Campagne %s - Trait %s : Il existe une catégorie de poids non renseignée (lot benthos %s)", operationExportContext.getCruise().getName(), operationExportContext.getOperationLabel(), childBatch.getId())); + } + categoryWeight = 0f; + } + 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>.