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

Commits:

1 changed file:

Changes:

  • models/persistence/src/main/java/fr/ird/observe/entities/data/ll/common/TripImpl.java
    ... ... @@ -52,20 +52,24 @@ public class TripImpl extends TripAbstract {
    52 52
                 int logbookFishingOperationCount = 0;
    
    53 53
                 int associatedActivityCount = 0;
    
    54 54
                 int associatedFishingOperationCount = 0;
    
    55
    -            for (fr.ird.observe.entities.data.ll.observation.Activity a : getActivityObs()) {
    
    56
    -                if (a.isSetOperation()) {
    
    57
    -                    observationsFishingOperationCount++;
    
    55
    +            if (isActivityObsNotEmpty()) {
    
    56
    +                for (fr.ird.observe.entities.data.ll.observation.Activity a : getActivityObs()) {
    
    57
    +                    if (a.isSetOperation()) {
    
    58
    +                        observationsFishingOperationCount++;
    
    59
    +                    }
    
    58 60
                     }
    
    59 61
                 }
    
    60
    -            for (fr.ird.observe.entities.data.ll.logbook.Activity a : getActivityLogbook()) {
    
    61
    -                boolean withRelated = a.getRelatedObservedActivity() != null;
    
    62
    -                if (withRelated) {
    
    63
    -                    associatedActivityCount++;
    
    64
    -                }
    
    65
    -                if (a.isSetOperation()) {
    
    66
    -                    logbookFishingOperationCount++;
    
    62
    +            if (isActivityLogbookNotEmpty()) {
    
    63
    +                for (fr.ird.observe.entities.data.ll.logbook.Activity a : getActivityLogbook()) {
    
    64
    +                    boolean withRelated = a.getRelatedObservedActivity() != null;
    
    67 65
                         if (withRelated) {
    
    68
    -                        associatedFishingOperationCount++;
    
    66
    +                        associatedActivityCount++;
    
    67
    +                    }
    
    68
    +                    if (a.isSetOperation()) {
    
    69
    +                        logbookFishingOperationCount++;
    
    70
    +                        if (withRelated) {
    
    71
    +                            associatedFishingOperationCount++;
    
    72
    +                        }
    
    69 73
                         }
    
    70 74
                     }
    
    71 75
                 }