Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe

Commits:

6 changed files:

Changes:

  • core/api/dto/src/main/resources/observe-reports.properties
    ... ... @@ -887,12 +887,12 @@ report.psObservationCatch.request.3=2,0|row|\
    887 887
       Where m.id In :tripId
    
    888 888
     report.psObservationCatch.request.3.repeat=speciesId|column
    
    889 889
     ################################################################################
    
    890
    -## Captures par groupe d'espèces
    
    890
    +## Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
    
    891 891
     ################################################################################
    
    892
    -report.psObservationCatchByGroup.modelType=PS
    
    893
    -report.psObservationCatchByGroup.name=Observations - Dénombrement des captures par type de banc et 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.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
    
    892
    +report.psObservationCatchTotalCountByGroup.modelType=PS
    
    893
    +report.psObservationCatchTotalCountByGroup.name=Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
    
    894
    +report.psObservationCatchTotalCountByGroup.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir, filtré par groupe
    
    895
    +report.psObservationCatchTotalCountByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
    
    896 896
     Select distinct sg \
    
    897 897
     From TripImpl t \
    
    898 898
     Join t.routeObs r \
    
    ... ... @@ -903,7 +903,7 @@ Join ca.species e \
    903 903
     Join e.speciesGroup sg \
    
    904 904
     Where t.id In :tripId \
    
    905 905
     Order By sg.code
    
    906
    -report.psObservationCatchByGroup.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
    
    906
    +report.psObservationCatchTotalCountByGroup.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
    
    907 907
     Select distinct e \
    
    908 908
     From TripImpl t \
    
    909 909
     Join t.routeObs r \
    
    ... ... @@ -913,11 +913,11 @@ Join c.catches ca with ca.totalCount Is Not Null \
    913 913
     Join ca.species e with e.speciesGroup.id = :speciesGroup \
    
    914 914
     Where t.id In :tripId \
    
    915 915
     Order By e.homeId
    
    916
    -report.psObservationCatchByGroup.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
    
    916
    +report.psObservationCatchTotalCountByGroup.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
    
    917 917
     Select sf \
    
    918 918
     From SpeciesFateImpl sf \
    
    919 919
     Order by sf.discard, sf.code
    
    920
    -report.psObservationCatchByGroup.request.1=0,0|row|\
    
    920
    +report.psObservationCatchTotalCountByGroup.request.1=0,0|row|\
    
    921 921
       Select \
    
    922 922
         concat(\
    
    923 923
           '[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
    
    ... ... @@ -934,7 +934,7 @@ report.psObservationCatchByGroup.request.1=0,0|row|\
    934 934
       Where m.id In :tripId \
    
    935 935
       Group by e \
    
    936 936
       Order By e.homeId
    
    937
    -report.psObservationCatchByGroup.operations.1=ExecuteRequestAndReorganizeCountByRepeatVariable:species|speciesFate|\
    
    937
    +report.psObservationCatchTotalCountByGroup.operations.1=ExecuteRequestAndReorganizeCountByRepeatVariable:species|speciesFate|\
    
    938 938
     Select \
    
    939 939
     s.id, sf.id, Sum(ca.totalCount) \
    
    940 940
     From TripImpl m \
    
    ... ... @@ -947,9 +947,73 @@ Join ca.speciesFate sf with sf.id In :speciesFate \
    947 947
     Where m.id In :tripId \
    
    948 948
     Group by s, sf \
    
    949 949
     Order By s.homeId
    
    950
    -report.psObservationCatchByGroup.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
    
    951
    -report.psObservationCatchByGroup.operations.3=SumIntRow:1|3
    
    952
    -report.psObservationCatchByGroup.operations.4=SumIntColumn:1|1
    
    950
    +report.psObservationCatchTotalCountByGroup.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
    
    951
    +report.psObservationCatchTotalCountByGroup.operations.3=SumIntRow:1|3
    
    952
    +report.psObservationCatchTotalCountByGroup.operations.4=SumIntColumn:1|1
    
    953
    +################################################################################
    
    954
    +## Poids des captures par groupe d'espèces
    
    955
    +################################################################################
    
    956
    +report.psObservationCatchWeightByGroup.modelType=PS
    
    957
    +report.psObservationCatchWeightByGroup.name=Observations - Poids des captures par type de banc et devenir, filtrés par groupe
    
    958
    +report.psObservationCatchWeightByGroup.description=Afficher le poids de captures par groupe d'espèce selon le type de banc et le devenir, filtrés par groupe
    
    959
    +report.psObservationCatchWeightByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
    
    960
    +Select distinct sg \
    
    961
    +From TripImpl t \
    
    962
    +Join t.routeObs r \
    
    963
    +Join r.activity a \
    
    964
    +Join a.set c \
    
    965
    +Join c.catches ca with ca.totalCount Is Not Null \
    
    966
    +Join ca.species e \
    
    967
    +Join e.speciesGroup sg \
    
    968
    +Where t.id In :tripId \
    
    969
    +Order By sg.code
    
    970
    +report.psObservationCatchWeightByGroup.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
    
    971
    +Select distinct e \
    
    972
    +From TripImpl t \
    
    973
    +Join t.routeObs r \
    
    974
    +Join r.activity a \
    
    975
    +Join a.set c \
    
    976
    +Join c.catches ca with ca.catchWeight Is Not Null \
    
    977
    +Join ca.species e with e.speciesGroup.id = :speciesGroup \
    
    978
    +Where t.id In :tripId \
    
    979
    +Order By e.homeId
    
    980
    +report.psObservationCatchWeightByGroup.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
    
    981
    +Select sf \
    
    982
    +From SpeciesFateImpl sf \
    
    983
    +Order by sf.discard, sf.code
    
    984
    +report.psObservationCatchWeightByGroup.request.1=0,0|row|\
    
    985
    +  Select \
    
    986
    +    concat(\
    
    987
    +      '[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
    
    988
    +      ' [sc]', (case when e.scientificLabel is not null then e.scientificLabel else '-' end), \
    
    989
    +      ' [fr]', (case when e.label2 is not null then e.label2 else '-' end)), \
    
    990
    +    Sum(case c.schoolType.id when 'fr.ird.referential.ps.common.SchoolType#0#2' then ca.catchWeight else 0 end), \
    
    991
    +    Sum(case c.schoolType.id when 'fr.ird.referential.ps.common.SchoolType#0#1' then ca.catchWeight else 0 end) \
    
    992
    +  From TripImpl m \
    
    993
    +  Join m.routeObs r \
    
    994
    +  Join r.activity a \
    
    995
    +  Join a.set c \
    
    996
    +  Join c.catches ca with ca.catchWeight Is Not Null \
    
    997
    +  Join ca.species e with e.id In :species \
    
    998
    +  Where m.id In :tripId \
    
    999
    +  Group by e \
    
    1000
    +  Order By e.homeId
    
    1001
    +report.psObservationCatchWeightByGroup.operations.1=ExecuteRequestAndReorganizeCountByRepeatVariable:species|speciesFate|\
    
    1002
    +Select \
    
    1003
    +s.id, sf.id, Sum(ca.catchWeight) \
    
    1004
    +From TripImpl m \
    
    1005
    +Join m.routeObs r \
    
    1006
    +Join r.activity a \
    
    1007
    +Join a.set c \
    
    1008
    +Join c.catches ca \
    
    1009
    +Join ca.species s with s.id In :species \
    
    1010
    +Join ca.speciesFate sf with sf.id In :speciesFate \
    
    1011
    +Where m.id In :tripId \
    
    1012
    +Group by s, sf \
    
    1013
    +Order By s.homeId
    
    1014
    +report.psObservationCatchWeightByGroup.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
    
    1015
    +report.psObservationCatchWeightByGroup.operations.3=SumIntRow:1|3
    
    1016
    +report.psObservationCatchWeightByGroup.operations.4=SumIntColumn:1|1
    
    953 1017
     ###########################################################
    
    954 1018
     ## Distribution des tailles par espèces et type de mesure
    
    955 1019
     ###########################################################
    

  • core/services/local/src/test/java/fr/ird/observe/services/local/service/ReportServiceLocalReadTest.java
    ... ... @@ -37,8 +37,13 @@ public class ReportServiceLocalReadTest extends GeneratedReportServiceLocalReadT
    37 37
         }
    
    38 38
     
    
    39 39
         @Test
    
    40
    -    public void executeReportPsObservationCatchByGroup() {
    
    40
    +    public void executeReportPsObservationCatchTotalCountByGroup() {
    
    41 41
             ReportService service = getService();
    
    42
    -        fixtures.executeReport(getServicesProvider(), service, "psObservationCatchByGroup");
    
    42
    +        fixtures.executeReport(getServicesProvider(), service, "psObservationCatchTotalCountByGroup");
    
    43
    +    }
    
    44
    +    @Test
    
    45
    +    public void executeReportPsObservationCatchWeightByGroup() {
    
    46
    +        ReportService service = getService();
    
    47
    +        fixtures.executeReport(getServicesProvider(), service, "psObservationCatchWeightByGroup");
    
    43 48
         }
    
    44 49
     }

  • core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchByGroupReportFixture.javacore/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchTotalCountByGroupReportFixture.java
    ... ... @@ -29,13 +29,13 @@ import fr.ird.observe.services.service.ReportFixture;
    29 29
     import java.util.Iterator;
    
    30 30
     
    
    31 31
     /**
    
    32
    - * Pour tester le report {@code discardedAccessoireByGroup}
    
    32
    + * Pour tester le report {@code psObservationCatchTotalCountByGroup}
    
    33 33
      *
    
    34 34
      * @author Tony Chemit - dev@tchemit.fr
    
    35 35
      * @since 1.9
    
    36 36
      */
    
    37 37
     @AutoService(ReportFixture.class)
    
    38
    -public class PsObservationCatchByGroupReportFixture extends ReportFixture {
    
    38
    +public class PsObservationCatchTotalCountByGroupReportFixture extends ReportFixture {
    
    39 39
     
    
    40 40
         @Override
    
    41 41
         public void assertSyntax(Report report) {
    

  • core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupReportFixture.java
    1
    +package fr.ird.observe.services.service.report.ps;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe Core :: Services :: Test
    
    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.Report;
    
    27
    +import fr.ird.observe.dto.report.ReportRequest;
    
    28
    +import fr.ird.observe.services.service.ReportFixture;
    
    29
    +
    
    30
    +import java.util.Iterator;
    
    31
    +
    
    32
    +/**
    
    33
    + * Created on 05/12/2022.
    
    34
    + *
    
    35
    + * @author Tony Chemit - dev@tchemit.fr
    
    36
    + * @since 9.0.22
    
    37
    + */
    
    38
    +@AutoService(ReportFixture.class)
    
    39
    +public class PsObservationCatchWeightByGroupReportFixture extends ReportFixture {
    
    40
    +
    
    41
    +    @Override
    
    42
    +    public void assertSyntax(Report report) {
    
    43
    +        super.assertSyntax(report);
    
    44
    +        super.assertSyntax(report);
    
    45
    +        Iterator<ReportRequest> requests = getRequestIterator(report);
    
    46
    +        assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 0, 0);
    
    47
    +    }
    
    48
    +
    
    49
    +    @Override
    
    50
    +    protected void setVariables(Report report) {
    
    51
    +        setVariableValue(report, "speciesGroup", "fr.ird.referential.common.SpeciesGroup#1239832683689#0.7120116158620075");
    
    52
    +    }
    
    53
    +}

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchByGroup.propertiescore/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroup.properties
    ... ... @@ -20,7 +20,7 @@
    20 20
     # #L%
    
    21 21
     ###
    
    22 22
     syntax.name=Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
    
    23
    -syntax.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir
    
    23
    +syntax.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir, filtré par groupe
    
    24 24
     syntax.rows=-1
    
    25 25
     syntax.columns=-1
    
    26 26
     syntax.columnsHeader=
    

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroup.properties
    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 - Poids des captures par type de banc et devenir, filtrés par groupe
    
    23
    +syntax.description=Afficher le poids de captures par groupe d'espèce selon le type de banc et le devenir, filtrés par groupe
    
    24
    +syntax.rows=-1
    
    25
    +syntax.columns=-1
    
    26
    +syntax.columnsHeader=
    
    27
    +syntax.rowsHeader=
    
    28
    +syntax.nbRequests=1
    
    29
    +result.columns=19
    
    30
    +result.rows=2
    
    31
    +result.0=Espèce^Total BL^Total BO^Ailerons seulements^Partiellement conservé (ex: ailerons de requin, poisson séché)^Autres (à préciser dans les notes)^Conservé pour raisons scientifiques^Conservé pour le marché local ou poisson séché/salé à bord^Conservé à destination de la conserverie^Utilisé en cuisine du bord^Echappe du filet (pour requin-baleine et cétacés)^Rejeté, statut non observé^Rejeté suffocant^Rejeté suffocant blessé^Sortie vivant du filet (pour requin-baleine et cétacés)^Sortie mort du filet (pour requin-baleine et cétacés)^Rejeté vivant^Rejeté mort^Total
    
    32
    +result.1=[FAO]ALV [sc]Alopias vulpinus [fr]Renard^0.0^12.0^null^null^null^null^null^null^null^12.0^null^null^null^null^null^null^null^12
    \ No newline at end of file