Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe Commits: fe3a0569 by Tony Chemit at 2023-03-17T14:19:44+01:00 Champ Vessel.comment non visible sur l'UI - Closes #2648 - - - - - 7f08d92a by Tony Chemit at 2023-03-17T14:56:57+01:00 Impossible de changer la date d'une route - Closes #2653 - - - - - d6c47301 by Tony Chemit at 2023-03-17T14:56:57+01:00 Client Actions - add final duration in last message - - - - - 15 changed files: - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/export/actions/Start.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/save/actions/Start.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/data/actions/Apply.java - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/legacy/actions/SynchroUIActionSupport.java - client/datasource/editor/common/src/main/i18n/getters/jaxx.getter - client/datasource/editor/common/src/main/java/fr/ird/observe/client/datasource/editor/common/referential/common/VesselUI.jaxx - client/runner/src/main/i18n/translations/client-runner_en_GB.properties - client/runner/src/main/i18n/translations/client-runner_es_ES.properties - client/runner/src/main/i18n/translations/client-runner_fr_FR.properties - core/api/dto-decoration/src/main/i18n/getters/labels.getter - core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/observation/RouteTopiaDao.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/class/i18nLabels.properties Changes: ===================================== client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/export/actions/Start.java ===================================== @@ -29,6 +29,8 @@ import fr.ird.observe.client.datasource.api.ObserveSwingDataSource; import fr.ird.observe.client.datasource.api.data.CopyDataTask; import fr.ird.observe.client.datasource.api.data.DataManager; import fr.ird.observe.dto.ProgressionModel; +import io.ultreia.java4all.lang.Strings; +import io.ultreia.java4all.util.TimeLog; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.nuiton.jaxx.runtime.swing.wizard.ext.WizardState; @@ -75,7 +77,7 @@ public class Start extends ExportUIActionSupport { ProgressionModel progressModel = stepModel.getProgressModel(); progressModel.setMaximum(stepCount); progressModel.setValue(0); - + long t00 = TimeLog.getTime(); try (ObserveSwingDataSource localDataSource = openSource(stepModel.getSource())) { progressModel.increments(); try (ObserveSwingDataSource centralDataSource = openSource(stepModel.getCentralSource())) { @@ -84,7 +86,7 @@ public class Start extends ExportUIActionSupport { dataManager.consume(tasks); } } - sendMessage(t("observe.ui.datasource.editor.actions.operation.message.done", new Date())); + sendMessage(t("observe.ui.datasource.editor.actions.operation.message.done", new Date(), Strings.convertTime(TimeLog.getTime() - t00))); log.warn(String.format("Expected count: %d - final step count: %d", stepCount, progressModel.getValue())); return WizardState.SUCCESSED; } ===================================== client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/save/actions/Start.java ===================================== @@ -30,6 +30,8 @@ import fr.ird.observe.client.datasource.api.ObserveSwingDataSource; import fr.ird.observe.datasource.request.CreateDatabaseRequest; import fr.ird.observe.services.service.DataSourceService; import fr.ird.observe.services.service.referential.UnidirectionalSynchronizeContext; +import io.ultreia.java4all.lang.Strings; +import io.ultreia.java4all.util.TimeLog; import io.ultreia.java4all.util.sql.SqlScript; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -78,7 +80,7 @@ public class Start extends SaveLocalUIActionSupport { } openSource(source); - + long t00 = TimeLog.getTime(); if (stepModel.isDoBackup() && source.isLocal()) { sendMessage("Sauvegarde de la base locale vers " + stepModel.getBackupFile()); @@ -95,7 +97,7 @@ public class Start extends SaveLocalUIActionSupport { saveUnidirectionalSynchronizeReferential(); } - sendMessage(t("observe.ui.datasource.editor.actions.operation.message.done", new Date())); + sendMessage(t("observe.ui.datasource.editor.actions.operation.message.done", new Date(), Strings.convertTime(TimeLog.getTime() - t00))); return WizardState.SUCCESSED; } ===================================== client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/data/actions/Apply.java ===================================== @@ -33,6 +33,8 @@ import fr.ird.observe.client.datasource.api.data.TaskSide; import fr.ird.observe.client.datasource.api.data.UserCancelException; import fr.ird.observe.dto.ProgressionModel; import fr.ird.observe.dto.data.RootOpenableDto; +import io.ultreia.java4all.lang.Strings; +import io.ultreia.java4all.util.TimeLog; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.nuiton.jaxx.runtime.swing.wizard.ext.WizardState; @@ -104,11 +106,11 @@ public class Apply extends DataSynchroUIActionSupport { ProgressionModel progressModel = stepModel.getProgressModel(); progressModel.setMaximum(stepCount); DataManager dataManager = new DataManager(progressModel, leftSource, rightSource); - + long t00 = TimeLog.getTime(); progressModel.increments(); try { dataManager.consume(finalTasksToConsume); - sendMessage(t("observe.ui.datasource.editor.actions.operation.message.done", new Date())); + sendMessage(t("observe.ui.datasource.editor.actions.operation.message.done", new Date(), Strings.convertTime(TimeLog.getTime() - t00))); return WizardState.SUCCESSED; } catch (Exception e) { progressModel.increments(); ===================================== client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/legacy/actions/SynchroUIActionSupport.java ===================================== @@ -32,6 +32,8 @@ import fr.ird.observe.services.service.referential.UnidirectionalSynchronizeCont import fr.ird.observe.services.service.referential.UnidirectionalSynchronizeEngine; import fr.ird.observe.services.service.referential.synchro.UnidirectionalCallbackResults; import fr.ird.observe.services.service.referential.synchro.UnidirectionalResult; +import io.ultreia.java4all.lang.Strings; +import io.ultreia.java4all.util.TimeLog; import org.apache.commons.lang3.tuple.Pair; import java.util.Collection; @@ -56,7 +58,7 @@ public abstract class SynchroUIActionSupport extends AdminTabUIActionSupport<Syn UnidirectionalResult referentialSynchronizeResult = engine.prepareResult(referentialSynchronizeContext, referentialSynchronizeCallbackResults); stepModel.setReferentialSynchronizeResult(referentialSynchronizeResult); - + long t00 = TimeLog.getTime(); if (referentialSynchronizeResult.isEmpty()) { //Update lastUpdateDate anyway (See https://gitlab.com/ultreiaio/ird-observe/-/issues/2231) sendMessage(t("observe.ui.datasource.editor.actions.synchro.referential.message.ref.is.updtodate")); @@ -104,6 +106,6 @@ public abstract class SynchroUIActionSupport extends AdminTabUIActionSupport<Syn ui.getModel().getSaveLocalModel().addStepForSave(AdminStep.SYNCHRONIZE); } - sendMessage(t("observe.ui.datasource.editor.actions.operation.message.done", new Date())); + sendMessage(t("observe.ui.datasource.editor.actions.operation.message.done", new Date(), Strings.convertTime(TimeLog.getTime() - t00))); } } ===================================== client/datasource/editor/common/src/main/i18n/getters/jaxx.getter ===================================== @@ -1,4 +1,5 @@ observe.Common.captain +observe.Common.comment observe.Common.coordinate observe.Common.country observe.Common.description @@ -79,6 +80,7 @@ observe.referential.common.Vessel.keelCode observe.referential.common.Vessel.length observe.referential.common.Vessel.lloydId observe.referential.common.Vessel.nationalId +observe.referential.common.Vessel.otherId observe.referential.common.Vessel.powerCv observe.referential.common.Vessel.powerKW observe.referential.common.Vessel.radioCallSignId ===================================== client/datasource/editor/common/src/main/java/fr/ird/observe/client/datasource/editor/common/referential/common/VesselUI.jaxx ===================================== @@ -33,6 +33,7 @@ org.nuiton.jaxx.widgets.number.NumberEditor io.ultreia.java4all.jaxx.widgets.combobox.FilterableComboBox + org.nuiton.jaxx.widgets.text.BigTextEditor org.nuiton.jaxx.widgets.text.NormalTextEditor io.ultreia.java4all.jaxx.widgets.combobox.BeanEnumEditor io.ultreia.java4all.jaxx.widgets.choice.BeanCheckBox @@ -154,6 +155,30 @@ <NumberEditor id='yearService' styleClass="int6"/> <JLabel id='changeDateLabel'/> <DateEditor id='changeDate'/> + <JLabel id='shipOwnerLabel'/> + <FilterableComboBox id='shipOwner' genericType='ShipOwnerReference'/> + </JPanel> + </cell> + </row> + <row> + <cell fill="both" weighty="1" weightx="1"> + <JPanel layout="{new GridLayout(1,0)}"> + <BigTextEditor id="comment"/> + </JPanel> + </cell> + </row> + <row> + <cell weighty="1"> + <JLabel styleClass="skipI18n"/> + </cell> + </row> + </Table> + </tab> + <tab id='otherId' i18nProperty=""> + <Table fill="both"> + <row> + <cell weightx="1"> + <JPanel id="otherIdPanel" _SpringLayout="true"> <JLabel id='iotcIdLabel'/> <NormalTextEditor id='iotcId'/> <JLabel id='comIdLabel'/> @@ -170,8 +195,6 @@ <NormalTextEditor id='tuviId'/> <JLabel id='lloydIdLabel'/> <NormalTextEditor id='lloydId'/> - <JLabel id='shipOwnerLabel'/> - <FilterableComboBox id='shipOwner' genericType='ShipOwnerReference'/> </JPanel> </cell> </row> ===================================== client/runner/src/main/i18n/translations/client-runner_en_GB.properties ===================================== @@ -499,7 +499,7 @@ observe.ui.datasource.editor.actions.consolidate.message.modifications.warning=% observe.ui.datasource.editor.actions.consolidate.message.noChanges=No data modified. observe.ui.datasource.editor.actions.consolidate.message.observation.activity.modification=Some data were computed for Observations activity [%s] %s observe.ui.datasource.editor.actions.consolidate.message.observation.activity.warning=Some warnings were found for Observations activity [%s] %s -observe.ui.datasource.editor.actions.consolidate.message.operation.done=Consolidate operation done in %s (duration\: %s). +observe.ui.datasource.editor.actions.consolidate.message.operation.done=Consolidate operation done at %s (duration\: %s). observe.ui.datasource.editor.actions.consolidate.message.save.changes=Save modified %1$s trip(s). observe.ui.datasource.editor.actions.consolidate.message.trip.modification=Some data were computed for trip [%s] %s observe.ui.datasource.editor.actions.consolidate.message.trip.warning=Some warnings were found for trip [%s] %s @@ -541,7 +541,7 @@ observe.ui.datasource.editor.actions.exportData.title=Export data observe.ui.datasource.editor.actions.exportData.title.tip=Export data observe.ui.datasource.editor.actions.operation.configuration=Configuration of operations observe.ui.datasource.editor.actions.operation.message.canceled=Operation <%1$s> canceled. -observe.ui.datasource.editor.actions.operation.message.done=Operation done at %1$td/%1$tm/%1$tY à %1$tH\:%1$tM\:%1$tS +observe.ui.datasource.editor.actions.operation.message.done=Operation done at %1$td/%1$tm/%1$tY à %1$tH\:%1$tM\:%1$tS (duration\: %s). observe.ui.datasource.editor.actions.operation.message.failed=Operation has failed. observe.ui.datasource.editor.actions.operation.message.needFix=Operation need fix. observe.ui.datasource.editor.actions.operation.message.running=Operation <%1$s> is running... ===================================== client/runner/src/main/i18n/translations/client-runner_es_ES.properties ===================================== @@ -541,7 +541,7 @@ observe.ui.datasource.editor.actions.exportData.title=Exportar los datos observe.ui.datasource.editor.actions.exportData.title.tip=Exportar los datos de usuario observe.ui.datasource.editor.actions.operation.configuration=Configuración de las operaciones observe.ui.datasource.editor.actions.operation.message.canceled=La operación <%1$s> fue cancelada. -observe.ui.datasource.editor.actions.operation.message.done=Operación terminada el %1$td/%1$tm/%1$tY a %1$tH\:%1$tM\:%1$tS +observe.ui.datasource.editor.actions.operation.message.done=Operación terminada el %1$td/%1$tm/%1$tY a %1$tH\:%1$tM\:%1$tS (duration\: %s).. observe.ui.datasource.editor.actions.operation.message.failed=La operación falló observe.ui.datasource.editor.actions.operation.message.needFix=La operación necesita correcciones. observe.ui.datasource.editor.actions.operation.message.running=La operación < %1$s > se está ejecutando... ===================================== client/runner/src/main/i18n/translations/client-runner_fr_FR.properties ===================================== @@ -541,7 +541,7 @@ observe.ui.datasource.editor.actions.exportData.title=Exporter les données observe.ui.datasource.editor.actions.exportData.title.tip=Exporter les données utilisateurs vers une base centrale observe.ui.datasource.editor.actions.operation.configuration=Configuration des opérations observe.ui.datasource.editor.actions.operation.message.canceled=L'opération <%1$s> a été annulée. -observe.ui.datasource.editor.actions.operation.message.done=Opération terminée le %1$td/%1$tm/%1$tY à %1$tH\:%1$tM\:%1$tS +observe.ui.datasource.editor.actions.operation.message.done=Opération terminée le %1$td/%1$tm/%1$tY à %1$tH\:%1$tM\:%1$tS (temps écoulé \: %s). observe.ui.datasource.editor.actions.operation.message.failed=L'opération a échouée observe.ui.datasource.editor.actions.operation.message.needFix=L'opération requière des corrections. observe.ui.datasource.editor.actions.operation.message.running=L'opération < %1$s > est en cours d'exécution... ===================================== core/api/dto-decoration/src/main/i18n/getters/labels.getter ===================================== @@ -1297,6 +1297,7 @@ observe.referential.common.Vessel.keelCodeFlotte observe.referential.common.Vessel.length observe.referential.common.Vessel.lloydId observe.referential.common.Vessel.nationalId +observe.referential.common.Vessel.otherId observe.referential.common.Vessel.powerCv observe.referential.common.Vessel.powerKW observe.referential.common.Vessel.radioCallSignId ===================================== core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/observation/RouteTopiaDao.java ===================================== @@ -27,10 +27,23 @@ import java.util.Objects; public class RouteTopiaDao extends AbstractRouteTopiaDao<Route> { + private static final String UPDATE_SET_DATE_IN_TIMESTAMP = "UPDATE ps_observation.set" + + " SET %1$s = (? || ' ' || %1$s::TIME)::TIMESTAMP" + + " WHERE topiaId IN " + + " (" + + " SELECT s.topiaId" + + " FROM ps_observation.activity a LEFT OUTER JOIN ps_observation.set s ON s.activity = a.topiaId" + + " WHERE a.ROUTE = ? AND s.%1$s IS NOT NULL" + + " );"; + /** - * FIXME PErsistence this request does not works any longer - * To update date part of {@link Set#getHaulingEndTimeStamp()}} and {@link Set#getEndTimeStamp()}} with - * the day date of the route. + * To update date part of + * <ul> + * <li>{@link Set#getHaulingEndTimeStamp()}}</li> + * <li>{@link Set#getHaulingEndTimeStamp()}</li> + * <li>{@link Set#getEndTimeStamp()}}</li> + * </ul> + * with the day date of the route. * * @param routeId id of the route to use * @param date day date to use @@ -41,23 +54,21 @@ public class RouteTopiaDao extends AbstractRouteTopiaDao<Route> { Objects.requireNonNull(routeId, "routeId can't be null"); topiaSqlSupport.doSqlWork(connection -> { - - String sql = "UPDATE ps_observation.set" + - " SET ENDPURSINGTIMESTAMP = (? || ' ' || ENDPURSINGTIMESTAMP::TIME)::TIMESTAMP," + - " ENDSETTIMESTAMP = (? || ' ' || ENDSETTIMESTAMP::TIME)::TIMESTAMP" + - " WHERE TOPIAID IN " + - " (" + - " SELECT s.TOPIAID" + - " FROM ps_observation.activity a, ps_observation.set s" + - " WHERE a.ROUTE = ? AND a.SET = s.TOPIAID" + - " );"; - - PreparedStatement ps = connection.prepareStatement(sql); - ps.setDate(1, date); - ps.setDate(2, date); - ps.setString(3, routeId); - ps.executeUpdate(); - + try (PreparedStatement ps = connection.prepareStatement(String.format(UPDATE_SET_DATE_IN_TIMESTAMP, Set.PROPERTY_END_TIME_STAMP))) { + ps.setDate(1, date); + ps.setString(2, routeId); + ps.executeUpdate(); + } + try (PreparedStatement ps = connection.prepareStatement(String.format(UPDATE_SET_DATE_IN_TIMESTAMP, Set.PROPERTY_HAULING_START_TIME_STAMP))) { + ps.setDate(1, date); + ps.setString(2, routeId); + ps.executeUpdate(); + } + try (PreparedStatement ps = connection.prepareStatement(String.format(UPDATE_SET_DATE_IN_TIMESTAMP, Set.PROPERTY_HAULING_END_TIME_STAMP))) { + ps.setDate(1, date); + ps.setString(2, routeId); + ps.executeUpdate(); + } }); } ===================================== core/services/i18n/src/main/i18n/translations/services_en_GB.properties ===================================== @@ -1562,6 +1562,7 @@ observe.referential.common.Vessel.keelCodeFlotte=Keel / Fleet observe.referential.common.Vessel.length=Length observe.referential.common.Vessel.lloydId=Lloyd Id observe.referential.common.Vessel.nationalId=National id +observe.referential.common.Vessel.otherId=Identifiers observe.referential.common.Vessel.powerCv=Power (Cv) observe.referential.common.Vessel.powerKW=Power (KW) observe.referential.common.Vessel.radioCallSignId=Radio call signal ===================================== core/services/i18n/src/main/i18n/translations/services_es_ES.properties ===================================== @@ -1562,6 +1562,7 @@ observe.referential.common.Vessel.keelCodeFlotte=Código de Quilla / Flota observe.referential.common.Vessel.length=Longitud eslora total observe.referential.common.Vessel.lloydId=Id Lloyd observe.referential.common.Vessel.nationalId=id nacional +observe.referential.common.Vessel.otherId=Identifiers observe.referential.common.Vessel.powerCv=Potencia del motor principal (Cv) observe.referential.common.Vessel.powerKW=Potencia del motor principal (KW) observe.referential.common.Vessel.radioCallSignId=Indicativo radio ===================================== core/services/i18n/src/main/i18n/translations/services_fr_FR.properties ===================================== @@ -1562,6 +1562,7 @@ observe.referential.common.Vessel.keelCodeFlotte=Code quille /Code flotte observe.referential.common.Vessel.length=Longueur hors tout observe.referential.common.Vessel.lloydId=Id Lloyd observe.referential.common.Vessel.nationalId=Id national +observe.referential.common.Vessel.otherId=Identifiants observe.referential.common.Vessel.powerCv=Puissance moteur principal (Cv) observe.referential.common.Vessel.powerKW=Puissance moteur principal (KW) observe.referential.common.Vessel.radioCallSignId=Indicatif radio ===================================== model/src/main/models/Observe/dto/class/i18nLabels.properties ===================================== @@ -114,7 +114,7 @@ referential.common.SizeMeasureType=action.reset.to.default.tip referential.common.Species=faoCode,maxLength,maxWeight,minLength,minWeight,minMaxWeight,ocean,scientificLabel,sizeMeasureType,speciesGroup,weightMeasureType,wormsId,faoAndWormsId,minLengthMax,oceanList,taillePoids.characteristics,generalTab,otherTab,ocean.available,ocean.selected referential.common.SpeciesGroup=speciesGroupReleaseMode,speciesGroupReleaseModeTab,generalTab,speciesGroupReleaseMode.available,speciesGroupReleaseMode.selected referential.common.SpeciesList=species,speciesTab,generalTab,species.available,species.selected -referential.common.Vessel=capacity,changeDate,comId,comment,flagCountry,fleetCountry,iccat,imoId,iotcId,keelCode,length,lloydId,nationalId,powerCv,powerKW,radioCallSignId,searchMaximum,shipOwner,tuviId,vesselSizeCategory,vesselType,wellRegex,wellRegexInformation,yearService,keelCodeFlotte,generalTab,otherTab +referential.common.Vessel=capacity,changeDate,comId,comment,flagCountry,fleetCountry,iccat,imoId,iotcId,keelCode,length,lloydId,nationalId,powerCv,powerKW,radioCallSignId,searchMaximum,shipOwner,tuviId,vesselSizeCategory,vesselType,wellRegex,wellRegexInformation,yearService,keelCodeFlotte,generalTab,otherTab,otherId referential.common.VesselSizeCategory=capacityLabel,gaugeLabel referential.common.WeightMeasureType=action.reset.to.default.tip referential.common.Wind=maxSpeed,maxSwellHeight,minSpeed,minSwellHeight,speedMinMax,swellHeightMinMax View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/d40b98abb7e593db4cb577eb0... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/d40b98abb7e593db4cb577eb0... You're receiving this email because of your account on gitlab.com.