Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe
Commits:
-
95047bae
by Tony Chemit at 2023-03-13T08:24:22+01:00
-
1313b4ed
by Tony Chemit at 2023-03-13T08:24:22+01:00
-
01c2aa78
by Tony Chemit at 2023-03-13T08:24:22+01:00
19 changed files:
- .gitignore
- client/datasource/actions/src/main/i18n/getters/java.getter
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/actions/Start.java
- client/runner/src/main/i18n/translations/client-runner_en_GB.properties
- client/runner/src/main/i18n/translations/client-runner_es_ES.properties
- client/runner/src/main/i18n/translations/client-runner_fr_FR.properties
- core/api/dto-consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/common/TripConsolidateResult.java
- + core/api/dto-consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/logbook/ActivityConsolidateResult.java
- + core/api/dto-consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/logbook/ActivityConsolidateResultBuilder.java
- core/api/dto-consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/logbook/FloatingObjectActions.java → core/api/dto-consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/logbook/FloatingObjectConsolidateActions.java
- core/api/dto-consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/logbook/FloatingObjectConsolidateEngine.java
- core/persistence/consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/common/TripConsolidateEngine.java
- + core/persistence/consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/logbook/ActivityConsolidateContext.java
- + core/persistence/consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/logbook/ActivityConsolidateEngine.java
- core/services/test/src/main/java/fr/ird/observe/services/service/data/ps/ConsolidateDataServiceFixtures.java
- pom.xml
- + src/site/markdown/consolidation.md
- src/site/markdown/index.md
- src/site/site.xml
Changes:
| ... | ... | @@ -19,7 +19,8 @@ |
| 19 | 19 | /*~
|
| 20 | 20 | /*/*~
|
| 21 | 21 | /src/site/markdown/CHANGELOG.md
|
| 22 | -/src/site/markdown/*.md
|
|
| 22 | +/src/site/markdown/observe-client.md
|
|
| 23 | +/src/site/markdown/observe-server.md
|
|
| 23 | 24 | /src/site/resources/*.conf
|
| 24 | 25 | client/runner/src/main/assembly/dist/config/observe-client*
|
| 25 | 26 | server/runner/src/main/assembly/dist/config/observe-server*
|
| ... | ... | @@ -32,12 +32,15 @@ observe.ui.datasource.actions.config.data.sources.equals |
| 32 | 32 | observe.ui.datasource.editor.actions.activity.pairing
|
| 33 | 33 | observe.ui.datasource.editor.actions.consolidate
|
| 34 | 34 | observe.ui.datasource.editor.actions.consolidate.description
|
| 35 | -observe.ui.datasource.editor.actions.consolidate.message.activity.modification
|
|
| 36 | -observe.ui.datasource.editor.actions.consolidate.message.activity.warning
|
|
| 35 | +observe.ui.datasource.editor.actions.consolidate.end.trip
|
|
| 36 | +observe.ui.datasource.editor.actions.consolidate.message.logbook.activity.modification
|
|
| 37 | +observe.ui.datasource.editor.actions.consolidate.message.logbook.activity.warning
|
|
| 37 | 38 | observe.ui.datasource.editor.actions.consolidate.message.modifications.modification
|
| 38 | 39 | observe.ui.datasource.editor.actions.consolidate.message.modifications.property
|
| 39 | 40 | observe.ui.datasource.editor.actions.consolidate.message.modifications.warning
|
| 40 | 41 | observe.ui.datasource.editor.actions.consolidate.message.noChanges
|
| 42 | +observe.ui.datasource.editor.actions.consolidate.message.observation.activity.modification
|
|
| 43 | +observe.ui.datasource.editor.actions.consolidate.message.observation.activity.warning
|
|
| 41 | 44 | observe.ui.datasource.editor.actions.consolidate.message.operation.done
|
| 42 | 45 | observe.ui.datasource.editor.actions.consolidate.message.save.changes
|
| 43 | 46 | observe.ui.datasource.editor.actions.consolidate.message.trip.modification
|
| ... | ... | @@ -27,10 +27,10 @@ import fr.ird.observe.client.datasource.actions.actions.AdminTabUIActionSupport; |
| 27 | 27 | import fr.ird.observe.client.datasource.actions.consolidate.ConsolidateModel;
|
| 28 | 28 | import fr.ird.observe.client.datasource.actions.consolidate.ConsolidateUI;
|
| 29 | 29 | import fr.ird.observe.client.datasource.api.ObserveSwingDataSource;
|
| 30 | +import fr.ird.observe.consolidation.AtomicConsolidateAction;
|
|
| 30 | 31 | import fr.ird.observe.consolidation.data.ps.common.TripConsolidateRequest;
|
| 31 | 32 | import fr.ird.observe.consolidation.data.ps.common.TripConsolidateResult;
|
| 32 | 33 | import fr.ird.observe.consolidation.data.ps.dcp.SimplifiedObjectTypeSpecializedRules;
|
| 33 | -import fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult;
|
|
| 34 | 34 | import fr.ird.observe.dto.BusinessDto;
|
| 35 | 35 | import fr.ird.observe.dto.ObserveUtil;
|
| 36 | 36 | import fr.ird.observe.dto.ProgressionModel;
|
| ... | ... | @@ -45,6 +45,8 @@ import fr.ird.observe.dto.decoration.ObserveI18nDecoratorHelper; |
| 45 | 45 | import fr.ird.observe.services.service.data.ps.ConsolidateDataService;
|
| 46 | 46 | import io.ultreia.java4all.bean.monitor.JavaBeanPropertyModification;
|
| 47 | 47 | import io.ultreia.java4all.i18n.I18n;
|
| 48 | +import io.ultreia.java4all.lang.Strings;
|
|
| 49 | +import io.ultreia.java4all.util.TimeLog;
|
|
| 48 | 50 | import org.apache.logging.log4j.LogManager;
|
| 49 | 51 | import org.apache.logging.log4j.Logger;
|
| 50 | 52 | import org.nuiton.jaxx.runtime.swing.wizard.ext.WizardState;
|
| ... | ... | @@ -55,6 +57,7 @@ import java.awt.event.ActionEvent; |
| 55 | 57 | import java.util.Date;
|
| 56 | 58 | import java.util.LinkedHashSet;
|
| 57 | 59 | import java.util.Set;
|
| 60 | +import java.util.concurrent.atomic.AtomicInteger;
|
|
| 58 | 61 | |
| 59 | 62 | import static io.ultreia.java4all.i18n.I18n.t;
|
| 60 | 63 | |
| ... | ... | @@ -96,45 +99,30 @@ public class Start extends AdminTabUIActionSupport<ConsolidateUI> { |
| 96 | 99 | |
| 97 | 100 | ConsolidateDataService consolidateDataService = dataSource.getPsConsolidateDataService();
|
| 98 | 101 | |
| 99 | - int index = 0;
|
|
| 102 | + AtomicInteger index = new AtomicInteger();
|
|
| 100 | 103 | int nbTrips = tripIds.size();
|
| 101 | 104 | |
| 102 | 105 | SimplifiedObjectTypeSpecializedRules simplifiedObjectTypeSpecializedRules = getClientConfig().getSimplifiedObjectTypeSpecializedRules();
|
| 103 | 106 | |
| 104 | 107 | Set<TripConsolidateResult> results = new LinkedHashSet<>();
|
| 105 | 108 | for (String tripId : tripIds) {
|
| 106 | - |
|
| 107 | - progressModel.increments();
|
|
| 108 | - |
|
| 109 | - if (stepModel.checkIfTripAlreadyProcessed(tripId)) {
|
|
| 110 | - // this one has already been processed
|
|
| 111 | - sendMessage(t("observe.ui.datasource.editor.actions.consolidate.skip.trip", ++index, nbTrips, tripId));
|
|
| 112 | - progressModel.increments();
|
|
| 113 | - continue;
|
|
| 114 | - }
|
|
| 115 | - sendMessage(t("observe.ui.datasource.editor.actions.consolidate.start.trip", ++index, nbTrips, tripId));
|
|
| 116 | - |
|
| 117 | - // mark trip processed
|
|
| 118 | - stepModel.setTripProcessed(tripId);
|
|
| 119 | - |
|
| 120 | - if (TripAware.isLonglineId(tripId)) {
|
|
| 121 | - // can't consolidate LL trips...
|
|
| 122 | - progressModel.increments();
|
|
| 123 | - continue;
|
|
| 124 | - }
|
|
| 125 | - TripConsolidateRequest request = new TripConsolidateRequest();
|
|
| 126 | - request.setTripId(tripId);
|
|
| 127 | - request.setFailIfLengthWeightParameterNotFound(stepModel.isConsolidationFailIfLengthWeightParameterNotFound());
|
|
| 128 | - request.setFailIfLengthLengthParameterNotFound(stepModel.isConsolidationFailIfLengthLengthParameterNotFound());
|
|
| 129 | - |
|
| 130 | - TripConsolidateResult result = consolidateDataService.consolidateTrip(simplifiedObjectTypeSpecializedRules, request);
|
|
| 131 | - if (result != null) {
|
|
| 132 | - printResult(result);
|
|
| 133 | - if (result.withModifications()) {
|
|
| 134 | - results.add(result);
|
|
| 135 | - }
|
|
| 109 | + long t0 = TimeLog.getTime();
|
|
| 110 | + try {
|
|
| 111 | + consolidateTrip(tripId,
|
|
| 112 | + index,
|
|
| 113 | + nbTrips,
|
|
| 114 | + stepModel,
|
|
| 115 | + simplifiedObjectTypeSpecializedRules,
|
|
| 116 | + consolidateDataService,
|
|
| 117 | + progressModel,
|
|
| 118 | + results);
|
|
| 119 | + } finally {
|
|
| 120 | + ObserveUtil.cleanMemory();
|
|
| 121 | + String message = t("observe.ui.datasource.editor.actions.consolidate.end.trip", index, nbTrips, tripId, Strings.convertTime(TimeLog.getTime() - t0));
|
|
| 122 | + log.info(message);
|
|
| 123 | + sendMessage(message);
|
|
| 124 | + sendMessage("------------------------");
|
|
| 136 | 125 | }
|
| 137 | - ObserveUtil.cleanMemory();
|
|
| 138 | 126 | }
|
| 139 | 127 | progressModel.increments();
|
| 140 | 128 | if (results.isEmpty()) {
|
| ... | ... | @@ -148,6 +136,47 @@ public class Start extends AdminTabUIActionSupport<ConsolidateUI> { |
| 148 | 136 | return WizardState.SUCCESSED;
|
| 149 | 137 | }
|
| 150 | 138 | |
| 139 | + void consolidateTrip(String tripId,
|
|
| 140 | + AtomicInteger index,
|
|
| 141 | + int nbTrips,
|
|
| 142 | + ConsolidateModel stepModel,
|
|
| 143 | + SimplifiedObjectTypeSpecializedRules simplifiedObjectTypeSpecializedRules,
|
|
| 144 | + ConsolidateDataService consolidateDataService,
|
|
| 145 | + ProgressionModel progressModel,
|
|
| 146 | + Set<TripConsolidateResult> results) {
|
|
| 147 | + progressModel.increments();
|
|
| 148 | + |
|
| 149 | + if (stepModel.checkIfTripAlreadyProcessed(tripId)) {
|
|
| 150 | + // this one has already been processed
|
|
| 151 | + sendMessage(t("observe.ui.datasource.editor.actions.consolidate.skip.trip", index.incrementAndGet(), nbTrips, tripId));
|
|
| 152 | + progressModel.increments();
|
|
| 153 | + return;
|
|
| 154 | + }
|
|
| 155 | + sendMessage(t("observe.ui.datasource.editor.actions.consolidate.start.trip", index.incrementAndGet(), nbTrips, tripId));
|
|
| 156 | + |
|
| 157 | + // mark trip processed
|
|
| 158 | + stepModel.setTripProcessed(tripId);
|
|
| 159 | + |
|
| 160 | + if (TripAware.isLonglineId(tripId)) {
|
|
| 161 | + // can't consolidate LL trips...
|
|
| 162 | + progressModel.increments();
|
|
| 163 | + return;
|
|
| 164 | + }
|
|
| 165 | + TripConsolidateRequest request = new TripConsolidateRequest();
|
|
| 166 | + request.setTripId(tripId);
|
|
| 167 | + request.setFailIfLengthWeightParameterNotFound(stepModel.isConsolidationFailIfLengthWeightParameterNotFound());
|
|
| 168 | + request.setFailIfLengthLengthParameterNotFound(stepModel.isConsolidationFailIfLengthLengthParameterNotFound());
|
|
| 169 | + |
|
| 170 | + TripConsolidateResult result = consolidateDataService.consolidateTrip(simplifiedObjectTypeSpecializedRules, request);
|
|
| 171 | + if (result != null) {
|
|
| 172 | + printResult(result);
|
|
| 173 | + if (result.withModifications()) {
|
|
| 174 | + results.add(result);
|
|
| 175 | + }
|
|
| 176 | + }
|
|
| 177 | + ObserveUtil.cleanMemory();
|
|
| 178 | + }
|
|
| 179 | + |
|
| 151 | 180 | void printResult(TripConsolidateResult result) {
|
| 152 | 181 | String tripSeineLabel = result.getTripLabel();
|
| 153 | 182 | if (result.withModifications()) {
|
| ... | ... | @@ -156,21 +185,23 @@ public class Start extends AdminTabUIActionSupport<ConsolidateUI> { |
| 156 | 185 | if (result.withWarnings()) {
|
| 157 | 186 | sendMessage(t("observe.ui.datasource.editor.actions.consolidate.message.trip.warning", result.getTripId(), tripSeineLabel));
|
| 158 | 187 | }
|
| 159 | - for (ActivityConsolidateResult activityResult : result.getActivityObservationResults()) {
|
|
| 188 | + for (fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult activityResult : result.getActivityObservationResults()) {
|
|
| 189 | + printResult(activityResult);
|
|
| 190 | + }
|
|
| 191 | + for (fr.ird.observe.consolidation.data.ps.logbook.ActivityConsolidateResult activityResult : result.getActivityLogbookResults()) {
|
|
| 160 | 192 | printResult(activityResult);
|
| 161 | 193 | }
|
| 162 | 194 | for (ToolkitIdModifications batchResult : result.getLocalmarketBatchResults()) {
|
| 163 | 195 | printResult(BatchDto.class, batchResult);
|
| 164 | 196 | }
|
| 165 | - sendMessage("---------------");
|
|
| 166 | 197 | }
|
| 167 | 198 | |
| 168 | - void printResult(ActivityConsolidateResult activityResult) {
|
|
| 199 | + void printResult(fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult activityResult) {
|
|
| 169 | 200 | if (activityResult.withModifications()) {
|
| 170 | - sendMessage(" " + t("observe.ui.datasource.editor.actions.consolidate.message.activity.modification", activityResult.getActivityId(), activityResult.getActivityLabel()));
|
|
| 201 | + sendMessage(" " + t("observe.ui.datasource.editor.actions.consolidate.message.observation.activity.modification", activityResult.getActivityId(), activityResult.getActivityLabel()));
|
|
| 171 | 202 | }
|
| 172 | 203 | if (activityResult.withWarnings()) {
|
| 173 | - sendMessage(" " + t("observe.ui.datasource.editor.actions.consolidate.message.activity.warning", activityResult.getActivityId(), activityResult.getActivityLabel()));
|
|
| 204 | + sendMessage(" " + t("observe.ui.datasource.editor.actions.consolidate.message.observation.activity.warning", activityResult.getActivityId(), activityResult.getActivityLabel()));
|
|
| 174 | 205 | }
|
| 175 | 206 | printResult(SetDto.class, activityResult.getSetModifications());
|
| 176 | 207 | for (ToolkitIdModifications modification : activityResult.getFloatingObjectModifications()) {
|
| ... | ... | @@ -184,6 +215,18 @@ public class Start extends AdminTabUIActionSupport<ConsolidateUI> { |
| 184 | 215 | }
|
| 185 | 216 | }
|
| 186 | 217 | |
| 218 | + void printResult(fr.ird.observe.consolidation.data.ps.logbook.ActivityConsolidateResult activityResult) {
|
|
| 219 | + if (activityResult.withModifications()) {
|
|
| 220 | + sendMessage(" " + t("observe.ui.datasource.editor.actions.consolidate.message.logbook.activity.modification", activityResult.getActivityId(), activityResult.getActivityLabel()));
|
|
| 221 | + }
|
|
| 222 | + if (activityResult.withWarnings()) {
|
|
| 223 | + sendMessage(" " + t("observe.ui.datasource.editor.actions.consolidate.message.logbook.activity.warning", activityResult.getActivityId(), activityResult.getActivityLabel()));
|
|
| 224 | + }
|
|
| 225 | + for (ToolkitIdModifications modification : activityResult.getFloatingObjectModifications()) {
|
|
| 226 | + printResult(FloatingObjectDto.class, modification);
|
|
| 227 | + }
|
|
| 228 | + }
|
|
| 229 | + |
|
| 187 | 230 | private void printResult(Class<? extends BusinessDto> dataType, ToolkitIdModifications modifications) {
|
| 188 | 231 | if (modifications == null) {
|
| 189 | 232 | return;
|
| ... | ... | @@ -193,7 +236,10 @@ public class Start extends AdminTabUIActionSupport<ConsolidateUI> { |
| 193 | 236 | sendMessage(" " + t("observe.ui.datasource.editor.actions.consolidate.message.modifications.modification", modifications.modificationsCount(), type, modifications.getId(), modifications.getLabel()));
|
| 194 | 237 | for (JavaBeanPropertyModification modification : modifications.getModifications()) {
|
| 195 | 238 | String property = I18n.t(ObserveI18nDecoratorHelper.getPropertyI18nKey(dataType, modification.getPropertyName()));
|
| 196 | - String message = I18n.t("observe.ui.datasource.editor.actions.consolidate.message.modifications.property", property, modification.getOldValue(), modification.getNewValue());
|
|
| 239 | + String message = I18n.t("observe.ui.datasource.editor.actions.consolidate.message.modifications.property",
|
|
| 240 | + property,
|
|
| 241 | + AtomicConsolidateAction.decorateValue(modification.getOldValue()),
|
|
| 242 | + AtomicConsolidateAction.decorateValue(modification.getNewValue()));
|
|
| 197 | 243 | sendMessage(" - " + message);
|
| 198 | 244 | }
|
| 199 | 245 | }
|
| ... | ... | @@ -490,15 +490,18 @@ observe.ui.datasource.editor.actions.activity.pairing=Activities pairing |
| 490 | 490 | observe.ui.datasource.editor.actions.consolidate=Consolidate data
|
| 491 | 491 | observe.ui.datasource.editor.actions.consolidate.config=Consolidate data configuration
|
| 492 | 492 | observe.ui.datasource.editor.actions.consolidate.description=Consolidate observed data
|
| 493 | -observe.ui.datasource.editor.actions.consolidate.message.activity.modification=Computed data for activity [%s] %s
|
|
| 494 | -observe.ui.datasource.editor.actions.consolidate.message.activity.warning=Some warnings were found for activity [%s] %s
|
|
| 493 | +observe.ui.datasource.editor.actions.consolidate.end.trip=End consolidate data on trip %s / %s (%s) [duration\: %s]
|
|
| 494 | +observe.ui.datasource.editor.actions.consolidate.message.logbook.activity.modification=Some data were computed for Logbook activity [%s] %s
|
|
| 495 | +observe.ui.datasource.editor.actions.consolidate.message.logbook.activity.warning=Some warnings were found for Logbook activity [%s] %s
|
|
| 495 | 496 | observe.ui.datasource.editor.actions.consolidate.message.modifications.modification=%d change(s) for data of type %s [%s] %s
|
| 496 | 497 | observe.ui.datasource.editor.actions.consolidate.message.modifications.property=Property %s, old value\: %s - new value\: %s
|
| 497 | 498 | observe.ui.datasource.editor.actions.consolidate.message.modifications.warning=%d warning(s) for data of type %s [%s] %s
|
| 498 | 499 | observe.ui.datasource.editor.actions.consolidate.message.noChanges=No data modified.
|
| 500 | +observe.ui.datasource.editor.actions.consolidate.message.observation.activity.modification=Some data were computed for Observations activity [%s] %s
|
|
| 501 | +observe.ui.datasource.editor.actions.consolidate.message.observation.activity.warning=Some warnings were found for Observations activity [%s] %s
|
|
| 499 | 502 | observe.ui.datasource.editor.actions.consolidate.message.operation.done=Consolidate operation done in %1$s.
|
| 500 | 503 | observe.ui.datasource.editor.actions.consolidate.message.save.changes=Save modified %1$s trip(s).
|
| 501 | -observe.ui.datasource.editor.actions.consolidate.message.trip.modification=Data consolidate for trip [%s] %s
|
|
| 504 | +observe.ui.datasource.editor.actions.consolidate.message.trip.modification=Some data were computed for trip [%s] %s
|
|
| 502 | 505 | observe.ui.datasource.editor.actions.consolidate.message.trip.warning=Some warnings were found for trip [%s] %s
|
| 503 | 506 | observe.ui.datasource.editor.actions.consolidate.skip.trip=Skip already consolidated data on trip %s / %s (%s)
|
| 504 | 507 | observe.ui.datasource.editor.actions.consolidate.start.trip=Start consolidate data on trip %s / %s (%s)
|
| ... | ... | @@ -490,12 +490,15 @@ observe.ui.datasource.editor.actions.activity.pairing=Activities pairing \#TODO |
| 490 | 490 | observe.ui.datasource.editor.actions.consolidate=Calcular los datos
|
| 491 | 491 | observe.ui.datasource.editor.actions.consolidate.config=Consolidate data configuration
|
| 492 | 492 | observe.ui.datasource.editor.actions.consolidate.description=Calcular los datos que no fueron observados
|
| 493 | -observe.ui.datasource.editor.actions.consolidate.message.activity.modification=Datos calculados para la actividad [%s] %s
|
|
| 494 | -observe.ui.datasource.editor.actions.consolidate.message.activity.warning=Some warnings were found for activity [%s] %s
|
|
| 493 | +observe.ui.datasource.editor.actions.consolidate.end.trip=End consolidate data on trip %s / %s (%s) [duration\: %s] \#TODO
|
|
| 494 | +observe.ui.datasource.editor.actions.consolidate.message.logbook.activity.modification=Some data were computed for Logbook activity [%s] %s
|
|
| 495 | +observe.ui.datasource.editor.actions.consolidate.message.logbook.activity.warning=Some warnings were found for Logbook activity [%s] %s
|
|
| 495 | 496 | observe.ui.datasource.editor.actions.consolidate.message.modifications.modification=%d change(s) for data of type %s [%s] %s
|
| 496 | 497 | observe.ui.datasource.editor.actions.consolidate.message.modifications.property=Property %s, old value\: %s - new value\: %s \#TODO
|
| 497 | 498 | observe.ui.datasource.editor.actions.consolidate.message.modifications.warning=%d warning(s) for data of type %s [%s] %s
|
| 498 | 499 | observe.ui.datasource.editor.actions.consolidate.message.noChanges=No modificación de datos.
|
| 500 | +observe.ui.datasource.editor.actions.consolidate.message.observation.activity.modification=Some data were computed for Observations activity [%s] %s
|
|
| 501 | +observe.ui.datasource.editor.actions.consolidate.message.observation.activity.warning=Some warnings were found for Observations activity [%s] %s
|
|
| 499 | 502 | observe.ui.datasource.editor.actions.consolidate.message.operation.done=Operación de calculo de datos terminada en %1$s.
|
| 500 | 503 | observe.ui.datasource.editor.actions.consolidate.message.save.changes=Guardar las modificaciones de la(s) %1$s marea(s) modificada(s).
|
| 501 | 504 | observe.ui.datasource.editor.actions.consolidate.message.trip.modification=Datos calculados para la marea [%s] %s
|
| ... | ... | @@ -490,15 +490,18 @@ observe.ui.datasource.editor.actions.activity.pairing=Appairement des activités |
| 490 | 490 | observe.ui.datasource.editor.actions.consolidate=Calculer les données
|
| 491 | 491 | observe.ui.datasource.editor.actions.consolidate.config=Configuration de la consolidation
|
| 492 | 492 | observe.ui.datasource.editor.actions.consolidate.description=Calculer les données non observées
|
| 493 | -observe.ui.datasource.editor.actions.consolidate.message.activity.modification=Données calculées pour l'activité [%s] %s
|
|
| 494 | -observe.ui.datasource.editor.actions.consolidate.message.activity.warning=Des avertissements ont été détectés pour l'activité [%s] %s
|
|
| 493 | +observe.ui.datasource.editor.actions.consolidate.end.trip=Consolidation terminée pour la marée %s / %s (%s) [durée \: %s]
|
|
| 494 | +observe.ui.datasource.editor.actions.consolidate.message.logbook.activity.modification=Des données ont été calculées pour l'activité (Livre de bord) [%s] %s
|
|
| 495 | +observe.ui.datasource.editor.actions.consolidate.message.logbook.activity.warning=Des avertissements ont été détectés pour l'activité (Livre de bord) [%s] %s
|
|
| 495 | 496 | observe.ui.datasource.editor.actions.consolidate.message.modifications.modification=%d modification(s) pour la donnée de type %s [%s] %s
|
| 496 | 497 | observe.ui.datasource.editor.actions.consolidate.message.modifications.property=Propriété %s, ancienne valeur \: %s - nouvelle valeur \: %s
|
| 497 | 498 | observe.ui.datasource.editor.actions.consolidate.message.modifications.warning=%d avertissement(s) pour la donnée de type %s [%s] %s
|
| 498 | 499 | observe.ui.datasource.editor.actions.consolidate.message.noChanges=Aucune donnée modifiée.
|
| 500 | +observe.ui.datasource.editor.actions.consolidate.message.observation.activity.modification=Des données ont été calculées pour l'activité (Observation) [%s] %s
|
|
| 501 | +observe.ui.datasource.editor.actions.consolidate.message.observation.activity.warning=Des avertissements ont été détectés pour l'activité (Observation) [%s] %s
|
|
| 499 | 502 | observe.ui.datasource.editor.actions.consolidate.message.operation.done=Opération de calcul des données terminée à %1$s.
|
| 500 | 503 | observe.ui.datasource.editor.actions.consolidate.message.save.changes=Sauvegarde des modifications sur la(es) %1$s marée(s) modifiée(s).
|
| 501 | -observe.ui.datasource.editor.actions.consolidate.message.trip.modification=Données calculées pour la marée [%s] %s.
|
|
| 504 | +observe.ui.datasource.editor.actions.consolidate.message.trip.modification=Des données ont été calculées pour la marée [%s] %s.
|
|
| 502 | 505 | observe.ui.datasource.editor.actions.consolidate.message.trip.warning=Des avertissement ont été détectés pour la marée [%s] %s.
|
| 503 | 506 | observe.ui.datasource.editor.actions.consolidate.skip.trip=Marée déjà consolidée %s / %s (%s)
|
| 504 | 507 | observe.ui.datasource.editor.actions.consolidate.start.trip=Démarrage de la consolidation pour la marée %s / %s (%s)
|
| ... | ... | @@ -23,7 +23,6 @@ package fr.ird.observe.consolidation.data.ps.common; |
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | 25 | |
| 26 | -import fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult;
|
|
| 27 | 26 | import fr.ird.observe.dto.ToolkitIdModifications;
|
| 28 | 27 | import io.ultreia.java4all.util.json.JsonAware;
|
| 29 | 28 | |
| ... | ... | @@ -49,16 +48,25 @@ public class TripConsolidateResult implements JsonAware { |
| 49 | 48 | /**
|
| 50 | 49 | * Observation activities results.
|
| 51 | 50 | */
|
| 52 | - protected final Set<ActivityConsolidateResult> activityObservationResults;
|
|
| 51 | + protected final Set<fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult> activityObservationResults;
|
|
| 52 | + /**
|
|
| 53 | + * Logbook activities results.
|
|
| 54 | + */
|
|
| 55 | + protected final Set<fr.ird.observe.consolidation.data.ps.logbook.ActivityConsolidateResult> activityLogbookResults;
|
|
| 53 | 56 | /**
|
| 54 | 57 | * Local market batches results.
|
| 55 | 58 | */
|
| 56 | 59 | protected final Set<ToolkitIdModifications> localmarketBatchResults;
|
| 57 | 60 | |
| 58 | - public TripConsolidateResult(String tripId, String tripLabel, Set<ActivityConsolidateResult> activityObservationResults, Set<ToolkitIdModifications> localmarketBatchResults) {
|
|
| 61 | + public TripConsolidateResult(String tripId,
|
|
| 62 | + String tripLabel,
|
|
| 63 | + Set<fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult> activityObservationResults,
|
|
| 64 | + Set<fr.ird.observe.consolidation.data.ps.logbook.ActivityConsolidateResult> activityLogbookResults,
|
|
| 65 | + Set<ToolkitIdModifications> localmarketBatchResults) {
|
|
| 59 | 66 | this.tripId = tripId;
|
| 60 | 67 | this.tripLabel = tripLabel;
|
| 61 | 68 | this.activityObservationResults = activityObservationResults;
|
| 69 | + this.activityLogbookResults = activityLogbookResults;
|
|
| 62 | 70 | this.localmarketBatchResults = localmarketBatchResults;
|
| 63 | 71 | }
|
| 64 | 72 | |
| ... | ... | @@ -70,21 +78,27 @@ public class TripConsolidateResult implements JsonAware { |
| 70 | 78 | return tripLabel;
|
| 71 | 79 | }
|
| 72 | 80 | |
| 73 | - public Set<ActivityConsolidateResult> getActivityObservationResults() {
|
|
| 81 | + public Set<fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult> getActivityObservationResults() {
|
|
| 74 | 82 | return activityObservationResults;
|
| 75 | 83 | }
|
| 76 | 84 | |
| 85 | + public Set<fr.ird.observe.consolidation.data.ps.logbook.ActivityConsolidateResult> getActivityLogbookResults() {
|
|
| 86 | + return activityLogbookResults;
|
|
| 87 | + }
|
|
| 88 | + |
|
| 77 | 89 | public Set<ToolkitIdModifications> getLocalmarketBatchResults() {
|
| 78 | 90 | return localmarketBatchResults;
|
| 79 | 91 | }
|
| 80 | 92 | |
| 81 | 93 | public boolean withModifications() {
|
| 82 | - return activityObservationResults.stream().anyMatch(ActivityConsolidateResult::withModifications) ||
|
|
| 94 | + return activityObservationResults.stream().anyMatch(fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult::withModifications) ||
|
|
| 95 | + activityLogbookResults.stream().anyMatch(fr.ird.observe.consolidation.data.ps.logbook.ActivityConsolidateResult::withModifications) ||
|
|
| 83 | 96 | localmarketBatchResults.stream().anyMatch(ToolkitIdModifications::withModifications);
|
| 84 | 97 | }
|
| 85 | 98 | |
| 86 | 99 | public boolean withWarnings() {
|
| 87 | - return activityObservationResults.stream().anyMatch(ActivityConsolidateResult::withWarnings) ||
|
|
| 100 | + return activityObservationResults.stream().anyMatch(fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult::withWarnings) ||
|
|
| 101 | + activityLogbookResults.stream().anyMatch(fr.ird.observe.consolidation.data.ps.logbook.ActivityConsolidateResult::withWarnings) ||
|
|
| 88 | 102 | localmarketBatchResults.stream().anyMatch(ToolkitIdModifications::withWarnings);
|
| 89 | 103 | }
|
| 90 | 104 | } |
| 1 | +package fr.ird.observe.consolidation.data.ps.logbook;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Core :: API :: Dto Consolidation
|
|
| 6 | + * %%
|
|
| 7 | + * Copyright (C) 2008 - 2023 IRD, Ultreia.io
|
|
| 8 | + * %%
|
|
| 9 | + * This program is free software: you can redistribute it and/or modify
|
|
| 10 | + * it under the terms of the GNU General Public License as
|
|
| 11 | + * published by the Free Software Foundation, either version 3 of the
|
|
| 12 | + * License, or (at your option) any later version.
|
|
| 13 | + *
|
|
| 14 | + * This program is distributed in the hope that it will be useful,
|
|
| 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 | + * GNU General Public License for more details.
|
|
| 18 | + *
|
|
| 19 | + * You should have received a copy of the GNU General Public
|
|
| 20 | + * License along with this program. If not, see
|
|
| 21 | + * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 | + * #L%
|
|
| 23 | + */
|
|
| 24 | + |
|
| 25 | +import fr.ird.observe.dto.ToolkitIdModifications;
|
|
| 26 | +import io.ultreia.java4all.util.json.JsonAware;
|
|
| 27 | + |
|
| 28 | +import java.util.Set;
|
|
| 29 | + |
|
| 30 | +/**
|
|
| 31 | + * Created on 12/03/2023.
|
|
| 32 | + *
|
|
| 33 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 34 | + * @since 9.0.28
|
|
| 35 | + */
|
|
| 36 | +public class ActivityConsolidateResult implements JsonAware {
|
|
| 37 | + |
|
| 38 | + /**
|
|
| 39 | + * Id of activity.
|
|
| 40 | + */
|
|
| 41 | + protected String activityId;
|
|
| 42 | + |
|
| 43 | + /**
|
|
| 44 | + * Label of activity.
|
|
| 45 | + */
|
|
| 46 | + private String activityLabel;
|
|
| 47 | + |
|
| 48 | + /**
|
|
| 49 | + * All modification on floating objects.
|
|
| 50 | + */
|
|
| 51 | + private Set<ToolkitIdModifications> floatingObjectModifications;
|
|
| 52 | + |
|
| 53 | + public String getActivityId() {
|
|
| 54 | + return activityId;
|
|
| 55 | + }
|
|
| 56 | + |
|
| 57 | + public void setActivityId(String activityId) {
|
|
| 58 | + this.activityId = activityId;
|
|
| 59 | + }
|
|
| 60 | + |
|
| 61 | + public String getActivityLabel() {
|
|
| 62 | + return activityLabel;
|
|
| 63 | + }
|
|
| 64 | + |
|
| 65 | + public void setActivityLabel(String activityLabel) {
|
|
| 66 | + this.activityLabel = activityLabel;
|
|
| 67 | + }
|
|
| 68 | + |
|
| 69 | + public Set<ToolkitIdModifications> getFloatingObjectModifications() {
|
|
| 70 | + return floatingObjectModifications;
|
|
| 71 | + }
|
|
| 72 | + |
|
| 73 | + public void setFloatingObjectModifications(Set<ToolkitIdModifications> floatingObjectModifications) {
|
|
| 74 | + this.floatingObjectModifications = floatingObjectModifications;
|
|
| 75 | + }
|
|
| 76 | + |
|
| 77 | + public boolean withModifications() {
|
|
| 78 | + if (getFloatingObjectModifications() != null) {
|
|
| 79 | + for (ToolkitIdModifications modifications : floatingObjectModifications) {
|
|
| 80 | + if (modifications.withModifications()) {
|
|
| 81 | + return true;
|
|
| 82 | + }
|
|
| 83 | + }
|
|
| 84 | + }
|
|
| 85 | + return false;
|
|
| 86 | + }
|
|
| 87 | + |
|
| 88 | + public boolean withWarnings() {
|
|
| 89 | + if (getFloatingObjectModifications() != null) {
|
|
| 90 | + for (ToolkitIdModifications modifications : floatingObjectModifications) {
|
|
| 91 | + if (modifications.withWarnings()) {
|
|
| 92 | + return true;
|
|
| 93 | + }
|
|
| 94 | + }
|
|
| 95 | + }
|
|
| 96 | + return false;
|
|
| 97 | + }
|
|
| 98 | +}
|
|
| 99 | + |
| 1 | +package fr.ird.observe.consolidation.data.ps.logbook;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Core :: API :: Dto Consolidation
|
|
| 6 | + * %%
|
|
| 7 | + * Copyright (C) 2008 - 2023 IRD, Ultreia.io
|
|
| 8 | + * %%
|
|
| 9 | + * This program is free software: you can redistribute it and/or modify
|
|
| 10 | + * it under the terms of the GNU General Public License as
|
|
| 11 | + * published by the Free Software Foundation, either version 3 of the
|
|
| 12 | + * License, or (at your option) any later version.
|
|
| 13 | + *
|
|
| 14 | + * This program is distributed in the hope that it will be useful,
|
|
| 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 | + * GNU General Public License for more details.
|
|
| 18 | + *
|
|
| 19 | + * You should have received a copy of the GNU General Public
|
|
| 20 | + * License along with this program. If not, see
|
|
| 21 | + * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 | + * #L%
|
|
| 23 | + */
|
|
| 24 | + |
|
| 25 | +import fr.ird.observe.dto.ToolkitIdModifications;
|
|
| 26 | + |
|
| 27 | +import java.util.LinkedHashSet;
|
|
| 28 | +import java.util.Optional;
|
|
| 29 | +import java.util.Set;
|
|
| 30 | + |
|
| 31 | +/**
|
|
| 32 | + * Created on 12/03/2023.
|
|
| 33 | + *
|
|
| 34 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 35 | + * @since 9.0.28
|
|
| 36 | + */
|
|
| 37 | +public class ActivityConsolidateResultBuilder {
|
|
| 38 | + private final Set<ToolkitIdModifications> floatingObjectModificationBuilder = new LinkedHashSet<>();
|
|
| 39 | + private final String activityLabel;
|
|
| 40 | + private final String activityId;
|
|
| 41 | + |
|
| 42 | + public ActivityConsolidateResultBuilder(String activityId, String activityLabel) {
|
|
| 43 | + this.activityId = activityId;
|
|
| 44 | + this.activityLabel = activityLabel;
|
|
| 45 | + }
|
|
| 46 | + |
|
| 47 | + public Optional<ActivityConsolidateResult> build() {
|
|
| 48 | + boolean noModification = floatingObjectModificationBuilder.isEmpty();
|
|
| 49 | + |
|
| 50 | + if (noModification) {
|
|
| 51 | + return Optional.empty();
|
|
| 52 | + }
|
|
| 53 | + ActivityConsolidateResult result = new ActivityConsolidateResult();
|
|
| 54 | + result.setActivityId(activityId);
|
|
| 55 | + result.setActivityLabel(activityLabel);
|
|
| 56 | + result.setFloatingObjectModifications(floatingObjectModificationBuilder);
|
|
| 57 | + return Optional.of(result);
|
|
| 58 | + }
|
|
| 59 | + |
|
| 60 | + public void flushFloatingObjectModification(ToolkitIdModifications modifications) {
|
|
| 61 | + floatingObjectModificationBuilder.add(modifications);
|
|
| 62 | + }
|
|
| 63 | +} |
| ... | ... | @@ -23,12 +23,13 @@ package fr.ird.observe.consolidation.data.ps.logbook; |
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | 25 | import fr.ird.observe.consolidation.AtomicConsolidateAction;
|
| 26 | +import fr.ird.observe.consolidation.data.ps.dcp.CleanComputedValuesAction;
|
|
| 26 | 27 | import fr.ird.observe.consolidation.data.ps.dcp.ComputeBiodegradableConsolidateAction;
|
| 27 | 28 | import fr.ird.observe.consolidation.data.ps.dcp.ComputeNonEntanglingConsolidateAction;
|
| 28 | 29 | import fr.ird.observe.consolidation.data.ps.dcp.ComputeSimplifiedObjectTypeConsolidateAction;
|
| 29 | -import fr.ird.observe.consolidation.data.ps.dcp.FloatingObjectConsolidateAction;
|
|
| 30 | 30 | import fr.ird.observe.dto.data.ps.logbook.FloatingObjectDto;
|
| 31 | -import fr.ird.observe.dto.data.ps.logbook.FloatingObjectPartDto;
|
|
| 31 | + |
|
| 32 | +import java.util.List;
|
|
| 32 | 33 | |
| 33 | 34 | /**
|
| 34 | 35 | * Created on 09/03/2023.
|
| ... | ... | @@ -36,31 +37,26 @@ import fr.ird.observe.dto.data.ps.logbook.FloatingObjectPartDto; |
| 36 | 37 | * @author Tony Chemit - dev@tchemit.fr
|
| 37 | 38 | * @since 9.0.27
|
| 38 | 39 | */
|
| 39 | -public enum FloatingObjectActions implements AtomicConsolidateAction<FloatingObjectConsolidateContext, FloatingObjectDto> {
|
|
| 40 | +public enum FloatingObjectConsolidateActions implements AtomicConsolidateAction<FloatingObjectConsolidateContext, FloatingObjectDto> {
|
|
| 40 | 41 | |
| 42 | + CleanComputedValuesWhenArriving(new CleanComputedValuesAction.WhenArriving<>()),
|
|
| 43 | + CleanComputedValuesWhenLeaving(new CleanComputedValuesAction.WhenLeaving<>()),
|
|
| 41 | 44 | ComputeBiodegradableWhenArriving(new ComputeBiodegradableConsolidateAction.WhenArriving<>()),
|
| 42 | 45 | ComputeBiodegradableWhenLeaving(new ComputeBiodegradableConsolidateAction.WhenLeaving<>()),
|
| 43 | - |
|
| 44 | 46 | ComputeNonEntanglingWhenArriving(new ComputeNonEntanglingConsolidateAction.WhenArriving<>()),
|
| 45 | 47 | ComputeNonEntanglingWhenLeaving(new ComputeNonEntanglingConsolidateAction.WhenLeaving<>()),
|
| 46 | - |
|
| 47 | 48 | ComputeSimplifiedObjectTypeWhenArriving(new ComputeSimplifiedObjectTypeConsolidateAction.WhenArriving<>()),
|
| 48 | 49 | ComputeSimplifiedObjectTypeWhenLeaving(new ComputeSimplifiedObjectTypeConsolidateAction.WhenLeaving<>());
|
| 49 | 50 | |
| 50 | - private final FloatingObjectConsolidateAction<?, FloatingObjectDto, FloatingObjectPartDto, FloatingObjectConsolidateRequest, FloatingObjectConsolidateContext> action;
|
|
| 51 | + private final AtomicConsolidateAction<FloatingObjectConsolidateContext, FloatingObjectDto> action;
|
|
| 51 | 52 | |
| 52 | - FloatingObjectActions(FloatingObjectConsolidateAction<?, FloatingObjectDto, FloatingObjectPartDto, FloatingObjectConsolidateRequest, FloatingObjectConsolidateContext> action) {
|
|
| 53 | + FloatingObjectConsolidateActions(AtomicConsolidateAction<FloatingObjectConsolidateContext, FloatingObjectDto> action) {
|
|
| 53 | 54 | this.action = action;
|
| 54 | 55 | }
|
| 55 | 56 | |
| 56 | 57 | @Override
|
| 57 | - public String fieldName() {
|
|
| 58 | - return action.fieldName();
|
|
| 59 | - }
|
|
| 60 | - |
|
| 61 | - @Override
|
|
| 62 | - public String extraFieldName() {
|
|
| 63 | - return action.extraFieldName();
|
|
| 58 | + public List<String> fieldNames() {
|
|
| 59 | + return action.fieldNames();
|
|
| 64 | 60 | }
|
| 65 | 61 | |
| 66 | 62 | @Override
|
| ... | ... | @@ -75,6 +71,6 @@ public enum FloatingObjectActions implements AtomicConsolidateAction<FloatingObj |
| 75 | 71 | |
| 76 | 72 | @Override
|
| 77 | 73 | public String toString() {
|
| 78 | - return FloatingObjectActions.class.getSimpleName() + "." + name();
|
|
| 74 | + return "ps.logbook." + FloatingObjectConsolidateActions.class.getSimpleName() + "." + name();
|
|
| 79 | 75 | }
|
| 80 | 76 | } |
| ... | ... | @@ -46,33 +46,43 @@ public class FloatingObjectConsolidateEngine extends FloatingObjectConsolidateEn |
| 46 | 46 | return new FloatingObjectConsolidateContext(getSimplifiedObjectTypeManager(), getMonitor(), getDecorator());
|
| 47 | 47 | }
|
| 48 | 48 | |
| 49 | + @Override
|
|
| 50 | + protected AtomicConsolidateAction<FloatingObjectConsolidateContext, FloatingObjectDto> cleanComputedValuesWhenArrivingAction() {
|
|
| 51 | + return FloatingObjectConsolidateActions.CleanComputedValuesWhenArriving;
|
|
| 52 | + }
|
|
| 53 | + |
|
| 54 | + @Override
|
|
| 55 | + protected AtomicConsolidateAction<FloatingObjectConsolidateContext, FloatingObjectDto> cleanComputedValuesWhenLeavingAction() {
|
|
| 56 | + return FloatingObjectConsolidateActions.CleanComputedValuesWhenLeaving;
|
|
| 57 | + }
|
|
| 58 | + |
|
| 49 | 59 | @Override
|
| 50 | 60 | protected AtomicConsolidateAction<FloatingObjectConsolidateContext, FloatingObjectDto> computeSimplifiedObjectTypeWhenArrivingAction() {
|
| 51 | - return FloatingObjectActions.ComputeSimplifiedObjectTypeWhenArriving;
|
|
| 61 | + return FloatingObjectConsolidateActions.ComputeSimplifiedObjectTypeWhenArriving;
|
|
| 52 | 62 | }
|
| 53 | 63 | |
| 54 | 64 | @Override
|
| 55 | 65 | protected AtomicConsolidateAction<FloatingObjectConsolidateContext, FloatingObjectDto> computeSimplifiedObjectTypeWhenLeavingAction() {
|
| 56 | - return FloatingObjectActions.ComputeSimplifiedObjectTypeWhenLeaving;
|
|
| 66 | + return FloatingObjectConsolidateActions.ComputeSimplifiedObjectTypeWhenLeaving;
|
|
| 57 | 67 | }
|
| 58 | 68 | |
| 59 | 69 | @Override
|
| 60 | 70 | protected AtomicConsolidateAction<FloatingObjectConsolidateContext, FloatingObjectDto> computeBiodegradableWhenArrivingAction() {
|
| 61 | - return FloatingObjectActions.ComputeBiodegradableWhenArriving;
|
|
| 71 | + return FloatingObjectConsolidateActions.ComputeBiodegradableWhenArriving;
|
|
| 62 | 72 | }
|
| 63 | 73 | |
| 64 | 74 | @Override
|
| 65 | 75 | protected AtomicConsolidateAction<FloatingObjectConsolidateContext, FloatingObjectDto> computeBiodegradableWhenLeavingAction() {
|
| 66 | - return FloatingObjectActions.ComputeBiodegradableWhenLeaving;
|
|
| 76 | + return FloatingObjectConsolidateActions.ComputeBiodegradableWhenLeaving;
|
|
| 67 | 77 | }
|
| 68 | 78 | |
| 69 | 79 | @Override
|
| 70 | 80 | protected AtomicConsolidateAction<FloatingObjectConsolidateContext, FloatingObjectDto> computeNonEntanglingWhenArrivingAction() {
|
| 71 | - return FloatingObjectActions.ComputeNonEntanglingWhenArriving;
|
|
| 81 | + return FloatingObjectConsolidateActions.ComputeNonEntanglingWhenArriving;
|
|
| 72 | 82 | }
|
| 73 | 83 | |
| 74 | 84 | @Override
|
| 75 | 85 | protected AtomicConsolidateAction<FloatingObjectConsolidateContext, FloatingObjectDto> computeNonEntanglingWhenLeavingAction() {
|
| 76 | - return FloatingObjectActions.ComputeNonEntanglingWhenLeaving;
|
|
| 86 | + return FloatingObjectConsolidateActions.ComputeNonEntanglingWhenLeaving;
|
|
| 77 | 87 | }
|
| 78 | 88 | } |
| ... | ... | @@ -26,16 +26,12 @@ import fr.ird.observe.consolidation.data.ps.dcp.SimplifiedObjectTypeManager; |
| 26 | 26 | import fr.ird.observe.consolidation.data.ps.localmarket.BatchConsolidateEngine;
|
| 27 | 27 | import fr.ird.observe.consolidation.data.ps.localmarket.BatchConsolidateRequest;
|
| 28 | 28 | import fr.ird.observe.consolidation.data.ps.localmarket.GetOptionalRtpMeanWeightImpl;
|
| 29 | -import fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateEngine;
|
|
| 30 | -import fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult;
|
|
| 31 | 29 | import fr.ird.observe.decoration.DecoratorService;
|
| 32 | 30 | import fr.ird.observe.dto.ToolkitIdModifications;
|
| 33 | 31 | import fr.ird.observe.dto.data.ps.localmarket.BatchDto;
|
| 34 | 32 | import fr.ird.observe.dto.referential.ReferentialLocale;
|
| 35 | 33 | import fr.ird.observe.entities.data.ps.common.Trip;
|
| 36 | 34 | import fr.ird.observe.entities.data.ps.localmarket.Batch;
|
| 37 | -import fr.ird.observe.entities.data.ps.observation.Activity;
|
|
| 38 | -import fr.ird.observe.entities.data.ps.observation.Route;
|
|
| 39 | 35 | import fr.ird.observe.spi.service.ServiceContext;
|
| 40 | 36 | import io.ultreia.java4all.decoration.Decorator;
|
| 41 | 37 | import org.apache.logging.log4j.LogManager;
|
| ... | ... | @@ -56,11 +52,13 @@ public class TripConsolidateEngine { |
| 56 | 52 | private static final Logger log = LogManager.getLogger(TripConsolidateEngine.class);
|
| 57 | 53 | private final ServiceContext context;
|
| 58 | 54 | private final BatchConsolidateEngine localmarketBatchEngine;
|
| 59 | - private final ActivityConsolidateEngine activityConsolidateEngine;
|
|
| 55 | + private final fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateEngine observationActivityConsolidateEngine;
|
|
| 56 | + private final fr.ird.observe.consolidation.data.ps.logbook.ActivityConsolidateEngine logbookActivityConsolidateEngine;
|
|
| 60 | 57 | |
| 61 | 58 | public TripConsolidateEngine(ServiceContext context, SimplifiedObjectTypeManager simplifiedObjectTypeManager) {
|
| 62 | 59 | this.context = context;
|
| 63 | - this.activityConsolidateEngine = new ActivityConsolidateEngine(context, simplifiedObjectTypeManager);
|
|
| 60 | + this.observationActivityConsolidateEngine = new fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateEngine(context, simplifiedObjectTypeManager);
|
|
| 61 | + this.logbookActivityConsolidateEngine = new fr.ird.observe.consolidation.data.ps.logbook.ActivityConsolidateEngine(context, simplifiedObjectTypeManager);
|
|
| 64 | 62 | this.localmarketBatchEngine = new BatchConsolidateEngine(new GetOptionalRtpMeanWeightImpl(context), context.getDecoratorService());
|
| 65 | 63 | }
|
| 66 | 64 | |
| ... | ... | @@ -76,15 +74,16 @@ public class TripConsolidateEngine { |
| 76 | 74 | |
| 77 | 75 | Set<ToolkitIdModifications> localmarketBatchResults = consolidateLocalmarketBatches(trip, failIfLengthWeightParameterNotFound);
|
| 78 | 76 | |
| 79 | - Set<ActivityConsolidateResult> activityConsolidateResults = consolidateObservationActivities(trip, failIfLengthWeightParameterNotFound, failIfLengthLengthParameterNotFound);
|
|
| 77 | + Set<fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult> observationActivityConsolidateResults = consolidateObservationActivities(trip, failIfLengthWeightParameterNotFound, failIfLengthLengthParameterNotFound);
|
|
| 78 | + Set<fr.ird.observe.consolidation.data.ps.logbook.ActivityConsolidateResult> logbookActivityConsolidateResults = consolidateLogbookActivities(trip);
|
|
| 80 | 79 | |
| 81 | - if (activityConsolidateResults.isEmpty() && localmarketBatchResults.isEmpty()) {
|
|
| 80 | + if (observationActivityConsolidateResults.isEmpty() && localmarketBatchResults.isEmpty() && logbookActivityConsolidateResults.isEmpty()) {
|
|
| 82 | 81 | // no modification, nor warning on this trip
|
| 83 | 82 | return Optional.empty();
|
| 84 | 83 | }
|
| 85 | 84 | decoratorService.installDecorator(Trip.class, trip);
|
| 86 | 85 | String tripLabel = trip.toString();
|
| 87 | - TripConsolidateResult result = new TripConsolidateResult(tripId, tripLabel, activityConsolidateResults, localmarketBatchResults);
|
|
| 86 | + TripConsolidateResult result = new TripConsolidateResult(tripId, tripLabel, observationActivityConsolidateResults, logbookActivityConsolidateResults, localmarketBatchResults);
|
|
| 88 | 87 | if (result.withModifications()) {
|
| 89 | 88 | log.info(String.format("Found some modifications on trip: %s - %s", tripId, result.getTripLabel()));
|
| 90 | 89 | }
|
| ... | ... | @@ -123,18 +122,18 @@ public class TripConsolidateEngine { |
| 123 | 122 | return result;
|
| 124 | 123 | }
|
| 125 | 124 | |
| 126 | - private Set<ActivityConsolidateResult> consolidateObservationActivities(Trip trip, boolean failIfLengthWeightParameterNotFound, boolean failIfLengthLengthParameterNotFound) {
|
|
| 127 | - Set<ActivityConsolidateResult> result = new LinkedHashSet<>();
|
|
| 125 | + private Set<fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult> consolidateObservationActivities(Trip trip, boolean failIfLengthWeightParameterNotFound, boolean failIfLengthLengthParameterNotFound) {
|
|
| 126 | + Set<fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult> result = new LinkedHashSet<>();
|
|
| 128 | 127 | int routeIndex = 0;
|
| 129 | 128 | int routeMax = trip.getRouteObsSize();
|
| 130 | - Decorator routeDecorator = context.getDecoratorService().getDecoratorByType(Route.class);
|
|
| 131 | - for (Route route : trip.getRouteObs()) {
|
|
| 129 | + Decorator routeDecorator = context.getDecoratorService().getDecoratorByType(fr.ird.observe.entities.data.ps.observation.Route.class);
|
|
| 130 | + for (fr.ird.observe.entities.data.ps.observation.Route route : trip.getRouteObs()) {
|
|
| 132 | 131 | route.registerDecorator(routeDecorator);
|
| 133 | - String routePrefix = String.format("Route %s [%s/%s] ", route, ++routeIndex, routeMax);
|
|
| 132 | + String routePrefix = String.format("Observations - Route %s [%s/%s] ", route, ++routeIndex, routeMax);
|
|
| 134 | 133 | log.debug(String.format("%s Start consolidate route: %s", routePrefix, route.getTopiaId()));
|
| 135 | 134 | int activityIndex = 0;
|
| 136 | 135 | int activityMax = route.getActivitySize();
|
| 137 | - for (Activity activity : route.getActivity()) {
|
|
| 136 | + for (fr.ird.observe.entities.data.ps.observation.Activity activity : route.getActivity()) {
|
|
| 138 | 137 | |
| 139 | 138 | String activityPrefix = String.format("%s - Activity [%s/%s] ", routePrefix, ++activityIndex, activityMax);
|
| 140 | 139 | |
| ... | ... | @@ -142,12 +141,41 @@ public class TripConsolidateEngine { |
| 142 | 141 | log.debug(String.format("%s Skip activity (No set nor floating object found): %s", activityPrefix, activity.getTopiaId()));
|
| 143 | 142 | continue;
|
| 144 | 143 | }
|
| 145 | - Optional<ActivityConsolidateResult> activityResult = activityConsolidateEngine.consolidateActivity(trip,
|
|
| 146 | - route,
|
|
| 147 | - activity,
|
|
| 148 | - activityPrefix,
|
|
| 149 | - failIfLengthWeightParameterNotFound,
|
|
| 150 | - failIfLengthLengthParameterNotFound);
|
|
| 144 | + Optional<fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult> activityResult = observationActivityConsolidateEngine.consolidateActivity(trip,
|
|
| 145 | + route,
|
|
| 146 | + activity,
|
|
| 147 | + activityPrefix,
|
|
| 148 | + failIfLengthWeightParameterNotFound,
|
|
| 149 | + failIfLengthLengthParameterNotFound);
|
|
| 150 | + activityResult.ifPresent(result::add);
|
|
| 151 | + }
|
|
| 152 | + }
|
|
| 153 | + return result;
|
|
| 154 | + }
|
|
| 155 | + |
|
| 156 | + private Set<fr.ird.observe.consolidation.data.ps.logbook.ActivityConsolidateResult> consolidateLogbookActivities(Trip trip) {
|
|
| 157 | + Set<fr.ird.observe.consolidation.data.ps.logbook.ActivityConsolidateResult> result = new LinkedHashSet<>();
|
|
| 158 | + int routeIndex = 0;
|
|
| 159 | + int routeMax = trip.getRouteLogbookSize();
|
|
| 160 | + Decorator routeDecorator = context.getDecoratorService().getDecoratorByType(fr.ird.observe.entities.data.ps.logbook.Route.class);
|
|
| 161 | + for (fr.ird.observe.entities.data.ps.logbook.Route route : trip.getRouteLogbook()) {
|
|
| 162 | + route.registerDecorator(routeDecorator);
|
|
| 163 | + String routePrefix = String.format("Logbook - Route %s [%s/%s] ", route, ++routeIndex, routeMax);
|
|
| 164 | + log.debug(String.format("%s Start consolidate route: %s", routePrefix, route.getTopiaId()));
|
|
| 165 | + int activityIndex = 0;
|
|
| 166 | + int activityMax = route.getActivitySize();
|
|
| 167 | + for (fr.ird.observe.entities.data.ps.logbook.Activity activity : route.getActivity()) {
|
|
| 168 | + |
|
| 169 | + String activityPrefix = String.format("%s - Activity [%s/%s] ", routePrefix, ++activityIndex, activityMax);
|
|
| 170 | + |
|
| 171 | + if (activity.isFloatingObjectEmpty()) {
|
|
| 172 | + log.debug(String.format("%s Skip activity (No floating object found): %s", activityPrefix, activity.getTopiaId()));
|
|
| 173 | + continue;
|
|
| 174 | + }
|
|
| 175 | + Optional<fr.ird.observe.consolidation.data.ps.logbook.ActivityConsolidateResult> activityResult = logbookActivityConsolidateEngine.consolidateActivity(trip,
|
|
| 176 | + route,
|
|
| 177 | + activity,
|
|
| 178 | + activityPrefix);
|
|
| 151 | 179 | activityResult.ifPresent(result::add);
|
| 152 | 180 | }
|
| 153 | 181 | }
|
| 1 | +package fr.ird.observe.consolidation.data.ps.logbook;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Core :: Persistence :: Consolidation
|
|
| 6 | + * %%
|
|
| 7 | + * Copyright (C) 2008 - 2023 IRD, Ultreia.io
|
|
| 8 | + * %%
|
|
| 9 | + * This program is free software: you can redistribute it and/or modify
|
|
| 10 | + * it under the terms of the GNU General Public License as
|
|
| 11 | + * published by the Free Software Foundation, either version 3 of the
|
|
| 12 | + * License, or (at your option) any later version.
|
|
| 13 | + *
|
|
| 14 | + * This program is distributed in the hope that it will be useful,
|
|
| 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 | + * GNU General Public License for more details.
|
|
| 18 | + *
|
|
| 19 | + * You should have received a copy of the GNU General Public
|
|
| 20 | + * License along with this program. If not, see
|
|
| 21 | + * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 | + * #L%
|
|
| 23 | + */
|
|
| 24 | + |
|
| 25 | +import fr.ird.observe.decoration.DecoratorService;
|
|
| 26 | +import fr.ird.observe.dto.ToolkitIdModifications;
|
|
| 27 | +import fr.ird.observe.entities.ObserveTopiaDaoSupplier;
|
|
| 28 | +import fr.ird.observe.entities.data.ps.logbook.Activity;
|
|
| 29 | +import fr.ird.observe.spi.service.ServiceContext;
|
|
| 30 | + |
|
| 31 | +import java.util.Locale;
|
|
| 32 | +import java.util.Optional;
|
|
| 33 | + |
|
| 34 | +/**
|
|
| 35 | + * Created on 12/03/2023.
|
|
| 36 | + *
|
|
| 37 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 38 | + * @since 9.0.28
|
|
| 39 | + */
|
|
| 40 | +public class ActivityConsolidateContext {
|
|
| 41 | + public final Locale locale;
|
|
| 42 | + public final ObserveTopiaDaoSupplier daoSupplier;
|
|
| 43 | + public final DecoratorService decoratorService;
|
|
| 44 | + public final String activityPrefix;
|
|
| 45 | + public final ActivityConsolidateResultBuilder resultBuilder;
|
|
| 46 | + |
|
| 47 | + public ActivityConsolidateContext(ServiceContext context, Activity activity, String activityPrefix) {
|
|
| 48 | + this.activityPrefix = activityPrefix;
|
|
| 49 | + this.decoratorService = context.getDecoratorService();
|
|
| 50 | + this.locale = context.getApplicationLocale();
|
|
| 51 | + this.daoSupplier = (ObserveTopiaDaoSupplier) context.getTopiaPersistenceContext();
|
|
| 52 | + this.resultBuilder = new ActivityConsolidateResultBuilder(activity.getTopiaId(), activity.toString());
|
|
| 53 | + }
|
|
| 54 | + |
|
| 55 | + public void flushFloatingObject(ToolkitIdModifications modifications) {
|
|
| 56 | + resultBuilder.flushFloatingObjectModification(modifications);
|
|
| 57 | + }
|
|
| 58 | + |
|
| 59 | + public Optional<ActivityConsolidateResult> buildResult() {
|
|
| 60 | + return resultBuilder.build();
|
|
| 61 | + }
|
|
| 62 | + |
|
| 63 | +} |
| 1 | +package fr.ird.observe.consolidation.data.ps.logbook;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Core :: Persistence :: Consolidation
|
|
| 6 | + * %%
|
|
| 7 | + * Copyright (C) 2008 - 2023 IRD, Ultreia.io
|
|
| 8 | + * %%
|
|
| 9 | + * This program is free software: you can redistribute it and/or modify
|
|
| 10 | + * it under the terms of the GNU General Public License as
|
|
| 11 | + * published by the Free Software Foundation, either version 3 of the
|
|
| 12 | + * License, or (at your option) any later version.
|
|
| 13 | + *
|
|
| 14 | + * This program is distributed in the hope that it will be useful,
|
|
| 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 | + * GNU General Public License for more details.
|
|
| 18 | + *
|
|
| 19 | + * You should have received a copy of the GNU General Public
|
|
| 20 | + * License along with this program. If not, see
|
|
| 21 | + * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 | + * #L%
|
|
| 23 | + */
|
|
| 24 | + |
|
| 25 | +import fr.ird.observe.consolidation.data.ps.dcp.SimplifiedObjectTypeManager;
|
|
| 26 | +import fr.ird.observe.dto.ToolkitIdModifications;
|
|
| 27 | +import fr.ird.observe.dto.data.ActivityAware;
|
|
| 28 | +import fr.ird.observe.dto.data.ps.logbook.FloatingObjectDto;
|
|
| 29 | +import fr.ird.observe.dto.data.ps.logbook.FloatingObjectPartDto;
|
|
| 30 | +import fr.ird.observe.dto.referential.ReferentialLocale;
|
|
| 31 | +import fr.ird.observe.entities.data.ps.common.Trip;
|
|
| 32 | +import fr.ird.observe.entities.data.ps.logbook.Activity;
|
|
| 33 | +import fr.ird.observe.entities.data.ps.logbook.FloatingObject;
|
|
| 34 | +import fr.ird.observe.entities.data.ps.logbook.FloatingObjectPart;
|
|
| 35 | +import fr.ird.observe.entities.data.ps.logbook.Route;
|
|
| 36 | +import fr.ird.observe.spi.service.ServiceContext;
|
|
| 37 | +import io.ultreia.java4all.decoration.Decorator;
|
|
| 38 | +import io.ultreia.java4all.util.Dates;
|
|
| 39 | +import org.apache.logging.log4j.LogManager;
|
|
| 40 | +import org.apache.logging.log4j.Logger;
|
|
| 41 | + |
|
| 42 | +import java.util.LinkedHashSet;
|
|
| 43 | +import java.util.Optional;
|
|
| 44 | + |
|
| 45 | +/**
|
|
| 46 | + * Created on 12/03/2023.
|
|
| 47 | + *
|
|
| 48 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 49 | + * @since 9.0.28
|
|
| 50 | + */
|
|
| 51 | +public class ActivityConsolidateEngine {
|
|
| 52 | + private static final Logger log = LogManager.getLogger(ActivityConsolidateEngine.class);
|
|
| 53 | + private final ServiceContext context;
|
|
| 54 | + private final FloatingObjectConsolidateEngine floatingObjectConsolidateEngine;
|
|
| 55 | + private final Decorator activityDecorator;
|
|
| 56 | + |
|
| 57 | + public ActivityConsolidateEngine(ServiceContext context, SimplifiedObjectTypeManager simplifiedObjectTypeManager) {
|
|
| 58 | + this.context = context;
|
|
| 59 | + this.floatingObjectConsolidateEngine = new FloatingObjectConsolidateEngine(simplifiedObjectTypeManager, context.getDecoratorService());
|
|
| 60 | + this.activityDecorator = context.getDecoratorService().getDecoratorByType(Activity.class, ActivityAware.CLASSIFIER_WITH_ROUTE);
|
|
| 61 | + }
|
|
| 62 | + |
|
| 63 | + public Optional<ActivityConsolidateResult> consolidateActivity(Trip trip,
|
|
| 64 | + Route route,
|
|
| 65 | + Activity activity,
|
|
| 66 | + String activityPrefix) {
|
|
| 67 | + if (activity.isFloatingObjectEmpty()) {
|
|
| 68 | + log.debug(String.format("%s Skip activity (No floating object found): %s", activityPrefix, activity.getTopiaId()));
|
|
| 69 | + return Optional.empty();
|
|
| 70 | + }
|
|
| 71 | + activity.setTime(Dates.getDateAndTime(route.getDate(), activity.getTime(), true, true));
|
|
| 72 | + activity.registerDecorator(activityDecorator);
|
|
| 73 | + |
|
| 74 | + ActivityConsolidateContext activityContext = new ActivityConsolidateContext(context,
|
|
| 75 | + activity,
|
|
| 76 | + activityPrefix);
|
|
| 77 | + try {
|
|
| 78 | + log.debug(String.format("%s Start consolidate activity: %s", activityContext.activityPrefix, activity.getTopiaId()));
|
|
| 79 | + if (activity.isFloatingObjectNotEmpty()) {
|
|
| 80 | + for (FloatingObject floatingObject : activity.getFloatingObject()) {
|
|
| 81 | + consolidateFloatingObject(activityContext, floatingObject);
|
|
| 82 | + }
|
|
| 83 | + }
|
|
| 84 | + Optional<ActivityConsolidateResult> result = activityContext.buildResult();
|
|
| 85 | + result.ifPresent(r -> {
|
|
| 86 | + if (r.withModifications()) {
|
|
| 87 | + log.info(String.format("%s Found some modifications on activity: %s - %s", activityPrefix, activity.getTopiaId(), r.getActivityLabel()));
|
|
| 88 | + }
|
|
| 89 | + if (r.withWarnings()) {
|
|
| 90 | + log.info(String.format("%s Found some warnings on activity: %s - %s", activityPrefix, activity.getTopiaId(), r.getActivityLabel()));
|
|
| 91 | + }
|
|
| 92 | + });
|
|
| 93 | + return result;
|
|
| 94 | + } catch (Exception e) {
|
|
| 95 | + log.error(String.format("%s Could not consolidate trip: %s, route: %s - activity: %s", activityPrefix, trip.getTopiaId(), route.getTopiaId(), activity.getTopiaId()), e);
|
|
| 96 | + throw e;
|
|
| 97 | + }
|
|
| 98 | + }
|
|
| 99 | + |
|
| 100 | + private void consolidateFloatingObject(ActivityConsolidateContext activityContext, FloatingObject floatingObject) {
|
|
| 101 | + |
|
| 102 | + if (floatingObject.getObjectOperation() == null) {
|
|
| 103 | + log.warn("**********************");
|
|
| 104 | + log.warn(String.format("Floating object %s has no object operation....", floatingObject.getTopiaId()));
|
|
| 105 | + log.warn("**********************");
|
|
| 106 | + return;
|
|
| 107 | + }
|
|
| 108 | + |
|
| 109 | + ReferentialLocale referentialLocale = context.getReferentialLocale();
|
|
| 110 | + |
|
| 111 | + FloatingObjectDto floatingObjectDto = FloatingObject.toDto(referentialLocale, floatingObject);
|
|
| 112 | + |
|
| 113 | + java.util.Set<FloatingObjectPartDto> floatingObjectPartSet = new LinkedHashSet<>(FloatingObjectPart.SPI.toDataDtoList(referentialLocale, floatingObject.getFloatingObjectPart()));
|
|
| 114 | + FloatingObjectConsolidateRequest request = new FloatingObjectConsolidateRequest(floatingObjectDto, floatingObjectPartSet);
|
|
| 115 | + Optional<ToolkitIdModifications> result = floatingObjectConsolidateEngine.consolidate(request);
|
|
| 116 | + |
|
| 117 | + result.ifPresent(r -> {
|
|
| 118 | + // flush to main result
|
|
| 119 | + activityContext.flushFloatingObject(r);
|
|
| 120 | + // flush back modifications detected to entity
|
|
| 121 | + r.flushToBean(floatingObject);
|
|
| 122 | + });
|
|
| 123 | + |
|
| 124 | + if (request.isNeedClean()) {
|
|
| 125 | + log.warn("**********************");
|
|
| 126 | + log.warn(String.format("Floating object %s has some bad parts, this will be fixed here....", floatingObject.getTopiaId()));
|
|
| 127 | + log.warn("**********************");
|
|
| 128 | + // Need to clean dcp parts
|
|
| 129 | + boolean notWhenArriving = !floatingObject.getObjectOperation().isWhenArriving();
|
|
| 130 | + boolean notWhenLeaving = !floatingObject.getObjectOperation().isWhenLeaving();
|
|
| 131 | + for (FloatingObjectPart floatingObjectPart : floatingObject.getFloatingObjectPart()) {
|
|
| 132 | + if (floatingObjectPart.getWhenArriving() != null && notWhenArriving) {
|
|
| 133 | + log.info(String.format("Set whenArriving to null for part: %s", floatingObjectPart.getTopiaId()));
|
|
| 134 | + floatingObjectPart.setWhenArriving(null);
|
|
| 135 | + }
|
|
| 136 | + if (floatingObjectPart.getWhenLeaving() != null && notWhenLeaving) {
|
|
| 137 | + log.info(String.format("Set whenLeaving to null for part: %s", floatingObjectPart.getTopiaId()));
|
|
| 138 | + floatingObjectPart.setWhenLeaving(null);
|
|
| 139 | + }
|
|
| 140 | + }
|
|
| 141 | + }
|
|
| 142 | + }
|
|
| 143 | + |
|
| 144 | +} |
| ... | ... | @@ -28,7 +28,6 @@ import fr.ird.observe.consolidation.data.ps.common.TripConsolidateResult; |
| 28 | 28 | import fr.ird.observe.consolidation.data.ps.dcp.SimplifiedObjectTypeManager;
|
| 29 | 29 | import fr.ird.observe.consolidation.data.ps.dcp.SimplifiedObjectTypeSpecializedRules;
|
| 30 | 30 | import fr.ird.observe.consolidation.data.ps.localmarket.BatchConsolidateRequest;
|
| 31 | -import fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult;
|
|
| 32 | 31 | import fr.ird.observe.decoration.DecoratorService;
|
| 33 | 32 | import fr.ird.observe.dto.ToolkitIdModifications;
|
| 34 | 33 | import fr.ird.observe.dto.data.ps.localmarket.BatchDto;
|
| ... | ... | @@ -210,9 +209,11 @@ public class ConsolidateDataServiceFixtures extends GeneratedConsolidateDataServ |
| 210 | 209 | TripConsolidateResult actual = service.consolidateTrip(simplifiedObjectTypeSpecializedRules, request);
|
| 211 | 210 | Assert.assertNotNull(actual);
|
| 212 | 211 | Assert.assertNotNull(actual.getActivityObservationResults());
|
| 212 | + Assert.assertNotNull(actual.getActivityLogbookResults());
|
|
| 213 | + Assert.assertEquals(0, actual.getActivityLogbookResults().size());
|
|
| 213 | 214 | Assert.assertEquals(getIntegerProperty("consolidateTrip.activityResult.count"), actual.getActivityObservationResults().size());
|
| 214 | - Assert.assertEquals(getIntegerProperty("consolidateTrip.activityResult.withModifications.count"), actual.getActivityObservationResults().stream().filter(ActivityConsolidateResult::withModifications).count());
|
|
| 215 | - Assert.assertEquals(getIntegerProperty("consolidateTrip.activityResult.withWarnings.count"), actual.getActivityObservationResults().stream().filter(ActivityConsolidateResult::withWarnings).count());
|
|
| 215 | + Assert.assertEquals(getIntegerProperty("consolidateTrip.activityResult.withModifications.count"), actual.getActivityObservationResults().stream().filter(fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult::withModifications).count());
|
|
| 216 | + Assert.assertEquals(getIntegerProperty("consolidateTrip.activityResult.withWarnings.count"), actual.getActivityObservationResults().stream().filter(fr.ird.observe.consolidation.data.ps.observation.ActivityConsolidateResult::withWarnings).count());
|
|
| 216 | 217 | }
|
| 217 | 218 | |
| 218 | 219 | } |
| ... | ... | @@ -1244,7 +1244,8 @@ |
| 1244 | 1244 | </reportSet>
|
| 1245 | 1245 | </reportSets>
|
| 1246 | 1246 | </plugin>
|
| 1247 | - <plugin>
|
|
| 1247 | + <!-- FIXME Need some work before javadoc is fine-->
|
|
| 1248 | + <!--plugin>
|
|
| 1248 | 1249 | <groupId>org.apache.maven.plugins</groupId>
|
| 1249 | 1250 | <artifactId>maven-javadoc-plugin</artifactId>
|
| 1250 | 1251 | <version>${plugin.version.javadoc}</version>
|
| ... | ... | @@ -1256,7 +1257,7 @@ |
| 1256 | 1257 | </reports>
|
| 1257 | 1258 | </reportSet>
|
| 1258 | 1259 | </reportSets>
|
| 1259 | - </plugin>
|
|
| 1260 | + </plugin-->
|
|
| 1260 | 1261 | <plugin>
|
| 1261 | 1262 | <groupId>org.apache.maven.plugins</groupId>
|
| 1262 | 1263 | <artifactId>maven-jxr-plugin</artifactId>
|
| 1 | +# Consolidation
|
|
| 2 | + |
|
| 3 | +Ce document décrit les règles de calcul utilisées lors de l'opération de consolidation.
|
|
| 4 | + |
|
| 5 | +## Modèle commun
|
|
| 6 | + |
|
| 7 | +Pour le moment aucune consolidation n'est effectiée sur ce modèle.
|
|
| 8 | + |
|
| 9 | +## Modèle Palangre
|
|
| 10 | + |
|
| 11 | +Pour le moment aucune consolidation n'est effectiée sur ce modèle.
|
|
| 12 | + |
|
| 13 | +## Modèle Senne
|
|
| 14 | + |
|
| 15 | +### Paquetage Commun
|
|
| 16 | + |
|
| 17 | +Pour le moment aucune consolidation n'est effectiée sur ce paquetage.
|
|
| 18 | + |
|
| 19 | +### Paquetage Livre de Bord
|
|
| 20 | + |
|
| 21 | +#### Entité Objet flottant (ps.logbook.FloatingObject)
|
|
| 22 | + |
|
| 23 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/logbook/FloatingObjectConsolidateActions.html#FloatingObjectConsolidateActions)
|
|
| 24 | + |
|
| 25 | +| Code | Champs |
|
|
| 26 | +|:----------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------|
|
|
| 27 | +| ps.logbook.FloatingObjectConsolidateActions.CleanComputedValuesWhenArriving | computedWhenArrivingBiodegradable <br/>computedWhenArrivingNonEntangling<br/>computedWhenArrivingSimplifiedObjectType |
|
|
| 28 | + |
|
| 29 | +Si l'objet flottant n'est pas actif sur l'arrivée, alors supprimer toutes les données calculées sur l'arrivée.
|
|
| 30 | + |
|
| 31 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/dcp/CleanComputedValuesAction.html)
|
|
| 32 | + |
|
| 33 | +| Code | Champs |
|
|
| 34 | +|:---------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------|
|
|
| 35 | +| ps.logbook.FloatingObjectConsolidateActions.CleanComputedValuesWhenLeaving | computedWhenLeavingBiodegradable<br/>computedWhenLeavingNonEntangling<br/>computedWhenLeavingSimplifiedObjectType |
|
|
| 36 | + |
|
| 37 | +Si l'objet flottant n'est pas actif sur le départ, alors supprimer toutes les données calculées sur le départ.
|
|
| 38 | + |
|
| 39 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/dcp/CleanComputedValuesAction.html)
|
|
| 40 | + |
|
| 41 | +| Code | Champs |
|
|
| 42 | +|:-----------------------------------------------------------------------------|:----------------------------------|
|
|
| 43 | +| ps.logbook.FloatingObjectConsolidateActions.ComputeBiodegradableWhenArriving | computedWhenArrivingBiodegradable |
|
|
| 44 | + |
|
| 45 | +Calcul de la propriété **computedWhenArrivingBiodegradable** à partir des matériaux sur l'arrivée.
|
|
| 46 | + |
|
| 47 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/dcp/ComputeBiodegradableConsolidateAction.html)
|
|
| 48 | + |
|
| 49 | +| Code | Champs |
|
|
| 50 | +|:----------------------------------------------------------------------------|:---------------------------------|
|
|
| 51 | +| ps.logbook.FloatingObjectConsolidateActions.ComputeBiodegradableWhenLeaving | computedWhenLeavingBiodegradable |
|
|
| 52 | + |
|
| 53 | +Calcul de la propriété **computedWhenLeavingBiodegradable** à partir des matériaux sur le départ.
|
|
| 54 | + |
|
| 55 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/dcp/ComputeBiodegradableConsolidateAction.html)
|
|
| 56 | + |
|
| 57 | +| Code | Champs |
|
|
| 58 | +|:-----------------------------------------------------------------------------|:----------------------------------|
|
|
| 59 | +| ps.logbook.FloatingObjectConsolidateActions.ComputeNonEntanglingWhenArriving | computedWhenArrivingNonEntangling |
|
|
| 60 | + |
|
| 61 | +Calcul de la propriété **computedWhenArrivingNonEntangling** à partir des matériaux sur l'arrivée.
|
|
| 62 | + |
|
| 63 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/dcp/ComputeNonEntanglingConsolidateAction.html)
|
|
| 64 | + |
|
| 65 | +| Code | Champs |
|
|
| 66 | +|:----------------------------------------------------------------------------|:---------------------------------|
|
|
| 67 | +| ps.logbook.FloatingObjectConsolidateActions.ComputeNonEntanglingWhenLeaving | computedWhenLeavingNonEntangling |
|
|
| 68 | + |
|
| 69 | +Calcul de la propriété **computedWhenLeavingNonEntangling** à partir des matériaux sur le départ.
|
|
| 70 | + |
|
| 71 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/dcp/ComputeNonEntanglingConsolidateAction.html)
|
|
| 72 | + |
|
| 73 | +| Code | Champs |
|
|
| 74 | +|:------------------------------------------------------------------------------------|:-----------------------------------------|
|
|
| 75 | +| ps.logbook.FloatingObjectConsolidateActions.ComputeSimplifiedObjectTypeWhenArriving | computedWhenArrivingSimplifiedObjectType |
|
|
| 76 | + |
|
| 77 | +Calcul de la propriété **computedWhenArrivingSimplifiedObjectType** à partir des matériaux sur l'arrivée.
|
|
| 78 | + |
|
| 79 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/dcp/ComputeSimplifiedObjectTypeConsolidateAction.html)
|
|
| 80 | + |
|
| 81 | +| Code | Champs |
|
|
| 82 | +|:-----------------------------------------------------------------------------------|:----------------------------------------|
|
|
| 83 | +| ps.logbook.FloatingObjectConsolidateActions.ComputeSimplifiedObjectTypeWhenLeaving | computedWhenLeavingSimplifiedObjectType |
|
|
| 84 | + |
|
| 85 | +Calcul de la propriété **computedWhenLeavingSimplifiedObjectType** à partir des matériaux sur le départ.
|
|
| 86 | + |
|
| 87 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/dcp/ComputeSimplifiedObjectTypeConsolidateAction.html)
|
|
| 88 | + |
|
| 89 | +### Paquetage Observations
|
|
| 90 | + |
|
| 91 | +#### Entité Calée (ps.observation.Set)
|
|
| 92 | + |
|
| 93 | +[Code source](./core/core-persistence/core-persistence-consolidation/xref/fr/ird/observe/consolidation/data/ps/observation/SetConsolidateActions.html#SetConsolidateActions)
|
|
| 94 | + |
|
| 95 | +| Code | Champs |
|
|
| 96 | +|:-------------------------------------------------------|:-----------|
|
|
| 97 | +| ps.observation.SetConsolidateActions.ComputeSchoolType | SchoolType |
|
|
| 98 | + |
|
| 99 | +Calcul du type de banc à partir des systèmes observés de l'activité.
|
|
| 100 | + |
|
| 101 | +#### Entité Objet flottant (ps.observation.FloatingObject)
|
|
| 102 | + |
|
| 103 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/observation/FloatingObjectConsolidateActions.html#FloatingObjectConsolidateActions)
|
|
| 104 | + |
|
| 105 | +| Code | Champs |
|
|
| 106 | +|:--------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------|
|
|
| 107 | +| ps.observation.FloatingObjectConsolidateActions.CleanComputedValuesWhenArriving | computedWhenArrivingBiodegradable <br/>computedWhenArrivingNonEntangling<br/>computedWhenArrivingSimplifiedObjectType |
|
|
| 108 | + |
|
| 109 | +Si l'objet flottant n'est pas actif sur l'arrivée, alors supprimer toutes les données calculées sur l'arrivée.
|
|
| 110 | + |
|
| 111 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/dcp/CleanComputedValuesAction.html)
|
|
| 112 | + |
|
| 113 | +| Code | Champs |
|
|
| 114 | +|:-------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------|
|
|
| 115 | +| ps.observation.FloatingObjectConsolidateActions.CleanComputedValuesWhenLeaving | computedWhenLeavingBiodegradable<br/>computedWhenLeavingNonEntangling<br/>computedWhenLeavingSimplifiedObjectType |
|
|
| 116 | + |
|
| 117 | +Si l'objet flottant n'est pas actif sur le départ, alors supprimer toutes les données calculées sur le départ.
|
|
| 118 | + |
|
| 119 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/dcp/CleanComputedValuesAction.html)
|
|
| 120 | + |
|
| 121 | +| Code | Champs |
|
|
| 122 | +|:---------------------------------------------------------------------------------|:----------------------------------|
|
|
| 123 | +| ps.observation.FloatingObjectConsolidateActions.ComputeBiodegradableWhenArriving | computedWhenArrivingBiodegradable |
|
|
| 124 | + |
|
| 125 | +Calcul de la propriété **computedWhenArrivingBiodegradable** à partir des matériaux sur l'arrivée.
|
|
| 126 | + |
|
| 127 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/dcp/ComputeBiodegradableConsolidateAction.html)
|
|
| 128 | + |
|
| 129 | +| Code | Champs |
|
|
| 130 | +|:--------------------------------------------------------------------------------|:---------------------------------|
|
|
| 131 | +| ps.observation.FloatingObjectConsolidateActions.ComputeBiodegradableWhenLeaving | computedWhenLeavingBiodegradable |
|
|
| 132 | + |
|
| 133 | +Calcul de la propriété **computedWhenLeavingBiodegradable** à partir des matériaux sur le départ.
|
|
| 134 | + |
|
| 135 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/dcp/ComputeBiodegradableConsolidateAction.html)
|
|
| 136 | + |
|
| 137 | +| Code | Champs |
|
|
| 138 | +|:---------------------------------------------------------------------------------|:----------------------------------|
|
|
| 139 | +| ps.observation.FloatingObjectConsolidateActions.ComputeNonEntanglingWhenArriving | computedWhenArrivingNonEntangling |
|
|
| 140 | + |
|
| 141 | +Calcul de la propriété **computedWhenArrivingNonEntangling** à partir des matériaux sur l'arrivée.
|
|
| 142 | + |
|
| 143 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/dcp/ComputeNonEntanglingConsolidateAction.html)
|
|
| 144 | + |
|
| 145 | +| Code | Champs |
|
|
| 146 | +|:--------------------------------------------------------------------------------|:---------------------------------|
|
|
| 147 | +| ps.observation.FloatingObjectConsolidateActions.ComputeNonEntanglingWhenLeaving | computedWhenLeavingNonEntangling |
|
|
| 148 | + |
|
| 149 | +Calcul de la propriété **computedWhenLeavingNonEntangling** à partir des matériaux sur le départ.
|
|
| 150 | + |
|
| 151 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/dcp/ComputeNonEntanglingConsolidateAction.html)
|
|
| 152 | + |
|
| 153 | +| Code | Champs |
|
|
| 154 | +|:----------------------------------------------------------------------------------------|:-----------------------------------------|
|
|
| 155 | +| ps.observation.FloatingObjectConsolidateActions.ComputeSimplifiedObjectTypeWhenArriving | computedWhenArrivingSimplifiedObjectType |
|
|
| 156 | + |
|
| 157 | +Calcul de la propriété **computedWhenArrivingSimplifiedObjectType** à partir des matériaux sur l'arrivée.
|
|
| 158 | + |
|
| 159 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/dcp/ComputeSimplifiedObjectTypeConsolidateAction.html)
|
|
| 160 | + |
|
| 161 | +| Code | Champs |
|
|
| 162 | +|:---------------------------------------------------------------------------------------|:----------------------------------------|
|
|
| 163 | +| ps.observation.FloatingObjectConsolidateActions.ComputeSimplifiedObjectTypeWhenLeaving | computedWhenLeavingSimplifiedObjectType |
|
|
| 164 | + |
|
| 165 | +Calcul de la propriété **computedWhenLeavingSimplifiedObjectType** à partir des matériaux sur le départ.
|
|
| 166 | + |
|
| 167 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/dcp/ComputeSimplifiedObjectTypeConsolidateAction.html)
|
|
| 168 | + |
|
| 169 | +#### Entité Capture (ps.observation.Catch)
|
|
| 170 | + |
|
| 171 | +[Code source](./core/core-persistence/core-persistence-consolidation/xref/fr/ird/observe/consolidation/data/ps/observation/CatchConsolidateActions.html#CatchConsolidateActions)
|
|
| 172 | + |
|
| 173 | +| Code | Champs |
|
|
| 174 | +|:-----------------------------------------------------------------------|:----------------------------------------|
|
|
| 175 | +| ps.observation.CatchConsolidateActions.ComputeMeanLengthFromMeanWeight | meanLength<br/>meanLengthComputedSource |
|
|
| 176 | + |
|
| 177 | +Pour calculer la taille moyenne de la capture à partir du poids moyen de la capture et du RTP adéquate.
|
|
| 178 | + |
|
| 179 | +La propriété calculée sera *CatchComputedValueSource.fromData*.
|
|
| 180 | + |
|
| 181 | +| Code | Champs |
|
|
| 182 | +|:-----------------------------------------------------------------------|:----------------------------------------|
|
|
| 183 | +| ps.observation.CatchConsolidateActions.ComputeMeanWeightFromMeanLength | meanWeight<br/>meanWeightComputedSource |
|
|
| 184 | + |
|
| 185 | +Pour calculer le poids moyen de la capture à partir de la taille moyenne de la capture et du RTP adéquate.
|
|
| 186 | + |
|
| 187 | +La propriété calculée sera *CatchComputedValueSource.fromData*.
|
|
| 188 | + |
|
| 189 | +| Code | Champs |
|
|
| 190 | +|:-------------------------------------------------------------------------------------|:------------------------------------------|
|
|
| 191 | +| ps.observation.CatchConsolidateActions.ComputeCatchWeightFromTotalCountAndMeanWeight | catchWeight<br/>catchWeightComputedSource |
|
|
| 192 | + |
|
| 193 | +Pour calculer le poids total de la capture à partir du poids moyen et de l'effectif de la capture.
|
|
| 194 | + |
|
| 195 | +La propriété calculée sera *CatchComputedValueSource.fromData*.
|
|
| 196 | + |
|
| 197 | +| Code | Champs |
|
|
| 198 | +|:-------------------------------------------------------------------------------------|:----------------------------------------|
|
|
| 199 | +| ps.observation.CatchConsolidateActions.ComputeTotalCountFromCatchWeightAndMeanWeight | totalCount<br/>totalCountComputedSource |
|
|
| 200 | + |
|
| 201 | +Pour calculer l'effectif de la capture à partir du poids total et moyen de la capture.
|
|
| 202 | + |
|
| 203 | +La propriété calculée sera *CatchComputedValueSource.fromData*.
|
|
| 204 | + |
|
| 205 | +| Code | Champs |
|
|
| 206 | +|:-------------------------------------------------------------------------------------|:----------------------------------------|
|
|
| 207 | +| ps.observation.CatchConsolidateActions.ComputeMeanWeightFromTotalCountAndCatchWeight | meanWeight<br/>meanWeightComputedSource |
|
|
| 208 | + |
|
| 209 | +Pour calculer la taille moyenne à partir du poids total et de l'effectif de la capture.
|
|
| 210 | + |
|
| 211 | +La propriété calculée sera *CatchComputedValueSource.fromData*.
|
|
| 212 | + |
|
| 213 | +| Code | Champs |
|
|
| 214 | +|:-------------------------------------------------------------------|:----------------------------------------|
|
|
| 215 | +| ps.observation.CatchConsolidateActions.CopyMeanLengthFromParameter | meanLength<br/>meanLengthComputedSource |
|
|
| 216 | + |
|
| 217 | +Pour recopier la taille moyenne du RTP adéquate.
|
|
| 218 | + |
|
| 219 | +La propriété calculée sera *CatchComputedValueSource.fromReferentiel*.
|
|
| 220 | + |
|
| 221 | +| Code | Champs |
|
|
| 222 | +|:-------------------------------------------------------------------|:----------------------------------------|
|
|
| 223 | +| ps.observation.CatchConsolidateActions.CopyMeanWeightFromParameter | meanWeight<br/>meanWeightComputedSource |
|
|
| 224 | + |
|
| 225 | +Pour recopier le poids moyen du RTP adéquate.
|
|
| 226 | + |
|
| 227 | +La propriété calculée sera *CatchComputedValueSource.fromReferentiel*.
|
|
| 228 | + |
|
| 229 | +| Code | Champs |
|
|
| 230 | +|:--------------------------------------------------------------------|:----------------------------------------|
|
|
| 231 | +| ps.observation.CatchConsolidateActions.ComputeMeanLengthFromSamples | meanLength<br/>meanLengthComputedSource |
|
|
| 232 | + |
|
| 233 | +Pour calculer la taille moyenne à partir des tailles moyennes des échantillons associés.
|
|
| 234 | + |
|
| 235 | +La propriété calculée sera *CatchComputedValueSource.fromSample*.
|
|
| 236 | + |
|
| 237 | +| Code | Champs |
|
|
| 238 | +|:--------------------------------------------------------------------|:----------------------------------------|
|
|
| 239 | +| ps.observation.CatchConsolidateActions.ComputeTotalCountFromSamples | totalCount<br/>totalCountComputedSource |
|
|
| 240 | + |
|
| 241 | +Pour calculer l'effectif de la capture à partir des effectifs des échantillons associés.
|
|
| 242 | + |
|
| 243 | +La propriété calculée sera *CatchComputedValueSource.fromSample*.
|
|
| 244 | + |
|
| 245 | +| Code | Champs |
|
|
| 246 | +|:---------------------------------------------------------------------|:--------------------|
|
|
| 247 | +| ps.observation.CatchConsolidateActions.CleanCatchWeightMeasureMethod | weightMeasureMethod |
|
|
| 248 | + |
|
| 249 | +Pour supprimer la méthode de mesure de poids si le poids a été calculé ou qu'il n'y a pas de poids.
|
|
| 250 | + |
|
| 251 | +#### Entité Échantillon (ps.observation.SampleMeasure)
|
|
| 252 | + |
|
| 253 | +[Code source](./core/core-persistence/core-persistence-consolidation/xref/fr/ird/observe/consolidation/data/ps/observation/SampleMeasureConsolidateActions.html#SampleMeasureConsolidateActions)
|
|
| 254 | + |
|
| 255 | +| Code | Champs |
|
|
| 256 | +|:-----------------------------------------------------------------------|:----------------------------|
|
|
| 257 | +| ps.observation.SampleMeasureConsolidateActions.ComputeLengthFromWeight | length<br/>isLengthComputed |
|
|
| 258 | + |
|
| 259 | +Calcul de la taille depuis le poids en utilisant la RTP adéquate.
|
|
| 260 | + |
|
| 261 | +| Code | Champs |
|
|
| 262 | +|:-----------------------------------------------------------------------|:----------------------------|
|
|
| 263 | +| ps.observation.SampleMeasureConsolidateActions.ComputeWeightFromLength | weight<br/>isWeightComputed |
|
|
| 264 | + |
|
| 265 | +Calcul du poids depuis la taille en utilisant la RTP adéquate.
|
|
| 266 | + |
|
| 267 | +### Paquetage Marché local
|
|
| 268 | + |
|
| 269 | +#### Entité Lot (ps.localmarket.Batch)
|
|
| 270 | + |
|
| 271 | +[Code source](./core/core-api/core-api-dto-consolidation/xref/fr/ird/observe/consolidation/data/ps/localmarket/BatchConsolidateActions.html#BatchConsolidateActions)
|
|
| 272 | + |
|
| 273 | +| Code | Champs |
|
|
| 274 | +|:--------------------------------------------------------------------------|:--------------------------------|
|
|
| 275 | +| ps.localmarket.BatchConsolidateActions.ComputeWeightFromSpeciesMeanWeight | weight<br/>weightComputedSource |
|
|
| 276 | + |
|
| 277 | +Si le conditionnement est de type **Espèce unité**, on calcule alors le poids à partir du poids moyen du
|
|
| 278 | +conditionnement (si celui est défini) et de l'effectif du lot.
|
|
| 279 | + |
|
| 280 | +La propriété calculée sera *BatchWeightComputedValueSource.fromSpeciesMeanWeight*.
|
|
| 281 | + |
|
| 282 | +| Code | Champs |
|
|
| 283 | +|:----------------------------------------------------------------------------|:--------------------------------|
|
|
| 284 | +| ps.localmarket.BatchConsolidateActions.ComputeWeightFromPackagingMeanWeight | weight<br/>weightComputedSource |
|
|
| 285 | + |
|
| 286 | +Si le conditionnement est de type **Conditionnement non pesé**, on calcule alors le poids à partir du poids moyen de
|
|
| 287 | +l'espèce de la RTP adéquate (si celle-ci est définie) et de l'effectif du lot.
|
|
| 288 | + |
|
| 289 | +La propriété calculée sera *BatchWeightComputedValueSource.fromPackagingMeanWeight*.
|
|
| 290 | + |
|
| 291 | +| Code | Champs |
|
|
| 292 | +|:---------------------------------------------------------|:--------------------------------|
|
|
| 293 | +| ps.localmarket.BatchConsolidateActions.ResetWeightValues | weight<br/>weightComputedSource |
|
|
| 294 | + |
|
| 295 | +Dans les autres cas, on supprime tout simplement le poids car on ne peut pas le calculer. |
|
| \ No newline at end of file |
| ... | ... | @@ -14,6 +14,7 @@ Le logiciel *ObServe*... **TODO** |
| 14 | 14 | - [Configuration client](./observe-client.html)
|
| 15 | 15 | - [Configuration server](./observe-server.html)
|
| 16 | 16 | - [Documentation de l'outil de reporting](./report/index.html)
|
| 17 | +- [Documentation de l'outil de consolidation](./consolidation.html)
|
|
| 17 | 18 | |
| 18 | 19 | |
| 19 | 20 |
| ... | ... | @@ -86,6 +86,7 @@ |
| 86 | 86 | <item name="Configuration (fichier d'exemple)" target="_blank" href="./observe-client.conf"/>
|
| 87 | 87 | <item name="Filtrage des référentiels" href="./referential-filter.html"/>
|
| 88 | 88 | <item name="Synchronisation référentiel avancée" href="./synchro-referential.html"/>
|
| 89 | + <item name="Consolidation des données" href="./consolidation.html"/>
|
|
| 89 | 90 | <item name="Outil de reporting" href="./report/index.html">
|
| 90 | 91 | <item name="Syntaxe d'un rapport" href="./report/syntax.html"/>
|
| 91 | 92 | <item name="Opérations disponibles pour un rapport" href="./report/embedded-operations.html"/>
|