[EDIT]メニュー画面で現在高の表示をできる用にしました。

This commit is contained in:
2026-09-18 16:11:20 +09:00
parent 41c5f6e99e
commit ed7a3a67b7
6 changed files with 19 additions and 5 deletions

View File

@@ -25,6 +25,8 @@ public class GoalModel {
private Integer goalComplete; private Integer goalComplete;
private Integer achievementRate; // 達成率 private Integer achievementRate; // 達成率
private Integer currentAmount; // 現在の資産
public static GoalModel convertFrom(GoalEntity goalEntity) { public static GoalModel convertFrom(GoalEntity goalEntity) {
return new GoalModel( return new GoalModel(
@@ -34,7 +36,7 @@ public class GoalModel {
goalEntity.getTargetAmount(), goalEntity.getTargetAmount(),
goalEntity.getDeadline(), goalEntity.getDeadline(),
goalEntity.getGoalComplete(), goalEntity.getGoalComplete(),
null); null,null);
} }
public static GoalEntity convertTo(GoalModel goalModel) { public static GoalEntity convertTo(GoalModel goalModel) {
@@ -56,7 +58,7 @@ public class GoalModel {
goalForm.getTargetAmount(), goalForm.getTargetAmount(),
goalForm.getDeadline(), goalForm.getDeadline(),
goalForm.getGoalComplete() goalForm.getGoalComplete()
,null); ,null,null);
} }
} }

View File

@@ -56,7 +56,8 @@ public class GoalServiceImpl implements GoalService {
goalModel.getTargetAmount(), goalModel.getTargetAmount(),
goalModel.getDeadline(), goalModel.getDeadline(),
goalModel.getGoalComplete(), goalModel.getGoalComplete(),
achievementRate); achievementRate,
currentAmount);
} }
@Override @Override

View File

@@ -344,6 +344,8 @@ public class TransactionController {
UserForm userForm = UserForm.convertFrom(userService.findByUserId(loginUser.getUserId())); UserForm userForm = UserForm.convertFrom(userService.findByUserId(loginUser.getUserId()));
model.addAttribute("achievementRate", goalForm.getAchievementRate()); model.addAttribute("achievementRate", goalForm.getAchievementRate());
model.addAttribute("currentAmount", goalForm.getCurrentAmount());
model.addAttribute("targetAmount", goalForm.getTargetAmount()); model.addAttribute("targetAmount", goalForm.getTargetAmount());

View File

@@ -29,6 +29,8 @@ public class GoalForm {
private Integer goalComplete; private Integer goalComplete;
private Integer achievementRate; // 達成率 private Integer achievementRate; // 達成率
private Integer currentAmount; // 現在の資産
public static GoalForm convertFrom(GoalModel goalModel) { public static GoalForm convertFrom(GoalModel goalModel) {
return new GoalForm( return new GoalForm(
@@ -38,7 +40,8 @@ public class GoalForm {
goalModel.getTargetAmount(), goalModel.getTargetAmount(),
goalModel.getDeadline(), goalModel.getDeadline(),
goalModel.getGoalComplete(), goalModel.getGoalComplete(),
goalModel.getAchievementRate()); goalModel.getAchievementRate(),
goalModel.getCurrentAmount());
} }
// public static List<GoalForm> convertFrom(List<GoalModel> goalModelList) { // public static List<GoalForm> convertFrom(List<GoalModel> goalModelList) {

View File

@@ -14,7 +14,6 @@
<h1>目標詳細</h1> <h1>目標詳細</h1>
<table> <table>
<tr> <tr>
<th>目標名</th> <th>目標名</th>
<td th:text="${goalForm.goalTitle}"></td> <td th:text="${goalForm.goalTitle}"></td>

View File

@@ -118,6 +118,13 @@
<span th:text="${targetAmount}"></span> <span th:text="${targetAmount}"></span>
<span>円</span> <span>円</span>
</div> </div>
<div>
<span>現在高</span>
<span th:text="${currentAmount}"></span>
<span>円</span>
</div>
<div> <div>
<span>貯金額</span> <span>貯金額</span>
<span th:text="${saving}"></span> <span th:text="${saving}"></span>