Compare commits
4 Commits
e0759c0f6b
...
29749c444a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29749c444a | ||
|
|
073ee12f03 | ||
|
|
1438c94406 | ||
|
|
65290c0189 |
@@ -378,18 +378,33 @@ public class TransactionController {
|
|||||||
|
|
||||||
List<GoalForm> resultList = goalForm.stream().filter(goal -> goal.getGoalComplete() == 0)
|
List<GoalForm> resultList = goalForm.stream().filter(goal -> goal.getGoalComplete() == 0)
|
||||||
.collect(Collectors.toList());
|
.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";
|
return "menu";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,46 +1,56 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html xmlns:th="http://www.thymeleaf.org">
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>目標作成</title>
|
|
||||||
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1" http-equiv="Content-Type">
|
||||||
|
<title>目標作成</title>
|
||||||
|
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
|
<link rel="stylesheet" th:href="@{/css/style.css}">
|
||||||
</head>
|
</head>
|
||||||
<body class="pb-5 pt-5">
|
|
||||||
|
<body style="padding-top:80px; padding-bottom:80px;">
|
||||||
|
|
||||||
<div th:replace="~{header :: header}"></div>
|
<div th:replace="~{header :: header}"></div>
|
||||||
|
|
||||||
<h1>目標作成</h1>
|
<div class="main-container">
|
||||||
|
|
||||||
<form th:action="@{/goal/create}" th:object="${goalForm}" method="post">
|
<h1 class="page-title">目標作成</h1>
|
||||||
<input type="hidden" th:field="*{goalId}">
|
|
||||||
|
|
||||||
<div>
|
<div class="card shadow-sm">
|
||||||
<label>目標名</label>
|
|
||||||
<input type="text" th:field="*{goalTitle}" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
<div class="card-body">
|
||||||
<label>目標説明</label>
|
|
||||||
<textarea th:field="*{goalSubtitle}" required></textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
<form th:action="@{/goal/create}" th:object="${goalForm}" method="post">
|
||||||
<label>目標金額</label>
|
<input type="hidden" th:field="*{goalId}">
|
||||||
<input type="number" th:field="*{targetAmount}" required min="1">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label>目標達成期限</label>
|
<label>目標名</label>
|
||||||
<input type="date" th:field="*{deadline}" th:min="${#temporals.format(#temporals.createNow(), 'yyyy-MM-dd')}" required>
|
<input type="text" th:field="*{goalTitle}" required>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit">更新する</button>
|
|
||||||
|
|
||||||
</form>
|
<div>
|
||||||
|
<label>目標説明</label>
|
||||||
|
<textarea th:field="*{goalSubtitle}" required></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label>目標金額</label>
|
||||||
|
<input type="number" th:field="*{targetAmount}" required min="1">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label>目標達成期限</label>
|
||||||
|
<input type="date" th:field="*{deadline}"
|
||||||
|
th:min="${#temporals.format(#temporals.createNow(), 'yyyy-MM-dd')}" required>
|
||||||
|
</div>
|
||||||
|
<button type="submit" class="btn btn-sm btn-primary w-100">更新する</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div th:replace="~{footer :: footer}"></div>
|
||||||
|
|
||||||
<div th:replace="~{footer :: footer}"></div>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -31,8 +31,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div style="width: 600px; height: 300px;">
|
<div class="card shadow-sm mb-3">
|
||||||
<canvas id="myChart"></canvas>
|
<div style="height: 400px;">
|
||||||
|
<canvas id="myChart"></canvas>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -81,6 +83,7 @@
|
|||||||
options: {
|
options: {
|
||||||
|
|
||||||
responsive: true,
|
responsive: true,
|
||||||
|
maintainAspectRatio: false,
|
||||||
|
|
||||||
scales: {
|
scales: {
|
||||||
|
|
||||||
@@ -101,21 +104,22 @@
|
|||||||
</script>
|
</script>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
|
||||||
<div>
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
||||||
<li th:each="goalForm : ${goalFormList}" class="transaction-item">
|
<li th:each="goalForm : ${goalFormList}" class="transaction-item">
|
||||||
|
|
||||||
<div>
|
<div class="d-flex justify-content-between">
|
||||||
|
|
||||||
|
<form th:action="@{/goal}" method="get" class="w-100">
|
||||||
|
|
||||||
<form th:action="@{/goal}" method="get">
|
<div class="table-responsive">
|
||||||
<table class="table">
|
<table class="table mb-0">
|
||||||
|
|
||||||
<input type="radio" name="goalId" th:value="${goalForm.goalId}"
|
<input type="radio" name="goalId" th:value="${goalForm.goalId}"
|
||||||
th:checked="${graphGoal != null and graphGoal.goalId == goalForm.goalId}"
|
th:checked="${graphGoal != null and graphGoal.goalId == goalForm.goalId}"
|
||||||
onchange="this.form.submit()">
|
onchange="this.form.submit()">
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>目標名</th>
|
<th>目標名</th>
|
||||||
<td th:text="${goalForm.goalTitle}"></td>
|
<td th:text="${goalForm.goalTitle}"></td>
|
||||||
@@ -125,10 +129,12 @@
|
|||||||
<th>目標説明</th>
|
<th>目標説明</th>
|
||||||
<td th:text="${goalForm.goalSubtitle}"></td>
|
<td th:text="${goalForm.goalSubtitle}"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>目標金額</th>
|
<th>目標金額</th>
|
||||||
<td th:text="${goalForm.targetAmount}"></td>
|
<td th:text="${goalForm.targetAmount}"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>目標達成期限</th>
|
<th>目標達成期限</th>
|
||||||
<td th:text="${goalForm.deadline}"></td>
|
<td th:text="${goalForm.deadline}"></td>
|
||||||
@@ -138,61 +144,57 @@
|
|||||||
<th>達成率</th>
|
<th>達成率</th>
|
||||||
<td th:text="${goalForm.achievementRate} + '%'"></td>
|
<td th:text="${goalForm.achievementRate} + '%'"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</div>
|
||||||
|
|
||||||
</div>
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-end gap-2 mt-3">
|
||||||
|
|
||||||
|
<form th:action="@{/goal/edit}" method="get">
|
||||||
|
<input type="hidden" name="goalId" th:value="${goalForm.goalId}">
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-sm btn-primary">
|
||||||
|
編集
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form th:action="@{/goal/delete}" method="post">
|
||||||
|
<input type="hidden" name="goalId" th:value="${goalForm.goalId}">
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-sm btn-danger">
|
||||||
|
削除
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
<div class="transaction-buttons">
|
</ul>
|
||||||
|
|
||||||
<form th:action="@{/goal/edit}" method="get">
|
</div>
|
||||||
|
|
||||||
<input type="hidden" name="goalId" th:value="${goalForm.goalId}">
|
<form th:action="@{/goal/create}" method="get">
|
||||||
|
|
||||||
<button type="submit" class="btn btn-sm btn-primary w-100">
|
<button type="submit" class="btn btn-success w-100">
|
||||||
編集
|
新規登録
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
<form th:action="@{/goal/record}" method="get">
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-sm btn-primary w-100">
|
||||||
|
履歴
|
||||||
|
</button>
|
||||||
|
|
||||||
<form th:action="@{/goal/delete}" method="post">
|
</form>
|
||||||
|
</div>
|
||||||
<input type="hidden" name="goalId" th:value="${goalForm.goalId}">
|
<div th:replace="~{footer :: footer}"></div>
|
||||||
|
|
||||||
<button type="submit" class="btn btn-sm btn-primary w-100">
|
|
||||||
削除
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<form th:action="@{/goal/create}" method="get">
|
|
||||||
|
|
||||||
<button type="submit" class="btn btn-sm btn-primary w-100">
|
|
||||||
新規登録
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
<form th:action="@{/goal/record}" method="get">
|
|
||||||
|
|
||||||
<button type="submit" class="btn btn-sm btn-primary w-100">
|
|
||||||
履歴
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
|
|
||||||
<div th:replace="~{footer :: footer}"></div>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<link rel="stylesheet" th:href="@{/css/style.css}">
|
<link rel="stylesheet" th:href="@{/css/style.css}">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body style="padding-top:80px; padding-bottom:80px;">
|
||||||
|
|
||||||
<div th:replace="~{header :: header}"></div>
|
<div th:replace="~{header :: header}"></div>
|
||||||
<div class="main-container">
|
<div class="main-container">
|
||||||
|
|||||||
Reference in New Issue
Block a user