Compare commits
11 Commits
03b1b7d982
...
s-morimto
| Author | SHA1 | Date | |
|---|---|---|---|
| acd7534fdb | |||
| ee5ec5009d | |||
| 7604e9ee76 | |||
| 26fa2365e8 | |||
| 5adb527d7a | |||
| e54e0133f7 | |||
| c3dae348bf | |||
| ea1e18ad93 | |||
| bb3b8965b2 | |||
| 3b239d07bd | |||
| 0c54a42b97 |
@@ -47,7 +47,7 @@ public class GlobalExceptionHandler {
|
||||
|
||||
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();
|
||||
|
||||
return "error";
|
||||
@@ -61,7 +61,7 @@ public class GlobalExceptionHandler {
|
||||
|
||||
LOGGER.log(Level.SEVERE, SEVERE_ERROR_MESSAGE_ILLEGAL_TRANSITION, e);
|
||||
|
||||
System.out.println("session invalidated exception");
|
||||
System.out.println("session invalidated");
|
||||
session.invalidate();
|
||||
|
||||
return "error";
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.example.demo.app.infra.entity;
|
||||
|
||||
public class TestController6 {
|
||||
|
||||
}
|
||||
@@ -57,7 +57,8 @@ public class ProfileController {
|
||||
profileModel.getBirthDate(),
|
||||
profileModel.getSaving(),
|
||||
profileModel.getAnnualIncome(),
|
||||
profileModel.getMonthlyBudget());
|
||||
profileModel.getMonthlyBudget(),
|
||||
profileModel.getBirthDate());
|
||||
|
||||
model.addAttribute(PageReturnAttributeKeyword.PROFILE_EDIT_FORM, profileEditForm);
|
||||
return TransitionTargetPageNameKeyword.PROFILE_EDIT_HTML;
|
||||
|
||||
@@ -353,29 +353,29 @@ public class TransactionController {
|
||||
@RequestParam(required = false, defaultValue = "0") String months) {
|
||||
|
||||
LoginModel loginUser = (LoginModel) session.getAttribute(SessionKeyword.LOGIN_USER);
|
||||
System.out.println("******************************************::1");
|
||||
|
||||
LocalDate today = LocalDate.now();
|
||||
System.out.println("******************************************::2");
|
||||
|
||||
int year = (years.equals("0")) ? today.getYear() : Integer.parseInt(years);
|
||||
System.out.println("******************************************::3");
|
||||
|
||||
int month = (months.equals("0")) ? today.getMonthValue() : Integer.parseInt(months);
|
||||
System.out.println("******************************************::4");
|
||||
|
||||
YearMonth yearMonth = YearMonth.of(year, month);
|
||||
System.out.println("******************************************::5");
|
||||
|
||||
int lastDay = yearMonth.lengthOfMonth();
|
||||
System.out.println("******************************************::6");
|
||||
|
||||
int firstDayOfWeek = yearMonth.atDay(1).getDayOfWeek().getValue() % 7;
|
||||
System.out.println("******************************************::7");
|
||||
|
||||
YearMonth previousYearMonth = yearMonth.minusMonths(1);
|
||||
System.out.println("******************************************::8");
|
||||
|
||||
int previousYear = previousYearMonth.getYear();
|
||||
int previousMonth = previousYearMonth.getMonthValue();
|
||||
System.out.println("******************************************::9");
|
||||
|
||||
YearMonth nextYearMonth = yearMonth.plusMonths(1);
|
||||
System.out.println("******************************************::10");
|
||||
|
||||
int nextYear = nextYearMonth.getYear();
|
||||
int nextMonth = nextYearMonth.getMonthValue();
|
||||
System.out.println("******************************************::11");
|
||||
|
||||
model.addAttribute(PageReturnAttributeKeyword.YEAR, year);
|
||||
model.addAttribute(PageReturnAttributeKeyword.MONTH, month);
|
||||
model.addAttribute(PageReturnAttributeKeyword.DAY, today.getDayOfMonth());
|
||||
@@ -388,34 +388,34 @@ public class TransactionController {
|
||||
|
||||
model.addAttribute(PageReturnAttributeKeyword.NEXT_YEAR, nextYear);
|
||||
model.addAttribute(PageReturnAttributeKeyword.NEXT_MONTH, nextMonth);
|
||||
System.out.println("******************************************::12");
|
||||
|
||||
LocalDate startDate = yearMonth.atDay(1);
|
||||
LocalDate endDate = yearMonth.atEndOfMonth();
|
||||
System.out.println("******************************************::13");
|
||||
|
||||
List<Income> incomeList = transactionService.findTotalIncomeList(startDate, endDate, loginUser.getUserId());
|
||||
System.out.println("******************************************::14");
|
||||
|
||||
List<Expense> expenseList = transactionService.findTotalExpenseList(startDate, endDate, loginUser.getUserId());
|
||||
System.out.println("******************************************::15");
|
||||
|
||||
model.addAttribute(PageReturnAttributeKeyword.INCOME_LIST, incomeList);
|
||||
model.addAttribute(PageReturnAttributeKeyword.EXPENSE_LIST, expenseList);
|
||||
System.out.println("******************************************::16");
|
||||
|
||||
int totalIncome = transactionService.findTotalIncome(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_EXPENSE, totalExpense);
|
||||
System.out.println("******************************************::18");
|
||||
|
||||
List<GoalForm> goalForm = GoalForm.convertFrom(goalService.getGoalByUserId(loginUser.getUserId()));
|
||||
System.out.println("******************************************::19");
|
||||
|
||||
UserForm userForm = UserForm.convertFrom(userService.findByUserId(loginUser.getUserId()));
|
||||
System.out.println("******************************************::20");
|
||||
|
||||
List<GoalForm> resultList = goalForm.stream().filter(goal -> goal.getGoalComplete() == 0)
|
||||
.collect(Collectors.toList());
|
||||
System.out.println("******************************************::21");
|
||||
|
||||
if (!resultList.isEmpty()) {
|
||||
GoalForm result = resultList.getFirst();
|
||||
System.out.println("******************************************::22");
|
||||
|
||||
model.addAttribute(PageReturnAttributeKeyword.ACHIEVEMENT_RATE, result.getAchievementRate());
|
||||
|
||||
model.addAttribute(PageReturnAttributeKeyword.CURRENT_AMOUNT, result.getCurrentAmount());
|
||||
|
||||
@@ -16,4 +16,5 @@ public class ProfileEditForm {
|
||||
private Integer saving;
|
||||
private Integer annualIncome;
|
||||
private Integer monthlyBudget;
|
||||
private LocalDate birthDate;
|
||||
}
|
||||
|
||||
@@ -138,6 +138,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card shadow-sm">
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
<body style="padding-bottom: 120px">
|
||||
<div th:replace="~{header :: header}"></div>
|
||||
|
||||
<h1 class="page-title">コース選択</h1>
|
||||
|
||||
<th:block th:if="${mode == 'change'}">
|
||||
|
||||
@@ -1,153 +1,153 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1" http-equiv="Content-Type">
|
||||
<title>収支詳細</title>
|
||||
<link rel="stylesheet" th:href="@{/css/transaction_detail.css}">
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
<body style="padding-top:80px; padding-bottom:80px;">
|
||||
|
||||
|
||||
<div th:replace="~{header :: header}"></div>
|
||||
<div class="main-container">
|
||||
|
||||
|
||||
<h2 class="page-title"
|
||||
th:text="${today}">
|
||||
</h2>
|
||||
|
||||
|
||||
<div th:each="transactionForm : ${transactionFormList}"
|
||||
class="card shadow-sm mb-3">
|
||||
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<div class="d-flex justify-content-between">
|
||||
|
||||
|
||||
<span class="fw-bold"
|
||||
th:text="${transactionForm.categoryName}">
|
||||
</span>
|
||||
|
||||
|
||||
<span th:text="'¥' + ${transactionForm.amount}">
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="d-flex justify-content-end gap-2 mt-3">
|
||||
|
||||
|
||||
<form th:action="@{/transaction/update}"
|
||||
method="get">
|
||||
|
||||
|
||||
<input type="hidden"
|
||||
name="today"
|
||||
th:value="${today}">
|
||||
|
||||
|
||||
<input type="hidden"
|
||||
name="transactionId"
|
||||
th:value="${transactionForm.transactionId}">
|
||||
|
||||
|
||||
<button class="btn btn-sm btn-primary"
|
||||
type="submit">
|
||||
|
||||
|
||||
編集
|
||||
|
||||
|
||||
</button>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<form th:action="@{/transaction/delete}"
|
||||
method="post">
|
||||
|
||||
|
||||
<input type="hidden"
|
||||
name="today"
|
||||
th:value="${today}">
|
||||
|
||||
|
||||
<input type="hidden"
|
||||
name="transactionId"
|
||||
th:value="${transactionForm.transactionId}">
|
||||
|
||||
|
||||
<button class="btn btn-sm btn-danger"
|
||||
type="submit">
|
||||
|
||||
|
||||
削除
|
||||
|
||||
|
||||
</button>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="d-grid mt-4">
|
||||
|
||||
|
||||
<form th:action="@{/transaction/create}"
|
||||
method="get">
|
||||
|
||||
|
||||
<input type="hidden"
|
||||
name="today"
|
||||
id="today"
|
||||
th:value="${today}">
|
||||
|
||||
|
||||
<button class="btn btn-success w-100"
|
||||
type="submit">
|
||||
|
||||
|
||||
新規登録
|
||||
|
||||
|
||||
</button>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="d-grid mt-4">
|
||||
|
||||
|
||||
<form th:action="@{/fixed-cost/list}" method="get">
|
||||
|
||||
|
||||
<input type="hidden"
|
||||
name="today"
|
||||
id="today"
|
||||
th:value="${today}">
|
||||
|
||||
|
||||
<button class="btn btn-dark w-100"
|
||||
type="submit">
|
||||
|
||||
|
||||
固定費一覧
|
||||
|
||||
|
||||
</button>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="d-grid mt-4">
|
||||
|
||||
|
||||
<form th:action="@{/category/list}"
|
||||
method="get">
|
||||
|
||||
|
||||
<input type="hidden"
|
||||
name="today"
|
||||
id="today"
|
||||
th:value="${today}">
|
||||
|
||||
|
||||
<button class="btn btn-dark w-100"
|
||||
type="submit">
|
||||
|
||||
|
||||
カテゴリ一覧
|
||||
|
||||
|
||||
</button>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div th:replace="~{footer :: footer}"></div>
|
||||
</body>
|
||||
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user