[Git][ultreiaio/ird-observe][develop] Nouveau rapport PS / Observations & Logbooks / Captures par Zone FPA, espèce...
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 8cb7f1d6 by Tony Chemit at 2024-03-19T20:14:00+01:00 Nouveau rapport PS / Observations & Logbooks / Captures par Zone FPA, espèce et devenir - Closes #2856 - - - - - 9 changed files: - + core/persistence/report/src/main/resources/META-INF/report/default/ps/psLogbookCatchWeightByFPAZonePerSpeciesFate.report - + core/persistence/report/src/main/resources/META-INF/report/default/ps/psObservationCatchWeightByFPAZonePerSpeciesFate.report - core/persistence/report/src/main/resources/META-INF/report/embedded.list - core/persistence/report/src/test/java/fr/ird/observe/report/ToolsTest.java - + core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsLogbookCatchWeightByFPAZonePerSpeciesFateReportFixture.java - + core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByFPAZonePerSpeciesFateReportFixture.java - + core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psLogbookCatchWeightByFPAZonePerSpeciesFate.properties - + core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByFPAZonePerSpeciesFate.properties - core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService.properties Changes: ===================================== core/persistence/report/src/main/resources/META-INF/report/default/ps/psLogbookCatchWeightByFPAZonePerSpeciesFate.report ===================================== @@ -0,0 +1,89 @@ +### +# #%L +# ObServe Core :: Persistence :: Report +# %% +# Copyright (C) 2008 - 2023 IRD, Ultreia.io +# %% +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program. If not, see +# <http://www.gnu.org/licenses/gpl-3.0.html>. +# #L% +### +modelType=PS +name=Livre de bord - Devenir des captures par groupe d'espèces et par zone FPA filtré par groupe d'espèce (en t) +name.en=Logbook - Catch fates by species group and FPA zone, filtered per group (in t) +name.es= +description=Après sélection d'un groupe d'espèces, ce rapport retourne les poids capturés (en tonnes) par zone FPA et par devenir +description.en=Once a species group is selected, this report returns catch weights (in tons) by FPA zone and fate +description.es= +variable.1.name=speciesGroup +variable.1.type=fr.ird.observe.dto.referential.common.SpeciesGroupReference +variable.1.request=Select distinct sg \ +From TripImpl t \ +Join t.routeLogbook r \ +Join r.activity a \ +Join a.catches ca with ca.weight Is Not Null \ +Join ca.species e \ +Join e.speciesGroup sg \ +Where t.id In :tripId \ +Order By sg.code +repeatVariable.1.name=fpaZone +repeatVariable.1.type=fr.ird.observe.entities.referential.common.FpaZone +repeatVariable.1.request=Select distinct z \ +From TripImpl t \ +Join t.routeLogbook r \ +Join r.activity a \ +Join a.currentFpaZone z \ +Join a.catches ca with ca.weight Is Not Null And ca.species.speciesGroup.id = :speciesGroup \ +Where t.id In :tripId \ +Order By z.code, z.@i18nColumnName@ +repeatVariable.2.name=speciesFate +repeatVariable.2.type=fr.ird.observe.entities.referential.ps.common.SpeciesFate +repeatVariable.2.request=Select distinct sf \ +From TripImpl t \ +Join t.routeLogbook r \ +Join r.activity a \ +Join a.catches ca with ca.weight Is Not Null And ca.species.speciesGroup.id = :speciesGroup \ +Join ca.speciesFate sf \ +Where t.id In :tripId \ +Order by sf.discard, sf.code +request.1.location=0,0 +request.1.layout=row +request.1.request=Select \ +concat( z.code, ' - ', z.@i18nColumnName@) \ +From FpaZoneImpl z \ +Where z In :fpaZone \ +Group by z.code, z.@i18nColumnName@ +request.1.repeat.name=fpaZone +request.1.repeat.layout=column +operations.1.type=ExecuteRequestAndReorganizeDataByRepeatVariable +operations.1.parameters=fpaZone|speciesFate|Select \ +z.id, sf.id, Sum(ca.weight) \ +From TripImpl m \ +Join m.routeLogbook r \ +Join r.activity a \ +Join a.currentFpaZone z With z.id In :fpaZone \ +Join a.catches ca with ca.weight Is Not Null And ca.species.speciesGroup.id = :speciesGroup \ +Join ca.speciesFate sf with sf.id In :speciesFate \ +Where m.id In :tripId \ +Group by z, sf \ +Order By z.code +operations.2.type=ComputeDynamicHeader +operations.2.parameters=@fpaZone@|speciesFate +operations.3.type=SumRow +operations.3.parameters=0|1 +operations.4.type=SumColumn +operations.4.parameters=1|1 +i18n.fpaZone=Zone FPA +i18n.fpaZone.en=FPA Zone +i18n.fpaZone.es= \ No newline at end of file ===================================== core/persistence/report/src/main/resources/META-INF/report/default/ps/psObservationCatchWeightByFPAZonePerSpeciesFate.report ===================================== @@ -0,0 +1,93 @@ +### +# #%L +# ObServe Core :: Persistence :: Report +# %% +# Copyright (C) 2008 - 2023 IRD, Ultreia.io +# %% +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program. If not, see +# <http://www.gnu.org/licenses/gpl-3.0.html>. +# #L% +### +modelType=PS +name=Observations - Devenir des captures par groupe d'espèces et par zone FPA filtré par groupe d'espèce (en t) +name.en=Observation - Catch fates by species group and FPA zone, filtered per group (in t) +name.es= +description=Après sélection d'un groupe d'espèces, ce rapport retourne les poids capturés (en tonnes) par zone FPA et par devenir +description.en=Once a species group is selected, this report returns catch weights (in tons) by FPA zone and fate +description.es= +variable.1.name=speciesGroup +variable.1.type=fr.ird.observe.dto.referential.common.SpeciesGroupReference +variable.1.request=Select distinct sg \ +From TripImpl t \ +Join t.routeObs r \ +Join r.activity a \ +Join a.set c \ +Join c.catches ca with ca.catchWeight Is Not Null \ +Join ca.species e \ +Join e.speciesGroup sg \ +Where t.id In :tripId \ +Order By sg.code +repeatVariable.1.name=fpaZone +repeatVariable.1.type=fr.ird.observe.entities.referential.common.FpaZone +repeatVariable.1.request=Select distinct z \ +From TripImpl t \ +Join t.routeObs r \ +Join r.activity a \ +Join a.currentFpaZone z \ +Join a.set c \ +Join c.catches ca with ca.catchWeight Is Not Null And ca.species.speciesGroup.id = :speciesGroup \ +Where t.id In :tripId \ +Order By z.code, z.@i18nColumnName@ +repeatVariable.2.name=speciesFate +repeatVariable.2.type=fr.ird.observe.entities.referential.ps.common.SpeciesFate +repeatVariable.2.request=Select distinct sf \ +From TripImpl t \ +Join t.routeObs r \ +Join r.activity a \ +Join a.set c \ +Join c.catches ca with ca.catchWeight Is Not Null And ca.species.speciesGroup.id = :speciesGroup \ +Join ca.speciesFate sf \ +Where t.id In :tripId \ +Order by sf.discard, sf.code +request.1.location=0,0 +request.1.layout=row +request.1.request=Select \ +concat( z.code, ' - ', z.@i18nColumnName@) \ +From FpaZoneImpl z \ +Where z In :fpaZone \ +Group by z.code, z.@i18nColumnName@ +request.1.repeat.name=fpaZone +request.1.repeat.layout=column +operations.1.type=ExecuteRequestAndReorganizeDataByRepeatVariable +operations.1.parameters=fpaZone|speciesFate|Select \ +z.id, sf.id, Sum(ca.catchWeight) \ +From TripImpl m \ +Join m.routeObs r \ +Join r.activity a \ +Join a.currentFpaZone z With z.id In :fpaZone \ +Join a.set c \ +Join c.catches ca with ca.catchWeight Is Not Null And ca.species.speciesGroup.id = :speciesGroup \ +Join ca.speciesFate sf with sf.id In :speciesFate \ +Where m.id In :tripId \ +Group by z, sf \ +Order By z.code +operations.2.type=ComputeDynamicHeader +operations.2.parameters=@fpaZone@|speciesFate +operations.3.type=SumRow +operations.3.parameters=0|1 +operations.4.type=SumColumn +operations.4.parameters=1|1 +i18n.fpaZone=Zone FPA +i18n.fpaZone.en=FPA Zone +i18n.fpaZone.es= \ No newline at end of file ===================================== core/persistence/report/src/main/resources/META-INF/report/embedded.list ===================================== @@ -10,6 +10,7 @@ default/ps/psLocalmarketBatch.report default/ps/psLocalmarketSample.report default/ps/psLocalmarketSurvey.report default/ps/psLogbookActivity.report +default/ps/psLogbookCatchWeightByFPAZonePerSpeciesFate.report default/ps/psLogbookFobUsageExtended.report default/ps/psLogbookFobUsageMinimal.report default/ps/psLogbookSampleMeasures.report @@ -26,6 +27,7 @@ default/ps/psObservationCatch.report default/ps/psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.report default/ps/psObservationCatchTotalCountByGroupPerReasonForDiscard.report default/ps/psObservationCatchTotalCountByGroupPerSpeciesFate.report +default/ps/psObservationCatchWeightByFPAZonePerSpeciesFate.report default/ps/psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.report default/ps/psObservationCatchWeightByGroupPerReasonForDiscard.report default/ps/psObservationCatchWeightByGroupPerSpeciesFate.report ===================================== core/persistence/report/src/test/java/fr/ird/observe/report/ToolsTest.java ===================================== @@ -47,7 +47,7 @@ import java.util.Objects; public class ToolsTest { - public static final int REPORTS_COUNT_COUNT = 37; + public static final int REPORTS_COUNT_COUNT = 39; private static Path reportsPath(Path basedir) { return basedir.resolve("src").resolve("main").resolve("resources").resolve("META-INF").resolve("report"); ===================================== core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsLogbookCatchWeightByFPAZonePerSpeciesFateReportFixture.java ===================================== @@ -0,0 +1,53 @@ +package fr.ird.observe.services.service.report.ps; + +/*- + * #%L + * ObServe Core :: Services :: Test + * %% + * Copyright (C) 2008 - 2024 IRD, Ultreia.io + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import com.google.auto.service.AutoService; +import fr.ird.observe.report.Report; +import fr.ird.observe.report.definition.ReportRequestDefinition; +import fr.ird.observe.report.definition.RequestLayout; +import fr.ird.observe.services.service.ReportFixture; + +import java.util.Iterator; + +/** + * Created at 19/03/2024. + * + * @author Tony Chemit - dev@tchemit.fr + * @since 9.3.0 + */ +@AutoService(ReportFixture.class) +public class PsLogbookCatchWeightByFPAZonePerSpeciesFateReportFixture extends ReportFixture { + + @Override + public void assertSyntax(Report report) { + super.assertSyntax(report); + Iterator<ReportRequestDefinition> requests = getRequestIterator(report); + assertReportRequestDimension(requests, RequestLayout.row, 0, 0); + } + + @Override + protected void setVariables(Report report) { + setVariableValue(report, "speciesGroup", "fr.ird.referential.common.SpeciesGroup#1239832683689#0.7120116158620075"); + } +} ===================================== core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByFPAZonePerSpeciesFateReportFixture.java ===================================== @@ -0,0 +1,53 @@ +package fr.ird.observe.services.service.report.ps; + +/*- + * #%L + * ObServe Core :: Services :: Test + * %% + * Copyright (C) 2008 - 2024 IRD, Ultreia.io + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import com.google.auto.service.AutoService; +import fr.ird.observe.report.Report; +import fr.ird.observe.report.definition.ReportRequestDefinition; +import fr.ird.observe.report.definition.RequestLayout; +import fr.ird.observe.services.service.ReportFixture; + +import java.util.Iterator; + +/** + * Created at 19/03/2024. + * + * @author Tony Chemit - dev@tchemit.fr + * @since 9.3.0 + */ +@AutoService(ReportFixture.class) +public class PsObservationCatchWeightByFPAZonePerSpeciesFateReportFixture extends ReportFixture { + + @Override + public void assertSyntax(Report report) { + super.assertSyntax(report); + Iterator<ReportRequestDefinition> requests = getRequestIterator(report); + assertReportRequestDimension(requests, RequestLayout.row, 0, 0); + } + + @Override + protected void setVariables(Report report) { + setVariableValue(report, "speciesGroup", "fr.ird.referential.common.SpeciesGroup#1239832683689#0.7120116158620075"); + } +} ===================================== core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psLogbookCatchWeightByFPAZonePerSpeciesFate.properties ===================================== @@ -0,0 +1,28 @@ +### +# #%L +# ObServe Core :: Services :: Test +# %% +# Copyright (C) 2008 - 2024 IRD, Ultreia.io +# %% +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program. If not, see +# <http://www.gnu.org/licenses/gpl-3.0.html>. +# #L% +### +syntax.name=Livre de bord - Devenir des captures par groupe d'espèces et par zone FPA filtré par groupe d'espèce (en t) +syntax.description=Après sélection d'un groupe d'espèces, ce rapport retourne les poids capturés (en tonnes) par zone FPA et par devenir +syntax.rows=-1 +syntax.columns=-1 +syntax.columnsHeader= +syntax.rowsHeader= +syntax.nbRequests=1 ===================================== core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByFPAZonePerSpeciesFate.properties ===================================== @@ -0,0 +1,32 @@ +### +# #%L +# ObServe Core :: Services :: Test +# %% +# Copyright (C) 2008 - 2024 IRD, Ultreia.io +# %% +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program. If not, see +# <http://www.gnu.org/licenses/gpl-3.0.html>. +# #L% +### +syntax.name=Observations - Devenir des captures par groupe d'espèces et par zone FPA filtré par groupe d'espèce (en t) +syntax.description=Après sélection d'un groupe d'espèces, ce rapport retourne les poids capturés (en tonnes) par zone FPA et par devenir +syntax.rows=-1 +syntax.columns=-1 +syntax.columnsHeader= +syntax.rowsHeader= +syntax.nbRequests=1 +result.columns=2 +result.rows=2 +result.0=Zone FPA^Echappe du filet (pour requin-baleine et cétacés) +result.1=CIV - Côte d'Ivoire^12.0 ===================================== core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService.properties ===================================== @@ -19,4 +19,4 @@ # <http://www.gnu.org/licenses/gpl-3.0.html>. # #L% ### -report.count=37 +report.count=39 View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/8cb7f1d683c1bc48845193e8a3... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/8cb7f1d683c1bc48845193e8a3... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT (@tchemit)