changeset 775:95fa207dbd54

Fixed status values on messung create.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 12 Nov 2015 12:19:34 +0100
parents 2719c9602f2c
children b55f517124e5
files src/main/java/de/intevation/lada/rest/MessungService.java
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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");
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)