This is an automated email from the git hooks/post-receive script. New commit to branch feature/6688 in repository tutti. See http://git.codelutin.com/tutti.git commit f9212e640351b46c4e4005482c144e7481891697 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Feb 21 17:06:52 2015 +0100 import catches (stabilize csv model + do the process math) --- .../GenericFormatImportOperationContext.java | 129 ++++++++++---- .../GenericformatImportPersitenceHelper.java | 111 +++++++++--- .../consumer/CsvConsumerForCatch.java | 191 +++++++++++++++++++++ .../service/genericformat/csv/CatchModel.java | 19 +- .../tutti/service/genericformat/csv/CatchRow.java | 152 +++++++++++----- .../producer/CsvProducerForCatch.java | 17 +- .../GenericFormatExportServiceTest.java | 80 ++++----- 7 files changed, 540 insertions(+), 159 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatImportOperationContext.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatImportOperationContext.java index 9999ca6..5a1d60f 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatImportOperationContext.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatImportOperationContext.java @@ -1,14 +1,17 @@ package fr.ifremer.tutti.service.genericformat; +import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import fr.ifremer.tutti.persistence.entities.CaracteristicMap; import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch; import fr.ifremer.tutti.persistence.entities.data.BenthosBatch; +import fr.ifremer.tutti.persistence.entities.data.BenthosBatchFrequency; import fr.ifremer.tutti.persistence.entities.data.FishingOperation; import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch; import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch; import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch; +import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency; import fr.ifremer.tutti.persistence.entities.referential.Caracteristic; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; @@ -37,13 +40,21 @@ public class GenericFormatImportOperationContext { private final Map<Integer, IndividualObservationBatch> individualObservationBatchesById; - private final Collection<SpeciesBatch> speciesBatches; + private final Map<Integer, SpeciesBatch> vracSpeciesBatches; - private final Collection<BenthosBatch> benthosBatches; + private final Map<Integer, SpeciesBatch> horsVracSpeciesBatches; - private final CaracteristicMap gearUseFeatures; + private final ArrayListMultimap<SpeciesBatch, SpeciesBatchFrequency> speciesFrequencies; - private final CaracteristicMap vesselUseFeatures; + private final Map<Integer, BenthosBatch> vracBenthosBatches; + + private final Map<Integer, BenthosBatch> horsVracBenthosBatches; + + private final ArrayListMultimap<BenthosBatch, BenthosBatchFrequency> benthosFrequencies; + + private final CaracteristicMap fishinOperationGearUseFeatures; + + private final CaracteristicMap fishinOperationVesselUseFeatures; public GenericFormatImportOperationContext(FishingOperation fishingOperation, String fishingOperationLabel) { @@ -52,10 +63,14 @@ public class GenericFormatImportOperationContext { this.marineLitterBatches = new ArrayList<>(); this.accidentalBatchesById = new TreeMap<>(); this.individualObservationBatchesById = new TreeMap<>(); - this.speciesBatches = new ArrayList<>(); - this.benthosBatches = new ArrayList<>(); - this.gearUseFeatures = new CaracteristicMap(); - this.vesselUseFeatures = new CaracteristicMap(); + this.vracSpeciesBatches = new TreeMap<>(); + this.horsVracSpeciesBatches = new TreeMap<>(); + this.speciesFrequencies = ArrayListMultimap.create(); + this.vracBenthosBatches = new TreeMap<>(); + this.horsVracBenthosBatches = new TreeMap<>(); + this.benthosFrequencies = ArrayListMultimap.create(); + this.fishinOperationGearUseFeatures = new CaracteristicMap(); + this.fishinOperationVesselUseFeatures = new CaracteristicMap(); } @@ -68,11 +83,11 @@ public class GenericFormatImportOperationContext { } public boolean withGearFeatures() { - return MapUtils.isNotEmpty(gearUseFeatures); + return MapUtils.isNotEmpty(fishinOperationGearUseFeatures); } public boolean withVesselFeatures() { - return MapUtils.isNotEmpty(vesselUseFeatures); + return MapUtils.isNotEmpty(fishinOperationVesselUseFeatures); } public boolean withMarineLitterBatches() { @@ -87,49 +102,72 @@ public class GenericFormatImportOperationContext { return MapUtils.isNotEmpty(individualObservationBatchesById); } - public boolean withSpeciesBatches() { - return CollectionUtils.isNotEmpty(speciesBatches); + public boolean withSpeciesBatches(boolean vrac) { + return MapUtils.isNotEmpty(getSpeciesBatchMap(vrac)); + } + + public boolean withBenthosBatches(boolean vrac) { + return MapUtils.isNotEmpty(getBenthosBatchMap(vrac)); + } + + public boolean withSpeciesFrequencies() { + return !speciesFrequencies.isEmpty(); + } + + public boolean withBenthosFrequencies() { + return !benthosFrequencies.isEmpty(); } - public boolean withBenthosBatches() { - return CollectionUtils.isNotEmpty(benthosBatches); + public AccidentalBatch getAccidentalBatchById(Integer accidentalBatchId) { + return accidentalBatchesById.get(accidentalBatchId); + } + + public IndividualObservationBatch getIndividualObservationBatchesById(Integer individualObservationBatchId) { + return individualObservationBatchesById.get(individualObservationBatchId); + } + + public SpeciesBatch getSpeciesBatch(boolean vrac, Integer referenceTaxonId) { + return getSpeciesBatchMap(vrac).get(referenceTaxonId); + } + + public BenthosBatch getBenthosBatch(boolean vrac, Integer referenceTaxonId) { + return getBenthosBatchMap(vrac).get(referenceTaxonId); } public void addGearUseFeature(Caracteristic caracteristic, Serializable value) { - gearUseFeatures.put(caracteristic, value); + fishinOperationGearUseFeatures.put(caracteristic, value); } public void addVesselUseFeature(Caracteristic caracteristic, Serializable value) { - vesselUseFeatures.put(caracteristic, value); + fishinOperationVesselUseFeatures.put(caracteristic, value); } public void addMarineLitterBatch(MarineLitterBatch marineLitterBatch) { marineLitterBatches.add(marineLitterBatch); } - public AccidentalBatch getAccidentalBatchById(Integer accidentalBatchId) { - AccidentalBatch result = accidentalBatchesById.get(accidentalBatchId); - return result; - } - public void addAccidentalBatch(Integer batchId, AccidentalBatch accidentalBatch) { accidentalBatchesById.put(batchId, accidentalBatch); } - public IndividualObservationBatch getIndividualObservationBatchesById(Integer individualObservationBatchId) { - return individualObservationBatchesById.get(individualObservationBatchId); - } - public void addIndividualObservationBatch(Integer batchId, IndividualObservationBatch individualObservationBatch) { individualObservationBatchesById.put(batchId, individualObservationBatch); } - public void addSpeciesBatch(SpeciesBatch speciesBatch) { - speciesBatches.add(speciesBatch); + public void addSpeciesBatch(boolean vrac, SpeciesBatch speciesBatch) { + getSpeciesBatchMap(vrac).put(speciesBatch.getSpecies().getReferenceTaxonId(), speciesBatch); + } + + public void addBenthosBatch(boolean vrac, BenthosBatch benthosBatch) { + getBenthosBatchMap(vrac).put(benthosBatch.getSpecies().getReferenceTaxonId(), benthosBatch); + } + + public void addSpeciesFrequency(SpeciesBatch batch, SpeciesBatchFrequency frequency) { + speciesFrequencies.put(batch, frequency); } - public void addBenthosBatch(BenthosBatch benthosBatch) { - benthosBatches.add(benthosBatch); + public void addBenthosFrequency(BenthosBatch batch, BenthosBatchFrequency frequency) { + benthosFrequencies.put(batch, frequency); } public Collection<MarineLitterBatch> getMarineLitterBatches() { @@ -144,20 +182,37 @@ public class GenericFormatImportOperationContext { return ImmutableList.copyOf(individualObservationBatchesById.values()); } - public Collection<SpeciesBatch> getSpeciesBatches() { - return ImmutableList.copyOf(speciesBatches); + public Collection<SpeciesBatch> getSpeciesBatches(boolean vrac) { + return ImmutableSet.copyOf(getSpeciesBatchMap(vrac).values()); } - public Collection<BenthosBatch> getBenthosBatches() { - return ImmutableSet.copyOf(benthosBatches); + public Collection<BenthosBatch> getBenthosBatches(boolean vrac) { + return ImmutableSet.copyOf(getBenthosBatchMap(vrac).values()); } - public CaracteristicMap getGearUseFeatures() { - return gearUseFeatures; + public ArrayListMultimap<BenthosBatch, BenthosBatchFrequency> getBenthosFrequencies() { + return benthosFrequencies; } - public CaracteristicMap getVesselUseFeatures() { - return vesselUseFeatures; + public ArrayListMultimap<SpeciesBatch, SpeciesBatchFrequency> getSpeciesFrequencies() { + return speciesFrequencies; } + + public CaracteristicMap getFishinOperationGearUseFeatures() { + return fishinOperationGearUseFeatures; + } + + public CaracteristicMap getFishinOperationVesselUseFeatures() { + return fishinOperationVesselUseFeatures; + } + + private Map<Integer, SpeciesBatch> getSpeciesBatchMap(boolean vrac) { + return vrac ? vracSpeciesBatches : horsVracSpeciesBatches; + } + + private Map<Integer, BenthosBatch> getBenthosBatchMap(boolean vrac) { + return vrac ? vracBenthosBatches : horsVracBenthosBatches; + } + } diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericformatImportPersitenceHelper.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericformatImportPersitenceHelper.java index f1f8851..409b147 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericformatImportPersitenceHelper.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericformatImportPersitenceHelper.java @@ -1,15 +1,18 @@ package fr.ifremer.tutti.service.genericformat; import com.google.common.base.Predicate; +import com.google.common.collect.ArrayListMultimap; import fr.ifremer.tutti.persistence.entities.CaracteristicMap; import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch; import fr.ifremer.tutti.persistence.entities.data.BenthosBatch; +import fr.ifremer.tutti.persistence.entities.data.BenthosBatchFrequency; import fr.ifremer.tutti.persistence.entities.data.CatchBatch; import fr.ifremer.tutti.persistence.entities.data.Cruise; import fr.ifremer.tutti.persistence.entities.data.FishingOperation; import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch; import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch; import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch; +import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency; import fr.ifremer.tutti.persistence.entities.referential.Gear; import fr.ifremer.tutti.service.PersistenceService; import org.apache.commons.collections4.MapUtils; @@ -18,6 +21,7 @@ import org.apache.commons.logging.LogFactory; import org.nuiton.decorator.Decorator; import java.util.Collection; +import java.util.List; import java.util.Set; /** @@ -68,7 +72,7 @@ public class GenericformatImportPersitenceHelper { if (MapUtils.isNotEmpty(caracteristics)) { if (log.isInfoEnabled()) { - log.info("Persist " + caracteristics.size() + " gear caracteristics for gear: " + gear.getName() + " of cruise: " + cruiseDecorator.toString(cruise)); + log.info("Persist " + caracteristics.size() + " gear caracteristics for gear: " + gear.getName() + " for cruise: " + cruiseDecorator.toString(cruise)); } persistenceService.saveGearCaracteristics(gear, cruise); @@ -82,7 +86,7 @@ public class GenericformatImportPersitenceHelper { public FishingOperation persistFishingOperation(FishingOperation fishingOperation) { if (log.isInfoEnabled()) { - log.info("Persist fishing Operation: " + fishingOperationDecorator.toString(fishingOperation)); + log.info("Persist fishing Operation: " + fishingOperationDecorator.toString(fishingOperation) + " for cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); } FishingOperation savedFishingOperation = persistenceService.createFishingOperation(fishingOperation); @@ -95,7 +99,7 @@ public class GenericformatImportPersitenceHelper { public void persistCatchBatch(CatchBatch catchBatch) { if (log.isInfoEnabled()) { - log.info("Persist catchBatch of fishing Operation: " + fishingOperationDecorator.toString(catchBatch.getFishingOperation())); + log.info("Persist catchBatch of fishing Operation: " + fishingOperationDecorator.toString(catchBatch.getFishingOperation()) + " for cruise: " + cruiseDecorator.toString(catchBatch.getFishingOperation().getCruise())); } persistenceService.createCatchBatch(catchBatch); @@ -117,20 +121,20 @@ public class GenericformatImportPersitenceHelper { if (fishingOperationContext.withGearFeatures()) { - CaracteristicMap gearUseFeatures = fishingOperationContext.getGearUseFeatures(); + CaracteristicMap gearUseFeatures = fishingOperationContext.getFishinOperationGearUseFeatures(); fishingOperation.setGearUseFeatures(gearUseFeatures); if (log.isInfoEnabled()) { - log.info("Persist " + gearUseFeatures.size() + " gear use features of " + fishingOperationContext.getFishingOperationLabel() + " of cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); + log.info("Persist " + gearUseFeatures.size() + " gear use features of " + fishingOperationContext.getFishingOperationLabel() + " for cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); } } if (fishingOperationContext.withVesselFeatures()) { - CaracteristicMap vesselUseFeatures = fishingOperationContext.getVesselUseFeatures(); + CaracteristicMap vesselUseFeatures = fishingOperationContext.getFishinOperationVesselUseFeatures(); fishingOperation.setVesselUseFeatures(vesselUseFeatures); if (log.isInfoEnabled()) { - log.info("Persist " + vesselUseFeatures.size() + " vessel use features of " + fishingOperationContext.getFishingOperationLabel() + " of cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); + log.info("Persist " + vesselUseFeatures.size() + " vessel use features of " + fishingOperationContext.getFishingOperationLabel() + " for cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); } } @@ -153,10 +157,10 @@ public class GenericformatImportPersitenceHelper { for (GenericFormatImportOperationContext fishingOperationContext : fishingOperationContexts) { FishingOperation fishingOperation = fishingOperationContext.getFishingOperation(); - String fishingOperationId = fishingOperation.getId(); +// String fishingOperationId = fishingOperation.getId(); Collection<MarineLitterBatch> marineLitterBatches = fishingOperationContext.getMarineLitterBatches(); if (log.isInfoEnabled()) { - log.info("Persist " + marineLitterBatches.size() + " marine litter(s) of " + fishingOperationContext.getFishingOperationLabel() + " of cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); + log.info("Persist " + marineLitterBatches.size() + " marine litter(s) of " + fishingOperationContext.getFishingOperationLabel() + " for cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); } //FIXME Does not work (all batches are persisted, but the last one only displayed later in application) // persistenceService.createMarineLitterBatches(fishingOperationId, marineLitterBatches); @@ -183,7 +187,7 @@ public class GenericformatImportPersitenceHelper { String fishingOperationId = fishingOperation.getId(); Collection<AccidentalBatch> accidentalBatches = fishingOperationContext.getAccidentalBatches(); if (log.isInfoEnabled()) { - log.info("Persist " + accidentalBatches.size() + " accidental batch(es) of " + fishingOperationContext.getFishingOperationLabel() + " of cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); + log.info("Persist " + accidentalBatches.size() + " accidental batch(es) of " + fishingOperationContext.getFishingOperationLabel() + " for cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); } persistenceService.createAccidentalBatches(fishingOperationId, accidentalBatches); @@ -206,7 +210,7 @@ public class GenericformatImportPersitenceHelper { String fishingOperationId = fishingOperation.getId(); Collection<IndividualObservationBatch> individualObservationBatches = fishingOperationContext.getIndividualObservationBatches(); if (log.isInfoEnabled()) { - log.info("Persist " + individualObservationBatches.size() + " individual observation(s) of " + fishingOperationContext.getFishingOperationLabel() + " of cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); + log.info("Persist " + individualObservationBatches.size() + " individual observation(s) of " + fishingOperationContext.getFishingOperationLabel() + " for cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); } persistenceService.createIndividualObservationBatches(fishingOperationId, individualObservationBatches); @@ -219,7 +223,7 @@ public class GenericformatImportPersitenceHelper { Iterable<GenericFormatImportOperationContext> fishingOperationContexts = importContext.getImportedFishingOperationContexts(new Predicate<GenericFormatImportOperationContext>() { @Override public boolean apply(GenericFormatImportOperationContext input) { - return input.withSpeciesBatches(); + return input.withSpeciesBatches(true) || input.withSpeciesBatches(false); } }); @@ -227,11 +231,43 @@ public class GenericformatImportPersitenceHelper { FishingOperation fishingOperation = fishingOperationContext.getFishingOperation(); String fishingOperationId = fishingOperation.getId(); - Collection<SpeciesBatch> speciesBatches = fishingOperationContext.getSpeciesBatches(); - if (log.isInfoEnabled()) { - log.info("Persist " + speciesBatches.size() + " species batch(es) of " + fishingOperationContext.getFishingOperationLabel() + " of cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); + + if (fishingOperationContext.withSpeciesBatches(true)) { + + Collection<SpeciesBatch> speciesBatches = fishingOperationContext.getSpeciesBatches(true); + if (log.isInfoEnabled()) { + log.info("Persist " + speciesBatches.size() + " VRAC species batch(es) of " + fishingOperationContext.getFishingOperationLabel() + " for cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); + } + persistenceService.createSpeciesBatches(fishingOperationId, speciesBatches); + + } + + if (fishingOperationContext.withSpeciesBatches(false)) { + + Collection<SpeciesBatch> speciesBatches = fishingOperationContext.getSpeciesBatches(false); + if (log.isInfoEnabled()) { + log.info("Persist " + speciesBatches.size() + " HORS VRAC species batch(es) of " + fishingOperationContext.getFishingOperationLabel() + " for cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); + } + persistenceService.createSpeciesBatches(fishingOperationId, speciesBatches); + + } + + if (fishingOperationContext.withSpeciesFrequencies()) { + + ArrayListMultimap<SpeciesBatch, SpeciesBatchFrequency> allFrequencies = fishingOperationContext.getSpeciesFrequencies(); + for (SpeciesBatch benthosBatch : allFrequencies.keySet()) { + + List<SpeciesBatchFrequency> frequencies = allFrequencies.get(benthosBatch); + + String batchId = benthosBatch.getId(); + if (log.isInfoEnabled()) { + log.info("Persist " + frequencies.size() + " frequency(ies) (species batch: " + batchId + ") of " + fishingOperationContext.getFishingOperationLabel() + " for cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); + } + persistenceService.saveSpeciesBatchFrequency(batchId, frequencies); + + } + } - persistenceService.createSpeciesBatches(fishingOperationId, speciesBatches); } @@ -242,7 +278,7 @@ public class GenericformatImportPersitenceHelper { Iterable<GenericFormatImportOperationContext> fishingOperationContexts = importContext.getImportedFishingOperationContexts(new Predicate<GenericFormatImportOperationContext>() { @Override public boolean apply(GenericFormatImportOperationContext input) { - return input.withBenthosBatches(); + return input.withBenthosBatches(true) || input.withBenthosBatches(false); } }); @@ -250,15 +286,46 @@ public class GenericformatImportPersitenceHelper { FishingOperation fishingOperation = fishingOperationContext.getFishingOperation(); String fishingOperationId = fishingOperation.getId(); - Collection<BenthosBatch> benthosBatches = fishingOperationContext.getBenthosBatches(); - if (log.isInfoEnabled()) { - log.info("Persist " + benthosBatches.size() + " benthos batch(es) of " + fishingOperationContext.getFishingOperationLabel() + " of cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); + + if (fishingOperationContext.withBenthosBatches(true)) { + + Collection<BenthosBatch> benthosBatches = fishingOperationContext.getBenthosBatches(true); + if (log.isInfoEnabled()) { + log.info("Persist " + benthosBatches.size() + " VRAC benthos batch(es) of " + fishingOperationContext.getFishingOperationLabel() + " for cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); + } + persistenceService.createBenthosBatches(fishingOperationId, benthosBatches); + + } + + if (fishingOperationContext.withBenthosBatches(false)) { + + Collection<BenthosBatch> benthosBatches = fishingOperationContext.getBenthosBatches(false); + if (log.isInfoEnabled()) { + log.info("Persist " + benthosBatches.size() + " HORS VRAC benthos batch(es) of " + fishingOperationContext.getFishingOperationLabel() + " for cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); + } + persistenceService.createBenthosBatches(fishingOperationId, benthosBatches); + + } + + if (fishingOperationContext.withBenthosFrequencies()) { + + ArrayListMultimap<BenthosBatch, BenthosBatchFrequency> allFrequencies = fishingOperationContext.getBenthosFrequencies(); + for (BenthosBatch benthosBatch : allFrequencies.keySet()) { + + List<BenthosBatchFrequency> frequencies = allFrequencies.get(benthosBatch); + + String batchId = benthosBatch.getId(); + if (log.isInfoEnabled()) { + log.info("Persist " + frequencies.size() + " frequency(ies) (benthos batch: " + batchId + ") of " + fishingOperationContext.getFishingOperationLabel() + " for cruise: " + cruiseDecorator.toString(fishingOperation.getCruise())); + } + persistenceService.saveBenthosBatchFrequency(batchId, frequencies); + + } + } - persistenceService.createBenthosBatches(fishingOperationId, benthosBatches); } } - } diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/consumer/CsvConsumerForCatch.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/consumer/CsvConsumerForCatch.java index 909b6c9..6a6b513 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/consumer/CsvConsumerForCatch.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/consumer/CsvConsumerForCatch.java @@ -1,12 +1,27 @@ package fr.ifremer.tutti.service.genericformat.consumer; +import com.google.common.base.Predicate; +import fr.ifremer.adagio.core.dao.referential.pmfm.QualitativeValueId; +import fr.ifremer.tutti.persistence.entities.data.BenthosBatch; +import fr.ifremer.tutti.persistence.entities.data.BenthosBatchFrequency; +import fr.ifremer.tutti.persistence.entities.data.BenthosBatchFrequencys; +import fr.ifremer.tutti.persistence.entities.data.BenthosBatchs; import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel; +import fr.ifremer.tutti.persistence.entities.data.SpeciesAbleBatch; +import fr.ifremer.tutti.persistence.entities.data.SpeciesAbleBatchs; +import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch; +import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency; +import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequencys; +import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchs; +import fr.ifremer.tutti.persistence.entities.referential.Species; import fr.ifremer.tutti.service.csv.CsvComsumer; import fr.ifremer.tutti.service.genericformat.GenericFormatImportContext; import fr.ifremer.tutti.service.genericformat.GenericFormatImportEntityParserFactory; import fr.ifremer.tutti.service.genericformat.GenericFormatImportOperationContext; import fr.ifremer.tutti.service.genericformat.csv.CatchModel; import fr.ifremer.tutti.service.genericformat.csv.CatchRow; +import fr.ifremer.tutti.service.genericformat.csv.ExportSampleCategory; +import org.apache.commons.lang3.BooleanUtils; import org.nuiton.csv.ImportRow; import java.nio.file.Path; @@ -19,8 +34,19 @@ import java.nio.file.Path; */ public class CsvConsumerForCatch extends CsvComsumer<CatchRow, CatchModel> { + private final Predicate<CatchRow> catchRowVracPredicate; + public CsvConsumerForCatch(Path file, char separator, SampleCategoryModel sampleCategoryModel, GenericFormatImportEntityParserFactory parserFactory) { super(file, CatchModel.forImport(separator, sampleCategoryModel, parserFactory)); + + this.catchRowVracPredicate = new Predicate<CatchRow>() { + @Override + public boolean apply(CatchRow input) { + ExportSampleCategory exportSampleCategory = input.getSampleCategory().get(0); + return QualitativeValueId.SORTED_VRAC.getValue().equals(exportSampleCategory.getCategoryValue()); + } + }; + } public void validateRow(ImportRow<CatchRow> row, GenericFormatImportContext importContext) { @@ -46,6 +72,171 @@ public class CsvConsumerForCatch extends CsvComsumer<CatchRow, CatchModel> { CatchRow bean = row.getBean(); + boolean vrac = catchRowVracPredicate.apply(bean); + bean.setVrac(vrac); + + boolean withFrequency = bean.withFrequency(); + + if (!withFrequency) { + + if (BooleanUtils.toBooleanDefaultIfNull(bean.getBatchNumberComputed(), false)) { + bean.setBatchNumber(null); + } + + } + + if (bean.isBenthos()) { + + BenthosBatch batch = getOrCreateBenthosBatch(fishingOperationContext, bean); + + if (withFrequency) { + + BenthosBatchFrequency frequency = BenthosBatchFrequencys.newBenthosBatchFrequency(); + frequency.setLengthStepCaracteristic(bean.getFrequencyLengthStepCaracteristic()); + frequency.setLengthStep(bean.getFrequencyLengthStep()); + frequency.setWeight(bean.getFrequencyWeight()); + frequency.setNumber(bean.getBatchNumber()); + + fishingOperationContext.addBenthosFrequency(batch, frequency); + + } else { + + batch.setNumber(bean.getBatchNumber()); + + } + + } else { + + SpeciesBatch batch = getOrCreateSpeciesBatch(fishingOperationContext, bean); + + if (withFrequency) { + + SpeciesBatchFrequency frequency = SpeciesBatchFrequencys.newSpeciesBatchFrequency(); + frequency.setLengthStepCaracteristic(bean.getFrequencyLengthStepCaracteristic()); + frequency.setLengthStep(bean.getFrequencyLengthStep()); + frequency.setWeight(bean.getFrequencyWeight()); + frequency.setNumber(bean.getBatchNumber()); + + fishingOperationContext.addSpeciesFrequency(batch, frequency); + + } else { + + batch.setNumber(bean.getBatchNumber()); + + } + + } + + } + + protected BenthosBatch getOrCreateBenthosBatch(GenericFormatImportOperationContext fishingOperationContext, CatchRow bean) { + + Species species = bean.getSpecies(); + boolean vrac = bean.isVrac(); + + BenthosBatch batch = fishingOperationContext.getBenthosBatch(vrac, species.getReferenceTaxonId()); + + if (batch == null) { + + // create root batch + + batch = BenthosBatchs.newBenthosBatch(); + batch.setSpecies(species); + batch.setFishingOperation(fishingOperationContext.getFishingOperation()); + + fishingOperationContext.addBenthosBatch(vrac, batch); + + } + + for (ExportSampleCategory exportSampleCategory : bean.getFilledSampleCategories()) { + + batch = (BenthosBatch) fillBatchCategories(batch, exportSampleCategory); + + } + + return batch; + + } + + protected SpeciesBatch getOrCreateSpeciesBatch(GenericFormatImportOperationContext fishingOperationContext, CatchRow bean) { + + Species species = bean.getSpecies(); + boolean vrac = bean.isVrac(); + + SpeciesBatch batch = fishingOperationContext.getSpeciesBatch(vrac, species.getReferenceTaxonId()); + + if (batch == null) { + + // create root batch + + batch = SpeciesBatchs.newSpeciesBatch(); + batch.setSpecies(species); + batch.setFishingOperation(fishingOperationContext.getFishingOperation()); + + fishingOperationContext.addSpeciesBatch(vrac, batch); + + } + + for (ExportSampleCategory exportSampleCategory : bean.getFilledSampleCategories()) { + + batch = (SpeciesBatch) fillBatchCategories(batch, exportSampleCategory); + + } + + return batch; + + } + + protected void fillBatchCategories(SpeciesAbleBatch batch, CatchRow bean) { + + for (ExportSampleCategory exportSampleCategory : bean.getFilledSampleCategories()) { + batch = fillBatchCategories(batch, exportSampleCategory); + } + + } + + protected SpeciesAbleBatch fillBatchCategories(SpeciesAbleBatch batch, ExportSampleCategory sampleCategory) { + + SpeciesAbleBatch result = null; + + if (batch.getSampleCategoryId() == null) { + + // category not filled in batch, fill it from the incoming category + batch.setSampleCategoryId(sampleCategory.getCategoryId()); + batch.setSampleCategoryValue(sampleCategory.getCategoryValue()); + batch.setSampleCategoryWeight(sampleCategory.getCategoryWeight()); + result = batch; + + } else { + + if (!batch.isChildBatchsEmpty()) { + + // got some childs, try to find a matching one + for (SpeciesAbleBatch childBatch : batch.getChildBatchs()) { + + if (childBatch.getSampleCategoryId().equals(sampleCategory.getCategoryId()) && + childBatch.getSampleCategoryValue().equals(sampleCategory.getCategoryValue())) { + + // matching child + result = childBatch; + break; + } + } + + } + + if (result == null) { + + // add a child + SpeciesAbleBatch childBatch = SpeciesAbleBatchs.createNewChild(batch); + result = fillBatchCategories(childBatch, sampleCategory); + + } + + } + + return result; + } } \ No newline at end of file diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/CatchModel.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/CatchModel.java index e68214f..ae2f448 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/CatchModel.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/CatchModel.java @@ -92,7 +92,7 @@ public class CatchModel extends AbstractTuttiImportExportModel<CatchRow> { newColumnForExport("Code_Espece_Campagne", SpeciesBatch.PROPERTY_SPECIES, TuttiCsvUtil.SPECIES_SURVEY_CODE_FORMATTER); newColumnForExport("Nom_Scientifique", SpeciesBatch.PROPERTY_SPECIES, TuttiCsvUtil.SPECIES_FORMATTER); newColumnForExport("Benthos", CatchRow.PROPOERTY_BENTHOS, TuttiCsvUtil.BOOLEAN); - newColumnForExport("Commentaire", SpeciesBatch.PROPERTY_COMMENT, TuttiCsvUtil.COMMENT_PARSER_FORMATTER); + newColumnForExport("Commentaire", SpeciesBatch.PROPERTY_COMMENT, TuttiCsvUtil.COMMENT_LIST_PARSER_FORMATTER); for (SampleCategoryModelEntry entry : sampleCategoryModel.getCategory()) { @@ -110,14 +110,16 @@ public class CatchModel extends AbstractTuttiImportExportModel<CatchRow> { // mensuration - newNullableColumnForExport("Code_Longueur", CatchRow.FREQUENCY_LENGTH_STEP_CARACTERISTIC, TuttiCsvUtil.CARACTERISTIC_TECHNICAL_FORMATTER); - newNullableColumnForExport("Libelle_Longueur", CatchRow.FREQUENCY_LENGTH_STEP_CARACTERISTIC, TuttiCsvUtil.CARACTERISTIC_FORMATTER); - newNullableColumnForExport("Taille", CatchRow.FREQUENCY_LENGTH_STEP, TuttiCsvUtil.FLOAT); - newNullableColumnForExport("NumOrdre_Taille_H2", CatchRow.FREQUENCY_RANK_ORDER, TuttiCsvUtil.INTEGER); - newNullableColumnForExport("Poids_Classe_Taille", CatchRow.FREQUENCY_WEIGHT, TuttiCsvUtil.FLOAT); + newColumnForExport("Code_Longueur", CatchRow.FREQUENCY_LENGTH_STEP_CARACTERISTIC, TuttiCsvUtil.CARACTERISTIC_TECHNICAL_FORMATTER); + newColumnForExport("Libelle_Longueur", CatchRow.FREQUENCY_LENGTH_STEP_CARACTERISTIC, TuttiCsvUtil.CARACTERISTIC_FORMATTER); + newColumnForExport("Taille", CatchRow.FREQUENCY_LENGTH_STEP, TuttiCsvUtil.FLOAT); + newColumnForExport("NumOrdre_Taille_H2", CatchRow.FREQUENCY_RANK_ORDER, TuttiCsvUtil.INTEGER); + newColumnForExport("Poids_Classe_Taille", CatchRow.FREQUENCY_WEIGHT, TuttiCsvUtil.FLOAT); newNullableColumnForExport("Unite_Taille", CatchRow.FREQUENCY_LENGTH_STEP_CARACTERISTIC + "." + Caracteristic.PROPERTY_UNIT); newNullableColumnForExport("Precision_Mesure", CatchRow.FREQUENCY_LENGTH_STEP_CARACTERISTIC + "." + Caracteristic.PROPERTY_PRECISION, TuttiCsvUtil.FLOAT); - newNullableColumnForExport("Nbr", CatchRow.BATCH_NUMBER, TuttiCsvUtil.INTEGER); + newColumnForExport("Nbr", CatchRow.BATCH_NUMBER, TuttiCsvUtil.INTEGER); + newColumnForExport("Nbr_Calcule", CatchRow.BATCH_NUMBER_COMPUTED, TuttiCsvUtil.BOOLEAN); + newColumnForExport("Poids_Reference", CatchRow.REFERENCE_WEIGHT, TuttiCsvUtil.PRIMITIVE_FLOAT); newColumnForExport("Coef_Elev_Espece_Capture", CatchRow.RAISING_FACTOR, TuttiCsvUtil.PRIMITIVE_FLOAT); @@ -152,7 +154,7 @@ public class CatchModel extends AbstractTuttiImportExportModel<CatchRow> { newIgnoredColumn("Code_Espece_Campagne"); newIgnoredColumn("Nom_Scientifique"); newMandatoryColumn("Benthos", CatchRow.PROPOERTY_BENTHOS, TuttiCsvUtil.BOOLEAN); - newMandatoryColumn("Commentaire", SpeciesBatch.PROPERTY_COMMENT, TuttiCsvUtil.COMMENT_PARSER_FORMATTER); + newMandatoryColumn("Commentaire", SpeciesBatch.PROPERTY_COMMENT, TuttiCsvUtil.COMMENT_LIST_PARSER_FORMATTER); for (SampleCategoryModelEntry entry : sampleCategoryModel.getCategory()) { @@ -178,6 +180,7 @@ public class CatchModel extends AbstractTuttiImportExportModel<CatchRow> { newIgnoredColumn("Unite_Taille"); newIgnoredColumn("Precision_Mesure"); newMandatoryColumn("Nbr", CatchRow.BATCH_NUMBER, TuttiCsvUtil.INTEGER); + newMandatoryColumn("Nbr_Calcule", CatchRow.BATCH_NUMBER_COMPUTED, TuttiCsvUtil.BOOLEAN); newIgnoredColumn("Poids_Reference"); newIgnoredColumn("Coef_Elev_Espece_Capture"); 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 3b874c7..01f1e48 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 @@ -22,11 +22,10 @@ package fr.ifremer.tutti.service.genericformat.csv; * #L% */ -import com.google.common.base.Joiner; import com.google.common.base.Preconditions; -import fr.ifremer.tutti.persistence.entities.data.BenthosBatchFrequency; import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry; -import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency; +import fr.ifremer.tutti.persistence.entities.data.SpeciesAbleBatchFrequency; +import fr.ifremer.tutti.persistence.entities.referential.Caracteristic; import fr.ifremer.tutti.persistence.entities.referential.Species; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -50,15 +49,13 @@ public class CatchRow extends RowWithOperationContextSupport { public static final String PROPOERTY_BENTHOS = "benthos"; - public static final String FREQUENCY_LENGTH_STEP = "frequency.lengthStep"; + public static final String FREQUENCY_LENGTH_STEP = "frequencyLengthStep"; - public static final String FREQUENCY_NUMBER = "frequency.number"; + public static final String FREQUENCY_WEIGHT = "frequencyWeight"; - public static final String FREQUENCY_WEIGHT = "frequency.weight"; + public static final String FREQUENCY_LENGTH_STEP_CARACTERISTIC = "frequencyLengthStepCaracteristic"; - public static final String FREQUENCY_LENGTH_STEP_CARACTERISTIC = "frequency.lengthStepCaracteristic"; - - public static final String FREQUENCY_RANK_ORDER = "frequency.rankOrder"; + public static final String FREQUENCY_RANK_ORDER = "frequencyRankOrder"; public static final String SAMPLE_CATEGORY = "sampleCategory"; @@ -68,6 +65,8 @@ public class CatchRow extends RowWithOperationContextSupport { public static final String BATCH_NUMBER = "batchNumber"; + public static final String BATCH_NUMBER_COMPUTED = "batchNumberComputed"; + public static final String BATCH_WEIGHT_UNIT = "batchWeightUnit"; public static final String FINAL_RAISING_FACTOR = "finalRaisingFactor"; @@ -80,10 +79,6 @@ public class CatchRow extends RowWithOperationContextSupport { protected final List<ExportSampleCategory> sampleCategory = new ArrayList<>(); - protected SpeciesBatchFrequency speciesFrequency; - - protected BenthosBatchFrequency benthosFrequency; - protected Species species; protected Float referenceWeight; @@ -94,13 +89,23 @@ public class CatchRow extends RowWithOperationContextSupport { protected Integer batchNumber; + protected Boolean batchNumberComputed; + protected String batchWeightUnit; protected boolean benthos; protected boolean vrac; - protected final List<String> comment = new ArrayList<>(); + protected Caracteristic frequencyLengthStepCaracteristic; + + protected Float frequencyLengthStep; + + protected Float frequencyWeight; + + protected Integer frequencyRankOrder; + + protected List<String> comment = new ArrayList<>(); public void setBenthos(boolean benthos) { this.benthos = benthos; @@ -122,6 +127,10 @@ public class CatchRow extends RowWithOperationContextSupport { this.batchNumber = batchNumber; } + public void setBatchNumberComputed(Boolean batchNumberComputed) { + this.batchNumberComputed = batchNumberComputed; + } + public void addSampleCategory(ExportSampleCategory sampleCategory) { int order = sampleCategory.getCategoryDef().getOrder(); while (this.sampleCategory.size() <= order) { @@ -130,40 +139,66 @@ public class CatchRow extends RowWithOperationContextSupport { this.sampleCategory.set(order, sampleCategory); } - public void setSpeciesFrequency(SpeciesBatchFrequency speciesFrequency) { - Preconditions.checkNotNull(speciesFrequency); - this.speciesFrequency = speciesFrequency; - this.batchNumber = speciesFrequency.getNumber(); + public void setFrequency(SpeciesAbleBatchFrequency frequency) { + Preconditions.checkNotNull(frequency); + setFrequencyLengthStepCaracteristic(frequency.getLengthStepCaracteristic()); + setFrequencyLengthStep(frequency.getLengthStep()); + setBatchNumber(frequency.getNumber()); + setBatchNumberComputed(false); + setFrequencyRankOrder(frequency.getRankOrder()); + setFrequencyWeight(frequency.getWeight()); } - public void setBenthosFrequency(BenthosBatchFrequency benthosFrequency) { - Preconditions.checkNotNull(benthosFrequency); - this.benthosFrequency = benthosFrequency; - this.batchNumber = benthosFrequency.getNumber(); + public void setFinalRaisingFactor(float finalRaisingFactor) { + this.finalRaisingFactor = finalRaisingFactor; } - public float getFinalRaisingFactor() { - return finalRaisingFactor; + public void setFrequencyLengthStepCaracteristic(Caracteristic frequencyLengthStepCaracteristic) { + this.frequencyLengthStepCaracteristic = frequencyLengthStepCaracteristic; } - public void setFinalRaisingFactor(float finalRaisingFactor) { - this.finalRaisingFactor = finalRaisingFactor; + public void setFrequencyLengthStep(Float frequencyLengthStep) { + this.frequencyLengthStep = frequencyLengthStep; + } + + public void setFrequencyWeight(Float frequencyWeight) { + this.frequencyWeight = frequencyWeight; + } + + public void setFrequencyRankOrder(Integer frequencyRankOrder) { + this.frequencyRankOrder = frequencyRankOrder; } - public Object getFrequency() { - return speciesFrequency == null ? benthosFrequency : speciesFrequency; + public void setSpecies(Species species) { + this.species = species; } public List<ExportSampleCategory> getSampleCategory() { return sampleCategory; } + public float getFinalRaisingFactor() { + return finalRaisingFactor; + } + + public Caracteristic getFrequencyLengthStepCaracteristic() { + return frequencyLengthStepCaracteristic; + } + + public Float getFrequencyLengthStep() { + return frequencyLengthStep; + } + + public Float getFrequencyWeight() { + return frequencyWeight; + } + public Species getSpecies() { return species; } - public void setSpecies(Species species) { - this.species = species; + public Integer getFrequencyRankOrder() { + return frequencyRankOrder; } public Float getReferenceWeight() { @@ -178,6 +213,10 @@ public class CatchRow extends RowWithOperationContextSupport { return batchNumber; } + public Boolean getBatchNumberComputed() { + return batchNumberComputed; + } + public String getBatchWeightUnit() { return batchWeightUnit; } @@ -205,12 +244,11 @@ public class CatchRow extends RowWithOperationContextSupport { result.setCruise(getCruise()); result.setFishingOperation(getFishingOperation()); result.sampleCategory.addAll(sampleCategory); - if (benthosFrequency != null) { - result.setBenthosFrequency(benthosFrequency); - } - if (speciesFrequency != null) { - result.setSpeciesFrequency(speciesFrequency); - } + result.setFrequencyLengthStep(frequencyLengthStep); + result.setFrequencyLengthStepCaracteristic(frequencyLengthStepCaracteristic); + result.setFrequencyRankOrder(frequencyRankOrder); + result.setFrequencyWeight(frequencyWeight); + result.setSpecies(species); result.setRaisingFactor(raisingFactor); result.setReferenceWeight(referenceWeight); @@ -230,22 +268,42 @@ public class CatchRow extends RowWithOperationContextSupport { this.comment.add(safeComment); } - public String getComment() { - String result; - if (comment.isEmpty()) { - result = ""; - } else { - result = Joiner.on('|').join(comment); - } - return result; + public List<String> getComment() { + return comment; + } + + public void setComment(List<String> comment) { + this.comment = comment; + } + + public boolean withFrequency() { + return frequencyLengthStep != null; } public ExportSampleCategory getSampleCategory(SampleCategoryModelEntry sampleCategoryModelEntry) { + int categoryOrder = sampleCategoryModelEntry.getOrder(); - if (sampleCategory.size() < categoryOrder) { - sampleCategory.add(categoryOrder, new ExportSampleCategory()); + if (sampleCategory.size() == categoryOrder) { + ExportSampleCategory exportSampleCategory = new ExportSampleCategory(); + exportSampleCategory.setCategoryDef(sampleCategoryModelEntry); + sampleCategory.add(categoryOrder, exportSampleCategory); } - return sampleCategory.get(categoryOrder); + ExportSampleCategory exportSampleCategory = sampleCategory.get(categoryOrder); + return exportSampleCategory; + + } + + public List<ExportSampleCategory> getFilledSampleCategories() { + + List<ExportSampleCategory> result = new ArrayList<>(); + for (ExportSampleCategory exportSampleCategory : sampleCategory) { + if (exportSampleCategory.getCategoryValue() != null) { + result.add(exportSampleCategory); + + } + } + return result; + } } 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 a68215e..0f234ab 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 @@ -158,6 +158,8 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { Integer number = Numbers.getValueOrComputedValue(speciesBatch.getNumber(), speciesBatch.getComputedNumber()); + Boolean numberComputed = Numbers.getValueOrComputedValueComputed(speciesBatch.getNumber(), + speciesBatch.getComputedNumber()); Integer rankOrder = speciesBatch.getRankOrder(); @@ -169,6 +171,7 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { speciesBatch.getSampleCategoryComputedWeight(), speciesBatch.getWeight(), number, + numberComputed, rankOrder); if (speciesBatch.isChildBatchsEmpty()) { @@ -224,7 +227,7 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { for (SpeciesBatchFrequency batchFrequency : speciesBatchFrequency) { CatchRow row = currentRow.copy(); - row.setSpeciesFrequency(batchFrequency); + row.setFrequency(batchFrequency); rows.add(row); if (!withNoWeightOnFrequencies) { @@ -278,9 +281,10 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { currentRow.addComment(benthosBatch.getComment()); - Integer number = Numbers.getValueOrComputedValue( - benthosBatch.getNumber(), - benthosBatch.getComputedNumber()); + Integer number = Numbers.getValueOrComputedValue(benthosBatch.getNumber(), + benthosBatch.getComputedNumber()); + Boolean numberComputed = Numbers.getValueOrComputedValueComputed(benthosBatch.getNumber(), + benthosBatch.getComputedNumber()); Integer rankOrder = benthosBatch.getRankOrder(); @@ -292,6 +296,7 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { benthosBatch.getSampleCategoryComputedWeight(), benthosBatch.getWeight(), number, + numberComputed, rankOrder); if (benthosBatch.isChildBatchsEmpty()) { @@ -347,7 +352,7 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { for (BenthosBatchFrequency batchFrequency : benthosBatchFrequency) { CatchRow row = currentRow.copy(); - row.setBenthosFrequency(batchFrequency); + row.setFrequency(batchFrequency); rows.add(row); if (!withNoWeightOnFrequencies) { @@ -441,8 +446,10 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { Float sampleCategoryComputedWeight, Float batchWeight, Integer batchNumber, + Boolean batchNumberComputed, Integer batchRankOrder) { currentRow.setBatchNumber(batchNumber); + currentRow.setBatchNumberComputed(batchNumberComputed); ExportSampleCategory<Serializable> sampleCategory = new ExportSampleCategory<>(); diff --git a/tutti-service/src/test/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportServiceTest.java b/tutti-service/src/test/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportServiceTest.java index ea68c51..538e8fe 100644 --- a/tutti-service/src/test/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportServiceTest.java +++ b/tutti-service/src/test/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportServiceTest.java @@ -96,48 +96,48 @@ public class GenericFormatExportServiceTest { "2013;Campagne CGFS;;A;2;1;308;Nombre d'engin - engin - totale - Déclaration d'un professionnel;2.0;VESSEL;CAM-CGFS;2.0"; public static final String CATCH_CONTENT = - "Annee;Serie;Serie_Partielle;Code_Station;Id_Operation;Poche;Engin;Rang_Engin;Code_Taxon;Code_Espece_Campagne;Nom_Scientifique;Benthos;Commentaire;V_HV;Num_Ordre_V_HV_H2;Tot_V_HV;Ech_V_HV;Type_Volume_Poids_V_HV;Unite_Volume_Poids_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;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Matu [...] - "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;1 - Stade 1;1;10.0;5.0;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.0;1;;cm;0.5;5;5.0;20.0;3.0;CAM-CGFS;311;305;300;272;NA\n" + - "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;1 - Stade 1;1;10.0;5.0;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;2;;cm;0.5;2;5.0;20.0;3.0;CAM-CGFS;311;305;300;272;NA\n" + - "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;1 - Stade 1;1;10.0;5.0;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;11.0;3;;cm;0.5;1;5.0;20.0;3.0;CAM-CGFS;311;305;300;272;NA\n" + - "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;3 - Stade 3;3;10.0;;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;11.0;1;;cm;0.5;5;10.0;10.0;1.5;CAM-CGFS;311;305;300;274;NA\n" + - "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Femelle;2;50.0;30.0;Poids;kg;NA;;;;;kg;NA;;;;;kg;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;10.0;1;;cm;;5;30.0;3.3333333;1.6666666;CAM-CGFS;311;305;301;NA;NA\n" + - "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Femelle;2;50.0;30.0;Poids;kg;NA;;;;;kg;NA;;;;;kg;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;11.0;2;;cm;;6;30.0;3.3333333;1.6666666;CAM-CGFS;311;305;301;NA;NA\n" + - "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Femelle;2;50.0;30.0;Poids;kg;NA;;;;;kg;NA;;;;;kg;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;12.0;3;;cm;;7;30.0;3.3333333;1.6666666;CAM-CGFS;311;305;301;NA;NA\n" + - "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;|;Vrac;1;100.0;;Poids;kg;M - Moyen;2;20.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;20.0;5.0;1.0;CAM-CGFS;311;306;NA;NA;NA\n" + - "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;;Hors Vrac;1;20.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;2;20.0;1.0;1.0;CAM-CGFS;310;NA;NA;NA;NA"; + "Annee;Serie;Serie_Partielle;Code_Station;Id_Operation;Poche;Engin;Rang_Engin;Code_Taxon;Code_Espece_Campagne;Nom_Scientifique;Benthos;Commentaire;V_HV;Num_Ordre_V_HV_H2;Tot_V_HV;Ech_V_HV;Type_Volume_Poids_V_HV;Unite_Volume_Poids_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;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Matu [...] + "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;1 - Stade 1;1;10.0;5.0;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.0;1;;cm;0.5;5;N;5.0;20.0;3.0;CAM-CGFS;311;305;300;272;NA\n" + + "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;1 - Stade 1;1;10.0;5.0;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;2;;cm;0.5;2;N;5.0;20.0;3.0;CAM-CGFS;311;305;300;272;NA\n" + + "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;1 - Stade 1;1;10.0;5.0;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;11.0;3;;cm;0.5;1;N;5.0;20.0;3.0;CAM-CGFS;311;305;300;272;NA\n" + + "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;3 - Stade 3;3;10.0;;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;11.0;1;;cm;0.5;5;N;10.0;10.0;1.5;CAM-CGFS;311;305;300;274;NA\n" + + "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Femelle;2;50.0;30.0;Poids;kg;NA;;;;;kg;NA;;;;;kg;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;10.0;1;;cm;;5;N;30.0;3.3333333;1.6666666;CAM-CGFS;311;305;301;NA;NA\n" + + "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Femelle;2;50.0;30.0;Poids;kg;NA;;;;;kg;NA;;;;;kg;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;11.0;2;;cm;;6;N;30.0;3.3333333;1.6666666;CAM-CGFS;311;305;301;NA;NA\n" + + "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Femelle;2;50.0;30.0;Poids;kg;NA;;;;;kg;NA;;;;;kg;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;12.0;3;;cm;;7;N;30.0;3.3333333;1.6666666;CAM-CGFS;311;305;301;NA;NA\n" + + "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;|;Vrac;1;100.0;;Poids;kg;M - Moyen;2;20.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;?;20.0;5.0;1.0;CAM-CGFS;311;306;NA;NA;NA\n" + + "2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;1;11242;;Aaptos;N;;Hors Vrac;1;20.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;2;?;20.0;1.0;1.0;CAM-CGFS;310;NA;NA;NA;NA"; public static final String CATCH_CONTENT_2 = - "Annee;Serie;Serie_Partielle;Code_Station;Id_Operation;Poche;Engin;Rang_Engin;Code_Taxon;Code_Espece_Campagne;Nom_Scientifique;Benthos;Commentaire;V_HV;Num_Ordre_V_HV_H2;Tot_V_HV;Ech_V_HV;Type_Volume_Poids_V_HV;Unite_Volume_Poids_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;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Matu [...] - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;365;;Aequipecten opercularis;N;taxon;Vrac;1;0.005;0.005;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;0.005;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;491;ALLOSPP;Alloteuthis;N;taxon;Vrac;2;0.004;0.004;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;0.004;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;300;;Buccinum undatum;N;taxon;Vrac;3;0.015;0.015;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;0.015;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1811;CALMLYR;Callionymus lyra;N;taxon;Vrac;4;0.07;0.07;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;0.07;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1644;DICELAB;Dicentrarchus labrax;N;taxon;Vrac;5;1.06;1.06;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;36.0;1;;cm;1.0;1;1.06;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1644;DICELAB;Dicentrarchus labrax;N;taxon;Vrac;5;1.06;1.06;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;38.0;2;;cm;1.0;1;1.06;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1362;ENGRENC;Engraulis encrasicolus;N;taxon;Vrac;6;0.038;0.038;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;1;;cm;0.5;2;0.038;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1362;ENGRENC;Engraulis encrasicolus;N;taxon;Vrac;6;0.038;0.038;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;12.5;2;;cm;0.5;1;0.038;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1362;ENGRENC;Engraulis encrasicolus;N;taxon;Vrac;6;0.038;0.038;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;13.0;3;;cm;0.5;1;0.038;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1986;;Limanda limanda;N;taxon;Vrac;7;0.66;0.66;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;25.0;1;;cm;1.0;1;0.66;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1986;;Limanda limanda;N;taxon;Vrac;7;0.66;0.66;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;28.0;2;;cm;1.0;1;0.66;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1986;;Limanda limanda;N;taxon;Vrac;7;0.66;0.66;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;30.0;3;;cm;1.0;1;0.66;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;489;LOLIVUL;Loligo vulgaris;N;taxon;Vrac;8;0.28;0.28;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;302;Longueur du manteau (LM) - individu - manteau - Mesure au cm par un observateur;9.0;1;;cm;1.0;1;0.28;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;489;LOLIVUL;Loligo vulgaris;N;taxon;Vrac;8;0.28;0.28;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;302;Longueur du manteau (LM) - individu - manteau - Mesure au cm par un observateur;10.0;2;;cm;1.0;3;0.28;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;489;LOLIVUL;Loligo vulgaris;N;taxon;Vrac;8;0.28;0.28;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;302;Longueur du manteau (LM) - individu - manteau - Mesure au cm par un observateur;11.0;3;;cm;1.0;2;0.28;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1988;;Microstomus kitt;N;taxon;Vrac;9;0.152;0.152;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;15.0;1;;cm;1.0;1;0.152;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1988;;Microstomus kitt;N;taxon;Vrac;9;0.152;0.152;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;18.0;2;;cm;1.0;1;0.152;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1690;MULLSUR;Mullus surmuletus;N;taxon;Vrac;10;0.036;0.036;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;11.0;1;;cm;1.0;1;0.036;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1978;;Pleuronectes platessa;N;taxon;Vrac;11;0.852;0.852;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;26.0;1;;cm;1.0;1;0.852;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1978;;Pleuronectes platessa;N;taxon;Vrac;11;0.852;0.852;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;30.0;2;;cm;1.0;1;0.852;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1351;SARDPIL;Sardina pilchardus;N;taxon;Vrac;12;0.022;0.022;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;1;;cm;0.5;1;0.022;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1772;SCOMSCO;Scomber scombrus;N;taxon;Vrac;13;0.18;0.18;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;27.0;1;;cm;1.0;1;0.18;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1242;SCYOCAN;Scyliorhinus canicula;N;taxon|categorie_individu;Vrac;14;;;Poids;kg;NA;;;;;kg;Femelle;1;1.0;1.0;Poids;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;51.0;1;;cm;1.0;1;1.0;1.0;1.0;CAM-CGFS;311;NA;301;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1242;SCYOCAN;Scyliorhinus canicula;N;taxon|categorie_individu;Vrac;14;;;Poids;kg;NA;;;;;kg;Femelle;1;1.0;1.0;Poids;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;55.0;2;;cm;1.0;1;1.0;1.0;1.0;CAM-CGFS;311;NA;301;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1662;TRACTRA;Trachurus trachurus;N;taxon|categorie_individu;Vrac;15;;;Poids;kg;P - Petit;1;17908.896;131.12;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;8.0;1;;cm;1.0;1;131.12;136.58502;136.58403;CAM-CGFS;311;307;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1662;TRACTRA;Trachurus trachurus;N;taxon|categorie_individu;Vrac;15;;;Poids;kg;P - Petit;1;17908.896;131.12;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;9.0;2;;cm;1.0;20;131.12;136.58502;136.58403;CAM-CGFS;311;307;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1662;TRACTRA;Trachurus trachurus;N;taxon|categorie_individu;Vrac;15;;;Poids;kg;P - Petit;1;17908.896;131.12;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;10.0;3;;cm;1.0;89;131.12;136.58502;136.58403;CAM-CGFS;311;307;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1662;TRACTRA;Trachurus trachurus;N;taxon|categorie_individu;Vrac;15;;;Poids;kg;P - Petit;1;17908.896;131.12;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;11.0;4;;cm;1.0;5;131.12;136.58502;136.58403;CAM-CGFS;311;307;NA;NA;NA\n" + - "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1662;TRACTRA;Trachurus trachurus;N;taxon|categorie_individu;Vrac;15;;;Poids;kg;G - Gros;2;0.13;0.13;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;23.0;1;;cm;1.0;1;0.13;137761.75;1.0;CAM-CGFS;311;305;NA;NA;NA"; + "Annee;Serie;Serie_Partielle;Code_Station;Id_Operation;Poche;Engin;Rang_Engin;Code_Taxon;Code_Espece_Campagne;Nom_Scientifique;Benthos;Commentaire;V_HV;Num_Ordre_V_HV_H2;Tot_V_HV;Ech_V_HV;Type_Volume_Poids_V_HV;Unite_Volume_Poids_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;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Matu [...] + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;365;;Aequipecten opercularis;N;taxon;Vrac;1;0.005;0.005;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;?;0.005;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;491;ALLOSPP;Alloteuthis;N;taxon;Vrac;2;0.004;0.004;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;?;0.004;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;300;;Buccinum undatum;N;taxon;Vrac;3;0.015;0.015;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;?;0.015;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1811;CALMLYR;Callionymus lyra;N;taxon;Vrac;4;0.07;0.07;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;?;0.07;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1644;DICELAB;Dicentrarchus labrax;N;taxon;Vrac;5;1.06;1.06;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;36.0;1;;cm;1.0;1;N;1.06;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1644;DICELAB;Dicentrarchus labrax;N;taxon;Vrac;5;1.06;1.06;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;38.0;2;;cm;1.0;1;N;1.06;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1362;ENGRENC;Engraulis encrasicolus;N;taxon;Vrac;6;0.038;0.038;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;1;;cm;0.5;2;N;0.038;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1362;ENGRENC;Engraulis encrasicolus;N;taxon;Vrac;6;0.038;0.038;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;12.5;2;;cm;0.5;1;N;0.038;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1362;ENGRENC;Engraulis encrasicolus;N;taxon;Vrac;6;0.038;0.038;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;13.0;3;;cm;0.5;1;N;0.038;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1986;;Limanda limanda;N;taxon;Vrac;7;0.66;0.66;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;25.0;1;;cm;1.0;1;N;0.66;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1986;;Limanda limanda;N;taxon;Vrac;7;0.66;0.66;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;28.0;2;;cm;1.0;1;N;0.66;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1986;;Limanda limanda;N;taxon;Vrac;7;0.66;0.66;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;30.0;3;;cm;1.0;1;N;0.66;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;489;LOLIVUL;Loligo vulgaris;N;taxon;Vrac;8;0.28;0.28;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;302;Longueur du manteau (LM) - individu - manteau - Mesure au cm par un observateur;9.0;1;;cm;1.0;1;N;0.28;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;489;LOLIVUL;Loligo vulgaris;N;taxon;Vrac;8;0.28;0.28;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;302;Longueur du manteau (LM) - individu - manteau - Mesure au cm par un observateur;10.0;2;;cm;1.0;3;N;0.28;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;489;LOLIVUL;Loligo vulgaris;N;taxon;Vrac;8;0.28;0.28;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;302;Longueur du manteau (LM) - individu - manteau - Mesure au cm par un observateur;11.0;3;;cm;1.0;2;N;0.28;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1988;;Microstomus kitt;N;taxon;Vrac;9;0.152;0.152;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;15.0;1;;cm;1.0;1;N;0.152;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1988;;Microstomus kitt;N;taxon;Vrac;9;0.152;0.152;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;18.0;2;;cm;1.0;1;N;0.152;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1690;MULLSUR;Mullus surmuletus;N;taxon;Vrac;10;0.036;0.036;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;11.0;1;;cm;1.0;1;N;0.036;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1978;;Pleuronectes platessa;N;taxon;Vrac;11;0.852;0.852;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;26.0;1;;cm;1.0;1;N;0.852;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1978;;Pleuronectes platessa;N;taxon;Vrac;11;0.852;0.852;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;30.0;2;;cm;1.0;1;N;0.852;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1351;SARDPIL;Sardina pilchardus;N;taxon;Vrac;12;0.022;0.022;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;1;;cm;0.5;1;N;0.022;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1772;SCOMSCO;Scomber scombrus;N;taxon;Vrac;13;0.18;0.18;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;27.0;1;;cm;1.0;1;N;0.18;1.0;1.0;CAM-CGFS;311;NA;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1242;SCYOCAN;Scyliorhinus canicula;N;taxon|categorie_individu;Vrac;14;;;Poids;kg;NA;;;;;kg;Femelle;1;1.0;1.0;Poids;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;51.0;1;;cm;1.0;1;N;1.0;1.0;1.0;CAM-CGFS;311;NA;301;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1242;SCYOCAN;Scyliorhinus canicula;N;taxon|categorie_individu;Vrac;14;;;Poids;kg;NA;;;;;kg;Femelle;1;1.0;1.0;Poids;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;55.0;2;;cm;1.0;1;N;1.0;1.0;1.0;CAM-CGFS;311;NA;301;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1662;TRACTRA;Trachurus trachurus;N;taxon|categorie_individu;Vrac;15;;;Poids;kg;P - Petit;1;17908.896;131.12;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;8.0;1;;cm;1.0;1;N;131.12;136.58502;136.58403;CAM-CGFS;311;307;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1662;TRACTRA;Trachurus trachurus;N;taxon|categorie_individu;Vrac;15;;;Poids;kg;P - Petit;1;17908.896;131.12;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;9.0;2;;cm;1.0;20;N;131.12;136.58502;136.58403;CAM-CGFS;311;307;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1662;TRACTRA;Trachurus trachurus;N;taxon|categorie_individu;Vrac;15;;;Poids;kg;P - Petit;1;17908.896;131.12;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;10.0;3;;cm;1.0;89;N;131.12;136.58502;136.58403;CAM-CGFS;311;307;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1662;TRACTRA;Trachurus trachurus;N;taxon|categorie_individu;Vrac;15;;;Poids;kg;P - Petit;1;17908.896;131.12;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;11.0;4;;cm;1.0;5;N;131.12;136.58502;136.58403;CAM-CGFS;311;307;NA;NA;NA\n" + + "2010;Campagne CGFS;;20;20;1;GOV 19.7/25.9;1;1662;TRACTRA;Trachurus trachurus;N;taxon|categorie_individu;Vrac;15;;;Poids;kg;G - Gros;2;0.13;0.13;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;23.0;1;;cm;1.0;1;N;0.13;137761.75;1.0;CAM-CGFS;311;305;NA;NA;NA"; public static final String MARINE_LITTER_CONTENT = "Annee;Serie;Serie_Partielle;Code_Station;Id_Operation;Poche;Engin;Rang_Engin;Categorie;Categorie_Taille;Nombre;Poids;Commentaire;Serie_Id;Categorie_Id;Categorie_Taille_Id\n" + -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.