changeset 6841:ddb0ed040209

(Issue1357) Pull river name into getReferenceGauge This fixes the timerange state on rivers with multiple gauges of the same id
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 15 Aug 2013 16:26:50 +0200
parents 233a1b04fb8a
children 086efb4196d7
files artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java	Thu Aug 15 16:25:50 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java	Thu Aug 15 16:26:50 2013 +0200
@@ -491,10 +491,14 @@
 
     public static Gauge getReferenceGauge(D4EArtifact flys) {
         Long officialNumber = flys.getDataAsLong("reference_gauge");
+        String river = getRivername(flys);
 
-        return officialNumber != null
-            ? Gauge.getGaugeByOfficialNumber(officialNumber)
-            : null;
+        if (officialNumber != null && river != null) {
+            return Gauge.getGaugeByOfficialNumber(officialNumber, river);
+        } else if (officialNumber != null) {
+            return Gauge.getGaugeByOfficialNumber(officialNumber);
+        }
+        return null;
     }
 
 

http://dive4elements.wald.intevation.org