Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
117feaa8
by Tony Chemit at 2020-12-26T10:28:20+01:00
-
ec3b8390
by Tony Chemit at 2020-12-26T10:33:57+01:00
11 changed files:
- client/datasource/editor/ll/src/main/i18n/getters/jaxx.getter
- client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/common/TripSelectionTreeNode.java
- client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/common/TripUI.jaxx
- client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/common/TripUI.jcss
- client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/logbook/ActivityUIModel.java
- client/i18n/src/main/i18n/translations/observe_en_GB.properties
- client/i18n/src/main/i18n/translations/observe_es_ES.properties
- client/i18n/src/main/i18n/translations/observe_fr_FR.properties
- models/dto/src/main/java/fr/ird/observe/dto/data/ll/common/TripDto.java
- models/dto/src/main/models/Observe-35-data-ll.model
- models/persistence/src/main/java/fr/ird/observe/entities/data/ll/common/TripImpl.java
Changes:
| ... | ... | @@ -30,10 +30,12 @@ observe.data.ll.common.GearUseFeatures.generalTab |
| 30 | 30 |
observe.data.ll.common.GearUseFeatures.measurementsTab
|
| 31 | 31 |
observe.data.ll.common.GearUseFeatures.number
|
| 32 | 32 |
observe.data.ll.common.GearUseFeatures.usedInTrip
|
| 33 |
+observe.data.ll.common.Trip.associatedActivityAndFishingOperationCount
|
|
| 33 | 34 |
observe.data.ll.common.Trip.availableData
|
| 34 | 35 |
observe.data.ll.common.Trip.ersId
|
| 35 | 36 |
observe.data.ll.common.Trip.generalComment
|
| 36 | 37 |
observe.data.ll.common.Trip.generalTab
|
| 38 |
+observe.data.ll.common.Trip.logbookActivityAndFishingOperationCount
|
|
| 37 | 39 |
observe.data.ll.common.Trip.logbookAvailability
|
| 38 | 40 |
observe.data.ll.common.Trip.logbookComment
|
| 39 | 41 |
observe.data.ll.common.Trip.logbookDataEntryOperator
|
| ... | ... | @@ -43,6 +45,7 @@ observe.data.ll.common.Trip.mapTab |
| 43 | 45 |
observe.data.ll.common.Trip.noOfCrewMembers
|
| 44 | 46 |
observe.data.ll.common.Trip.noOfDays
|
| 45 | 47 |
observe.data.ll.common.Trip.observationMethod
|
| 48 |
+observe.data.ll.common.Trip.observationsActivityAndFishingOperationCount
|
|
| 46 | 49 |
observe.data.ll.common.Trip.observationsAvailability
|
| 47 | 50 |
observe.data.ll.common.Trip.observationsComment
|
| 48 | 51 |
observe.data.ll.common.Trip.observationsDataEntryOperator
|
| ... | ... | @@ -51,7 +54,6 @@ observe.data.ll.common.Trip.observationsTab |
| 51 | 54 |
observe.data.ll.common.Trip.species
|
| 52 | 55 |
observe.data.ll.common.Trip.species.selected
|
| 53 | 56 |
observe.data.ll.common.Trip.species.universe
|
| 54 |
-observe.data.ll.common.Trip.totalFishingOperationsNumber
|
|
| 55 | 57 |
observe.data.ll.common.Trip.tripType
|
| 56 | 58 |
observe.data.ll.landing.Landing.brokerageCompany
|
| 57 | 59 |
observe.data.ll.landing.Landing.caracteristicsTab
|
| ... | ... | @@ -49,7 +49,7 @@ public class TripSelectionTreeNode extends TripSelectionTreeNodeSupport<TripDto, |
| 49 | 49 |
|
| 50 | 50 |
@Override
|
| 51 | 51 |
public String getText() {
|
| 52 |
- String s = super.getText() + " (" + getData().getActivityObsSize() + ")";
|
|
| 52 |
+ String s = super.getText() + " (" + getData().getObservationsActivityCount() + ")";
|
|
| 53 | 53 |
if (isExist()) {
|
| 54 | 54 |
return t("observe.common.exist.on.remote", s);
|
| 55 | 55 |
}
|
| ... | ... | @@ -180,13 +180,13 @@ |
| 180 | 180 |
</cell>
|
| 181 | 181 |
</row>
|
| 182 | 182 |
|
| 183 |
- <!-- totalFishingOperationsNumber -->
|
|
| 183 |
+ <!-- associatedActivityAndFishingOperationCount -->
|
|
| 184 | 184 |
<row>
|
| 185 |
- <cell anchor='west'>
|
|
| 186 |
- <JLabel id='totalFishingOperationsNumberLabel' styleClass="italic"/>
|
|
| 187 |
- </cell>
|
|
| 188 |
- <cell anchor='west' weightx="0.5">
|
|
| 189 |
- <JLabel id='totalFishingOperationsNumber' styleClass="skipI18n"/>
|
|
| 185 |
+ <cell columns='2'>
|
|
| 186 |
+ <JPanel id='associatedActivityAndFishingOperationCountPanel' layout="{new BorderLayout()}" beanScope="model">
|
|
| 187 |
+ <JLabel id='associatedActivityAndFishingOperationCountLabel' styleClass="italic" constraints='BorderLayout.WEST'/>
|
|
| 188 |
+ <JLabel id='associatedActivityAndFishingOperationCount' styleClass="skipI18n" constraints='BorderLayout.CENTER'/>
|
|
| 189 |
+ </JPanel>
|
|
| 190 | 190 |
</cell>
|
| 191 | 191 |
</row>
|
| 192 | 192 |
|
| ... | ... | @@ -267,7 +267,15 @@ |
| 267 | 267 |
<JaxxComboBox id='observationsDataQuality' genericType='DataQualityReference' constructorParams='this'/>
|
| 268 | 268 |
</cell>
|
| 269 | 269 |
</row>
|
| 270 |
- |
|
| 270 |
+ <!-- observationsActivityAndFishingOperationCount -->
|
|
| 271 |
+ <row>
|
|
| 272 |
+ <cell columns='2'>
|
|
| 273 |
+ <JPanel id='observationsActivityAndFishingOperationCountPanel' layout="{new BorderLayout()}" beanScope="model">
|
|
| 274 |
+ <JLabel id='observationsActivityAndFishingOperationCountLabel' styleClass="italic" constraints='BorderLayout.WEST'/>
|
|
| 275 |
+ <JLabel id='observationsActivityAndFishingOperationCount' styleClass="skipI18n" constraints='BorderLayout.CENTER'/>
|
|
| 276 |
+ </JPanel>
|
|
| 277 |
+ </cell>
|
|
| 278 |
+ </row>
|
|
| 271 | 279 |
<!-- observationsComment -->
|
| 272 | 280 |
<row>
|
| 273 | 281 |
<cell columns='2' fill='both' weighty="1">
|
| ... | ... | @@ -301,7 +309,15 @@ |
| 301 | 309 |
<JaxxComboBox id='logbookDataQuality' genericType='DataQualityReference' constructorParams='this'/>
|
| 302 | 310 |
</cell>
|
| 303 | 311 |
</row>
|
| 304 |
- |
|
| 312 |
+ <!-- logbookActivityAndFishingOperationCount -->
|
|
| 313 |
+ <row>
|
|
| 314 |
+ <cell columns='2' weightx="1">
|
|
| 315 |
+ <JPanel id='logbookActivityAndFishingOperationCountPanel' layout="{new BorderLayout()}" beanScope="model">
|
|
| 316 |
+ <JLabel id='logbookActivityAndFishingOperationCountLabel' styleClass="italic" constraints='BorderLayout.WEST'/>
|
|
| 317 |
+ <JLabel id='logbookActivityAndFishingOperationCount' styleClass="skipI18n" constraints='BorderLayout.CENTER'/>
|
|
| 318 |
+ </JPanel>
|
|
| 319 |
+ </cell>
|
|
| 320 |
+ </row>
|
|
| 305 | 321 |
<!-- logbookComment -->
|
| 306 | 322 |
<row>
|
| 307 | 323 |
<cell columns='2' fill='both' weighty="1">
|
| ... | ... | @@ -20,9 +20,19 @@ |
| 20 | 20 |
* #L%
|
| 21 | 21 |
*/
|
| 22 | 22 |
|
| 23 |
-#totalFishingOperationsNumber {
|
|
| 23 |
+#associatedActivityAndFishingOperationCount {
|
|
| 24 | 24 |
font-weight:bold;
|
| 25 |
- text:{getStringValue(bean.getTotalFishingOperationsNumber())};
|
|
| 25 |
+ text:{" " + bean.getAssociatedActivityAndFishingOperationCount()};
|
|
| 26 |
+}
|
|
| 27 |
+ |
|
| 28 |
+#observationsActivityAndFishingOperationCount {
|
|
| 29 |
+ font-weight:bold;
|
|
| 30 |
+ text:{" " + bean.getObservationsActivityAndFishingOperationCount()};
|
|
| 31 |
+}
|
|
| 32 |
+ |
|
| 33 |
+#logbookActivityAndFishingOperationCount {
|
|
| 34 |
+ font-weight:bold;
|
|
| 35 |
+ text:{" " + bean.getLogbookActivityAndFishingOperationCount()};
|
|
| 26 | 36 |
}
|
| 27 | 37 |
|
| 28 | 38 |
#startDate {
|
| ... | ... | @@ -55,8 +65,6 @@ |
| 55 | 65 |
}
|
| 56 | 66 |
|
| 57 | 67 |
#species {
|
| 58 |
- /*showListLabel:true;
|
|
| 59 |
- label:{t("observe.data.ll.common.Trip.species")};*/
|
|
| 60 | 68 |
universeLabel:{t("observe.data.ll.common.Trip.species.universe")};
|
| 61 | 69 |
selectedLabel:{t("observe.data.ll.common.Trip.species.selected")};
|
| 62 | 70 |
}
|
| ... | ... | @@ -100,9 +100,6 @@ public class ActivityUIModel extends GeneratedActivityUIModel { |
| 100 | 100 |
}
|
| 101 | 101 |
|
| 102 | 102 |
private void updateActivityObsCandidates() {
|
| 103 |
- if (!getStates().isOpened()) {
|
|
| 104 |
- return;
|
|
| 105 |
- }
|
|
| 106 | 103 |
log.info(String.format("%s Will update release observed activities...", getPrefix()));
|
| 107 | 104 |
ActivityDto bean = getStates().getBean();
|
| 108 | 105 |
if (pairingContext == null) {
|
| ... | ... | @@ -352,6 +352,7 @@ observe.data.ll.common.Trip.action.move=Change program |
| 352 | 352 |
observe.data.ll.common.Trip.action.move.choose.parent.message=Select target program
|
| 353 | 353 |
observe.data.ll.common.Trip.action.move.choose.parent.title=Move trips to another program
|
| 354 | 354 |
observe.data.ll.common.Trip.action.move.tip=Change program of trip(s)
|
| 355 |
+observe.data.ll.common.Trip.associatedActivityAndFishingOperationCount=Total associated activities / fishing operation count
|
|
| 355 | 356 |
observe.data.ll.common.Trip.availableData=Available data
|
| 356 | 357 |
observe.data.ll.common.Trip.ersId=Id ERS
|
| 357 | 358 |
observe.data.ll.common.Trip.generalComment=Comment
|
| ... | ... | @@ -359,6 +360,7 @@ observe.data.ll.common.Trip.generalTab=Common characteristics |
| 359 | 360 |
observe.data.ll.common.Trip.list.message.none=No trip for current program
|
| 360 | 361 |
observe.data.ll.common.Trip.list.navigation.node=Trip
|
| 361 | 362 |
observe.data.ll.common.Trip.list.title=List of trips
|
| 363 |
+observe.data.ll.common.Trip.logbookActivityAndFishingOperationCount=Total logbook activities / fishing operation count
|
|
| 362 | 364 |
observe.data.ll.common.Trip.logbookAvailability=Logbook and associated data
|
| 363 | 365 |
observe.data.ll.common.Trip.logbookComment=Comment
|
| 364 | 366 |
observe.data.ll.common.Trip.logbookTab=Logbook and associated data
|
| ... | ... | @@ -367,6 +369,7 @@ observe.data.ll.common.Trip.message.not.open=Current trip is not opened, no edit |
| 367 | 369 |
observe.data.ll.common.Trip.navigation.unsaved=New trip
|
| 368 | 370 |
observe.data.ll.common.Trip.noOfCrewMembers=Number of crew
|
| 369 | 371 |
observe.data.ll.common.Trip.noOfDays=Duration (days)
|
| 372 |
+observe.data.ll.common.Trip.observationsActivityAndFishingOperationCount=Total observed activities / fishing operation count
|
|
| 370 | 373 |
observe.data.ll.common.Trip.observationsAvailability=Observations
|
| 371 | 374 |
observe.data.ll.common.Trip.observationsComment=Comment
|
| 372 | 375 |
observe.data.ll.common.Trip.observationsTab=Observations
|
| ... | ... | @@ -374,7 +377,6 @@ observe.data.ll.common.Trip.species=Target species |
| 374 | 377 |
observe.data.ll.common.Trip.species.selected=Selected species
|
| 375 | 378 |
observe.data.ll.common.Trip.species.universe=Available species
|
| 376 | 379 |
observe.data.ll.common.Trip.title=Trip
|
| 377 |
-observe.data.ll.common.Trip.totalFishingOperationsNumber=Total fishing operation count
|
|
| 378 | 380 |
observe.data.ll.common.Trip.with.logbooks.message=There is some logbook data in this trip, can't unselect logbook availability
|
| 379 | 381 |
observe.data.ll.common.Trip.with.logbooks.title=Can't remove logbook availability
|
| 380 | 382 |
observe.data.ll.common.Trip.with.observations.message=There is some observations in this trip, can't unselect observations availability
|
| ... | ... | @@ -352,6 +352,7 @@ observe.data.ll.common.Trip.action.move=Reasignación del programa |
| 352 | 352 |
observe.data.ll.common.Trip.action.move.choose.parent.message=A qué programa quiere asociar las mareas seleccionadas ?
|
| 353 | 353 |
observe.data.ll.common.Trip.action.move.choose.parent.title=Cambiar el programa de las mareas
|
| 354 | 354 |
observe.data.ll.common.Trip.action.move.tip=Cambiar el programme de mareas seleccionadas
|
| 355 |
+observe.data.ll.common.Trip.associatedActivityAndFishingOperationCount=Total associated activities / fishing operation count \#TODO
|
|
| 355 | 356 |
observe.data.ll.common.Trip.availableData=Données disponibles
|
| 356 | 357 |
observe.data.ll.common.Trip.ersId=Id ERS
|
| 357 | 358 |
observe.data.ll.common.Trip.generalComment=Comentarios
|
| ... | ... | @@ -359,6 +360,7 @@ observe.data.ll.common.Trip.generalTab=General características |
| 359 | 360 |
observe.data.ll.common.Trip.list.message.none=Ninguna marea para el programa actual
|
| 360 | 361 |
observe.data.ll.common.Trip.list.navigation.node=Marea
|
| 361 | 362 |
observe.data.ll.common.Trip.list.title=List of trips
|
| 363 |
+observe.data.ll.common.Trip.logbookActivityAndFishingOperationCount=Total logbook activities / fishing operation count \#TODO
|
|
| 362 | 364 |
observe.data.ll.common.Trip.logbookAvailability=Diario de pesca y datos asociados
|
| 363 | 365 |
observe.data.ll.common.Trip.logbookComment=Comentarios
|
| 364 | 366 |
observe.data.ll.common.Trip.logbookTab=Diario de pesca y datos asociados
|
| ... | ... | @@ -367,6 +369,7 @@ observe.data.ll.common.Trip.message.not.open=La marea actual no está abierta, n |
| 367 | 369 |
observe.data.ll.common.Trip.navigation.unsaved=Nueva marea
|
| 368 | 370 |
observe.data.ll.common.Trip.noOfCrewMembers=Nombre d'équipage
|
| 369 | 371 |
observe.data.ll.common.Trip.noOfDays=Duración (días)
|
| 372 |
+observe.data.ll.common.Trip.observationsActivityAndFishingOperationCount=Total observed activities / fishing operation count \#TODO
|
|
| 370 | 373 |
observe.data.ll.common.Trip.observationsAvailability=Observaciones
|
| 371 | 374 |
observe.data.ll.common.Trip.observationsComment=Comentarios
|
| 372 | 375 |
observe.data.ll.common.Trip.observationsTab=Observaciones
|
| ... | ... | @@ -374,7 +377,6 @@ observe.data.ll.common.Trip.species=Especie objetivo |
| 374 | 377 |
observe.data.ll.common.Trip.species.selected=Espèces sélectionnées \#TODO
|
| 375 | 378 |
observe.data.ll.common.Trip.species.universe=Espèces disponibles \#TODO
|
| 376 | 379 |
observe.data.ll.common.Trip.title=Marea
|
| 377 |
-observe.data.ll.common.Trip.totalFishingOperationsNumber=Número total de las operaciones de pesca
|
|
| 378 | 380 |
observe.data.ll.common.Trip.with.logbooks.message=There is some logbook data in this trip, can't unselect logbook availability \#TODO
|
| 379 | 381 |
observe.data.ll.common.Trip.with.logbooks.title=Can't remove logbook availability \#TODO
|
| 380 | 382 |
observe.data.ll.common.Trip.with.observations.message=There is some observations in this trip, can't unselect observations availability \#TODO
|
| ... | ... | @@ -352,6 +352,7 @@ observe.data.ll.common.Trip.action.move=Réallocation du programme |
| 352 | 352 |
observe.data.ll.common.Trip.action.move.choose.parent.message=A quel programme voulez-vous associer les marées sélectionnées ?
|
| 353 | 353 |
observe.data.ll.common.Trip.action.move.choose.parent.title=Changer le programme des marées
|
| 354 | 354 |
observe.data.ll.common.Trip.action.move.tip=Changer le programme des marées sélectionnées
|
| 355 |
+observe.data.ll.common.Trip.associatedActivityAndFishingOperationCount=Nombres d'activités / d'opérations de pêche mises en correspondance
|
|
| 355 | 356 |
observe.data.ll.common.Trip.availableData=Données disponibles
|
| 356 | 357 |
observe.data.ll.common.Trip.ersId=Id ERS
|
| 357 | 358 |
observe.data.ll.common.Trip.generalComment=Commentaire
|
| ... | ... | @@ -359,6 +360,7 @@ observe.data.ll.common.Trip.generalTab=Caractéristiques communes |
| 359 | 360 |
observe.data.ll.common.Trip.list.message.none=Aucune marée pour le programme courant
|
| 360 | 361 |
observe.data.ll.common.Trip.list.navigation.node=Marée
|
| 361 | 362 |
observe.data.ll.common.Trip.list.title=Liste de marées
|
| 363 |
+observe.data.ll.common.Trip.logbookActivityAndFishingOperationCount=Nombres d'activités / d'opérations de pêche livre de bord
|
|
| 362 | 364 |
observe.data.ll.common.Trip.logbookAvailability=Livre de bord et données associées
|
| 363 | 365 |
observe.data.ll.common.Trip.logbookComment=Commentaire
|
| 364 | 366 |
observe.data.ll.common.Trip.logbookTab=Livre de bord et données associées
|
| ... | ... | @@ -367,6 +369,7 @@ observe.data.ll.common.Trip.message.not.open=La marée courante n'est pas ouvert |
| 367 | 369 |
observe.data.ll.common.Trip.navigation.unsaved=Nouvelle marée
|
| 368 | 370 |
observe.data.ll.common.Trip.noOfCrewMembers=Nombre d'équipage
|
| 369 | 371 |
observe.data.ll.common.Trip.noOfDays=Durée (jours)
|
| 372 |
+observe.data.ll.common.Trip.observationsActivityAndFishingOperationCount=Nombres d'activités / d'opérations de pêche observées
|
|
| 370 | 373 |
observe.data.ll.common.Trip.observationsAvailability=Données d'observation
|
| 371 | 374 |
observe.data.ll.common.Trip.observationsComment=Commentaire
|
| 372 | 375 |
observe.data.ll.common.Trip.observationsTab=Données d'observation
|
| ... | ... | @@ -374,7 +377,6 @@ observe.data.ll.common.Trip.species=Espèces ciblées |
| 374 | 377 |
observe.data.ll.common.Trip.species.selected=Espèces sélectionnées
|
| 375 | 378 |
observe.data.ll.common.Trip.species.universe=Espèces disponibles
|
| 376 | 379 |
observe.data.ll.common.Trip.title=Marée
|
| 377 |
-observe.data.ll.common.Trip.totalFishingOperationsNumber=Nombre total d'opérations de pêche
|
|
| 378 | 380 |
observe.data.ll.common.Trip.with.logbooks.message=Il existe des données `Livre de bord` sur cette marée, impossible de désactiver cette propriété
|
| 379 | 381 |
observe.data.ll.common.Trip.with.logbooks.title=Impossible de désactiver la présence des livres de bord
|
| 380 | 382 |
observe.data.ll.common.Trip.with.observations.message=Il existe des observations sur cette marée, impossible de désactiver cette propriété
|
| ... | ... | @@ -52,20 +52,68 @@ public class TripDto extends GeneratedTripDto { |
| 52 | 52 |
return I18nDecoratorHelper.getStartEndDateLabel(getStartDate(), getEndDate());
|
| 53 | 53 |
}
|
| 54 | 54 |
|
| 55 |
+ @Override
|
|
| 56 |
+ public void setStartDate(Date startDate) {
|
|
| 57 |
+ super.setStartDate(startDate == null ? null : DateUtil.getDay(startDate));
|
|
| 58 |
+ }
|
|
| 59 |
+ |
|
| 60 |
+ @Override
|
|
| 61 |
+ public void setObservationsActivityCount(int observationsActivityCount) {
|
|
| 62 |
+ super.setObservationsActivityCount(observationsActivityCount);
|
|
| 63 |
+ firePropertyChange("observationsActivityAndFishingOperationCount", getObservationsActivityAndFishingOperationCount());
|
|
| 64 |
+ }
|
|
| 65 |
+ |
|
| 66 |
+ @Override
|
|
| 67 |
+ public void setObservationsFishingOperationCount(int observationsFishingOperationCount) {
|
|
| 68 |
+ super.setObservationsFishingOperationCount(observationsFishingOperationCount);
|
|
| 69 |
+ firePropertyChange("observationsActivityAndFishingOperationCount", getObservationsActivityAndFishingOperationCount());
|
|
| 70 |
+ }
|
|
| 71 |
+ |
|
| 72 |
+ public String getObservationsActivityAndFishingOperationCount() {
|
|
| 73 |
+ return String.format("%d / %d", getObservationsActivityCount(), getObservationsFishingOperationCount());
|
|
| 74 |
+ }
|
|
| 75 |
+ |
|
| 76 |
+ @Override
|
|
| 77 |
+ public void setLogbookActivityCount(int logbookActivityCount) {
|
|
| 78 |
+ super.setLogbookActivityCount(logbookActivityCount);
|
|
| 79 |
+ firePropertyChange("logbookActivityAndFishingOperationCount", getLogbookActivityAndFishingOperationCount());
|
|
| 80 |
+ }
|
|
| 81 |
+ |
|
| 82 |
+ @Override
|
|
| 83 |
+ public void setLogbookFishingOperationCount(int logbookFishingOperationCount) {
|
|
| 84 |
+ super.setLogbookFishingOperationCount(logbookFishingOperationCount);
|
|
| 85 |
+ firePropertyChange("logbookActivityAndFishingOperationCount", getLogbookActivityAndFishingOperationCount());
|
|
| 86 |
+ }
|
|
| 87 |
+ |
|
| 88 |
+ public String getLogbookActivityAndFishingOperationCount() {
|
|
| 89 |
+ return String.format("%d / %d", getLogbookActivityCount(), getLogbookFishingOperationCount());
|
|
| 90 |
+ }
|
|
| 91 |
+ |
|
| 92 |
+ @Override
|
|
| 93 |
+ public void setAssociatedActivityCount(int associatedActivityCount) {
|
|
| 94 |
+ super.setAssociatedActivityCount(associatedActivityCount);
|
|
| 95 |
+ firePropertyChange("associatedActivityAndFishingOperationCount", getAssociatedActivityAndFishingOperationCount());
|
|
| 96 |
+ }
|
|
| 97 |
+ |
|
| 98 |
+ @Override
|
|
| 99 |
+ public void setAssociatedFishingOperationCount(int associatedFishingOperationCount) {
|
|
| 100 |
+ super.setAssociatedFishingOperationCount(associatedFishingOperationCount);
|
|
| 101 |
+ firePropertyChange("associatedActivityAndFishingOperationCount", getAssociatedActivityAndFishingOperationCount());
|
|
| 102 |
+ }
|
|
| 103 |
+ |
|
| 104 |
+ public String getAssociatedActivityAndFishingOperationCount() {
|
|
| 105 |
+ return String.format("%d / %d", getAssociatedActivityCount(), getAssociatedFishingOperationCount());
|
|
| 106 |
+ }
|
|
| 107 |
+ |
|
| 55 | 108 |
public void updateNoOfDays() {
|
| 56 | 109 |
setNoOfDays(createNoOfDay(startDate, endDate));
|
| 57 | 110 |
}
|
| 58 | 111 |
|
| 59 | 112 |
public boolean withLogbookData() {
|
| 60 |
- return getActivityLogbookSize() > 0 || getSampleSize() > 0 || getLandingSize() > 0;
|
|
| 113 |
+ return getLogbookActivityCount() > 0 || getSampleSize() > 0 || getLandingSize() > 0;
|
|
| 61 | 114 |
}
|
| 62 | 115 |
|
| 63 | 116 |
public boolean withObservationData() {
|
| 64 |
- return isNotActivityObsEmpty();
|
|
| 65 |
- }
|
|
| 66 |
- |
|
| 67 |
- @Override
|
|
| 68 |
- public void setStartDate(Date startDate) {
|
|
| 69 |
- super.setStartDate(startDate == null ? null : DateUtil.getDay(startDate));
|
|
| 117 |
+ return getObservationsActivityCount() > 0;
|
|
| 70 | 118 |
}
|
| 71 | 119 |
}
|
| ... | ... | @@ -10,15 +10,19 @@ data.ll.common.GearUseFeaturesMeasurement > data.Data | references=measurementVa |
| 10 | 10 |
measurementValue + {*:1} String
|
| 11 | 11 |
gearCharacteristic {*:1} fr.ird.observe.dto.referential.common.GearCharacteristicReference
|
| 12 | 12 |
|
| 13 |
-data.ll.common.Trip > data.Openable >> data.TripAware | references=startDate,endDate,program,tripTypeId,activityObsSize,activityLogbookSize,landingSize,sampleSize,vessel,observerLabel,observationsAvailability,logbookAvailability comparator=startDate navigationParent=referential.common.Program
|
|
| 13 |
+data.ll.common.Trip > data.Openable >> data.TripAware | references=startDate,endDate,program,tripTypeId,observationsActivityCount,logbookActivityCount,landingSize,sampleSize,vessel,observerLabel,observationsAvailability,logbookAvailability comparator=startDate navigationParent=referential.common.Program
|
|
| 14 | 14 |
startDate + {*:1} Date | notNull
|
| 15 | 15 |
endDate + {*:1} Date | notNull
|
| 16 |
-totalFishingOperationsNumber + {*:1} Integer
|
|
| 17 | 16 |
ersId + {*:1} String
|
| 18 | 17 |
generalComment + {*:1} String
|
| 19 | 18 |
observationsComment + {*:1} String
|
| 20 | 19 |
logbookComment + {*:1} String
|
| 21 |
-activityLogbookSize + {*:1} int
|
|
| 20 |
+logbookActivityCount + {*:1} int
|
|
| 21 |
+logbookFishingOperationCount + {*:1} int
|
|
| 22 |
+observationsActivityCount + {*:1} int
|
|
| 23 |
+observationsFishingOperationCount + {*:1} int
|
|
| 24 |
+associatedActivityCount + {*:1} int
|
|
| 25 |
+associatedFishingOperationCount + {*:1} int
|
|
| 22 | 26 |
sampleSize + {*:1} int
|
| 23 | 27 |
landingSize + {*:1} int
|
| 24 | 28 |
noOfCrewMembers + {*:1} Integer
|
| ... | ... | @@ -25,7 +25,6 @@ package fr.ird.observe.entities.data.ll.common; |
| 25 | 25 |
import fr.ird.observe.dto.data.DataDto;
|
| 26 | 26 |
import fr.ird.observe.dto.data.ll.common.TripDto;
|
| 27 | 27 |
import fr.ird.observe.dto.referential.ReferentialLocale;
|
| 28 |
-import fr.ird.observe.entities.data.ll.observation.Activity;
|
|
| 29 | 28 |
import org.nuiton.util.DateUtil;
|
| 30 | 29 |
|
| 31 | 30 |
import java.util.Date;
|
| ... | ... | @@ -45,25 +44,41 @@ public class TripImpl extends TripAbstract { |
| 45 | 44 |
super.toDto(referentialLocale, dto);
|
| 46 | 45 |
if (dto instanceof TripDto) {
|
| 47 | 46 |
TripDto dto1 = (TripDto) dto;
|
| 48 |
- //FIXME Improve this to compute it in dto.postInit method
|
|
| 49 |
- dto1.setTotalFishingOperationsNumber(computeTotalFishingOperationsNumber());
|
|
| 47 |
+ |
|
| 48 |
+ dto1.setObservationsActivityCount(getActivityObsSize());
|
|
| 49 |
+ dto1.setLogbookActivityCount(getActivityLogbookSize());
|
|
| 50 |
+ |
|
| 51 |
+ int observationsFishingOperationCount = 0;
|
|
| 52 |
+ int logbookFishingOperationCount = 0;
|
|
| 53 |
+ int associatedActivityCount = 0;
|
|
| 54 |
+ int associatedFishingOperationCount = 0;
|
|
| 55 |
+ for (fr.ird.observe.entities.data.ll.observation.Activity a : getActivityObs()) {
|
|
| 56 |
+ if (a.isSetOperation()) {
|
|
| 57 |
+ observationsFishingOperationCount++;
|
|
| 58 |
+ }
|
|
| 59 |
+ }
|
|
| 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++;
|
|
| 67 |
+ if (withRelated) {
|
|
| 68 |
+ associatedFishingOperationCount++;
|
|
| 69 |
+ }
|
|
| 70 |
+ }
|
|
| 71 |
+ }
|
|
| 72 |
+ dto1.setObservationsFishingOperationCount(observationsFishingOperationCount);
|
|
| 73 |
+ dto1.setLogbookFishingOperationCount(logbookFishingOperationCount);
|
|
| 74 |
+ dto1.setAssociatedActivityCount(associatedActivityCount);
|
|
| 75 |
+ dto1.setAssociatedFishingOperationCount(associatedFishingOperationCount);
|
|
| 50 | 76 |
}
|
| 51 | 77 |
}
|
| 52 | 78 |
|
| 53 | 79 |
@Override
|
| 54 | 80 |
public Date getTheoreticalEndDate() {
|
| 55 |
- Date lastActivityDate = isActivityObsEmpty() ? null : getActivityObs().stream().map(Activity::getTimeStamp).max(Date::compareTo).orElse(null);
|
|
| 81 |
+ Date lastActivityDate = isActivityObsEmpty() ? null : getActivityObs().stream().map(fr.ird.observe.entities.data.ll.observation.Activity::getTimeStamp).max(Date::compareTo).orElse(null);
|
|
| 56 | 82 |
return DateUtil.getEndOfDay(lastActivityDate == null ? getStartDate() : lastActivityDate);
|
| 57 | 83 |
}
|
| 58 |
- |
|
| 59 |
- private int computeTotalFishingOperationsNumber() {
|
|
| 60 |
- int result = 0;
|
|
| 61 |
- if (isActivityLogbookNotEmpty()) {
|
|
| 62 |
- result += activityLogbook.stream().filter(fr.ird.observe.entities.data.ll.logbook.Activity::isSetOperation).count();
|
|
| 63 |
- }
|
|
| 64 |
- if (isActivityObsNotEmpty()) {
|
|
| 65 |
- result += activityObs.stream().filter(fr.ird.observe.entities.data.ll.observation.Activity::isSetOperation).count();
|
|
| 66 |
- }
|
|
| 67 |
- return result;
|
|
| 68 |
- }
|
|
| 69 | 84 |
}
|