Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/826 incomplete squad assignements #827

Merged
merged 4 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ch.seidel</groupId>
<artifactId>KuTu</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>

<inceptionYear>2014</inceptionYear>

Expand Down Expand Up @@ -333,7 +333,7 @@
<dependency>
<groupId>org.simplejavamail</groupId>
<artifactId>simple-java-mail</artifactId>
<version>8.3.1</version>
<version>8.6.2</version>
</dependency>

<dependency>
Expand Down
18 changes: 15 additions & 3 deletions src/main/scala/ch/seidel/kutu/KuTuApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ object KuTuApp extends JFXApp3 with KutuService with JsonSupport with JwtSupport
setCursor(Cursor.Wait)
try {
handler(event)
} catch {
case e: Throwable =>
logger.error("Unerwarteter Fehler", e)
throw e
}
finally {
setCursor(Cursor.Default)
Expand All @@ -129,6 +133,11 @@ object KuTuApp extends JFXApp3 with KutuService with JsonSupport with JwtSupport
Platform.runLater {
try {
task
} catch {
case e: Throwable =>
logger.error("Unerwarteter Fehler", e)
Platform.runLater(() => PageDisplayer.showErrorDialog("Unerwarteter Fehler")(e))
throw e
}
finally {
setCursor(Cursor.Default)
Expand Down Expand Up @@ -164,14 +173,17 @@ object KuTuApp extends JFXApp3 with KutuService with JsonSupport with JwtSupport
p.success(ret)
}
catch {
case e: Exception => p.failure(e)
case e: Throwable =>
logger.error("Fehler beim Abschliessen von " + title, e)
p.failure(e)
}
finally {
//setCursor(Cursor.Default)
pForm.getDialogStage.close()
}
}
case Failure(error) =>
logger.error("Fehler bei " + title, error)
Platform.runLater {
try {
p.failure(error)
Expand All @@ -186,8 +198,8 @@ object KuTuApp extends JFXApp3 with KutuService with JsonSupport with JwtSupport
timerTask.run()
}
catch {
case e: Exception =>
e.printStackTrace()
case e: Throwable =>
logger.error("Fehler bei " + title, e)
Platform.runLater {
try {
p.failure(e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,14 @@ object RiegenBuilder {
val riegen = kandidatriegen.map(_._2).sortBy(r => r.start.map( dzl.indexOf(_)))
//kandidat.diszipline für die Rotationsberechnung verwenden
val rg = riegen.groupBy(e => e.start).toList.sortBy{d => d._1.map( dzl.indexOf(_))}
val geraete = dzl.foldLeft(rg){(acc, item) =>
acc.find(p => p._1.exists { f => f.equals(item) }) match {
case Some(_) => acc
case _ => acc :+ (Some(item) -> List[Riege]())
val geraete = dzl.foldLeft(rg) { (acc, item) =>
acc.find(p => p._1.exists { f => f.equals(item) }) match {
case Some(_) => acc
case _ => acc :+ (Some(item) -> List[Riege]())
}
}
}.sortBy(geraet => geraet._1.map(g => dzl.indexOf(g)))
.filter(pair => dzlmap.exists(p => pair._1.contains(p._1)))
.sortBy(geraet => geraet._1.map(g => dzl.indexOf(g)))
.map(geraet => (geraet._1, geraet._2, dzlmap(geraet._1.get)))

val startformationen = pickStartformationen(geraete, durchgang, k => (k.einteilung, k.diszipline))
Expand Down Expand Up @@ -136,7 +138,9 @@ object RiegenBuilder {
case Some(_) => acc
case _ => acc :+ (Some(item) -> List[Riege]())
}
}.sortBy(geraet => geraet._1.map(g => dzl.indexOf(g)))
}
.filter(pair => dzlmap.exists(p => pair._1.contains(p._1)))
.sortBy(geraet => geraet._1.map(g => dzl.indexOf(g)))
.map(geraet => (geraet._1, geraet._2, dzlmap(geraet._1.get)))

val startformationen = pickStartformationen(geraete, durchgang, k => (k.einteilung2, k.diszipline2))
Expand Down
Loading