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 2e6ff3433686a192088c728b840ad89abda8b904 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Feb 19 17:07:56 2015 +0100 import des opérations --- .../consumer/CsvConsumerForOperation.java | 49 ++- .../service/genericformat/csv/OperationModel.java | 34 +-- .../service/genericformat/csv/OperationRow.java | 340 +++++++++++++-------- .../producer/CsvProducerForOperation.java | 1 + 4 files changed, 277 insertions(+), 147 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/consumer/CsvConsumerForOperation.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/consumer/CsvConsumerForOperation.java index 7669392..84b3859 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/consumer/CsvConsumerForOperation.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/consumer/CsvConsumerForOperation.java @@ -1,5 +1,6 @@ package fr.ifremer.tutti.service.genericformat.consumer; +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.service.ValidationService; @@ -25,22 +26,27 @@ public class CsvConsumerForOperation extends CsvComsumer<OperationRow, Operation super(file, OperationModel.forImport(separator, parserFactory)); } - public void checkRow(ImportRow<OperationRow> row, GenericFormatImportContext importContext, ValidationService validationService) { + public void validateRow(ImportRow<OperationRow> row, GenericFormatImportContext importContext, ValidationService validationService) { if (row.isValid()) { OperationRow bean = row.getBean(); + FishingOperation fishingOperation = bean.getFishingOperation(); + Cruise importedCruise = importContext.getImportedCruise(bean.getCruise()); if (importedCruise == null) { addCheckError(row, new CruiseNotFoundException(bean.getCruise())); + } else if (importContext.isFishingOperationAlreadyImported(fishingOperation)) { + + addCheckError(row, new FishingOperationAlreadyImportedException(fishingOperation)); + } else { bean.setCruise(importedCruise); - FishingOperation fishingOperation = bean.getFishingOperation(); NuitonValidatorResult validatorResult = validationService.validateEditFishingOperation(fishingOperation); if (validatorResult.hasFatalMessages() || validatorResult.hasErrorMessagess()) { @@ -59,4 +65,43 @@ public class CsvConsumerForOperation extends CsvComsumer<OperationRow, Operation } + public void prepareRowForPersist(ImportRow<OperationRow> row) { + + OperationRow bean = row.getBean(); + + CatchBatch catchBatch = bean.getCatchBatch(); + + if (bean.isCatchTotalWeightComputed()) { + catchBatch.setCatchTotalWeight(null); + } + if (bean.isCatchTotalRejectedWeightComputed()) { + catchBatch.setCatchTotalRejectedWeight(null); + } + + if (bean.isSpeciesTotalSortedWeightComputed()) { + catchBatch.setSpeciesTotalSortedWeight(null); + } + if (bean.isSpeciesTotalInertWeightComputed()) { + catchBatch.setSpeciesTotalInertWeight(null); + } + if (bean.isSpeciesTotalLivingNotItemizedWeightComputed()) { + catchBatch.setSpeciesTotalLivingNotItemizedWeight(null); + } + + if (bean.isBenthosTotalSortedWeightComputed()) { + catchBatch.setBenthosTotalSortedWeight(null); + } + if (bean.isBenthosTotalInertWeightComputed()) { + catchBatch.setBenthosTotalInertWeight(null); + } + if (bean.isBenthosTotalLivingNotItemizedWeightComputed()) { + catchBatch.setBenthosTotalLivingNotItemizedWeight(null); + } + + if (bean.isMarineLitterTotalWeightComputed()) { + catchBatch.setMarineLitterTotalWeight(null); + } + + } + } \ No newline at end of file diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationModel.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationModel.java index 80acad7..9548096 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationModel.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationModel.java @@ -201,16 +201,16 @@ public class OperationModel extends AbstractTuttiImportExportModel<OperationRow> newMandatoryColumn("Commentaire", FishingOperation.PROPERTY_COMMENT, TuttiCsvUtil.COMMENT_PARSER_FORMATTER); newMandatoryColumn("Poids_Total", OperationRow.PROPERTY_CATCH_TOTAL_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); - newIgnoredColumn("Poids_Total_Calcule"); + newMandatoryColumn("Poids_Total_Calcule", OperationRow.PROPERTY_CATCH_TOTAL_WEIGHT_COMPUTED, TuttiCsvUtil.PRIMITIVE_BOOLEAN); - newMandatoryColumn("Poids_Total_Vrac", OperationRow.PROPERTY_CATCH_TOTAL_SORTED_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); + newIgnoredColumn("Poids_Total_Vrac"); newIgnoredColumn("Poids_Total_Vrac_Calcule"); - newMandatoryColumn("Poids_Total_HorsVrac", OperationRow.PROPERTY_CATCH_TOTAL_UNSORTED_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); + newIgnoredColumn("Poids_Total_HorsVrac"); newIgnoredColumn("Poids_Total_HorsVrac_Calcule"); newMandatoryColumn("Poids_Total_Non_Trie", OperationRow.PROPERTY_CATCH_TOTAL_REJECTED_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); - newIgnoredColumn("Poids_Total_Non_Trie_Calcule"); + newMandatoryColumn("Poids_Total_Non_Trie_Calcule", OperationRow.PROPERTY_CATCH_TOTAL_REJECTED_WEIGHT_COMPUTED, TuttiCsvUtil.PRIMITIVE_BOOLEAN); newMandatoryColumn("Poids_Total_Tremis", OperationRow.PROPERTY_CATCH_TOTAL_SORTED_TREMIS_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); newIgnoredColumn("Poids_Total_Tremis_Calcule"); @@ -218,44 +218,44 @@ public class OperationModel extends AbstractTuttiImportExportModel<OperationRow> newMandatoryColumn("Poids_Total_Carroussel", OperationRow.PROPERTY_CATCH_TOTAL_SORTED_CAROUSSEL_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); newIgnoredColumn("Poids_Total_Carroussel_Calcule"); - newMandatoryColumn("Poids_Total_Espece", OperationRow.PROPERTY_SPECIES_TOTAL_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); + newIgnoredColumn("Poids_Total_Espece"); newIgnoredColumn("Poids_Total_Espece_Calcule"); newMandatoryColumn("Poids_Total_Espece_Vrac", OperationRow.PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); - newIgnoredColumn("Poids_Total_Espece_Vrac_Calcule"); + newMandatoryColumn("Poids_Total_Espece_Vrac_Calcule", OperationRow.PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT_COMPUTED, TuttiCsvUtil.PRIMITIVE_BOOLEAN); - newMandatoryColumn("Poids_Total_Espece_Vrac_Trie", OperationRow.PROPERTY_SPECIES_TOTAL_SAMPLE_SORTED_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); + newIgnoredColumn("Poids_Total_Espece_Vrac_Trie"); newIgnoredColumn("Poids_Total_Espece_Vrac_Trie_Calcule"); - newMandatoryColumn("Poids_Total_Espece_HorsVrac", OperationRow.PROPERTY_SPECIES_TOTAL_UNSORTED_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); + newIgnoredColumn("Poids_Total_Espece_HorsVrac"); newIgnoredColumn("Poids_Total_Espece_HorsVrac_Calcule"); newMandatoryColumn("Poids_Total_Espece_Inerte_Trie", OperationRow.PROPERTY_SPECIES_TOTAL_INERT_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); - newIgnoredColumn("Poids_Total_Espece_Inerte_Trie_Calcule"); + newMandatoryColumn("Poids_Total_Espece_Inerte_Trie_Calcule", OperationRow.PROPERTY_SPECIES_TOTAL_INERT_WEIGHT_COMPUTED, TuttiCsvUtil.PRIMITIVE_BOOLEAN); newMandatoryColumn("Poids_Total_Espece_Vivant_non_detaille_trie", OperationRow.PROPERTY_SPECIES_TOTAL_LIVING_NOT_ITEMIZED_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); - newIgnoredColumn("Poids_Total_Espece_Vivant_non_detaille_trie_Calcule"); + newMandatoryColumn("Poids_Total_Espece_Vivant_non_detaille_trie_Calcule", OperationRow.PROPERTY_SPECIES_TOTAL_LIVING_NOT_ITEMIZED_WEIGHT_COMPUTED, TuttiCsvUtil.PRIMITIVE_BOOLEAN); - newMandatoryColumn("Poids_Total_Benthos", OperationRow.PROPERTY_BENTHOS_TOTAL_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); + newIgnoredColumn("Poids_Total_Benthos"); newIgnoredColumn("Poids_Total_Benthos_Calcule"); newMandatoryColumn("Poids_Total_Benthos_Vrac", OperationRow.PROPERTY_BENTHOS_TOTAL_SORTED_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); - newIgnoredColumn("Poids_Total_Benthos_Vrac_Calcule"); + newMandatoryColumn("Poids_Total_Benthos_Vrac_Calcule", OperationRow.PROPERTY_BENTHOS_TOTAL_SORTED_WEIGHT_COMPUTED, TuttiCsvUtil.PRIMITIVE_BOOLEAN); - newMandatoryColumn("Poids_Total_Benthos_Vrac_Trie", OperationRow.PROPERTY_BENTHOS_TOTAL_SAMPLE_SORTED_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); + newIgnoredColumn("Poids_Total_Benthos_Vrac_Trie"); newIgnoredColumn("Poids_Total_Benthos_Vrac_Trie_Calcule"); - newMandatoryColumn("Poids_Total_Benthos_HorsVrac", OperationRow.PROPERTY_BENTHOS_TOTAL_UNSORTED_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); + newIgnoredColumn("Poids_Total_Benthos_HorsVrac"); newIgnoredColumn("Poids_Total_Benthos_HorsVrac_Calcule"); newMandatoryColumn("Poids_Total_Benthos_Inerte_Trie", OperationRow.PROPERTY_BENTHOS_TOTAL_INERT_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); - newIgnoredColumn("Poids_Total_Benthos_Inerte_Trie_Calcule"); + newMandatoryColumn("Poids_Total_Benthos_Inerte_Trie_Calcule", OperationRow.PROPERTY_BENTHOS_TOTAL_INERT_WEIGHT_COMPUTED, TuttiCsvUtil.PRIMITIVE_BOOLEAN); newMandatoryColumn("Poids_Total_Benthos_Vivant_non_detaille_trie", OperationRow.PROPERTY_BENTHOS_TOTAL_LIVING_NOT_ITEMIZED_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); - newIgnoredColumn("Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule"); + newMandatoryColumn("Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule", OperationRow.PROPERTY_BENTHOS_TOTAL_LIVING_NOT_ITEMIZED_WEIGHT_COMPUTED, TuttiCsvUtil.PRIMITIVE_BOOLEAN); newMandatoryColumn("Poids_Total_Macro_Dechet", OperationRow.PROPERTY_MARINE_LITTER_TOTAL_WEIGHT, TuttiCsvUtil.WEIGHT_NULL_TO_9); - newIgnoredColumn("Poids_Total_Macro_Dechet_Calcule"); + newMandatoryColumn("Poids_Total_Macro_Dechet_Calcule", OperationRow.PROPERTY_MARINE_LITTER_TOTAL_WEIGHT_COMPUTED, TuttiCsvUtil.PRIMITIVE_BOOLEAN); newMandatoryColumn("Serie_Id", Cruise.PROPERTY_PROGRAM, parserFactory.getProgramParser()); newMandatoryColumn("Navire_Id", FishingOperation.PROPERTY_VESSEL, parserFactory.getVesselParser()); diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationRow.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationRow.java index c89b244..8dcd49c 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationRow.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/csv/OperationRow.java @@ -22,12 +22,11 @@ package fr.ifremer.tutti.service.genericformat.csv; * #L% */ -import fr.ifremer.tutti.persistence.entities.CaracteristicMap; import fr.ifremer.tutti.persistence.entities.data.CatchBatch; +import fr.ifremer.tutti.persistence.entities.data.CatchBatchs; import fr.ifremer.tutti.persistence.entities.data.Cruise; import fr.ifremer.tutti.persistence.entities.data.FishingOperation; import fr.ifremer.tutti.persistence.entities.data.Program; -import fr.ifremer.tutti.persistence.entities.referential.Caracteristic; import fr.ifremer.tutti.persistence.entities.referential.Gear; import fr.ifremer.tutti.persistence.entities.referential.Person; import fr.ifremer.tutti.persistence.entities.referential.TuttiLocation; @@ -133,6 +132,24 @@ public class OperationRow implements Serializable { protected CatchBatch catchBatch; + protected boolean catchTotalWeightComputed; + + protected boolean catchTotalRejectedWeightComputed; + + protected boolean speciesTotalSortedWeightComputed; + + protected boolean speciesTotalInertWeightComputed; + + protected boolean speciesTotalLivingNotItemizedWeightComputed; + + protected boolean benthosTotalSortedWeightComputed; + + protected boolean benthosTotalInertWeightComputed; + + protected boolean benthosTotalLivingNotItemizedWeightComputed; + + protected boolean marineLitterTotalWeightComputed; + public void setCruise(Cruise cruise) { this.cruise = cruise; } @@ -150,7 +167,36 @@ public class OperationRow implements Serializable { } public void setCatchBatch(CatchBatch catchBatch) { + + if (catchBatch == null) { + + // Avoid any NPE + catchBatch = CatchBatchs.newCatchBatch(); + } + this.catchBatch = catchBatch; + + } + + public void computeCatchValues() { + + setCatchTotalWeightComputed(Numbers.getValueOrComputedValueComputed(catchBatch.getCatchTotalWeight(), catchBatch.getCatchTotalComputedWeight())); + setCatchTotalRejectedWeightComputed(Numbers.getValueOrComputedValueComputed(catchBatch.getCatchTotalRejectedWeight(), catchBatch.getCatchTotalRejectedComputedWeight())); + + setSpeciesTotalSortedWeightComputed(Numbers.getValueOrComputedValueComputed(catchBatch.getSpeciesTotalSortedWeight(), catchBatch.getSpeciesTotalSortedComputedWeight())); + setSpeciesTotalInertWeightComputed(Numbers.getValueOrComputedValueComputed(catchBatch.getSpeciesTotalInertWeight(), catchBatch.getSpeciesTotalInertComputedWeight())); + setSpeciesTotalLivingNotItemizedWeightComputed(Numbers.getValueOrComputedValueComputed(catchBatch.getSpeciesTotalLivingNotItemizedWeight(), catchBatch.getSpeciesTotalLivingNotItemizedComputedWeight())); + + setBenthosTotalSortedWeightComputed(Numbers.getValueOrComputedValueComputed(catchBatch.getBenthosTotalSortedWeight(), catchBatch.getBenthosTotalSortedComputedWeight())); + setBenthosTotalInertWeightComputed(Numbers.getValueOrComputedValueComputed(catchBatch.getBenthosTotalInertWeight(), catchBatch.getBenthosTotalInertComputedWeight())); + setBenthosTotalLivingNotItemizedWeightComputed(Numbers.getValueOrComputedValueComputed(catchBatch.getBenthosTotalLivingNotItemizedWeight(), catchBatch.getBenthosTotalLivingNotItemizedComputedWeight())); + + setMarineLitterTotalWeightComputed(Numbers.getValueOrComputedValueComputed(catchBatch.getMarineLitterTotalWeight(), catchBatch.getMarineLitterTotalComputedWeight())); + + } + + public CatchBatch getCatchBatch() { + return catchBatch; } public void setBeginDate(Date beginDate) { @@ -245,6 +291,50 @@ public class OperationRow implements Serializable { fishingOperation.setGearShootingStartLatitude(gearShootingStartLatitude); } + public void setBenthosTotalLivingNotItemizedWeight(Float benthosTotalLivingNotItemizedWeight) { + catchBatch.setBenthosTotalLivingNotItemizedWeight(benthosTotalLivingNotItemizedWeight); + } + + public void setCatchTotalRejectedWeight(Float catchTotalRejectedWeight) { + catchBatch.setCatchTotalRejectedWeight(catchTotalRejectedWeight); + } + + public void setMarineLitterTotalWeight(Float marineLitterTotalWeight) { + catchBatch.setMarineLitterTotalWeight(marineLitterTotalWeight); + } + + public void setBenthosTotalInertWeight(Float benthosTotalInertWeight) { + catchBatch.setBenthosTotalInertWeight(benthosTotalInertWeight); + } + + public void setCatchTotalSortedTremisWeight(Float catchTotalSortedTremisWeight) { + catchBatch.setCatchTotalSortedTremisWeight(catchTotalSortedTremisWeight); + } + + public void setCatchTotalWeight(Float catchTotalWeight) { + catchBatch.setCatchTotalWeight(catchTotalWeight); + } + + public void setBenthosTotalSortedWeight(Float benthosTotalSortedWeight) { + catchBatch.setBenthosTotalSortedWeight(benthosTotalSortedWeight); + } + + public void setCatchTotalSortedCarousselWeight(Float catchTotalSortedCarousselWeight) { + catchBatch.setCatchTotalSortedCarousselWeight(catchTotalSortedCarousselWeight); + } + + public void setSpeciesTotalSortedWeight(Float speciesTotalSortedWeight) { + catchBatch.setSpeciesTotalSortedWeight(speciesTotalSortedWeight); + } + + public void setSpeciesTotalLivingNotItemizedWeight(Float speciesTotalLivingNotItemizedWeight) { + catchBatch.setSpeciesTotalLivingNotItemizedWeight(speciesTotalLivingNotItemizedWeight); + } + + public void setSpeciesTotalInertWeight(Float speciesTotalInertWeight) { + catchBatch.setSpeciesTotalInertWeight(speciesTotalInertWeight); + } + public Date getBeginDate() { return cruise.getBeginDate(); } @@ -350,50 +440,20 @@ public class OperationRow implements Serializable { catchBatch.getCatchTotalComputedWeight()); } - public Boolean getCatchTotalWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - catchBatch.getCatchTotalWeight(), - catchBatch.getCatchTotalComputedWeight()); - } - public Float getCatchTotalSortedTremisWeight() { - return Numbers.getValueOrComputedValue( - catchBatch.getCatchTotalSortedTremisWeight(), null); - } - - public Boolean getCatchTotalSortedTremisWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - catchBatch.getCatchTotalSortedTremisWeight(), null); + return catchBatch.getCatchTotalSortedTremisWeight(); } public Float getCatchTotalSortedCarousselWeight() { - return Numbers.getValueOrComputedValue( - catchBatch.getCatchTotalSortedCarousselWeight(), null); - } - - public Boolean getCatchTotalSortedCarousselWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - catchBatch.getCatchTotalSortedCarousselWeight(), null); + return catchBatch.getCatchTotalSortedCarousselWeight(); } public Float getCatchTotalSortedWeight() { - return Numbers.getValueOrComputedValue( - null, catchBatch.getCatchTotalSortedComputedWeight()); - } - - public Boolean getCatchTotalSortedWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - null, catchBatch.getCatchTotalSortedComputedWeight()); + return catchBatch.getCatchTotalSortedComputedWeight(); } public Float getCatchTotalUnsortedWeight() { - return Numbers.getValueOrComputedValue( - null, catchBatch.getCatchTotalUnsortedComputedWeight()); - } - - public Boolean getCatchTotalUnsortedWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - null, catchBatch.getCatchTotalUnsortedComputedWeight()); + return catchBatch.getCatchTotalUnsortedComputedWeight(); } public Float getCatchTotalRejectedWeight() { @@ -402,20 +462,8 @@ public class OperationRow implements Serializable { catchBatch.getCatchTotalRejectedComputedWeight()); } - public Boolean getCatchTotalRejectedWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - catchBatch.getCatchTotalRejectedWeight(), - catchBatch.getCatchTotalRejectedComputedWeight()); - } - public Float getSpeciesTotalWeight() { - return Numbers.getValueOrComputedValue( - null, catchBatch.getSpeciesTotalComputedWeight()); - } - - public Boolean getSpeciesTotalWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - null, catchBatch.getSpeciesTotalComputedWeight()); + return catchBatch.getSpeciesTotalComputedWeight(); } public Float getSpeciesTotalSortedWeight() { @@ -424,20 +472,8 @@ public class OperationRow implements Serializable { catchBatch.getSpeciesTotalSortedComputedWeight()); } - public Boolean getSpeciesTotalSortedWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - catchBatch.getSpeciesTotalSortedWeight(), - catchBatch.getSpeciesTotalSortedComputedWeight()); - } - public Float getSpeciesTotalUnsortedWeight() { - return Numbers.getValueOrComputedValue( - null, catchBatch.getSpeciesTotalUnsortedComputedWeight()); - } - - public Boolean getSpeciesTotalUnsortedWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - null, catchBatch.getSpeciesTotalUnsortedComputedWeight()); + return catchBatch.getSpeciesTotalUnsortedComputedWeight(); } public Float getSpeciesTotalSampleSortedWeight() { @@ -446,9 +482,10 @@ public class OperationRow implements Serializable { catchBatch.getSpeciesTotalSampleSortedComputedWeight()); } - public Boolean getSpeciesTotalSampleSortedWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - null, catchBatch.getSpeciesTotalSampleSortedComputedWeight()); + public Float getSpeciesTotalLivingNotItemizedWeight() { + return Numbers.getValueOrComputedValue( + catchBatch.getSpeciesTotalLivingNotItemizedWeight(), + catchBatch.getSpeciesTotalLivingNotItemizedComputedWeight()); } public Float getSpeciesTotalInertWeight() { @@ -457,105 +494,152 @@ public class OperationRow implements Serializable { catchBatch.getSpeciesTotalInertComputedWeight()); } - public Boolean getSpeciesTotalInertWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - catchBatch.getSpeciesTotalInertWeight(), - catchBatch.getSpeciesTotalInertComputedWeight()); + public Float getBenthosTotalWeight() { + return catchBatch.getBenthosTotalComputedWeight(); } - public Float getSpeciesTotalLivingNotItemizedWeight() { + public Float getBenthosTotalSortedWeight() { return Numbers.getValueOrComputedValue( - catchBatch.getSpeciesTotalLivingNotItemizedWeight(), - catchBatch.getSpeciesTotalLivingNotItemizedComputedWeight()); + catchBatch.getBenthosTotalSortedWeight(), + catchBatch.getBenthosTotalSortedComputedWeight()); } - public Boolean getSpeciesTotalLivingNotItemizedWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - catchBatch.getSpeciesTotalLivingNotItemizedWeight(), - catchBatch.getSpeciesTotalLivingNotItemizedComputedWeight()); + public Float getBenthosTotalUnsortedWeight() { + return catchBatch.getBenthosTotalUnsortedComputedWeight(); } - public Float getBenthosTotalWeight() { + public Float getBenthosTotalInertWeight() { return Numbers.getValueOrComputedValue( - null, catchBatch.getBenthosTotalComputedWeight()); + catchBatch.getBenthosTotalInertWeight(), + catchBatch.getBenthosTotalInertComputedWeight()); } - public Boolean getBenthosTotalWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - null, catchBatch.getBenthosTotalComputedWeight()); + public Float getBenthosTotalSampleSortedWeight() { + return catchBatch.getBenthosTotalSampleSortedComputedWeight(); } - public Float getBenthosTotalSortedWeight() { + public Float getBenthosTotalLivingNotItemizedWeight() { return Numbers.getValueOrComputedValue( - catchBatch.getBenthosTotalSortedWeight(), - catchBatch.getBenthosTotalSortedComputedWeight()); + catchBatch.getBenthosTotalLivingNotItemizedWeight(), + catchBatch.getBenthosTotalLivingNotItemizedComputedWeight()); } - public Boolean getBenthosTotalSortedWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - catchBatch.getBenthosTotalSortedWeight(), - catchBatch.getBenthosTotalSortedComputedWeight()); + public Float getMarineLitterTotalWeight() { + return Numbers.getValueOrComputedValue( + catchBatch.getMarineLitterTotalWeight(), + catchBatch.getMarineLitterTotalComputedWeight()); } - public Float getBenthosTotalUnsortedWeight() { - return Numbers.getValueOrComputedValue( - null, catchBatch.getBenthosTotalUnsortedComputedWeight()); + public boolean isCatchTotalSortedTremisWeightComputed() { + return false; } - public Boolean getBenthosTotalUnsortedWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - null, catchBatch.getBenthosTotalUnsortedComputedWeight()); + public boolean isCatchTotalSortedCarousselWeightComputed() { + return false; } - public Float getBenthosTotalSampleSortedWeight() { - return Numbers.getValueOrComputedValue( - null, catchBatch.getBenthosTotalSampleSortedComputedWeight()); + public boolean isCatchTotalSortedWeightComputed() { + return true; } - public Boolean getBenthosTotalSampleSortedWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - null, catchBatch.getBenthosTotalSampleSortedComputedWeight()); + public boolean isCatchTotalUnsortedWeightComputed() { + return true; } - public Float getBenthosTotalInertWeight() { - return Numbers.getValueOrComputedValue( - catchBatch.getBenthosTotalInertWeight(), - catchBatch.getBenthosTotalInertComputedWeight()); + public boolean isSpeciesTotalWeightComputed() { + return true; } - public Boolean getBenthosTotalInertWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - catchBatch.getBenthosTotalInertWeight(), - catchBatch.getBenthosTotalInertComputedWeight()); + public boolean isSpeciesTotalUnsortedWeightComputed() { + return true; } - public Float getBenthosTotalLivingNotItemizedWeight() { - return Numbers.getValueOrComputedValue( - catchBatch.getBenthosTotalLivingNotItemizedWeight(), - catchBatch.getBenthosTotalLivingNotItemizedComputedWeight()); + public boolean isSpeciesTotalSampleSortedWeightComputed() { + return true; } - public Boolean getBenthosTotalLivingNotItemizedWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - catchBatch.getBenthosTotalLivingNotItemizedWeight(), - catchBatch.getBenthosTotalLivingNotItemizedComputedWeight()); + public boolean isBenthosTotalWeightComputed() { + return true; } - public Float getMarineLitterTotalWeight() { - return Numbers.getValueOrComputedValue( - catchBatch.getMarineLitterTotalWeight(), - catchBatch.getMarineLitterTotalComputedWeight()); + public boolean isBenthosTotalUnsortedWeightComputed() { + return true; } - public Boolean getMarineLitterTotalWeightComputed() { - return Numbers.getValueOrComputedValueComputed( - catchBatch.getMarineLitterTotalWeight(), - catchBatch.getMarineLitterTotalComputedWeight()); + public boolean isBenthosTotalSampleSortedWeightComputed() { + return true; } - protected Serializable getGearUseFeature(Caracteristic caracteristic) { - CaracteristicMap gearUseFeatures = fishingOperation.getGearUseFeatures(); - Serializable serializable = gearUseFeatures == null ? null : gearUseFeatures.get(caracteristic); - return serializable; + public boolean isCatchTotalWeightComputed() { + return catchTotalWeightComputed; } + + public boolean isCatchTotalRejectedWeightComputed() { + return catchTotalRejectedWeightComputed; + } + + public boolean isSpeciesTotalSortedWeightComputed() { + return speciesTotalSortedWeightComputed; + } + + public boolean isSpeciesTotalInertWeightComputed() { + return speciesTotalInertWeightComputed; + } + + public boolean isSpeciesTotalLivingNotItemizedWeightComputed() { + return speciesTotalLivingNotItemizedWeightComputed; + } + + public boolean isBenthosTotalSortedWeightComputed() { + return benthosTotalSortedWeightComputed; + } + + public boolean isBenthosTotalInertWeightComputed() { + return benthosTotalInertWeightComputed; + } + + public boolean isBenthosTotalLivingNotItemizedWeightComputed() { + return benthosTotalLivingNotItemizedWeightComputed; + } + + public boolean isMarineLitterTotalWeightComputed() { + return marineLitterTotalWeightComputed; + } + + public void setCatchTotalWeightComputed(boolean catchTotalWeightComputed) { + this.catchTotalWeightComputed = catchTotalWeightComputed; + } + + public void setCatchTotalRejectedWeightComputed(boolean catchTotalRejectedWeightComputed) { + this.catchTotalRejectedWeightComputed = catchTotalRejectedWeightComputed; + } + + public void setSpeciesTotalSortedWeightComputed(boolean speciesTotalSortedWeightComputed) { + this.speciesTotalSortedWeightComputed = speciesTotalSortedWeightComputed; + } + + public void setSpeciesTotalInertWeightComputed(boolean speciesTotalInertWeightComputed) { + this.speciesTotalInertWeightComputed = speciesTotalInertWeightComputed; + } + + public void setSpeciesTotalLivingNotItemizedWeightComputed(boolean speciesTotalLivingNotItemizedWeightComputed) { + this.speciesTotalLivingNotItemizedWeightComputed = speciesTotalLivingNotItemizedWeightComputed; + } + + public void setBenthosTotalSortedWeightComputed(boolean benthosTotalSortedWeightComputed) { + this.benthosTotalSortedWeightComputed = benthosTotalSortedWeightComputed; + } + + public void setBenthosTotalInertWeightComputed(boolean benthosTotalInertWeightComputed) { + this.benthosTotalInertWeightComputed = benthosTotalInertWeightComputed; + } + + public void setBenthosTotalLivingNotItemizedWeightComputed(boolean benthosTotalLivingNotItemizedWeightComputed) { + this.benthosTotalLivingNotItemizedWeightComputed = benthosTotalLivingNotItemizedWeightComputed; + } + + public void setMarineLitterTotalWeightComputed(boolean marineLitterTotalWeightComputed) { + this.marineLitterTotalWeightComputed = marineLitterTotalWeightComputed; + } + } diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForOperation.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForOperation.java index 3dc0f63..647c949 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForOperation.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForOperation.java @@ -27,6 +27,7 @@ public class CsvProducerForOperation extends CsvProducer<OperationRow, Operation row.setCruise(cruise); row.setFishingOperation(operation); row.setCatchBatch(catchBatch); + row.computeCatchValues(); return row; -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.