Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe
Commits:
-
4fcb9612
by Tony Chemit at 2022-11-13T15:28:50+01:00
-
ec5fe21b
by Tony Chemit at 2022-11-13T15:28:50+01:00
-
0ae68cbf
by Tony Chemit at 2022-11-13T15:28:50+01:00
-
18be9c7c
by Tony Chemit at 2022-11-13T15:28:50+01:00
-
eadf39d0
by Tony Chemit at 2022-11-13T16:05:04+01:00
-
6cc3444c
by Tony Chemit at 2022-11-14T07:34:11+01:00
-
6a3376f9
by Tony Chemit at 2022-11-14T13:21:55+01:00
-
6534f2a5
by Tony Chemit at 2022-11-14T13:22:16+01:00
-
c81cfbc3
by Tony Chemit at 2022-11-14T13:22:16+01:00
-
63946e03
by Tony Chemit at 2022-11-14T13:22:16+01:00
-
4ae9268b
by Tony Chemit at 2022-11-14T13:22:16+01:00
-
29db74f1
by Tony Chemit at 2022-11-14T13:22:16+01:00
17 changed files:
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/report/ReportModel.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/report/ResultTableModel.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/table/actions/entry/ResetEntry.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/SampleUIHandler.java
- core/api/dto/src/main/resources/observe-reports.properties
- + core/persistence/java/src/main/java/fr/ird/observe/spi/report/ComputePsObservationLengthsDistribution.java
- core/services/test/src/main/java/fr/ird/observe/services/service/ReportFixture.java
- core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationAccessoryCatchByGroupReportFixture.java → core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchByGroupReportFixture.java
- core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationAccessoryCatchReportFixture.java → core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchReportFixture.java
- core/services/local/src/test/java/fr/ird/observe/services/local/service/ReportServiceLocalReadTest.java → core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationLengthsDistributionReportFixture.java
- core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationAccessoryCatch.properties → core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatch.properties
- core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationAccessoryCatchByGroup.properties → core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchByGroup.properties
- + core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationLengthsDistribution.properties
- core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationTargetCatchByAssociation.properties
- core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationTargetDiscardedByAssociation.properties
- toolkit/api/src/main/java/fr/ird/observe/dto/report/DataMatrix.java
- toolkit/api/src/main/java/fr/ird/observe/dto/report/ReportBuilder.java
Changes:
| ... | ... | @@ -43,10 +43,10 @@ import java.net.URL; |
| 43 | 43 | import java.nio.file.Files;
|
| 44 | 44 | import java.util.Collections;
|
| 45 | 45 | import java.util.Date;
|
| 46 | +import java.util.LinkedHashMap;
|
|
| 46 | 47 | import java.util.List;
|
| 47 | 48 | import java.util.Map;
|
| 48 | 49 | import java.util.Objects;
|
| 49 | -import java.util.TreeMap;
|
|
| 50 | 50 | import java.util.stream.Collectors;
|
| 51 | 51 | |
| 52 | 52 | /**
|
| ... | ... | @@ -81,7 +81,7 @@ public class ReportModel extends AdminActionModel { |
| 81 | 81 | /**
|
| 82 | 82 | * les variables utilisées pour le report.
|
| 83 | 83 | */
|
| 84 | - protected final Map<String, Object> variables;
|
|
| 84 | + protected final Map<String, Object> variables = new LinkedHashMap<>();
|
|
| 85 | 85 | /**
|
| 86 | 86 | * la fichier contenant la définition des reports.
|
| 87 | 87 | */
|
| ... | ... | @@ -128,7 +128,6 @@ public class ReportModel extends AdminActionModel { |
| 128 | 128 | |
| 129 | 129 | public ReportModel() {
|
| 130 | 130 | super(AdminStep.REPORT);
|
| 131 | - variables = new TreeMap<>();
|
|
| 132 | 131 | // quand le type de modèle change, on mets à jour les rapports disponibles
|
| 133 | 132 | addPropertyChangeListener(REPORT_FILE_PROPERTY_NAME, evt -> updateReports());
|
| 134 | 133 | }
|
| ... | ... | @@ -149,12 +149,11 @@ public class ResultTableModel extends AbstractTableModel { |
| 149 | 149 | rowNames.addAll(Arrays.asList(report.getRowHeaders()));
|
| 150 | 150 | }
|
| 151 | 151 | |
| 152 | - withColumnHeader = !columnNames.isEmpty();
|
|
| 153 | - withRowHeader = !rowNames.isEmpty();
|
|
| 154 | - table.setTableHeader(!withColumnHeader ? null : tableHeader);
|
|
| 155 | - table.createDefaultColumnsFromModel();
|
|
| 156 | 152 | int nbRows = incomingData.getHeight();
|
| 157 | 153 | int nbCols = incomingData.getWidth();
|
| 154 | + |
|
| 155 | + withColumnHeader = !columnNames.isEmpty();
|
|
| 156 | + withRowHeader = !rowNames.isEmpty();
|
|
| 158 | 157 | if (withRowHeader) {
|
| 159 | 158 | // on ajoute une première colonne aux données
|
| 160 | 159 | nbCols += 1;
|
| ... | ... | @@ -162,6 +161,22 @@ public class ResultTableModel extends AbstractTableModel { |
| 162 | 161 | incomingData.setX(1);
|
| 163 | 162 | }
|
| 164 | 163 | |
| 164 | + if (!withColumnHeader && !withRowHeader) {
|
|
| 165 | + // let's say we always use columns from incomingData
|
|
| 166 | + table.setTableHeader(tableHeader);
|
|
| 167 | + for (int i = 0; i < nbCols; i++) {
|
|
| 168 | + columnNames.add((String) incomingData.getValue(i, 0));
|
|
| 169 | + }
|
|
| 170 | + incomingData.setY(-1);
|
|
| 171 | + withColumnHeader = true;
|
|
| 172 | + nbRows--;
|
|
| 173 | + |
|
| 174 | + } else {
|
|
| 175 | + table.setTableHeader(!withColumnHeader ? null : tableHeader);
|
|
| 176 | + }
|
|
| 177 | + table.createDefaultColumnsFromModel();
|
|
| 178 | + |
|
| 179 | + |
|
| 165 | 180 | data.setHeight(nbRows);
|
| 166 | 181 | data.setWidth(nbCols);
|
| 167 | 182 | |
| ... | ... | @@ -185,7 +200,9 @@ public class ResultTableModel extends AbstractTableModel { |
| 185 | 200 | } else if (withColumnHeader) {
|
| 186 | 201 | |
| 187 | 202 | }
|
| 188 | - data.copyData(incomingData);
|
|
| 203 | + if (nbCols > 0) {
|
|
| 204 | + data.copyData(incomingData);
|
|
| 205 | + }
|
|
| 189 | 206 | fireTableStructureChanged();
|
| 190 | 207 | table.revalidate();
|
| 191 | 208 | table.repaint();
|
| ... | ... | @@ -220,7 +237,7 @@ public class ResultTableModel extends AbstractTableModel { |
| 220 | 237 | }
|
| 221 | 238 | |
| 222 | 239 | public String getClipboardContent(boolean copyRowHeaders, boolean copyColumnHeaders) {
|
| 223 | - return getDataContent(copyRowHeaders, copyColumnHeaders, true,'\t');
|
|
| 240 | + return getDataContent(copyRowHeaders, copyColumnHeaders, true, '\t');
|
|
| 224 | 241 | }
|
| 225 | 242 | |
| 226 | 243 | public String getCsvContent() {
|
| ... | ... | @@ -59,7 +59,12 @@ public final class ResetEntry extends ContentTableUIActionSupport<ContentTableUI |
| 59 | 59 | }
|
| 60 | 60 | } else {
|
| 61 | 61 | // reset existing entry
|
| 62 | - tableModel.resetEditBean();
|
|
| 62 | + ui.getStates().setResetEdit(true);
|
|
| 63 | + try {
|
|
| 64 | + tableModel.resetEditBean();
|
|
| 65 | + } finally {
|
|
| 66 | + ui.getStates().setResetEdit(false);
|
|
| 67 | + }
|
|
| 63 | 68 | }
|
| 64 | 69 | }
|
| 65 | 70 |
| ... | ... | @@ -72,12 +72,11 @@ public class SampleUIHandler extends GeneratedSampleUIHandler { |
| 72 | 72 | private final PropertyChangeListener speciesChanged;
|
| 73 | 73 | |
| 74 | 74 | public SampleUIHandler() {
|
| 75 | - weightChanged = evt -> onWeightChanged((Float) evt.getNewValue());
|
|
| 76 | - lengthChanged = evt -> onLengthChanged((Float) evt.getNewValue());
|
|
| 75 | + weightChanged = evt -> onWeightChanged((Float) evt.getNewValue(), !ui.getStates().isResetEdit());
|
|
| 76 | + lengthChanged = evt -> onLengthChanged((Float) evt.getNewValue(), !ui.getStates().isResetEdit());
|
|
| 77 | 77 | speciesChanged = evt -> onSpeciesChanged((SpeciesReference) evt.getNewValue());
|
| 78 | 78 | }
|
| 79 | 79 | |
| 80 | - |
|
| 81 | 80 | @Override
|
| 82 | 81 | public void onInit(SampleUI ui) {
|
| 83 | 82 | super.onInit(ui);
|
| ... | ... | @@ -97,8 +96,8 @@ public class SampleUIHandler extends GeneratedSampleUIHandler { |
| 97 | 96 | |
| 98 | 97 | public void onSelectedRowChanged(SampleMeasureDto tableEditBean, SampleMeasureDto previousRowBean, boolean notPersisted, boolean newRow) {
|
| 99 | 98 | |
| 100 | - onLengthChanged(tableEditBean.getLength());
|
|
| 101 | - onWeightChanged(tableEditBean.getWeight());
|
|
| 99 | + onLengthChanged(tableEditBean.getLength(), false);
|
|
| 100 | + onWeightChanged(tableEditBean.getWeight(), false);
|
|
| 102 | 101 | |
| 103 | 102 | SampleUIModel sampleModel = getModel();
|
| 104 | 103 | |
| ... | ... | @@ -209,6 +208,9 @@ public class SampleUIHandler extends GeneratedSampleUIHandler { |
| 209 | 208 | }
|
| 210 | 209 | |
| 211 | 210 | public void startEditTableEditBean(SampleMeasureDto tableEditBean) {
|
| 211 | + tableEditBean.removePropertyChangeListener(SampleMeasureDto.PROPERTY_WEIGHT, weightChanged);
|
|
| 212 | + tableEditBean.removePropertyChangeListener(SampleMeasureDto.PROPERTY_LENGTH, lengthChanged);
|
|
| 213 | + tableEditBean.removePropertyChangeListener(SampleMeasureDto.PROPERTY_SPECIES, speciesChanged);
|
|
| 212 | 214 | tableEditBean.addPropertyChangeListener(SampleMeasureDto.PROPERTY_WEIGHT, weightChanged);
|
| 213 | 215 | tableEditBean.addPropertyChangeListener(SampleMeasureDto.PROPERTY_LENGTH, lengthChanged);
|
| 214 | 216 | tableEditBean.addPropertyChangeListener(SampleMeasureDto.PROPERTY_SPECIES, speciesChanged);
|
| ... | ... | @@ -249,9 +251,9 @@ public class SampleUIHandler extends GeneratedSampleUIHandler { |
| 249 | 251 | acquisitionModeGroup.setSelectedValue(acquisitionMode);
|
| 250 | 252 | }
|
| 251 | 253 | |
| 252 | - protected void onWeightChanged(Float newValue) {
|
|
| 254 | + protected void onWeightChanged(Float newValue, boolean realChange) {
|
|
| 253 | 255 | SampleMeasureDto tableEditBean = ui.getModel().getStates().getTableEditBean();
|
| 254 | - if (tableEditBean.getAcquisitionMode() == 1) {
|
|
| 256 | + if (realChange && tableEditBean.getAcquisitionMode() == 1) {
|
|
| 255 | 257 | tableEditBean.setIsWeightComputed(false);
|
| 256 | 258 | }
|
| 257 | 259 | if (newValue == null) {
|
| ... | ... | @@ -259,9 +261,11 @@ public class SampleUIHandler extends GeneratedSampleUIHandler { |
| 259 | 261 | }
|
| 260 | 262 | }
|
| 261 | 263 | |
| 262 | - protected void onLengthChanged(Float newValue) {
|
|
| 264 | + protected void onLengthChanged(Float newValue, boolean realChange) {
|
|
| 263 | 265 | SampleMeasureDto tableEditBean = ui.getModel().getStates().getTableEditBean();
|
| 264 | - tableEditBean.setIsLengthComputed(false);
|
|
| 266 | + if (realChange) {
|
|
| 267 | + tableEditBean.setIsLengthComputed(false);
|
|
| 268 | + }
|
|
| 265 | 269 | if (newValue == null) {
|
| 266 | 270 | tableEditBean.setLengthMeasureMethod(null);
|
| 267 | 271 | }
|
| ... | ... | @@ -157,8 +157,8 @@ report.psObservationFobUsageMinimal.request.3=2,0|row|\ |
| 157 | 157 | Where \
|
| 158 | 158 | m.id In :tripId \
|
| 159 | 159 | and dcp.computedWhenArrivingSimplifiedObjectType = :typeObjetId \
|
| 160 | - and a.vesselActivity.id != 'fr.ird.referential.ps.common.VesselActivity#1239832675369#0.12552908048322586'
|
|
| 161 | -and (dcp.objectOperation.id = 'fr.ird.referential.ps.common.ObjectOperation#0#2' \
|
|
| 160 | + and a.vesselActivity.id != 'fr.ird.referential.ps.common.VesselActivity#1239832675369#0.12552908048322586' \
|
|
| 161 | + and (dcp.objectOperation.id = 'fr.ird.referential.ps.common.ObjectOperation#0#2' \
|
|
| 162 | 162 | or dcp.objectOperation.id = 'fr.ird.referential.ps.common.ObjectOperation#0#8' \
|
| 163 | 163 | or dcp.objectOperation.id = 'fr.ird.referential.ps.common.ObjectOperation#0#4' \
|
| 164 | 164 | or dcp.objectOperation.id = 'fr.ird.referential.ps.common.ObjectOperation#0#5' \
|
| ... | ... | @@ -567,6 +567,140 @@ report.psObservationSetByAssociation.request.8=3,1|column|\ |
| 567 | 567 | and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \
|
| 568 | 568 | and os not in elements(a.observedSystem)
|
| 569 | 569 | ################################################################################
|
| 570 | +## Captures thons selon le type d'association
|
|
| 571 | +################################################################################
|
|
| 572 | +report.psObservationTargetCatchByAssociation.modelType=PS
|
|
| 573 | +report.psObservationTargetCatchByAssociation.name=Observations - Captures de thons selon le type d’association (en t)
|
|
| 574 | +report.psObservationTargetCatchByAssociation.description=Afficher la répartitions des captures de thons selon le type d'association
|
|
| 575 | +report.psObservationTargetCatchByAssociation.columns=YFT, SKJ, BET, LTA, FRI, Autres, Total
|
|
| 576 | +report.psObservationTargetCatchByAssociation.rows=BL sans baleine, BL avec baleine, BO avec requin-baleine, BO sans requin-baleine, Total
|
|
| 577 | +report.psObservationTargetCatchByAssociation.operations.1=SumRow
|
|
| 578 | +report.psObservationTargetCatchByAssociation.operations.2=SumColumn
|
|
| 579 | +# ligne 1
|
|
| 580 | +report.psObservationTargetCatchByAssociation.request.1=0,0|row|\
|
|
| 581 | + Select \
|
|
| 582 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569' Then ct.catchWeight \
|
|
| 583 | + Else 0.0 End), \
|
|
| 584 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992' Then ct.catchWeight \
|
|
| 585 | + Else 0.0 End), \
|
|
| 586 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then ct.catchWeight \
|
|
| 587 | + Else 0.0 End), \
|
|
| 588 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615' Then ct.catchWeight \
|
|
| 589 | + Else 0.0 End), \
|
|
| 590 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058' Then ct.catchWeight \
|
|
| 591 | + Else 0.0 End), \
|
|
| 592 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569' Then 0.0 \
|
|
| 593 | + When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992' Then 0.0 \
|
|
| 594 | + When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then 0.0 \
|
|
| 595 | + When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615' Then 0.0 \
|
|
| 596 | + When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058' Then 0.0 \
|
|
| 597 | + Else ct.catchWeight End) \
|
|
| 598 | + From TripImpl m \
|
|
| 599 | + Join m.routeObs r \
|
|
| 600 | + Join r.activity a \
|
|
| 601 | + Join a.set c \
|
|
| 602 | + with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#2' \
|
|
| 603 | + Join c.catches ct \
|
|
| 604 | + Join ct.speciesFate sf with sf.discard = FALSE, \
|
|
| 605 | + ObservedSystemImpl os \
|
|
| 606 | + Where \
|
|
| 607 | + m.id In :tripId \
|
|
| 608 | + and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9395222812356602' \
|
|
| 609 | + and os not in elements(a.observedSystem)
|
|
| 610 | +# ligne 2
|
|
| 611 | +report.psObservationTargetCatchByAssociation.request.7=0,1|row|\
|
|
| 612 | + Select \
|
|
| 613 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569' Then ct.catchWeight \
|
|
| 614 | + Else 0.0 End), \
|
|
| 615 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992' Then ct.catchWeight \
|
|
| 616 | + Else 0.0 End), \
|
|
| 617 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then ct.catchWeight \
|
|
| 618 | + Else 0.0 End), \
|
|
| 619 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615' Then ct.catchWeight \
|
|
| 620 | + Else 0.0 End), \
|
|
| 621 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058' Then ct.catchWeight \
|
|
| 622 | + Else 0.0 End), \
|
|
| 623 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569' Then 0.0 \
|
|
| 624 | + When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992' Then 0.0 \
|
|
| 625 | + When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then 0.0 \
|
|
| 626 | + When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615' Then 0.0 \
|
|
| 627 | + When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058' Then 0.0 \
|
|
| 628 | + Else ct.catchWeight End) \
|
|
| 629 | + From TripImpl m \
|
|
| 630 | + Join m.routeObs r \
|
|
| 631 | + Join r.activity a \
|
|
| 632 | + Join a.set c \
|
|
| 633 | + with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#2' \
|
|
| 634 | + Join c.catches ct \
|
|
| 635 | + Join ct.speciesFate sf with sf.discard = FALSE, \
|
|
| 636 | + ObservedSystemImpl os \
|
|
| 637 | + Where \
|
|
| 638 | + m.id In :tripId \
|
|
| 639 | + and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9395222812356602' \
|
|
| 640 | + and os in elements(a.observedSystem)
|
|
| 641 | +# ligne 3
|
|
| 642 | +report.psObservationTargetCatchByAssociation.request.13=0,2|row|\
|
|
| 643 | + Select \
|
|
| 644 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569' Then ct.catchWeight \
|
|
| 645 | + Else 0.0 End), \
|
|
| 646 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992' Then ct.catchWeight \
|
|
| 647 | + Else 0.0 End), \
|
|
| 648 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then ct.catchWeight \
|
|
| 649 | + Else 0.0 End), \
|
|
| 650 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615' Then ct.catchWeight \
|
|
| 651 | + Else 0.0 End), \
|
|
| 652 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058' Then ct.catchWeight \
|
|
| 653 | + Else 0.0 End), \
|
|
| 654 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569' Then 0.0 \
|
|
| 655 | + When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992' Then 0.0 \
|
|
| 656 | + When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then 0.0 \
|
|
| 657 | + When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615' Then 0.0 \
|
|
| 658 | + When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058' Then 0.0 \
|
|
| 659 | + Else ct.catchWeight End) \
|
|
| 660 | + From TripImpl m \
|
|
| 661 | + Join m.routeObs r \
|
|
| 662 | + Join r.activity a \
|
|
| 663 | + Join a.set c \
|
|
| 664 | + with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#1' \
|
|
| 665 | + Join c.catches ct \
|
|
| 666 | + Join ct.speciesFate sf with sf.discard = FALSE, \
|
|
| 667 | + ObservedSystemImpl os \
|
|
| 668 | + Where \
|
|
| 669 | + m.id In :tripId \
|
|
| 670 | + and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \
|
|
| 671 | + and os in elements(a.observedSystem)
|
|
| 672 | +# ligne 4
|
|
| 673 | +report.psObservationTargetCatchByAssociation.request.19=0,3|row|\
|
|
| 674 | + Select \
|
|
| 675 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569' Then ct.catchWeight \
|
|
| 676 | + Else 0.0 End), \
|
|
| 677 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992' Then ct.catchWeight \
|
|
| 678 | + Else 0.0 End), \
|
|
| 679 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then ct.catchWeight \
|
|
| 680 | + Else 0.0 End), \
|
|
| 681 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615' Then ct.catchWeight \
|
|
| 682 | + Else 0.0 End), \
|
|
| 683 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058' Then ct.catchWeight \
|
|
| 684 | + Else 0.0 End), \
|
|
| 685 | + Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569' Then 0.0 \
|
|
| 686 | + When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992' Then 0.0 \
|
|
| 687 | + When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then 0.0 \
|
|
| 688 | + When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615' Then 0.0 \
|
|
| 689 | + When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058' Then 0.0 \
|
|
| 690 | + Else ct.catchWeight End) \
|
|
| 691 | + From TripImpl m \
|
|
| 692 | + Join m.routeObs r \
|
|
| 693 | + Join r.activity a \
|
|
| 694 | + Join a.set c \
|
|
| 695 | + with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#1' \
|
|
| 696 | + Join c.catches ct \
|
|
| 697 | + Join ct.speciesFate sf with sf.discard = FALSE, \
|
|
| 698 | + ObservedSystemImpl os \
|
|
| 699 | + Where \
|
|
| 700 | + m.id In :tripId \
|
|
| 701 | + and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \
|
|
| 702 | + and os not in elements(a.observedSystem)
|
|
| 703 | +################################################################################
|
|
| 570 | 704 | ## Rejets thons selon le type d'association
|
| 571 | 705 | ################################################################################
|
| 572 | 706 | report.psObservationTargetDiscardedByAssociation.modelType=PS
|
| ... | ... | @@ -600,7 +734,8 @@ report.psObservationTargetDiscardedByAssociation.request.1=0,0|row|\ |
| 600 | 734 | Join r.activity a \
|
| 601 | 735 | Join a.set c \
|
| 602 | 736 | with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#2' \
|
| 603 | - Join c.catches ct, \
|
|
| 737 | + Join c.catches ct \
|
|
| 738 | + Join ct.speciesFate sf with sf.discard = TRUE, \
|
|
| 604 | 739 | ObservedSystemImpl os \
|
| 605 | 740 | Where \
|
| 606 | 741 | m.id In :tripId \
|
| ... | ... | @@ -630,7 +765,8 @@ report.psObservationTargetDiscardedByAssociation.request.7=0,1|row|\ |
| 630 | 765 | Join r.activity a \
|
| 631 | 766 | Join a.set c \
|
| 632 | 767 | with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#2' \
|
| 633 | - Join c.catches ct, \
|
|
| 768 | + Join c.catches ct \
|
|
| 769 | + Join ct.speciesFate sf with sf.discard = TRUE, \
|
|
| 634 | 770 | ObservedSystemImpl os \
|
| 635 | 771 | Where \
|
| 636 | 772 | m.id In :tripId \
|
| ... | ... | @@ -660,7 +796,8 @@ report.psObservationTargetDiscardedByAssociation.request.13=0,2|row|\ |
| 660 | 796 | Join r.activity a \
|
| 661 | 797 | Join a.set c \
|
| 662 | 798 | with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#1' \
|
| 663 | - Join c.catches ct, \
|
|
| 799 | + Join c.catches ct \
|
|
| 800 | + Join ct.speciesFate sf with sf.discard = TRUE, \
|
|
| 664 | 801 | ObservedSystemImpl os \
|
| 665 | 802 | Where \
|
| 666 | 803 | m.id In :tripId \
|
| ... | ... | @@ -690,33 +827,34 @@ report.psObservationTargetDiscardedByAssociation.request.19=0,3|row|\ |
| 690 | 827 | Join r.activity a \
|
| 691 | 828 | Join a.set c \
|
| 692 | 829 | with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#1' \
|
| 693 | - Join c.catches ct, \
|
|
| 830 | + Join c.catches ct \
|
|
| 831 | + Join ct.speciesFate sf with sf.discard = TRUE, \
|
|
| 694 | 832 | ObservedSystemImpl os \
|
| 695 | 833 | Where \
|
| 696 | 834 | m.id In :tripId \
|
| 697 | 835 | and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \
|
| 698 | 836 | and os not in elements(a.observedSystem)
|
| 699 | 837 | ################################################################################
|
| 700 | -## Captures accessoires observées
|
|
| 838 | +## Captures observées
|
|
| 701 | 839 | ################################################################################
|
| 702 | -report.psObservationAccessoryCatch.modelType=PS
|
|
| 703 | -report.psObservationAccessoryCatch.name=Observations - Liste des captures accessoires selon le type de banc, filtrées par groupe
|
|
| 704 | -report.psObservationAccessoryCatch.description=Afficher les captures accessoires par groupe d'espèce\nLes poids sont exprimés en tonnes.
|
|
| 705 | -report.psObservationAccessoryCatch.columns=Espèce, Banc libre, Banc objet
|
|
| 706 | -report.psObservationAccessoryCatch.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|From SpeciesGroupImpl ge Order By ge.code
|
|
| 707 | -report.psObservationAccessoryCatch.repeatVariable.speciesId=java.lang.String|\
|
|
| 840 | +report.psObservationCatch.modelType=PS
|
|
| 841 | +report.psObservationCatch.name=Observations - Liste des captures selon le type de banc, filtrées par groupe
|
|
| 842 | +report.psObservationCatch.description=Afficher les captures par groupe d'espèce\nLes poids sont exprimés en tonnes.
|
|
| 843 | +report.psObservationCatch.columns=Espèce, Banc libre, Banc objet
|
|
| 844 | +report.psObservationCatch.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|From SpeciesGroupImpl ge Order By ge.code
|
|
| 845 | +report.psObservationCatch.repeatVariable.speciesId=java.lang.String|\
|
|
| 708 | 846 | Select e.id From SpeciesImpl e \
|
| 709 | 847 | Where e.speciesGroup.id = :speciesGroup \
|
| 710 | 848 | Order By e.homeId
|
| 711 | -report.psObservationAccessoryCatch.request.1=0,0|row|\
|
|
| 849 | +report.psObservationCatch.request.1=0,0|row|\
|
|
| 712 | 850 | Select \
|
| 713 | 851 | concat('[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
|
| 714 | 852 | ' [sc]', (case when e.scientificLabel is not null then e.scientificLabel else '-' end), \
|
| 715 | 853 | ' [fr]', (case when e.label2 is not null then e.label2 else '-' end)) \
|
| 716 | 854 | From SpeciesImpl e \
|
| 717 | 855 | Where e.id = :speciesId
|
| 718 | -report.psObservationAccessoryCatch.request.1.repeat=speciesId|column
|
|
| 719 | -report.psObservationAccessoryCatch.request.2=1,0|row|\
|
|
| 856 | +report.psObservationCatch.request.1.repeat=speciesId|column
|
|
| 857 | +report.psObservationCatch.request.2=1,0|row|\
|
|
| 720 | 858 | Select \
|
| 721 | 859 | case when Count(ca) > 0 then \
|
| 722 | 860 | concat('+', \
|
| ... | ... | @@ -731,8 +869,8 @@ report.psObservationAccessoryCatch.request.2=1,0|row|\ |
| 731 | 869 | Join c.catches ca \
|
| 732 | 870 | with ca.species.id = :speciesId \
|
| 733 | 871 | Where m.id In :tripId
|
| 734 | -report.psObservationAccessoryCatch.request.2.repeat=speciesId|column
|
|
| 735 | -report.psObservationAccessoryCatch.request.3=2,0|row|\
|
|
| 872 | +report.psObservationCatch.request.2.repeat=speciesId|column
|
|
| 873 | +report.psObservationCatch.request.3=2,0|row|\
|
|
| 736 | 874 | Select \
|
| 737 | 875 | case when Count(ca) > 0 then \
|
| 738 | 876 | concat('+', \
|
| ... | ... | @@ -747,16 +885,16 @@ report.psObservationAccessoryCatch.request.3=2,0|row|\ |
| 747 | 885 | Join c.catches ca \
|
| 748 | 886 | with ca.species.id = :speciesId \
|
| 749 | 887 | Where m.id In :tripId
|
| 750 | -report.psObservationAccessoryCatch.request.3.repeat=speciesId|column
|
|
| 888 | +report.psObservationCatch.request.3.repeat=speciesId|column
|
|
| 751 | 889 | ################################################################################
|
| 752 | -## Captures accessoires par speciesGroup d'espèces
|
|
| 890 | +## Captures par groupe d'espèces
|
|
| 753 | 891 | ################################################################################
|
| 754 | -report.psObservationAccessoryCatchByGroup.modelType=PS
|
|
| 755 | -report.psObservationAccessoryCatchByGroup.name=Observations - Dénombrement des captures accessoires et devenir, filtrés par groupe
|
|
| 756 | -report.psObservationAccessoryCatchByGroup.description=Afficher les nombres de captures accessoires par groupe d'espèce selon le type de banc et le devenir
|
|
| 757 | -report.psObservationAccessoryCatchByGroup.columns=Espèce, Total BL, Total BO, Sorti vivant/échappé, Sorti mort, Rejeté vivant, Rejeté mort, Partiellement conservé, Cuve, Cuisine, Autre
|
|
| 758 | -report.psObservationAccessoryCatchByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|From SpeciesGroupImpl ge Order By ge.code
|
|
| 759 | -report.psObservationAccessoryCatchByGroup.request.1=0,0|row|\
|
|
| 892 | +report.psObservationCatchByGroup.modelType=PS
|
|
| 893 | +report.psObservationCatchByGroup.name=Observations - Dénombrement des captures par devenir, filtrés par groupe
|
|
| 894 | +report.psObservationCatchByGroup.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir
|
|
| 895 | +report.psObservationCatchByGroup.columns=Espèce, Total BL, Total BO, Sorti vivant/échappé, Sorti mort, Rejeté vivant, Rejeté mort, Partiellement conservé, Cuve, Cuisine, Conservé pour le marché local ou poisson séché/salé à bord, Ailerons seulements, Rejeté statut inconnu (seulement pour l'observation électronique), Conservé à des fins scientifiques, Rejeté suffocant, Rejeté blessé, Autre
|
|
| 896 | +report.psObservationCatchByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|From SpeciesGroupImpl ge Order By ge.code
|
|
| 897 | +report.psObservationCatchByGroup.request.1=0,0|row|\
|
|
| 760 | 898 | Select \
|
| 761 | 899 | concat(\
|
| 762 | 900 | '[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
|
| ... | ... | @@ -779,6 +917,12 @@ report.psObservationAccessoryCatchByGroup.request.1=0,0|row|\ |
| 779 | 917 | else 0.0 end), \
|
| 780 | 918 | Sum(case ca.speciesFate.id when 'fr.ird.referential.ps.common.SpeciesFate#1239832683621#0.6728026426066158' then ca.totalCount \
|
| 781 | 919 | else 0.0 end), \
|
| 920 | + Sum(case ca.speciesFate.id when 'fr.ird.referential.ps.common.SpeciesFate#1464000000000#15' then ca.totalCount else 0.0 end), \
|
|
| 921 | + Sum(case ca.speciesFate.id when 'fr.ird.referential.ps.common.SpeciesFate#1467372855729#0.568287924081734' then ca.totalCount else 0.0 end), \
|
|
| 922 | + Sum(case ca.speciesFate.id when 'fr.ird.referential.ps.common.SpeciesFate#1501492537510#0.9210847837998154' then ca.totalCount else 0.0 end), \
|
|
| 923 | + Sum(case ca.speciesFate.id when 'fr.ird.referential.ps.common.SpeciesFate#1501492831539#0.9377232562184147' then ca.totalCount else 0.0 end), \
|
|
| 924 | + Sum(case ca.speciesFate.id when 'fr.ird.referential.ps.common.SpeciesFate#1544448835551#0.620629930572886' then ca.totalCount else 0.0 end), \
|
|
| 925 | + Sum(case ca.speciesFate.id when 'fr.ird.referential.ps.common.SpeciesFate#1544448977865#0.24265421995390768' then ca.totalCount else 0.0 end), \
|
|
| 782 | 926 | Sum(case ca.speciesFate.id when 'fr.ird.referential.ps.common.SpeciesFate#1239832683619#0.9931091059863436' then 0.0 \
|
| 783 | 927 | when 'fr.ird.referential.ps.common.SpeciesFate#1239832683618#0.06155887805368032' then 0.0 \
|
| 784 | 928 | when 'fr.ird.referential.ps.common.SpeciesFate#1239832683619#0.11883784875534997' then 0.0 \
|
| ... | ... | @@ -787,6 +931,12 @@ report.psObservationAccessoryCatchByGroup.request.1=0,0|row|\ |
| 787 | 931 | when 'fr.ird.referential.ps.common.SpeciesFate#1239832683620#0.46609703818634485' then 0.0 \
|
| 788 | 932 | when 'fr.ird.referential.ps.common.SpeciesFate#1239832683619#0.5722739932065866' then 0.0 \
|
| 789 | 933 | when 'fr.ird.referential.ps.common.SpeciesFate#1239832683621#0.6728026426066158' then 0.0 \
|
| 934 | + when 'fr.ird.referential.ps.common.SpeciesFate#1464000000000#15' then 0.0 \
|
|
| 935 | + when 'fr.ird.referential.ps.common.SpeciesFate#1467372855729#0.568287924081734' then 0.0 \
|
|
| 936 | + when 'fr.ird.referential.ps.common.SpeciesFate#1501492537510#0.9210847837998154' then 0.0 \
|
|
| 937 | + when 'fr.ird.referential.ps.common.SpeciesFate#1501492831539#0.9377232562184147' then 0.0 \
|
|
| 938 | + when 'fr.ird.referential.ps.common.SpeciesFate#1544448835551#0.620629930572886' then 0.0 \
|
|
| 939 | + when 'fr.ird.referential.ps.common.SpeciesFate#1544448977865#0.24265421995390768' then 0.0 \
|
|
| 790 | 940 | else ca.totalCount end) \
|
| 791 | 941 | From TripImpl m \
|
| 792 | 942 | Join m.routeObs r \
|
| ... | ... | @@ -799,6 +949,47 @@ report.psObservationAccessoryCatchByGroup.request.1=0,0|row|\ |
| 799 | 949 | Group by e \
|
| 800 | 950 | Order By e.homeId
|
| 801 | 951 | ###########################################################
|
| 952 | +## Distribution des tailles par espèces et type de mesure
|
|
| 953 | +###########################################################
|
|
| 954 | +report.psObservationLengthsDistribution.modelType=PS
|
|
| 955 | +report.psObservationLengthsDistribution.name=Observations - Distribution des tailles par espèces et type de mesure
|
|
| 956 | +report.psObservationLengthsDistribution.description=Afficher la nombre d'individus mesurés par classe de taille pour les espèces et le type de mesure
|
|
| 957 | +report.psObservationLengthsDistribution.operations.1=ComputePsObservationLengthsDistribution
|
|
| 958 | +report.psObservationLengthsDistribution.variable.1.species=fr.ird.observe.dto.referential.common.SpeciesDto|\
|
|
| 959 | +Select distinct ntl.species \
|
|
| 960 | +From TripImpl t \
|
|
| 961 | +Join t.routeObs r \
|
|
| 962 | +Join r.activity a \
|
|
| 963 | +Join a.set.sample nts \
|
|
| 964 | +Join nts.sampleMeasure ntl \
|
|
| 965 | +Where t.id In :tripId
|
|
| 966 | +report.psObservationLengthsDistribution.variable.2.sizeMeasureType=fr.ird.observe.dto.referential.common.SizeMeasureTypeDto|\
|
|
| 967 | +Select distinct ntl.sizeMeasureType \
|
|
| 968 | +From TripImpl t \
|
|
| 969 | +Join t.routeObs r \
|
|
| 970 | +Join r.activity a \
|
|
| 971 | +Join a.set.sample nts \
|
|
| 972 | +Join nts.sampleMeasure ntl \
|
|
| 973 | +Where t.id In :tripId
|
|
| 974 | +report.psObservationLengthsDistribution.repeatVariable.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
|
|
| 975 | +Select distinct sf \
|
|
| 976 | +From TripImpl t \
|
|
| 977 | +Join t.routeObs r \
|
|
| 978 | +Join r.activity a \
|
|
| 979 | +Join a.set.sample nts \
|
|
| 980 | +Join nts.sampleMeasure ntl with ntl.species.id = :species And ntl.sizeMeasureType.id = :sizeMeasureType \
|
|
| 981 | +Left Join ntl.speciesFate sf \
|
|
| 982 | +Where t.id In :tripId
|
|
| 983 | +report.psObservationLengthsDistribution.repeatVariable.length=java.lang.Float|\
|
|
| 984 | +Select distinct ntl.length \
|
|
| 985 | +From TripImpl t \
|
|
| 986 | +Join t.routeObs r \
|
|
| 987 | +Join r.activity a \
|
|
| 988 | +Join a.set.sample nts \
|
|
| 989 | +Join nts.sampleMeasure ntl with ntl.species.id = :species And ntl.sizeMeasureType.id = :sizeMeasureType \
|
|
| 990 | +Where t.id In :tripId \
|
|
| 991 | +Order By ntl.length
|
|
| 992 | +###########################################################
|
|
| 802 | 993 | ## Distribution des tailles par espèces non ciblées
|
| 803 | 994 | ###########################################################
|
| 804 | 995 | report.psObservationNonTargetDistributionLengths.modelType=PS
|
| 1 | +package fr.ird.observe.spi.report;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Core :: Persistence :: Java
|
|
| 6 | + * %%
|
|
| 7 | + * Copyright (C) 2008 - 2022 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 com.google.auto.service.AutoService;
|
|
| 26 | +import fr.ird.observe.dto.report.DataMatrix;
|
|
| 27 | +import fr.ird.observe.dto.report.Report;
|
|
| 28 | +import fr.ird.observe.dto.report.ReportOperationConsumer;
|
|
| 29 | +import fr.ird.observe.dto.report.ReportRequestExecutor;
|
|
| 30 | +import fr.ird.observe.dto.report.ReportVariable;
|
|
| 31 | +import fr.ird.observe.entities.referential.ps.common.SpeciesFate;
|
|
| 32 | + |
|
| 33 | +import java.util.List;
|
|
| 34 | +import java.util.Map;
|
|
| 35 | +import java.util.Set;
|
|
| 36 | +import java.util.TreeMap;
|
|
| 37 | +import java.util.stream.Collectors;
|
|
| 38 | + |
|
| 39 | +/**
|
|
| 40 | + * Created on 13/11/2022.
|
|
| 41 | + *
|
|
| 42 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 43 | + * @since 9.0.17
|
|
| 44 | + */
|
|
| 45 | +@AutoService(ReportOperationConsumer.class)
|
|
| 46 | +public class ComputePsObservationLengthsDistribution implements ReportOperationConsumer {
|
|
| 47 | + |
|
| 48 | + /**
|
|
| 49 | + * To get total count per length.
|
|
| 50 | + */
|
|
| 51 | + public static final String TOTAL_COUNT_REQUEST = "" +
|
|
| 52 | + "Select sum(ntl.count) \n" +
|
|
| 53 | + "From TripImpl t \n" +
|
|
| 54 | + "Join t.routeObs r \n" +
|
|
| 55 | + "Join r.activity a \n" +
|
|
| 56 | + "Join a.set.sample nts \n" +
|
|
| 57 | + "Join nts.sampleMeasure ntl With ntl.species.id = :species And ntl.sizeMeasureType.id = :sizeMeasureType \n" +
|
|
| 58 | + "Where t.id In :tripId \n" +
|
|
| 59 | + "Group By ntl.length \n" +
|
|
| 60 | + "Order By ntl.length";
|
|
| 61 | + |
|
| 62 | + /**
|
|
| 63 | + * To get species fate count per length
|
|
| 64 | + */
|
|
| 65 | + public static final String SPECIES_FATE_COUNT_REQUEST = "" +
|
|
| 66 | + "Select ntl.length, sum(ntl.count) \n" +
|
|
| 67 | + "From TripImpl t \n" +
|
|
| 68 | + "Join t.routeObs r \n" +
|
|
| 69 | + "Join r.activity a \n" +
|
|
| 70 | + "Join a.set.sample nts \n" +
|
|
| 71 | + "Join nts.sampleMeasure ntl With ntl.species.id = :species And ntl.sizeMeasureType.id = :sizeMeasureType And ntl.speciesFate.id = :speciesFate\n" +
|
|
| 72 | + "Where t.id In :tripId \n" +
|
|
| 73 | + "Group By ntl.length \n" +
|
|
| 74 | + "Order By ntl.length";
|
|
| 75 | + |
|
| 76 | + /**
|
|
| 77 | + * To get null species fate count per length
|
|
| 78 | + */
|
|
| 79 | + public static final String NULL_SPECIES_FATE_COUNT_REQUEST = "" +
|
|
| 80 | + "Select ntl.length, sum(ntl.count) \n" +
|
|
| 81 | + "From TripImpl t \n" +
|
|
| 82 | + "Join t.routeObs r \n" +
|
|
| 83 | + "Join r.activity a \n" +
|
|
| 84 | + "Join a.set.sample nts \n" +
|
|
| 85 | + "Join nts.sampleMeasure ntl With ntl.species.id = :species And ntl.sizeMeasureType.id = :sizeMeasureType And ntl.speciesFate Is Null\n" +
|
|
| 86 | + "Where t.id In :tripId \n" +
|
|
| 87 | + "Group By ntl.length \n" +
|
|
| 88 | + "Order By ntl.length";
|
|
| 89 | + |
|
| 90 | + @Override
|
|
| 91 | + public DataMatrix consume(String parameters, ReportRequestExecutor requestExecutor, Report report, Set<String> tripId, DataMatrix incoming) {
|
|
| 92 | + |
|
| 93 | + Map<String, Object> queryParameters = new TreeMap<>();
|
|
| 94 | + queryParameters.put("tripId", tripId);
|
|
| 95 | + for (ReportVariable<?> variable : report.getVariables()) {
|
|
| 96 | + queryParameters.put(variable.getName(), variable.getSelectedValue());
|
|
| 97 | + }
|
|
| 98 | + |
|
| 99 | + Set<SpeciesFate> speciesFateList = report.<SpeciesFate>getRepeatVariable("speciesFate").getValues();
|
|
| 100 | + List<String> lengthList = report.getRepeatVariable("length").getValues().stream().map(Object::toString).collect(Collectors.toList());
|
|
| 101 | + |
|
| 102 | + DataMatrix result = createTmpMatrix(0, 0, 2 + speciesFateList.size(), 1 + lengthList.size());
|
|
| 103 | + boolean useNullSpeciesFate = speciesFateList.remove(null);
|
|
| 104 | + int columnIndex = 0;
|
|
| 105 | + fillLengthsColumn(result, columnIndex++, lengthList);
|
|
| 106 | + |
|
| 107 | + for (SpeciesFate speciesFate : speciesFateList) {
|
|
| 108 | + fillSpeciesFateCountColumn(result, columnIndex++, queryParameters, speciesFate, lengthList, requestExecutor);
|
|
| 109 | + }
|
|
| 110 | + |
|
| 111 | + if (useNullSpeciesFate) {
|
|
| 112 | + fillSpeciesFateCountColumn(result, columnIndex++, queryParameters, null, lengthList, requestExecutor);
|
|
| 113 | + }
|
|
| 114 | + |
|
| 115 | + fillTotalCountColumn(result, columnIndex, queryParameters, requestExecutor);
|
|
| 116 | + |
|
| 117 | + return result;
|
|
| 118 | + }
|
|
| 119 | + |
|
| 120 | + private void fillLengthsColumn(DataMatrix result, int columnIndex, List<String> lengthList) {
|
|
| 121 | + int index = 0;
|
|
| 122 | + result.setValue(columnIndex, index++, "Classe de taille (cm)");
|
|
| 123 | + for (String length : lengthList) {
|
|
| 124 | + result.setValue(columnIndex, index++, length);
|
|
| 125 | + }
|
|
| 126 | + }
|
|
| 127 | + |
|
| 128 | + private void fillSpeciesFateCountColumn(DataMatrix result, int columnIndex, Map<String, Object> queryParameters, SpeciesFate speciesFate, List<String> lengthList, ReportRequestExecutor requestExecutor) {
|
|
| 129 | + String header;
|
|
| 130 | + List<Object[]> rows;
|
|
| 131 | + if (speciesFate == null) {
|
|
| 132 | + header = "Aucun";
|
|
| 133 | + queryParameters.remove("speciesFate");
|
|
| 134 | + rows = requestExecutor.executeRequest(NULL_SPECIES_FATE_COUNT_REQUEST, queryParameters);
|
|
| 135 | + } else {
|
|
| 136 | + header = speciesFate.getLabel2();
|
|
| 137 | + queryParameters.put("speciesFate", speciesFate.getId());
|
|
| 138 | + rows = requestExecutor.executeRequest(SPECIES_FATE_COUNT_REQUEST, queryParameters);
|
|
| 139 | + }
|
|
| 140 | + result.setValue(columnIndex, 0, String.format("Effectif ( devenir - %s )", header));
|
|
| 141 | + |
|
| 142 | + for (Object[] row : rows) {
|
|
| 143 | + String length = row[0].toString();
|
|
| 144 | + Number count = (Number) row[1];
|
|
| 145 | + int index = lengthList.indexOf(length);
|
|
| 146 | + result.setValue(columnIndex, index + 1, count);
|
|
| 147 | + }
|
|
| 148 | + }
|
|
| 149 | + |
|
| 150 | + private void fillTotalCountColumn(DataMatrix result, int columnIndex, Map<String, Object> queryParameters, ReportRequestExecutor requestExecutor) {
|
|
| 151 | + result.setValue(columnIndex, 0, "Effectif total");
|
|
| 152 | + List<Object> rows = requestExecutor.executeRequest(TOTAL_COUNT_REQUEST, queryParameters);
|
|
| 153 | + int index = 1;
|
|
| 154 | + for (Object row : rows) {
|
|
| 155 | + Number count = (Number) row;
|
|
| 156 | + result.setValue(columnIndex, index++, count);
|
|
| 157 | + }
|
|
| 158 | + }
|
|
| 159 | + |
|
| 160 | +}
|
|
| 161 | + |
| ... | ... | @@ -76,6 +76,7 @@ public abstract class ReportFixture { |
| 76 | 76 | }
|
| 77 | 77 | |
| 78 | 78 | public final DataMatrix execute(ReportService service, Report report) {
|
| 79 | + log.warn("Starting report {}", report.getName());
|
|
| 79 | 80 | return service.executeReport(report, getTripIds());
|
| 80 | 81 | }
|
| 81 | 82 | |
| ... | ... | @@ -127,6 +128,8 @@ public abstract class ReportFixture { |
| 127 | 128 | for (int i = 0; i < rows; i++) {
|
| 128 | 129 | ReportServiceFixtures.writeArrayAssert(String.format("result.%d", i), actual.getData()[i]);
|
| 129 | 130 | }
|
| 131 | + System.out.println("New asserts:\n" + String.join("\n", ReportServiceFixtures.getAsserts()));
|
|
| 132 | + ReportServiceFixtures.getAsserts().clear();
|
|
| 130 | 133 | }
|
| 131 | 134 | }
|
| 132 | 135 | |
| ... | ... | @@ -159,7 +162,11 @@ public abstract class ReportFixture { |
| 159 | 162 | |
| 160 | 163 | Assert.assertEquals(rows, report.getRows());
|
| 161 | 164 | Assert.assertEquals(columns, report.getColumns());
|
| 162 | - Assert.assertArrayEquals(columnsHeader, report.getColumnHeaders());
|
|
| 165 | + if (report.getColumnHeaders() == null) {
|
|
| 166 | + Assert.assertEquals(0, columnsHeader.length);
|
|
| 167 | + } else {
|
|
| 168 | + Assert.assertArrayEquals(columnsHeader, report.getColumnHeaders());
|
|
| 169 | + }
|
|
| 163 | 170 | if (report.getRowHeaders() == null) {
|
| 164 | 171 | Assert.assertEquals(0, rowsHeader.length);
|
| 165 | 172 | } else {
|
| ... | ... | @@ -168,7 +175,11 @@ public abstract class ReportFixture { |
| 168 | 175 | } else {
|
| 169 | 176 | ReportServiceFixtures.addAssert("syntax.rows", report.getRows());
|
| 170 | 177 | ReportServiceFixtures.addAssert("syntax.columns", report.getColumns());
|
| 171 | - ReportServiceFixtures.writeArrayAssert("syntax.columnsHeader", (Object[]) report.getColumnHeaders());
|
|
| 178 | + if (report.getRowHeaders() == null) {
|
|
| 179 | + ReportServiceFixtures.writeArrayAssert("syntax.columnsHeader");
|
|
| 180 | + } else {
|
|
| 181 | + ReportServiceFixtures.writeArrayAssert("syntax.columnsHeader", (Object[]) report.getColumnHeaders());
|
|
| 182 | + }
|
|
| 172 | 183 | if (report.getRowHeaders() == null) {
|
| 173 | 184 | ReportServiceFixtures.writeArrayAssert("syntax.rowsHeader");
|
| 174 | 185 | } else {
|
| ... | ... | @@ -35,7 +35,7 @@ import java.util.Iterator; |
| 35 | 35 | * @since 1.9
|
| 36 | 36 | */
|
| 37 | 37 | @AutoService(ReportFixture.class)
|
| 38 | -public class PsObservationAccessoryCatchByGroupReportFixture extends ReportFixture {
|
|
| 38 | +public class PsObservationCatchByGroupReportFixture extends ReportFixture {
|
|
| 39 | 39 | |
| 40 | 40 | @Override
|
| 41 | 41 | public void assertSyntax(Report report) {
|
| ... | ... | @@ -36,7 +36,7 @@ import java.util.Iterator; |
| 36 | 36 | * @since 1.9
|
| 37 | 37 | */
|
| 38 | 38 | @AutoService(ReportFixture.class)
|
| 39 | -public class PsObservationAccessoryCatchReportFixture extends ReportFixture {
|
|
| 39 | +public class PsObservationCatchReportFixture extends ReportFixture {
|
|
| 40 | 40 | |
| 41 | 41 | @Override
|
| 42 | 42 | public void assertSyntax(Report report) {
|
| 1 | -package fr.ird.observe.services.local.service;
|
|
| 1 | +package fr.ird.observe.services.service.report.ps;
|
|
| 2 | 2 | |
| 3 | 3 | /*-
|
| 4 | 4 | * #%L
|
| 5 | - * ObServe Core :: Services :: Local
|
|
| 5 | + * ObServe Core :: Services :: Test
|
|
| 6 | 6 | * %%
|
| 7 | 7 | * Copyright (C) 2008 - 2022 IRD, Ultreia.io
|
| 8 | 8 | * %%
|
| ... | ... | @@ -22,17 +22,23 @@ package fr.ird.observe.services.local.service; |
| 22 | 22 | * #L%
|
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | -import fr.ird.observe.services.service.ReportServiceFixtures;
|
|
| 26 | -import org.junit.AfterClass;
|
|
| 25 | +import com.google.auto.service.AutoService;
|
|
| 26 | +import fr.ird.observe.dto.report.Report;
|
|
| 27 | +import fr.ird.observe.services.service.ReportFixture;
|
|
| 27 | 28 | |
| 28 | -public class ReportServiceLocalReadTest extends GeneratedReportServiceLocalReadTest {
|
|
| 29 | +/**
|
|
| 30 | + * Created on 13/11/2022.
|
|
| 31 | + *
|
|
| 32 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 33 | + * @since 9.0.17
|
|
| 34 | + */
|
|
| 35 | +@AutoService(ReportFixture.class)
|
|
| 36 | +public class PsObservationLengthsDistributionReportFixture extends ReportFixture {
|
|
| 29 | 37 | |
| 30 | - @AfterClass
|
|
| 31 | - public static void afterClass() {
|
|
| 32 | - if (!ReportServiceFixtures.WITH_ASSERT) {
|
|
| 33 | - System.out.println("New asserts:\n" + String.join("\n", ReportServiceFixtures.getAsserts()));
|
|
| 34 | - ReportServiceFixtures.getAsserts().clear();
|
|
| 35 | - }
|
|
| 38 | + @Override
|
|
| 39 | + protected void setVariables(Report report) {
|
|
| 40 | + setVariableValue(report, "species", "fr.ird.referential.common.Species#1239832684537#0.2397229787936519");
|
|
| 41 | + setVariableValue(report, "sizeMeasureType", "fr.ird.referential.common.SizeMeasureType#1433499465700#0.0902433863375336");
|
|
| 36 | 42 | }
|
| 37 | - |
|
| 38 | 43 | }
|
| 44 | + |
| ... | ... | @@ -19,8 +19,24 @@ |
| 19 | 19 | # <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 20 | 20 | # #L%
|
| 21 | 21 | ###
|
| 22 | +syntax.name=Observations - Liste des captures selon le type de banc, filtrées par groupe
|
|
| 23 | +syntax.description=Afficher les captures par groupe d'espèce-Les poids sont exprimés en tonnes.
|
|
| 24 | +syntax.columns=3
|
|
| 25 | +syntax.rows=-1
|
|
| 26 | +syntax.columnsHeader=Espèce^Banc libre^Banc objet
|
|
| 27 | +syntax.nbRequests=3
|
|
| 28 | +result.columns=3
|
|
| 29 | +result.rows=49
|
|
| 22 | 30 | result.0=[FAO]CCB [sc]Carcharhinus brevipinna [fr]Requin tisserand^-^-
|
| 23 | 31 | result.1=[FAO]ALS [sc]Carcharhinus albimarginatus [fr]Requin pointe blanche^-^-
|
| 32 | +result.2=[FAO]AML [sc]Carcharhinus amblyrhynchos [fr]Grey reef shark^-^-
|
|
| 33 | +result.3=[FAO]PTH [sc]Alopias pelagicus [fr]Renard pélagique^-^-
|
|
| 34 | +result.4=[FAO]BTH [sc]Alopias superciliosus [fr]Renard à gros yeux^-^-
|
|
| 35 | +result.5=[FAO]ALV [sc]Alopias vulpinus [fr]Renard^-^+ Effectif : 3 Poids total (t) : 12.0
|
|
| 36 | +result.6=[FAO]BLR [sc]Carcharhinus melanopterus [fr]Requin pointes noires^-^-
|
|
| 37 | +result.7=[FAO]BRO [sc]Carcharhinus brachyurus [fr]Requin cuivre^-^-
|
|
| 38 | +result.8=[FAO]WSH [sc]Carcharodon carcharias [fr]Grand requin blanc^-^-
|
|
| 39 | +result.9=[FAO]CCE [sc]Carcharhinus leucas [fr]Requin bouledogue^-^-
|
|
| 24 | 40 | result.10=[FAO]CCL [sc]Carcharhinus limbatus [fr]Requin bordé^-^-
|
| 25 | 41 | result.11=[FAO]CCP [sc]Carcharhinus plumbeus [fr]Requin gris^-^-
|
| 26 | 42 | result.12=[FAO]FAL [sc]Carcharhinus falciformis [fr]Requin soyeux^-^-
|
| ... | ... | @@ -28,10 +44,9 @@ result.13=[FAO]OCS [sc]Carcharhinus longimanus [fr]Requin océanique^-^- |
| 28 | 44 | result.14=[FAO]CWZ [sc]Carcharhinus spp [fr]Requins Carcharhinus nca^-^-
|
| 29 | 45 | result.15=[FAO]DUS [sc]Carcharhinus obscurus [fr]Requin sombre^-^-
|
| 30 | 46 | result.16=[FAO]SHL [sc]Etmopterus spp [fr]Genre Etmopterus^-^-
|
| 31 | -result.17=[FAO]THR [sc]Alopias spp [fr]Renards de mer nca ^-^-
|
|
| 47 | +result.17=[FAO]THR [sc]Alopias spp [fr]Renards de mer nca^-^-
|
|
| 32 | 48 | result.18=[FAO]RSK [sc]Carcharhinidae spp [fr]Famille Carcharhinidae^-^-
|
| 33 | 49 | result.19=[FAO]MSK [sc]Lamnidae [fr]Famille Lamnidae^-^-
|
| 34 | -result.2=[FAO]AML [sc]Carcharhinus amblyrhynchos [fr]Grey reef shark^-^-
|
|
| 35 | 50 | result.20=[FAO]2FOD [sc]Odontaspididae [fr]Odontaspididae^-^-
|
| 36 | 51 | result.21=[FAO]2FRH [sc]Rhincodontidae [fr]Famille Rhincodontidae^-^-
|
| 37 | 52 | result.22=[FAO]SPY [sc]Sphyrnidae [fr]Famille Sphyrnidae^-^-
|
| ... | ... | @@ -42,18 +57,16 @@ result.26=[FAO]LMA [sc]Isurus paucus [fr]Petite taupe, Mako^-^- |
| 42 | 57 | result.27=[FAO]MAK [sc]Isurus spp [fr]Taupes^-^-
|
| 43 | 58 | result.28=[FAO]LMP [sc]Megachasma pelagios [fr]Requin grande gueule^-^-
|
| 44 | 59 | result.29=[FAO]CVX [sc]Carcharhiniformes [fr]Ordre Carcharhiniformes^-^-
|
| 45 | -result.3=[FAO]PTH [sc]Alopias pelagicus [fr]Renard pélagique^-^-
|
|
| 46 | 60 | result.30=[FAO]HDQ [sc]Heterodontiformes [fr]Ordre Heterodontiformes^-^-
|
| 47 | 61 | result.31=[FAO]HXW [sc]Hexanchiformes [fr]Ordre Hexanchiformes^-^-
|
| 48 | 62 | result.32=[FAO]LMZ [sc]Lamniformes [fr]Ordre Lamniformes^-^-
|
| 49 | 63 | result.33=[FAO]OCX [sc]Orectolobiformes [fr]Ordre Orectolobiformes^-^-
|
| 50 | -result.34=[FAO]PWS [sc]Pristiophorus spp [fr]Requins-scies nca ^-^-
|
|
| 64 | +result.34=[FAO]PWS [sc]Pristiophorus spp [fr]Requins-scies nca^-^-
|
|
| 51 | 65 | result.35=[FAO]OSF [sc]Stegostoma fasciatum [fr]Requin zèbre^-^-
|
| 52 | 66 | result.36=[FAO]SHX [sc]Squaliformes [fr]Ordre Squaliformes^-^-
|
| 53 | -result.37=[FAO]ASK [sc]Squatinidae [fr]Anges de mer nca ^-^-
|
|
| 67 | +result.37=[FAO]ASK [sc]Squatinidae [fr]Anges de mer nca^-^-
|
|
| 54 | 68 | result.38=[FAO]BSH [sc]Prionace glauca [fr]Peau bleue^-^-
|
| 55 | 69 | result.39=[FAO]POR [sc]Lamna nasus [fr]Requin taupe commun^-^-
|
| 56 | -result.4=[FAO]BTH [sc]Alopias superciliosus [fr]Renard à gros yeux^-^-
|
|
| 57 | 70 | result.40=[FAO]PSK [sc]Pseudocarcharias kamoharai [fr]Requin crocodile^-^-
|
| 58 | 71 | result.41=[FAO]2REX [sc]Requin non identifié [fr]Requin non identifié^-^-
|
| 59 | 72 | result.42=[FAO]BSK [sc]Cetorhinus maximus [fr]Requin pèlerin^-^-
|
| ... | ... | @@ -63,17 +76,3 @@ result.45=[FAO]SPL [sc]Sphyrna lewini [fr]Requin marteau halicorne^-^- |
| 63 | 76 | result.46=[FAO]SPK [sc]Sphyrna mokarran [fr]Grand requin marteau^-^-
|
| 64 | 77 | result.47=[FAO]SPN [sc]Sphyrna spp [fr]Requins marteau nca^-^-
|
| 65 | 78 | result.48=[FAO]SPZ [sc]Sphyrna zygaena [fr]Requin marteau commun^-^- |
| 66 | -result.5=[FAO]ALV [sc]Alopias vulpinus [fr]Renard^-^+ Effectif : 3 Poids total (t) : 12.0
|
|
| 67 | -result.6=[FAO]BLR [sc]Carcharhinus melanopterus [fr]Requin pointes noires^-^-
|
|
| 68 | -result.7=[FAO]BRO [sc]Carcharhinus brachyurus [fr]Requin cuivre^-^-
|
|
| 69 | -result.8=[FAO]WSH [sc]Carcharodon carcharias [fr]Grand requin blanc^-^-
|
|
| 70 | -result.9=[FAO]CCE [sc]Carcharhinus leucas [fr]Requin bouledogue^-^-
|
|
| 71 | -result.columns=3
|
|
| 72 | -result.rows=49
|
|
| 73 | -syntax.columns=3
|
|
| 74 | -syntax.columnsHeader=Espèce^Banc libre^Banc objet
|
|
| 75 | -syntax.description=Afficher les captures accessoires par groupe d'espèce-Les poids sont exprimés en tonnes.
|
|
| 76 | -syntax.name=Observations - Liste des captures accessoires selon le type de banc, filtrées par groupe
|
|
| 77 | -syntax.nbRequests=3
|
|
| 78 | -syntax.rows=-1
|
|
| 79 | -syntax.rowsHeader= |
| ... | ... | @@ -19,13 +19,13 @@ |
| 19 | 19 | # <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 20 | 20 | # #L%
|
| 21 | 21 | ###
|
| 22 | -result.0=[FAO]ALV [sc]Alopias vulpinus [fr]Renard^0^3^3^0^0^0^0^0^0^0.0
|
|
| 23 | -result.columns=11
|
|
| 22 | +result.0=[FAO]ALV [sc]Alopias vulpinus [fr]Renard^0^3^3^0^0^0^0^0^0^0^0^0^0^0^0^0.0
|
|
| 23 | +result.columns=17
|
|
| 24 | 24 | result.rows=1
|
| 25 | -syntax.columns=11
|
|
| 26 | -syntax.columnsHeader=Espèce^Total BL^Total BO^Sorti vivant/échappé^Sorti mort^Rejeté vivant^Rejeté mort^Partiellement conservé^Cuve^Cuisine^Autre
|
|
| 27 | -syntax.description=Afficher les nombres de captures accessoires par groupe d'espèce selon le type de banc et le devenir
|
|
| 28 | -syntax.name=Observations - Dénombrement des captures accessoires et devenir, filtrés par groupe
|
|
| 25 | +syntax.columns=17
|
|
| 26 | +syntax.columnsHeader=Espèce^Total BL^Total BO^Sorti vivant/échappé^Sorti mort^Rejeté vivant^Rejeté mort^Partiellement conservé^Cuve^Cuisine^Conservé pour le marché local ou poisson séché/salé à bord^Ailerons seulements^Rejeté statut inconnu (seulement pour l'observation électronique)^Conservé à des fins scientifiques^Rejeté suffocant^Rejeté blessé^Autre
|
|
| 27 | +syntax.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir
|
|
| 28 | +syntax.name=Observations - Dénombrement des captures par devenir, filtrés par groupe
|
|
| 29 | 29 | syntax.nbRequests=1
|
| 30 | 30 | syntax.rows=-1
|
| 31 | 31 | syntax.rowsHeader= |
| 1 | +###
|
|
| 2 | +# #%L
|
|
| 3 | +# ObServe Core :: Services :: Test
|
|
| 4 | +# %%
|
|
| 5 | +# Copyright (C) 2008 - 2022 IRD, Ultreia.io
|
|
| 6 | +# %%
|
|
| 7 | +# This program is free software: you can redistribute it and/or modify
|
|
| 8 | +# it under the terms of the GNU General Public License as
|
|
| 9 | +# published by the Free Software Foundation, either version 3 of the
|
|
| 10 | +# License, or (at your option) any later version.
|
|
| 11 | +#
|
|
| 12 | +# This program is distributed in the hope that it will be useful,
|
|
| 13 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 14 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 15 | +# GNU General Public License for more details.
|
|
| 16 | +#
|
|
| 17 | +# You should have received a copy of the GNU General Public
|
|
| 18 | +# License along with this program. If not, see
|
|
| 19 | +# <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 20 | +# #L%
|
|
| 21 | +###
|
|
| 22 | +syntax.name=Observations - Distribution des tailles par espèces et type de mesure
|
|
| 23 | +syntax.description=Afficher la nombre d'individus mesurés par classe de taille pour les espèces et le type de mesure
|
|
| 24 | +syntax.rows=-1
|
|
| 25 | +syntax.columns=-1
|
|
| 26 | +syntax.columnsHeader=
|
|
| 27 | +syntax.rowsHeader=
|
|
| 28 | +syntax.nbRequests=0
|
|
| 29 | +result.columns=3
|
|
| 30 | +result.rows=5
|
|
| 31 | +result.0=Classe de taille (cm)^Effectif ( devenir - Aucun )^Effectif total
|
|
| 32 | +result.1=50.0^2^2
|
|
| 33 | +result.2=54.0^1^1
|
|
| 34 | +result.3=68.0^1^1
|
|
| 35 | +result.4=70.0^1^1 |
| ... | ... | @@ -19,3 +19,17 @@ |
| 19 | 19 | # <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 20 | 20 | # #L%
|
| 21 | 21 | ###
|
| 22 | +syntax.name=Observations - Captures de thons selon le type d’association (en t)
|
|
| 23 | +syntax.description=Afficher la répartitions des captures de thons selon le type d'association
|
|
| 24 | +syntax.rows=5
|
|
| 25 | +syntax.columns=7
|
|
| 26 | +syntax.columnsHeader=YFT^SKJ^BET^LTA^FRI^Autres^Total
|
|
| 27 | +syntax.rowsHeader=BL sans baleine^BL avec baleine^BO avec requin-baleine^BO sans requin-baleine^Total
|
|
| 28 | +syntax.nbRequests=4
|
|
| 29 | +result.columns=7
|
|
| 30 | +result.rows=5
|
|
| 31 | +result.0=175.0^0.0^7.0^0.0^0.0^0.0^182.0
|
|
| 32 | +result.1=null^null^null^null^null^null^0.0
|
|
| 33 | +result.2=null^null^null^null^null^null^0.0
|
|
| 34 | +result.3=0.0^1.0^0.0^0.0^1.0^12.1406^14.1406
|
|
| 35 | +result.4=175.0^1.0^7.0^0.0^1.0^12.1406^196.1406 |
|
| \ No newline at end of file |
| ... | ... | @@ -19,11 +19,11 @@ |
| 19 | 19 | # <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 20 | 20 | # #L%
|
| 21 | 21 | ###
|
| 22 | -result.0=175.0^0.0^7.0^0.0^0.0^0.2882^182.2882
|
|
| 22 | +result.0=0.0^0.0^0.0^0.0^0.0^0.2882^0.2882
|
|
| 23 | 23 | result.1=null^null^null^null^null^null^0.0
|
| 24 | 24 | result.2=null^null^null^null^null^null^0.0
|
| 25 | -result.3=0.0^1.0^5.0^0.0^1.0^160.4436^167.4436
|
|
| 26 | -result.4=175.0^1.0^12.0^0.0^1.0^160.7318^349.7318
|
|
| 25 | +result.3=0.0^0.0^5.0^0.0^0.0^148.303^153.303
|
|
| 26 | +result.4=0.0^0.0^5.0^0.0^0.0^148.5912^153.5912
|
|
| 27 | 27 | result.columns=7
|
| 28 | 28 | result.rows=5
|
| 29 | 29 | syntax.columns=7
|
| ... | ... | @@ -159,7 +159,13 @@ public class DataMatrix implements JsonAware { |
| 159 | 159 | log.debug(String.format("copying incoming matrix (dim: %s, location: %s)", incoming.getDimension(), incoming.getLocation()));
|
| 160 | 160 | |
| 161 | 161 | for (int i = 0; i < width; i++) {
|
| 162 | + if (x + i < 0) {
|
|
| 163 | + continue;
|
|
| 164 | + }
|
|
| 162 | 165 | for (int j = 0; j < height; j++) {
|
| 166 | + if (y + j < 0) {
|
|
| 167 | + continue;
|
|
| 168 | + }
|
|
| 163 | 169 | Serializable value = incoming.getValue(i, j);
|
| 164 | 170 | setValue(x + i, y + j, value);
|
| 165 | 171 | }
|
| ... | ... | @@ -319,12 +319,14 @@ public class ReportBuilder { |
| 319 | 319 | Map.Entry<String, String> entry = itr.next();
|
| 320 | 320 | String key = entry.getKey();
|
| 321 | 321 | if (!key.startsWith(VARIABLE_PREFIX)) {
|
| 322 | - |
|
| 323 | 322 | continue;
|
| 324 | 323 | }
|
| 325 | 324 | String operations = entry.getValue();
|
| 326 | 325 | String id = key.substring(VARIABLE_PREFIX.length());
|
| 327 | - |
|
| 326 | + int indexOf = id.indexOf(".");
|
|
| 327 | + if (indexOf > -1) {
|
|
| 328 | + id = id.substring(indexOf + 1);
|
|
| 329 | + }
|
|
| 328 | 330 | // on interdit la surcharge d'une variable déjà trouvée pour le report
|
| 329 | 331 | if (ids.contains(id)) {
|
| 330 | 332 | throw new IllegalArgumentException("La variable " + id + " est déjà définie pour le report " + reportName);
|
| ... | ... | @@ -359,12 +361,14 @@ public class ReportBuilder { |
| 359 | 361 | Map.Entry<String, String> entry = itr.next();
|
| 360 | 362 | String key = entry.getKey();
|
| 361 | 363 | if (!key.startsWith(REPEAT_VARIABLE_PREFIX)) {
|
| 362 | - |
|
| 363 | 364 | continue;
|
| 364 | 365 | }
|
| 365 | 366 | String operations = entry.getValue();
|
| 366 | 367 | String id = key.substring(REPEAT_VARIABLE_PREFIX.length());
|
| 367 | - |
|
| 368 | + int indexOf = id.indexOf(".");
|
|
| 369 | + if (indexOf > -1) {
|
|
| 370 | + id = id.substring(indexOf + 1);
|
|
| 371 | + }
|
|
| 368 | 372 | // on interdit la surcharge d'une variable déjà trouvée pour le report
|
| 369 | 373 | if (ids.contains(id)) {
|
| 370 | 374 | throw new IllegalArgumentException("La variable de répétition " + id + " est déjà définie pour le report " + reportName);
|