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

Commits:

13 changed files:

Changes:

  • pom.xml
    ... ... @@ -99,7 +99,7 @@
    99 99
         <projectId>ird-t3</projectId>
    
    100 100
         <stageId>frirdt3</stageId>
    
    101 101
         <applicationName>t3</applicationName>
    
    102
    -    <t3-data.version>1.8</t3-data.version>
    
    102
    +    <t3-data.version>1.9-SNAPSHOT</t3-data.version>
    
    103 103
         <lib.version.java4all.i18n>4.0-alpha-11</lib.version.java4all.i18n>
    
    104 104
     
    
    105 105
         <env>dev</env>
    

  • t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeRF2Action.java
    ... ... @@ -195,7 +195,7 @@ public class ComputeRF2Action extends AbstractLevel0Action<ComputeRF2Configurati
    195 195
                                     computeThisStratum = false;
    
    196 196
                                     for (CompleteTrip completeTrip : stratumTrips) {
    
    197 197
                                         for (Trip trip : completeTrip) {
    
    198
    -                                        if (trip.getElementaryCatchTotalWeightRf1(species) == 0) {
    
    198
    +                                        if (trip.getLogbookAvailability() == 0) {
    
    199 199
                                                 // no logbook on this
    
    200 200
                                                 computeThisStratum = true;
    
    201 201
                                                 String message = l(locale, "t3.level0.computeRF2.found.missing.logbook", harbourStr, countryStr, vesselSimpleTypeStr, month, nbStratum, decorate(trip));
    

  • t3-actions/src/main/resources/i18n/t3-actions_en_GB.properties
    ... ... @@ -36,7 +36,7 @@ t3.level0.computeRF1.warning.no.logbook=No log book for trip %s, use a null rf1
    36 36
     t3.level0.computeRF1.warning.no.species.usable.for.country=Could not find usable species fro Raising Factor 1 computation from country %s
    
    37 37
     t3.level0.computeRF1.warning.too.high.rf1=For complete trip %s from %s to %s computed rf1 %s is too high (higher than %s)
    
    38 38
     t3.level0.computeRF1.warning.too.low.rf1=For complete trip %s from %s to %s computed rf1 is too small (less than %s)
    
    39
    -t3.level0.computeRF1.warning.trip.is.not.complete=Trip %s is not compelte, can not compute any rf1 for it
    
    39
    +t3.level0.computeRF1.warning.trip.is.not.complete=Trip %s is not complete, can not compute any rf1 for it
    
    40 40
     t3.level0.computeRF2.computed.rf2.for.stratum=Computed rf2 for stratum \: %s
    
    41 41
     t3.level0.computeRF2.found.missing.logbook=Stratum [%s/%s/%s/%s] (%s) - found a trip {%s} without logbook, will compute rf2.
    
    42 42
     t3.level0.computeRF2.nbTrips.for.stratum=[%s/%s/%s/%s] (%s) - %s complete trip(s) found.
    

  • t3-actions/src/main/resources/i18n/t3-actions_fr_FR.properties
    ... ... @@ -43,8 +43,8 @@ t3.level0.computeRF2.nbTrips.for.stratum=Strate [%s/%s/%s/%s] (%s) - %s marée(s
    43 43
     t3.level0.computeRF2.resume.rf1.for.trip=Marée %s Poids total des captures rf1isées %s / Poids total des ventes %s
    
    44 44
     t3.level0.computeRF2.resume.skip.for.trip=La marée %s ne possède pas de lots commerciaux (non prise en compte dans le calcul du rf2)
    
    45 45
     t3.level0.computeRF2.resume.total.rf1=Poids cumulé des captures rf1isées %s  / Poids cumulé des ventes %s
    
    46
    -t3.level0.computeRF2.skip.missing.logbook=Strate [%s/%s/%s/%s] (%s) - le rf2 ne sera pas calculé, aucun logbook manquant.
    
    47
    -t3.level0.computeRF2.skip.missing.species=Strate [%s/%s/???/???] - le rf2 ne sera pas calculé, pas d'espèce trouvé pour la flotte.
    
    46
    +t3.level0.computeRF2.skip.missing.logbook=Strate [%s/%s/%s/%s] (%s) - aucun logbook manquant, le rf2 ne sera pas calculé.
    
    47
    +t3.level0.computeRF2.skip.missing.species=Strate [%s/%s/???/???] - pas d'espèce trouvé pour la flotte, le rf2 ne sera pas calculé.
    
    48 48
     t3.level0.computeSetDurationAndPositiveSetCount.error.noSetDurationFound=Donnée SetDuration non trouvée (ocean %s, flotte %s, type de banc %s, année %s)
    
    49 49
     t3.level0.computeTripEffort=Efforts de la marée %s (pêche %s, recherche %s)
    
    50 50
     t3.level0.computeTripEffortSkipForDay=Marée %s, jour sans temps de pêche (uniquement des activités « au port » ou « route sans veille »)
    

  • t3-domain/src/main/java/fr/ird/t3/entities/data/AbstractTripTopiaDao.java
    ... ... @@ -85,7 +85,7 @@ public class AbstractTripTopiaDao<E extends Trip> extends GeneratedTripTopiaDao<
    85 85
          * @param pKey primary key of this trip
    
    86 86
          */
    
    87 87
         public static void checkAndSetStandardTripType(Trip trip, Object[] pKey) {
    
    88
    -        int logBookAvailability = trip.getLogBookAvailability();
    
    88
    +        int logBookAvailability = trip.getLogbookAvailability();
    
    89 89
             switch (logBookAvailability) {
    
    90 90
                 case TRIP_WITHOUT_LOGBOOK:
    
    91 91
                     if (trip.isActivityNotEmpty()) {
    
    ... ... @@ -111,7 +111,7 @@ public class AbstractTripTopiaDao<E extends Trip> extends GeneratedTripTopiaDao<
    111 111
          * @param pKey primary key of this trip
    
    112 112
          */
    
    113 113
         public static void checkAndSetLogbookMissingTripType(Trip trip, Object[] pKey) {
    
    114
    -        int logBookAvailability = trip.getLogBookAvailability();
    
    114
    +        int logBookAvailability = trip.getLogbookAvailability();
    
    115 115
             if (trip.getTripType() == TripType.LOGBOOKMISSING) {
    
    116 116
                 if (TRIP_WITH_LOGBOOK == logBookAvailability) {
    
    117 117
                     throw new IllegalStateException(String.format("Trip %s has no logBook but logBookAvailability says the opposite, please fix this trip.", Arrays.toString(pKey)));
    

  • t3-domain/src/main/java/fr/ird/t3/entities/data/TripImpl.java
    ... ... @@ -31,7 +31,6 @@ import fr.ird.t3.entities.reference.Vessel;
    31 31
     import fr.ird.t3.entities.reference.VesselImpl;
    
    32 32
     import org.nuiton.util.DateUtil;
    
    33 33
     
    
    34
    -import java.util.ArrayList;
    
    35 34
     import java.util.Collection;
    
    36 35
     import java.util.Comparator;
    
    37 36
     import java.util.Date;
    
    ... ... @@ -66,8 +65,6 @@ public class TripImpl extends TripAbstract {
    66 65
     
    
    67 66
         private transient Boolean level2Computed;
    
    68 67
         private transient Boolean level3Computed;
    
    69
    -    // only used for avdth import
    
    70
    -    private transient int logBookAvailability;
    
    71 68
     
    
    72 69
         @Override
    
    73 70
         public boolean isSomeDataComputed() {
    
    ... ... @@ -147,34 +144,6 @@ public class TripImpl extends TripAbstract {
    147 144
             return result;
    
    148 145
         }
    
    149 146
     
    
    150
    -    // only used for avdth import
    
    151
    -    @Override
    
    152
    -    public int getLogBookAvailability() {
    
    153
    -        return logBookAvailability;
    
    154
    -    }
    
    155
    -
    
    156
    -    // only used for avdth import
    
    157
    -    @Override
    
    158
    -    public void setLogBookAvailability(int logbookAvaibility) {
    
    159
    -        this.logBookAvailability = logbookAvaibility;
    
    160
    -    }
    
    161
    -
    
    162
    -    //    /** @return the sum of all activities set duration in hours. */
    
    163
    -//    @Override
    
    164
    -//    public float getTotalSetsDuration() {
    
    165
    -//        float result = 0;
    
    166
    -//        if (isActivityNotEmpty()) {
    
    167
    -//            for (Activity activity : getActivity()) {
    
    168
    -//
    
    169
    -//                // get the setDuration
    
    170
    -//                Float setTime = activity.getSetDuration();
    
    171
    -//
    
    172
    -//                result += setTime == null ? 0f : setTime;
    
    173
    -//            }
    
    174
    -//        }
    
    175
    -//        return result / 60;
    
    176
    -//    }
    
    177
    -
    
    178 147
         @Override
    
    179 148
         public float getElementaryCatchTotalWeight(Collection<Species> species) {
    
    180 149
             float result = 0;
    

  • t3-domain/src/main/java/fr/ird/t3/services/migration/T3MigrationCallbackV2_7.java
    1
    +package fr.ird.t3.services.migration;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * T3 :: Domain
    
    6
    + * %%
    
    7
    + * Copyright (C) 2010 - 2018 IRD, Code Lutin, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU Affero General Public License as published by
    
    11
    + * the Free Software Foundation, either version 3 of the License, or
    
    12
    + * (at your option) any later version.
    
    13
    + *
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + *
    
    19
    + * You should have received a copy of the GNU Affero General Public License
    
    20
    + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    21
    + * #L%
    
    22
    + */
    
    23
    +
    
    24
    +import com.google.auto.service.AutoService;
    
    25
    +import org.nuiton.topia.migration.TopiaMigrationCallbackByClassNG;
    
    26
    +import org.nuiton.topia.persistence.TopiaException;
    
    27
    +import org.nuiton.topia.persistence.support.TopiaSqlSupport;
    
    28
    +import org.nuiton.version.Versions;
    
    29
    +
    
    30
    +import java.util.List;
    
    31
    +
    
    32
    +/**
    
    33
    + * Created by tchemit on 03/03/2018.
    
    34
    + *
    
    35
    + * @author Tony Chemit - dev@tchemit.fr
    
    36
    + */
    
    37
    +@AutoService(TopiaMigrationCallbackByClassNG.MigrationCallBackForVersion.class)
    
    38
    +public class T3MigrationCallbackV2_7 extends T3MigrationCallbackSupport {
    
    39
    +
    
    40
    +    public T3MigrationCallbackV2_7() {
    
    41
    +        super(Versions.valueOf("2.7"));
    
    42
    +    }
    
    43
    +
    
    44
    +    @Override
    
    45
    +    protected void prepareMigrationScript(TopiaSqlSupport sqlSupport, List<String> queries, boolean showSql, boolean showProgression) throws TopiaException {
    
    46
    +        addScript("01", "add-trip-logbookAvailability", queries);
    
    47
    +    }
    
    48
    +
    
    49
    +}

  • t3-domain/src/main/resources/db/migration/V2_7_01_add-trip-logbookAvailability.sql
    1
    +---
    
    2
    +-- #%L
    
    3
    +-- T3 :: Domain
    
    4
    +-- %%
    
    5
    +-- Copyright (C) 2010 - 2018 IRD, Code Lutin, Ultreia.io
    
    6
    +-- %%
    
    7
    +-- This program is free software: you can redistribute it and/or modify
    
    8
    +-- it under the terms of the GNU Affero General Public License as published by
    
    9
    +-- the Free Software Foundation, either version 3 of the License, or
    
    10
    +-- (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 Affero General Public License
    
    18
    +-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    19
    +-- #L%
    
    20
    +---
    
    21
    +ALTER TABLE Trip ADD COLUMN logBookAvailability int default 0 NOT NULL;
    
    22
    +

  • t3-domain/src/main/xmi/t3-persistence.properties
    ... ... @@ -21,7 +21,7 @@
    21 21
     model.tagValue.notGenerateToString=true
    
    22 22
     model.tagValue.generateOperatorForDAOHelper=true
    
    23 23
     model.tagValue.constantPrefix=PROPERTY_
    
    24
    -model.tagValue.version=2.5
    
    24
    +model.tagValue.version=2.7
    
    25 25
     model.tagValue.indexForeignKeys=true
    
    26 26
     
    
    27 27
     fr.ird.t3.entities.reference.WeightCategoryLogBookConversion.attribute.distributions.stereotype=ordered
    

  • t3-domain/src/main/xmi/t3-persistence.zargo
    No preview for this file type
  • t3-input-avdthv33/src/main/java/fr/ird/t3/io/input/avdth/v33/T3AccessEntityMetaProviderAvdth33.java
    ... ... @@ -276,7 +276,7 @@ public class T3AccessEntityMetaProviderAvdth33 implements T3AccessEntityMetaProv
    276 276
                     Trip.PROPERTY_FALSE_FISHES_WEIGHT, Float.class, "V_POIDS_FP",
    
    277 277
                     Trip.PROPERTY_LANDING_TOTAL_WEIGHT, Float.class, "V_POIDS_DBQ",
    
    278 278
                     Trip.PROPERTY_FISH_HOLD_EMPTY, Integer.class, "F_CAL_VID",
    
    279
    -                Trip.PROPERTY_LOG_BOOK_AVAILABILITY, Integer.class, "F_ENQ"
    
    279
    +                Trip.PROPERTY_LOGBOOK_AVAILABILITY, Integer.class, "F_ENQ"
    
    280 280
             );
    
    281 281
     
    
    282 282
             // OPERA : [C_OPERA, L_OP8L, L_OPERA]
    

  • t3-input-avdthv35/src/main/java/fr/ird/t3/io/input/avdth/v35/T3AccessEntityMetaProviderAvdth35.java
    ... ... @@ -303,7 +303,7 @@ public class T3AccessEntityMetaProviderAvdth35 implements T3AccessEntityMetaProv
    303 303
                     Trip.PROPERTY_FALSE_FISHES_WEIGHT, Float.class, "V_POIDS_FP",
    
    304 304
                     Trip.PROPERTY_LANDING_TOTAL_WEIGHT, Float.class, "V_POIDS_DBQ",
    
    305 305
                     Trip.PROPERTY_FISH_HOLD_EMPTY, Integer.class, "F_CAL_VID",
    
    306
    -                Trip.PROPERTY_LOG_BOOK_AVAILABILITY, Integer.class, "F_ENQ"
    
    306
    +                Trip.PROPERTY_LOGBOOK_AVAILABILITY, Integer.class, "F_ENQ"
    
    307 307
             );
    
    308 308
     
    
    309 309
             // FP_LOT : [C_BAT, D_DBQ, N_LOT, C_ESP, C_COND, , V_POIDS_PESE, L_ORIGINE, L_COM]
    

  • t3-input-avdthv36/src/main/java/fr/ird/t3/io/input/avdth/v36/T3AccessEntityMetaProviderAvdth36.java
    ... ... @@ -306,7 +306,7 @@ public class T3AccessEntityMetaProviderAvdth36 implements T3AccessEntityMetaProv
    306 306
                     Trip.PROPERTY_FALSE_FISHES_WEIGHT, Float.class, "V_POIDS_FP",
    
    307 307
                     Trip.PROPERTY_LANDING_TOTAL_WEIGHT, Float.class, "V_POIDS_DBQ",
    
    308 308
                     Trip.PROPERTY_FISH_HOLD_EMPTY, Integer.class, "F_CAL_VID",
    
    309
    -                Trip.PROPERTY_LOG_BOOK_AVAILABILITY, Integer.class, "F_ENQ"
    
    309
    +                Trip.PROPERTY_LOGBOOK_AVAILABILITY, Integer.class, "F_ENQ"
    
    310 310
             );
    
    311 311
     
    
    312 312
             // FP_LOT : [C_BAT, D_DBQ, N_LOT, C_ESP, C_COND, , V_POIDS_PESE, L_ORIGINE, L_COM]