Observe-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
December 2022
- 1 participants
- 58 discussions
10 Dec '22
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
747f5194 by Tony Chemit at 2022-12-11T00:56:52+01:00
update pom
- - - - -
9bebca7f by Tony Chemit at 2022-12-11T00:57:17+01:00
Report - Fix SumColumn and SumRow total cell condition
- - - - -
9d195aef by Tony Chemit at 2022-12-11T00:57:21+01:00
Report - Fix syntax.columnsHeader assert
- - - - -
e79d8d76 by Tony Chemit at 2022-12-11T00:57:24+01:00
Report - Fix SumColumn and SumRow total cell condition (on psLogbookWellPlanCheck report)
- - - - -
9d070c7d by Tony Chemit at 2022-12-11T00:57:28+01:00
Report - Improve how to detect a variable in a request (can have :xxx,)
- - - - -
3dbafec5 by Tony Chemit at 2022-12-11T00:57:31+01:00
Report - Add possible Boolean report variable
- - - - -
7933cad8 by Tony Chemit at 2022-12-11T00:57:36+01:00
Report - Add report psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation
- - - - -
afb181a3 by Tony Chemit at 2022-12-11T00:57:40+01:00
Report - Add report psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation
- - - - -
424f54de by Tony Chemit at 2022-12-11T00:57:43+01:00
Persistence - be able to add a null parameter in a query
- - - - -
8a2e9e77 by Tony Chemit at 2022-12-11T00:57:49+01:00
Merge branch 'feature/issue_2552' into develop
Optimisation des rapports Captures de thons selon le type d'association et Rejets de thons selon le type d'association
- Closes #2552
- - - - -
15 changed files:
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/report/ReportUIHandler.java
- core/api/dto/src/main/resources/observe-reports.properties
- 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/ReportFixture.java
- + core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociationReportFixture.java
- + core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociationReportFixture.java
- core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psLogbookWellPlanCheck.properties
- + core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.properties
- + core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.properties
- pom.xml
- toolkit/api/src/main/java/fr/ird/observe/dto/report/Report.java
- toolkit/api/src/main/java/fr/ird/observe/dto/report/operations/SumColumn.java
- toolkit/api/src/main/java/fr/ird/observe/dto/report/operations/SumRow.java
- toolkit/persistence/src/main/java/fr/ird/observe/spi/report/DefaultReportRequestExecutor.java
- toolkit/persistence/src/main/java/org/nuiton/topia/persistence/internal/support/HibernateTopiaJpaSupport.java
Changes:
=====================================
client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/report/ReportUIHandler.java
=====================================
@@ -41,6 +41,7 @@ import fr.ird.observe.spi.module.BusinessProjectMapping;
import fr.ird.observe.spi.module.ObserveBusinessProject;
import io.ultreia.java4all.bean.JavaBean;
import io.ultreia.java4all.decoration.Decorator;
+import io.ultreia.java4all.jaxx.widgets.choice.BooleanEditor;
import io.ultreia.java4all.jaxx.widgets.combobox.FilterableComboBox;
import io.ultreia.java4all.util.TimeLog;
import org.apache.logging.log4j.LogManager;
@@ -220,43 +221,79 @@ public class ReportUIHandler extends AdminTabUIHandler<ReportUI> implements UIHa
for (ReportVariable variable : report.getVariables()) {
String variableName = variable.getName();
Set values = variable.getValues();
- List<JavaBean> universe = new ArrayList<>(values);
log.info("Variable type: " + variable.getType());
//FIXME Decorators, let's object deal with it and never ask at this level... Just do a toString()...
Decorator decorator;
Class type;
BusinessProjectMapping mapping = ObserveBusinessProject.get().getMapping();
- if (ReferentialDto.class.isAssignableFrom(variable.getType()) && !universe.isEmpty()) {
+ if (ReferentialDto.class.isAssignableFrom(variable.getType()) && !values.isEmpty()) {
type = mapping.getReferenceType(variable.getType());
decorator = getDecoratorService().getDecoratorByType(type);
- } else if (DataDto.class.isAssignableFrom(variable.getType()) && !universe.isEmpty()) {
+ } else if (DataDto.class.isAssignableFrom(variable.getType()) && !values.isEmpty()) {
type = mapping.getReferenceType(variable.getType());
decorator = getDecoratorService().getDecoratorByType(type);
+ } else if (Boolean.class.isAssignableFrom(variable.getType()) && !values.isEmpty()) {
+ type = variable.getType();
+ decorator = null;
} else {
type = variable.getType();
decorator = getDecoratorService().getDecoratorByType(type);
}
log.info(String.format("Variable real type: %s", type));
- FilterableComboBox<?> combo = UIHelper.newFilterableComboBox(type, decorator, universe);
- combo.setShowReset(true);
- JPanel p = new JPanel(new BorderLayout());
- p.add(new JLabel(t(I18nDecoratorHelper.getType(variable.getType()))), BorderLayout.WEST);
- p.add(combo, BorderLayout.CENTER);
- variablesPanel.add(p);
- JComboBox<?> jComboBox = combo.getCombobox();
- jComboBox.putClientProperty(VARIABLE_NAME, variableName);
- jComboBox.addItemListener(e -> {
- JComboBox<?> comboBox = (JComboBox<?>) e.getSource();
- if (e.getStateChange() == ItemEvent.DESELECTED) {
- // ne rien faire de l'évènement de déselection sauf si le modèle devient vide
- if (comboBox.getSelectedItem() == null) {
- updateVariable(comboBox, null);
- }
- return;
+ if (type.equals(Boolean.class)) {
+ BooleanEditor.Builder builder = BooleanEditor.newBuilder();
+ if (values.contains(false)) {
+ builder.addFalseEntry("conservé");
+ }
+ if (values.contains(true)) {
+ builder.addTrueEntry("rejeté");
}
- Object o = e.getItem();
- updateVariable(comboBox, o);
- });
+ if (values.contains(null)) {
+ builder.addNullEntry("inconnu");
+ }
+ BooleanEditor jComboBox = builder.build();
+ JPanel p = new JPanel(new BorderLayout());
+ //FIXME Add i18n from the reportName + reportVariableName
+ p.add(new JLabel("Mode (conservé/rejeté/inconnu)"), BorderLayout.WEST);
+ p.add(jComboBox, BorderLayout.CENTER);
+ variablesPanel.add(p);
+ jComboBox.putClientProperty(VARIABLE_NAME, variableName);
+ jComboBox.addItemListener(e -> {
+ JComboBox<?> comboBox = (JComboBox<?>) e.getSource();
+ if (e.getStateChange() == ItemEvent.DESELECTED) {
+ // ne rien faire de l'évènement de déselection sauf si le modèle devient vide
+ if (comboBox.getSelectedItem() == null) {
+ updateVariable(comboBox, null);
+ }
+ return;
+ }
+ Boolean booleanValue = jComboBox.getBooleanValue();
+ updateVariable(comboBox, booleanValue);
+ });
+ } else {
+ List<JavaBean> universe = new ArrayList<>(values);
+ FilterableComboBox<?> combo = UIHelper.newFilterableComboBox(type, decorator, universe);
+ combo.setShowReset(true);
+ JPanel p = new JPanel(new BorderLayout());
+ p.add(new JLabel(t(I18nDecoratorHelper.getType(variable.getType()))), BorderLayout.WEST);
+ p.add(combo, BorderLayout.CENTER);
+ variablesPanel.add(p);
+ JComboBox<?> jComboBox = combo.getCombobox();
+ jComboBox.putClientProperty(VARIABLE_NAME, variableName);
+ jComboBox.addItemListener(e -> {
+ JComboBox<?> comboBox = (JComboBox<?>) e.getSource();
+ if (e.getStateChange() == ItemEvent.DESELECTED) {
+ // ne rien faire de l'évènement de déselection sauf si le modèle devient vide
+ if (comboBox.getSelectedItem() == null) {
+ updateVariable(comboBox, null);
+ }
+ return;
+ }
+ Object o = e.getItem();
+ updateVariable(comboBox, o);
+ });
+ }
+
}
}
=====================================
core/api/dto/src/main/resources/observe-reports.properties
=====================================
@@ -567,6 +567,266 @@ report.psObservationSetByAssociation.request.8=3,1|column|\
and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \
and os not in elements(a.observedSystem)
################################################################################
+## Observations - Poids des captures selon le type d'association, filtrées par groupe et rejet
+################################################################################
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.modelType=PS
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.name=Observations - Poids des captures selon le type d'association, filtrées par groupe et mode (rejeté/conservé) (en t)
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.description=Afficher le poids de rejets par groupe d'espèces et mode (rejeté/conservé) selon le type d'association
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.columns=Espèce,BL sans baleine,BL avec baleine,BO avec requin-baleine,BO sans requin-baleine,Total
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.variable.1.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
+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
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.variable.2.discardMode=java.lang.Boolean|\
+Select distinct sf.discard \
+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.speciesFate sf \
+Where t.id In :tripId \
+Order By sf.discard
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
+Select distinct e \
+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.speciesFate.discard = :discardMode \
+Join ca.species e with e.speciesGroup.id = :speciesGroup \
+Where t.id In :tripId \
+Order By e.faoCode
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.operations.1=SumRow:0|1
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.operations.2=SumColumn:0|1
+# Colonne 1 (les espèces)
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.request.1=0,0|row|\
+ Select \
+ concat(\
+ '[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
+ ' [sc]', (case when e.scientificLabel is not null then e.scientificLabel else '-' end), \
+ ' [fr]', (case when e.label2 is not null then e.label2 else '-' end)) \
+ From SpeciesImpl e \
+ Where e = :species
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.request.1.repeat=species|column
+# colonne 2 (BL sans baleine)
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.request.2=1,0|row|\
+ Select Sum(CASE When ca.species = :species Then ca.catchWeight Else 0.0 End) \
+ From TripImpl m \
+ Join m.routeObs r \
+ Join r.activity a \
+ Join a.set c with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#2' \
+ Join c.catches ca with ca.catchWeight Is Not Null \
+ Join ca.speciesFate sf with sf.discard = :discardMode, \
+ ObservedSystemImpl os, \
+ SpeciesImpl e \
+ Where \
+ m.id In :tripId \
+ And e = :species \
+ And os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9395222812356602' \
+ And os not in elements(a.observedSystem) \
+ Group by e
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.request.2.repeat=species|column
+# colonne 3 (BL avec baleine)
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.request.3=2,0|row|\
+ Select Sum(CASE When ca.species = :species Then ca.catchWeight Else 0.0 End) \
+ From TripImpl m \
+ Join m.routeObs r \
+ Join r.activity a \
+ Join a.set c with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#2' \
+ Join c.catches ca with ca.catchWeight Is Not Null \
+ Join ca.speciesFate sf with sf.discard = :discardMode, \
+ ObservedSystemImpl os, \
+ SpeciesImpl e \
+ Where \
+ m.id In :tripId \
+ And e = :species \
+ And os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9395222812356602' \
+ And os in elements(a.observedSystem) \
+ Group by e
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.request.3.repeat=species|column
+# colonne 4 (BO avec requin-baleine)
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.request.4=3,0|row|\
+ Select Sum(CASE When ca.species = :species Then ca.catchWeight Else 0.0 End) \
+ From TripImpl m \
+ Join m.routeObs r \
+ Join r.activity a \
+ Join a.set c with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#1' \
+ Join c.catches ca with ca.catchWeight Is Not Null \
+ Join ca.speciesFate sf with sf.discard = :discardMode, \
+ ObservedSystemImpl os1, \
+ ObservedSystemImpl os2, \
+ ObservedSystemImpl os3, \
+ SpeciesImpl e \
+ Where \
+ m.id In :tripId \
+ And e = :species \
+ And os1.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \
+ And os2.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#0#1.0' \
+ And os3.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#0#1.1' \
+ And ( os1 in elements(a.observedSystem) Or os2 in elements(a.observedSystem) Or os3 in elements(a.observedSystem) ) \
+ Group by e
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.request.4.repeat=species|column
+# colonne 5 (BO sans requin-baleine)
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.request.5=4,0|row|\
+ Select Sum(CASE When ca.species = :species Then ca.catchWeight Else 0.0 End) \
+ From TripImpl m \
+ Join m.routeObs r \
+ Join r.activity a \
+ Join a.set c with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#1' \
+ Join c.catches ca with ca.catchWeight Is Not Null \
+ Join ca.speciesFate sf with sf.discard = :discardMode, \
+ ObservedSystemImpl os1, \
+ ObservedSystemImpl os2, \
+ ObservedSystemImpl os3, \
+ SpeciesImpl e \
+ Where \
+ m.id In :tripId \
+ And e = :species \
+ And os1.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \
+ And os2.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#0#1.0' \
+ And os3.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#0#1.1' \
+ And os1 not in elements(a.observedSystem) And os2 not in elements(a.observedSystem) And os3 not in elements(a.observedSystem) \
+ Group by e
+report.psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.request.5.repeat=species|column
+################################################################################
+## Observations - Dénombrement des captures selon le type d'association, filtrées par groupe et rejet
+################################################################################
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.modelType=PS
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.name=Observations - Dénombrement des captures selon le type d'association, filtrées par groupe et mode (rejeté/conservé)
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.description=Afficher le dénombrement de rejets par groupe d'espèces et mode (rejeté/conservé) selon le type d'association
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.columns=Espèce,BL sans baleine,BL avec baleine,BO avec requin-baleine,BO sans requin-baleine,Total
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.variable.1.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
+Select distinct sg \
+From TripImpl t \
+Join t.routeObs r \
+Join r.activity a \
+Join a.set c \
+Join c.catches ca with ca.totalCount Is Not Null \
+Join ca.species e \
+Join e.speciesGroup sg \
+Where t.id In :tripId \
+Order By sg.code
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.variable.2.discardMode=java.lang.Boolean|\
+Select distinct sf.discard \
+From TripImpl t \
+Join t.routeObs r \
+Join r.activity a \
+Join a.set c \
+Join c.catches ca with ca.totalCount Is Not Null \
+Join ca.speciesFate sf \
+Where t.id In :tripId \
+Order By sf.discard
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
+Select distinct e \
+From TripImpl t \
+Join t.routeObs r \
+Join r.activity a \
+Join a.set c \
+Join c.catches ca with ca.totalCount Is Not Null And ca.speciesFate.discard = :discardMode \
+Join ca.species e with e.speciesGroup.id = :speciesGroup \
+Where t.id In :tripId \
+Order By e.faoCode
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.operations.1=SumIntRow:0|1
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.operations.2=SumIntColumn:0|1
+# Colonne 1 (les espèces)
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.request.1=0,0|row|\
+ Select \
+ concat(\
+ '[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
+ ' [sc]', (case when e.scientificLabel is not null then e.scientificLabel else '-' end), \
+ ' [fr]', (case when e.label2 is not null then e.label2 else '-' end)) \
+ From SpeciesImpl e \
+ Where e = :species
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.request.1.repeat=species|column
+# colonne 2 (BL sans baleine)
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.request.2=1,0|row|\
+ Select Sum(CASE When ca.species = :species Then ca.totalCount Else 0.0 End) \
+ From TripImpl m \
+ Join m.routeObs r \
+ Join r.activity a \
+ Join a.set c with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#2' \
+ Join c.catches ca with ca.totalCount Is Not Null \
+ Join ca.speciesFate sf with sf.discard = :discardMode, \
+ ObservedSystemImpl os, \
+ SpeciesImpl e \
+ Where \
+ m.id In :tripId \
+ And e = :species \
+ And os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9395222812356602' \
+ And os not in elements(a.observedSystem) \
+ Group by e
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.request.2.repeat=species|column
+# colonne 3 (BL avec baleine)
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.request.3=2,0|row|\
+ Select Sum(CASE When ca.species = :species Then ca.totalCount Else 0.0 End) \
+ From TripImpl m \
+ Join m.routeObs r \
+ Join r.activity a \
+ Join a.set c with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#2' \
+ Join c.catches ca with ca.totalCount Is Not Null \
+ Join ca.speciesFate sf with sf.discard = :discardMode, \
+ ObservedSystemImpl os, \
+ SpeciesImpl e \
+ Where \
+ m.id In :tripId \
+ And e = :species \
+ And os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9395222812356602' \
+ And os in elements(a.observedSystem) \
+ Group by e
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.request.3.repeat=species|column
+# colonne 4 (BO avec requin-baleine)
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.request.4=3,0|row|\
+ Select Sum(CASE When ca.species = :species Then ca.totalCount Else 0.0 End) \
+ From TripImpl m \
+ Join m.routeObs r \
+ Join r.activity a \
+ Join a.set c with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#1' \
+ Join c.catches ca with ca.totalCount Is Not Null \
+ Join ca.speciesFate sf with sf.discard = :discardMode, \
+ ObservedSystemImpl os1, \
+ ObservedSystemImpl os2, \
+ ObservedSystemImpl os3, \
+ SpeciesImpl e \
+ Where \
+ m.id In :tripId \
+ And e = :species \
+ And os1.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \
+ And os2.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#0#1.0' \
+ And os3.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#0#1.1' \
+ And ( os1 in elements(a.observedSystem) Or os2 in elements(a.observedSystem) Or os3 in elements(a.observedSystem) ) \
+ Group by e
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.request.4.repeat=species|column
+# colonne 5 (BO sans requin-baleine)
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.request.5=4,0|row|\
+ Select Sum(CASE When ca.species = :species Then ca.totalCount Else 0.0 End) \
+ From TripImpl m \
+ Join m.routeObs r \
+ Join r.activity a \
+ Join a.set c with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#1' \
+ Join c.catches ca with ca.totalCount Is Not Null \
+ Join ca.speciesFate sf with sf.discard = :discardMode, \
+ ObservedSystemImpl os1, \
+ ObservedSystemImpl os2, \
+ ObservedSystemImpl os3, \
+ SpeciesImpl e \
+ Where \
+ m.id In :tripId \
+ And e = :species \
+ And os1.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \
+ And os2.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#0#1.0' \
+ And os3.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#0#1.1' \
+ And os1 not in elements(a.observedSystem) And os2 not in elements(a.observedSystem) And os3 not in elements(a.observedSystem) \
+ Group by e
+report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.request.5.repeat=species|column
+################################################################################
## Captures thons selon le type d'association
################################################################################
report.psObservationTargetCatchByAssociation.modelType=PS
=====================================
core/services/local/src/test/java/fr/ird/observe/services/local/service/ReportServiceLocalReadTest.java
=====================================
@@ -59,4 +59,16 @@ public class ReportServiceLocalReadTest extends GeneratedReportServiceLocalReadT
ReportService service = getService();
fixtures.executeReport(getServicesProvider(), service, "psObservationCatchTotalCountByGroupPerReasonForDiscard");
}
+
+ @Test
+ public void executeReportPsObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation() {
+ ReportService service = getService();
+ fixtures.executeReport(getServicesProvider(), service, "psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation");
+ }
+
+ @Test
+ public void executeReportPsObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation() {
+ ReportService service = getService();
+ fixtures.executeReport(getServicesProvider(), service, "psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation");
+ }
}
=====================================
core/services/test/src/main/java/fr/ird/observe/services/service/ReportFixture.java
=====================================
@@ -35,6 +35,7 @@ import java.beans.Introspector;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedHashSet;
+import java.util.Objects;
import java.util.Set;
import static fr.ird.observe.test.ObserveFixtures.WITH_ASSERT;
@@ -107,6 +108,18 @@ public abstract class ReportFixture {
}
}
+ protected void setVariableValue(Report report, String variableName, Boolean id) {
+ for (ReportVariable variable : report.getVariables()) {
+ if (variableName.equals(variable.getName())) {
+ Boolean value = (Boolean) variable.getValues().stream()
+ .filter(f-> Objects.equals(f, id))
+ .findFirst()
+ .orElse(null);
+ variable.setSelectedValue(value);
+ }
+ }
+ }
+
public void assertSyntax(Report actual) {
Assert.assertNotNull(actual);
assertReportName(actual);
@@ -175,7 +188,7 @@ public abstract class ReportFixture {
} else {
ReportServiceFixtures.addAssert("syntax.rows", report.getRows());
ReportServiceFixtures.addAssert("syntax.columns", report.getColumns());
- if (report.getRowHeaders() == null) {
+ if (report.getColumnHeaders() == null) {
ReportServiceFixtures.writeArrayAssert("syntax.columnsHeader");
} else {
ReportServiceFixtures.writeArrayAssert("syntax.columnsHeader", (Object[]) report.getColumnHeaders());
=====================================
core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociationReportFixture.java
=====================================
@@ -0,0 +1,57 @@
+package fr.ird.observe.services.service.report.ps;
+
+/*-
+ * #%L
+ * ObServe Core :: Services :: Test
+ * %%
+ * Copyright (C) 2008 - 2022 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.dto.report.Report;
+import fr.ird.observe.dto.report.ReportRequest;
+import fr.ird.observe.services.service.ReportFixture;
+
+import java.util.Iterator;
+
+/**
+ * Created on 09/12/2022.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since 9.0.22
+ */
+(a)AutoService(ReportFixture.class)
+public class PsObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociationReportFixture extends ReportFixture {
+
+ @Override
+ public void assertSyntax(Report report) {
+ super.assertSyntax(report);
+ Iterator<ReportRequest> requests = getRequestIterator(report);
+ assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 0, 0);
+ assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 1, 0);
+ assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 2, 0);
+ assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 3, 0);
+ assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 4, 0);
+ }
+
+ @Override
+ protected void setVariables(Report report) {
+ setVariableValue(report, "speciesGroup", "fr.ird.referential.common.SpeciesGroup#1239832683689#0.17327457618202002");
+ setVariableValue(report, "discardMode", false);
+ }
+}
\ No newline at end of file
=====================================
core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociationReportFixture.java
=====================================
@@ -0,0 +1,58 @@
+package fr.ird.observe.services.service.report.ps;
+
+/*-
+ * #%L
+ * ObServe Core :: Services :: Test
+ * %%
+ * Copyright (C) 2008 - 2022 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.dto.report.Report;
+import fr.ird.observe.dto.report.ReportRequest;
+import fr.ird.observe.services.service.ReportFixture;
+
+import java.util.Iterator;
+
+/**
+ * Created on 09/12/2022.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since 9.0.22
+ */
+(a)AutoService(ReportFixture.class)
+public class PsObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociationReportFixture extends ReportFixture {
+
+ @Override
+ public void assertSyntax(Report report) {
+ super.assertSyntax(report);
+ Iterator<ReportRequest> requests = getRequestIterator(report);
+ assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 0, 0);
+ assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 1, 0);
+ assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 2, 0);
+ assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 3, 0);
+ assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 4, 0);
+ }
+
+ @Override
+ protected void setVariables(Report report) {
+ setVariableValue(report, "speciesGroup", "fr.ird.referential.common.SpeciesGroup#1433499401278#0.203439718578011");
+ setVariableValue(report, "discardMode", false);
+ }
+}
+
=====================================
core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psLogbookWellPlanCheck.properties
=====================================
@@ -20,7 +20,7 @@
# #L%
###
result.0=483^CAP BOJADOR^30/3/2019^8/4/2019^30/3/2019^1^15:12^0.0^123.0^43.0^0.0^0.0^0.0^0.0^24.0^0.0^0.0^166.0^24.0^142.0
-result.1=-^-^-^-^-^-^-^0^123^43^0^0^0^0^24^0^0^166^24^142
+result.1=Total^-^-^-^-^-^-^0^123^43^0^0^0^0^24^0^0^166^24^142
result.columns=20
result.rows=2
syntax.columns=20
=====================================
core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.properties
=====================================
@@ -0,0 +1,31 @@
+###
+# #%L
+# ObServe Core :: Services :: Test
+# %%
+# Copyright (C) 2008 - 2022 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 - Dénombrement des captures selon le type d'association, filtrées par groupe et mode (rejeté/conservé)
+syntax.description=Afficher le dénombrement de rejets par groupe d'espèces et mode (rejeté/conservé) selon le type d'association
+syntax.rows=-1
+syntax.columns=6
+syntax.columnsHeader=Espèce^BL sans baleine^BL avec baleine^BO avec requin-baleine^BO sans requin-baleine^Total
+syntax.rowsHeader=
+syntax.nbRequests=5
+result.columns=6
+result.rows=1
+result.0=[FAO]SAI [sc]Istiophorus albicans [fr]Voilier de l'Atlantique^null^null^null^4^4
\ No newline at end of file
=====================================
core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.properties
=====================================
@@ -0,0 +1,36 @@
+###
+# #%L
+# ObServe Core :: Services :: Test
+# %%
+# Copyright (C) 2008 - 2022 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 - Poids des captures selon le type d'association, filtrées par groupe et mode (rejeté/conservé) (en t)
+syntax.description=Afficher le poids de rejets par groupe d'espèces et mode (rejeté/conservé) selon le type d'association
+syntax.rows=-1
+syntax.columns=6
+syntax.columnsHeader=Espèce^BL sans baleine^BL avec baleine^BO avec requin-baleine^BO sans requin-baleine^Total
+syntax.rowsHeader=
+syntax.nbRequests=5
+result.columns=6
+result.rows=6
+result.0=[FAO]BET [sc]Thunnus obesus [fr]Patudo, thon obèse, thon gros yeux^7.0^null^null^0.0^7.0
+result.1=[FAO]FRI [sc]Auxis thazard [fr]Auxide^0.0^null^null^1.0^1.0
+result.2=[FAO]FRZ [sc]Auxis spp [fr]Auxis^0.0^null^null^12.0^12.0
+result.3=[FAO]SKJ [sc]Katsuwonus pelamis [fr]Listao, bonite à ventre rayé^0.0^null^null^1.0^1.0
+result.4=[FAO]YFT [sc]Thunnus albacares [fr]Albacore, thon à nageoires jaunes^175.0^null^null^0.0^175.0
+result.5=Total^182.0^0.0^0.0^14.0^196.0
\ No newline at end of file
=====================================
pom.xml
=====================================
@@ -23,7 +23,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2022.97</version>
+ <version>2022.98</version>
</parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
=====================================
toolkit/api/src/main/java/fr/ird/observe/dto/report/Report.java
=====================================
@@ -164,7 +164,10 @@ public class Report implements Serializable, JsonAware {
public boolean canExecute() {
for (ReportVariable<?> variable : getVariables()) {
-
+ if (variable.getType().equals(Boolean.class)) {
+ // Boolean type can be null
+ continue;
+ }
// on verifie qu'on a bien cette variable
String name = variable.getName();
if (variable.getSelectedValue() == null) {
@@ -180,7 +183,10 @@ public class Report implements Serializable, JsonAware {
public boolean canExecute(Map<String, Object> variables) {
for (ReportVariable<?> variable : getVariables()) {
-
+ if (variable.getType().equals(Boolean.class)) {
+ // Boolean type can be null
+ continue;
+ }
// on verifie qu'on a bien cette variable
String name = variable.getName();
if (variables.get(name) == null) {
=====================================
toolkit/api/src/main/java/fr/ird/observe/dto/report/operations/SumColumn.java
=====================================
@@ -66,7 +66,7 @@ public class SumColumn implements ReportOperationConsumer {
tmpMatrix.setValue(column, 0, sumColumn);
}
DataMatrix merge = DataMatrix.merge(incoming, tmpMatrix);
- if (report.getColumnHeaders() == null) {
+ if (report.getRowHeaders() == null) {
merge.setValue(0, height, "Total");
}
return merge;
=====================================
toolkit/api/src/main/java/fr/ird/observe/dto/report/operations/SumRow.java
=====================================
@@ -67,7 +67,7 @@ public class SumRow implements ReportOperationConsumer {
tmpMatrix.setValue(0, row, sumRow);
}
DataMatrix merge = DataMatrix.merge(incoming, tmpMatrix);
- if (report.getRowHeaders() == null) {
+ if (report.getColumnHeaders() == null) {
merge.setValue(width, 0, "Total");
}
return merge;
=====================================
toolkit/persistence/src/main/java/fr/ird/observe/spi/report/DefaultReportRequestExecutor.java
=====================================
@@ -131,7 +131,7 @@ public abstract class DefaultReportRequestExecutor implements ReportRequestExecu
Map<String, Object> paramsFixes = new HashMap<>();
for (Map.Entry<String, Object> entry : params.entrySet()) {
String name = entry.getKey();
- if (request.contains(":" + name + " ") || request.endsWith(":" + name)) {
+ if (request.contains(":" + name + " ") || request.contains(":" + name + ",") || request.endsWith(":" + name)) {
Object value = entry.getValue();
if (value instanceof DtoReference) {
DtoReference referenceDto = (DtoReference) value;
=====================================
toolkit/persistence/src/main/java/org/nuiton/topia/persistence/internal/support/HibernateTopiaJpaSupport.java
=====================================
@@ -85,7 +85,9 @@ public class HibernateTopiaJpaSupport implements TopiaJpaSupport {
for (Map.Entry<String, Object> entry : parameters.entrySet()) {
String name = entry.getKey();
Object value = entry.getValue();
- if (value.getClass().isArray()) {
+ if (value == null) {
+ query.setParameter(name, null);
+ } else if (value.getClass().isArray()) {
query.setParameterList(name, (Object[]) value);
} else if (value instanceof Collection<?>) {
query.setParameterList(name, (Collection<?>) value);
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/4a495572cba92845d382c986…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/4a495572cba92845d382c986…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] AVDTH - Mise à jour de la documentation (add FIXME)
by Tony CHEMIT (@tchemit) 05 Dec '22
by Tony CHEMIT (@tchemit) 05 Dec '22
05 Dec '22
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
4a495572 by Tony Chemit at 2022-12-05T22:20:31+01:00
AVDTH - Mise à jour de la documentation (add FIXME)
- - - - -
1 changed file:
- src/site/markdown/avdth/logbook.md
Changes:
=====================================
src/site/markdown/avdth/logbook.md
=====================================
@@ -331,6 +331,8 @@ Voir mapping [REF_CATCH_WEIGHT_CATEGORY](./referential.html#REF_CATCH_WEIGHT_CAT
### Table CUVE
+**FIXME Mettre à jour la documentation de la nouvelle migration du plan de cuve**
+
Cette table représente la définition des cuves sur une marée et est déversée dans la table **WellPlan**.
| n° | nom | destination | note |
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/4a495572cba92845d382c9864…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/4a495572cba92845d382c9864…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] AVDTH - Mise à jour de la documentation
by Tony CHEMIT (@tchemit) 05 Dec '22
by Tony CHEMIT (@tchemit) 05 Dec '22
05 Dec '22
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
57c96eff by Tony Chemit at 2022-12-05T22:18:50+01:00
AVDTH - Mise à jour de la documentation
- - - - -
2 changed files:
- src/site/markdown/avdth/logbook.md
- src/site/markdown/avdth/referential.md
Changes:
=====================================
src/site/markdown/avdth/logbook.md
=====================================
@@ -16,43 +16,43 @@ La table est déversée dans plusieurs tables :
* **FloatingObject**
* **TransmittingBuoy**
-|n° | nom | destination |note |
-|:--- | :--- | :--- |:--- |
-| ACTIVITE_01 | C_BAT | Route.topiaId | |
-| ACTIVITE_02 | D_DBQ | Route.topiaId | |
-| ACTIVITE_03 | D_ACT | Route.date | |
-| ACTIVITE_04 | N_ACT | Activity.number | |
-| ACTIVITE_05 | H_ACT | Activity.time | [1](#n_0_1) |
-| ACTIVITE_06 | M_ACT | Activity.time | [1](#n_0_1) |
-| ACTIVITE_07 | C_OCEA | Not used | |
-| ACTIVITE_08 | Q_ACT | Signe de latitude et longitude | [2](#n_0_2) |
-| ACTIVITE_09 | V_LAT | Activity.latitude | [2](#n_0_2) |
-| ACTIVITE_10 | V_LON | Activity.longitude | [2](#n_0_2) |
-| ACTIVITE_11 | V_TMER | Route.timeAtSea | [3](#n_0_3) |
-| ACTIVITE_12 | V_TPEC | Route.fishingTime | [3](#n_0_3) |
-| ACTIVITE_13 | C_OPERA | Activity.vesselActivity | [4](#n_0_4) |
-| ACTIVITE_14 | V_NB_OP | Activity.setCount | |
-| ACTIVITE_15 | C_TBANC | Activity.schoolType | [5](#n_0_5) |
-| ACTIVITE_16 | F_DON_ORG | Activity.originalDataModified | [6](#n_0_6) |
-| ACTIVITE_17 | F_POS_COR | Activity.positionCorrected | [7](#n_0_7) |
-| ACTIVITE_18 | F_POS_VMS_D | Activity.vmsDivergent | [8](#n_0_8) |
-| ACTIVITE_19 | F_CUVE_C | Not used | |
-| ACTIVITE_20 | F_OBS | Not used | |
-| ACTIVITE_21 | F_EXPERT | Not used | |
-| ACTIVITE_22 | V_POIDS_CAP | Activity.totalWeight | |
-| ACTIVITE_23 | V_TEMP_S | Activity.seaSurfaceTemperature | |
-| ACTIVITE_24 | V_COUR_DIR | Activity.currentDirection | |
-| ACTIVITE_25 | V_COUR_VIT | Activity.currentSpeed | |
-| ACTIVITE_26 | V_VENT_DIR | Activity.windDirection | |
-| ACTIVITE_27 | V_VENT_VIT | Activity.wind | [9](#n_0_9) |
-| ACTIVITE_28 | C_TYP_OBJET | | [10](#n_0_10)|
-| ACTIVITE_29 | F_DCP_ECO | ??? | |
-| ACTIVITE_30 | F_PROP_BALISE | ??? | |
-| ACTIVITE_31 | C_TYP_BALISE | | [10](#n_0_10)|
-| ACTIVITE_32 | V_ID_BALISE | TransmittingBuoy.code | |
-| ACTIVITE_33 | V_POIDS_ESTIM_DCP | FloatingObject.comment | [11](#n_0_11)|
-| ACTIVITE_34 | L_COM_A | Activity.comment | |
-| ACTIVITE_35 | C_Z_FPA | Activity.fpaZone | [12](#n_0_12)|
+| n° | nom | destination | note |
+|:------------|:------------------|:-------------------------------------------|:--------------|
+| ACTIVITE_01 | C_BAT | Route.topiaId | |
+| ACTIVITE_02 | D_DBQ | Route.topiaId | |
+| ACTIVITE_03 | D_ACT | Route.date | |
+| ACTIVITE_04 | N_ACT | Activity.number | |
+| ACTIVITE_05 | H_ACT | Activity.time | [1](#n_0_1) |
+| ACTIVITE_06 | M_ACT | Activity.time | [1](#n_0_1) |
+| ACTIVITE_07 | C_OCEA | Not used | |
+| ACTIVITE_08 | Q_ACT | Signe de latitude et longitude | [2](#n_0_2) |
+| ACTIVITE_09 | V_LAT | Activity.latitude | [2](#n_0_2) |
+| ACTIVITE_10 | V_LON | Activity.longitude | [2](#n_0_2) |
+| ACTIVITE_11 | V_TMER | Route.timeAtSea | [3](#n_0_3) |
+| ACTIVITE_12 | V_TPEC | Route.fishingTime | [3](#n_0_3) |
+| ACTIVITE_13 | C_OPERA | Activity.vesselActivity | [4](#n_0_4) |
+| ACTIVITE_14 | V_NB_OP | Activity.setCount | |
+| ACTIVITE_15 | C_TBANC | Activity.schoolType | [5](#n_0_5) |
+| ACTIVITE_16 | F_DON_ORG | Activity.originalDataModified | [6](#n_0_6) |
+| ACTIVITE_17 | F_POS_COR | Activity.positionCorrected | [7](#n_0_7) |
+| ACTIVITE_18 | F_POS_VMS_D | Activity.vmsDivergent | [8](#n_0_8) |
+| ACTIVITE_19 | F_CUVE_C | Not used | |
+| ACTIVITE_20 | F_OBS | Not used | |
+| ACTIVITE_21 | F_EXPERT | Not used | |
+| ACTIVITE_22 | V_POIDS_CAP | Activity.totalWeight | |
+| ACTIVITE_23 | V_TEMP_S | Activity.seaSurfaceTemperature | |
+| ACTIVITE_24 | V_COUR_DIR | Activity.currentDirection | |
+| ACTIVITE_25 | V_COUR_VIT | Activity.currentSpeed | |
+| ACTIVITE_26 | V_VENT_DIR | Activity.windDirection | |
+| ACTIVITE_27 | V_VENT_VIT | Activity.wind | [9](#n_0_9) |
+| ACTIVITE_28 | C_TYP_OBJET | | [10](#n_0_10) |
+| ACTIVITE_29 | F_DCP_ECO | ??? | |
+| ACTIVITE_30 | F_PROP_BALISE | TransmittingBuoy.transmittingBuoyOwnerShip | [10](#n_0_10) |
+| ACTIVITE_31 | C_TYP_BALISE | | [10](#n_0_10) |
+| ACTIVITE_32 | V_ID_BALISE | TransmittingBuoy.code | |
+| ACTIVITE_33 | V_POIDS_ESTIM_DCP | FloatingObject.comment | [11](#n_0_11) |
+| ACTIVITE_34 | L_COM_A | Activity.comment | |
+| ACTIVITE_35 | C_Z_FPA | Activity.fpaZone | [12](#n_0_12) |
* Note 1
@@ -111,21 +111,23 @@ On ajoute un DCP uniquement pour une activité avec **vesselActivity.code == 13*
Provient d'une translation de **ACTIVITE.C_OPERA** vers **ps_common.ObjectOperation.code**
-| ACTIVITE.C_OPERA | ps_common.ObjectOperation.code |
-| :--- | :--- |
-|5 | 1 |
-|6 | 4 |
-|22 | 4 |
-|23 | 1 |
-|24 | 4 |
-|25 | 2 |
-|26 | 2 |
-|29 | 2 |
-|30 | 2 |
-|31 | 8 |
-|32 | 8 |
-|33 | 11 |
-|34 | 4 |
+| ACTIVITE.C_OPERA | ps_common.ObjectOperation.code |
+|:-----------------|:-------------------------------|
+| 5 | 1 |
+| 6 | 4 |
+| 22 | 4 |
+| 23 | 1 |
+| 24 | 4 |
+| 25 | 2 |
+| 26 | 2 |
+| 29 | 2 |
+| 30 | 2 |
+| 31 | 8 |
+| 32 | 8 |
+| 33 | 11 |
+| 34 | 4 |
+| 40 | 11 |
+| 41 | 11 |
* ```FloatingObject.floatingObjectPart```
@@ -133,21 +135,23 @@ Pour calculer les matériaux du DCP, on doit d'abord définir les deux valeurs
* ```whenArriving```
* ```whenLeaving```
-| ACTIVITE.C_OPERA | whenArriving | whenLeaving |
-| :--- | :--- | :--- |
-|5 | | TRUE |
-|6 | TRUE | |
-|22 | TRUE | |
-|23 | | TRUE |
-|24 | TRUE | |
-|25 | TRUE | |
-|26 | TRUE | |
-|29 | TRUE | |
-|30 | TRUE | |
-|31 | TRUE | TRUE |
-|32 | TRUE | TRUE |
-|33 | TRUE | |
-|34 | TRUE | |
+| ACTIVITE.C_OPERA | whenArriving | whenLeaving |
+|:-----------------|:-------------|:------------|
+| 5 | | TRUE |
+| 6 | TRUE | |
+| 22 | TRUE | |
+| 23 | | TRUE |
+| 24 | TRUE | |
+| 25 | TRUE | |
+| 26 | TRUE | |
+| 29 | TRUE | |
+| 30 | TRUE | |
+| 31 | TRUE | TRUE |
+| 32 | TRUE | TRUE |
+| 33 | TRUE | |
+| 34 | TRUE | |
+| 40 | TRUE | |
+| 41 | TRUE | |
* Calcul des matériaux à utiliser
@@ -207,12 +211,12 @@ if ("999".equals(typeObjectCode)) {
Pour le **simple mapping** on utilise la translation :
-| ACTIVITE.C_TYP_OBJET | ps_common.ObjectMaterial.code | note |
-| :--- | :--- | :---|
-|1 | fr.ird.referential.ps.common.ObjectMaterial#0#0.46 | 1-2 AFAD |
-|2 | fr.ird.referential.ps.common.ObjectMaterial#0#0.2 | 1-1 DFAD |
-|3 | fr.ird.referential.ps.common.ObjectMaterial#0#0.50 | 2 LOG |
-|9 | fr.ird.referential.ps.common.ObjectMaterial#0#1.3 | FOB |
+| ACTIVITE.C_TYP_OBJET | ps_common.ObjectMaterial.code | note |
+|:---------------------|:---------------------------------------------------|:---------|
+| 1 | fr.ird.referential.ps.common.ObjectMaterial#0#0.46 | 1-2 AFAD |
+| 2 | fr.ird.referential.ps.common.ObjectMaterial#0#0.2 | 1-1 DFAD |
+| 3 | fr.ird.referential.ps.common.ObjectMaterial#0#0.50 | 2 LOG |
+| 9 | fr.ird.referential.ps.common.ObjectMaterial#0#1.3 | FOB |
* ```FloatingObject.transmittingBuoy```
@@ -221,23 +225,29 @@ Soit ```baliseId``` (**ACTIVITE.V_ID_BALISE**) (à placer dans **TransmittingBuo
Soit ```transmittingBuoyOperation``` (translation de **ACTIVITE.C_OPERA**)
-| ACTIVITE.C_OPERA | ps_common.TransmittingBuoyOperation.code |
-| :--- | :--- |
-5 | 3 |
-6 | 2 |
-23 | 3 |
-24 | 2 |
-25 | 3 |
-26 | 2 |
-29 | 1 |
-32 | 3 |
-33 | 4 |
-34 | 2 |
+| ACTIVITE.C_OPERA | ps_common.TransmittingBuoyOperation.code |
+|:-----------------|:-----------------------------------------|
+| 5 | 3 |
+| 6 | 2 |
+| 23 | 3 |
+| 24 | 2 |
+| 25 | 3 |
+| 26 | 2 |
+| 29 | 1 |
+| 32 | 3 |
+| 33 | 4 |
+| 34 | 2 |
+| 40 | 4 |
+| 41 | 5 |
Soit ```transmittingBuoyType``` (translation de **ACTIVITE.C_TYP_BALISE**)
Voir mapping [REF_TRANSMITTING_BUOY](./referential.html#REF_TRANSMITTING_BUOY)
+Soit ```transmittingBuoyOwnerShip``` (translation de **ACTIVITE.F_PROP_BALISE**)
+
+Voir mapping [REF_TRANSMITTING_BUOY_OWNER_SHIP](./referential.html#REF_TRANSMITTING_BUOY_OWNER_SHIP)
+
**Attention: cette règle n'est plus appliquée!**
** On remplace par 999 si non trouvé**
@@ -264,7 +274,7 @@ return observedSystem.get(observedSystemCode);
avec ```OBSERVED_SYSTEM_CODE_MAPPING```
| ACTIVITE.C_TYP_OBJET | ps_common.ObservedSystem.code |
-| :--- | :--- |
+|:---------------------|:------------------------------|
| 1 | 20 |
| 2 | 20 |
| 3 | 20 |
@@ -277,14 +287,14 @@ avec ```OBSERVED_SYSTEM_CODE_MAPPING```
### Table ACT_ASSOC
-|n° | nom | destination |note |
-|:--- | :--- | :--- |:--- |
-| ACT_ASSOC_01 | C_BAT | Activity_ObservedSystem.activity | [1](#n_1_1)|
-| ACT_ASSOC_02 | D_DBQ | Activity_ObservedSystem.activity | [1](#n_1_1)|
-| ACT_ASSOC_03 | D_ACT | Activity_ObservedSystem.activity | [1](#n_1_1)|
-| ACT_ASSOC_04 | N_ACT | Activity_ObservedSystem.activity | [1](#n_1_1)|
-| ACT_ASSOC_05 | N_ASSOC | Not used | |
-| ACT_ASSOC_06 | C_ASSOC | Activity_ObservedSystem.ObservedSystem | [2](#n_1_2)|
+| n° | nom | destination | note |
+|:-------------|:--------|:---------------------------------------|:------------|
+| ACT_ASSOC_01 | C_BAT | Activity_ObservedSystem.activity | [1](#n_1_1) |
+| ACT_ASSOC_02 | D_DBQ | Activity_ObservedSystem.activity | [1](#n_1_1) |
+| ACT_ASSOC_03 | D_ACT | Activity_ObservedSystem.activity | [1](#n_1_1) |
+| ACT_ASSOC_04 | N_ACT | Activity_ObservedSystem.activity | [1](#n_1_1) |
+| ACT_ASSOC_05 | N_ASSOC | Not used | |
+| ACT_ASSOC_06 | C_ASSOC | Activity_ObservedSystem.ObservedSystem | [2](#n_1_2) |
* Note 1
### <a name="n_1_1"></a>
@@ -296,16 +306,16 @@ Voir mapping [REF_OBSERVED_SYSTEM](./referential.html#REF_OBSERVED_SYSTEM)
### Table CAPT_ELEM
-|n° | nom | destination |note |
-|:--- | :--- | :--- |:--- |
-| CAPT_ELEM_01 | C_BAT | Catch.activity | [1](#n_2_1)|
-| CAPT_ELEM_02 | D_DBQ | Catch.activity | [1](#n_2_1)|
-| CAPT_ELEM_03 | D_ACT | Catch.activity | [1](#n_2_1)|
-| CAPT_ELEM_04 | N_ACT | Catch.activity | [1](#n_2_1)|
-| CAPT_ELEM_05 | N_CAPT | Catch.homeId | |
-| CAPT_ELEM_06 | C_ESP | Catch.species | [2](#n_2_2)|
-| CAPT_ELEM_07 | C_CAT_T | Catch.weightCategory | [3](#n_2_3)|
-| CAPT_ELEM_08 | V_POIDS_CAPT | Catch.weight | |
+| n° | nom | destination | note |
+|:-------------|:-------------|:---------------------|:------------|
+| CAPT_ELEM_01 | C_BAT | Catch.activity | [1](#n_2_1) |
+| CAPT_ELEM_02 | D_DBQ | Catch.activity | [1](#n_2_1) |
+| CAPT_ELEM_03 | D_ACT | Catch.activity | [1](#n_2_1) |
+| CAPT_ELEM_04 | N_ACT | Catch.activity | [1](#n_2_1) |
+| CAPT_ELEM_05 | N_CAPT | Catch.homeId | |
+| CAPT_ELEM_06 | C_ESP | Catch.species | [2](#n_2_2) |
+| CAPT_ELEM_07 | C_CAT_T | Catch.weightCategory | [3](#n_2_3) |
+| CAPT_ELEM_08 | V_POIDS_CAPT | Catch.weight | |
* Note 1
### <a name="n_2_1"></a>
@@ -323,13 +333,13 @@ Voir mapping [REF_CATCH_WEIGHT_CATEGORY](./referential.html#REF_CATCH_WEIGHT_CAT
Cette table représente la définition des cuves sur une marée et est déversée dans la table **WellPlan**.
-|n° | nom | destination |note |
-|:--- | :--- | :--- |:--- |
-| CUVE_01 | C_BAT | WellPlan.trip | [1](#n_3_1)|
-| CUVE_02 | D_DBQ | WellPlan.trip | [1](#n_3_1)|
-| CUVE_03 | N_CUVE | WellPlan.well | [2](#n_3_2)|
-| CUVE_04 | F_POS_CUVE | WellPlan.well | [2](#n_3_2)|
-| CUVE_05 | C_DEST | WellPlan.wellSamplingConformity et wellSamplingStatus | [3](#n_3_3)|
+| n° | nom | destination | note |
+|:--------|:-----------|:------------------------------------------------------|:------------|
+| CUVE_01 | C_BAT | WellPlan.trip | [1](#n_3_1) |
+| CUVE_02 | D_DBQ | WellPlan.trip | [1](#n_3_1) |
+| CUVE_03 | N_CUVE | WellPlan.well | [2](#n_3_2) |
+| CUVE_04 | F_POS_CUVE | WellPlan.well | [2](#n_3_2) |
+| CUVE_05 | C_DEST | WellPlan.wellSamplingConformity et wellSamplingStatus | [3](#n_3_3) |
* Note 1
### <a name="n_3_1"></a>
@@ -353,19 +363,19 @@ Voir mapping [REF_WELL_SAMPLING_CONFORMITY](./referential.html#REF_WELL_SAMPLING
Cette table définit le plan de cuve et est déversée dans la table **WellPlan**.
-|n° | nom | destination |note |
-|:--- | :--- | :--- |:--- |
-| CUVE_CALEE_01 | C_BAT | WellPlan.topiaId | [1](#n_4_1)|
-| CUVE_CALEE_02 | D_DBQ | WellPlan.topiaId | [1](#n_4_1)|
-| CUVE_CALEE_03 | N_CUVE | WellPlan.topiaId | [1](#n_4_1)|
-| CUVE_CALEE_04 | F_POS_CUVE | WellPlan.topiaId | [1](#n_4_1)|
-| CUVE_CALEE_05 | N_CALESP | ??? | |
-| CUVE_CALEE_06 | D_ACT | Activity.topiaId | [2](#n_4_2)|
-| CUVE_CALEE_07 | N_ACT | Activity.topiaId | [2](#n_4_2)|
-| CUVE_CALEE_08 | C_ESP | WellPlan.species | [3](#n_4_3)|
-| CUVE_CALEE_09 | C_CAT_POIDS | WellPlan.weightCategory | [4](#n_4_4)|
-| CUVE_CALEE_10 | V_POIDS | WellPlan.weight | |
-| CUVE_CALEE_11 | V_NB | Not Used | |
+| n° | nom | destination | note |
+|:--------------|:------------|:------------------------|:------------|
+| CUVE_CALEE_01 | C_BAT | WellPlan.topiaId | [1](#n_4_1) |
+| CUVE_CALEE_02 | D_DBQ | WellPlan.topiaId | [1](#n_4_1) |
+| CUVE_CALEE_03 | N_CUVE | WellPlan.topiaId | [1](#n_4_1) |
+| CUVE_CALEE_04 | F_POS_CUVE | WellPlan.topiaId | [1](#n_4_1) |
+| CUVE_CALEE_05 | N_CALESP | ??? | |
+| CUVE_CALEE_06 | D_ACT | Activity.topiaId | [2](#n_4_2) |
+| CUVE_CALEE_07 | N_ACT | Activity.topiaId | [2](#n_4_2) |
+| CUVE_CALEE_08 | C_ESP | WellPlan.species | [3](#n_4_3) |
+| CUVE_CALEE_09 | C_CAT_POIDS | WellPlan.weightCategory | [4](#n_4_4) |
+| CUVE_CALEE_10 | V_POIDS | WellPlan.weight | |
+| CUVE_CALEE_11 | V_NB | Not Used | |
* Note 1
### <a name="n_4_1"></a>
=====================================
src/site/markdown/avdth/referential.md
=====================================
@@ -167,39 +167,51 @@ Mapping TransmittingBuoy
Pour transposer certains codes **TYPE_BALISE.C_TYP_BALISE** en code **ps_common.TransmittingBuoy.code**, les autres codes sont ceux d'ObServe.
-| **TYPE_BALISE.C_TYP_BALISE** | **ps_common.ObservedSystem.code** |
-|:-----------------------------|:----------------------------------|
-| 11 | 90 |
-| 12 | 21 |
-| 13 | 22 |
-| 14 | 23 |
-| 15 | 24 |
-| 16 | 25 |
-| 17 | 26 |
-| 18 | 27 |
-| 19 | 28 |
-| 20 | 41 |
-| 21 | 42 |
-| 22 | 43 |
-| 23 | 44 |
-| 24 | 45 |
-| 25 | 46 |
-| 26 | 47 |
-| 27 | 100 |
-| 28 | 61 |
-| 29 | 62 |
-| 30 | 63 |
-| 31 | 64 |
-| 32 | 65 |
-| 33 | 66 |
-| 34 | 67 |
-| 35 | 68 |
-| 36 | 69 |
-| 37 | 70 |
-| 38 | 71 |
-| 39 | 3 |
-| 40 | 91 |
-| 98 | 99 |
+| **TYPE_BALISE.C_TYP_BALISE** | **ps_common.TransmittingBuoyType.code** |
+|:-----------------------------|:-----------------------------------------|
+| 11 | 90 |
+| 12 | 21 |
+| 13 | 22 |
+| 14 | 23 |
+| 15 | 24 |
+| 16 | 25 |
+| 17 | 26 |
+| 18 | 27 |
+| 19 | 28 |
+| 20 | 41 |
+| 21 | 42 |
+| 22 | 43 |
+| 23 | 44 |
+| 24 | 45 |
+| 25 | 46 |
+| 26 | 47 |
+| 27 | 100 |
+| 28 | 61 |
+| 29 | 62 |
+| 30 | 63 |
+| 31 | 64 |
+| 32 | 65 |
+| 33 | 66 |
+| 34 | 67 |
+| 35 | 68 |
+| 36 | 69 |
+| 37 | 70 |
+| 38 | 71 |
+| 39 | 3 |
+| 40 | 91 |
+| 98 | 99 |
+
+
+### REF_TRANSMITTING_BUOY_OWNER_SHIP
+
+Mapping TransmittingBuoyOwnerShip
+
+Pour transposer certains codes **ACTIVITE.F_PROP_BALISE** en code **ps_common.TransmittingBuoyOwnerShip.code**.
+
+| **ACTIVITE.F_PROP_BALISE** | **ps_common.TransmittingBuoyOwnerShip.code** |
+|:---------------------------|:---------------------------------------------|
+| 1 | 0 |
+| 2 | 3 |
### REF_VESSEL_ACTIVITY_TYPE
@@ -226,6 +238,8 @@ Mapping type d'activité
| 32 | 13 (2) |
| 33 | 13 (2) |
| 34 | 13 (2) |
+| 40 | 13 (2) |
+| 41 | 13 (2) |
| 7 | 22 |
| 8 | 10 |
| 9 | 23 |
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/57c96effa36303db3e54949ac…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/57c96effa36303db3e54949ac…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-9.0.x] AVDTH - Mise à jour de la documentation
by Tony CHEMIT (@tchemit) 05 Dec '22
by Tony CHEMIT (@tchemit) 05 Dec '22
05 Dec '22
Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe
Commits:
b7a5669d by Tony Chemit at 2022-12-05T22:07:57+01:00
AVDTH - Mise à jour de la documentation
- - - - -
2 changed files:
- src/site/markdown/avdth/logbook.md
- src/site/markdown/avdth/referential.md
Changes:
=====================================
src/site/markdown/avdth/logbook.md
=====================================
@@ -16,43 +16,43 @@ La table est déversée dans plusieurs tables :
* **FloatingObject**
* **TransmittingBuoy**
-|n° | nom | destination |note |
-|:--- | :--- | :--- |:--- |
-| ACTIVITE_01 | C_BAT | Route.topiaId | |
-| ACTIVITE_02 | D_DBQ | Route.topiaId | |
-| ACTIVITE_03 | D_ACT | Route.date | |
-| ACTIVITE_04 | N_ACT | Activity.number | |
-| ACTIVITE_05 | H_ACT | Activity.time | [1](#n_0_1) |
-| ACTIVITE_06 | M_ACT | Activity.time | [1](#n_0_1) |
-| ACTIVITE_07 | C_OCEA | Not used | |
-| ACTIVITE_08 | Q_ACT | Signe de latitude et longitude | [2](#n_0_2) |
-| ACTIVITE_09 | V_LAT | Activity.latitude | [2](#n_0_2) |
-| ACTIVITE_10 | V_LON | Activity.longitude | [2](#n_0_2) |
-| ACTIVITE_11 | V_TMER | Route.timeAtSea | [3](#n_0_3) |
-| ACTIVITE_12 | V_TPEC | Route.fishingTime | [3](#n_0_3) |
-| ACTIVITE_13 | C_OPERA | Activity.vesselActivity | [4](#n_0_4) |
-| ACTIVITE_14 | V_NB_OP | Activity.setCount | |
-| ACTIVITE_15 | C_TBANC | Activity.schoolType | [5](#n_0_5) |
-| ACTIVITE_16 | F_DON_ORG | Activity.originalDataModified | [6](#n_0_6) |
-| ACTIVITE_17 | F_POS_COR | Activity.positionCorrected | [7](#n_0_7) |
-| ACTIVITE_18 | F_POS_VMS_D | Activity.vmsDivergent | [8](#n_0_8) |
-| ACTIVITE_19 | F_CUVE_C | Not used | |
-| ACTIVITE_20 | F_OBS | Not used | |
-| ACTIVITE_21 | F_EXPERT | Not used | |
-| ACTIVITE_22 | V_POIDS_CAP | Activity.totalWeight | |
-| ACTIVITE_23 | V_TEMP_S | Activity.seaSurfaceTemperature | |
-| ACTIVITE_24 | V_COUR_DIR | Activity.currentDirection | |
-| ACTIVITE_25 | V_COUR_VIT | Activity.currentSpeed | |
-| ACTIVITE_26 | V_VENT_DIR | Activity.windDirection | |
-| ACTIVITE_27 | V_VENT_VIT | Activity.wind | [9](#n_0_9) |
-| ACTIVITE_28 | C_TYP_OBJET | | [10](#n_0_10)|
-| ACTIVITE_29 | F_DCP_ECO | ??? | |
-| ACTIVITE_30 | F_PROP_BALISE | ??? | |
-| ACTIVITE_31 | C_TYP_BALISE | | [10](#n_0_10)|
-| ACTIVITE_32 | V_ID_BALISE | TransmittingBuoy.code | |
-| ACTIVITE_33 | V_POIDS_ESTIM_DCP | FloatingObject.comment | [11](#n_0_11)|
-| ACTIVITE_34 | L_COM_A | Activity.comment | |
-| ACTIVITE_35 | C_Z_FPA | Activity.fpaZone | [12](#n_0_12)|
+| n° | nom | destination | note |
+|:------------|:------------------|:-------------------------------------------|:--------------|
+| ACTIVITE_01 | C_BAT | Route.topiaId | |
+| ACTIVITE_02 | D_DBQ | Route.topiaId | |
+| ACTIVITE_03 | D_ACT | Route.date | |
+| ACTIVITE_04 | N_ACT | Activity.number | |
+| ACTIVITE_05 | H_ACT | Activity.time | [1](#n_0_1) |
+| ACTIVITE_06 | M_ACT | Activity.time | [1](#n_0_1) |
+| ACTIVITE_07 | C_OCEA | Not used | |
+| ACTIVITE_08 | Q_ACT | Signe de latitude et longitude | [2](#n_0_2) |
+| ACTIVITE_09 | V_LAT | Activity.latitude | [2](#n_0_2) |
+| ACTIVITE_10 | V_LON | Activity.longitude | [2](#n_0_2) |
+| ACTIVITE_11 | V_TMER | Route.timeAtSea | [3](#n_0_3) |
+| ACTIVITE_12 | V_TPEC | Route.fishingTime | [3](#n_0_3) |
+| ACTIVITE_13 | C_OPERA | Activity.vesselActivity | [4](#n_0_4) |
+| ACTIVITE_14 | V_NB_OP | Activity.setCount | |
+| ACTIVITE_15 | C_TBANC | Activity.schoolType | [5](#n_0_5) |
+| ACTIVITE_16 | F_DON_ORG | Activity.originalDataModified | [6](#n_0_6) |
+| ACTIVITE_17 | F_POS_COR | Activity.positionCorrected | [7](#n_0_7) |
+| ACTIVITE_18 | F_POS_VMS_D | Activity.vmsDivergent | [8](#n_0_8) |
+| ACTIVITE_19 | F_CUVE_C | Not used | |
+| ACTIVITE_20 | F_OBS | Not used | |
+| ACTIVITE_21 | F_EXPERT | Not used | |
+| ACTIVITE_22 | V_POIDS_CAP | Activity.totalWeight | |
+| ACTIVITE_23 | V_TEMP_S | Activity.seaSurfaceTemperature | |
+| ACTIVITE_24 | V_COUR_DIR | Activity.currentDirection | |
+| ACTIVITE_25 | V_COUR_VIT | Activity.currentSpeed | |
+| ACTIVITE_26 | V_VENT_DIR | Activity.windDirection | |
+| ACTIVITE_27 | V_VENT_VIT | Activity.wind | [9](#n_0_9) |
+| ACTIVITE_28 | C_TYP_OBJET | | [10](#n_0_10) |
+| ACTIVITE_29 | F_DCP_ECO | ??? | |
+| ACTIVITE_30 | F_PROP_BALISE | TransmittingBuoy.transmittingBuoyOwnerShip | [10](#n_0_10) |
+| ACTIVITE_31 | C_TYP_BALISE | | [10](#n_0_10) |
+| ACTIVITE_32 | V_ID_BALISE | TransmittingBuoy.code | |
+| ACTIVITE_33 | V_POIDS_ESTIM_DCP | FloatingObject.comment | [11](#n_0_11) |
+| ACTIVITE_34 | L_COM_A | Activity.comment | |
+| ACTIVITE_35 | C_Z_FPA | Activity.fpaZone | [12](#n_0_12) |
* Note 1
@@ -111,21 +111,23 @@ On ajoute un DCP uniquement pour une activité avec **vesselActivity.code == 13*
Provient d'une translation de **ACTIVITE.C_OPERA** vers **ps_common.ObjectOperation.code**
-| ACTIVITE.C_OPERA | ps_common.ObjectOperation.code |
-| :--- | :--- |
-|5 | 1 |
-|6 | 4 |
-|22 | 4 |
-|23 | 1 |
-|24 | 4 |
-|25 | 2 |
-|26 | 2 |
-|29 | 2 |
-|30 | 2 |
-|31 | 8 |
-|32 | 8 |
-|33 | 11 |
-|34 | 4 |
+| ACTIVITE.C_OPERA | ps_common.ObjectOperation.code |
+|:-----------------|:-------------------------------|
+| 5 | 1 |
+| 6 | 4 |
+| 22 | 4 |
+| 23 | 1 |
+| 24 | 4 |
+| 25 | 2 |
+| 26 | 2 |
+| 29 | 2 |
+| 30 | 2 |
+| 31 | 8 |
+| 32 | 8 |
+| 33 | 11 |
+| 34 | 4 |
+| 40 | 11 |
+| 41 | 11 |
* ```FloatingObject.floatingObjectPart```
@@ -133,21 +135,23 @@ Pour calculer les matériaux du DCP, on doit d'abord définir les deux valeurs
* ```whenArriving```
* ```whenLeaving```
-| ACTIVITE.C_OPERA | whenArriving | whenLeaving |
-| :--- | :--- | :--- |
-|5 | | TRUE |
-|6 | TRUE | |
-|22 | TRUE | |
-|23 | | TRUE |
-|24 | TRUE | |
-|25 | TRUE | |
-|26 | TRUE | |
-|29 | TRUE | |
-|30 | TRUE | |
-|31 | TRUE | TRUE |
-|32 | TRUE | TRUE |
-|33 | TRUE | |
-|34 | TRUE | |
+| ACTIVITE.C_OPERA | whenArriving | whenLeaving |
+|:-----------------|:-------------|:------------|
+| 5 | | TRUE |
+| 6 | TRUE | |
+| 22 | TRUE | |
+| 23 | | TRUE |
+| 24 | TRUE | |
+| 25 | TRUE | |
+| 26 | TRUE | |
+| 29 | TRUE | |
+| 30 | TRUE | |
+| 31 | TRUE | TRUE |
+| 32 | TRUE | TRUE |
+| 33 | TRUE | |
+| 34 | TRUE | |
+| 40 | TRUE | |
+| 41 | TRUE | |
* Calcul des matériaux à utiliser
@@ -207,12 +211,12 @@ if ("999".equals(typeObjectCode)) {
Pour le **simple mapping** on utilise la translation :
-| ACTIVITE.C_TYP_OBJET | ps_common.ObjectMaterial.code | note |
-| :--- | :--- | :---|
-|1 | fr.ird.referential.ps.common.ObjectMaterial#0#0.46 | 1-2 AFAD |
-|2 | fr.ird.referential.ps.common.ObjectMaterial#0#0.2 | 1-1 DFAD |
-|3 | fr.ird.referential.ps.common.ObjectMaterial#0#0.50 | 2 LOG |
-|9 | fr.ird.referential.ps.common.ObjectMaterial#0#1.3 | FOB |
+| ACTIVITE.C_TYP_OBJET | ps_common.ObjectMaterial.code | note |
+|:---------------------|:---------------------------------------------------|:---------|
+| 1 | fr.ird.referential.ps.common.ObjectMaterial#0#0.46 | 1-2 AFAD |
+| 2 | fr.ird.referential.ps.common.ObjectMaterial#0#0.2 | 1-1 DFAD |
+| 3 | fr.ird.referential.ps.common.ObjectMaterial#0#0.50 | 2 LOG |
+| 9 | fr.ird.referential.ps.common.ObjectMaterial#0#1.3 | FOB |
* ```FloatingObject.transmittingBuoy```
@@ -221,23 +225,29 @@ Soit ```baliseId``` (**ACTIVITE.V_ID_BALISE**) (à placer dans **TransmittingBuo
Soit ```transmittingBuoyOperation``` (translation de **ACTIVITE.C_OPERA**)
-| ACTIVITE.C_OPERA | ps_common.TransmittingBuoyOperation.code |
-| :--- | :--- |
-5 | 3 |
-6 | 2 |
-23 | 3 |
-24 | 2 |
-25 | 3 |
-26 | 2 |
-29 | 1 |
-32 | 3 |
-33 | 4 |
-34 | 2 |
+| ACTIVITE.C_OPERA | ps_common.TransmittingBuoyOperation.code |
+|:-----------------|:-----------------------------------------|
+| 5 | 3 |
+| 6 | 2 |
+| 23 | 3 |
+| 24 | 2 |
+| 25 | 3 |
+| 26 | 2 |
+| 29 | 1 |
+| 32 | 3 |
+| 33 | 4 |
+| 34 | 2 |
+| 40 | 4 |
+| 41 | 5 |
Soit ```transmittingBuoyType``` (translation de **ACTIVITE.C_TYP_BALISE**)
Voir mapping [REF_TRANSMITTING_BUOY](./referential.html#REF_TRANSMITTING_BUOY)
+Soit ```transmittingBuoyOwnerShip``` (translation de **ACTIVITE.F_PROP_BALISE**)
+
+Voir mapping [REF_TRANSMITTING_BUOY_OWNER_SHIP](./referential.html#REF_TRANSMITTING_BUOY_OWNER_SHIP)
+
**Attention: cette règle n'est plus appliquée!**
** On remplace par 999 si non trouvé**
@@ -264,7 +274,7 @@ return observedSystem.get(observedSystemCode);
avec ```OBSERVED_SYSTEM_CODE_MAPPING```
| ACTIVITE.C_TYP_OBJET | ps_common.ObservedSystem.code |
-| :--- | :--- |
+|:---------------------|:------------------------------|
| 1 | 20 |
| 2 | 20 |
| 3 | 20 |
@@ -277,14 +287,14 @@ avec ```OBSERVED_SYSTEM_CODE_MAPPING```
### Table ACT_ASSOC
-|n° | nom | destination |note |
-|:--- | :--- | :--- |:--- |
-| ACT_ASSOC_01 | C_BAT | Activity_ObservedSystem.activity | [1](#n_1_1)|
-| ACT_ASSOC_02 | D_DBQ | Activity_ObservedSystem.activity | [1](#n_1_1)|
-| ACT_ASSOC_03 | D_ACT | Activity_ObservedSystem.activity | [1](#n_1_1)|
-| ACT_ASSOC_04 | N_ACT | Activity_ObservedSystem.activity | [1](#n_1_1)|
-| ACT_ASSOC_05 | N_ASSOC | Not used | |
-| ACT_ASSOC_06 | C_ASSOC | Activity_ObservedSystem.ObservedSystem | [2](#n_1_2)|
+| n° | nom | destination | note |
+|:-------------|:--------|:---------------------------------------|:------------|
+| ACT_ASSOC_01 | C_BAT | Activity_ObservedSystem.activity | [1](#n_1_1) |
+| ACT_ASSOC_02 | D_DBQ | Activity_ObservedSystem.activity | [1](#n_1_1) |
+| ACT_ASSOC_03 | D_ACT | Activity_ObservedSystem.activity | [1](#n_1_1) |
+| ACT_ASSOC_04 | N_ACT | Activity_ObservedSystem.activity | [1](#n_1_1) |
+| ACT_ASSOC_05 | N_ASSOC | Not used | |
+| ACT_ASSOC_06 | C_ASSOC | Activity_ObservedSystem.ObservedSystem | [2](#n_1_2) |
* Note 1
### <a name="n_1_1"></a>
@@ -296,16 +306,16 @@ Voir mapping [REF_OBSERVED_SYSTEM](./referential.html#REF_OBSERVED_SYSTEM)
### Table CAPT_ELEM
-|n° | nom | destination |note |
-|:--- | :--- | :--- |:--- |
-| CAPT_ELEM_01 | C_BAT | Catch.activity | [1](#n_2_1)|
-| CAPT_ELEM_02 | D_DBQ | Catch.activity | [1](#n_2_1)|
-| CAPT_ELEM_03 | D_ACT | Catch.activity | [1](#n_2_1)|
-| CAPT_ELEM_04 | N_ACT | Catch.activity | [1](#n_2_1)|
-| CAPT_ELEM_05 | N_CAPT | Catch.homeId | |
-| CAPT_ELEM_06 | C_ESP | Catch.species | [2](#n_2_2)|
-| CAPT_ELEM_07 | C_CAT_T | Catch.weightCategory | [3](#n_2_3)|
-| CAPT_ELEM_08 | V_POIDS_CAPT | Catch.weight | |
+| n° | nom | destination | note |
+|:-------------|:-------------|:---------------------|:------------|
+| CAPT_ELEM_01 | C_BAT | Catch.activity | [1](#n_2_1) |
+| CAPT_ELEM_02 | D_DBQ | Catch.activity | [1](#n_2_1) |
+| CAPT_ELEM_03 | D_ACT | Catch.activity | [1](#n_2_1) |
+| CAPT_ELEM_04 | N_ACT | Catch.activity | [1](#n_2_1) |
+| CAPT_ELEM_05 | N_CAPT | Catch.homeId | |
+| CAPT_ELEM_06 | C_ESP | Catch.species | [2](#n_2_2) |
+| CAPT_ELEM_07 | C_CAT_T | Catch.weightCategory | [3](#n_2_3) |
+| CAPT_ELEM_08 | V_POIDS_CAPT | Catch.weight | |
* Note 1
### <a name="n_2_1"></a>
@@ -323,13 +333,13 @@ Voir mapping [REF_CATCH_WEIGHT_CATEGORY](./referential.html#REF_CATCH_WEIGHT_CAT
Cette table représente la définition des cuves sur une marée et est déversée dans la table **WellPlan**.
-|n° | nom | destination |note |
-|:--- | :--- | :--- |:--- |
-| CUVE_01 | C_BAT | WellPlan.trip | [1](#n_3_1)|
-| CUVE_02 | D_DBQ | WellPlan.trip | [1](#n_3_1)|
-| CUVE_03 | N_CUVE | WellPlan.well | [2](#n_3_2)|
-| CUVE_04 | F_POS_CUVE | WellPlan.well | [2](#n_3_2)|
-| CUVE_05 | C_DEST | WellPlan.wellSamplingConformity et wellSamplingStatus | [3](#n_3_3)|
+| n° | nom | destination | note |
+|:--------|:-----------|:------------------------------------------------------|:------------|
+| CUVE_01 | C_BAT | WellPlan.trip | [1](#n_3_1) |
+| CUVE_02 | D_DBQ | WellPlan.trip | [1](#n_3_1) |
+| CUVE_03 | N_CUVE | WellPlan.well | [2](#n_3_2) |
+| CUVE_04 | F_POS_CUVE | WellPlan.well | [2](#n_3_2) |
+| CUVE_05 | C_DEST | WellPlan.wellSamplingConformity et wellSamplingStatus | [3](#n_3_3) |
* Note 1
### <a name="n_3_1"></a>
@@ -353,19 +363,19 @@ Voir mapping [REF_WELL_SAMPLING_CONFORMITY](./referential.html#REF_WELL_SAMPLING
Cette table définit le plan de cuve et est déversée dans la table **WellPlan**.
-|n° | nom | destination |note |
-|:--- | :--- | :--- |:--- |
-| CUVE_CALEE_01 | C_BAT | WellPlan.topiaId | [1](#n_4_1)|
-| CUVE_CALEE_02 | D_DBQ | WellPlan.topiaId | [1](#n_4_1)|
-| CUVE_CALEE_03 | N_CUVE | WellPlan.topiaId | [1](#n_4_1)|
-| CUVE_CALEE_04 | F_POS_CUVE | WellPlan.topiaId | [1](#n_4_1)|
-| CUVE_CALEE_05 | N_CALESP | ??? | |
-| CUVE_CALEE_06 | D_ACT | Activity.topiaId | [2](#n_4_2)|
-| CUVE_CALEE_07 | N_ACT | Activity.topiaId | [2](#n_4_2)|
-| CUVE_CALEE_08 | C_ESP | WellPlan.species | [3](#n_4_3)|
-| CUVE_CALEE_09 | C_CAT_POIDS | WellPlan.weightCategory | [4](#n_4_4)|
-| CUVE_CALEE_10 | V_POIDS | WellPlan.weight | |
-| CUVE_CALEE_11 | V_NB | Not Used | |
+| n° | nom | destination | note |
+|:--------------|:------------|:------------------------|:------------|
+| CUVE_CALEE_01 | C_BAT | WellPlan.topiaId | [1](#n_4_1) |
+| CUVE_CALEE_02 | D_DBQ | WellPlan.topiaId | [1](#n_4_1) |
+| CUVE_CALEE_03 | N_CUVE | WellPlan.topiaId | [1](#n_4_1) |
+| CUVE_CALEE_04 | F_POS_CUVE | WellPlan.topiaId | [1](#n_4_1) |
+| CUVE_CALEE_05 | N_CALESP | ??? | |
+| CUVE_CALEE_06 | D_ACT | Activity.topiaId | [2](#n_4_2) |
+| CUVE_CALEE_07 | N_ACT | Activity.topiaId | [2](#n_4_2) |
+| CUVE_CALEE_08 | C_ESP | WellPlan.species | [3](#n_4_3) |
+| CUVE_CALEE_09 | C_CAT_POIDS | WellPlan.weightCategory | [4](#n_4_4) |
+| CUVE_CALEE_10 | V_POIDS | WellPlan.weight | |
+| CUVE_CALEE_11 | V_NB | Not Used | |
* Note 1
### <a name="n_4_1"></a>
=====================================
src/site/markdown/avdth/referential.md
=====================================
@@ -167,39 +167,51 @@ Mapping TransmittingBuoy
Pour transposer certains codes **TYPE_BALISE.C_TYP_BALISE** en code **ps_common.TransmittingBuoy.code**, les autres codes sont ceux d'ObServe.
-| **TYPE_BALISE.C_TYP_BALISE** | **ps_common.ObservedSystem.code** |
-|:-----------------------------|:----------------------------------|
-| 11 | 90 |
-| 12 | 21 |
-| 13 | 22 |
-| 14 | 23 |
-| 15 | 24 |
-| 16 | 25 |
-| 17 | 26 |
-| 18 | 27 |
-| 19 | 28 |
-| 20 | 41 |
-| 21 | 42 |
-| 22 | 43 |
-| 23 | 44 |
-| 24 | 45 |
-| 25 | 46 |
-| 26 | 47 |
-| 27 | 100 |
-| 28 | 61 |
-| 29 | 62 |
-| 30 | 63 |
-| 31 | 64 |
-| 32 | 65 |
-| 33 | 66 |
-| 34 | 67 |
-| 35 | 68 |
-| 36 | 69 |
-| 37 | 70 |
-| 38 | 71 |
-| 39 | 3 |
-| 40 | 91 |
-| 98 | 99 |
+| **TYPE_BALISE.C_TYP_BALISE** | **ps_common.TransmittingBuoyType.code** |
+|:-----------------------------|:-----------------------------------------|
+| 11 | 90 |
+| 12 | 21 |
+| 13 | 22 |
+| 14 | 23 |
+| 15 | 24 |
+| 16 | 25 |
+| 17 | 26 |
+| 18 | 27 |
+| 19 | 28 |
+| 20 | 41 |
+| 21 | 42 |
+| 22 | 43 |
+| 23 | 44 |
+| 24 | 45 |
+| 25 | 46 |
+| 26 | 47 |
+| 27 | 100 |
+| 28 | 61 |
+| 29 | 62 |
+| 30 | 63 |
+| 31 | 64 |
+| 32 | 65 |
+| 33 | 66 |
+| 34 | 67 |
+| 35 | 68 |
+| 36 | 69 |
+| 37 | 70 |
+| 38 | 71 |
+| 39 | 3 |
+| 40 | 91 |
+| 98 | 99 |
+
+
+### REF_TRANSMITTING_BUOY_OWNER_SHIP
+
+Mapping TransmittingBuoyOwnerShip
+
+Pour transposer certains codes **ACTIVITE.F_PROP_BALISE** en code **ps_common.TransmittingBuoyOwnerShip.code**.
+
+| **ACTIVITE.F_PROP_BALISE** | **ps_common.TransmittingBuoyOwnerShip.code** |
+|:---------------------------|:---------------------------------------------|
+| 1 | 0 |
+| 2 | 3 |
### REF_VESSEL_ACTIVITY_TYPE
@@ -226,6 +238,8 @@ Mapping type d'activité
| 32 | 13 (2) |
| 33 | 13 (2) |
| 34 | 13 (2) |
+| 40 | 13 (2) |
+| 41 | 13 (2) |
| 7 | 22 |
| 8 | 10 |
| 9 | 23 |
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/b7a5669d0f09931b0e7e11e1a…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/b7a5669d0f09931b0e7e11e1a…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] AVDTH - Gestion de la propriété de la balise en situation de migration AVDTH - Closes #2569
by Tony CHEMIT (@tchemit) 05 Dec '22
by Tony CHEMIT (@tchemit) 05 Dec '22
05 Dec '22
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
647f687a by Tony Chemit at 2022-12-05T21:49:13+01:00
AVDTH - Gestion de la propriété de la balise en situation de migration AVDTH - Closes #2569
- - - - -
2 changed files:
- core/persistence/resources/src/main/java/fr/ird/observe/persistence/avdth/data/ImportReferentialContext.java
- core/persistence/resources/src/main/java/fr/ird/observe/persistence/avdth/data/logbook/FloatingObjectReader.java
Changes:
=====================================
core/persistence/resources/src/main/java/fr/ird/observe/persistence/avdth/data/ImportReferentialContext.java
=====================================
@@ -554,8 +554,11 @@ public class ImportReferentialContext {
return Objects.requireNonNull(transmittingBuoyType, String.format("Can't find transmittingBuoyType with code: %s", buoyTypeCode));
}
- public TransmittingBuoyOwnership getTransmittingBuoyOwnershipByVesselActivityCode(String vesselActivityCode) {
- String transmittingBuoyOwnershipCode = FloatingObjectReader.TRANSMITTING_BUOY_OWNERSHIP_CODE_MAPPING.get(vesselActivityCode);
+ public TransmittingBuoyOwnership getTransmittingBuoyOwnership(String buoyOwnershipCode) {
+ if (buoyOwnershipCode == null) {
+ return null;
+ }
+ String transmittingBuoyOwnershipCode = FloatingObjectReader.TRANSMITTING_BUOY_OWNERSHIP_CODE_MAPPING.get(buoyOwnershipCode);
if (transmittingBuoyOwnershipCode == null) {
return null;
}
=====================================
core/persistence/resources/src/main/java/fr/ird/observe/persistence/avdth/data/logbook/FloatingObjectReader.java
=====================================
@@ -108,11 +108,11 @@ public class FloatingObjectReader extends DataReader<FloatingObject> {
.put("26", "2") // Visite | 2 Récupération | W_ARRIVING |
.put("29", "1") // Visite | 1 Visite | W_ARRIVING |
.put("32", "3") // Modif ou renfor | 3 Mise à l'eau | W_ARR + W_LEA |
- .put("33", "4") // Perte | 4 Perte signal | W_ARRIVING | codes 11 et 4 à créer ; matériaux sur W_ARRIVING par convention, comme pour Visite + appartenance 3 - Ce bateau
+ .put("33", "4") // Perte | 4 Perte signal | W_ARRIVING | codes 11 et 4 à créer ; matériaux sur W_ARRIVING par convention, comme pour Visite
.put("34", "2") // Retrait | 2 Récupération | W_ARRIVING | rattacher cette balise à un FOB de type '2-2-4-4 Bouée émettrice seule'
// See https://gitlab.com/ultreiaio/ird-observe/-/issues/2568
- .put("40", "4") // Perte | 4 Perte signal | W_ARRIVING | rattacher cette balise à un FOB de type '1-1 DFAD' + appartenance 3 - Ce bateau
- .put("41", "5") // Arret commandé de la transmission | 5 Fin d'utilisation | W_ARRIVING | rattacher cette balise à un FOB de type '1-1 DFAD' + appartenance 3 - Ce bateau
+ .put("40", "4") // Perte | 4 Perte signal | W_ARRIVING | rattacher cette balise à un FOB de type '1-1 DFAD'
+ .put("41", "5") // Arret commandé de la transmission | 5 Fin d'utilisation | W_ARRIVING | rattacher cette balise à un FOB de type '1-1 DFAD'
.build();
/**
* Is floatingObjectPart on leaving from avdth ACTIVITE.C_OPERA.
@@ -193,13 +193,13 @@ public class FloatingObjectReader extends DataReader<FloatingObject> {
.put("99", "99")
.build();
/**
- * To get TransmittingBuoy.transmittingBuoyOwnership code from avdth ACTIVITE.C_OPERA code.
+ * To get TransmittingBuoy.transmittingBuoyOwnership code from avdth ACTIVITE.F_PROP_BALISE code.
+ * <p>
+ * See <a href="https://gitlab.com/ultreiaio/ird-observe/-/issues/2569">issue 2569</a>
*/
public static final Map<String, String> TRANSMITTING_BUOY_OWNERSHIP_CODE_MAPPING = Map.of(
- "33", "3",
- "40", "3",
- "41", "3"
- );
+ "1", "0",
+ "2", "3");
/**
* To get associated observedSystem code from avdth ACTIVITE.C_TYP_OBJET code.
*/
@@ -257,8 +257,7 @@ public class FloatingObjectReader extends DataReader<FloatingObject> {
}
//FIXME 29 - F_DCP_ECO
// int dcpEcoCode = resultSet.getInt(29);
- //FIXME 30 - F_PROP_BALISE
-// String buoyCode = resultSet.getString(30);
+ String buoyOwnershipCode = resultSet.getString(30);
String buoyTypeCode = resultSet.getString(31);
if (buoyTypeCode == null) {
//FIXME should fail?
@@ -335,10 +334,8 @@ public class FloatingObjectReader extends DataReader<FloatingObject> {
transmittingBuoy.setLatitude(dataContext.getActivity().getLatitude());
transmittingBuoy.setLongitude(dataContext.getActivity().getLongitude());
}
- TransmittingBuoyOwnership transmittingBuoyOwnership = dataContext.getTransmittingBuoyOwnershipByVesselActivityCode(vesselActivityCode);
- if (transmittingBuoyOwnership != null) {
- transmittingBuoy.setTransmittingBuoyOwnership(transmittingBuoyOwnership);
- }
+ TransmittingBuoyOwnership transmittingBuoyOwnership = dataContext.getTransmittingBuoyOwnership(buoyOwnershipCode);
+ transmittingBuoy.setTransmittingBuoyOwnership(transmittingBuoyOwnership);
entity.addTransmittingBuoy(transmittingBuoy);
}
} else if (addBuoyFromObservedSystem) {
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/647f687a82fd5239d055c8ad6…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/647f687a82fd5239d055c8ad6…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-9.0.x] AVDTH - Gestion de la propriété de la balise en situation de migration AVDTH - Closes #2569
by Tony CHEMIT (@tchemit) 05 Dec '22
by Tony CHEMIT (@tchemit) 05 Dec '22
05 Dec '22
Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe
Commits:
efb91ec2 by Tony Chemit at 2022-12-05T21:48:51+01:00
AVDTH - Gestion de la propriété de la balise en situation de migration AVDTH - Closes #2569
- - - - -
2 changed files:
- core/persistence/resources/src/main/java/fr/ird/observe/persistence/avdth/data/ImportReferentialContext.java
- core/persistence/resources/src/main/java/fr/ird/observe/persistence/avdth/data/logbook/FloatingObjectReader.java
Changes:
=====================================
core/persistence/resources/src/main/java/fr/ird/observe/persistence/avdth/data/ImportReferentialContext.java
=====================================
@@ -554,8 +554,11 @@ public class ImportReferentialContext {
return Objects.requireNonNull(transmittingBuoyType, String.format("Can't find transmittingBuoyType with code: %s", buoyTypeCode));
}
- public TransmittingBuoyOwnership getTransmittingBuoyOwnershipByVesselActivityCode(String vesselActivityCode) {
- String transmittingBuoyOwnershipCode = FloatingObjectReader.TRANSMITTING_BUOY_OWNERSHIP_CODE_MAPPING.get(vesselActivityCode);
+ public TransmittingBuoyOwnership getTransmittingBuoyOwnership(String buoyOwnershipCode) {
+ if (buoyOwnershipCode == null) {
+ return null;
+ }
+ String transmittingBuoyOwnershipCode = FloatingObjectReader.TRANSMITTING_BUOY_OWNERSHIP_CODE_MAPPING.get(buoyOwnershipCode);
if (transmittingBuoyOwnershipCode == null) {
return null;
}
=====================================
core/persistence/resources/src/main/java/fr/ird/observe/persistence/avdth/data/logbook/FloatingObjectReader.java
=====================================
@@ -108,11 +108,11 @@ public class FloatingObjectReader extends DataReader<FloatingObject> {
.put("26", "2") // Visite | 2 Récupération | W_ARRIVING |
.put("29", "1") // Visite | 1 Visite | W_ARRIVING |
.put("32", "3") // Modif ou renfor | 3 Mise à l'eau | W_ARR + W_LEA |
- .put("33", "4") // Perte | 4 Perte signal | W_ARRIVING | codes 11 et 4 à créer ; matériaux sur W_ARRIVING par convention, comme pour Visite + appartenance 3 - Ce bateau
+ .put("33", "4") // Perte | 4 Perte signal | W_ARRIVING | codes 11 et 4 à créer ; matériaux sur W_ARRIVING par convention, comme pour Visite
.put("34", "2") // Retrait | 2 Récupération | W_ARRIVING | rattacher cette balise à un FOB de type '2-2-4-4 Bouée émettrice seule'
// See https://gitlab.com/ultreiaio/ird-observe/-/issues/2568
- .put("40", "4") // Perte | 4 Perte signal | W_ARRIVING | rattacher cette balise à un FOB de type '1-1 DFAD' + appartenance 3 - Ce bateau
- .put("41", "5") // Arret commandé de la transmission | 5 Fin d'utilisation | W_ARRIVING | rattacher cette balise à un FOB de type '1-1 DFAD' + appartenance 3 - Ce bateau
+ .put("40", "4") // Perte | 4 Perte signal | W_ARRIVING | rattacher cette balise à un FOB de type '1-1 DFAD'
+ .put("41", "5") // Arret commandé de la transmission | 5 Fin d'utilisation | W_ARRIVING | rattacher cette balise à un FOB de type '1-1 DFAD'
.build();
/**
* Is floatingObjectPart on leaving from avdth ACTIVITE.C_OPERA.
@@ -193,13 +193,13 @@ public class FloatingObjectReader extends DataReader<FloatingObject> {
.put("99", "99")
.build();
/**
- * To get TransmittingBuoy.transmittingBuoyOwnership code from avdth ACTIVITE.C_OPERA code.
+ * To get TransmittingBuoy.transmittingBuoyOwnership code from avdth ACTIVITE.F_PROP_BALISE code.
+ * <p>
+ * See <a href="https://gitlab.com/ultreiaio/ird-observe/-/issues/2569">issue 2569</a>
*/
public static final Map<String, String> TRANSMITTING_BUOY_OWNERSHIP_CODE_MAPPING = Map.of(
- "33", "3",
- "40", "3",
- "41", "3"
- );
+ "1", "0",
+ "2", "3");
/**
* To get associated observedSystem code from avdth ACTIVITE.C_TYP_OBJET code.
*/
@@ -257,8 +257,7 @@ public class FloatingObjectReader extends DataReader<FloatingObject> {
}
//FIXME 29 - F_DCP_ECO
// int dcpEcoCode = resultSet.getInt(29);
- //FIXME 30 - F_PROP_BALISE
-// String buoyCode = resultSet.getString(30);
+ String buoyOwnershipCode = resultSet.getString(30);
String buoyTypeCode = resultSet.getString(31);
if (buoyTypeCode == null) {
//FIXME should fail?
@@ -335,10 +334,8 @@ public class FloatingObjectReader extends DataReader<FloatingObject> {
transmittingBuoy.setLatitude(dataContext.getActivity().getLatitude());
transmittingBuoy.setLongitude(dataContext.getActivity().getLongitude());
}
- TransmittingBuoyOwnership transmittingBuoyOwnership = dataContext.getTransmittingBuoyOwnershipByVesselActivityCode(vesselActivityCode);
- if (transmittingBuoyOwnership != null) {
- transmittingBuoy.setTransmittingBuoyOwnership(transmittingBuoyOwnership);
- }
+ TransmittingBuoyOwnership transmittingBuoyOwnership = dataContext.getTransmittingBuoyOwnership(buoyOwnershipCode);
+ transmittingBuoy.setTransmittingBuoyOwnership(transmittingBuoyOwnership);
entity.addTransmittingBuoy(transmittingBuoy);
}
} else if (addBuoyFromObservedSystem) {
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/efb91ec278cd5b5185c3837bf…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/efb91ec278cd5b5185c3837bf…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 7 commits: Report - ajout du report psObservationCatchWeightByGroupPerReasonForDiscard
by Tony CHEMIT (@tchemit) 05 Dec '22
by Tony CHEMIT (@tchemit) 05 Dec '22
05 Dec '22
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
cdfa26c2 by Tony Chemit at 2022-12-05T21:22:47+01:00
Report - ajout du report psObservationCatchWeightByGroupPerReasonForDiscard
- - - - -
03028d1f by Tony Chemit at 2022-12-05T21:22:47+01:00
Report - fix psObservationCatchWeightByGroup speciesGroup variable request
- - - - -
ded96bef by Tony Chemit at 2022-12-05T21:22:47+01:00
Report - ajout du report psObservationCatchTotalCountByGroupPerReasonForDiscard
- - - - -
e07b4510 by Tony Chemit at 2022-12-05T21:22:47+01:00
Report - renommage du report psObservationCatchTotalCountByGroup en psObservationCatchTotalCountByGroupPerSpeciesFate
- - - - -
ffd0eed7 by Tony Chemit at 2022-12-05T21:22:48+01:00
Report - renommage du report psObservationCatchWeightByGroup en psObservationCatchWeightByGroupPerSpeciesFate
- - - - -
d332c07a by Tony Chemit at 2022-12-05T21:22:48+01:00
Report - renommage opération ExecuteRequestAndReorganizeCountByRepeatVariable en ExecuteRequestAndReorganizeDataByRepeatVariable
- - - - -
ee6fc362 by Tony Chemit at 2022-12-05T21:23:03+01:00
Merge branch 'feature/issue_2555' into develop
Besoin d'un rapport Observations fournissant les poids par raisons de rejets
- Closes #2555
- - - - -
11 changed files:
- core/api/dto/src/main/resources/observe-reports.properties
- 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/PsObservationCatchTotalCountByGroupPerReasonForDiscardReportFixture.java
- core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchTotalCountByGroupReportFixture.java → core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchTotalCountByGroupPerSpeciesFateReportFixture.java
- + core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupPerReasonForDiscardReportFixture.java
- core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupReportFixture.java → core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupPerSpeciesFateReportFixture.java
- + core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroupPerReasonForDiscard.properties
- core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroup.properties → core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroupPerSpeciesFate.properties
- + core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroupPerReasonForDiscard.properties
- core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroup.properties → core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroupPerSpeciesFate.properties
- toolkit/api/src/main/java/fr/ird/observe/dto/report/operations/ExecuteRequestAndReorganizeCountByRepeatVariable.java → toolkit/api/src/main/java/fr/ird/observe/dto/report/operations/ExecuteRequestAndReorganizeDataByRepeatVariable.java
Changes:
=====================================
core/api/dto/src/main/resources/observe-reports.properties
=====================================
@@ -889,10 +889,10 @@ report.psObservationCatch.request.3.repeat=speciesId|column
################################################################################
## Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
################################################################################
-report.psObservationCatchTotalCountByGroup.modelType=PS
-report.psObservationCatchTotalCountByGroup.name=Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
-report.psObservationCatchTotalCountByGroup.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir, filtré par groupe
-report.psObservationCatchTotalCountByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.modelType=PS
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.name=Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir, filtré par groupe
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
Select distinct sg \
From TripImpl t \
Join t.routeObs r \
@@ -903,7 +903,7 @@ Join ca.species e \
Join e.speciesGroup sg \
Where t.id In :tripId \
Order By sg.code
-report.psObservationCatchTotalCountByGroup.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
Select distinct e \
From TripImpl t \
Join t.routeObs r \
@@ -913,11 +913,11 @@ Join c.catches ca with ca.totalCount Is Not Null \
Join ca.species e with e.speciesGroup.id = :speciesGroup \
Where t.id In :tripId \
Order By e.homeId
-report.psObservationCatchTotalCountByGroup.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
Select sf \
From SpeciesFateImpl sf \
Order by sf.discard, sf.code
-report.psObservationCatchTotalCountByGroup.request.1=0,0|row|\
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.request.1=0,0|row|\
Select \
concat(\
'[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
@@ -934,7 +934,7 @@ report.psObservationCatchTotalCountByGroup.request.1=0,0|row|\
Where m.id In :tripId \
Group by e \
Order By e.homeId
-report.psObservationCatchTotalCountByGroup.operations.1=ExecuteRequestAndReorganizeCountByRepeatVariable:species|speciesFate|\
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.operations.1=ExecuteRequestAndReorganizeDataByRepeatVariable:species|speciesFate|\
Select \
s.id, sf.id, Sum(ca.totalCount) \
From TripImpl m \
@@ -947,27 +947,27 @@ Join ca.speciesFate sf with sf.id In :speciesFate \
Where m.id In :tripId \
Group by s, sf \
Order By s.homeId
-report.psObservationCatchTotalCountByGroup.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
-report.psObservationCatchTotalCountByGroup.operations.3=SumIntRow:1|3
-report.psObservationCatchTotalCountByGroup.operations.4=SumIntColumn:1|1
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.operations.3=SumIntRow:1|3
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.operations.4=SumIntColumn:1|1
################################################################################
## Poids des captures par groupe d'espèces
################################################################################
-report.psObservationCatchWeightByGroup.modelType=PS
-report.psObservationCatchWeightByGroup.name=Observations - Poids des captures par type de banc et devenir, filtrés par groupe
-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
-report.psObservationCatchWeightByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
+report.psObservationCatchWeightByGroupPerSpeciesFate.modelType=PS
+report.psObservationCatchWeightByGroupPerSpeciesFate.name=Observations - Poids des captures par type de banc et devenir, filtrés par groupe
+report.psObservationCatchWeightByGroupPerSpeciesFate.description=Afficher le poids de captures par groupe d'espèce selon le type de banc et le devenir, filtrés par groupe
+report.psObservationCatchWeightByGroupPerSpeciesFate.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
Select distinct sg \
From TripImpl t \
Join t.routeObs r \
Join r.activity a \
Join a.set c \
-Join c.catches ca with ca.totalCount Is Not Null \
+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
-report.psObservationCatchWeightByGroup.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
+report.psObservationCatchWeightByGroupPerSpeciesFate.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
Select distinct e \
From TripImpl t \
Join t.routeObs r \
@@ -977,11 +977,11 @@ Join c.catches ca with ca.catchWeight Is Not Null \
Join ca.species e with e.speciesGroup.id = :speciesGroup \
Where t.id In :tripId \
Order By e.homeId
-report.psObservationCatchWeightByGroup.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
+report.psObservationCatchWeightByGroupPerSpeciesFate.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
Select sf \
From SpeciesFateImpl sf \
Order by sf.discard, sf.code
-report.psObservationCatchWeightByGroup.request.1=0,0|row|\
+report.psObservationCatchWeightByGroupPerSpeciesFate.request.1=0,0|row|\
Select \
concat(\
'[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
@@ -998,7 +998,7 @@ report.psObservationCatchWeightByGroup.request.1=0,0|row|\
Where m.id In :tripId \
Group by e \
Order By e.homeId
-report.psObservationCatchWeightByGroup.operations.1=ExecuteRequestAndReorganizeCountByRepeatVariable:species|speciesFate|\
+report.psObservationCatchWeightByGroupPerSpeciesFate.operations.1=ExecuteRequestAndReorganizeDataByRepeatVariable:species|speciesFate|\
Select \
s.id, sf.id, Sum(ca.catchWeight) \
From TripImpl m \
@@ -1011,9 +1011,137 @@ Join ca.speciesFate sf with sf.id In :speciesFate \
Where m.id In :tripId \
Group by s, sf \
Order By s.homeId
-report.psObservationCatchWeightByGroup.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
-report.psObservationCatchWeightByGroup.operations.3=SumIntRow:1|3
-report.psObservationCatchWeightByGroup.operations.4=SumIntColumn:1|1
+report.psObservationCatchWeightByGroupPerSpeciesFate.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
+report.psObservationCatchWeightByGroupPerSpeciesFate.operations.3=SumIntRow:1|3
+report.psObservationCatchWeightByGroupPerSpeciesFate.operations.4=SumIntColumn:1|1
+################################################################################
+## Poids des captures par groupe d'espèces, type de banc et et raison de rejet
+################################################################################
+report.psObservationCatchWeightByGroupPerReasonForDiscard.modelType=PS
+report.psObservationCatchWeightByGroupPerReasonForDiscard.name=Observations - Poids des rejets par type de banc et raison de rejet, filtrés par groupe
+report.psObservationCatchWeightByGroupPerReasonForDiscard.description=Afficher le poids de captures rejetées par espèce selon le type de banc et type de rejet, filtrés par groupe
+report.psObservationCatchWeightByGroupPerReasonForDiscard.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
+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 And ca.reasonForDiscard Is Not Null \
+Join ca.species e \
+Join e.speciesGroup sg \
+Where t.id In :tripId \
+Order By sg.code
+report.psObservationCatchWeightByGroupPerReasonForDiscard.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
+Select distinct e \
+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.reasonForDiscard Is Not Null \
+Join ca.species e with e.speciesGroup.id = :speciesGroup \
+Where t.id In :tripId \
+Order By e.homeId
+report.psObservationCatchWeightByGroupPerReasonForDiscard.repeatVariable.2.reasonForDiscard=fr.ird.observe.entities.referential.ps.observation.ReasonForDiscard|\
+Select sf \
+From ReasonForDiscardImpl sf \
+Order by sf.code
+report.psObservationCatchWeightByGroupPerReasonForDiscard.request.1=0,0|row|\
+ Select \
+ concat(\
+ '[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
+ ' [sc]', (case when e.scientificLabel is not null then e.scientificLabel else '-' end), \
+ ' [fr]', (case when e.label2 is not null then e.label2 else '-' end)), \
+ Sum(case c.schoolType.id when 'fr.ird.referential.ps.common.SchoolType#0#2' then ca.catchWeight else 0 end), \
+ Sum(case c.schoolType.id when 'fr.ird.referential.ps.common.SchoolType#0#1' then ca.catchWeight else 0 end) \
+ From TripImpl m \
+ Join m.routeObs r \
+ Join r.activity a \
+ Join a.set c \
+ Join c.catches ca with ca.catchWeight Is Not Null And ca.reasonForDiscard Is Not Null \
+ Join ca.species e with e.id In :species \
+ Where m.id In :tripId \
+ Group by e \
+ Order By e.homeId
+report.psObservationCatchWeightByGroupPerReasonForDiscard.operations.1=ExecuteRequestAndReorganizeDataByRepeatVariable:species|reasonForDiscard|\
+Select \
+s.id, sf.id, Sum(ca.catchWeight) \
+From TripImpl m \
+Join m.routeObs r \
+Join r.activity a \
+Join a.set c \
+Join c.catches ca with ca.catchWeight Is Not Null \
+Join ca.species s with s.id In :species \
+Join ca.reasonForDiscard sf with sf.id In :reasonForDiscard \
+Where m.id In :tripId \
+Group by s, sf \
+Order By s.homeId
+report.psObservationCatchWeightByGroupPerReasonForDiscard.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|reasonForDiscard
+report.psObservationCatchWeightByGroupPerReasonForDiscard.operations.3=SumIntRow:1|3
+report.psObservationCatchWeightByGroupPerReasonForDiscard.operations.4=SumIntColumn:1|1
+################################################################################
+## Dénombrement des rejets par groupe d'espèces, type de banc et raison de rejet
+################################################################################
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.modelType=PS
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.name=Observations - Dénombrement des rejets par type de banc et raison de rejet, filtrés par groupe
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.description=Afficher le nombre de captures rejetées par espèce selon le type de banc et le type de rejet, filtrés par groupe
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
+Select distinct sg \
+From TripImpl t \
+Join t.routeObs r \
+Join r.activity a \
+Join a.set c \
+Join c.catches ca with ca.totalCount Is Not Null And ca.reasonForDiscard Is Not Null \
+Join ca.species e \
+Join e.speciesGroup sg \
+Where t.id In :tripId \
+Order By sg.code
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
+Select distinct e \
+From TripImpl t \
+Join t.routeObs r \
+Join r.activity a \
+Join a.set c \
+Join c.catches ca with ca.totalCount Is Not Null And ca.reasonForDiscard Is Not Null \
+Join ca.species e with e.speciesGroup.id = :speciesGroup \
+Where t.id In :tripId \
+Order By e.homeId
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.repeatVariable.2.reasonForDiscard=fr.ird.observe.entities.referential.ps.observation.ReasonForDiscard|\
+Select sf \
+From ReasonForDiscardImpl sf \
+Order by sf.code
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.request.1=0,0|row|\
+ Select \
+ concat(\
+ '[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
+ ' [sc]', (case when e.scientificLabel is not null then e.scientificLabel else '-' end), \
+ ' [fr]', (case when e.label2 is not null then e.label2 else '-' end)), \
+ Sum(case c.schoolType.id when 'fr.ird.referential.ps.common.SchoolType#0#2' then ca.totalCount else 0 end), \
+ Sum(case c.schoolType.id when 'fr.ird.referential.ps.common.SchoolType#0#1' then ca.totalCount else 0 end) \
+ From TripImpl m \
+ Join m.routeObs r \
+ Join r.activity a \
+ Join a.set c \
+ Join c.catches ca with ca.totalCount Is Not Null And ca.reasonForDiscard Is Not Null \
+ Join ca.species e with e.id In :species \
+ Where m.id In :tripId \
+ Group by e \
+ Order By e.homeId
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.operations.1=ExecuteRequestAndReorganizeDataByRepeatVariable:species|reasonForDiscard|\
+Select \
+s.id, sf.id, Sum(ca.totalCount) \
+From TripImpl m \
+Join m.routeObs r \
+Join r.activity a \
+Join a.set c \
+Join c.catches ca with ca.totalCount Is Not Null \
+Join ca.species s with s.id In :species \
+Join ca.reasonForDiscard sf with sf.id In :reasonForDiscard \
+Where m.id In :tripId \
+Group by s, sf \
+Order By s.homeId
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|reasonForDiscard
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.operations.3=SumIntRow:1|3
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.operations.4=SumIntColumn:1|1
###########################################################
## Distribution des tailles par espèces et type de mesure
###########################################################
@@ -1050,7 +1178,7 @@ Join nts.sampleMeasure ntl with ntl.species.id = :species And ntl.sizeMeasureTyp
Where t.id In :tripId \
Order By ntl.length
report.psObservationLengthsDistribution.operations.1=CopyRepeatVariableToFirstColumn:length
-report.psObservationLengthsDistribution.operations.2=ExecuteRequestAndReorganizeCountByRepeatVariable:length|speciesFate|\
+report.psObservationLengthsDistribution.operations.2=ExecuteRequestAndReorganizeDataByRepeatVariable:length|speciesFate|\
Select ntl.length, sf.id, sum(ntl.count) \
From TripImpl t \
Join t.routeObs r \
=====================================
core/services/local/src/test/java/fr/ird/observe/services/local/service/ReportServiceLocalReadTest.java
=====================================
@@ -37,13 +37,26 @@ public class ReportServiceLocalReadTest extends GeneratedReportServiceLocalReadT
}
@Test
- public void executeReportPsObservationCatchTotalCountByGroup() {
+ public void executeReportPsObservationCatchTotalCountByGroupPerSpeciesFate() {
ReportService service = getService();
- fixtures.executeReport(getServicesProvider(), service, "psObservationCatchTotalCountByGroup");
+ fixtures.executeReport(getServicesProvider(), service, "psObservationCatchTotalCountByGroupPerSpeciesFate");
}
+
+ @Test
+ public void executeReportPsObservationCatchWeightByGroupPerSpeciesFate() {
+ ReportService service = getService();
+ fixtures.executeReport(getServicesProvider(), service, "psObservationCatchWeightByGroupPerSpeciesFate");
+ }
+
+ @Test
+ public void executeReportPsObservationCatchWeightByGroupPerReasonForDiscard() {
+ ReportService service = getService();
+ fixtures.executeReport(getServicesProvider(), service, "psObservationCatchWeightByGroupPerReasonForDiscard");
+ }
+
@Test
- public void executeReportPsObservationCatchWeightByGroup() {
+ public void executeReportPsObservationCatchTotalCountByGroupPerReasonForDiscard() {
ReportService service = getService();
- fixtures.executeReport(getServicesProvider(), service, "psObservationCatchWeightByGroup");
+ fixtures.executeReport(getServicesProvider(), service, "psObservationCatchTotalCountByGroupPerReasonForDiscard");
}
}
=====================================
core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchTotalCountByGroupPerReasonForDiscardReportFixture.java
=====================================
@@ -0,0 +1,53 @@
+package fr.ird.observe.services.service.report.ps;
+
+/*-
+ * #%L
+ * ObServe Core :: Services :: Test
+ * %%
+ * Copyright (C) 2008 - 2022 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.dto.report.Report;
+import fr.ird.observe.dto.report.ReportRequest;
+import fr.ird.observe.services.service.ReportFixture;
+
+import java.util.Iterator;
+
+/**
+ * Created on 05/12/2022.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since 9.0.22
+ */
+(a)AutoService(ReportFixture.class)
+public class PsObservationCatchTotalCountByGroupPerReasonForDiscardReportFixture extends ReportFixture {
+
+ @Override
+ public void assertSyntax(Report report) {
+ super.assertSyntax(report);
+ Iterator<ReportRequest> requests = getRequestIterator(report);
+ assertReportRequestDimension(requests, ReportRequest.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/PsObservationCatchTotalCountByGroupReportFixture.java → core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchTotalCountByGroupPerSpeciesFateReportFixture.java
=====================================
@@ -35,7 +35,7 @@ import java.util.Iterator;
* @since 1.9
*/
@AutoService(ReportFixture.class)
-public class PsObservationCatchTotalCountByGroupReportFixture extends ReportFixture {
+public class PsObservationCatchTotalCountByGroupPerSpeciesFateReportFixture extends ReportFixture {
@Override
public void assertSyntax(Report report) {
=====================================
core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupPerReasonForDiscardReportFixture.java
=====================================
@@ -0,0 +1,52 @@
+package fr.ird.observe.services.service.report.ps;
+
+/*-
+ * #%L
+ * ObServe Core :: Services :: Test
+ * %%
+ * Copyright (C) 2008 - 2022 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.dto.report.Report;
+import fr.ird.observe.dto.report.ReportRequest;
+import fr.ird.observe.services.service.ReportFixture;
+
+import java.util.Iterator;
+
+/**
+ * Created on 05/12/2022.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since 9.0.22
+ */
+(a)AutoService(ReportFixture.class)
+public class PsObservationCatchWeightByGroupPerReasonForDiscardReportFixture extends ReportFixture {
+
+ @Override
+ public void assertSyntax(Report report) {
+ super.assertSyntax(report);
+ Iterator<ReportRequest> requests = getRequestIterator(report);
+ assertReportRequestDimension(requests, ReportRequest.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/PsObservationCatchWeightByGroupReportFixture.java → core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupPerSpeciesFateReportFixture.java
=====================================
@@ -36,7 +36,7 @@ import java.util.Iterator;
* @since 9.0.22
*/
@AutoService(ReportFixture.class)
-public class PsObservationCatchWeightByGroupReportFixture extends ReportFixture {
+public class PsObservationCatchWeightByGroupPerSpeciesFateReportFixture extends ReportFixture {
@Override
public void assertSyntax(Report report) {
=====================================
core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroupPerReasonForDiscard.properties
=====================================
@@ -0,0 +1,32 @@
+###
+# #%L
+# ObServe Core :: Services :: Test
+# %%
+# Copyright (C) 2008 - 2022 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 - Dénombrement des rejets par type de banc et raison de rejet, filtrés par groupe
+syntax.description=Afficher le nombre de captures rejetées par espèce selon le type de banc et le type de rejet, filtrés par groupe
+syntax.rows=-1
+syntax.columns=-1
+syntax.columnsHeader=
+syntax.rowsHeader=
+syntax.nbRequests=1
+result.columns=9
+result.rows=2
+result.0=Espèce^Total BL^Total BO^Espèce non désirée ou protégée^Taille^Cuve pleine^Poisson abîmé ou impropre à la consommation humaine^Autre ( à préciser dans les notes )^Total
+result.1=[FAO]ALV [sc]Alopias vulpinus [fr]Renard^0^3^null^null^3^null^null^3
\ No newline at end of file
=====================================
core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroup.properties → core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroupPerSpeciesFate.properties
=====================================
=====================================
core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroupPerReasonForDiscard.properties
=====================================
@@ -0,0 +1,32 @@
+###
+# #%L
+# ObServe Core :: Services :: Test
+# %%
+# Copyright (C) 2008 - 2022 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 - Poids des rejets par type de banc et raison de rejet, filtrés par groupe
+syntax.description=Afficher le poids de captures rejetées par espèce selon le type de banc et type de rejet, filtrés par groupe
+syntax.rows=-1
+syntax.columns=-1
+syntax.columnsHeader=
+syntax.rowsHeader=
+syntax.nbRequests=1
+result.columns=9
+result.rows=2
+result.0=Espèce^Total BL^Total BO^Espèce non désirée ou protégée^Taille^Cuve pleine^Poisson abîmé ou impropre à la consommation humaine^Autre ( à préciser dans les notes )^Total
+result.1=[FAO]ALV [sc]Alopias vulpinus [fr]Renard^0.0^12.0^null^null^12.0^null^null^12
\ No newline at end of file
=====================================
core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroup.properties → core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroupPerSpeciesFate.properties
=====================================
=====================================
toolkit/api/src/main/java/fr/ird/observe/dto/report/operations/ExecuteRequestAndReorganizeCountByRepeatVariable.java → toolkit/api/src/main/java/fr/ird/observe/dto/report/operations/ExecuteRequestAndReorganizeDataByRepeatVariable.java
=====================================
@@ -46,7 +46,7 @@ import java.util.Set;
* @since 9.0.17
*/
@AutoService(ReportOperationConsumer.class)
-public class ExecuteRequestAndReorganizeCountByRepeatVariable implements ReportOperationConsumer {
+public class ExecuteRequestAndReorganizeDataByRepeatVariable implements ReportOperationConsumer {
@Override
public DataMatrix consume(String parameters, ReportRequestExecutor requestExecutor, Report report, Set<String> tripId, DataMatrix incoming) {
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/c83e69d18c66b158044ce87f…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/c83e69d18c66b158044ce87f…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-9.0.x] 7 commits: Report - ajout du report psObservationCatchWeightByGroupPerReasonForDiscard
by Tony CHEMIT (@tchemit) 05 Dec '22
by Tony CHEMIT (@tchemit) 05 Dec '22
05 Dec '22
Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe
Commits:
ca079e35 by Tony Chemit at 2022-12-05T20:56:57+01:00
Report - ajout du report psObservationCatchWeightByGroupPerReasonForDiscard
- - - - -
ab5114b6 by Tony Chemit at 2022-12-05T20:56:57+01:00
Report - fix psObservationCatchWeightByGroup speciesGroup variable request
- - - - -
b5016a38 by Tony Chemit at 2022-12-05T21:06:30+01:00
Report - ajout du report psObservationCatchTotalCountByGroupPerReasonForDiscard
- - - - -
8cd8df10 by Tony Chemit at 2022-12-05T21:06:30+01:00
Report - renommage du report psObservationCatchTotalCountByGroup en psObservationCatchTotalCountByGroupPerSpeciesFate
- - - - -
50f213e9 by Tony Chemit at 2022-12-05T21:06:30+01:00
Report - renommage du report psObservationCatchWeightByGroup en psObservationCatchWeightByGroupPerSpeciesFate
- - - - -
067791dd by Tony Chemit at 2022-12-05T21:06:30+01:00
Report - renommage opération ExecuteRequestAndReorganizeCountByRepeatVariable en ExecuteRequestAndReorganizeDataByRepeatVariable
- - - - -
c5bb361b by Tony Chemit at 2022-12-05T21:21:55+01:00
Merge branch 'feature/issue_2555' into develop-9.0.x
Besoin d'un rapport Observations fournissant les poids par raisons de rejets
- Closes #2555
- - - - -
11 changed files:
- core/api/dto/src/main/resources/observe-reports.properties
- 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/PsObservationCatchTotalCountByGroupPerReasonForDiscardReportFixture.java
- core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchTotalCountByGroupReportFixture.java → core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchTotalCountByGroupPerSpeciesFateReportFixture.java
- + core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupPerReasonForDiscardReportFixture.java
- core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupReportFixture.java → core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupPerSpeciesFateReportFixture.java
- + core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroupPerReasonForDiscard.properties
- core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroup.properties → core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroupPerSpeciesFate.properties
- + core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroupPerReasonForDiscard.properties
- core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroup.properties → core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroupPerSpeciesFate.properties
- toolkit/api/src/main/java/fr/ird/observe/dto/report/operations/ExecuteRequestAndReorganizeCountByRepeatVariable.java → toolkit/api/src/main/java/fr/ird/observe/dto/report/operations/ExecuteRequestAndReorganizeDataByRepeatVariable.java
Changes:
=====================================
core/api/dto/src/main/resources/observe-reports.properties
=====================================
@@ -889,10 +889,10 @@ report.psObservationCatch.request.3.repeat=speciesId|column
################################################################################
## Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
################################################################################
-report.psObservationCatchTotalCountByGroup.modelType=PS
-report.psObservationCatchTotalCountByGroup.name=Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
-report.psObservationCatchTotalCountByGroup.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir, filtré par groupe
-report.psObservationCatchTotalCountByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.modelType=PS
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.name=Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir, filtré par groupe
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
Select distinct sg \
From TripImpl t \
Join t.routeObs r \
@@ -903,7 +903,7 @@ Join ca.species e \
Join e.speciesGroup sg \
Where t.id In :tripId \
Order By sg.code
-report.psObservationCatchTotalCountByGroup.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
Select distinct e \
From TripImpl t \
Join t.routeObs r \
@@ -913,11 +913,11 @@ Join c.catches ca with ca.totalCount Is Not Null \
Join ca.species e with e.speciesGroup.id = :speciesGroup \
Where t.id In :tripId \
Order By e.homeId
-report.psObservationCatchTotalCountByGroup.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
Select sf \
From SpeciesFateImpl sf \
Order by sf.discard, sf.code
-report.psObservationCatchTotalCountByGroup.request.1=0,0|row|\
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.request.1=0,0|row|\
Select \
concat(\
'[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
@@ -934,7 +934,7 @@ report.psObservationCatchTotalCountByGroup.request.1=0,0|row|\
Where m.id In :tripId \
Group by e \
Order By e.homeId
-report.psObservationCatchTotalCountByGroup.operations.1=ExecuteRequestAndReorganizeCountByRepeatVariable:species|speciesFate|\
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.operations.1=ExecuteRequestAndReorganizeDataByRepeatVariable:species|speciesFate|\
Select \
s.id, sf.id, Sum(ca.totalCount) \
From TripImpl m \
@@ -947,27 +947,27 @@ Join ca.speciesFate sf with sf.id In :speciesFate \
Where m.id In :tripId \
Group by s, sf \
Order By s.homeId
-report.psObservationCatchTotalCountByGroup.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
-report.psObservationCatchTotalCountByGroup.operations.3=SumIntRow:1|3
-report.psObservationCatchTotalCountByGroup.operations.4=SumIntColumn:1|1
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.operations.3=SumIntRow:1|3
+report.psObservationCatchTotalCountByGroupPerSpeciesFate.operations.4=SumIntColumn:1|1
################################################################################
## Poids des captures par groupe d'espèces
################################################################################
-report.psObservationCatchWeightByGroup.modelType=PS
-report.psObservationCatchWeightByGroup.name=Observations - Poids des captures par type de banc et devenir, filtrés par groupe
-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
-report.psObservationCatchWeightByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
+report.psObservationCatchWeightByGroupPerSpeciesFate.modelType=PS
+report.psObservationCatchWeightByGroupPerSpeciesFate.name=Observations - Poids des captures par type de banc et devenir, filtrés par groupe
+report.psObservationCatchWeightByGroupPerSpeciesFate.description=Afficher le poids de captures par groupe d'espèce selon le type de banc et le devenir, filtrés par groupe
+report.psObservationCatchWeightByGroupPerSpeciesFate.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
Select distinct sg \
From TripImpl t \
Join t.routeObs r \
Join r.activity a \
Join a.set c \
-Join c.catches ca with ca.totalCount Is Not Null \
+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
-report.psObservationCatchWeightByGroup.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
+report.psObservationCatchWeightByGroupPerSpeciesFate.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
Select distinct e \
From TripImpl t \
Join t.routeObs r \
@@ -977,11 +977,11 @@ Join c.catches ca with ca.catchWeight Is Not Null \
Join ca.species e with e.speciesGroup.id = :speciesGroup \
Where t.id In :tripId \
Order By e.homeId
-report.psObservationCatchWeightByGroup.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
+report.psObservationCatchWeightByGroupPerSpeciesFate.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
Select sf \
From SpeciesFateImpl sf \
Order by sf.discard, sf.code
-report.psObservationCatchWeightByGroup.request.1=0,0|row|\
+report.psObservationCatchWeightByGroupPerSpeciesFate.request.1=0,0|row|\
Select \
concat(\
'[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
@@ -998,7 +998,7 @@ report.psObservationCatchWeightByGroup.request.1=0,0|row|\
Where m.id In :tripId \
Group by e \
Order By e.homeId
-report.psObservationCatchWeightByGroup.operations.1=ExecuteRequestAndReorganizeCountByRepeatVariable:species|speciesFate|\
+report.psObservationCatchWeightByGroupPerSpeciesFate.operations.1=ExecuteRequestAndReorganizeDataByRepeatVariable:species|speciesFate|\
Select \
s.id, sf.id, Sum(ca.catchWeight) \
From TripImpl m \
@@ -1011,9 +1011,137 @@ Join ca.speciesFate sf with sf.id In :speciesFate \
Where m.id In :tripId \
Group by s, sf \
Order By s.homeId
-report.psObservationCatchWeightByGroup.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
-report.psObservationCatchWeightByGroup.operations.3=SumIntRow:1|3
-report.psObservationCatchWeightByGroup.operations.4=SumIntColumn:1|1
+report.psObservationCatchWeightByGroupPerSpeciesFate.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
+report.psObservationCatchWeightByGroupPerSpeciesFate.operations.3=SumIntRow:1|3
+report.psObservationCatchWeightByGroupPerSpeciesFate.operations.4=SumIntColumn:1|1
+################################################################################
+## Poids des captures par groupe d'espèces, type de banc et et raison de rejet
+################################################################################
+report.psObservationCatchWeightByGroupPerReasonForDiscard.modelType=PS
+report.psObservationCatchWeightByGroupPerReasonForDiscard.name=Observations - Poids des rejets par type de banc et raison de rejet, filtrés par groupe
+report.psObservationCatchWeightByGroupPerReasonForDiscard.description=Afficher le poids de captures rejetées par espèce selon le type de banc et type de rejet, filtrés par groupe
+report.psObservationCatchWeightByGroupPerReasonForDiscard.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
+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 And ca.reasonForDiscard Is Not Null \
+Join ca.species e \
+Join e.speciesGroup sg \
+Where t.id In :tripId \
+Order By sg.code
+report.psObservationCatchWeightByGroupPerReasonForDiscard.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
+Select distinct e \
+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.reasonForDiscard Is Not Null \
+Join ca.species e with e.speciesGroup.id = :speciesGroup \
+Where t.id In :tripId \
+Order By e.homeId
+report.psObservationCatchWeightByGroupPerReasonForDiscard.repeatVariable.2.reasonForDiscard=fr.ird.observe.entities.referential.ps.observation.ReasonForDiscard|\
+Select sf \
+From ReasonForDiscardImpl sf \
+Order by sf.code
+report.psObservationCatchWeightByGroupPerReasonForDiscard.request.1=0,0|row|\
+ Select \
+ concat(\
+ '[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
+ ' [sc]', (case when e.scientificLabel is not null then e.scientificLabel else '-' end), \
+ ' [fr]', (case when e.label2 is not null then e.label2 else '-' end)), \
+ Sum(case c.schoolType.id when 'fr.ird.referential.ps.common.SchoolType#0#2' then ca.catchWeight else 0 end), \
+ Sum(case c.schoolType.id when 'fr.ird.referential.ps.common.SchoolType#0#1' then ca.catchWeight else 0 end) \
+ From TripImpl m \
+ Join m.routeObs r \
+ Join r.activity a \
+ Join a.set c \
+ Join c.catches ca with ca.catchWeight Is Not Null And ca.reasonForDiscard Is Not Null \
+ Join ca.species e with e.id In :species \
+ Where m.id In :tripId \
+ Group by e \
+ Order By e.homeId
+report.psObservationCatchWeightByGroupPerReasonForDiscard.operations.1=ExecuteRequestAndReorganizeDataByRepeatVariable:species|reasonForDiscard|\
+Select \
+s.id, sf.id, Sum(ca.catchWeight) \
+From TripImpl m \
+Join m.routeObs r \
+Join r.activity a \
+Join a.set c \
+Join c.catches ca with ca.catchWeight Is Not Null \
+Join ca.species s with s.id In :species \
+Join ca.reasonForDiscard sf with sf.id In :reasonForDiscard \
+Where m.id In :tripId \
+Group by s, sf \
+Order By s.homeId
+report.psObservationCatchWeightByGroupPerReasonForDiscard.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|reasonForDiscard
+report.psObservationCatchWeightByGroupPerReasonForDiscard.operations.3=SumIntRow:1|3
+report.psObservationCatchWeightByGroupPerReasonForDiscard.operations.4=SumIntColumn:1|1
+################################################################################
+## Dénombrement des rejets par groupe d'espèces, type de banc et raison de rejet
+################################################################################
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.modelType=PS
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.name=Observations - Dénombrement des rejets par type de banc et raison de rejet, filtrés par groupe
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.description=Afficher le nombre de captures rejetées par espèce selon le type de banc et le type de rejet, filtrés par groupe
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
+Select distinct sg \
+From TripImpl t \
+Join t.routeObs r \
+Join r.activity a \
+Join a.set c \
+Join c.catches ca with ca.totalCount Is Not Null And ca.reasonForDiscard Is Not Null \
+Join ca.species e \
+Join e.speciesGroup sg \
+Where t.id In :tripId \
+Order By sg.code
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
+Select distinct e \
+From TripImpl t \
+Join t.routeObs r \
+Join r.activity a \
+Join a.set c \
+Join c.catches ca with ca.totalCount Is Not Null And ca.reasonForDiscard Is Not Null \
+Join ca.species e with e.speciesGroup.id = :speciesGroup \
+Where t.id In :tripId \
+Order By e.homeId
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.repeatVariable.2.reasonForDiscard=fr.ird.observe.entities.referential.ps.observation.ReasonForDiscard|\
+Select sf \
+From ReasonForDiscardImpl sf \
+Order by sf.code
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.request.1=0,0|row|\
+ Select \
+ concat(\
+ '[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
+ ' [sc]', (case when e.scientificLabel is not null then e.scientificLabel else '-' end), \
+ ' [fr]', (case when e.label2 is not null then e.label2 else '-' end)), \
+ Sum(case c.schoolType.id when 'fr.ird.referential.ps.common.SchoolType#0#2' then ca.totalCount else 0 end), \
+ Sum(case c.schoolType.id when 'fr.ird.referential.ps.common.SchoolType#0#1' then ca.totalCount else 0 end) \
+ From TripImpl m \
+ Join m.routeObs r \
+ Join r.activity a \
+ Join a.set c \
+ Join c.catches ca with ca.totalCount Is Not Null And ca.reasonForDiscard Is Not Null \
+ Join ca.species e with e.id In :species \
+ Where m.id In :tripId \
+ Group by e \
+ Order By e.homeId
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.operations.1=ExecuteRequestAndReorganizeDataByRepeatVariable:species|reasonForDiscard|\
+Select \
+s.id, sf.id, Sum(ca.totalCount) \
+From TripImpl m \
+Join m.routeObs r \
+Join r.activity a \
+Join a.set c \
+Join c.catches ca with ca.totalCount Is Not Null \
+Join ca.species s with s.id In :species \
+Join ca.reasonForDiscard sf with sf.id In :reasonForDiscard \
+Where m.id In :tripId \
+Group by s, sf \
+Order By s.homeId
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|reasonForDiscard
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.operations.3=SumIntRow:1|3
+report.psObservationCatchTotalCountByGroupPerReasonForDiscard.operations.4=SumIntColumn:1|1
###########################################################
## Distribution des tailles par espèces et type de mesure
###########################################################
@@ -1050,7 +1178,7 @@ Join nts.sampleMeasure ntl with ntl.species.id = :species And ntl.sizeMeasureTyp
Where t.id In :tripId \
Order By ntl.length
report.psObservationLengthsDistribution.operations.1=CopyRepeatVariableToFirstColumn:length
-report.psObservationLengthsDistribution.operations.2=ExecuteRequestAndReorganizeCountByRepeatVariable:length|speciesFate|\
+report.psObservationLengthsDistribution.operations.2=ExecuteRequestAndReorganizeDataByRepeatVariable:length|speciesFate|\
Select ntl.length, sf.id, sum(ntl.count) \
From TripImpl t \
Join t.routeObs r \
=====================================
core/services/local/src/test/java/fr/ird/observe/services/local/service/ReportServiceLocalReadTest.java
=====================================
@@ -37,13 +37,26 @@ public class ReportServiceLocalReadTest extends GeneratedReportServiceLocalReadT
}
@Test
- public void executeReportPsObservationCatchTotalCountByGroup() {
+ public void executeReportPsObservationCatchTotalCountByGroupPerSpeciesFate() {
ReportService service = getService();
- fixtures.executeReport(getServicesProvider(), service, "psObservationCatchTotalCountByGroup");
+ fixtures.executeReport(getServicesProvider(), service, "psObservationCatchTotalCountByGroupPerSpeciesFate");
}
+
+ @Test
+ public void executeReportPsObservationCatchWeightByGroupPerSpeciesFate() {
+ ReportService service = getService();
+ fixtures.executeReport(getServicesProvider(), service, "psObservationCatchWeightByGroupPerSpeciesFate");
+ }
+
+ @Test
+ public void executeReportPsObservationCatchWeightByGroupPerReasonForDiscard() {
+ ReportService service = getService();
+ fixtures.executeReport(getServicesProvider(), service, "psObservationCatchWeightByGroupPerReasonForDiscard");
+ }
+
@Test
- public void executeReportPsObservationCatchWeightByGroup() {
+ public void executeReportPsObservationCatchTotalCountByGroupPerReasonForDiscard() {
ReportService service = getService();
- fixtures.executeReport(getServicesProvider(), service, "psObservationCatchWeightByGroup");
+ fixtures.executeReport(getServicesProvider(), service, "psObservationCatchTotalCountByGroupPerReasonForDiscard");
}
}
=====================================
core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchTotalCountByGroupPerReasonForDiscardReportFixture.java
=====================================
@@ -0,0 +1,53 @@
+package fr.ird.observe.services.service.report.ps;
+
+/*-
+ * #%L
+ * ObServe Core :: Services :: Test
+ * %%
+ * Copyright (C) 2008 - 2022 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.dto.report.Report;
+import fr.ird.observe.dto.report.ReportRequest;
+import fr.ird.observe.services.service.ReportFixture;
+
+import java.util.Iterator;
+
+/**
+ * Created on 05/12/2022.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since 9.0.22
+ */
+(a)AutoService(ReportFixture.class)
+public class PsObservationCatchTotalCountByGroupPerReasonForDiscardReportFixture extends ReportFixture {
+
+ @Override
+ public void assertSyntax(Report report) {
+ super.assertSyntax(report);
+ Iterator<ReportRequest> requests = getRequestIterator(report);
+ assertReportRequestDimension(requests, ReportRequest.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/PsObservationCatchTotalCountByGroupReportFixture.java → core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchTotalCountByGroupPerSpeciesFateReportFixture.java
=====================================
@@ -35,7 +35,7 @@ import java.util.Iterator;
* @since 1.9
*/
@AutoService(ReportFixture.class)
-public class PsObservationCatchTotalCountByGroupReportFixture extends ReportFixture {
+public class PsObservationCatchTotalCountByGroupPerSpeciesFateReportFixture extends ReportFixture {
@Override
public void assertSyntax(Report report) {
=====================================
core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupPerReasonForDiscardReportFixture.java
=====================================
@@ -0,0 +1,52 @@
+package fr.ird.observe.services.service.report.ps;
+
+/*-
+ * #%L
+ * ObServe Core :: Services :: Test
+ * %%
+ * Copyright (C) 2008 - 2022 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.dto.report.Report;
+import fr.ird.observe.dto.report.ReportRequest;
+import fr.ird.observe.services.service.ReportFixture;
+
+import java.util.Iterator;
+
+/**
+ * Created on 05/12/2022.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since 9.0.22
+ */
+(a)AutoService(ReportFixture.class)
+public class PsObservationCatchWeightByGroupPerReasonForDiscardReportFixture extends ReportFixture {
+
+ @Override
+ public void assertSyntax(Report report) {
+ super.assertSyntax(report);
+ Iterator<ReportRequest> requests = getRequestIterator(report);
+ assertReportRequestDimension(requests, ReportRequest.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/PsObservationCatchWeightByGroupReportFixture.java → core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupPerSpeciesFateReportFixture.java
=====================================
@@ -36,7 +36,7 @@ import java.util.Iterator;
* @since 9.0.22
*/
@AutoService(ReportFixture.class)
-public class PsObservationCatchWeightByGroupReportFixture extends ReportFixture {
+public class PsObservationCatchWeightByGroupPerSpeciesFateReportFixture extends ReportFixture {
@Override
public void assertSyntax(Report report) {
=====================================
core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroupPerReasonForDiscard.properties
=====================================
@@ -0,0 +1,32 @@
+###
+# #%L
+# ObServe Core :: Services :: Test
+# %%
+# Copyright (C) 2008 - 2022 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 - Dénombrement des rejets par type de banc et raison de rejet, filtrés par groupe
+syntax.description=Afficher le nombre de captures rejetées par espèce selon le type de banc et le type de rejet, filtrés par groupe
+syntax.rows=-1
+syntax.columns=-1
+syntax.columnsHeader=
+syntax.rowsHeader=
+syntax.nbRequests=1
+result.columns=9
+result.rows=2
+result.0=Espèce^Total BL^Total BO^Espèce non désirée ou protégée^Taille^Cuve pleine^Poisson abîmé ou impropre à la consommation humaine^Autre ( à préciser dans les notes )^Total
+result.1=[FAO]ALV [sc]Alopias vulpinus [fr]Renard^0^3^null^null^3^null^null^3
\ No newline at end of file
=====================================
core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroup.properties → core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroupPerSpeciesFate.properties
=====================================
=====================================
core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroupPerReasonForDiscard.properties
=====================================
@@ -0,0 +1,32 @@
+###
+# #%L
+# ObServe Core :: Services :: Test
+# %%
+# Copyright (C) 2008 - 2022 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 - Poids des rejets par type de banc et raison de rejet, filtrés par groupe
+syntax.description=Afficher le poids de captures rejetées par espèce selon le type de banc et type de rejet, filtrés par groupe
+syntax.rows=-1
+syntax.columns=-1
+syntax.columnsHeader=
+syntax.rowsHeader=
+syntax.nbRequests=1
+result.columns=9
+result.rows=2
+result.0=Espèce^Total BL^Total BO^Espèce non désirée ou protégée^Taille^Cuve pleine^Poisson abîmé ou impropre à la consommation humaine^Autre ( à préciser dans les notes )^Total
+result.1=[FAO]ALV [sc]Alopias vulpinus [fr]Renard^0.0^12.0^null^null^12.0^null^null^12
\ No newline at end of file
=====================================
core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroup.properties → core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroupPerSpeciesFate.properties
=====================================
=====================================
toolkit/api/src/main/java/fr/ird/observe/dto/report/operations/ExecuteRequestAndReorganizeCountByRepeatVariable.java → toolkit/api/src/main/java/fr/ird/observe/dto/report/operations/ExecuteRequestAndReorganizeDataByRepeatVariable.java
=====================================
@@ -46,7 +46,7 @@ import java.util.Set;
* @since 9.0.17
*/
@AutoService(ReportOperationConsumer.class)
-public class ExecuteRequestAndReorganizeCountByRepeatVariable implements ReportOperationConsumer {
+public class ExecuteRequestAndReorganizeDataByRepeatVariable implements ReportOperationConsumer {
@Override
public DataMatrix consume(String parameters, ReportRequestExecutor requestExecutor, Report report, Set<String> tripId, DataMatrix incoming) {
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/75f969b653c2034a2c0cb5c7…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/75f969b653c2034a2c0cb5c7…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 3 commits: Report - ajout du report psObservationCatchWeightByGroup
by Tony CHEMIT (@tchemit) 05 Dec '22
by Tony CHEMIT (@tchemit) 05 Dec '22
05 Dec '22
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
ff61c3ef by Tony Chemit at 2022-12-05T19:38:52+01:00
Report - ajout du report psObservationCatchWeightByGroup
- - - - -
3d0e57fa by Tony Chemit at 2022-12-05T19:38:53+01:00
Report - renommage du report psObservationCatchByGroup en psObservationCatchTotalCountByGroup
- - - - -
c83e69d1 by Tony Chemit at 2022-12-05T19:47:00+01:00
Merge branch 'feature/issue_2554' into develop
Besoin d'un rapport Observations fournissant les captures par devenir, en poids
- Closes #2554
- - - - -
6 changed files:
- core/api/dto/src/main/resources/observe-reports.properties
- 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/PsObservationCatchByGroupReportFixture.java → core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchTotalCountByGroupReportFixture.java
- + core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupReportFixture.java
- 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-psObservationCatchTotalCountByGroup.properties
- + core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroup.properties
Changes:
=====================================
core/api/dto/src/main/resources/observe-reports.properties
=====================================
@@ -887,12 +887,12 @@ report.psObservationCatch.request.3=2,0|row|\
Where m.id In :tripId
report.psObservationCatch.request.3.repeat=speciesId|column
################################################################################
-## Captures par groupe d'espèces
+## Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
################################################################################
-report.psObservationCatchByGroup.modelType=PS
-report.psObservationCatchByGroup.name=Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
-report.psObservationCatchByGroup.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir
-report.psObservationCatchByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
+report.psObservationCatchTotalCountByGroup.modelType=PS
+report.psObservationCatchTotalCountByGroup.name=Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
+report.psObservationCatchTotalCountByGroup.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir, filtré par groupe
+report.psObservationCatchTotalCountByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
Select distinct sg \
From TripImpl t \
Join t.routeObs r \
@@ -903,7 +903,7 @@ Join ca.species e \
Join e.speciesGroup sg \
Where t.id In :tripId \
Order By sg.code
-report.psObservationCatchByGroup.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
+report.psObservationCatchTotalCountByGroup.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
Select distinct e \
From TripImpl t \
Join t.routeObs r \
@@ -913,11 +913,11 @@ Join c.catches ca with ca.totalCount Is Not Null \
Join ca.species e with e.speciesGroup.id = :speciesGroup \
Where t.id In :tripId \
Order By e.homeId
-report.psObservationCatchByGroup.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
+report.psObservationCatchTotalCountByGroup.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
Select sf \
From SpeciesFateImpl sf \
Order by sf.discard, sf.code
-report.psObservationCatchByGroup.request.1=0,0|row|\
+report.psObservationCatchTotalCountByGroup.request.1=0,0|row|\
Select \
concat(\
'[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
@@ -934,7 +934,7 @@ report.psObservationCatchByGroup.request.1=0,0|row|\
Where m.id In :tripId \
Group by e \
Order By e.homeId
-report.psObservationCatchByGroup.operations.1=ExecuteRequestAndReorganizeCountByRepeatVariable:species|speciesFate|\
+report.psObservationCatchTotalCountByGroup.operations.1=ExecuteRequestAndReorganizeCountByRepeatVariable:species|speciesFate|\
Select \
s.id, sf.id, Sum(ca.totalCount) \
From TripImpl m \
@@ -947,9 +947,73 @@ Join ca.speciesFate sf with sf.id In :speciesFate \
Where m.id In :tripId \
Group by s, sf \
Order By s.homeId
-report.psObservationCatchByGroup.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
-report.psObservationCatchByGroup.operations.3=SumIntRow:1|3
-report.psObservationCatchByGroup.operations.4=SumIntColumn:1|1
+report.psObservationCatchTotalCountByGroup.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
+report.psObservationCatchTotalCountByGroup.operations.3=SumIntRow:1|3
+report.psObservationCatchTotalCountByGroup.operations.4=SumIntColumn:1|1
+################################################################################
+## Poids des captures par groupe d'espèces
+################################################################################
+report.psObservationCatchWeightByGroup.modelType=PS
+report.psObservationCatchWeightByGroup.name=Observations - Poids des captures par type de banc et devenir, filtrés par groupe
+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
+report.psObservationCatchWeightByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
+Select distinct sg \
+From TripImpl t \
+Join t.routeObs r \
+Join r.activity a \
+Join a.set c \
+Join c.catches ca with ca.totalCount Is Not Null \
+Join ca.species e \
+Join e.speciesGroup sg \
+Where t.id In :tripId \
+Order By sg.code
+report.psObservationCatchWeightByGroup.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
+Select distinct e \
+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 with e.speciesGroup.id = :speciesGroup \
+Where t.id In :tripId \
+Order By e.homeId
+report.psObservationCatchWeightByGroup.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
+Select sf \
+From SpeciesFateImpl sf \
+Order by sf.discard, sf.code
+report.psObservationCatchWeightByGroup.request.1=0,0|row|\
+ Select \
+ concat(\
+ '[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
+ ' [sc]', (case when e.scientificLabel is not null then e.scientificLabel else '-' end), \
+ ' [fr]', (case when e.label2 is not null then e.label2 else '-' end)), \
+ Sum(case c.schoolType.id when 'fr.ird.referential.ps.common.SchoolType#0#2' then ca.catchWeight else 0 end), \
+ Sum(case c.schoolType.id when 'fr.ird.referential.ps.common.SchoolType#0#1' then ca.catchWeight else 0 end) \
+ From TripImpl m \
+ Join m.routeObs r \
+ Join r.activity a \
+ Join a.set c \
+ Join c.catches ca with ca.catchWeight Is Not Null \
+ Join ca.species e with e.id In :species \
+ Where m.id In :tripId \
+ Group by e \
+ Order By e.homeId
+report.psObservationCatchWeightByGroup.operations.1=ExecuteRequestAndReorganizeCountByRepeatVariable:species|speciesFate|\
+Select \
+s.id, sf.id, Sum(ca.catchWeight) \
+From TripImpl m \
+Join m.routeObs r \
+Join r.activity a \
+Join a.set c \
+Join c.catches ca \
+Join ca.species s with s.id In :species \
+Join ca.speciesFate sf with sf.id In :speciesFate \
+Where m.id In :tripId \
+Group by s, sf \
+Order By s.homeId
+report.psObservationCatchWeightByGroup.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
+report.psObservationCatchWeightByGroup.operations.3=SumIntRow:1|3
+report.psObservationCatchWeightByGroup.operations.4=SumIntColumn:1|1
###########################################################
## Distribution des tailles par espèces et type de mesure
###########################################################
=====================================
core/services/local/src/test/java/fr/ird/observe/services/local/service/ReportServiceLocalReadTest.java
=====================================
@@ -37,8 +37,13 @@ public class ReportServiceLocalReadTest extends GeneratedReportServiceLocalReadT
}
@Test
- public void executeReportPsObservationCatchByGroup() {
+ public void executeReportPsObservationCatchTotalCountByGroup() {
ReportService service = getService();
- fixtures.executeReport(getServicesProvider(), service, "psObservationCatchByGroup");
+ fixtures.executeReport(getServicesProvider(), service, "psObservationCatchTotalCountByGroup");
+ }
+ @Test
+ public void executeReportPsObservationCatchWeightByGroup() {
+ ReportService service = getService();
+ fixtures.executeReport(getServicesProvider(), service, "psObservationCatchWeightByGroup");
}
}
=====================================
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/PsObservationCatchTotalCountByGroupReportFixture.java
=====================================
@@ -29,13 +29,13 @@ import fr.ird.observe.services.service.ReportFixture;
import java.util.Iterator;
/**
- * Pour tester le report {@code discardedAccessoireByGroup}
+ * Pour tester le report {@code psObservationCatchTotalCountByGroup}
*
* @author Tony Chemit - dev(a)tchemit.fr
* @since 1.9
*/
@AutoService(ReportFixture.class)
-public class PsObservationCatchByGroupReportFixture extends ReportFixture {
+public class PsObservationCatchTotalCountByGroupReportFixture extends ReportFixture {
@Override
public void assertSyntax(Report report) {
=====================================
core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupReportFixture.java
=====================================
@@ -0,0 +1,53 @@
+package fr.ird.observe.services.service.report.ps;
+
+/*-
+ * #%L
+ * ObServe Core :: Services :: Test
+ * %%
+ * Copyright (C) 2008 - 2022 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.dto.report.Report;
+import fr.ird.observe.dto.report.ReportRequest;
+import fr.ird.observe.services.service.ReportFixture;
+
+import java.util.Iterator;
+
+/**
+ * Created on 05/12/2022.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since 9.0.22
+ */
+(a)AutoService(ReportFixture.class)
+public class PsObservationCatchWeightByGroupReportFixture extends ReportFixture {
+
+ @Override
+ public void assertSyntax(Report report) {
+ super.assertSyntax(report);
+ super.assertSyntax(report);
+ Iterator<ReportRequest> requests = getRequestIterator(report);
+ assertReportRequestDimension(requests, ReportRequest.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-psObservationCatchByGroup.properties → core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroup.properties
=====================================
@@ -20,7 +20,7 @@
# #L%
###
syntax.name=Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
-syntax.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir
+syntax.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir, filtré par groupe
syntax.rows=-1
syntax.columns=-1
syntax.columnsHeader=
=====================================
core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroup.properties
=====================================
@@ -0,0 +1,32 @@
+###
+# #%L
+# ObServe Core :: Services :: Test
+# %%
+# Copyright (C) 2008 - 2022 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 - Poids des captures par type de banc et devenir, filtrés par groupe
+syntax.description=Afficher le poids de captures par groupe d'espèce selon le type de banc et le devenir, filtrés par groupe
+syntax.rows=-1
+syntax.columns=-1
+syntax.columnsHeader=
+syntax.rowsHeader=
+syntax.nbRequests=1
+result.columns=19
+result.rows=2
+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
+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
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/eaebe74a78f4bf9d98102569…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/eaebe74a78f4bf9d98102569…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-9.0.x] 3 commits: Report - ajout du report psObservationCatchWeightByGroup
by Tony CHEMIT (@tchemit) 05 Dec '22
by Tony CHEMIT (@tchemit) 05 Dec '22
05 Dec '22
Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe
Commits:
43323ca5 by Tony Chemit at 2022-12-05T17:21:15+01:00
Report - ajout du report psObservationCatchWeightByGroup
- - - - -
a99f1129 by Tony Chemit at 2022-12-05T19:37:35+01:00
Report - renommage du report psObservationCatchByGroup en psObservationCatchTotalCountByGroup
- - - - -
75f969b6 by Tony Chemit at 2022-12-05T19:38:02+01:00
Merge branch 'feature/issue_2554' into develop-9.0.x
Besoin d'un rapport Observations fournissant les captures par devenir, en poids
- Closes #2554
- - - - -
6 changed files:
- core/api/dto/src/main/resources/observe-reports.properties
- 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/PsObservationCatchByGroupReportFixture.java → core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchTotalCountByGroupReportFixture.java
- + core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupReportFixture.java
- 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-psObservationCatchTotalCountByGroup.properties
- + core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroup.properties
Changes:
=====================================
core/api/dto/src/main/resources/observe-reports.properties
=====================================
@@ -887,12 +887,12 @@ report.psObservationCatch.request.3=2,0|row|\
Where m.id In :tripId
report.psObservationCatch.request.3.repeat=speciesId|column
################################################################################
-## Captures par groupe d'espèces
+## Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
################################################################################
-report.psObservationCatchByGroup.modelType=PS
-report.psObservationCatchByGroup.name=Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
-report.psObservationCatchByGroup.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir
-report.psObservationCatchByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
+report.psObservationCatchTotalCountByGroup.modelType=PS
+report.psObservationCatchTotalCountByGroup.name=Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
+report.psObservationCatchTotalCountByGroup.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir, filtré par groupe
+report.psObservationCatchTotalCountByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
Select distinct sg \
From TripImpl t \
Join t.routeObs r \
@@ -903,7 +903,7 @@ Join ca.species e \
Join e.speciesGroup sg \
Where t.id In :tripId \
Order By sg.code
-report.psObservationCatchByGroup.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
+report.psObservationCatchTotalCountByGroup.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
Select distinct e \
From TripImpl t \
Join t.routeObs r \
@@ -913,11 +913,11 @@ Join c.catches ca with ca.totalCount Is Not Null \
Join ca.species e with e.speciesGroup.id = :speciesGroup \
Where t.id In :tripId \
Order By e.homeId
-report.psObservationCatchByGroup.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
+report.psObservationCatchTotalCountByGroup.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
Select sf \
From SpeciesFateImpl sf \
Order by sf.discard, sf.code
-report.psObservationCatchByGroup.request.1=0,0|row|\
+report.psObservationCatchTotalCountByGroup.request.1=0,0|row|\
Select \
concat(\
'[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
@@ -934,7 +934,7 @@ report.psObservationCatchByGroup.request.1=0,0|row|\
Where m.id In :tripId \
Group by e \
Order By e.homeId
-report.psObservationCatchByGroup.operations.1=ExecuteRequestAndReorganizeCountByRepeatVariable:species|speciesFate|\
+report.psObservationCatchTotalCountByGroup.operations.1=ExecuteRequestAndReorganizeCountByRepeatVariable:species|speciesFate|\
Select \
s.id, sf.id, Sum(ca.totalCount) \
From TripImpl m \
@@ -947,9 +947,73 @@ Join ca.speciesFate sf with sf.id In :speciesFate \
Where m.id In :tripId \
Group by s, sf \
Order By s.homeId
-report.psObservationCatchByGroup.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
-report.psObservationCatchByGroup.operations.3=SumIntRow:1|3
-report.psObservationCatchByGroup.operations.4=SumIntColumn:1|1
+report.psObservationCatchTotalCountByGroup.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
+report.psObservationCatchTotalCountByGroup.operations.3=SumIntRow:1|3
+report.psObservationCatchTotalCountByGroup.operations.4=SumIntColumn:1|1
+################################################################################
+## Poids des captures par groupe d'espèces
+################################################################################
+report.psObservationCatchWeightByGroup.modelType=PS
+report.psObservationCatchWeightByGroup.name=Observations - Poids des captures par type de banc et devenir, filtrés par groupe
+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
+report.psObservationCatchWeightByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
+Select distinct sg \
+From TripImpl t \
+Join t.routeObs r \
+Join r.activity a \
+Join a.set c \
+Join c.catches ca with ca.totalCount Is Not Null \
+Join ca.species e \
+Join e.speciesGroup sg \
+Where t.id In :tripId \
+Order By sg.code
+report.psObservationCatchWeightByGroup.repeatVariable.1.species=fr.ird.observe.entities.referential.common.Species|\
+Select distinct e \
+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 with e.speciesGroup.id = :speciesGroup \
+Where t.id In :tripId \
+Order By e.homeId
+report.psObservationCatchWeightByGroup.repeatVariable.2.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
+Select sf \
+From SpeciesFateImpl sf \
+Order by sf.discard, sf.code
+report.psObservationCatchWeightByGroup.request.1=0,0|row|\
+ Select \
+ concat(\
+ '[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
+ ' [sc]', (case when e.scientificLabel is not null then e.scientificLabel else '-' end), \
+ ' [fr]', (case when e.label2 is not null then e.label2 else '-' end)), \
+ Sum(case c.schoolType.id when 'fr.ird.referential.ps.common.SchoolType#0#2' then ca.catchWeight else 0 end), \
+ Sum(case c.schoolType.id when 'fr.ird.referential.ps.common.SchoolType#0#1' then ca.catchWeight else 0 end) \
+ From TripImpl m \
+ Join m.routeObs r \
+ Join r.activity a \
+ Join a.set c \
+ Join c.catches ca with ca.catchWeight Is Not Null \
+ Join ca.species e with e.id In :species \
+ Where m.id In :tripId \
+ Group by e \
+ Order By e.homeId
+report.psObservationCatchWeightByGroup.operations.1=ExecuteRequestAndReorganizeCountByRepeatVariable:species|speciesFate|\
+Select \
+s.id, sf.id, Sum(ca.catchWeight) \
+From TripImpl m \
+Join m.routeObs r \
+Join r.activity a \
+Join a.set c \
+Join c.catches ca \
+Join ca.species s with s.id In :species \
+Join ca.speciesFate sf with sf.id In :speciesFate \
+Where m.id In :tripId \
+Group by s, sf \
+Order By s.homeId
+report.psObservationCatchWeightByGroup.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
+report.psObservationCatchWeightByGroup.operations.3=SumIntRow:1|3
+report.psObservationCatchWeightByGroup.operations.4=SumIntColumn:1|1
###########################################################
## Distribution des tailles par espèces et type de mesure
###########################################################
=====================================
core/services/local/src/test/java/fr/ird/observe/services/local/service/ReportServiceLocalReadTest.java
=====================================
@@ -37,8 +37,13 @@ public class ReportServiceLocalReadTest extends GeneratedReportServiceLocalReadT
}
@Test
- public void executeReportPsObservationCatchByGroup() {
+ public void executeReportPsObservationCatchTotalCountByGroup() {
ReportService service = getService();
- fixtures.executeReport(getServicesProvider(), service, "psObservationCatchByGroup");
+ fixtures.executeReport(getServicesProvider(), service, "psObservationCatchTotalCountByGroup");
+ }
+ @Test
+ public void executeReportPsObservationCatchWeightByGroup() {
+ ReportService service = getService();
+ fixtures.executeReport(getServicesProvider(), service, "psObservationCatchWeightByGroup");
}
}
=====================================
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/PsObservationCatchTotalCountByGroupReportFixture.java
=====================================
@@ -29,13 +29,13 @@ import fr.ird.observe.services.service.ReportFixture;
import java.util.Iterator;
/**
- * Pour tester le report {@code discardedAccessoireByGroup}
+ * Pour tester le report {@code psObservationCatchTotalCountByGroup}
*
* @author Tony Chemit - dev(a)tchemit.fr
* @since 1.9
*/
@AutoService(ReportFixture.class)
-public class PsObservationCatchByGroupReportFixture extends ReportFixture {
+public class PsObservationCatchTotalCountByGroupReportFixture extends ReportFixture {
@Override
public void assertSyntax(Report report) {
=====================================
core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByGroupReportFixture.java
=====================================
@@ -0,0 +1,53 @@
+package fr.ird.observe.services.service.report.ps;
+
+/*-
+ * #%L
+ * ObServe Core :: Services :: Test
+ * %%
+ * Copyright (C) 2008 - 2022 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.dto.report.Report;
+import fr.ird.observe.dto.report.ReportRequest;
+import fr.ird.observe.services.service.ReportFixture;
+
+import java.util.Iterator;
+
+/**
+ * Created on 05/12/2022.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since 9.0.22
+ */
+(a)AutoService(ReportFixture.class)
+public class PsObservationCatchWeightByGroupReportFixture extends ReportFixture {
+
+ @Override
+ public void assertSyntax(Report report) {
+ super.assertSyntax(report);
+ super.assertSyntax(report);
+ Iterator<ReportRequest> requests = getRequestIterator(report);
+ assertReportRequestDimension(requests, ReportRequest.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-psObservationCatchByGroup.properties → core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroup.properties
=====================================
@@ -20,7 +20,7 @@
# #L%
###
syntax.name=Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
-syntax.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir
+syntax.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir, filtré par groupe
syntax.rows=-1
syntax.columns=-1
syntax.columnsHeader=
=====================================
core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroup.properties
=====================================
@@ -0,0 +1,32 @@
+###
+# #%L
+# ObServe Core :: Services :: Test
+# %%
+# Copyright (C) 2008 - 2022 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 - Poids des captures par type de banc et devenir, filtrés par groupe
+syntax.description=Afficher le poids de captures par groupe d'espèce selon le type de banc et le devenir, filtrés par groupe
+syntax.rows=-1
+syntax.columns=-1
+syntax.columnsHeader=
+syntax.rowsHeader=
+syntax.nbRequests=1
+result.columns=19
+result.rows=2
+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
+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
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/be2abbc12d17b139f150a970…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/be2abbc12d17b139f150a970…
You're receiving this email because of your account on gitlab.com.
1
0