This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 26aea1f72c5760a51dc917ac317041780a1133f7 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Apr 28 12:41:12 2015 +0200 correction du facteur d'elevation pour les export pdf et csv (refs #7021) --- .../tutti/service/export/ExportCatchContext.java | 50 +++++++++++++--------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ExportCatchContext.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ExportCatchContext.java index 51ae285..3a9d6e9 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ExportCatchContext.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ExportCatchContext.java @@ -92,11 +92,11 @@ public class ExportCatchContext { BatchContainer<MarineLitterBatch> marineLitterBatches = weightComputingService.getComputedMarineLitterBatches( fishingOperationId, - catchBatch.getMarineLitterTotalWeight()); - weightComputingService.computeCatchBatchWeights(catchBatch, - rootSpeciesBatch, - rootBenthosBatch, - marineLitterBatches); + catchBatch.getMarineLitterTotalWeight()); + weightComputingService.computeCatchBatchWeights(catchBatch, + rootSpeciesBatch, + rootBenthosBatch, + marineLitterBatches); Multimap<Species, SpeciesBatchFrequency> speciesFrequencies; Multimap<Species, BenthosBatchFrequency> benthosFrequencies; @@ -160,6 +160,20 @@ public class ExportCatchContext { catchBatch.getBenthosTotalUnsortedComputedWeight(); } + public float getSpeciesTotalSortedWeight() { + float result = Numbers.getValueOrComputedValue( + catchBatch.getSpeciesTotalSortedWeight(), + catchBatch.getSpeciesTotalSortedComputedWeight()); + return result; + } + + public float getBenthosTotalSortedWeight() { + float result = Numbers.getValueOrComputedValue( + catchBatch.getBenthosTotalSortedWeight(), + catchBatch.getBenthosTotalSortedComputedWeight()); + return result; + } + public boolean withSpeciesBatches() { return rootSpeciesBatch != null && !rootSpeciesBatch.isEmptyChildren(); } @@ -289,32 +303,28 @@ public class ExportCatchContext { protected float getSpeciesElevationRate() { - float globalRatio = (getCatchTotalWeight() - catchBatch.getCatchTotalUnsortedComputedWeight()) / catchBatch.getCatchTotalSortedComputedWeight(); + float globalRatio = catchBatch.getCatchTotalSortedComputedWeight() / catchBatch.getCatchTotalSortedSortedComputedWeight(); - float speciesTotalSortedWeight = Numbers.getValueOrComputedValue( - catchBatch.getSpeciesTotalSortedWeight(), - catchBatch.getSpeciesTotalSortedComputedWeight()); + float speciesTotalSortedWeight = getSpeciesTotalSortedWeight(); - // ratio total species weight / total sorted sampled species weight + // ratio total species weight / total sorted sampled species weight float result = globalRatio * speciesTotalSortedWeight; - if (catchBatch.getSpeciesTotalSampleSortedComputedWeight() > 0) { - result /= catchBatch.getSpeciesTotalSampleSortedComputedWeight(); - } + if (catchBatch.getSpeciesTotalSampleSortedComputedWeight() > 0) { + result /= catchBatch.getSpeciesTotalSampleSortedComputedWeight(); + } return result; } protected float getBenthosElevationRate() { - float globalRatio = (getCatchTotalWeight() - catchBatch.getCatchTotalUnsortedComputedWeight()) / catchBatch.getCatchTotalSortedComputedWeight(); + float globalRatio = catchBatch.getCatchTotalSortedComputedWeight() / catchBatch.getCatchTotalSortedSortedComputedWeight(); - float benthosTotalSortedWeight = Numbers.getValueOrComputedValue( - catchBatch.getBenthosTotalSortedWeight(), - catchBatch.getBenthosTotalSortedComputedWeight()); + float benthosTotalSortedWeight = getBenthosTotalSortedWeight(); - // ratio total benthos weight / total sorted sampled benthos weight + // ratio total benthos weight / total sorted sampled benthos weight float result = globalRatio * benthosTotalSortedWeight; - if (catchBatch.getBenthosTotalSampleSortedComputedWeight() > 0) { - result /= catchBatch.getBenthosTotalSampleSortedComputedWeight(); + if (catchBatch.getBenthosTotalSampleSortedComputedWeight() > 0) { + result /= catchBatch.getBenthosTotalSampleSortedComputedWeight(); } return result; } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.