From e0759c0f6b0713430f4179a0ab20d5d6191adaa1 Mon Sep 17 00:00:00 2001 From: s-choi Date: Fri, 25 Sep 2026 14:14:44 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=20=E7=9B=AE=E6=A8=99=E8=B3=87=E9=87=91?= =?UTF-8?q?=E3=83=BB=E7=8F=BE=E5=9C=A8=E9=AB=98=E3=83=BB=E9=81=94=E6=88=90?= =?UTF-8?q?=E7=8E=87=E3=83=BB=E9=81=94=E6=88=90=E6=9C=9F=E9=99=90=E3=81=8C?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E3=83=90?= =?UTF-8?q?=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=BE=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TransactionController.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 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 8643554..0b0984b 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 @@ -28,6 +28,7 @@ import com.example.demo.app.domain.service.UserService; import com.example.demo.app.presentation.form.CategoryForm; import com.example.demo.app.presentation.form.Expense; import com.example.demo.app.presentation.form.FixedCostForm; +import com.example.demo.app.presentation.form.GoalForm; import com.example.demo.app.presentation.form.Income; import com.example.demo.app.presentation.form.TransactionForm; import com.example.demo.app.presentation.form.UserForm; @@ -371,19 +372,24 @@ public class TransactionController { model.addAttribute("totalIncome", totalIncome); model.addAttribute("totalExpense", totalExpense); - // List goalForm = GoalForm.convertFrom(goalService.getGoalByUserId(loginUser.getUserId())); + List goalForm = GoalForm.convertFrom(goalService.getGoalByUserId(loginUser.getUserId())); UserForm userForm = UserForm.convertFrom(userService.findByUserId(loginUser.getUserId())); - // model.addAttribute("achievementRate", goalForm.getAchievementRate()); - // - // model.addAttribute("currentAmount", goalForm.getCurrentAmount()); - // - // model.addAttribute("targetAmount", goalForm.getTargetAmount()); + List resultList = goalForm.stream().filter(goal -> goal.getGoalComplete() == 0) + .collect(Collectors.toList()); + + GoalForm result = resultList.getFirst(); + + model.addAttribute("achievementRate", result.getAchievementRate()); + + model.addAttribute("currentAmount", result.getCurrentAmount()); + + model.addAttribute("targetAmount", result.getTargetAmount()); model.addAttribute("saving", userForm.getSaving()); - // model.addAttribute("deadline", goalForm.getDeadline()); + model.addAttribute("deadline", result.getDeadline()); return "menu"; }