branch develop-4.4.x updated (665af62 -> 3c29747)
This is an automated email from the git hooks/post-receive script. New change to branch develop-4.4.x in repository tutti. See http://git.codelutin.com/tutti.git from 665af62 [jgitflow-maven-plugin]Updating develop poms back to pre merge state new 4a20c31 Simplification du code de calcul du raising factor final new 8d60163 Ajout d'un test pour vérifier le calcul du raising factor final new 4ce9f47 Ajout méthode pour récupérer la dernière catégorie renseignée new 687010e Utilisation des bonnes catégories pour compléter le sampleWeight (utilisé pour le calcul du raising factor final) new 609a875 Utilisation des bonnes catégories pour compléter le sampleWeight (utilisé pour le calcul du raising factor final) new 3096c21 Fixes #7992 Merge branch 'feature/7992_erreur_calcul_coef_final' into develop-4.4.x new 99c4242 on ne pousse que les heures et les minutes quand on appelle set...Time (fixes #7996) new 3c29747 Fixes #7996 Merge branch 'feature/7996' into develop-4.4.x The 8 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 3c29747ae78225d80fa378c719e7cc3c9ae7ba47 Merge: 3096c21 99c4242 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Feb 22 16:48:28 2016 +0100 Fixes #7996 Merge branch 'feature/7996' into develop-4.4.x commit 99c424250e2ebe45fcc15b7194dedc1518fb0a99 Author: Kevin Morin <morin@codelutin.com> Date: Mon Feb 22 13:20:28 2016 +0100 on ne pousse que les heures et les minutes quand on appelle set...Time (fixes #7996) commit 3096c21ac50340fcecfecb2ceab3d1f632bb8dde Merge: 665af62 609a875 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Feb 22 16:41:21 2016 +0100 Fixes #7992 Merge branch 'feature/7992_erreur_calcul_coef_final' into develop-4.4.x commit 609a875f256b7003a13221170be6f35361138cc9 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Feb 22 16:41:12 2016 +0100 Utilisation des bonnes catégories pour compléter le sampleWeight (utilisé pour le calcul du raising factor final) commit 687010ea86747dad09d0aa12a23848578f6ffc71 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Feb 22 16:34:54 2016 +0100 Utilisation des bonnes catégories pour compléter le sampleWeight (utilisé pour le calcul du raising factor final) commit 4ce9f47632f8d36ec77bf6b12b2198d397a2305f Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Feb 22 16:34:23 2016 +0100 Ajout méthode pour récupérer la dernière catégorie renseignée commit 8d601630af1faba4d73ee4d4a637296753ac6b11 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Feb 22 16:33:58 2016 +0100 Ajout d'un test pour vérifier le calcul du raising factor final commit 4a20c317c240f5c3448efca6ea23066cdb16c749 Author: Tony CHEMIT <chemit@codelutin.com> Date: Fri Feb 19 07:01:27 2016 +0100 Simplification du code de calcul du raising factor final Summary of changes: .../tutti/service/genericformat/csv/CatchRow.java | 7 ++++ .../producer/CsvProducerForCatch.java | 34 +++++++++++------ ... => GenericFormatExportServiceAno7992Test.java} | 44 ++++++++++++---------- .../resources/genericFormat/ano7992.tuttiProtocol | 22 +++++++++++ .../operation/EditFishingOperationUIHandler.java | 2 +- .../operation/EditFishingOperationUIModel.java | 20 +++++++--- 6 files changed, 92 insertions(+), 37 deletions(-) copy tutti-service/src/test/java/fr/ifremer/tutti/service/genericformat/{GenericFormatExportServiceAno5804Test.java => GenericFormatExportServiceAno7992Test.java} (53%) create mode 100644 tutti-service/src/test/resources/genericFormat/ano7992.tuttiProtocol -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop-4.4.x in repository tutti. See http://git.codelutin.com/tutti.git commit 4a20c317c240f5c3448efca6ea23066cdb16c749 Author: Tony CHEMIT <chemit@codelutin.com> Date: Fri Feb 19 07:01:27 2016 +0100 Simplification du code de calcul du raising factor final --- .../producer/CsvProducerForCatch.java | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java index cbcd40f..cd0e728 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java @@ -84,7 +84,9 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { // see http://forge.codelutin.com/issues/5110 for (CatchRow row : rows) { - float finalRaisingFactor = computeFinalRaisingFactor(row, speciesCatchRaisingFactor, benthosCatchRaisingFactor); + Float raisingFactor = row.isBenthos() ? benthosCatchRaisingFactor : speciesCatchRaisingFactor; + + float finalRaisingFactor = computeFinalRaisingFactor(row, raisingFactor); row.setFinalRaisingFactor(finalRaisingFactor); } @@ -105,6 +107,13 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { addBenthosBatches(operationExportContext, rootBenthosBatch, benthosCatchRaisingFactor, batchWeightUnit, rows); + for (CatchRow row : rows) { + + float finalRaisingFactor = computeFinalRaisingFactor(row, benthosCatchRaisingFactor); + row.setFinalRaisingFactor(finalRaisingFactor); + + } + return rows; } @@ -121,6 +130,13 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { addSpeciesBatches(operationExportContext, rootSpeciesBatch, speciesCatchRaisingFactor, batchWeightUnit, rows); + for (CatchRow row : rows) { + + float finalRaisingFactor = computeFinalRaisingFactor(row, speciesCatchRaisingFactor); + row.setFinalRaisingFactor(finalRaisingFactor); + + } + return rows; } @@ -466,13 +482,13 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { } } - protected float computeFinalRaisingFactor(CatchRow row, Float speciesCatchRaisingFactor, Float benthosCatchRaisingFactor) { + protected float computeFinalRaisingFactor(CatchRow row, Float raisingFactor) { float finalRaisingFactor; if (row.isVrac()) { - finalRaisingFactor = row.isBenthos() ? benthosCatchRaisingFactor : speciesCatchRaisingFactor; + finalRaisingFactor = raisingFactor; } else { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop-4.4.x in repository tutti. See http://git.codelutin.com/tutti.git commit 8d601630af1faba4d73ee4d4a637296753ac6b11 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Feb 22 16:33:58 2016 +0100 Ajout d'un test pour vérifier le calcul du raising factor final --- .../GenericFormatExportServiceAno7992Test.java | 131 +++++++++++++++++++++ .../resources/genericFormat/ano7992.tuttiProtocol | 22 ++++ 2 files changed, 153 insertions(+) diff --git a/tutti-service/src/test/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportServiceAno7992Test.java b/tutti-service/src/test/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportServiceAno7992Test.java new file mode 100644 index 0000000..2455ee0 --- /dev/null +++ b/tutti-service/src/test/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportServiceAno7992Test.java @@ -0,0 +1,131 @@ +package fr.ifremer.tutti.service.genericformat; + +/* + * #%L + * Tutti :: Service + * $Id:$ + * $HeadURL:$ + * %% + * Copyright (C) 2012 - 2014 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import com.google.common.io.Files; +import fr.ifremer.tutti.persistence.ProgressionModel; +import fr.ifremer.tutti.persistence.model.ProgramDataModel; +import fr.ifremer.tutti.service.PersistenceService; +import fr.ifremer.tutti.service.ServiceDbResource; +import fr.ifremer.tutti.service.TuttiServiceContext; +import org.junit.Assert; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Test; + +import java.io.File; +import java.nio.file.Path; + +/** + * Created on 9/22/14. + * + * @author Tony Chemit - chemit@codelutin.com + * @since 4.5 + */ +public class GenericFormatExportServiceAno7992Test { + + @ClassRule + public static final ServiceDbResource dbResource = ServiceDbResource.readDb("dbAno7992"); + + public static final String CATCH_FILE_CONTENT + = "Annee;Serie;Serie_Partielle;Code_Station;Id_Operation;Poche;Code_Taxon;Code_Espece_Campagne;Nom_Scientifique;Benthos;Lot_A_Confirmer;V_HV;Num_Ordre_V_HV_H2;Tot_V_HV;Ech_V_HV;Type_Volume_Poids_V_HV;Unite_Volume_Poids_V_HV;Commentaire_V_HV;Class_Tri;Num_Ordre_Class_Tri_H2;Tot_Class_Tri;Ech_Class_Tri;Type_Volume_Poids_Class_Tri;Unite_Volume_Poids_Class_Tri;Commentaire_Class_Tri;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Commentaire [...] + + "2015;Campagne EVHOE;;T0696;1;1;949;NEPH-NOR;Nephrops norvegicus;N;N;Vrac;1;3.2;;Poids;kg;;NA;;;;;kg;;Male;1;2.54;;Poids;kg;;NA;;;;;kg;;NA;;;;;kg;;;;;;;;;;?;2.54;2.519685;2.3188405;CAM-EVHOE;311;100004;NA;;300;100005;NA;;NA;\n" + + "2015;Campagne EVHOE;;T0696;1;1;949;NEPH-NOR;Nephrops norvegicus;N;N;Vrac;1;3.2;;Poids;kg;;NA;;;;;kg;;Femelle;2;0.22;;Poids;kg;;NA;;;;;kg;;NA;;;;;kg;;;;;;;;;;?;0.22;29.09091;2.3188405;CAM-EVHOE;311;100004;NA;;301;100006;NA;;NA;\n"; + + protected GenericFormatExportService service; + + protected PersistenceService persistenceService; + + protected ServiceDbResource.DataContext dataContext; + + protected ProgressionModel progressionModel; + + protected File dataDirectory; + + public static final String PROGRAM_ID = "CAM-EVHOE"; + + public static final String CRUISE_ID = "100000"; + + public static final String OPERATION_1_ID = "100000"; + + @Before + public void setUp() throws Exception { + + dataDirectory = dbResource.getConfig().getDataDirectory(); + + TuttiServiceContext serviceContext = dbResource.getServiceContext(); + + persistenceService = serviceContext.getService(PersistenceService.class); + + dbResource.loadInternalProtocolFile("genericFormat", "ano7992"); + + dbResource.setCountryInConfig("12"); + dbResource.openDataContext(); + + service = serviceContext.getService(GenericFormatExportService.class); + + dataContext = dbResource.loadContext(PROGRAM_ID, CRUISE_ID, 1, OPERATION_1_ID); + + progressionModel = new ProgressionModel(); + + } + + @Test + public void exportCruise() throws Exception { + + File exportFile = new File(dataDirectory, "exportCruise.zip"); + + Files.createParentDirs(exportFile); + + Assert.assertFalse(exportFile.exists()); + + String programId = dataContext.program.getId(); + String cruiseId = dataContext.cruise.getId(); + + ProgramDataModel dataToExport = persistenceService.loadCruises(programId, true, cruiseId); + + GenericFormatExportConfiguration exportConfiguration = new GenericFormatExportConfiguration(); + exportConfiguration.setExportFile(exportFile); + exportConfiguration.setExportAttachments(false); + exportConfiguration.setExportSpecies(true); + exportConfiguration.setExportBenthos(false); + exportConfiguration.setExportMarineLitter(false); + exportConfiguration.setExportAccidentalCatch(false); + exportConfiguration.setExportIndividualObservation(false); + exportConfiguration.setDataToExport(dataToExport); + + int nbSteps = service.getExportNbSteps(exportConfiguration); + progressionModel.setTotal(nbSteps); + + GenericFormatExportResult exportResult = service.export(exportConfiguration, progressionModel); + Path catchPath = exportResult.getArchive().getCatchPath(); + String catchFileContent = new String(java.nio.file.Files.readAllBytes(catchPath)); + System.out.println("Catch file:\n" + catchFileContent); + + Assert.assertEquals(CATCH_FILE_CONTENT, catchFileContent); + + } + +} diff --git a/tutti-service/src/test/resources/genericFormat/ano7992.tuttiProtocol b/tutti-service/src/test/resources/genericFormat/ano7992.tuttiProtocol new file mode 100644 index 0000000..1f39308 --- /dev/null +++ b/tutti-service/src/test/resources/genericFormat/ano7992.tuttiProtocol @@ -0,0 +1,22 @@ +id: 8dd7864b-c72c-4fef-834e-c2c3bd419abb +name: ano7992 +lengthClassesPmfmId: +- 41 +programId: CAM-EVHOE +species: +- !SpeciesProtocol + calcifySampleEnabled: true + countIfNoFrequencyEnabled: true + lengthStepPmfmId: 41 + mandatorySampleCategoryId: + - 198 + - 196 + - 1682 + - 1702 + - 1478 + - 1418 + - 101 + speciesReferenceTaxonId: 949 + speciesSurveyCode: NEPH-NOR + weightEnabled: true +version: 3 -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop-4.4.x in repository tutti. See http://git.codelutin.com/tutti.git commit 4ce9f47632f8d36ec77bf6b12b2198d397a2305f Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Feb 22 16:34:23 2016 +0100 Ajout méthode pour récupérer la dernière catégorie renseignée --- .../java/fr/ifremer/tutti/service/genericformat/csv/CatchRow.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/CatchRow.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/CatchRow.java index 7dc6dc1..f5fb734 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/CatchRow.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/CatchRow.java @@ -30,6 +30,8 @@ import fr.ifremer.tutti.persistence.entities.referential.Species; import java.util.ArrayList; import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; /** * A row in a catch export. @@ -177,6 +179,11 @@ public class CatchRow extends RowWithOperationContextSupport { return sampleCategory; } + public ExportSampleCategory getLastSampleCategoryFilled() { + List<ExportSampleCategory> list = sampleCategory.stream().filter(Objects::nonNull).collect(Collectors.toList()); + return list.isEmpty() ? null:list.get(list.size()-1); + } + public Float getFinalRaisingFactor() { return finalRaisingFactor; } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop-4.4.x in repository tutti. See http://git.codelutin.com/tutti.git commit 687010ea86747dad09d0aa12a23848578f6ffc71 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Feb 22 16:34:54 2016 +0100 Utilisation des bonnes catégories pour compléter le sampleWeight (utilisé pour le calcul du raising factor final) --- .../tutti/service/genericformat/producer/CsvProducerForCatch.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java index cd0e728..13501b2 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java @@ -320,8 +320,6 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { } else { - int categoryIndex = currentRow.getSampleCategory().size(); - float sampleComputedWeight = 0f; for (SpeciesBatch childBatch : speciesBatch.getChildBatchs()) { @@ -333,7 +331,7 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { childBatch, totalBatchWeight); - ExportSampleCategory exportSampleCategory = childRow.getSampleCategory().get(categoryIndex); + ExportSampleCategory exportSampleCategory = childRow.getLastSampleCategoryFilled(); if (exportSampleCategory != null) { Float categoryWeight = Numbers.getValueOrComputedValue( exportSampleCategory.getCategoryWeight(), @@ -351,7 +349,7 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { sampleComputedWeight += categoryWeight; } } - currentRow.getSampleCategory().get(categoryIndex - 1).setSampleComputedWeight(sampleComputedWeight); + currentRow.getLastSampleCategoryFilled().setSampleComputedWeight(sampleComputedWeight); } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop-4.4.x in repository tutti. See http://git.codelutin.com/tutti.git commit 609a875f256b7003a13221170be6f35361138cc9 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Feb 22 16:41:12 2016 +0100 Utilisation des bonnes catégories pour compléter le sampleWeight (utilisé pour le calcul du raising factor final) --- .../tutti/service/genericformat/producer/CsvProducerForCatch.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java index 13501b2..992a40d 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java @@ -447,8 +447,6 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { } else { - int categoryIndex = currentRow.getSampleCategory().size(); - float sampleComputedWeight = 0f; for (BenthosBatch childBatch : benthosBatch.getChildBatchs()) { @@ -460,7 +458,7 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { childBatch, totalBatchWeight); - ExportSampleCategory exportSampleCategory = childRow.getSampleCategory().get(categoryIndex); + ExportSampleCategory exportSampleCategory = childRow.getLastSampleCategoryFilled(); Float categoryWeight = Numbers.getValueOrComputedValue( exportSampleCategory.getCategoryWeight(), exportSampleCategory.getComputedWeight()); @@ -476,7 +474,7 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { sampleComputedWeight += categoryWeight; } - currentRow.getSampleCategory().get(categoryIndex - 1).setSampleComputedWeight(sampleComputedWeight); + currentRow.getLastSampleCategoryFilled().setSampleComputedWeight(sampleComputedWeight); } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop-4.4.x in repository tutti. See http://git.codelutin.com/tutti.git commit 3096c21ac50340fcecfecb2ceab3d1f632bb8dde Merge: 665af62 609a875 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Feb 22 16:41:21 2016 +0100 Fixes #7992 Merge branch 'feature/7992_erreur_calcul_coef_final' into develop-4.4.x .../tutti/service/genericformat/csv/CatchRow.java | 7 ++ .../producer/CsvProducerForCatch.java | 34 ++++-- .../GenericFormatExportServiceAno7992Test.java | 131 +++++++++++++++++++++ .../resources/genericFormat/ano7992.tuttiProtocol | 22 ++++ 4 files changed, 183 insertions(+), 11 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop-4.4.x in repository tutti. See http://git.codelutin.com/tutti.git commit 99c424250e2ebe45fcc15b7194dedc1518fb0a99 Author: Kevin Morin <morin@codelutin.com> Date: Mon Feb 22 13:20:28 2016 +0100 on ne pousse que les heures et les minutes quand on appelle set...Time (fixes #7996) --- .../operation/EditFishingOperationUIHandler.java | 2 +- .../operation/EditFishingOperationUIModel.java | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java index 0087073..12cc4d3 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java @@ -522,7 +522,7 @@ public class EditFishingOperationUIHandler extends AbstractTuttiTabContainerUIHa listenModelModifiy(vesselUseFeatureModel); setCustomTab(2, vesselUseFeatureModel); - // listen when id becones empty or not toupdate cancel action and button + // listen when id becomes empty or not to update cancel action and button getModel().addPropertyChangeListener( EditFishingOperationUIModel.PROPERTY_ID, new PropertyChangeListener() { diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java index 38282ad..b649bc1 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java @@ -822,16 +822,24 @@ public class EditFishingOperationUIModel extends AbstractTuttiBeanUIModel<Fishin //------------------------------------------------------------------------// public void setGearShootingStartTime(Date gearShootingStartDate) { - Object oldValue = getGearShootingStartDate(); - if (oldValue != null) { - setGearShootingStartDate(gearShootingStartDate); + Date currentGearShootingStartDate = getGearShootingStartDate(); + if (currentGearShootingStartDate != null && gearShootingStartDate != null) { + Calendar currentCalendar = DateUtil.getDefaultCalendar(currentGearShootingStartDate); + Calendar timeCalendar = DateUtil.getDefaultCalendar(gearShootingStartDate); + currentCalendar.set(Calendar.HOUR_OF_DAY, timeCalendar.get(Calendar.HOUR_OF_DAY)); + currentCalendar.set(Calendar.MINUTE, timeCalendar.get(Calendar.MINUTE)); + setGearShootingStartDate(currentCalendar.getTime()); } } public void setGearShootingEndTime(Date gearShootingEndDate) { - Object oldValue = getGearShootingEndDate(); - if (oldValue != null) { - setGearShootingEndDate(gearShootingEndDate); + Date currentGearShootingEndDate = getGearShootingEndDate(); + if (currentGearShootingEndDate != null && gearShootingEndDate != null) { + Calendar currentCalendar = DateUtil.getDefaultCalendar(currentGearShootingEndDate); + Calendar timeCalendar = DateUtil.getDefaultCalendar(gearShootingEndDate); + currentCalendar.set(Calendar.HOUR_OF_DAY, timeCalendar.get(Calendar.HOUR_OF_DAY)); + currentCalendar.set(Calendar.MINUTE, timeCalendar.get(Calendar.MINUTE)); + setGearShootingEndDate(currentCalendar.getTime()); } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop-4.4.x in repository tutti. See http://git.codelutin.com/tutti.git commit 3c29747ae78225d80fa378c719e7cc3c9ae7ba47 Merge: 3096c21 99c4242 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Feb 22 16:48:28 2016 +0100 Fixes #7996 Merge branch 'feature/7996' into develop-4.4.x .../operation/EditFishingOperationUIHandler.java | 2 +- .../operation/EditFishingOperationUIModel.java | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm