This is an automated email from the git hooks/post-receive script. New commit to branch develop-4.x in repository observe. See http://git.codelutin.com/observe.git commit 189f0e576821ad19e34eb96e2c7d77a3de9fd21e Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Nov 4 18:26:27 2015 +0100 Bien réinitialiser tous les champs précédemment calculé lors d'une opération de consolidation (See #7692) --- .../fr/ird/observe/ConsolidateDataService.java | 87 +++++++++++++++++----- 1 file changed, 69 insertions(+), 18 deletions(-) diff --git a/observe-business/src/main/java/fr/ird/observe/ConsolidateDataService.java b/observe-business/src/main/java/fr/ird/observe/ConsolidateDataService.java index 39cd13d..0382414 100644 --- a/observe-business/src/main/java/fr/ird/observe/ConsolidateDataService.java +++ b/observe-business/src/main/java/fr/ird/observe/ConsolidateDataService.java @@ -266,6 +266,8 @@ public class ConsolidateDataService { targetLengthMonitor.setBean(targetLength); + resetTargetLength(targetLength); + updateLengthWeightAble( tx, maree, @@ -295,6 +297,8 @@ public class ConsolidateDataService { nonTargetSampleMonitor.setBean(nonTargetLength); + resetNonTargetLength(nonTargetLength); + updateLengthWeightAble( tx, maree, @@ -318,27 +322,11 @@ public class ConsolidateDataService { nonTargetCatchMonitor.setBean(nonTargetCatch); - // suppression de tous les champs précédemment calculés + // suppression de tous les champs précédemment calculées - if (nonTargetCatch.isCatchWeightComputed()) { - nonTargetCatch.setCatchWeight(null); - nonTargetCatch.setCatchWeightComputedSource(null); - } - - if (nonTargetCatch.isTotalCountComputed()) { - nonTargetCatch.setTotalCount(null); - nonTargetCatch.setTotalCountComputedSource(null); - } + resetNonTargetCatch(nonTargetCatch); - if (nonTargetCatch.isMeanWeightComputed()) { - nonTargetCatch.setMeanWeight(null); - nonTargetCatch.setMeanWeightComputedSource(null); - } - if (nonTargetCatch.isMeanLengthComputed()) { - nonTargetCatch.setMeanLength(null); - nonTargetCatch.setMeanLengthComputedSource(null); - } updateNonTargetCatch( tx, @@ -356,6 +344,69 @@ public class ConsolidateDataService { return needUpdate; } + protected void resetNonTargetCatch(NonTargetCatch nonTargetCatch) { + + if (nonTargetCatch.isCatchWeightComputed()) { + nonTargetCatch.setCatchWeight(null); + nonTargetCatch.setCatchWeightComputedSource(null); + } + + if (nonTargetCatch.isTotalCountComputed()) { + nonTargetCatch.setTotalCount(null); + nonTargetCatch.setTotalCountComputedSource(null); + } + + if (nonTargetCatch.isMeanWeightComputed()) { + nonTargetCatch.setMeanWeight(null); + nonTargetCatch.setMeanWeightComputedSource(null); + } + + if (nonTargetCatch.isMeanLengthComputed()) { + nonTargetCatch.setMeanLength(null); + nonTargetCatch.setMeanLengthComputedSource(null); + } + + } + protected void resetNonTargetLength(NonTargetLength nonTargetLength) { + + if (nonTargetLength.isLengthSource()) { + + // Reset de la valeur calculée + nonTargetLength.setLength(null); + nonTargetLength.setLengthSource(false); + + } + + if (nonTargetLength.isWeightSource()) { + + // Reset de la valeur calculée + nonTargetLength.setWeight(null); + nonTargetLength.setWeightSource(false); + + } + + } + + protected void resetTargetLength(TargetLength targetLength) { + + if (targetLength.isLengthSource()) { + + // Reset de la valeur calculée + targetLength.setLength(null); + targetLength.setLengthSource(false); + + } + + if (targetLength.isWeightSource()) { + + // Reset de la valeur calculée + targetLength.setWeight(null); + targetLength.setWeightSource(false); + + } + + } + protected boolean allNonTargetCatchDataFilled(NonTargetCatch nonTargetCatch) { return Iterables.all( Sets.newHashSet(nonTargetCatch.getCatchWeight(), -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.