Tony CHEMIT pushed to branch feature/issue_avdth_dcp at ultreiaio / ird-observe

Commits:

15 changed files:

Changes:

  • core/api/dto/src/main/resources/observe-reports.properties
    ... ... @@ -827,274 +827,6 @@ report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.re
    827 827
       Group by e
    
    828 828
     report.psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.request.5.repeat=species|column
    
    829 829
     ################################################################################
    
    830
    -## Captures thons selon le type d'association
    
    831
    -################################################################################
    
    832
    -report.psObservationTargetCatchByAssociation.modelType=PS
    
    833
    -report.psObservationTargetCatchByAssociation.name=Observations - Captures de thons selon le type d’association (en t)
    
    834
    -report.psObservationTargetCatchByAssociation.description=Afficher la répartitions des captures de thons selon le type d'association
    
    835
    -report.psObservationTargetCatchByAssociation.columns=YFT, SKJ, BET, LTA, FRI, Autres, Total
    
    836
    -report.psObservationTargetCatchByAssociation.rows=BL sans baleine, BL avec baleine, BO avec requin-baleine, BO sans requin-baleine, Total
    
    837
    -report.psObservationTargetCatchByAssociation.operations.1=SumRow
    
    838
    -report.psObservationTargetCatchByAssociation.operations.2=SumColumn
    
    839
    -# ligne 1
    
    840
    -report.psObservationTargetCatchByAssociation.request.1=0,0|row|\
    
    841
    -  Select \
    
    842
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then ct.catchWeight \
    
    843
    -                                                 Else 0.0 End), \
    
    844
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then ct.catchWeight \
    
    845
    -                                                 Else 0.0 End), \
    
    846
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then ct.catchWeight \
    
    847
    -                                                 Else 0.0 End), \
    
    848
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then ct.catchWeight \
    
    849
    -                                                 Else 0.0 End), \
    
    850
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then ct.catchWeight \
    
    851
    -                                                 Else 0.0 End), \
    
    852
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then 0.0 \
    
    853
    -                                                 When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then 0.0 \
    
    854
    -                                                 When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then 0.0 \
    
    855
    -                                                 When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then 0.0 \
    
    856
    -                                                 When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then 0.0 \
    
    857
    -                                                 Else ct.catchWeight End) \
    
    858
    -  From TripImpl m \
    
    859
    -  Join m.routeObs r \
    
    860
    -  Join r.activity a \
    
    861
    -  Join a.set c \
    
    862
    -      with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#2' \
    
    863
    -  Join c.catches ct \
    
    864
    -  Join ct.speciesFate sf with sf.discard = FALSE, \
    
    865
    -  ObservedSystemImpl os \
    
    866
    -  Where \
    
    867
    -      m.id In :tripId \
    
    868
    -      and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9395222812356602' \
    
    869
    -      and os not in elements(a.observedSystem)
    
    870
    -# ligne 2
    
    871
    -report.psObservationTargetCatchByAssociation.request.7=0,1|row|\
    
    872
    -  Select \
    
    873
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then ct.catchWeight \
    
    874
    -                                                 Else 0.0 End), \
    
    875
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then ct.catchWeight \
    
    876
    -                                                 Else 0.0 End), \
    
    877
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then ct.catchWeight \
    
    878
    -                                                 Else 0.0 End), \
    
    879
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then ct.catchWeight \
    
    880
    -                                                 Else 0.0 End), \
    
    881
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then ct.catchWeight \
    
    882
    -                                                 Else 0.0 End), \
    
    883
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then 0.0 \
    
    884
    -                                                 When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then 0.0 \
    
    885
    -                                                 When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then 0.0 \
    
    886
    -                                                 When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then 0.0 \
    
    887
    -                                                 When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then 0.0 \
    
    888
    -                                                 Else ct.catchWeight End) \
    
    889
    -  From TripImpl m \
    
    890
    -  Join m.routeObs r \
    
    891
    -  Join r.activity a \
    
    892
    -  Join a.set c \
    
    893
    -      with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#2' \
    
    894
    -  Join c.catches ct \
    
    895
    -  Join ct.speciesFate sf with sf.discard = FALSE, \
    
    896
    -  ObservedSystemImpl os \
    
    897
    -  Where \
    
    898
    -      m.id In :tripId \
    
    899
    -      and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9395222812356602' \
    
    900
    -      and os in elements(a.observedSystem)
    
    901
    -# ligne 3
    
    902
    -report.psObservationTargetCatchByAssociation.request.13=0,2|row|\
    
    903
    -  Select \
    
    904
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then ct.catchWeight \
    
    905
    -                                                 Else 0.0 End), \
    
    906
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then ct.catchWeight \
    
    907
    -                                                 Else 0.0 End), \
    
    908
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then ct.catchWeight \
    
    909
    -                                                 Else 0.0 End), \
    
    910
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then ct.catchWeight \
    
    911
    -                                                 Else 0.0 End), \
    
    912
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then ct.catchWeight \
    
    913
    -                                                 Else 0.0 End), \
    
    914
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then 0.0 \
    
    915
    -                                                 When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then 0.0 \
    
    916
    -                                                 When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then 0.0 \
    
    917
    -                                                 When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then 0.0 \
    
    918
    -                                                 When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then 0.0 \
    
    919
    -                                                 Else ct.catchWeight End) \
    
    920
    -  From TripImpl m \
    
    921
    -  Join m.routeObs r \
    
    922
    -  Join r.activity a \
    
    923
    -  Join a.set c \
    
    924
    -      with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#1' \
    
    925
    -  Join c.catches ct \
    
    926
    -  Join ct.speciesFate sf with sf.discard = FALSE, \
    
    927
    -  ObservedSystemImpl os \
    
    928
    -  Where \
    
    929
    -      m.id In :tripId \
    
    930
    -      and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \
    
    931
    -      and os in elements(a.observedSystem)
    
    932
    -# ligne 4
    
    933
    -report.psObservationTargetCatchByAssociation.request.19=0,3|row|\
    
    934
    -  Select \
    
    935
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then ct.catchWeight \
    
    936
    -                                                 Else 0.0 End), \
    
    937
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then ct.catchWeight \
    
    938
    -                                                 Else 0.0 End), \
    
    939
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then ct.catchWeight \
    
    940
    -                                                 Else 0.0 End), \
    
    941
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then ct.catchWeight \
    
    942
    -                                                 Else 0.0 End), \
    
    943
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then ct.catchWeight \
    
    944
    -                                                 Else 0.0 End), \
    
    945
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then 0.0 \
    
    946
    -                                                 When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then 0.0 \
    
    947
    -                                                 When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then 0.0 \
    
    948
    -                                                 When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then 0.0 \
    
    949
    -                                                 When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then 0.0 \
    
    950
    -                                                 Else ct.catchWeight End) \
    
    951
    -  From TripImpl m \
    
    952
    -  Join m.routeObs r \
    
    953
    -  Join r.activity a \
    
    954
    -  Join a.set c \
    
    955
    -      with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#1' \
    
    956
    -  Join c.catches ct \
    
    957
    -  Join ct.speciesFate sf with sf.discard = FALSE, \
    
    958
    -  ObservedSystemImpl os \
    
    959
    -  Where \
    
    960
    -      m.id In :tripId \
    
    961
    -      and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \
    
    962
    -      and os not in elements(a.observedSystem)
    
    963
    -################################################################################
    
    964
    -## Rejets thons selon le type d'association
    
    965
    -################################################################################
    
    966
    -report.psObservationTargetDiscardedByAssociation.modelType=PS
    
    967
    -report.psObservationTargetDiscardedByAssociation.name=Observations - Rejets de thons selon le type d’association (en t)
    
    968
    -report.psObservationTargetDiscardedByAssociation.description=Afficher la répartitions des rejets de thons selon le type d'association
    
    969
    -report.psObservationTargetDiscardedByAssociation.columns=YFT, SKJ, BET, LTA, FRI, Autres, Total
    
    970
    -report.psObservationTargetDiscardedByAssociation.rows=BL sans baleine, BL avec baleine, BO avec requin-baleine, BO sans requin-baleine, Total
    
    971
    -report.psObservationTargetDiscardedByAssociation.operations.1=SumRow
    
    972
    -report.psObservationTargetDiscardedByAssociation.operations.2=SumColumn
    
    973
    -# ligne 1
    
    974
    -report.psObservationTargetDiscardedByAssociation.request.1=0,0|row|\
    
    975
    -  Select \
    
    976
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then ct.catchWeight \
    
    977
    -                                                 Else 0.0 End), \
    
    978
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then ct.catchWeight \
    
    979
    -                                                 Else 0.0 End), \
    
    980
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then ct.catchWeight \
    
    981
    -                                                 Else 0.0 End), \
    
    982
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then ct.catchWeight \
    
    983
    -                                                 Else 0.0 End), \
    
    984
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then ct.catchWeight \
    
    985
    -                                                 Else 0.0 End), \
    
    986
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then 0.0 \
    
    987
    -                                                 When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then 0.0 \
    
    988
    -                                                 When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then 0.0 \
    
    989
    -                                                 When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then 0.0 \
    
    990
    -                                                 When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then 0.0 \
    
    991
    -                                                 Else ct.catchWeight End) \
    
    992
    -  From TripImpl m \
    
    993
    -  Join m.routeObs r \
    
    994
    -  Join r.activity a \
    
    995
    -  Join a.set c \
    
    996
    -      with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#2' \
    
    997
    -  Join c.catches ct \
    
    998
    -  Join ct.speciesFate sf with sf.discard = TRUE, \
    
    999
    -  ObservedSystemImpl os \
    
    1000
    -  Where \
    
    1001
    -      m.id In :tripId \
    
    1002
    -      and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9395222812356602' \
    
    1003
    -      and os not in elements(a.observedSystem)
    
    1004
    -# ligne 2
    
    1005
    -report.psObservationTargetDiscardedByAssociation.request.7=0,1|row|\
    
    1006
    -  Select \
    
    1007
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then ct.catchWeight \
    
    1008
    -                                                 Else 0.0 End), \
    
    1009
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then ct.catchWeight \
    
    1010
    -                                                 Else 0.0 End), \
    
    1011
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then ct.catchWeight \
    
    1012
    -                                                 Else 0.0 End), \
    
    1013
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then ct.catchWeight \
    
    1014
    -                                                 Else 0.0 End), \
    
    1015
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then ct.catchWeight \
    
    1016
    -                                                 Else 0.0 End), \
    
    1017
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then 0.0 \
    
    1018
    -                                                 When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then 0.0 \
    
    1019
    -                                                 When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then 0.0 \
    
    1020
    -                                                 When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then 0.0 \
    
    1021
    -                                                 When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then 0.0 \
    
    1022
    -                                                 Else ct.catchWeight End) \
    
    1023
    -  From TripImpl m \
    
    1024
    -  Join m.routeObs r \
    
    1025
    -  Join r.activity a \
    
    1026
    -  Join a.set c \
    
    1027
    -      with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#2' \
    
    1028
    -  Join c.catches ct \
    
    1029
    -  Join ct.speciesFate sf with sf.discard = TRUE, \
    
    1030
    -  ObservedSystemImpl os \
    
    1031
    -  Where \
    
    1032
    -      m.id In :tripId \
    
    1033
    -      and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9395222812356602' \
    
    1034
    -      and os in elements(a.observedSystem)
    
    1035
    -# ligne 3
    
    1036
    -report.psObservationTargetDiscardedByAssociation.request.13=0,2|row|\
    
    1037
    -  Select \
    
    1038
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then ct.catchWeight \
    
    1039
    -                                                 Else 0.0 End), \
    
    1040
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then ct.catchWeight \
    
    1041
    -                                                 Else 0.0 End), \
    
    1042
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then ct.catchWeight \
    
    1043
    -                                                 Else 0.0 End), \
    
    1044
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then ct.catchWeight \
    
    1045
    -                                                 Else 0.0 End), \
    
    1046
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then ct.catchWeight \
    
    1047
    -                                                 Else 0.0 End), \
    
    1048
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then 0.0 \
    
    1049
    -                                                 When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then 0.0 \
    
    1050
    -                                                 When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then 0.0 \
    
    1051
    -                                                 When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then 0.0 \
    
    1052
    -                                                 When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then 0.0 \
    
    1053
    -                                                 Else ct.catchWeight End) \
    
    1054
    -  From TripImpl m \
    
    1055
    -  Join m.routeObs r \
    
    1056
    -  Join r.activity a \
    
    1057
    -  Join a.set c \
    
    1058
    -      with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#1' \
    
    1059
    -  Join c.catches ct \
    
    1060
    -  Join ct.speciesFate sf with sf.discard = TRUE, \
    
    1061
    -  ObservedSystemImpl os \
    
    1062
    -  Where \
    
    1063
    -      m.id In :tripId \
    
    1064
    -      and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \
    
    1065
    -      and os in elements(a.observedSystem)
    
    1066
    -# ligne 4
    
    1067
    -report.psObservationTargetDiscardedByAssociation.request.19=0,3|row|\
    
    1068
    -  Select \
    
    1069
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then ct.catchWeight \
    
    1070
    -                                                 Else 0.0 End), \
    
    1071
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then ct.catchWeight \
    
    1072
    -                                                 Else 0.0 End), \
    
    1073
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then ct.catchWeight \
    
    1074
    -                                                 Else 0.0 End), \
    
    1075
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then ct.catchWeight \
    
    1076
    -                                                 Else 0.0 End), \
    
    1077
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then ct.catchWeight \
    
    1078
    -                                                 Else 0.0 End), \
    
    1079
    -      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then 0.0 \
    
    1080
    -                                                 When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then 0.0 \
    
    1081
    -                                                 When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then 0.0 \
    
    1082
    -                                                 When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then 0.0 \
    
    1083
    -                                                 When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then 0.0 \
    
    1084
    -                                                 Else ct.catchWeight End) \
    
    1085
    -  From TripImpl m \
    
    1086
    -  Join m.routeObs r \
    
    1087
    -  Join r.activity a \
    
    1088
    -  Join a.set c \
    
    1089
    -      with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#1' \
    
    1090
    -  Join c.catches ct \
    
    1091
    -  Join ct.speciesFate sf with sf.discard = TRUE, \
    
    1092
    -  ObservedSystemImpl os \
    
    1093
    -  Where \
    
    1094
    -      m.id In :tripId \
    
    1095
    -      and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \
    
    1096
    -      and os not in elements(a.observedSystem)
    
    1097
    -################################################################################
    
    1098 830
     ## Captures observées
    
    1099 831
     ################################################################################
    
    1100 832
     report.psObservationCatch.modelType=PS
    
    ... ... @@ -1151,7 +883,7 @@ report.psObservationCatch.request.3.repeat=speciesId|column
    1151 883
     ################################################################################
    
    1152 884
     report.psObservationCatchTotalCountByGroupPerSpeciesFate.modelType=PS
    
    1153 885
     report.psObservationCatchTotalCountByGroupPerSpeciesFate.name=Observations - Dénombrement des captures par type de banc et devenir, filtrés par groupe
    
    1154
    -report.psObservationCatchTotalCountByGroupPerSpeciesFate.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir, filtré par groupe
    
    886
    +report.psObservationCatchTotalCountByGroupPerSpeciesFate.description=Afficher les nombres de captures selon le type de banc et le devenir, filtré par groupe
    
    1155 887
     report.psObservationCatchTotalCountByGroupPerSpeciesFate.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
    
    1156 888
     Select distinct sg \
    
    1157 889
     From TripImpl t \
    
    ... ... @@ -1214,8 +946,8 @@ report.psObservationCatchTotalCountByGroupPerSpeciesFate.operations.4=SumIntColu
    1214 946
     ## Poids des captures par groupe d'espèces
    
    1215 947
     ################################################################################
    
    1216 948
     report.psObservationCatchWeightByGroupPerSpeciesFate.modelType=PS
    
    1217
    -report.psObservationCatchWeightByGroupPerSpeciesFate.name=Observations - Poids des captures par type de banc et devenir, filtrés par groupe
    
    1218
    -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
    
    949
    +report.psObservationCatchWeightByGroupPerSpeciesFate.name=Observations - Poids des captures par type de banc et devenir, filtrés par groupe (en t)
    
    950
    +report.psObservationCatchWeightByGroupPerSpeciesFate.description=Afficher le poids de captures selon le type de banc et le devenir, filtrés par groupe (en t)
    
    1219 951
     report.psObservationCatchWeightByGroupPerSpeciesFate.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
    
    1220 952
     Select distinct sg \
    
    1221 953
     From TripImpl t \
    
    ... ... @@ -1272,13 +1004,13 @@ Where m.id In :tripId \
    1272 1004
     Group by s, sf \
    
    1273 1005
     Order By s.homeId
    
    1274 1006
     report.psObservationCatchWeightByGroupPerSpeciesFate.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|speciesFate
    
    1275
    -report.psObservationCatchWeightByGroupPerSpeciesFate.operations.3=SumIntRow:1|3
    
    1276
    -report.psObservationCatchWeightByGroupPerSpeciesFate.operations.4=SumIntColumn:1|1
    
    1007
    +report.psObservationCatchWeightByGroupPerSpeciesFate.operations.3=SumRow:1|3
    
    1008
    +report.psObservationCatchWeightByGroupPerSpeciesFate.operations.4=SumColumn:1|1
    
    1277 1009
     ################################################################################
    
    1278 1010
     ## Poids des captures par groupe d'espèces, type de banc et et raison de rejet
    
    1279 1011
     ################################################################################
    
    1280 1012
     report.psObservationCatchWeightByGroupPerReasonForDiscard.modelType=PS
    
    1281
    -report.psObservationCatchWeightByGroupPerReasonForDiscard.name=Observations - Poids des rejets par type de banc et raison de rejet, filtrés par groupe
    
    1013
    +report.psObservationCatchWeightByGroupPerReasonForDiscard.name=Observations - Poids des rejets par type de banc et raison de rejet, filtrés par groupe (en t)
    
    1282 1014
     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
    
    1283 1015
     report.psObservationCatchWeightByGroupPerReasonForDiscard.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
    
    1284 1016
     Select distinct sg \
    
    ... ... @@ -1336,14 +1068,14 @@ Where m.id In :tripId \
    1336 1068
     Group by s, sf \
    
    1337 1069
     Order By s.homeId
    
    1338 1070
     report.psObservationCatchWeightByGroupPerReasonForDiscard.operations.2=ComputeDynamicHeader:Espèce,Total BL,Total BO|reasonForDiscard
    
    1339
    -report.psObservationCatchWeightByGroupPerReasonForDiscard.operations.3=SumIntRow:1|3
    
    1340
    -report.psObservationCatchWeightByGroupPerReasonForDiscard.operations.4=SumIntColumn:1|1
    
    1071
    +report.psObservationCatchWeightByGroupPerReasonForDiscard.operations.3=SumRow:1|3
    
    1072
    +report.psObservationCatchWeightByGroupPerReasonForDiscard.operations.4=SumColumn:1|1
    
    1341 1073
     ################################################################################
    
    1342 1074
     ## Dénombrement des rejets par groupe d'espèces, type de banc et raison de rejet
    
    1343 1075
     ################################################################################
    
    1344 1076
     report.psObservationCatchTotalCountByGroupPerReasonForDiscard.modelType=PS
    
    1345
    -report.psObservationCatchTotalCountByGroupPerReasonForDiscard.name=Observations - Dénombrement des rejets par type de banc et raison de rejet, filtrés par groupe
    
    1346
    -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
    
    1077
    +report.psObservationCatchTotalCountByGroupPerReasonForDiscard.name=Observations - Dénombrement des rejets par type de banc et raison de rejet, filtrés par groupe (en t)
    
    1078
    +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 (en t)
    
    1347 1079
     report.psObservationCatchTotalCountByGroupPerReasonForDiscard.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|\
    
    1348 1080
     Select distinct sg \
    
    1349 1081
     From TripImpl t \
    

  • core/persistence/resources/src/main/java/fr/ird/observe/persistence/avdth/data/ImportReferentialContext.java
    ... ... @@ -58,7 +58,6 @@ import fr.ird.observe.entities.referential.ps.logbook.SetSuccessStatus;
    58 58
     import fr.ird.observe.entities.referential.ps.logbook.WellContentStatus;
    
    59 59
     import fr.ird.observe.entities.referential.ps.logbook.WellSamplingConformity;
    
    60 60
     import fr.ird.observe.entities.referential.ps.logbook.WellSamplingStatus;
    
    61
    -import fr.ird.observe.persistence.avdth.data.logbook.FloatingObjectReader;
    
    62 61
     import fr.ird.observe.persistence.avdth.data.logbook.WellPlanReader;
    
    63 62
     import fr.ird.observe.persistence.avdth.referential.AvdthReferentialImportResult;
    
    64 63
     import fr.ird.observe.persistence.avdth.referential.SpeciesCache;
    
    ... ... @@ -80,10 +79,8 @@ import java.util.function.Consumer;
    80 79
      * @author Tony Chemit - dev@tchemit.fr
    
    81 80
      * @since 9.0.0
    
    82 81
      */
    
    83
    -@SuppressWarnings("SpellCheckingInspection")
    
    84 82
     public class ImportReferentialContext {
    
    85 83
     
    
    86
    -
    
    87 84
         private Map<String, WeightCategory> landingCategories;
    
    88 85
         private Map<String, Destination> destinations;
    
    89 86
         private Map<String, WeightCategory> wellCategories;
    
    ... ... @@ -127,6 +124,7 @@ public class ImportReferentialContext {
    127 124
         private ObjectMaterial objectMaterialDFAD;
    
    128 125
         private ObjectMaterial objectMaterialALOG;
    
    129 126
         private ObjectMaterial objectMaterialAFAD;
    
    127
    +    private ObjectMaterial objectMaterialBiodegradable;
    
    130 128
         private ObjectMaterial objectMaterialAlone;
    
    131 129
         private ObjectMaterial objectMaterialLOG;
    
    132 130
         private ObjectMaterial objectMaterialFALOG;
    
    ... ... @@ -228,6 +226,7 @@ public class ImportReferentialContext {
    228 226
             objectMaterialHALOG = objectMaterial.get("fr.ird.referential.ps.common.ObjectMaterial#0#0.67");
    
    229 227
             objectMaterialVNLOG = objectMaterial.get("fr.ird.referential.ps.common.ObjectMaterial#0#0.52");
    
    230 228
             objectMaterialAlone = objectMaterial.get("fr.ird.referential.ps.common.ObjectMaterial#1561561977652#0.5876332198776647");
    
    229
    +        objectMaterialBiodegradable = objectMaterial.get("fr.ird.referential.ps.common.ObjectMaterial#0#0.69");
    
    231 230
     
    
    232 231
             // catch
    
    233 232
             catchCategories = new TreeMap<>();
    
    ... ... @@ -333,6 +332,26 @@ public class ImportReferentialContext {
    333 332
             return objectMaterialAFAD;
    
    334 333
         }
    
    335 334
     
    
    335
    +    public ObjectMaterial getObjectMaterialLOG() {
    
    336
    +        return objectMaterialLOG;
    
    337
    +    }
    
    338
    +
    
    339
    +    public ObjectMaterial getObjectMaterialFALOG() {
    
    340
    +        return objectMaterialFALOG;
    
    341
    +    }
    
    342
    +
    
    343
    +    public ObjectMaterial getObjectMaterialHALOG() {
    
    344
    +        return objectMaterialHALOG;
    
    345
    +    }
    
    346
    +
    
    347
    +    public ObjectMaterial getObjectMaterialVNLOG() {
    
    348
    +        return objectMaterialVNLOG;
    
    349
    +    }
    
    350
    +
    
    351
    +    public ObjectMaterial getObjectMaterialBiodegradable() {
    
    352
    +        return objectMaterialBiodegradable;
    
    353
    +    }
    
    354
    +
    
    336 355
         public ObjectMaterial getObjectMaterialAlone() {
    
    337 356
             return objectMaterialAlone;
    
    338 357
         }
    
    ... ... @@ -529,79 +548,29 @@ public class ImportReferentialContext {
    529 548
             entity.addObservedSystem(getObservedSystem("102"));
    
    530 549
         }
    
    531 550
     
    
    532
    -    public ObjectOperation getObjectOperationByVesselActivityCode(String vesselActivityCode) {
    
    533
    -        String objectOperationCode = FloatingObjectReader.DCP_OBJECT_OPERATION_CODE_MAPPING.get(vesselActivityCode);
    
    534
    -        if (objectOperationCode == null) {
    
    535
    -            return null;
    
    536
    -        }
    
    551
    +    public ObjectOperation getObjectOperation(String objectOperationCode) {
    
    537 552
             return objectOperation.get(objectOperationCode);
    
    538 553
         }
    
    539 554
     
    
    540
    -    public TransmittingBuoyOperation getTransmittingBuoyOperationByVesselActivityCode(String vesselActivityCode) {
    
    541
    -        String transmittingBuoyTypeCode = FloatingObjectReader.TRANSMITTING_BUOY_OPERATION_CODE_MAPPING.get(vesselActivityCode);
    
    555
    +    public TransmittingBuoyOperation getTransmittingBuoyOperation(String transmittingBuoyTypeCode) {
    
    542 556
             if (transmittingBuoyTypeCode == null) {
    
    543 557
                 return null;
    
    544 558
             }
    
    545 559
             return transmittingBuoyOperation.get(transmittingBuoyTypeCode);
    
    546 560
         }
    
    547 561
     
    
    548
    -    public TransmittingBuoyType getTransmittingBuoyTypeByBuoyTypeCode(String buoyTypeCode) {
    
    549
    -        String transmittingBuoyTypeCode = FloatingObjectReader.TRANSMITTING_BUOY_TYPE_CODE_MAPPING.get(buoyTypeCode);
    
    550
    -        if (transmittingBuoyTypeCode == null) {
    
    551
    -            transmittingBuoyTypeCode = "999";
    
    552
    -        }
    
    553
    -        TransmittingBuoyType transmittingBuoyType = this.transmittingBuoyType.get(transmittingBuoyTypeCode);
    
    554
    -        return Objects.requireNonNull(transmittingBuoyType, String.format("Can't find transmittingBuoyType with code: %s", buoyTypeCode));
    
    562
    +    public TransmittingBuoyType getTransmittingBuoyType(String transmittingBuoyTypeCode) {
    
    563
    +        TransmittingBuoyType result = transmittingBuoyType.get(transmittingBuoyTypeCode);
    
    564
    +        return Objects.requireNonNull(result, String.format("Can't find result with code: %s", transmittingBuoyTypeCode));
    
    555 565
         }
    
    556 566
     
    
    557
    -    public TransmittingBuoyOwnership getTransmittingBuoyOwnership(String buoyOwnershipCode) {
    
    558
    -        if (buoyOwnershipCode == null) {
    
    559
    -            return null;
    
    560
    -        }
    
    561
    -        String transmittingBuoyOwnershipCode = FloatingObjectReader.TRANSMITTING_BUOY_OWNERSHIP_CODE_MAPPING.get(buoyOwnershipCode);
    
    567
    +    public TransmittingBuoyOwnership getTransmittingBuoyOwnership(String transmittingBuoyOwnershipCode) {
    
    562 568
             if (transmittingBuoyOwnershipCode == null) {
    
    563 569
                 return null;
    
    564 570
             }
    
    565 571
             return transmittingBuoyOwnership.get(transmittingBuoyOwnershipCode);
    
    566 572
         }
    
    567 573
     
    
    568
    -    public ObservedSystem getObservedSystem(String objectTypeCode, String buoyTypeCode) {
    
    569
    -        if (objectTypeCode.equals("999")) {
    
    570
    -            if (buoyTypeCode.equals("999")) {
    
    571
    -                return getObservedSystem0();
    
    572
    -            }
    
    573
    -            return getObservedSystem20();
    
    574
    -        }
    
    575
    -        String observedSystemCode = FloatingObjectReader.OBSERVED_SYSTEM_CODE_MAPPING.get(objectTypeCode);
    
    576
    -        return getObservedSystem(observedSystemCode, false);
    
    577
    -    }
    
    578
    -
    
    579
    -    /**
    
    580
    -     * To get objectMaterial id associated by a DCP from avdth ACTIVITE.C_TYP_OBJET code.
    
    581
    -     *
    
    582
    -     * @param objectTypeCode ACTIVITE.C_TYP_OBJET
    
    583
    -     * @return material or null
    
    584
    -     */
    
    585
    -    public ObjectMaterial getObjectMaterialByObjectTypeCode(String objectTypeCode) {
    
    586
    -        switch (objectTypeCode) {
    
    587
    -            case "1":
    
    588
    -                return objectMaterialAFAD;
    
    589
    -            case "2":
    
    590
    -                return objectMaterialDFAD;
    
    591
    -            case "3":
    
    592
    -                return objectMaterialLOG;
    
    593
    -            case "9":
    
    594
    -                return objectMaterialFOB;
    
    595
    -            case "10":
    
    596
    -                return objectMaterialFALOG;
    
    597
    -            case "11":
    
    598
    -                return objectMaterialHALOG;
    
    599
    -            case "13":
    
    600
    -                return objectMaterialVNLOG;
    
    601
    -        }
    
    602
    -        return null;
    
    603
    -    }
    
    604
    -
    
    605 574
         public WeightCategory getWellWeightCategory(String weightCategoryCode) {
    
    606 575
             String categoryCode = "W-" + weightCategoryCode;
    
    607 576
             WeightCategory weightCategory = wellCategories.get(categoryCode);
    
    ... ... @@ -611,4 +580,5 @@ public class ImportReferentialContext {
    611 580
         public VesselActivity getVesselActivity6() {
    
    612 581
             return vesselActivity6;
    
    613 582
         }
    
    583
    +
    
    614 584
     }

  • core/persistence/resources/src/main/java/fr/ird/observe/persistence/avdth/data/logbook/FloatingObjectReader.java
    ... ... @@ -23,6 +23,7 @@ package fr.ird.observe.persistence.avdth.data.logbook;
    23 23
      */
    
    24 24
     
    
    25 25
     import com.google.common.collect.ImmutableMap;
    
    26
    +import fr.ird.observe.entities.data.ps.logbook.Activity;
    
    26 27
     import fr.ird.observe.entities.data.ps.logbook.FloatingObject;
    
    27 28
     import fr.ird.observe.entities.data.ps.logbook.FloatingObjectPart;
    
    28 29
     import fr.ird.observe.entities.data.ps.logbook.TransmittingBuoy;
    
    ... ... @@ -232,54 +233,79 @@ public class FloatingObjectReader extends DataReader<FloatingObject> {
    232 233
         @Override
    
    233 234
         public FloatingObject read(ImportDataContext dataContext, ResultSet resultSet) throws SQLException {
    
    234 235
     
    
    235
    -        String vesselActivityCode = resultSet.getString(13);
    
    236
    -        VesselActivity vesselActivity = dataContext.getVesselActivity(vesselActivityCode);
    
    236
    +        // Get the current activity where to add the optional floating object
    
    237
    +        Activity activity = dataContext.getActivity();
    
    238
    +
    
    239
    +        // Get his vessel activity
    
    240
    +        VesselActivity vesselActivity = activity.getVesselActivity();
    
    241
    +
    
    242
    +        // Avdth observed system codes associated to the current activity (need them to compute fill floating object)
    
    237 243
             Set<String> observedSystemCodes = dataContext.getObservedSystemCodes();
    
    238
    -        if (!Objects.equals(vesselActivity.getCode(), "13")) {
    
    239
    -            boolean noDcpInObservedSystems = observedSystemCodes.stream().noneMatch(OBSERVED_SYTEM_CODES_WITH_DCP::contains);
    
    240
    -            if (noDcpInObservedSystems) {
    
    241
    -                reset(dataContext);
    
    242
    -                return null;
    
    243
    -            }
    
    244
    -        }
    
    245 244
     
    
    246
    -        FloatingObject entity = newEntity(FloatingObject.SPI);
    
    245
    +        // We need to get the original vessel activity code from AVDTH (to compute some mapping)
    
    246
    +        String vesselActivityCode = resultSet.getString(13);
    
    247 247
     
    
    248
    -        ObjectOperation objectOperation = dataContext.getObjectOperationByVesselActivityCode(vesselActivityCode);
    
    249
    -        entity.setObjectOperation(Objects.requireNonNull(objectOperation, String.format("Can't find objectOperation with code: %s", vesselActivityCode)));
    
    250
    -        boolean addCoordinate = "11".equals(objectOperation.getCode());
    
    251
    -        boolean whenArriving = WHEN_ARRIVING_CODE.contains(vesselActivityCode);
    
    252
    -        boolean whenLeaving = WHEN_LEAVING_CODE.contains(vesselActivityCode);
    
    248
    +        // Is the floating object can be created by the observed systems?
    
    249
    +        boolean floatingObjectCreatedByObservedSystem = observedSystemCodes.stream().anyMatch(OBSERVED_SYTEM_CODES_WITH_DCP::contains);
    
    250
    +
    
    251
    +        // Is the current vessel activity accept to create Floating object?
    
    252
    +        boolean vesselActivityAllowFad = vesselActivity.isAllowFad();
    
    253
    +
    
    254
    +        // Get object type code
    
    253 255
             String objectTypeCode = resultSet.getString(28);
    
    254 256
             if (objectTypeCode == null) {
    
    255 257
                 //FIXME should fail ?
    
    256 258
                 objectTypeCode = "999";
    
    257 259
             }
    
    258
    -        //FIXME 29 - F_DCP_ECO
    
    259
    -//        int dcpEcoCode = resultSet.getInt(29);
    
    260
    +
    
    261
    +        // Is floating object exists in avdth?
    
    262
    +        boolean floatingObjectExistsInAvdth = !objectTypeCode.equals("999");
    
    263
    +        //FIXME If objectTypeCode = 999, this means we can not create Floating object?
    
    264
    +
    
    265
    +        if (!vesselActivityAllowFad && !floatingObjectCreatedByObservedSystem) {
    
    266
    +            // do not create the floating object
    
    267
    +            reset(dataContext);
    
    268
    +            return null;
    
    269
    +        }
    
    270
    +
    
    271
    +        FloatingObject entity = newEntity(FloatingObject.SPI);
    
    272
    +
    
    273
    +        ObjectOperation objectOperation = getObjectOperationByVesselActivityCode(dataContext, vesselActivityCode);
    
    274
    +        entity.setObjectOperation(Objects.requireNonNull(objectOperation, String.format("Can't find objectOperation with ACTIVITE.C_OPERA: %s", vesselActivityCode)));
    
    275
    +        boolean addCoordinate = "11".equals(objectOperation.getCode());
    
    276
    +        boolean whenArriving = WHEN_ARRIVING_CODE.contains(vesselActivityCode);
    
    277
    +        boolean whenLeaving = WHEN_LEAVING_CODE.contains(vesselActivityCode);
    
    278
    +
    
    279
    +        Object dcpEcoCode = resultSet.getObject(29);
    
    260 280
             String buoyOwnershipCode = resultSet.getString(30);
    
    261 281
             String buoyTypeCode = resultSet.getString(31);
    
    262 282
             if (buoyTypeCode == null) {
    
    263 283
                 //FIXME should fail?
    
    264 284
                 buoyTypeCode = "999";
    
    265 285
             }
    
    286
    +        // avdth data has a buoy
    
    287
    +        boolean willCreateBuoy = !"999".equals(buoyTypeCode);
    
    288
    +
    
    266 289
             String buoyId = resultSet.getString(32);
    
    267 290
             String dcpWeight = resultSet.getString(33);
    
    268 291
             if (dcpWeight != null) {
    
    269 292
                 //FIXME Check if ok
    
    270 293
                 entity.setComment(String.format("ACTIVITE.POIDS_ESTIM_DCP value from avdth: %s", dcpWeight));
    
    271 294
             }
    
    272
    -        ObservedSystem observedSystem = dataContext.getObservedSystem(objectTypeCode, buoyTypeCode);
    
    295
    +        ObservedSystem observedSystem = getObservedSystem(dataContext, objectTypeCode, buoyTypeCode);
    
    273 296
             if (observedSystem != null) {
    
    274
    -            dataContext.getActivity().addObservedSystem(observedSystem);
    
    297
    +            activity.addObservedSystem(observedSystem);
    
    275 298
             }
    
    276
    -        // avdth data has a buoy
    
    277
    -        boolean willCreateBuoy = !"999".equals(buoyTypeCode);
    
    299
    +
    
    278 300
             // to add default material if there is a declared buoy and no object material created by ObservedSystem
    
    279 301
             boolean addDefaultObjectMaterialOnUnknownObjectType = true;
    
    280 302
             // should create a buoy from ObservedSystem
    
    281 303
             boolean addBuoyFromObservedSystem = false;
    
    282 304
             Set<String> objectMaterialUsed = new TreeSet<>();
    
    305
    +        if (!floatingObjectCreatedByObservedSystem && dcpEcoCode != null && Objects.equals(2, dcpEcoCode)) {
    
    306
    +            // add material 4-1 (Biodegradable materials)
    
    307
    +            addObjectMaterial(objectMaterialUsed, dataContext.getObjectMaterialBiodegradable(), whenArriving, whenLeaving, entity);
    
    308
    +        }
    
    283 309
             if (observedSystemCodes.contains("20")) {
    
    284 310
                 // add ObjectMaterial FOB
    
    285 311
                 addObjectMaterial(objectMaterialUsed, dataContext.getObjectMaterialFOB(), whenArriving, whenLeaving, entity);
    
    ... ... @@ -316,25 +342,25 @@ public class FloatingObjectReader extends DataReader<FloatingObject> {
    316 342
                 }
    
    317 343
             } else {
    
    318 344
                 // simple mapping
    
    319
    -            ObjectMaterial objectMaterial1 = dataContext.getObjectMaterialByObjectTypeCode(objectTypeCode);
    
    345
    +            ObjectMaterial objectMaterial1 = getObjectMaterialByObjectTypeCode(dataContext, objectTypeCode);
    
    320 346
                 if (objectMaterial1 != null) {
    
    321 347
                     addObjectMaterial(objectMaterialUsed, objectMaterial1, whenArriving, whenLeaving, entity);
    
    322 348
                 }
    
    323 349
             }
    
    324 350
             if (willCreateBuoy) {
    
    325 351
                 // only add buoy if buoy type known
    
    326
    -            TransmittingBuoyType transmittingBuoyType = dataContext.getTransmittingBuoyTypeByBuoyTypeCode(buoyTypeCode);
    
    327
    -            TransmittingBuoyOperation transmittingBuoyOperation = dataContext.getTransmittingBuoyOperationByVesselActivityCode(vesselActivityCode);
    
    352
    +            TransmittingBuoyType transmittingBuoyType = getTransmittingBuoyTypeByBuoyTypeCode(dataContext, buoyTypeCode);
    
    353
    +            TransmittingBuoyOperation transmittingBuoyOperation = getTransmittingBuoyOperationByVesselActivityCode(dataContext, vesselActivityCode);
    
    328 354
                 if (transmittingBuoyOperation != null) {
    
    329 355
                     TransmittingBuoy transmittingBuoy = newEntity(TransmittingBuoy.SPI, transmittingBuoyCount);
    
    330 356
                     transmittingBuoy.setTransmittingBuoyOperation(transmittingBuoyOperation);
    
    331 357
                     transmittingBuoy.setTransmittingBuoyType(transmittingBuoyType);
    
    332 358
                     transmittingBuoy.setCode(buoyId);
    
    333 359
                     if (addCoordinate) {
    
    334
    -                    transmittingBuoy.setLatitude(dataContext.getActivity().getLatitude());
    
    335
    -                    transmittingBuoy.setLongitude(dataContext.getActivity().getLongitude());
    
    360
    +                    transmittingBuoy.setLatitude(activity.getLatitude());
    
    361
    +                    transmittingBuoy.setLongitude(activity.getLongitude());
    
    336 362
                     }
    
    337
    -                TransmittingBuoyOwnership transmittingBuoyOwnership = dataContext.getTransmittingBuoyOwnership(buoyOwnershipCode);
    
    363
    +                TransmittingBuoyOwnership transmittingBuoyOwnership = getTransmittingBuoyOwnership(dataContext, buoyOwnershipCode);
    
    338 364
                     transmittingBuoy.setTransmittingBuoyOwnership(transmittingBuoyOwnership);
    
    339 365
                     entity.addTransmittingBuoy(transmittingBuoy);
    
    340 366
                 }
    
    ... ... @@ -380,4 +406,74 @@ public class FloatingObjectReader extends DataReader<FloatingObject> {
    380 406
             return floatingObjectPartCount.intValue();
    
    381 407
         }
    
    382 408
     
    
    409
    +    private ObjectOperation getObjectOperationByVesselActivityCode(ImportDataContext dataContext, String vesselActivityCode) {
    
    410
    +        String objectOperationCode = DCP_OBJECT_OPERATION_CODE_MAPPING.get(vesselActivityCode);
    
    411
    +        return dataContext.getObjectOperation(Objects.requireNonNull(objectOperationCode, String.format("Can't find objectOperation with ACTIVITE.C_OPERA: %s", vesselActivityCode)));
    
    412
    +    }
    
    413
    +
    
    414
    +    private ObservedSystem getObservedSystem(ImportDataContext dataContext,String objectTypeCode, String buoyTypeCode) {
    
    415
    +        if (objectTypeCode.equals("999")) {
    
    416
    +            if (buoyTypeCode.equals("999")) {
    
    417
    +                return dataContext.getObservedSystem0();
    
    418
    +            }
    
    419
    +            return dataContext.getObservedSystem20();
    
    420
    +        }
    
    421
    +        String observedSystemCode = OBSERVED_SYSTEM_CODE_MAPPING.get(objectTypeCode);
    
    422
    +        return dataContext.getObservedSystem(observedSystemCode, false);
    
    423
    +    }
    
    424
    +
    
    425
    +    private TransmittingBuoyOwnership getTransmittingBuoyOwnership(ImportDataContext dataContext,String buoyOwnershipCode) {
    
    426
    +        if (buoyOwnershipCode == null) {
    
    427
    +            return null;
    
    428
    +        }
    
    429
    +        String transmittingBuoyOwnershipCode = TRANSMITTING_BUOY_OWNERSHIP_CODE_MAPPING.get(buoyOwnershipCode);
    
    430
    +        if (transmittingBuoyOwnershipCode == null) {
    
    431
    +            return null;
    
    432
    +        }
    
    433
    +        return dataContext.getTransmittingBuoyOwnership(transmittingBuoyOwnershipCode);
    
    434
    +    }
    
    435
    +
    
    436
    +    private TransmittingBuoyOperation getTransmittingBuoyOperationByVesselActivityCode(ImportDataContext dataContext,String vesselActivityCode) {
    
    437
    +        String transmittingBuoyTypeCode = TRANSMITTING_BUOY_OPERATION_CODE_MAPPING.get(vesselActivityCode);
    
    438
    +        if (transmittingBuoyTypeCode == null) {
    
    439
    +            return null;
    
    440
    +        }
    
    441
    +        return dataContext.getTransmittingBuoyOperation(transmittingBuoyTypeCode);
    
    442
    +    }
    
    443
    +
    
    444
    +
    
    445
    +    private TransmittingBuoyType getTransmittingBuoyTypeByBuoyTypeCode(ImportDataContext dataContext,String buoyTypeCode) {
    
    446
    +        String transmittingBuoyTypeCode = TRANSMITTING_BUOY_TYPE_CODE_MAPPING.get(buoyTypeCode);
    
    447
    +        if (transmittingBuoyTypeCode == null) {
    
    448
    +            transmittingBuoyTypeCode = "999";
    
    449
    +        }
    
    450
    +        TransmittingBuoyType transmittingBuoyType = dataContext.getTransmittingBuoyType(transmittingBuoyTypeCode);
    
    451
    +        return Objects.requireNonNull(transmittingBuoyType, String.format("Can't find transmittingBuoyType with code: %s", buoyTypeCode));
    
    452
    +    }
    
    453
    +
    
    454
    +    /**
    
    455
    +     * To get objectMaterial id associated by a DCP from avdth ACTIVITE.C_TYP_OBJET code.
    
    456
    +     *
    
    457
    +     * @param objectTypeCode ACTIVITE.C_TYP_OBJET
    
    458
    +     * @return material or null
    
    459
    +     */
    
    460
    +    private ObjectMaterial getObjectMaterialByObjectTypeCode(ImportDataContext dataContext,String objectTypeCode) {
    
    461
    +        switch (objectTypeCode) {
    
    462
    +            case "1":
    
    463
    +                return dataContext.getObjectMaterialAFAD();
    
    464
    +            case "2":
    
    465
    +                return dataContext.getObjectMaterialDFAD();
    
    466
    +            case "3":
    
    467
    +                return dataContext.getObjectMaterialLOG();
    
    468
    +            case "9":
    
    469
    +                return dataContext.getObjectMaterialFOB();
    
    470
    +            case "10":
    
    471
    +                return dataContext.getObjectMaterialFALOG();
    
    472
    +            case "11":
    
    473
    +                return dataContext.getObjectMaterialHALOG();
    
    474
    +            case "13":
    
    475
    +                return dataContext.getObjectMaterialVNLOG();
    
    476
    +        }
    
    477
    +        return null;
    
    478
    +    }
    
    383 479
     }

  • core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationTargetCatchByAssociationReportFixture.java deleted
    1
    -/*
    
    2
    - * #%L
    
    3
    - * ObServe Core :: Services :: Test
    
    4
    - * %%
    
    5
    - * Copyright (C) 2008 - 2022 IRD, Ultreia.io
    
    6
    - * %%
    
    7
    - * This program is free software: you can redistribute it and/or modify
    
    8
    - * it under the terms of the GNU General Public License as
    
    9
    - * published by the Free Software Foundation, either version 3 of the
    
    10
    - * License, or (at your option) any later version.
    
    11
    - *
    
    12
    - * This program is distributed in the hope that it will be useful,
    
    13
    - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    14
    - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    15
    - * GNU General Public License for more details.
    
    16
    - *
    
    17
    - * You should have received a copy of the GNU General Public
    
    18
    - * License along with this program.  If not, see
    
    19
    - * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20
    - * #L%
    
    21
    - */
    
    22
    -package fr.ird.observe.services.service.report.ps;
    
    23
    -
    
    24
    -import com.google.auto.service.AutoService;
    
    25
    -import fr.ird.observe.dto.report.Report;
    
    26
    -import fr.ird.observe.dto.report.ReportRequest;
    
    27
    -import fr.ird.observe.services.service.ReportFixture;
    
    28
    -
    
    29
    -import java.util.Iterator;
    
    30
    -
    
    31
    -/**
    
    32
    - * Test le report {@code targetCatchByAssociation}.
    
    33
    - *
    
    34
    - * @author Tony Chemit - dev@tchemit.fr
    
    35
    - * @since 1.9
    
    36
    - */
    
    37
    -@AutoService(ReportFixture.class)
    
    38
    -public class PsObservationTargetCatchByAssociationReportFixture extends ReportFixture {
    
    39
    -
    
    40
    -    @Override
    
    41
    -    public void assertSyntax(Report report) {
    
    42
    -        super.assertSyntax(report);
    
    43
    -        Iterator<ReportRequest> requests = getRequestIterator(report);
    
    44
    -        assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 0, 0);
    
    45
    -        assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 0, 1);
    
    46
    -        assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 0, 2);
    
    47
    -        assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 0, 3);
    
    48
    -    }
    
    49
    -}

  • core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationTargetDiscardedByAssociationReportFixture.java deleted
    1
    -/*
    
    2
    - * #%L
    
    3
    - * ObServe Core :: Services :: Test
    
    4
    - * %%
    
    5
    - * Copyright (C) 2008 - 2022 IRD, Ultreia.io
    
    6
    - * %%
    
    7
    - * This program is free software: you can redistribute it and/or modify
    
    8
    - * it under the terms of the GNU General Public License as
    
    9
    - * published by the Free Software Foundation, either version 3 of the
    
    10
    - * License, or (at your option) any later version.
    
    11
    - *
    
    12
    - * This program is distributed in the hope that it will be useful,
    
    13
    - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    14
    - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    15
    - * GNU General Public License for more details.
    
    16
    - *
    
    17
    - * You should have received a copy of the GNU General Public
    
    18
    - * License along with this program.  If not, see
    
    19
    - * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20
    - * #L%
    
    21
    - */
    
    22
    -package fr.ird.observe.services.service.report.ps;
    
    23
    -
    
    24
    -import com.google.auto.service.AutoService;
    
    25
    -import fr.ird.observe.dto.report.Report;
    
    26
    -import fr.ird.observe.dto.report.ReportRequest;
    
    27
    -import fr.ird.observe.services.service.ReportFixture;
    
    28
    -
    
    29
    -import java.util.Iterator;
    
    30
    -
    
    31
    -/**
    
    32
    - * Test le report {@code targetDiscardedByAssociation}.
    
    33
    - *
    
    34
    - * @author Tony Chemit - dev@tchemit.fr
    
    35
    - * @since 1.9
    
    36
    - */
    
    37
    -@AutoService(ReportFixture.class)
    
    38
    -public class PsObservationTargetDiscardedByAssociationReportFixture extends ReportFixture {
    
    39
    -
    
    40
    -    @Override
    
    41
    -    public void assertSyntax(Report report) {
    
    42
    -        super.assertSyntax(report);
    
    43
    -        Iterator<ReportRequest> requests = getRequestIterator(report);
    
    44
    -        assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 0, 0);
    
    45
    -        assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 0, 1);
    
    46
    -        assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 0, 2);
    
    47
    -        assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 0, 3);
    
    48
    -    }
    
    49
    -}

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchTotalCountByGroupPerReasonForDiscard.properties
    ... ... @@ -19,8 +19,8 @@
    19 19
     # <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20 20
     # #L%
    
    21 21
     ###
    
    22
    -syntax.name=Observations - Dénombrement des rejets par type de banc et raison de rejet, filtrés par groupe
    
    23
    -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
    
    22
    +syntax.name=Observations - Dénombrement des rejets par type de banc et raison de rejet, filtrés par groupe (en t)
    
    23
    +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 (en t)
    
    24 24
     syntax.rows=-1
    
    25 25
     syntax.columns=-1
    
    26 26
     syntax.columnsHeader=
    

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

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByGroupPerReasonForDiscard.properties
    ... ... @@ -19,7 +19,7 @@
    19 19
     # <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20 20
     # #L%
    
    21 21
     ###
    
    22
    -syntax.name=Observations - Poids des rejets par type de banc et raison de rejet, filtrés par groupe
    
    22
    +syntax.name=Observations - Poids des rejets par type de banc et raison de rejet, filtrés par groupe (en t)
    
    23 23
     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
    
    24 24
     syntax.rows=-1
    
    25 25
     syntax.columns=-1
    
    ... ... @@ -29,4 +29,4 @@ syntax.nbRequests=1
    29 29
     result.columns=9
    
    30 30
     result.rows=2
    
    31 31
     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
    
    32
    -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
    32
    +result.1=[FAO]ALV [sc]Alopias vulpinus [fr]Renard^0.0^12.0^null^null^12.0^null^null^12.0
    \ No newline at end of file

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

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationTargetCatchByAssociation.properties deleted
    1
    -###
    
    2
    -# #%L
    
    3
    -# ObServe Core :: Services :: Test
    
    4
    -# %%
    
    5
    -# Copyright (C) 2008 - 2022 IRD, Ultreia.io
    
    6
    -# %%
    
    7
    -# This program is free software: you can redistribute it and/or modify
    
    8
    -# it under the terms of the GNU General Public License as
    
    9
    -# published by the Free Software Foundation, either version 3 of the
    
    10
    -# License, or (at your option) any later version.
    
    11
    -#
    
    12
    -# This program is distributed in the hope that it will be useful,
    
    13
    -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    14
    -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    15
    -# GNU General Public License for more details.
    
    16
    -#
    
    17
    -# You should have received a copy of the GNU General Public
    
    18
    -# License along with this program.  If not, see
    
    19
    -# <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20
    -# #L%
    
    21
    -###
    
    22
    -syntax.name=Observations - Captures de thons selon le type d’association (en t)
    
    23
    -syntax.description=Afficher la répartitions des captures de thons selon le type d'association
    
    24
    -syntax.rows=5
    
    25
    -syntax.columns=7
    
    26
    -syntax.columnsHeader=YFT^SKJ^BET^LTA^FRI^Autres^Total
    
    27
    -syntax.rowsHeader=BL sans baleine^BL avec baleine^BO avec requin-baleine^BO sans requin-baleine^Total
    
    28
    -syntax.nbRequests=4
    
    29
    -result.columns=7
    
    30
    -result.rows=5
    
    31
    -result.0=175.0^0.0^7.0^0.0^0.0^0.0^182.0
    
    32
    -result.1=null^null^null^null^null^null^0.0
    
    33
    -result.2=null^null^null^null^null^null^0.0
    
    34
    -result.3=0.0^1.0^0.0^0.0^1.0^12.1406^14.1406
    
    35
    -result.4=175.0^1.0^7.0^0.0^1.0^12.1406^196.1406
    \ No newline at end of file

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationTargetDiscardedByAssociation.properties deleted
    1
    -###
    
    2
    -# #%L
    
    3
    -# ObServe Core :: Services :: Test
    
    4
    -# %%
    
    5
    -# Copyright (C) 2008 - 2022 IRD, Ultreia.io
    
    6
    -# %%
    
    7
    -# This program is free software: you can redistribute it and/or modify
    
    8
    -# it under the terms of the GNU General Public License as
    
    9
    -# published by the Free Software Foundation, either version 3 of the
    
    10
    -# License, or (at your option) any later version.
    
    11
    -#
    
    12
    -# This program is distributed in the hope that it will be useful,
    
    13
    -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    14
    -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    15
    -# GNU General Public License for more details.
    
    16
    -#
    
    17
    -# You should have received a copy of the GNU General Public
    
    18
    -# License along with this program.  If not, see
    
    19
    -# <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20
    -# #L%
    
    21
    -###
    
    22
    -result.0=0.0^0.0^0.0^0.0^0.0^0.2882^0.2882
    
    23
    -result.1=null^null^null^null^null^null^0.0
    
    24
    -result.2=null^null^null^null^null^null^0.0
    
    25
    -result.3=0.0^0.0^5.0^0.0^0.0^148.303^153.303
    
    26
    -result.4=0.0^0.0^5.0^0.0^0.0^148.5912^153.5912
    
    27
    -result.columns=7
    
    28
    -result.rows=5
    
    29
    -syntax.columns=7
    
    30
    -syntax.columnsHeader=YFT^SKJ^BET^LTA^FRI^Autres^Total
    
    31
    -syntax.description=Afficher la répartitions des rejets de thons selon le type d'association
    
    32
    -syntax.name=Observations - Rejets de thons selon le type d’association (en t)
    
    33
    -syntax.nbRequests=4
    
    34
    -syntax.rows=5
    
    35
    -syntax.rowsHeader=BL sans baleine^BL avec baleine^BO avec requin-baleine^BO sans requin-baleine^Total

  • src/site/markdown/avdth/logbook.md
    ... ... @@ -46,7 +46,7 @@ La table est déversée dans plusieurs tables :
    46 46
     | ACTIVITE_26 | V_VENT_DIR        | Activity.windDirection                     |               |
    
    47 47
     | ACTIVITE_27 | V_VENT_VIT        | Activity.wind                              | [9](#n_0_9)   | 
    
    48 48
     | ACTIVITE_28 | C_TYP_OBJET       |                                            | [10](#n_0_10) | 
    
    49
    -| ACTIVITE_29 | F_DCP_ECO         | ???                                        |               |
    
    49
    +| ACTIVITE_29 | F_DCP_ECO         | Dcp écologique                             | [10](#n_0_10) |
    
    50 50
     | ACTIVITE_30 | F_PROP_BALISE     | TransmittingBuoy.transmittingBuoyOwnerShip | [10](#n_0_10) |
    
    51 51
     | ACTIVITE_31 | C_TYP_BALISE      |                                            | [10](#n_0_10) |
    
    52 52
     | ACTIVITE_32 | V_ID_BALISE       | TransmittingBuoy.code                      |               |
    
    ... ... @@ -218,6 +218,7 @@ Pour le **simple mapping** on utilise la translation :
    218 218
     | 3                    | fr.ird.referential.ps.common.ObjectMaterial#0#0.50 | 2 LOG    |
    
    219 219
     | 9                    | fr.ird.referential.ps.common.ObjectMaterial#0#1.3  | FOB      |
    
    220 220
     
    
    221
    +Enfin si la valeur du champs **ACTIVITE.F_DCP_ECO** vaut **2**, alors on ajoute le matériel **4-1** (*Matériaux biodégradables*).
    
    221 222
     
    
    222 223
     * ```FloatingObject.transmittingBuoy```
    
    223 224
     
    

  • toolkit/persistence/src/main/java/org/nuiton/topia/service/migration/TopiaMigrationServiceContext.java
    ... ... @@ -279,8 +279,11 @@ public class TopiaMigrationServiceContext {
    279 279
             }
    
    280 280
         }
    
    281 281
     
    
    282
    -    public void saveModelVersion() {
    
    283
    -        saveVersion(null, getModelVersion());
    
    282
    +    protected void saveModelVersionAndCommit() {
    
    283
    +        Version version = getModelVersion();
    
    284
    +        log.info(String.format("[ Version %s ] Saving persistence model database version and commit.", version));
    
    285
    +        sqlHelper.saveAndCommit(jdbcHelper, version.getVersion());
    
    286
    +        dbVersion = version;
    
    284 287
         }
    
    285 288
     
    
    286 289
         public Optional<TopiaMigrationServiceAskUserToMigrate> getAskUserToMigrate() {
    
    ... ... @@ -289,11 +292,7 @@ public class TopiaMigrationServiceContext {
    289 292
     
    
    290 293
         protected void saveVersion(TopiaSqlSupport sqlSupport, Version version) {
    
    291 294
             log.info(String.format("[ Version %s ] Saving new database version.", version));
    
    292
    -        if (sqlSupport != null) {
    
    293
    -            sqlHelper.save(sqlSupport, version.getVersion());
    
    294
    -        } else {
    
    295
    -            sqlHelper.save(jdbcHelper, version.getVersion());
    
    296
    -        }
    
    295
    +        sqlHelper.save(sqlSupport, version.getVersion());
    
    297 296
             dbVersion = version;
    
    298 297
         }
    
    299 298
     
    

  • toolkit/persistence/src/main/java/org/nuiton/topia/service/migration/TopiaMigrationServiceImpl.java
    ... ... @@ -91,7 +91,7 @@ public class TopiaMigrationServiceImpl implements TopiaMigrationService {
    91 91
                 context.dropLegacyTable();
    
    92 92
                 if (dbVersion.equals(modelVersion)) {
    
    93 93
                     log.info("Database is up to date, but was coming from legacy migration table, fill new migration table.");
    
    94
    -                context.saveModelVersion();
    
    94
    +                context.saveModelVersionAndCommit();
    
    95 95
                     return;
    
    96 96
                 }
    
    97 97
             }
    
    ... ... @@ -103,7 +103,7 @@ public class TopiaMigrationServiceImpl implements TopiaMigrationService {
    103 103
     
    
    104 104
             if (versionTableExist && dbNotVersioned) {
    
    105 105
                 log.info("Database is empty, no migration needed.");
    
    106
    -            context.saveModelVersion();
    
    106
    +            context.saveModelVersionAndCommit();
    
    107 107
                 return;
    
    108 108
             }
    
    109 109
     
    
    ... ... @@ -113,8 +113,9 @@ public class TopiaMigrationServiceImpl implements TopiaMigrationService {
    113 113
             List<Version> versionsToApply = context.getResources().getVersionsAfter(dbVersion);
    
    114 114
     
    
    115 115
             if (versionsToApply.isEmpty()) {
    
    116
    +            //TODO This case should never happen?
    
    116 117
                 log.info("No version to apply, no migration needed.");
    
    117
    -            context.saveModelVersion();
    
    118
    +            context.saveModelVersionAndCommit();
    
    118 119
                 return;
    
    119 120
             }
    
    120 121
     
    

  • toolkit/persistence/src/main/java/org/nuiton/topia/service/migration/version/MigrationServiceSqlHelper.java
    ... ... @@ -149,9 +149,9 @@ public interface MigrationServiceSqlHelper {
    149 149
             return deleteTableSql() + fillVersionSql(version);
    
    150 150
         }
    
    151 151
     
    
    152
    -    default void save(JdbcHelper jdbcHelper, String version) {
    
    152
    +    default void saveAndCommit(JdbcHelper jdbcHelper, String version) {
    
    153 153
             try {
    
    154
    -            jdbcHelper.runUpdate(saveTableSql(version));
    
    154
    +            jdbcHelper.runUpdate(saveTableSql(version) + "commit;");
    
    155 155
             } catch (Exception e) {
    
    156 156
                 throw new TopiaException(String.format("Could not save version %s", version), e);
    
    157 157
             }