[Lada-commits] [PATCH 09 of 10] Fixed status values on messung create

Wald Commits scm-commit at wald.intevation.org
Thu Nov 12 12:20:17 CET 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1447327174 -3600
# Node ID 95fa207dbd54abc1f8e97a78ecb4ec8c272001ee
# Parent  2719c9602f2c63f8ff562a1463ac7820b9e6e1d1
Fixed status values on messung create.

diff -r 2719c9602f2c -r 95fa207dbd54 src/main/java/de/intevation/lada/rest/MessungService.java
--- a/src/main/java/de/intevation/lada/rest/MessungService.java	Thu Nov 12 12:17:29 2015 +0100
+++ b/src/main/java/de/intevation/lada/rest/MessungService.java	Thu Nov 12 12:19:34 2015 +0100
@@ -9,7 +9,6 @@
 
 import java.sql.Timestamp;
 import java.util.Date;
-import java.util.List;
 
 import javax.enterprise.context.RequestScoped;
 import javax.inject.Inject;
@@ -30,11 +29,10 @@
 import de.intevation.lada.lock.LockConfig;
 import de.intevation.lada.lock.LockType;
 import de.intevation.lada.lock.ObjectLocker;
-import de.intevation.lada.model.land.LKommentarM;
 import de.intevation.lada.model.land.LMessung;
-import de.intevation.lada.model.land.LMesswert;
+import de.intevation.lada.model.land.LProbe;
+import de.intevation.lada.model.land.LStatusProtokoll;
 import de.intevation.lada.model.land.MessungTranslation;
-import de.intevation.lada.model.land.LStatusProtokoll;
 import de.intevation.lada.util.annotation.AuthorizationConfig;
 import de.intevation.lada.util.annotation.RepositoryConfig;
 import de.intevation.lada.util.auth.Authorization;
@@ -248,10 +246,12 @@
         LStatusProtokoll status = new LStatusProtokoll();
         status.setDatum(new Timestamp(new Date().getTime()));
         status.setMessungsId(((LMessung)created.getData()).getId());
+        LProbe probe =
+            defaultRepo.getByIdPlain(LProbe.class, ret.getProbeId(), "land");
         //TODO set the correct value. use the probe to get the "erzeuger"!?
-        status.setErzeuger("11010");
+        status.setErzeuger(probe.getMstId());
         status.setStatusStufe(1);
-        status.setStatusWert(1);
+        status.setStatusWert(0);
         defaultRepo.create(status, "land");
         ret.setStatus(status.getId());
         defaultRepo.update(ret, "land");


More information about the Lada-commits mailing list