From 29749c444ae79184343d99b764212b9df3933fc0 Mon Sep 17 00:00:00 2001 From: s-choi Date: Fri, 25 Sep 2026 14:39:03 +0900 Subject: [PATCH] =?UTF-8?q?[HOTFIX]=20=E7=9B=AE=E6=A8=99=E3=81=8C=E3=81=AA?= =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=9F=E5=A0=B4=E5=90=88=E3=80=81=E3=83=AD?= =?UTF-8?q?=E3=82=B0=E3=82=A4=E3=83=B3=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=BE?= =?UTF-8?q?=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TransactionController.java | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/example/demo/app/presentation/controller/TransactionController.java b/src/main/java/com/example/demo/app/presentation/controller/TransactionController.java index 0b0984b..50addac 100644 --- a/src/main/java/com/example/demo/app/presentation/controller/TransactionController.java +++ b/src/main/java/com/example/demo/app/presentation/controller/TransactionController.java @@ -378,18 +378,33 @@ public class TransactionController { List resultList = goalForm.stream().filter(goal -> goal.getGoalComplete() == 0) .collect(Collectors.toList()); + GoalForm result = new GoalForm(); + + if (resultList.getFirst() != null) { + result = resultList.getFirst(); + model.addAttribute("achievementRate", result.getAchievementRate()); - GoalForm result = resultList.getFirst(); + model.addAttribute("currentAmount", result.getCurrentAmount()); - model.addAttribute("achievementRate", result.getAchievementRate()); + model.addAttribute("targetAmount", result.getTargetAmount()); - model.addAttribute("currentAmount", result.getCurrentAmount()); + model.addAttribute("saving", userForm.getSaving()); - model.addAttribute("targetAmount", result.getTargetAmount()); + model.addAttribute("deadline", result.getDeadline()); - model.addAttribute("saving", userForm.getSaving()); + } else { + model.addAttribute("achievementRate", "目標を設定してください"); + + model.addAttribute("currentAmount", "目標を設定してください"); + + model.addAttribute("targetAmount", "目標を設定してください"); + + model.addAttribute("saving", userForm.getSaving()); + + model.addAttribute("deadline", "目標を設定してください"); + + } - model.addAttribute("deadline", result.getDeadline()); return "menu"; }