From b666b322149ff4e3df110e3d3f5bf251b13257bf Mon Sep 17 00:00:00 2001 From: n-kawahito Date: Tue, 29 Sep 2026 13:38:52 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[FIX]URL=E3=81=AE=E6=B2=B3=E5=B7=9D?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/css/style.css | 8 ++++++++ src/main/resources/templates/footer.html | 8 ++++---- src/main/resources/templates/menu.html | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/resources/static/css/style.css b/src/main/resources/static/css/style.css index 399873b..8632b09 100644 --- a/src/main/resources/static/css/style.css +++ b/src/main/resources/static/css/style.css @@ -46,6 +46,10 @@ body { border-top: 1px solid #d0d7de; } +.a-footer { + text-decoration: none; +} + /* ======================= カード ======================= */ @@ -178,6 +182,10 @@ td:hover { text-align: right; } +.a-calender { + text-decoration: none; +} + /* ======================= 金額表示 ======================= */ diff --git a/src/main/resources/templates/footer.html b/src/main/resources/templates/footer.html index 8e446ef..450bdfa 100644 --- a/src/main/resources/templates/footer.html +++ b/src/main/resources/templates/footer.html @@ -15,22 +15,22 @@
diff --git a/src/main/resources/templates/menu.html b/src/main/resources/templates/menu.html index 8573b98..ba31ed3 100644 --- a/src/main/resources/templates/menu.html +++ b/src/main/resources/templates/menu.html @@ -63,7 +63,7 @@ + )}" class="a-footer">
Date: Tue, 29 Sep 2026 14:18:59 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[FIX]=E9=81=94=E6=88=90=E6=9C=9F=E9=99=90?= =?UTF-8?q?=E3=81=8C=E9=81=8E=E3=81=8E=E3=81=9F=E5=A0=B4=E5=90=88=E3=80=81?= =?UTF-8?q?=E6=9C=AA=E9=81=94=E6=88=90=E3=81=A8=E3=81=97=E3=81=A6=E5=B1=A5?= =?UTF-8?q?=E6=AD=B4=E3=81=AB=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E8=A8=AD=E8=A8=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/GoalController.java | 33 ++++++++++++------- .../demo/app/presentation/form/GoalForm.java | 3 ++ src/main/resources/templates/goal_record.html | 6 ++++ 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/example/demo/app/presentation/controller/GoalController.java b/src/main/java/com/example/demo/app/presentation/controller/GoalController.java index 2ced072..61133c1 100644 --- a/src/main/java/com/example/demo/app/presentation/controller/GoalController.java +++ b/src/main/java/com/example/demo/app/presentation/controller/GoalController.java @@ -57,6 +57,8 @@ public class GoalController { Long userId = loginUser.getUserId(); + LocalDate today = LocalDate.now(); + goalService.updateGoalComplete(userId); List goalModelList = goalService.getGoalByUserId(userId); @@ -64,7 +66,8 @@ public class GoalController { List goalFormList1 = GoalForm.convertFrom(goalModelList); List goalFormList = goalFormList1.stream() - .filter(goalForm -> goalForm.getGoalComplete() == 0) + .filter(goalForm -> goalForm.getGoalComplete() == 0 + && !goalForm.getDeadline().isBefore(today)) .collect(Collectors.toList()); model.addAttribute( @@ -107,8 +110,6 @@ public class GoalController { 1, 1); - LocalDate today = LocalDate.now(); - Map> transactionFormMap = new HashMap<>(); transactionService @@ -233,15 +234,14 @@ public class GoalController { @GetMapping(TransitionTargetPageNameKeyword.EDIT) public String editGoal(Model model, HttpSession session, Long goalId) { LoginModel loginUser = (LoginModel) session.getAttribute(SessionKeyword.LOGIN_USER); - + Long userId = loginUser.getUserId(); - + GoalForm goalForm = GoalForm.convertFrom(goalService.getGoalById(goalId)); - model.addAttribute(PageReturnAttributeKeyword.GOAL_FORM, goalForm); return TransitionTargetPageNameKeyword.GOAL_EDIT_HTML; - + } @SessionCheck @@ -272,11 +272,11 @@ public class GoalController { LoginModel loginUser = (LoginModel) session.getAttribute(SessionKeyword.LOGIN_USER); Long userId = loginUser.getUserId(); - + int currentAmount = goalService.getCurrentAmount(userId); - + model.addAttribute(PageReturnAttributeKeyword.CURRENT_AMOUNT, currentAmount); - + return TransitionTargetPageNameKeyword.GOAL_CREATE_HTML; } @@ -305,7 +305,8 @@ public class GoalController { if (record == null) { return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.GOAL; } else { - return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.GOAL + TransitionTargetPageNameKeyword.RECORD; + return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.GOAL + + TransitionTargetPageNameKeyword.RECORD; } } @@ -314,6 +315,8 @@ public class GoalController { @GetMapping(TransitionTargetPageNameKeyword.RECORD) public String getRecord(HttpSession session, Model model) { + LocalDate today = LocalDate.now(); + LoginModel loginUser = (LoginModel) session.getAttribute(SessionKeyword.LOGIN_USER); Long userId = loginUser.getUserId(); @@ -325,7 +328,13 @@ public class GoalController { List goalCompleteFormList = new ArrayList<>(); goalFormList.stream().forEach(goalForm -> { - if (goalForm.getGoalComplete() == 1) { + if (goalForm.getGoalComplete() == 1 || goalForm.getDeadline().isBefore(today)) { + + goalForm.setStatus( + goalForm.getGoalComplete() == 1 + ? "達成" + : "未達成"); + goalCompleteFormList.add(goalForm); } }); diff --git a/src/main/java/com/example/demo/app/presentation/form/GoalForm.java b/src/main/java/com/example/demo/app/presentation/form/GoalForm.java index 30bad09..7b64856 100644 --- a/src/main/java/com/example/demo/app/presentation/form/GoalForm.java +++ b/src/main/java/com/example/demo/app/presentation/form/GoalForm.java @@ -29,6 +29,8 @@ public class GoalForm { private Integer goalComplete; + private String status; + private Integer achievementRate; // 達成率 private Integer currentAmount; // 現在の資産 @@ -43,6 +45,7 @@ public class GoalForm { goalModel.getTargetAmount(), goalModel.getDeadline(), goalModel.getGoalComplete(), + null, goalModel.getAchievementRate(), goalModel.getCurrentAmount(), goalModel.getUserId()); diff --git a/src/main/resources/templates/goal_record.html b/src/main/resources/templates/goal_record.html index c5a7e0b..5b17934 100644 --- a/src/main/resources/templates/goal_record.html +++ b/src/main/resources/templates/goal_record.html @@ -47,6 +47,12 @@
+ 状態: + + + +
+