This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository echobase. See https://gitlab.nuiton.org/codelutin/echobase.git commit ac29006324f969004418b45bb80849c2bf2dba7d Author: jcouteau <couteau@codelutin.com> Date: Fri Feb 21 08:32:01 2020 +0100 fixes #10217 : Biotic Export --- .../services/service/atlantos/xml/XmlBioticExport.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/xml/XmlBioticExport.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/xml/XmlBioticExport.java index 7e9a0bc4..bc759b35 100644 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/xml/XmlBioticExport.java +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/atlantos/xml/XmlBioticExport.java @@ -348,7 +348,7 @@ public class XmlBioticExport implements EchoBaseService { String gearCode = operation.getGear().getGearCode(); OperationMetadataValue meanWaterDepthMeta = operationMetadatas.get("MeanWaterDepth"); - Float meanWaterDepth = Float.parseFloat(meanWaterDepthMeta.getDataValue()); + Float meanWaterDepth = Float.parseFloat(meanWaterDepthMeta != null ? meanWaterDepthMeta.getDataValue() : "0.0"); int minTrawlDepth; int maxTrawlDepth; @@ -485,7 +485,7 @@ public class XmlBioticExport implements EchoBaseService { xml.create("LengthType", "IDREF", vocabulary.getVocabularyCode("AC_LengthMeasurementType_1")); xml.create("NumberAtLength", numberAtLength); - xml.create("WeightAtLength", weightAtLength != null ? roundWith3Digits(weightAtLength) : 0); + xml.create("WeightAtLength", weightAtLength != null ? roundWith3Digits(Float.parseFloat(weightAtLength)) : 0); } } @@ -501,7 +501,13 @@ public class XmlBioticExport implements EchoBaseService { } public String roundWith3Digits(Float weight) { - return roundWith3Digits(weight.toString()); + if (weight != null && weight < 0.001) { + return "0.000"; + } else if (weight != null) { + return roundWith3Digits(weight.toString()); + } else { + return ""; + } } public void exportBiology(Sample individualSample, XmlWriter xml) throws IOException { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.