Compare commits
15 Commits
baab2a822d
...
n-kawahito
| Author | SHA1 | Date | |
|---|---|---|---|
| a10a4053cf | |||
|
|
a811b0d261 | ||
|
|
9d5dd5b9b2 | ||
|
|
378c169c1f | ||
|
|
e67912a259 | ||
|
|
c470cc1970 | ||
|
|
edadbf86ec | ||
| 546a2927eb | |||
|
|
129d74a4df | ||
|
|
d3b76fb2cd | ||
|
|
67cc89d2a8 | ||
| 31b5e54023 | |||
| 1d34a2189d | |||
|
|
bbee55f58f | ||
|
|
f319fcb9f8 |
@@ -49,7 +49,7 @@ public class GlobalExceptionHandler {
|
|||||||
|
|
||||||
LOGGER.log(Level.SEVERE, SEVERE_ERROR_MESSAGE_ILLEGAL_TRANSITION, e);
|
LOGGER.log(Level.SEVERE, SEVERE_ERROR_MESSAGE_ILLEGAL_TRANSITION, e);
|
||||||
|
|
||||||
System.out.println("session invalidated method not supported exception");
|
System.out.println("session invalidated");
|
||||||
session.invalidate();
|
session.invalidate();
|
||||||
|
|
||||||
return TransitionTargetPageNameKeyword.ERROR_HTML;
|
return TransitionTargetPageNameKeyword.ERROR_HTML;
|
||||||
@@ -61,7 +61,7 @@ public class GlobalExceptionHandler {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
||||||
System.out.println("session invalidated exception");
|
System.out.println("session invalidated exception");
|
||||||
session.invalidate();
|
// session.invalidate();
|
||||||
return TransitionTargetPageNameKeyword.ERROR_HTML;
|
return TransitionTargetPageNameKeyword.ERROR_HTML;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,17 +130,14 @@ public class CourseServiceImpl implements CourseService {
|
|||||||
public String deleteCourse(Long courseId, Long userId) {
|
public String deleteCourse(Long courseId, Long userId) {
|
||||||
|
|
||||||
UserEntity userEntity = userRepository.findById(userId).orElse(null);
|
UserEntity userEntity = userRepository.findById(userId).orElse(null);
|
||||||
System.out.println("***********************ここでエラー1");
|
|
||||||
if (userEntity.getCourseEntity().getCourseId() == courseId) {
|
if (userEntity.getCourseEntity().getCourseId() == courseId) {
|
||||||
return "selected";
|
return "selected";
|
||||||
|
} else if (courseId <= 6) {
|
||||||
|
return "original";
|
||||||
}
|
}
|
||||||
System.out.println("***********************ここでエラー2");
|
|
||||||
allocationRepository.deleteByCourseId(courseId);
|
allocationRepository.deleteByCourseId(courseId);
|
||||||
System.out.println("***********************ここでエラー3");
|
|
||||||
courseOwnerRepository.deleteByCourseId(courseId);
|
courseOwnerRepository.deleteByCourseId(courseId);
|
||||||
System.out.println("***********************ここでエラー4");
|
|
||||||
courseRepository.deleteById(courseId);
|
courseRepository.deleteById(courseId);
|
||||||
System.out.println("***********************ここでエラー5");
|
|
||||||
return "ok";
|
return "ok";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ public class CourseController {
|
|||||||
|
|
||||||
LoginModel loginUser = (LoginModel) session.getAttribute(SessionKeyword.LOGIN_USER);
|
LoginModel loginUser = (LoginModel) session.getAttribute(SessionKeyword.LOGIN_USER);
|
||||||
|
|
||||||
System.out.println("**********************cousrId: " + courseId);
|
// System.out.println("**********************cousrId: " + courseId);
|
||||||
String condition = courseService.deleteCourse(courseId, loginUser.getUserId());
|
String condition = courseService.deleteCourse(courseId, loginUser.getUserId());
|
||||||
|
|
||||||
if (condition.equals("selected")) {
|
if (condition.equals("selected")) {
|
||||||
@@ -141,9 +141,13 @@ public class CourseController {
|
|||||||
|
|
||||||
return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.COURSE;
|
return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.COURSE;
|
||||||
|
|
||||||
|
} else if (condition.equals("original")) {
|
||||||
|
model.addAttribute("message", "既存のデータは削除できません");
|
||||||
|
|
||||||
|
return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.COURSE;
|
||||||
} else if (condition.equals("ok")) {
|
} else if (condition.equals("ok")) {
|
||||||
return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.COURSE;
|
return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.COURSE;
|
||||||
}
|
}
|
||||||
model.addAttribute("message", "エラーが発生しました");
|
model.addAttribute("message", "エラーが発生しました");
|
||||||
|
|
||||||
return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.COURSE;
|
return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.COURSE;
|
||||||
|
|||||||
@@ -275,7 +275,9 @@ public class GoalController {
|
|||||||
|
|
||||||
int currentAmount = goalService.getCurrentAmount(userId);
|
int currentAmount = goalService.getCurrentAmount(userId);
|
||||||
|
|
||||||
model.addAttribute(PageReturnAttributeKeyword.CURRENT_AMOUNT, currentAmount);
|
// System.out.println("************************currentAmount : " + currentAmount);
|
||||||
|
|
||||||
|
session.setAttribute(PageReturnAttributeKeyword.CURRENT_AMOUNT, currentAmount);
|
||||||
|
|
||||||
return TransitionTargetPageNameKeyword.GOAL_CREATE_HTML;
|
return TransitionTargetPageNameKeyword.GOAL_CREATE_HTML;
|
||||||
}
|
}
|
||||||
@@ -292,7 +294,7 @@ public class GoalController {
|
|||||||
model.addAttribute(PageReturnAttributeKeyword.MESSAGE, "現在所持金より高い金額を設定してください。");
|
model.addAttribute(PageReturnAttributeKeyword.MESSAGE, "現在所持金より高い金額を設定してください。");
|
||||||
return TransitionTargetPageNameKeyword.GOAL_CREATE_HTML;
|
return TransitionTargetPageNameKeyword.GOAL_CREATE_HTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.GOAL;
|
return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.GOAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -372,29 +372,29 @@ public class TransactionController {
|
|||||||
@RequestParam(required = false, defaultValue = "0") String months) {
|
@RequestParam(required = false, defaultValue = "0") String months) {
|
||||||
|
|
||||||
LoginModel loginUser = (LoginModel) session.getAttribute(SessionKeyword.LOGIN_USER);
|
LoginModel loginUser = (LoginModel) session.getAttribute(SessionKeyword.LOGIN_USER);
|
||||||
System.out.println("******************************************::1");
|
|
||||||
LocalDate today = LocalDate.now();
|
LocalDate today = LocalDate.now();
|
||||||
System.out.println("******************************************::2");
|
|
||||||
int year = (years.equals("0")) ? today.getYear() : Integer.parseInt(years);
|
int year = (years.equals("0")) ? today.getYear() : Integer.parseInt(years);
|
||||||
System.out.println("******************************************::3");
|
|
||||||
int month = (months.equals("0")) ? today.getMonthValue() : Integer.parseInt(months);
|
int month = (months.equals("0")) ? today.getMonthValue() : Integer.parseInt(months);
|
||||||
System.out.println("******************************************::4");
|
|
||||||
YearMonth yearMonth = YearMonth.of(year, month);
|
YearMonth yearMonth = YearMonth.of(year, month);
|
||||||
System.out.println("******************************************::5");
|
|
||||||
int lastDay = yearMonth.lengthOfMonth();
|
int lastDay = yearMonth.lengthOfMonth();
|
||||||
System.out.println("******************************************::6");
|
|
||||||
int firstDayOfWeek = yearMonth.atDay(1).getDayOfWeek().getValue() % 7;
|
int firstDayOfWeek = yearMonth.atDay(1).getDayOfWeek().getValue() % 7;
|
||||||
System.out.println("******************************************::7");
|
|
||||||
YearMonth previousYearMonth = yearMonth.minusMonths(1);
|
YearMonth previousYearMonth = yearMonth.minusMonths(1);
|
||||||
System.out.println("******************************************::8");
|
|
||||||
int previousYear = previousYearMonth.getYear();
|
int previousYear = previousYearMonth.getYear();
|
||||||
int previousMonth = previousYearMonth.getMonthValue();
|
int previousMonth = previousYearMonth.getMonthValue();
|
||||||
System.out.println("******************************************::9");
|
|
||||||
YearMonth nextYearMonth = yearMonth.plusMonths(1);
|
YearMonth nextYearMonth = yearMonth.plusMonths(1);
|
||||||
System.out.println("******************************************::10");
|
|
||||||
int nextYear = nextYearMonth.getYear();
|
int nextYear = nextYearMonth.getYear();
|
||||||
int nextMonth = nextYearMonth.getMonthValue();
|
int nextMonth = nextYearMonth.getMonthValue();
|
||||||
System.out.println("******************************************::11");
|
|
||||||
model.addAttribute(PageReturnAttributeKeyword.YEAR, year);
|
model.addAttribute(PageReturnAttributeKeyword.YEAR, year);
|
||||||
model.addAttribute(PageReturnAttributeKeyword.MONTH, month);
|
model.addAttribute(PageReturnAttributeKeyword.MONTH, month);
|
||||||
model.addAttribute(PageReturnAttributeKeyword.DAY, today.getDayOfMonth());
|
model.addAttribute(PageReturnAttributeKeyword.DAY, today.getDayOfMonth());
|
||||||
@@ -407,34 +407,34 @@ public class TransactionController {
|
|||||||
|
|
||||||
model.addAttribute(PageReturnAttributeKeyword.NEXT_YEAR, nextYear);
|
model.addAttribute(PageReturnAttributeKeyword.NEXT_YEAR, nextYear);
|
||||||
model.addAttribute(PageReturnAttributeKeyword.NEXT_MONTH, nextMonth);
|
model.addAttribute(PageReturnAttributeKeyword.NEXT_MONTH, nextMonth);
|
||||||
System.out.println("******************************************::12");
|
|
||||||
LocalDate startDate = yearMonth.atDay(1);
|
LocalDate startDate = yearMonth.atDay(1);
|
||||||
LocalDate endDate = yearMonth.atEndOfMonth();
|
LocalDate endDate = yearMonth.atEndOfMonth();
|
||||||
System.out.println("******************************************::13");
|
|
||||||
List<Income> incomeList = transactionService.findTotalIncomeList(startDate, endDate, loginUser.getUserId());
|
List<Income> incomeList = transactionService.findTotalIncomeList(startDate, endDate, loginUser.getUserId());
|
||||||
System.out.println("******************************************::14");
|
|
||||||
List<Expense> expenseList = transactionService.findTotalExpenseList(startDate, endDate, loginUser.getUserId());
|
List<Expense> expenseList = transactionService.findTotalExpenseList(startDate, endDate, loginUser.getUserId());
|
||||||
System.out.println("******************************************::15");
|
|
||||||
model.addAttribute(PageReturnAttributeKeyword.INCOME_LIST, incomeList);
|
model.addAttribute(PageReturnAttributeKeyword.INCOME_LIST, incomeList);
|
||||||
model.addAttribute(PageReturnAttributeKeyword.EXPENSE_LIST, expenseList);
|
model.addAttribute(PageReturnAttributeKeyword.EXPENSE_LIST, expenseList);
|
||||||
System.out.println("******************************************::16");
|
|
||||||
int totalIncome = transactionService.findTotalIncome(startDate, endDate, loginUser.getUserId());
|
int totalIncome = transactionService.findTotalIncome(startDate, endDate, loginUser.getUserId());
|
||||||
|
|
||||||
int totalExpense = transactionService.findTotalExpense(startDate, endDate, loginUser.getUserId());
|
int totalExpense = transactionService.findTotalExpense(startDate, endDate, loginUser.getUserId());
|
||||||
System.out.println("******************************************::17");
|
|
||||||
model.addAttribute(PageReturnAttributeKeyword.TOTAL_INCOME, totalIncome);
|
model.addAttribute(PageReturnAttributeKeyword.TOTAL_INCOME, totalIncome);
|
||||||
model.addAttribute(PageReturnAttributeKeyword.TOTAL_EXPENSE, totalExpense);
|
model.addAttribute(PageReturnAttributeKeyword.TOTAL_EXPENSE, totalExpense);
|
||||||
System.out.println("******************************************::18");
|
|
||||||
List<GoalForm> goalForm = GoalForm.convertFrom(goalService.getGoalByUserId(loginUser.getUserId()));
|
List<GoalForm> goalForm = GoalForm.convertFrom(goalService.getGoalByUserId(loginUser.getUserId()));
|
||||||
System.out.println("******************************************::19");
|
|
||||||
UserForm userForm = UserForm.convertFrom(userService.findByUserId(loginUser.getUserId()));
|
UserForm userForm = UserForm.convertFrom(userService.findByUserId(loginUser.getUserId()));
|
||||||
System.out.println("******************************************::20");
|
|
||||||
List<GoalForm> resultList = goalForm.stream().filter(goal -> goal.getGoalComplete() == 0)
|
List<GoalForm> resultList = goalForm.stream().filter(goal -> goal.getGoalComplete() == 0 && goal.getDeadline().isAfter(today) )
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
System.out.println("******************************************::21");
|
|
||||||
if (!resultList.isEmpty()) {
|
if (!resultList.isEmpty()) {
|
||||||
GoalForm result = resultList.getFirst();
|
GoalForm result = resultList.getFirst();
|
||||||
System.out.println("******************************************::22");
|
|
||||||
model.addAttribute(PageReturnAttributeKeyword.ACHIEVEMENT_RATE, result.getAchievementRate());
|
model.addAttribute(PageReturnAttributeKeyword.ACHIEVEMENT_RATE, result.getAchievementRate());
|
||||||
|
|
||||||
model.addAttribute(PageReturnAttributeKeyword.CURRENT_AMOUNT, result.getCurrentAmount());
|
model.addAttribute(PageReturnAttributeKeyword.CURRENT_AMOUNT, result.getCurrentAmount());
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
package com.example.demo.utility;
|
|
||||||
|
|
||||||
public class Constant {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
package com.example.demo.utility;
|
|
||||||
|
|
||||||
public class TestController1 {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -214,6 +214,10 @@ td:hover {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.goal {
|
||||||
|
min-width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
/* =======================
|
/* =======================
|
||||||
ボタン
|
ボタン
|
||||||
======================= */
|
======================= */
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
.transaction-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.transaction-buttons {
|
|
||||||
display: flex;
|
|
||||||
gap: 10px;
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.transaction-buttons form {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label" for="transactionType">収入・支出</label>
|
<label class="form-label" for="transactionType">収入・支出</label>
|
||||||
|
|
||||||
<select class="form-select" id="transactionType">
|
<select class="form-select" id="transactionType" required>
|
||||||
|
|
||||||
<option value="">選択してください</option>
|
<option value="">選択してください</option>
|
||||||
<option value="0">支出</option>
|
<option value="0">支出</option>
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label" for="categoryId">カテゴリ</label>
|
<label class="form-label" for="categoryId">カテゴリ</label>
|
||||||
|
|
||||||
<select class="form-select" id="categoryId" th:field="*{categoryId}">
|
<select class="form-select" id="categoryId" th:field="*{categoryId}" required>
|
||||||
<option value="">選択してください</option>
|
<option value="">選択してください</option>
|
||||||
|
|
||||||
<option class="expenseListClass" th:each="category : ${expenseList}"
|
<option class="expenseListClass" th:each="category : ${expenseList}"
|
||||||
|
|||||||
@@ -37,7 +37,9 @@
|
|||||||
<div>
|
<div>
|
||||||
<label>目標金額</label>
|
<label>目標金額</label>
|
||||||
<input type="number" th:field="*{targetAmount}" required min="1">
|
<input type="number" th:field="*{targetAmount}" required min="1">
|
||||||
<span th:text="|所持金:${currentAmount}円|"></span>
|
<br>
|
||||||
|
<span th:text="|所持金:${session.currentAmount}円|"></span>
|
||||||
|
<input type="hidden" name="currentAmount" th:value="${currentAmount}">
|
||||||
<span th:if="${message != null}">
|
<span th:if="${message != null}">
|
||||||
<span th:text="${message}" style="color: red;"></span>
|
<span th:text="${message}" style="color: red;"></span>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -54,143 +54,102 @@
|
|||||||
|
|
||||||
const myChart =
|
const myChart =
|
||||||
new Chart(myCt, {
|
new Chart(myCt, {
|
||||||
|
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
|
|
||||||
data: {
|
data: {
|
||||||
|
|
||||||
labels: labels,
|
labels: labels,
|
||||||
|
|
||||||
datasets: [
|
datasets: [
|
||||||
{
|
{
|
||||||
label: '達成率',
|
label: '達成率',
|
||||||
|
|
||||||
data: achievementRates,
|
data: achievementRates,
|
||||||
|
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
'rgba(54, 162, 235, 0.5)',
|
'rgba(54, 162, 235, 0.5)',
|
||||||
|
|
||||||
borderColor:
|
borderColor:
|
||||||
'rgba(54, 162, 235, 1)',
|
'rgba(54, 162, 235, 1)',
|
||||||
|
|
||||||
borderWidth: 1
|
borderWidth: 1
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
options: {
|
options: {
|
||||||
|
|
||||||
responsive: true,
|
responsive: true,
|
||||||
|
|
||||||
maintainAspectRatio: false,
|
maintainAspectRatio: false,
|
||||||
|
|
||||||
scales: {
|
scales: {
|
||||||
|
|
||||||
y: {
|
y: {
|
||||||
|
|
||||||
beginAtZero: true,
|
beginAtZero: true,
|
||||||
|
|
||||||
max: 100,
|
max: 100,
|
||||||
|
|
||||||
ticks: {
|
ticks: {
|
||||||
|
|
||||||
callback: function (value) {
|
callback: function (value) {
|
||||||
return value + '%';
|
return value + '%';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
||||||
<li th:each="goalForm : ${goalFormList}">
|
<li th:each="goalForm : ${goalFormList}">
|
||||||
|
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
|
|
||||||
<form th:action="@{/goal}" method="get" class="w-100">
|
<form th:action="@{/goal}" method="get" class="w-100">
|
||||||
|
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
|
|
||||||
<table class="table mb-0">
|
<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}"
|
||||||
|
class="goal"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>目標説明</th>
|
<th>目標説明</th >
|
||||||
<td th:text="${goalForm.goalSubtitle}"></td>
|
<td th:text="${goalForm.goalSubtitle}"
|
||||||
|
class="goal"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>目標金額</th>
|
<th>目標金額</th>
|
||||||
<td th:text="${goalForm.targetAmount}"></td>
|
<td th:text="${goalForm.targetAmount}"
|
||||||
|
class="goal"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>目標達成期限</th>
|
<th>目標達成期限</th>
|
||||||
<td th:text="${goalForm.deadline}"></td>
|
<td th:text="${goalForm.deadline}"
|
||||||
|
class="goal"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>達成率</th>
|
<th>達成率</th>
|
||||||
<td th:text="${goalForm.achievementRate} + '%'"></td>
|
<td th:text="${goalForm.achievementRate} + '%'"
|
||||||
|
class="goal"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-flex justify-content-end gap-2 mt-3">
|
<div class="d-flex justify-content-end gap-2 mt-3">
|
||||||
|
|
||||||
<form th:action="@{/goal/edit}" method="get">
|
<form th:action="@{/goal/edit}" method="get">
|
||||||
|
|
||||||
<input type="hidden" name="goalId" th:value="${goalForm.goalId}">
|
<input type="hidden" name="goalId" th:value="${goalForm.goalId}">
|
||||||
|
|
||||||
<button type="submit" class="btn btn-sm btn-primary">
|
<button type="submit" class="btn btn-sm btn-primary">
|
||||||
編集
|
編集
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form th:action="@{/goal/delete}" method="post">
|
<form th:action="@{/goal/delete}" method="post">
|
||||||
|
|
||||||
<input type="hidden" name="goalId" th:value="${goalForm.goalId}">
|
<input type="hidden" name="goalId" th:value="${goalForm.goalId}">
|
||||||
|
|
||||||
<button type="submit" class="btn btn-sm btn-danger">
|
<button type="submit" class="btn btn-sm btn-danger">
|
||||||
削除
|
削除
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-grid gap-2 mt-4">
|
<div class="d-grid gap-2 mt-4">
|
||||||
|
|
||||||
<form th:action="@{/goal/create}" method="get">
|
<form th:action="@{/goal/create}" method="get">
|
||||||
|
|
||||||
<button type="submit" class="btn btn-success w-100">
|
<button type="submit" class="btn btn-success w-100">
|
||||||
@@ -200,7 +159,6 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form th:action="@{/goal/record}" method="get">
|
<form th:action="@{/goal/record}" method="get">
|
||||||
|
|
||||||
<button type="submit" class="btn btn-sm btn-primary w-100">
|
<button type="submit" class="btn btn-sm btn-primary w-100">
|
||||||
履歴
|
履歴
|
||||||
</button>
|
</button>
|
||||||
@@ -208,7 +166,6 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div th:replace="~{footer :: footer}"></div>
|
<div th:replace="~{footer :: footer}"></div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
<title>Calendar</title>
|
<title>カレンダー</title>
|
||||||
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
|
|
||||||
@@ -55,51 +55,35 @@
|
|||||||
|
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
<tr th:each="week : ${#numbers.sequence(0, 5)}">
|
<tr th:each="week : ${#numbers.sequence(0, 5)}">
|
||||||
|
|
||||||
<td th:each="weekDay : ${#numbers.sequence(0, 6)}">
|
<td th:each="weekDay : ${#numbers.sequence(0, 6)}">
|
||||||
|
|
||||||
<a th:if="${week * 7 + weekDay - firstDayOfWeek + 1 >= 1
|
<a th:if="${week * 7 + weekDay - firstDayOfWeek + 1 >= 1
|
||||||
and week * 7 + weekDay - firstDayOfWeek + 1 <= lastDay}" th:href="@{/transaction/detail(
|
and week * 7 + weekDay - firstDayOfWeek + 1 <= lastDay}" th:href="@{/transaction/detail(
|
||||||
todayDates=${T(java.time.LocalDate).of(year, month, week * 7 + weekDay - firstDayOfWeek + 1)}
|
todayDates=${T(java.time.LocalDate).of(year, month, week * 7 + weekDay - firstDayOfWeek + 1)}
|
||||||
)}" class="a-footer">
|
)}" class="a-footer">
|
||||||
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
th:if="${week * 7 + weekDay - firstDayOfWeek + 1 >= 1 and week * 7 + weekDay - firstDayOfWeek + 1 <= lastDay}">
|
th:if="${week * 7 + weekDay - firstDayOfWeek + 1 >= 1 and week * 7 + weekDay - firstDayOfWeek + 1 <= lastDay}">
|
||||||
|
|
||||||
<div class="date" th:text="${week * 7 + weekDay - firstDayOfWeek + 1}">
|
<div class="date" th:text="${week * 7 + weekDay - firstDayOfWeek + 1}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div th:each="income : ${incomeList}"
|
<div th:each="income : ${incomeList}"
|
||||||
th:if="${income.date.dayOfMonth == week * 7 + weekDay - firstDayOfWeek + 1}"
|
th:if="${income.date.dayOfMonth == week * 7 + weekDay - firstDayOfWeek + 1}"
|
||||||
class="income" th:text="|収入 +${income.amount}円|">
|
class="income" th:text="|収入 +${income.amount}円|">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div th:each="expense : ${expenseList}"
|
<div th:each="expense : ${expenseList}"
|
||||||
th:if="${expense.date.dayOfMonth == week * 7 + weekDay - firstDayOfWeek + 1}"
|
th:if="${expense.date.dayOfMonth == week * 7 + weekDay - firstDayOfWeek + 1}"
|
||||||
class="expense" th:text="|支出 -${expense.amount}円|">
|
class="expense" th:text="|支出 -${expense.amount}円|">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
<div class="card shadow-sm mb-3">
|
<div class="card shadow-sm mb-3">
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<div class="d-flex justify-content-between mb-2">
|
<div class="d-flex justify-content-between mb-2">
|
||||||
<span>収入</span>
|
<span>収入</span>
|
||||||
<span th:text="'¥' + ${totalIncome}"></span>
|
<span th:text="'¥' + ${totalIncome}"></span>
|
||||||
@@ -124,25 +108,19 @@
|
|||||||
<span>目標資金</span>
|
<span>目標資金</span>
|
||||||
<span th:text="'¥' + ${targetAmount}"></span>
|
<span th:text="'¥' + ${targetAmount}"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-flex justify-content-between mb-2">
|
<div class="d-flex justify-content-between mb-2">
|
||||||
<span>現在高</span>
|
<span>現在高</span>
|
||||||
<span th:text="'¥' + ${currentAmount}"></span>
|
<span th:text="'¥' + ${currentAmount}"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<span>貯金額</span>
|
<span>貯金額</span>
|
||||||
<span th:text="'¥' + ${saving}"></span>
|
<span th:text="'¥' + ${saving}"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card shadow-sm">
|
<div class="card shadow-sm">
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<div class="d-flex justify-content-between mb-2">
|
<div class="d-flex justify-content-between mb-2">
|
||||||
<span>達成率</span>
|
<span>達成率</span>
|
||||||
<span th:text="${achievementRate} + '%'"
|
<span th:text="${achievementRate} + '%'"
|
||||||
|
|||||||
@@ -21,12 +21,6 @@
|
|||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</th:block>
|
</th:block>
|
||||||
|
|
||||||
<form th:action="${mode == 'regist'} ? @{/user/register/return}: @{/change}" method="post">
|
|
||||||
<th:block th:if="${mode == 'change'}">
|
|
||||||
<form th:action="@{/course/create}" method="get">
|
|
||||||
<button type="submit">新規登録</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</th:block>
|
</th:block>
|
||||||
<form th:action="${mode == 'regist'} ? @{/user/register/return}: @{/change}" id="totalForm" method="post">
|
<form th:action="${mode == 'regist'} ? @{/user/register/return}: @{/change}" id="totalForm" method="post">
|
||||||
@@ -42,7 +36,8 @@
|
|||||||
aria-controls="'collapse' + ${course.courseId}">
|
aria-controls="'collapse' + ${course.courseId}">
|
||||||
<span th:text="${course.courseName}"></span>
|
<span th:text="${course.courseName}"></span>
|
||||||
</button>
|
</button>
|
||||||
<p style="width: 120px;"><button type="button" class="btn btn-danger w-100"
|
|
||||||
|
<p th:if="${course.courseId > 6}" style="width: 120px;"><button type="button" class="btn btn-danger w-100"
|
||||||
th:attr="data-course-id=${course.courseId}" onclick="deleteCourse(this)">削除</button></p>
|
th:attr="data-course-id=${course.courseId}" onclick="deleteCourse(this)">削除</button></p>
|
||||||
</h2>
|
</h2>
|
||||||
<div th:id="'collapse' + ${course.courseId}" class="accordion-collapse collapse"
|
<div th:id="'collapse' + ${course.courseId}" class="accordion-collapse collapse"
|
||||||
|
|||||||
@@ -122,6 +122,16 @@
|
|||||||
|
|
||||||
const tType = '[[${session.tType}]]';
|
const tType = '[[${session.tType}]]';
|
||||||
|
|
||||||
|
console.log("tType: " + tType);
|
||||||
|
|
||||||
|
if (tType.includes("0")) {
|
||||||
|
console.log("okokokokokokokkkokokokoko");
|
||||||
|
transactionType.value = "0";
|
||||||
|
} else if (tType.includes("1")) {
|
||||||
|
transactionType.value = "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function toggleCategory() {
|
function toggleCategory() {
|
||||||
|
|
||||||
if (transactionType.value === "0") {
|
if (transactionType.value === "0") {
|
||||||
@@ -164,12 +174,6 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (tType == "0") {
|
|
||||||
transactionType.value = "0";
|
|
||||||
} else if (tType == "1") {
|
|
||||||
transactionType.value = "1";
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleCategory();
|
toggleCategory();
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user