This is an automated email from the git hooks/post-receive script. New commit to branch feature/8429 in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git commit 67cd7c1db0677621165513accf172fd2b82bc182 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Nov 8 11:06:54 2016 +0100 Ajout méthodes sur les entités pour afficher les mesures dans les rapports --- .../longline/GearUseFeaturesLonglineImpl.java | 58 +++++++++++++++++++++ .../entities/seine/GearUseFeaturesSeineImpl.java | 58 +++++++++++++++++++++ entities/src/main/xmi/observe-longline.zargo | Bin 93746 -> 93824 bytes entities/src/main/xmi/observe-seine.zargo | Bin 87124 -> 87287 bytes 4 files changed, 116 insertions(+) diff --git a/entities/src/main/java/fr/ird/observe/entities/longline/GearUseFeaturesLonglineImpl.java b/entities/src/main/java/fr/ird/observe/entities/longline/GearUseFeaturesLonglineImpl.java new file mode 100644 index 0000000..5768beb --- /dev/null +++ b/entities/src/main/java/fr/ird/observe/entities/longline/GearUseFeaturesLonglineImpl.java @@ -0,0 +1,58 @@ +package fr.ird.observe.entities.longline; + +/*- + * #%L + * ObServe :: Entities + * %% + * Copyright (C) 2008 - 2016 IRD, Code Lutin, Tony Chemit + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import com.google.common.base.Joiner; +import fr.ird.observe.entities.referentiel.GearCaracteristic; + +import java.util.stream.Collectors; + +public class GearUseFeaturesLonglineImpl extends GearUseFeaturesLonglineAbstract { + + private static final long serialVersionUID = 1L; + + @Override + public String getMeasurementsAsString() { + return Joiner.on(", ").join( + getGearUseFeaturesMeasurement().stream() + .map(g -> { + GearCaracteristic gearCaracteristic = g.getGearCaracteristic(); + String code = gearCaracteristic.getCode(); + String unit = gearCaracteristic.getUnit(); + String measurementValue = g.getMeasurementValue(); + boolean isBoolean = false; + if ("true".equals(measurementValue)) { + measurementValue = "Oui"; + isBoolean = true; + } else if ("false".equals(measurementValue)) { + measurementValue = "Non"; + isBoolean = true; + } + return "( " + (code == null ? " Aucun code" : code) + + " - " + gearCaracteristic.getLabel2() + + (isBoolean ? "" : (" [ " + (unit == null ? "pas d'unité" : unit) + " ]")) + + " = " + measurementValue + " )"; + }) + .collect(Collectors.toList())); + } +} diff --git a/entities/src/main/java/fr/ird/observe/entities/seine/GearUseFeaturesSeineImpl.java b/entities/src/main/java/fr/ird/observe/entities/seine/GearUseFeaturesSeineImpl.java new file mode 100644 index 0000000..057e259 --- /dev/null +++ b/entities/src/main/java/fr/ird/observe/entities/seine/GearUseFeaturesSeineImpl.java @@ -0,0 +1,58 @@ +package fr.ird.observe.entities.seine; + +/*- + * #%L + * ObServe :: Entities + * %% + * Copyright (C) 2008 - 2016 IRD, Code Lutin, Tony Chemit + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import com.google.common.base.Joiner; +import fr.ird.observe.entities.referentiel.GearCaracteristic; + +import java.util.stream.Collectors; + +public class GearUseFeaturesSeineImpl extends GearUseFeaturesSeineAbstract { + + private static final long serialVersionUID = 1L; + + @Override + public String getMeasurementsAsString() { + return Joiner.on(", ").join( + getGearUseFeaturesMeasurement().stream() + .map(g -> { + GearCaracteristic gearCaracteristic = g.getGearCaracteristic(); + String code = gearCaracteristic.getCode(); + String unit = gearCaracteristic.getUnit(); + String measurementValue = g.getMeasurementValue(); + boolean isBoolean = false; + if ("true".equals(measurementValue)) { + measurementValue = "Oui"; + isBoolean = true; + } else if ("false".equals(measurementValue)) { + measurementValue = "Non"; + isBoolean = true; + } + return "( " + (code == null ? " Aucun code" : code) + + " - " + gearCaracteristic.getLabel2() + + (isBoolean ? "" : (" [ " + (unit == null ? "pas d'unité" : unit) + " ]")) + + " = " + measurementValue + " )"; + }) + .collect(Collectors.toList())); + } +} diff --git a/entities/src/main/xmi/observe-longline.zargo b/entities/src/main/xmi/observe-longline.zargo index 62bd7db..f96b968 100644 Binary files a/entities/src/main/xmi/observe-longline.zargo and b/entities/src/main/xmi/observe-longline.zargo differ diff --git a/entities/src/main/xmi/observe-seine.zargo b/entities/src/main/xmi/observe-seine.zargo index f87b2aa..8c5bf2a 100644 Binary files a/entities/src/main/xmi/observe-seine.zargo and b/entities/src/main/xmi/observe-seine.zargo differ -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.