[Lada-commits] [PATCH 2 of 2] Add the initial status to generated messung objects

Wald Commits scm-commit at wald.intevation.org
Mon Mar 14 10:15:46 CET 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1457946943 -3600
# Node ID 67c3d22372e44c890502a0e5e96de79545e4946e
# Parent  c94a0795906084e9312ef40b2e0f3b46dfe7434c
Add the initial status to generated messung objects.

diff -r c94a07959060 -r 67c3d22372e4 src/main/java/de/intevation/lada/factory/ProbeFactory.java
--- a/src/main/java/de/intevation/lada/factory/ProbeFactory.java	Mon Mar 14 10:15:06 2016 +0100
+++ b/src/main/java/de/intevation/lada/factory/ProbeFactory.java	Mon Mar 14 10:15:43 2016 +0100
@@ -7,7 +7,6 @@
  */
 package de.intevation.lada.factory;
 
-import java.math.BigInteger;
 import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.Calendar;
@@ -21,6 +20,7 @@
 import de.intevation.lada.model.land.LMesswert;
 import de.intevation.lada.model.land.LOrtszuordnung;
 import de.intevation.lada.model.land.LProbe;
+import de.intevation.lada.model.land.LStatusProtokoll;
 import de.intevation.lada.model.land.Messprogramm;
 import de.intevation.lada.model.land.MessprogrammMmt;
 import de.intevation.lada.model.land.MessungTranslation;
@@ -198,6 +198,17 @@
             MessungTranslation mTranslation = new MessungTranslation();
             mTranslation.setMessungsId(messung);
             repository.create(mTranslation, "land");
+
+            LStatusProtokoll status = new LStatusProtokoll();
+            status.setDatum(new Timestamp(new Date().getTime()));
+            status.setMessungsId(messung.getId());
+            status.setErzeuger(probe.getMstId());
+            status.setStatusStufe(1);
+            status.setStatusWert(0);
+            repository.create(status, "land");
+            messung.setStatus(status.getId());
+            repository.update(messung, "land");
+
             for (int mw : mmt.getMessgroessen()) {
                 LMesswert wert = new LMesswert();
                 wert.setMessgroesseId(mw);


More information about the Lada-commits mailing list