This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git commit 8f83cfdc7aec53a7e39c7c5aebc49358a6b24c8f Author: Tony CHEMIT <chemit@codelutin.com> Date: Fri Sep 2 12:35:34 2016 +0200 Bien réinitialiser les champs calculé avant un nouveau calcul (Fixes #7705) --- .../consolidate/ConsolidateDataServiceTopia.java | 68 ++++++++++++---------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/services-topia/src/main/java/fr/ird/observe/services/topia/service/actions/consolidate/ConsolidateDataServiceTopia.java b/services-topia/src/main/java/fr/ird/observe/services/topia/service/actions/consolidate/ConsolidateDataServiceTopia.java index 65c5625..4724052 100644 --- a/services-topia/src/main/java/fr/ird/observe/services/topia/service/actions/consolidate/ConsolidateDataServiceTopia.java +++ b/services-topia/src/main/java/fr/ird/observe/services/topia/service/actions/consolidate/ConsolidateDataServiceTopia.java @@ -221,16 +221,6 @@ public class ConsolidateDataServiceTopia extends ObserveServiceTopia implements activityContext.watchTargetLength(targetLength); - if (targetLength.isWeightSource()) { - targetLength.setWeight(null); - targetLength.setWeightSource(false); - } - - if (targetLength.isLengthSource()) { - targetLength.setLength(null); - targetLength.setLengthSource(false); - } - updateLengthWeightAble(activityContext, targetLength.getSpecies(), null, /* pas de sexe precise */ @@ -272,28 +262,6 @@ public class ConsolidateDataServiceTopia extends ObserveServiceTopia implements activityContext.watchNonTargetCatch(nonTargetCatch); - // suppression de tous les champs précédemment calculés - - 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); - } - updateNonTargetCatch(activityContext, nonTargetCatch); activityContext.flushNonTargetCatch(); @@ -718,10 +686,30 @@ public class ConsolidateDataServiceTopia extends ObserveServiceTopia implements public void watchTargetLength(TargetLength targetLength) { targetLengthMonitor.setBean(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); + } } public void watchNonTargetLenght(NonTargetLength nonTargetLength) { nonTargetLengthMonitor.setBean(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); + } } public void flushTargetLength() { @@ -742,6 +730,22 @@ public class ConsolidateDataServiceTopia extends ObserveServiceTopia implements public void watchNonTargetCatch(NonTargetCatch nonTargetCatch) { nonTargetCatchMonitor.setBean(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); + } } public void flushNonTargetCatch() { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.