From 294794297172ff4d4539028c869640ae4ef8fbfd Mon Sep 17 00:00:00 2001 From: Mark Struchkov Date: Mon, 21 Jan 2019 14:12:57 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D1=83=20=D0=B2=D0=BE?= =?UTF-8?q?=D0=B7=D1=80=D0=B0=D1=89=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BE=D1=82?= =?UTF-8?q?=D0=B2=D0=B5=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Теперь можно попасть в начало меню после окончания ветки и сохраняется статус, если ответил не правильно --- pom.xml | 3 ++- .../java/org/sadtech/autoresponder/Autoresponder.java | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 9338003..fc3c0a5 100644 --- a/pom.xml +++ b/pom.xml @@ -12,6 +12,7 @@ org.apache.maven.plugins maven-compiler-plugin + 3.8.0 8 8 @@ -32,7 +33,7 @@ org.projectlombok lombok - ${lombok.ver} + 1.18.4 diff --git a/src/main/java/org/sadtech/autoresponder/Autoresponder.java b/src/main/java/org/sadtech/autoresponder/Autoresponder.java index 566a75a..3723185 100644 --- a/src/main/java/org/sadtech/autoresponder/Autoresponder.java +++ b/src/main/java/org/sadtech/autoresponder/Autoresponder.java @@ -29,15 +29,16 @@ public class Autoresponder { Unit unit; if (person.getUnit() == null) { unit = nextUnit(unitService.menuUnit(), message); - person.setUnit(unit); } else { - unit = nextUnit(person.getUnit().getNextUnits(), message); - if (unit == null) { - return null; + if (person.getUnit().getNextUnits() != null) { + unit = nextUnit(person.getUnit().getNextUnits(), message); } else { - person.setUnit(unit); + unit = nextUnit(unitService.menuUnit(), message); } } + if (unit!=null) { + person.setUnit(unit); + } return unit; }