Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
11 changed files:
- client-core/src/main/java/fr/ird/observe/client/ui/admin/consolidate/ConsolidateUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/observation/AbstractSampleUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/observation/NonTargetSampleUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/observation/TargetSampleUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/ui/storage/tabs/StorageTabUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/ui/storage/tabs/StorageTabUIHandler.java
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
- services-local/src/main/java/fr/ird/observe/services/local/service/actions/consolidate/ConsolidateDataServiceLocal.java
- services-local/src/main/java/fr/ird/observe/services/local/service/actions/consolidate/ConsolidationActivitySeineDataContext.java
Changes:
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 |
* %%
|
| 7 | 7 |
* This program is free software: you can redistribute it and/or modify
|
| 8 | 8 |
* it under the terms of the GNU General Public License as
|
| 9 |
- * published by the Free Software Foundation, either version 3 of the
|
|
| 9 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 10 | 10 |
* License, or (at your option) any later version.
|
| 11 | 11 |
*
|
| 12 | 12 |
* This program is distributed in the hope that it will be useful,
|
| ... | ... | @@ -14,7 +14,7 @@ |
| 14 | 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 | 15 |
* GNU General Public License for more details.
|
| 16 | 16 |
*
|
| 17 |
- * You should have received a copy of the GNU General Public
|
|
| 17 |
+ * You should have received a copy of the GNU General Public
|
|
| 18 | 18 |
* License along with this program. If not, see
|
| 19 | 19 |
* <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 20 | 20 |
* #L%
|
| ... | ... | @@ -109,11 +109,11 @@ public class ConsolidateUIHandler extends AdminTabUIHandler<ConsolidateUI> imple |
| 109 | 109 |
|
| 110 | 110 |
String tripSeineLabel = result.getTripSeineLabel();
|
| 111 | 111 |
|
| 112 |
- sendMessage(t("observe.actions.consolidate.message.trip", tripSeineLabel));
|
|
| 112 |
+ sendMessage(t("observe.actions.consolidate.message.trip", result.getTripSeineId(), tripSeineLabel));
|
|
| 113 | 113 |
|
| 114 | 114 |
for (ConsolidateActivitySeineDataResult activitySeineDataResult : result.getConsolidateActivitySeineDataResults()) {
|
| 115 | 115 |
|
| 116 |
- sendMessage(t("observe.actions.consolidate.message.activity", activitySeineDataResult.getActivitySeineLabel()));
|
|
| 116 |
+ sendMessage(t("observe.actions.consolidate.message.activity", activitySeineDataResult.getActivitySeineId(), activitySeineDataResult.getActivitySeineLabel()));
|
|
| 117 | 117 |
|
| 118 | 118 |
}
|
| 119 | 119 |
resultsBuilder.add(result);
|
| ... | ... | @@ -38,6 +38,8 @@ import java.beans.PropertyChangeListener; |
| 38 | 38 |
import java.util.List;
|
| 39 | 39 |
import java.util.Optional;
|
| 40 | 40 |
|
| 41 |
+import static io.ultreia.java4all.i18n.I18n.n;
|
|
| 42 |
+ |
|
| 41 | 43 |
/**
|
| 42 | 44 |
* Created on 31/10/16.
|
| 43 | 45 |
*
|
| ... | ... | @@ -46,6 +48,11 @@ import java.util.Optional; |
| 46 | 48 |
*/
|
| 47 | 49 |
public abstract class AbstractSampleUIHandler<E extends DataDto, D extends DataDto, U extends ContentTableUI<E, D, U>> extends ContentTableUIHandler<E, D, U> {
|
| 48 | 50 |
|
| 51 |
+ public static final String POIDS_COMPUTED_TIP = n("observe.common.Sample.weight.computed.tip");
|
|
| 52 |
+ public static final String POIDS_OBSERVED_TIP = n("observe.common.Sample.weight.observed.tip");
|
|
| 53 |
+ public static final String LONGUEUR_COMPUTED_TIP = n("observe.common.Sample.length.computed.tip");
|
|
| 54 |
+ public static final String LONGUEUR_OBSERVED_TIP = n("observe.common.Sample.length.observed.tip");
|
|
| 55 |
+ |
|
| 49 | 56 |
protected final Logger log = LogManager.getLogger(getClass());
|
| 50 | 57 |
/**
|
| 51 | 58 |
* Ecoute les modifications de la propriété {@link TargetLengthDto#getWeight()},
|
| ... | ... | @@ -82,22 +82,14 @@ |
| 82 | 82 |
|
| 83 | 83 |
<script><![CDATA[
|
| 84 | 84 |
|
| 85 |
-public static final String POIDS_COMPUTED_TIP = n("observe.common.Sample.weight.computed.tip");
|
|
| 86 |
-public static final String POIDS_OBSERVED_TIP = n("observe.common.Sample.weight.observed.tip");
|
|
| 87 |
-public static final String LONGUEUR_COMPUTED_TIP = n("observe.common.Sample.length.computed.tip");
|
|
| 88 |
-public static final String LONGUEUR_OBSERVED_TIP = n("observe.common.Sample.length.observed.tip");
|
|
| 89 |
- |
|
| 90 | 85 |
public String getWeightDataTip(boolean computed) {
|
| 91 |
- return computed ? t(POIDS_COMPUTED_TIP) : t(POIDS_OBSERVED_TIP);
|
|
| 86 |
+ return computed ? t(NonTargetSampleUIHandler.POIDS_COMPUTED_TIP) : t(NonTargetSampleUIHandler.POIDS_OBSERVED_TIP);
|
|
| 92 | 87 |
}
|
| 93 | 88 |
|
| 94 | 89 |
public String getLengthDataTip(boolean computed) {
|
| 95 |
- return computed ? t(LONGUEUR_COMPUTED_TIP) : t(LONGUEUR_OBSERVED_TIP);
|
|
| 90 |
+ return computed ? t(NonTargetSampleUIHandler.LONGUEUR_COMPUTED_TIP) : t(NonTargetSampleUIHandler.LONGUEUR_OBSERVED_TIP);
|
|
| 96 | 91 |
}
|
| 97 | 92 |
|
| 98 |
-public String getSpeciesFauneTypeTaille(SpeciesReference species) {
|
|
| 99 |
- return species == null ? t("observe.message.no.species.selected") : species.getSizeMeasureTypeId();
|
|
| 100 |
-}
|
|
| 101 | 93 |
]]>
|
| 102 | 94 |
</script>
|
| 103 | 95 |
|
| ... | ... | @@ -79,20 +79,15 @@ |
| 79 | 79 |
|
| 80 | 80 |
<script><![CDATA[
|
| 81 | 81 |
|
| 82 |
-public static final String POIDS_COMPUTED_TIP = n("observe.common.Sample.weight.computed.tip");
|
|
| 83 |
-public static final String POIDS_OBSERVED_TIP = n("observe.common.Sample.weight.observed.tip");
|
|
| 84 |
-public static final String LONGUEUR_COMPUTED_TIP = n("observe.common.Sample.length.computed.tip");
|
|
| 85 |
-public static final String LONGUEUR_OBSERVED_TIP = n("observe.common.Sample.length.observed.tip");
|
|
| 86 |
- |
|
| 87 | 82 |
@Override
|
| 88 | 83 |
public abstract TargetSampleUIHandler getHandler();
|
| 89 | 84 |
|
| 90 | 85 |
public String getWeightDataTip(boolean computed) {
|
| 91 |
- return computed ? t(POIDS_COMPUTED_TIP) : t(POIDS_OBSERVED_TIP);
|
|
| 86 |
+ return computed ? t(TargetSampleUIHandler.POIDS_COMPUTED_TIP) : t(TargetSampleUIHandler.POIDS_OBSERVED_TIP);
|
|
| 92 | 87 |
}
|
| 93 | 88 |
|
| 94 | 89 |
public String getLengthDataTip(boolean computed) {
|
| 95 |
- return computed ? t(LONGUEUR_COMPUTED_TIP) : t(LONGUEUR_OBSERVED_TIP);
|
|
| 90 |
+ return computed ? t(TargetSampleUIHandler.LONGUEUR_COMPUTED_TIP) : t(TargetSampleUIHandler.LONGUEUR_OBSERVED_TIP);
|
|
| 96 | 91 |
}
|
| 97 | 92 |
]]>
|
| 98 | 93 |
</script>
|
| ... | ... | @@ -64,13 +64,7 @@ protected void setDescriptionText(String text) { |
| 64 | 64 |
}
|
| 65 | 65 |
|
| 66 | 66 |
protected String getProgressString(int currentStep, int nbStep) {
|
| 67 |
- StorageStep step = getStep();
|
|
| 68 |
- String txt = "";
|
|
| 69 |
- if (step != null) {
|
|
| 70 |
- txt = n("observe.storage.step.label");
|
|
| 71 |
- txt = t(txt, currentStep + 1, nbStep, I18nEnumHelper.getLabel(step));
|
|
| 72 |
- }
|
|
| 73 |
- return txt;
|
|
| 67 |
+ return getProgressString(currentStep, nbStep, getStep());
|
|
| 74 | 68 |
}
|
| 75 | 69 |
]]>
|
| 76 | 70 |
</script>
|
| ... | ... | @@ -23,12 +23,15 @@ package fr.ird.observe.client.ui.storage.tabs; |
| 23 | 23 |
|
| 24 | 24 |
import fr.ird.observe.client.ObserveSwingApplicationContext;
|
| 25 | 25 |
import fr.ird.observe.client.ObserveTextGenerator;
|
| 26 |
+import fr.ird.observe.client.ui.storage.StorageStep;
|
|
| 26 | 27 |
import fr.ird.observe.client.ui.storage.StorageUIModel;
|
| 28 |
+import fr.ird.observe.dto.I18nEnumHelper;
|
|
| 27 | 29 |
import fr.ird.observe.services.configuration.ObserveDataSourceInformation;
|
| 28 | 30 |
import org.nuiton.jaxx.runtime.JAXXObject;
|
| 29 | 31 |
|
| 30 | 32 |
import javax.swing.JLabel;
|
| 31 | 33 |
|
| 34 |
+import static io.ultreia.java4all.i18n.I18n.n;
|
|
| 32 | 35 |
import static io.ultreia.java4all.i18n.I18n.t;
|
| 33 | 36 |
|
| 34 | 37 |
/**
|
| ... | ... | @@ -80,4 +83,12 @@ public class StorageTabUIHandler<U extends JAXXObject> { |
| 80 | 83 |
this.ui = ui;
|
| 81 | 84 |
}
|
| 82 | 85 |
|
| 86 |
+ protected String getProgressString(int currentStep, int nbStep,StorageStep step) {
|
|
| 87 |
+ String txt = "";
|
|
| 88 |
+ if (step != null) {
|
|
| 89 |
+ txt = n("observe.storage.step.label");
|
|
| 90 |
+ txt = t(txt, currentStep + 1, nbStep, I18nEnumHelper.getLabel(step));
|
|
| 91 |
+ }
|
|
| 92 |
+ return txt;
|
|
| 93 |
+ }
|
|
| 83 | 94 |
}
|
| ... | ... | @@ -161,11 +161,11 @@ observe.action.translate.tip=Translate application |
| 161 | 161 |
observe.action.validate.config.generateReport=Generate validation report
|
| 162 | 162 |
observe.actions.consolidate=Consolidate data
|
| 163 | 163 |
observe.actions.consolidate.description=Consolidate observed data
|
| 164 |
-observe.actions.consolidate.message.activity=Computed data for activity %1$s
|
|
| 164 |
+observe.actions.consolidate.message.activity=Computed data for activity [%s] %s
|
|
| 165 | 165 |
observe.actions.consolidate.message.noChanges=No data modified.
|
| 166 | 166 |
observe.actions.consolidate.message.operation.done=Consolidate operation done in %1$s.
|
| 167 | 167 |
observe.actions.consolidate.message.save.changes=Save modified %1$s trip(s).
|
| 168 |
-observe.actions.consolidate.message.trip=Data consolidate for trip %1$s
|
|
| 168 |
+observe.actions.consolidate.message.trip=Data consolidate for trip [%s] %s
|
|
| 169 | 169 |
observe.actions.consolidate.start.trip=Start consolidate data on trip %s / %s (%s)
|
| 170 | 170 |
observe.actions.consolidate.title=Consolidate data
|
| 171 | 171 |
observe.actions.consolidate.title.tip=Consolidate observed data
|
| ... | ... | @@ -1713,7 +1713,7 @@ observe.common.Sample.action.resetDefaultSizeMeasureType.tip=Use default size me |
| 1713 | 1713 |
observe.common.Sample.length.computed.tip=Length was computed
|
| 1714 | 1714 |
observe.common.Sample.length.observed.tip=Length was observed
|
| 1715 | 1715 |
observe.common.Sample.weight=Individual weight (kg)
|
| 1716 |
-observe.common.Sample.weight.computed.tip=Weight was computed (%s)
|
|
| 1716 |
+observe.common.Sample.weight.computed.tip=Weight was computed
|
|
| 1717 | 1717 |
observe.common.Sample.weight.observed.tip=Weight was observed
|
| 1718 | 1718 |
observe.common.SampleLogbook.message.creating=Sample is in creation
|
| 1719 | 1719 |
observe.common.SampleLogbook.message.updating=Sample is updating
|
| ... | ... | @@ -161,11 +161,11 @@ observe.action.translate.tip=Traduire l'application \#TODO |
| 161 | 161 |
observe.action.validate.config.generateReport=Generar un informe de validación
|
| 162 | 162 |
observe.actions.consolidate=Calcular los datos
|
| 163 | 163 |
observe.actions.consolidate.description=Calcular los datos que no fueron observados
|
| 164 |
-observe.actions.consolidate.message.activity=Datos calculados para la actividad %1$s
|
|
| 164 |
+observe.actions.consolidate.message.activity=Datos calculados para la actividad [%s] %s
|
|
| 165 | 165 |
observe.actions.consolidate.message.noChanges=No modificación de datos.
|
| 166 | 166 |
observe.actions.consolidate.message.operation.done=Operación de calculo de datos terminada en %1$s.
|
| 167 | 167 |
observe.actions.consolidate.message.save.changes=Guardar las modificaciones de la(s) %1$s marea(s) modificada(s).
|
| 168 |
-observe.actions.consolidate.message.trip=Datos calculados para la marea %1$s
|
|
| 168 |
+observe.actions.consolidate.message.trip=Datos calculados para la marea [%s] %s
|
|
| 169 | 169 |
observe.actions.consolidate.start.trip=Démarrage de la consolidation pour la marée %s / %s (%s) \#TODO
|
| 170 | 170 |
observe.actions.consolidate.title=Consolidar los datos observados
|
| 171 | 171 |
observe.actions.consolidate.title.tip=Consolidar los datos observados
|
| ... | ... | @@ -161,11 +161,11 @@ observe.action.translate.tip=Traduire l'application |
| 161 | 161 |
observe.action.validate.config.generateReport=Générer un rapport de validation
|
| 162 | 162 |
observe.actions.consolidate=Calculer les données
|
| 163 | 163 |
observe.actions.consolidate.description=Calculer les données non observées
|
| 164 |
-observe.actions.consolidate.message.activity=Données calculées pour l'activité %1$s
|
|
| 164 |
+observe.actions.consolidate.message.activity=Données calculées pour l'activité [%s] %s
|
|
| 165 | 165 |
observe.actions.consolidate.message.noChanges=Aucune donnée modifiée.
|
| 166 | 166 |
observe.actions.consolidate.message.operation.done=Opération de calcul des données terminée à %1$s.
|
| 167 | 167 |
observe.actions.consolidate.message.save.changes=Sauvegarde des modifications sur la(es) %1$s marée(s) modifiée(s).
|
| 168 |
-observe.actions.consolidate.message.trip=Données calculées pour la marée %1$s
|
|
| 168 |
+observe.actions.consolidate.message.trip=Données calculées pour la marée [%s] %s.
|
|
| 169 | 169 |
observe.actions.consolidate.start.trip=Démarrage de la consolidation pour la marée %s / %s (%s)
|
| 170 | 170 |
observe.actions.consolidate.title=Consolider les données observateur
|
| 171 | 171 |
observe.actions.consolidate.title.tip=Consolider les données observateur
|
| ... | ... | @@ -147,10 +147,10 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements |
| 147 | 147 |
@Override
|
| 148 | 148 |
public ConsolidateTripSeineDataResult consolidateTripSeine(ConsolidateTripSeineDataRequest request) {
|
| 149 | 149 |
ReferentialLocale referenceLocale = serviceContext.getReferentialLocale();
|
| 150 |
- boolean failIfLenghtWeightParameterNotFound = request.isFailIfLengthWeightParameterNotFound();
|
|
| 150 |
+ boolean failIfLengthWeightParameterNotFound = request.isFailIfLengthWeightParameterNotFound();
|
|
| 151 | 151 |
boolean failIfLengthLengthParameterNotFound = request.isFailIfLengthLengthParameterNotFound();
|
| 152 | 152 |
|
| 153 |
- Optional<ConsolidateTripSeineDataResult> consolidateTripSeineDataResult = consolidateTripSeine(referenceLocale, request.getTripSeineId(), failIfLenghtWeightParameterNotFound, failIfLengthLengthParameterNotFound);
|
|
| 153 |
+ Optional<ConsolidateTripSeineDataResult> consolidateTripSeineDataResult = consolidateTripSeine(referenceLocale, request.getTripSeineId(), failIfLengthWeightParameterNotFound,failIfLengthLengthParameterNotFound );
|
|
| 154 | 154 |
return consolidateTripSeineDataResult.orElse(null);
|
| 155 | 155 |
}
|
| 156 | 156 |
|
| ... | ... | @@ -173,6 +173,8 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements |
| 173 | 173 |
|
| 174 | 174 |
private Optional<ConsolidateTripSeineDataResult> consolidateTripSeine(ReferentialLocale referenceLocale, String tripSeineId, boolean failIfLengthWeightParameterNotFound, boolean failIfLengthLengthParameterNotFound) {
|
| 175 | 175 |
|
| 176 |
+ log.info(String.format("Start consolidate trip: %s", tripSeineId));
|
|
| 177 |
+ |
|
| 176 | 178 |
TripSeine tripSeine = TRIP_SEINE_SPI.loadEntity(getTopiaPersistenceContext(), tripSeineId);
|
| 177 | 179 |
|
| 178 | 180 |
BeanMonitor targetLengthMonitor = new BeanMonitor(
|
| ... | ... | @@ -210,17 +212,23 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements |
| 210 | 212 |
|
| 211 | 213 |
DataEntityDtoBinderSupport<FloatingObjectDto, FloatingObject> floatingObjectBinder = DbModelHelper.fromDataDto(FloatingObjectDto.class).toEntityBinder();
|
| 212 | 214 |
DataEntityDtoBinderSupport<FloatingObjectPartDto, FloatingObjectPart> floatingObjectPartBinder = DbModelHelper.fromDataDto(FloatingObjectPartDto.class).toEntityBinder();
|
| 213 |
- |
|
| 215 |
+ int routeIndex = 0;
|
|
| 216 |
+ int routeMax = tripSeine.sizeRoute();
|
|
| 214 | 217 |
for (Route route : tripSeine.getRoute()) {
|
| 215 | 218 |
|
| 219 |
+ String routePrefix =String.format("Route [%s/%s] ", ++routeIndex, routeMax);
|
|
| 220 |
+ log.info(String.format("%s Start consolidate route: %s", routePrefix, route.getTopiaId()));
|
|
| 221 |
+ int activityIndex = 0;
|
|
| 222 |
+ int activityMax = route.sizeActivitySeine();
|
|
| 216 | 223 |
for (ActivitySeine activitySeine : route.getActivitySeine()) {
|
| 217 | 224 |
|
| 225 |
+ String activityPrefix = String.format("%s - Activity [%s/%s] ", routePrefix, ++activityIndex, activityMax);
|
|
| 226 |
+ |
|
| 218 | 227 |
if (!activitySeine.isSetOperation() && !activitySeine.isDCPOperation()) {
|
| 219 |
- log.debug("No set nor dcp on activity " + activitySeine);
|
|
| 228 |
+ log.info(String.format("%s Skip activity (No set nor dcp): %s", activityPrefix, activitySeine.getTopiaId()));
|
|
| 220 | 229 |
continue;
|
| 221 | 230 |
}
|
| 222 | 231 |
|
| 223 |
- |
|
| 224 | 232 |
ConsolidateActivitySeineDataResultBuilder resultBuilder = new ConsolidateActivitySeineDataResultBuilder(applicationLocale, referenceLocale, activitySeine.getTopiaId(), ActivitySeines.decorate(referenceLocale.ordinal(), activitySeine));
|
| 225 | 233 |
|
| 226 | 234 |
ConsolidationActivitySeineDataContext activityContext = new ConsolidationActivitySeineDataContext();
|
| ... | ... | @@ -238,15 +246,21 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements |
| 238 | 246 |
activityContext.floatingObjectConsolidateEngine = floatingObjectConsolidateEngine;
|
| 239 | 247 |
activityContext.floatingObjectBinder = floatingObjectBinder;
|
| 240 | 248 |
activityContext.floatingObjectPartBinder = floatingObjectPartBinder;
|
| 249 |
+ activityContext.activityPrefix = activityPrefix;
|
|
| 241 | 250 |
|
| 242 |
- consolidateActivitySeine(activityContext);
|
|
| 251 |
+ try {
|
|
| 252 |
+ consolidateActivitySeine(activityContext);
|
|
| 253 |
+ } catch (Exception e) {
|
|
| 254 |
+ log.error(String.format("%s Could not consolidate trip: %s, route: %s - activity: %s", activityPrefix, tripSeineId, route.getTopiaId(), activitySeine.getTopiaId()), e);
|
|
| 255 |
+ throw e;
|
|
| 256 |
+ }
|
|
| 243 | 257 |
|
| 244 | 258 |
Optional<ConsolidateActivitySeineDataResult> optionalConsolidateActivitySeineDataResult = resultBuilder.build();
|
| 245 | 259 |
if (optionalConsolidateActivitySeineDataResult.isPresent()) {
|
| 246 | 260 |
|
| 247 | 261 |
// Des modifications ont été enregistrées sur l'activité
|
| 248 | 262 |
ConsolidateActivitySeineDataResult consolidateActivitySeineDataResult = optionalConsolidateActivitySeineDataResult.get();
|
| 249 |
- log.info("Found some modifications on activity: " + consolidateActivitySeineDataResult.getActivitySeineLabel());
|
|
| 263 |
+ log.info(String.format("%s Found some modifications on activity: %s - %s", activityPrefix, activitySeine.getTopiaId(), consolidateActivitySeineDataResult.getActivitySeineLabel()));
|
|
| 250 | 264 |
activitiesResultBuilder.add(consolidateActivitySeineDataResult);
|
| 251 | 265 |
|
| 252 | 266 |
}
|
| ... | ... | @@ -265,7 +279,7 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements |
| 265 | 279 |
|
| 266 | 280 |
consolidateTripSeineDataResult = new ConsolidateTripSeineDataResult(tripSeineId, TripSeines.decorate(referenceLocale.ordinal(), tripSeine), consolidateActivitySeineDataResults);
|
| 267 | 281 |
|
| 268 |
- log.info("Found some modifications on trip: " + consolidateTripSeineDataResult.getTripSeineLabel());
|
|
| 282 |
+ log.info(String.format("Found some modifications on trip: %s - %s", tripSeineId, consolidateTripSeineDataResult.getTripSeineLabel()));
|
|
| 269 | 283 |
}
|
| 270 | 284 |
return Optional.ofNullable(consolidateTripSeineDataResult);
|
| 271 | 285 |
|
| ... | ... | @@ -275,7 +289,8 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements |
| 275 | 289 |
|
| 276 | 290 |
ActivitySeine activity = activityContext.activity;
|
| 277 | 291 |
|
| 278 |
- log.debug("Start consolidate activity: " + activity.getTopiaId());
|
|
| 292 |
+ log.info(String.format("%s Start consolidate activity: %s", activityContext.activityPrefix, activity.getTopiaId()));
|
|
| 293 |
+ |
|
| 279 | 294 |
if (activity.isFloatingObjectNotEmpty()) {
|
| 280 | 295 |
|
| 281 | 296 |
for (FloatingObject dcp : activity.getFloatingObject()) {
|
| ... | ... | @@ -285,7 +300,7 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements |
| 285 | 300 |
SetSeine setSeine = activity.getSetSeine();
|
| 286 | 301 |
|
| 287 | 302 |
if (setSeine == null) {
|
| 288 |
- log.info("No set found for activity: " + activity.getTopiaId());
|
|
| 303 |
+ log.debug(String.format("%s No set found for activity: %s", activityContext.activityPrefix, activity.getTopiaId()));
|
|
| 289 | 304 |
return;
|
| 290 | 305 |
}
|
| 291 | 306 |
SchoolType oldSchoolType = setSeine.getSchoolType();
|
| ... | ... | @@ -302,7 +317,7 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements |
| 302 | 317 |
|
| 303 | 318 |
// des echantillons thons trouves
|
| 304 | 319 |
for (TargetSample targetSample : setSeine.getTargetSample()) {
|
| 305 |
- if (!targetSample.isTargetLengthEmpty()) {
|
|
| 320 |
+ if (targetSample.isTargetLengthNotEmpty()) {
|
|
| 306 | 321 |
for (TargetLength targetLength : targetSample.getTargetLength()) {
|
| 307 | 322 |
|
| 308 | 323 |
activityContext.watchTargetLength(targetLength);
|
| ... | ... | @@ -324,7 +339,7 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements |
| 324 | 339 |
// des echantillons faunes trouves
|
| 325 | 340 |
for (NonTargetSample nonTargetSample : setSeine.getNonTargetSample()) {
|
| 326 | 341 |
|
| 327 |
- if (!nonTargetSample.isNonTargetLengthEmpty()) {
|
|
| 342 |
+ if (nonTargetSample.isNonTargetLengthNotEmpty()) {
|
|
| 328 | 343 |
for (NonTargetLength nonTargetLength : nonTargetSample.getNonTargetLength()) {
|
| 329 | 344 |
|
| 330 | 345 |
activityContext.watchNonTargetLenght(nonTargetLength);
|
| ... | ... | @@ -643,6 +658,11 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements |
| 643 | 658 |
|
| 644 | 659 |
// recherche du parametrage adequate
|
| 645 | 660 |
SizeMeasureType inputSizeMeasureType = lengthWeightComputable.getSizeMeasureType();
|
| 661 |
+ //FIXME https://gitlab.com/ultreiaio/ird-observe/issues/1217
|
|
| 662 |
+ if (inputSizeMeasureType == null) {
|
|
| 663 |
+ log.error(String.format("No size measure type found for TargetLength (%s) will use the one of the species", lengthWeightComputable.getTopiaId()));
|
|
| 664 |
+ inputSizeMeasureType = species.getSizeMeasureType();
|
|
| 665 |
+ }
|
|
| 646 | 666 |
Optional<LengthWeightParameter> optionalLengthWeightParameter = activityContext.findLengthWeightParameter(species, sex, inputSizeMeasureType);
|
| 647 | 667 |
|
| 648 | 668 |
if (!optionalLengthWeightParameter.isPresent()) {
|
| ... | ... | @@ -677,7 +697,7 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements |
| 677 | 697 |
if (optionalLengthLengthParameter.isPresent()) {
|
| 678 | 698 |
length = optionalLengthLengthParameter.get().computeFromFormulaOne(length);
|
| 679 | 699 |
} else {
|
| 680 |
- log.warn("Could not find lengthLengthParameter for input: " + inputSizeMeasureType + " - output: " + outputSizeMeasureType);
|
|
| 700 |
+ log.warn(String.format("Could not find LengthLengthParameter for input: %s - output: %s", inputSizeMeasureType, outputSizeMeasureType));
|
|
| 681 | 701 |
return;
|
| 682 | 702 |
}
|
| 683 | 703 |
}
|
| ... | ... | @@ -71,6 +71,7 @@ class ConsolidationActivitySeineDataContext { |
| 71 | 71 |
boolean failIfLengthWeightParameterNotFound;
|
| 72 | 72 |
boolean failIfLengthLengthParameterNotFound;
|
| 73 | 73 |
BeanMonitor targetLengthMonitor;
|
| 74 |
+ String activityPrefix;
|
|
| 74 | 75 |
|
| 75 | 76 |
BeanMonitor nonTargetLengthMonitor;
|
| 76 | 77 |
|