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

View File

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

View File

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

View File

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

View File

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

View File

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