Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 3614488d by Tony Chemit at 2023-04-14T11:50:22+02:00 Ajouter une colonne poids total (en t) sur le tableau des cuves calées - Closes #2675 - - - - - 11 changed files: - client/datasource/editor/ps/src/main/i18n/getters/navigation.getter - client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/WellActivityUIHandler.java - client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/WellActivityUITableModel.java - core/api/dto-decoration/src/main/i18n/getters/labels.getter - core/api/dto/src/main/java/fr/ird/observe/dto/data/ps/logbook/WellActivityDto.java - core/services/i18n/src/main/i18n/translations/services_en_GB.properties - core/services/i18n/src/main/i18n/translations/services_es_ES.properties - core/services/i18n/src/main/i18n/translations/services_fr_FR.properties - model/src/main/models/Observe/dto/21-data-ps-logbook.model - model/src/main/models/Observe/dto/class/containerChildDataDtoProperties.properties - model/src/main/models/Observe/dto/class/i18nLabels.properties Changes: ===================================== client/datasource/editor/ps/src/main/i18n/getters/navigation.getter ===================================== @@ -169,6 +169,8 @@ observe.data.ps.logbook.WellActivity.action.save observe.data.ps.logbook.WellActivity.action.save.tip observe.data.ps.logbook.WellActivity.activity observe.data.ps.logbook.WellActivity.activity.short +observe.data.ps.logbook.WellActivity.computedTotalWeight +observe.data.ps.logbook.WellActivity.computedTotalWeight.short observe.data.ps.logbook.WellActivity.wellActivitySpecies observe.data.ps.logbook.WellActivity.wellActivitySpecies.short observe.data.ps.observation.Activity.action.create ===================================== client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/WellActivityUIHandler.java ===================================== @@ -47,4 +47,10 @@ public class WellActivityUIHandler extends GeneratedWellActivityUIHandler { } return ui.getWellActivitySpeciesTable(); } + + @Override + protected void onTableModelChanged() { + super.onTableModelChanged(); + getUi().getTable().invalidate(); + } } ===================================== client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/WellActivityUITableModel.java ===================================== @@ -25,7 +25,6 @@ package fr.ird.observe.client.datasource.editor.ps.data.logbook; import fr.ird.observe.client.datasource.editor.api.content.EditableContentUI; import fr.ird.observe.client.util.UIHelper; import fr.ird.observe.client.util.table.EditableListProperty; -import fr.ird.observe.dto.data.ps.logbook.WellActivityDto; import fr.ird.observe.dto.data.ps.logbook.WellActivitySpeciesDto; import fr.ird.observe.dto.data.ps.logbook.WellDto; @@ -76,6 +75,7 @@ public class WellActivityUITableModel extends GeneratedWellActivityUITableModel getValidator().doValidate(); getValidator().setChanged(false); wellActivitySpeciesTableModel.setModified(false); + fireTableDataChanged(); } @Override @@ -83,9 +83,4 @@ public class WellActivityUITableModel extends GeneratedWellActivityUITableModel super.startEditTableEditBeanOnInlineModels(); wellActivitySpeciesTableModel.validate(); } - - @Override - protected void onSelectedRowChanged(WellActivityUI ui, int editingRow, WellActivityDto tableEditBean, WellActivityDto previousRowBean, boolean notPersisted, boolean newRow) { - super.onSelectedRowChanged(ui, editingRow, tableEditBean, previousRowBean, notPersisted, newRow); - } } ===================================== core/api/dto-decoration/src/main/i18n/getters/labels.getter ===================================== @@ -1023,6 +1023,8 @@ observe.data.ps.logbook.WellActivity.action.save observe.data.ps.logbook.WellActivity.action.save.tip observe.data.ps.logbook.WellActivity.activity observe.data.ps.logbook.WellActivity.activity.short +observe.data.ps.logbook.WellActivity.computedTotalWeight +observe.data.ps.logbook.WellActivity.computedTotalWeight.short observe.data.ps.logbook.WellActivity.title observe.data.ps.logbook.WellActivity.type observe.data.ps.logbook.WellActivity.wellActivitySpecies ===================================== core/api/dto/src/main/java/fr/ird/observe/dto/data/ps/logbook/WellActivityDto.java ===================================== @@ -28,6 +28,7 @@ import io.ultreia.java4all.decoration.DecoratorProvider; @GenerateJavaBeanDefinition public class WellActivityDto extends GeneratedWellActivityDto { + @Override public void registerDecorator(Decorator decorator) { super.registerDecorator(decorator); @@ -36,4 +37,9 @@ public class WellActivityDto extends GeneratedWellActivityDto { DecoratorProvider.registerDecorator(ActivityStubDto.class, decorator.getLocale(), activity); } } + + @Override + public Float getComputedTotalWeight() { + return (float)getWellActivitySpecies().stream().mapToDouble(WellActivitySpeciesDto::getWeight).sum(); + } } ===================================== core/services/i18n/src/main/i18n/translations/services_en_GB.properties ===================================== @@ -1227,6 +1227,8 @@ observe.data.ps.logbook.WellActivity.action.save=Insert observe.data.ps.logbook.WellActivity.action.save.tip=Insert the well activity observe.data.ps.logbook.WellActivity.activity=Activity observe.data.ps.logbook.WellActivity.activity.short=Activity +observe.data.ps.logbook.WellActivity.computedTotalWeight=Total weight (in t) +observe.data.ps.logbook.WellActivity.computedTotalWeight.short=Total weight (in t) observe.data.ps.logbook.WellActivity.title=Well activity observe.data.ps.logbook.WellActivity.type=Well activity observe.data.ps.logbook.WellActivity.wellActivitySpecies=Well activity species ===================================== core/services/i18n/src/main/i18n/translations/services_es_ES.properties ===================================== @@ -1227,6 +1227,8 @@ observe.data.ps.logbook.WellActivity.action.save=Insert observe.data.ps.logbook.WellActivity.action.save.tip=Insert the well activity observe.data.ps.logbook.WellActivity.activity=Activity observe.data.ps.logbook.WellActivity.activity.short=Activity +observe.data.ps.logbook.WellActivity.computedTotalWeight=Peso (en t) +observe.data.ps.logbook.WellActivity.computedTotalWeight.short=Peso (en t) observe.data.ps.logbook.WellActivity.title=Well activity observe.data.ps.logbook.WellActivity.type=Well activity observe.data.ps.logbook.WellActivity.wellActivitySpecies=Well activity species ===================================== core/services/i18n/src/main/i18n/translations/services_fr_FR.properties ===================================== @@ -1227,6 +1227,8 @@ observe.data.ps.logbook.WellActivity.action.save=Insérer observe.data.ps.logbook.WellActivity.action.save.tip=Insérer cette cuve-calée observe.data.ps.logbook.WellActivity.activity=Activité observe.data.ps.logbook.WellActivity.activity.short=Activité +observe.data.ps.logbook.WellActivity.computedTotalWeight=Poids total (en t) +observe.data.ps.logbook.WellActivity.computedTotalWeight.short=Poids total (en t) observe.data.ps.logbook.WellActivity.title=Cuve-calée observe.data.ps.logbook.WellActivity.type=Cuve-calée observe.data.ps.logbook.WellActivity.wellActivitySpecies=Espèces ===================================== model/src/main/models/Observe/dto/21-data-ps-logbook.model ===================================== @@ -143,6 +143,7 @@ wellActivity + {*} data.ps.logbook.WellActivity data.ps.logbook.WellActivity > data.ContainerChild >> data.ps.logbook.ActivityLabelAware activity {*:1} data.ps.logbook.ActivityStub wellActivitySpecies + {*} data.ps.logbook.WellActivitySpecies +computedTotalWeight Float data.ps.logbook.WellActivitySpecies > data.Data >> data.InlineDataDto species {*:1} referential.common.SpeciesReference ===================================== model/src/main/models/Observe/dto/class/containerChildDataDtoProperties.properties ===================================== @@ -41,7 +41,7 @@ data.ps.localmarket.Batch=species,packaging,count,weight data.ps.localmarket.SampleSpecies=species,sizeMeasureType,measuredCount,comment data.ps.logbook.Catch=species,weightCategory,speciesFate,well,weight,count,comment data.ps.logbook.SampleSpecies=subSampleNumber,species,sizeMeasureType,measuredCount,totalCount,comment -data.ps.logbook.WellActivity=activity,wellActivitySpecies +data.ps.logbook.WellActivity=activity,wellActivitySpecies,computedTotalWeight data.ps.observation.Catch=species,speciesFate,reasonForDiscard,catchWeight,totalCount,weightMeasureMethod,minWeight,maxWeight,meanWeight,meanLength,well,informationSource,comment data.ps.observation.NonTargetCatchRelease=species,sex,speciesGroupReleaseMode,conformity,releasingTime,length,comment data.ps.observation.ObjectObservedSpecies=species,speciesStatus,count ===================================== model/src/main/models/Observe/dto/class/i18nLabels.properties ===================================== @@ -82,7 +82,7 @@ data.ps.logbook.SampleSpecies=comment,measuredCount,sampleSpeciesMeasure,sizeMea data.ps.logbook.SampleSpeciesMeasure=count,sizeClass data.ps.logbook.TransmittingBuoy=comment,code,transmittingBuoyOwnership,transmittingBuoyType,transmittingBuoyOperation,country,vessel,latitude,longitude,quadrant data.ps.logbook.Well=well,wellVessel,wellFactory,wellSamplingConformity,wellSamplingStatus,generalTab,wellActivityTab,action.save,action.save.tip,wellVessel.short,wellFactory.short,wellAlternativeNumbering -data.ps.logbook.WellActivity=activity,wellActivitySpecies +data.ps.logbook.WellActivity=activity,wellActivitySpecies,computedTotalWeight,computedTotalWeight.short data.ps.logbook.WellActivitySpecies=species,weight,weightCategory,count,setSpeciesNumber data.ps.observation.Activity=date,coordinate,observedSystem.available,observedSystem.selected,comment,comment2,currentFpaZone,dataQuality,detectionMode,ersId,floatingObjectEmpty,latitude,longitude,nextFpaZone,nonTargetCatchSpecies,observedSystem,observedSystemDistance,previousFpaZone,quadrant,reasonForNoFishing,seaSurfaceTemperature,surroundingActivity,time,vesselActivity,vesselSpeed,wind,generalTab,error.no.activity.6,measurementsTab,observedSystemTab data.ps.observation.Catch=catchWeight,catchWeightTotalCount,meanWeightMeanLength,comment,informationSource,sizeMeasureMethod,meanLength,minWeight,maxWeight,meanWeight,minMaxWeight,reasonForDiscard,species,speciesFate,totalCount,weightMeasureMethod,well,catchWeightComputed.computed.tip,catchWeightComputed.observed.tip,meanLengthComputed.computed.tip,meanLengthComputed.observed.tip,meanWeightComputed.computed.tip,meanWeightComputed.observed.tip,totalCountComputed.computed.tip,totalCountComputed.observed.tip,meanLengthComputedSource,totalCountComputedSource,meanWeightComputedSource View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/3614488d9ee2bbd5e3250fb3c3... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/3614488d9ee2bbd5e3250fb3c3... You're receiving this email because of your account on gitlab.com.