This is an automated email from the git hooks/post-receive script. New commit to branch develop-3.x in repository tutti. See http://git.codelutin.com/tutti.git commit 5c4062cea9a2fd2bf3dceed665897af7564a912c Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Apr 28 11:09:02 2015 +0200 correction du ration d'élévation pour un lot (pris en compte du vrac non trié) (refs #7021) --- .../tutti/service/export/ExportCatchContext.java | 57 ++++++++++++++-------- 1 file changed, 37 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..e082942 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; @@ -153,6 +153,13 @@ public class ExportCatchContext { return result; } + public float getCatchTotalRejectedWeight() { + float result = Numbers.getValueOrComputedValue( + catchBatch.getCatchTotalRejectedWeight(), + catchBatch.getCatchTotalRejectedComputedWeight()); + return result; + } + public float getCatchTotalSortedWeight() { return catchBatch.getSpeciesTotalSampleSortedComputedWeight() + catchBatch.getBenthosTotalSampleSortedComputedWeight() + @@ -160,6 +167,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 +310,28 @@ public class ExportCatchContext { protected float getSpeciesElevationRate() { - float globalRatio = (getCatchTotalWeight() - catchBatch.getCatchTotalUnsortedComputedWeight()) / catchBatch.getCatchTotalSortedComputedWeight(); + float globalRatio = catchBatch.getCatchTotalSortedComputedWeight() / (getCatchTotalWeight() - getCatchTotalRejectedWeight()); - 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() / (getCatchTotalWeight() - getCatchTotalRejectedWeight()); - 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>.