Compare commits
42 Commits
s-morimto
...
3818da7b4e
| Author | SHA1 | Date | |
|---|---|---|---|
| 3818da7b4e | |||
| e6b1e676a6 | |||
| b666b32214 | |||
| f37dd792a0 | |||
| fd469405bc | |||
| a995a41656 | |||
|
|
fd1b098e3c | ||
|
|
0b9eff82c5 | ||
| 150b6287c4 | |||
|
|
000c1fa464 | ||
|
|
81b426b579 | ||
|
|
104fa5e319 | ||
|
|
fb031e5255 | ||
|
|
cb5d228db4 | ||
| 438ff59bc2 | |||
|
|
f5c410b352 | ||
|
|
18c51d3a65 | ||
|
|
0162f2f679 | ||
| 109b8125d6 | |||
| 94b526a045 | |||
|
|
31d80388af | ||
| 4a9a1d0898 | |||
| 626c4d6721 | |||
| 759df536a5 | |||
|
|
bce2d01e48 | ||
|
|
6ee8a3aa59 | ||
| 98ebb86673 | |||
| e43958a1fb | |||
|
|
84e55d7606 | ||
| 57a76ae044 | |||
| 4880a4285e | |||
| 03b1b7d982 | |||
| 3a825196e1 | |||
|
|
aad285f9ba | ||
|
|
f1e48b02f9 | ||
| 718b90cee6 | |||
|
|
60e0694731 | ||
|
|
b09fd95c31 | ||
|
|
65282cdcb2 | ||
| 74b7032ffc | |||
|
|
0687a1837e | ||
|
|
2a4150c883 |
@@ -10,6 +10,7 @@ import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.example.demo.app.presentation.controller.pageproperty.SessionKeyword;
|
||||
import com.example.demo.exception.NoSessionException;
|
||||
|
||||
|
||||
@@ -32,7 +33,7 @@ public class SessionCheckAspect {
|
||||
public void checkSession() {
|
||||
HttpSession session = request.getSession(false);
|
||||
|
||||
if (session == null || session.getAttribute("loginUser") == null) {
|
||||
if (session == null || session.getAttribute(SessionKeyword.LOGIN_USER) == null) {
|
||||
throw new NoSessionException("不正なログインです");
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ import org.springframework.web.HttpRequestMethodNotSupportedException;
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
|
||||
import com.example.demo.app.presentation.controller.pageproperty.PageReturnAttributeKeyword;
|
||||
import com.example.demo.app.presentation.controller.pageproperty.TransitionTargetPageNameKeyword;
|
||||
import com.example.demo.exception.NoSessionException;
|
||||
|
||||
@ControllerAdvice
|
||||
@@ -30,40 +32,36 @@ public class GlobalExceptionHandler {
|
||||
LOGGER.log(Level.SEVERE, SEVERE_ERROR_MESSAGE_ILLEGAL_TRANSITION, e);
|
||||
|
||||
model.addAttribute(
|
||||
"errorMessage",
|
||||
PageReturnAttributeKeyword.ERROR_MESSAGE,
|
||||
"システムエラーが発生しました。"
|
||||
+ "初めからやり直してください。");
|
||||
|
||||
return "redirect:/login";
|
||||
return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.LOGIN;
|
||||
|
||||
}
|
||||
|
||||
@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
|
||||
public String handleBadRequestException(Model model, Exception e, HttpSession session) {
|
||||
model.addAttribute("error", SEVERE_ERROR_MESSAGE_BAD_REQUEST);
|
||||
model.addAttribute("status", HttpStatus.BAD_REQUEST.value());
|
||||
model.addAttribute(PageReturnAttributeKeyword.ERROR, SEVERE_ERROR_MESSAGE_BAD_REQUEST);
|
||||
model.addAttribute(PageReturnAttributeKeyword.STATUS, HttpStatus.BAD_REQUEST.value());
|
||||
|
||||
e.printStackTrace();
|
||||
|
||||
LOGGER.log(Level.SEVERE, SEVERE_ERROR_MESSAGE_ILLEGAL_TRANSITION, e);
|
||||
|
||||
System.out.println("session invalidated");
|
||||
System.out.println("session invalidated method not supported exception");
|
||||
session.invalidate();
|
||||
|
||||
return "error";
|
||||
return TransitionTargetPageNameKeyword.ERROR_HTML;
|
||||
}
|
||||
|
||||
@ExceptionHandler(Exception.class)
|
||||
public String AllException(Model model, Exception e, HttpSession session) {
|
||||
model.addAttribute("error", SEVERE_ERROR_MESSAGE_BAD_REQUEST);
|
||||
|
||||
e.printStackTrace();
|
||||
|
||||
LOGGER.log(Level.SEVERE, SEVERE_ERROR_MESSAGE_ILLEGAL_TRANSITION, e);
|
||||
|
||||
System.out.println("session invalidated");
|
||||
System.out.println("session invalidated exception");
|
||||
session.invalidate();
|
||||
|
||||
return "error";
|
||||
return TransitionTargetPageNameKeyword.ERROR_HTML;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class GoalModel {
|
||||
goalModel.getTargetAmount(),
|
||||
goalModel.getDeadline(),
|
||||
0,
|
||||
userEntity, 0);
|
||||
userEntity);
|
||||
}
|
||||
|
||||
public static GoalModel convertFrom(GoalForm goalForm) {
|
||||
|
||||
@@ -25,6 +25,8 @@ public class LoginServiceImpl implements LoginService {
|
||||
|
||||
if (userEntity == null) {
|
||||
return null;
|
||||
} else if (userEntity.getDeleteFlag() == 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
boolean isValidPassword = false;
|
||||
|
||||
@@ -53,13 +53,13 @@ public class UserServiceImpl implements UserService {
|
||||
|
||||
userEntity.setQuestionEntity(questionEntity);
|
||||
|
||||
|
||||
|
||||
userEntity.setCourseEntity(courseEntity);
|
||||
|
||||
userEntity.setDeleteFlag(0);
|
||||
|
||||
userRepository.save(userEntity);
|
||||
goalEntity.setUserEntity(userRepository.save(userEntity));
|
||||
|
||||
goalRepository.save(goalEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,7 +29,7 @@ public class CategoryEntity {
|
||||
@Column(name = "category_id")
|
||||
private Long categoryId;
|
||||
|
||||
@Column(name = "category_name", nullable = false)
|
||||
@Column(name = "category_name", nullable = false, length = 50)
|
||||
private String categoryName;
|
||||
|
||||
@Column(name = "transaction_type", nullable = false)
|
||||
|
||||
@@ -27,7 +27,7 @@ public class CourseEntity {
|
||||
@Column(name = "course_id")
|
||||
private Long courseId;
|
||||
|
||||
@Column(name = "course_name", nullable = false)
|
||||
@Column(name = "course_name", nullable = false, length = 50)
|
||||
private String courseName;
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class FixedCostEntity {
|
||||
@JoinColumn(name = "category_id")
|
||||
private CategoryEntity categoryEntity;
|
||||
|
||||
@Column(name = "fixed_cost_name", nullable = false)
|
||||
@Column(name = "fixed_cost_name", nullable = false, length = 50)
|
||||
private String fixedCostName;
|
||||
|
||||
@Column(name = "amount", nullable = false)
|
||||
|
||||
@@ -29,10 +29,10 @@ public class GoalEntity {
|
||||
private Long goalId;
|
||||
|
||||
@Column(name = "goal_title", nullable = true)
|
||||
private String goalTitle;
|
||||
private String goalTitle = "名前を設定してください";
|
||||
|
||||
@Column(name = "goal_subtitle", nullable = true)
|
||||
private String goalSubtitle;
|
||||
private String goalSubtitle = "説明を書いてください";
|
||||
|
||||
@Column(name = "target_amount", nullable = true)
|
||||
private Integer targetAmount;
|
||||
@@ -47,6 +47,4 @@ public class GoalEntity {
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserEntity userEntity;
|
||||
|
||||
private Integer deleteFlag;
|
||||
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class UserEntity {
|
||||
@Column(name = "user_id")
|
||||
private Long userId;
|
||||
|
||||
@Column(name = "user_name", nullable = false)
|
||||
@Column(name = "user_name", nullable = false, length = 100)
|
||||
private String userName;
|
||||
|
||||
@Column(name = "mail_address", nullable = false)
|
||||
@@ -39,7 +39,7 @@ public class UserEntity {
|
||||
@Column(name = "password", nullable = false)
|
||||
private String password;
|
||||
|
||||
@Column(name = "secret_answer", nullable = false)
|
||||
@Column(name = "secret_answer", nullable = false, length = 100)
|
||||
private String secretQuestionAnswer;
|
||||
|
||||
@Column(name = "birth_date", nullable = false)
|
||||
|
||||
@@ -125,15 +125,6 @@ public class CourseController {
|
||||
|
||||
List<AllocationModel> allocationModelList = new ArrayList<>();
|
||||
|
||||
allocationModelList.add(new AllocationModel(allocationFormList.getCategoryId1(),
|
||||
(Long) session.getAttribute(PageReturnAttributeKeyword.COURSE_ID),
|
||||
allocationFormList.getAllocationRatio1()));
|
||||
allocationModelList.add(new AllocationModel(allocationFormList.getCategoryId2(),
|
||||
(Long) session.getAttribute(PageReturnAttributeKeyword.COURSE_ID),
|
||||
allocationFormList.getAllocationRatio2()));
|
||||
allocationModelList.add(new AllocationModel(allocationFormList.getCategoryId3(),
|
||||
(Long) session.getAttribute(PageReturnAttributeKeyword.COURSE_ID),
|
||||
allocationFormList.getAllocationRatio3()));
|
||||
allocationModelList.add(new AllocationModel(allocationFormList.getCategoryId4(),
|
||||
(Long) session.getAttribute(PageReturnAttributeKeyword.COURSE_ID),
|
||||
allocationFormList.getAllocationRatio4()));
|
||||
|
||||
@@ -11,4 +11,5 @@ public class ErrorController {
|
||||
public String showError() {
|
||||
return TransitionTargetPageNameKeyword.ERROR_HTML;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -57,6 +57,8 @@ public class GoalController {
|
||||
|
||||
Long userId = loginUser.getUserId();
|
||||
|
||||
LocalDate today = LocalDate.now();
|
||||
|
||||
goalService.updateGoalComplete(userId);
|
||||
|
||||
List<GoalModel> goalModelList = goalService.getGoalByUserId(userId);
|
||||
@@ -64,7 +66,8 @@ public class GoalController {
|
||||
List<GoalForm> goalFormList1 = GoalForm.convertFrom(goalModelList);
|
||||
|
||||
List<GoalForm> goalFormList = goalFormList1.stream()
|
||||
.filter(goalForm -> goalForm.getGoalComplete() == 0)
|
||||
.filter(goalForm -> goalForm.getGoalComplete() == 0
|
||||
&& !goalForm.getDeadline().isBefore(today))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
model.addAttribute(
|
||||
@@ -107,8 +110,6 @@ public class GoalController {
|
||||
1,
|
||||
1);
|
||||
|
||||
LocalDate today = LocalDate.now();
|
||||
|
||||
Map<LocalDate, List<TransactionForm>> transactionFormMap = new HashMap<>();
|
||||
|
||||
transactionService
|
||||
@@ -238,7 +239,6 @@ public class GoalController {
|
||||
|
||||
GoalForm goalForm = GoalForm.convertFrom(goalService.getGoalById(goalId));
|
||||
|
||||
|
||||
model.addAttribute(PageReturnAttributeKeyword.GOAL_FORM, goalForm);
|
||||
return TransitionTargetPageNameKeyword.GOAL_EDIT_HTML;
|
||||
|
||||
@@ -275,7 +275,7 @@ public class GoalController {
|
||||
|
||||
int currentAmount = goalService.getCurrentAmount(userId);
|
||||
|
||||
model.addAttribute("currentAmount", currentAmount);
|
||||
model.addAttribute(PageReturnAttributeKeyword.CURRENT_AMOUNT, currentAmount);
|
||||
|
||||
return TransitionTargetPageNameKeyword.GOAL_CREATE_HTML;
|
||||
}
|
||||
@@ -305,7 +305,8 @@ public class GoalController {
|
||||
if (record == null) {
|
||||
return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.GOAL;
|
||||
} else {
|
||||
return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.GOAL + TransitionTargetPageNameKeyword.RECORD;
|
||||
return TransitionTargetPageNameKeyword.REDIRECT + TransitionTargetPageNameKeyword.GOAL
|
||||
+ TransitionTargetPageNameKeyword.RECORD;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -314,6 +315,8 @@ public class GoalController {
|
||||
@GetMapping(TransitionTargetPageNameKeyword.RECORD)
|
||||
public String getRecord(HttpSession session, Model model) {
|
||||
|
||||
LocalDate today = LocalDate.now();
|
||||
|
||||
LoginModel loginUser = (LoginModel) session.getAttribute(SessionKeyword.LOGIN_USER);
|
||||
|
||||
Long userId = loginUser.getUserId();
|
||||
@@ -325,7 +328,13 @@ public class GoalController {
|
||||
List<GoalForm> goalCompleteFormList = new ArrayList<>();
|
||||
|
||||
goalFormList.stream().forEach(goalForm -> {
|
||||
if (goalForm.getGoalComplete() == 1) {
|
||||
if (goalForm.getGoalComplete() == 1 || goalForm.getDeadline().isBefore(today)) {
|
||||
|
||||
goalForm.setStatus(
|
||||
goalForm.getGoalComplete() == 1
|
||||
? "達成"
|
||||
: "未達成");
|
||||
|
||||
goalCompleteFormList.add(goalForm);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -57,8 +57,7 @@ public class ProfileController {
|
||||
profileModel.getBirthDate(),
|
||||
profileModel.getSaving(),
|
||||
profileModel.getAnnualIncome(),
|
||||
profileModel.getMonthlyBudget(),
|
||||
profileModel.getBirthDate());
|
||||
profileModel.getMonthlyBudget());
|
||||
|
||||
model.addAttribute(PageReturnAttributeKeyword.PROFILE_EDIT_FORM, profileEditForm);
|
||||
return TransitionTargetPageNameKeyword.PROFILE_EDIT_HTML;
|
||||
|
||||
@@ -238,7 +238,7 @@ public class TransactionController {
|
||||
|
||||
model.addAttribute(PageReturnAttributeKeyword.TRANSACTION_FORM, transactionForm);
|
||||
|
||||
session.setAttribute("tType", String.valueOf(transactionForm.getTransactionType()));
|
||||
session.setAttribute(SessionKeyword.T_TYPE, String.valueOf(transactionForm.getTransactionType()));
|
||||
|
||||
model.addAttribute(PageReturnAttributeKeyword.CATEGORY_FORM_LIST, categoryFormList);
|
||||
|
||||
@@ -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,6 +16,7 @@ import com.example.demo.app.domain.service.QuestionService;
|
||||
import com.example.demo.app.domain.service.UserService;
|
||||
import com.example.demo.app.infra.entity.QuestionEntity;
|
||||
import com.example.demo.app.presentation.controller.pageproperty.PageReturnAttributeKeyword;
|
||||
import com.example.demo.app.presentation.controller.pageproperty.SessionKeyword;
|
||||
import com.example.demo.app.presentation.controller.pageproperty.TransitionTargetPageNameKeyword;
|
||||
import com.example.demo.app.presentation.form.UserForm;
|
||||
|
||||
@@ -58,7 +59,7 @@ public class UserController {
|
||||
model.addAttribute(PageReturnAttributeKeyword.SELECTED_COURSE_NAME, courseService.findById(courseId).getCourseName());
|
||||
}
|
||||
|
||||
session.setAttribute(PageReturnAttributeKeyword.SELECTED_COURSE_NAME, courseService.findById(courseId).getCourseName());
|
||||
session.setAttribute(SessionKeyword.SELECTED_COURSE_NAME, courseService.findById(courseId).getCourseName());
|
||||
model.addAttribute(PageReturnAttributeKeyword.COURSE_ID, courseId);
|
||||
model.addAttribute(PageReturnAttributeKeyword.USER_FORM, userForm);
|
||||
|
||||
@@ -70,11 +71,9 @@ public class UserController {
|
||||
String selectedCourseName, Model model,
|
||||
HttpSession session) {
|
||||
|
||||
model.addAttribute(PageReturnAttributeKeyword.SELECTED_COURSE_NAME, (String) session.getAttribute("selectedCourseName"));
|
||||
model.addAttribute(PageReturnAttributeKeyword.SELECTED_COURSE_NAME, (String) session.getAttribute(SessionKeyword.SELECTED_COURSE_NAME));
|
||||
|
||||
session.setAttribute("questionId", userForm.getSecretQuestionId());
|
||||
|
||||
System.out.println("return questionId: ****************************:" + userForm.getSecretQuestionId());
|
||||
session.setAttribute(SessionKeyword.QUESTION_ID, userForm.getSecretQuestionId());
|
||||
|
||||
return TransitionTargetPageNameKeyword.USER_RESISTER_CONFIRM_HTML;
|
||||
|
||||
@@ -86,11 +85,9 @@ public class UserController {
|
||||
Model model,
|
||||
HttpSession session) {
|
||||
|
||||
Long courseId = courseService.findByName((String) session.getAttribute(PageReturnAttributeKeyword.SELECTED_COURSE_NAME));
|
||||
Long courseId = courseService.findByName((String) session.getAttribute(SessionKeyword.SELECTED_COURSE_NAME));
|
||||
|
||||
Long questionId = (Long) session.getAttribute("questionId");
|
||||
|
||||
System.out.println("confirm questionId: ****************************:" + questionId);
|
||||
Long questionId = (Long) session.getAttribute(SessionKeyword.QUESTION_ID);
|
||||
|
||||
userForm.setSecretQuestionId(questionId);
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ public class PageReturnAttributeKeyword {
|
||||
|
||||
public static final String ERROR_MESSAGE = "errorMessage";
|
||||
public static final String MESSAGE = "message";
|
||||
|
||||
public static final String ERROR = "error";
|
||||
public static final String STATUS = "status";
|
||||
|
||||
public static final String QUESTION_LIST = "questionList";
|
||||
public static final String USER_FORM = "userForm";
|
||||
|
||||
@@ -3,4 +3,10 @@ package com.example.demo.app.presentation.controller.pageproperty;
|
||||
public class SessionKeyword {
|
||||
// SESSION情報として格納したいログイン者の情報
|
||||
public static final String LOGIN_USER = "loginUser";
|
||||
|
||||
public static final String SELECTED_COURSE_NAME = "selectedCourseName";
|
||||
|
||||
public static final String QUESTION_ID = "questionId";
|
||||
|
||||
public static final String T_TYPE = "tType";
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ public class GoalForm {
|
||||
|
||||
private Integer goalComplete;
|
||||
|
||||
private String status;
|
||||
|
||||
private Integer achievementRate; // 達成率
|
||||
|
||||
private Integer currentAmount; // 現在の資産
|
||||
@@ -43,6 +45,7 @@ public class GoalForm {
|
||||
goalModel.getTargetAmount(),
|
||||
goalModel.getDeadline(),
|
||||
goalModel.getGoalComplete(),
|
||||
null,
|
||||
goalModel.getAchievementRate(),
|
||||
goalModel.getCurrentAmount(),
|
||||
goalModel.getUserId());
|
||||
|
||||
@@ -16,5 +16,4 @@ public class ProfileEditForm {
|
||||
private Integer saving;
|
||||
private Integer annualIncome;
|
||||
private Integer monthlyBudget;
|
||||
private LocalDate birthDate;
|
||||
}
|
||||
|
||||
@@ -46,6 +46,10 @@ body {
|
||||
border-top: 1px solid #d0d7de;
|
||||
}
|
||||
|
||||
.a-footer {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* =======================
|
||||
カード
|
||||
======================= */
|
||||
@@ -178,6 +182,10 @@ td:hover {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.a-calender {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* =======================
|
||||
金額表示
|
||||
======================= */
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<table class="table text-center">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">カテゴリ別</th>
|
||||
<th scope="col"></th>
|
||||
<th scope="col">支出</th>
|
||||
<th scope="col">前月比</th>
|
||||
</tr>
|
||||
@@ -47,7 +47,7 @@
|
||||
0
|
||||
</td>
|
||||
<td th:text="${analysisForm.totalDifferenceAmount >= 0}
|
||||
? '+' + ${analysisForm.totalDifferenceAmount}
|
||||
? '+' + ${analysisForm.totalDifferenceAmount}
|
||||
: ${analysisForm.totalDifferenceAmount}"
|
||||
th:class="${analysisForm.totalDifferenceAmount >= 0}
|
||||
? 'text-danger'
|
||||
@@ -73,16 +73,14 @@
|
||||
|
||||
<th scope="row"
|
||||
th:text="${category.categoryName}">
|
||||
食費
|
||||
</th>
|
||||
|
||||
<td th:text="'¥' + ${category.currentMonthAmount}">
|
||||
0
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<span th:text="${category.monthDifferenceAmount >= 0}
|
||||
? '+' + ${category.monthDifferenceAmount}
|
||||
? '+' + ${category.monthDifferenceAmount}
|
||||
: ${category.monthDifferenceAmount}"
|
||||
th:class="${category.monthDifferenceAmount >= 0}
|
||||
? 'text-danger'
|
||||
@@ -90,7 +88,7 @@
|
||||
</span>
|
||||
<br>
|
||||
<span th:text="${category.courseDifferenceAmount >= 0}
|
||||
? '+' + ${category.courseDifferenceAmount}
|
||||
? '+' + ${category.courseDifferenceAmount}
|
||||
: ${category.courseDifferenceAmount}"
|
||||
th:class="${category.courseDifferenceAmount >= 0}
|
||||
? 'text-danger'
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="categoryName">カテゴリ名</label>
|
||||
|
||||
<input class="form-control" type="text" id="categoryName" th:field="*{categoryName}">
|
||||
<input class="form-control" type="text" id="categoryName" th:field="*{categoryName}" required>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
@@ -33,7 +33,7 @@
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="transactionType">収入・支出</label>
|
||||
|
||||
<select class="form-select" id="transactionType" th:field="*{transactionType}">
|
||||
<select class="form-select" id="transactionType" th:field="*{transactionType}" required>
|
||||
|
||||
<option value="">選択してください</option>
|
||||
<option value="0">支出</option>
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body class="pb-5 pt-5">
|
||||
<body style="padding-top:80px; padding-bottom:80px;">
|
||||
|
||||
<div th:replace="~{header :: header}"></div>
|
||||
<div class="main-container">
|
||||
|
||||
<div>
|
||||
<ul>
|
||||
<ul class="list-unstyled p-0 m-0">
|
||||
<li class="card shadow-sm mb-3" th:each="categoryForm : ${categoryFormList}">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between">
|
||||
@@ -49,20 +49,30 @@
|
||||
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<hr>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="d-grid mt-4">
|
||||
|
||||
<form th:action="@{/category/create}" method="get">
|
||||
<input type="hidden" name="today" id="today" th:value="${today}">
|
||||
<button type="submit">新規登録</button>
|
||||
|
||||
<input type="hidden"
|
||||
name="today"
|
||||
id="today"
|
||||
th:value="${today}">
|
||||
|
||||
<button class="btn btn-success w-100" type="submit">
|
||||
新規登録
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div th:replace="~{footer :: footer}"></div>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="categoryName">カテゴリ名</label>
|
||||
|
||||
<input class="form-control" type="text" id="categoryName" th:field="*{categoryName}">
|
||||
<input class="form-control" type="text" id="categoryName" th:field="*{categoryName}" required>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
@@ -33,7 +33,7 @@
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="transactionType">収入・支出</label>
|
||||
|
||||
<select class="form-select" id="transactionType" th:field="*{transactionType}">
|
||||
<select class="form-select" id="transactionType" th:field="*{transactionType}" required>
|
||||
|
||||
<option value="">選択してください</option>
|
||||
<option value="0">支出</option>
|
||||
@@ -47,7 +47,7 @@
|
||||
<input type="hidden" name="categoryId" th:value="${categoryId}">
|
||||
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-primary">登録</button>
|
||||
<button type="submit" class="btn btn-primary">更新</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="courseName">コース名</label>
|
||||
|
||||
<input class="form-control" type="text" id="courseName" th:field="*{courseName}">
|
||||
<input class="form-control" type="text" id="courseName" th:field="*{courseName}" required>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
@@ -22,86 +22,70 @@
|
||||
<form th:action="@{/course/create}" th:object="${allocationFormList}" method="post">
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="allocationRatio1">給与</label>
|
||||
<input class="form-control" type="number" id="allocationRatio1" th:field="*{allocationRatio1}">
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="allocationRatio2">賞与</label>
|
||||
<input class="form-control" type="number" id="allocationRatio2" th:field="*{allocationRatio2}">
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="allocationRatio3">その他</label>
|
||||
<input class="form-control" type="number" id="allocationRatio3" th:field="*{allocationRatio3}">
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="allocationRatio4">固定費</label>
|
||||
<input class="form-control" type="number" id="allocationRatio4" th:field="*{allocationRatio4}">
|
||||
<input class="form-control" type="number" min="0" max="100" onchange="inputChange()" id="allocationRatio4" th:field="*{allocationRatio4}" required>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="allocationRatio5">食費</label>
|
||||
<input class="form-control" type="number" id="allocationRatio5" th:field="*{allocationRatio5}">
|
||||
<input class="form-control" type="number" min="0" max="100" onchange="inputChange()" id="allocationRatio5" th:field="*{allocationRatio5}" required>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="allocationRatio6">交通費</label>
|
||||
<input class="form-control" type="number" id="allocationRatio6" th:field="*{allocationRatio6}">
|
||||
<input class="form-control" type="number" min="0" max="100" onchange="inputChange()" id="allocationRatio6" th:field="*{allocationRatio6}" required>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="allocationRatio7">日用品費</label>
|
||||
<input class="form-control" type="number" id="allocationRatio7" th:field="*{allocationRatio7}">
|
||||
<input class="form-control" type="number" min="0" max="100" onchange="inputChange()" id="allocationRatio7" th:field="*{allocationRatio7}" required>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="allocationRatio8">被服/美容費</label>
|
||||
<input class="form-control" type="number" id="allocationRatio8" th:field="*{allocationRatio8}">
|
||||
<input class="form-control" type="number" min="0" max="100" onchange="inputChange()" id="allocationRatio8" th:field="*{allocationRatio8}" required>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="allocationRatio9">医療費</label>
|
||||
<input class="form-control" type="number" id="allocationRatio9" th:field="*{allocationRatio9}">
|
||||
<input class="form-control" type="number" min="0" max="100" onchange="inputChange()" id="allocationRatio9" th:field="*{allocationRatio9}" required>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="allocationRatio10">趣味/娯楽費</label>
|
||||
<input class="form-control" type="number" id="allocationRatio10"
|
||||
th:field="*{allocationRatio10}">
|
||||
<input class="form-control" type="number" min="0" max="100" onchange="inputChange()" id="allocationRatio10"
|
||||
th:field="*{allocationRatio10}" required>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="allocationRatio11">その他</label>
|
||||
<input class="form-control" type="number" id="allocationRatio11"
|
||||
th:field="*{allocationRatio11}">
|
||||
<input class="form-control" type="number" min="0" max="100" onchange="inputChange()" id="allocationRatio11"
|
||||
th:field="*{allocationRatio11}" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="allocationRatioTotal">合計(%)</label>
|
||||
<input class="form-control" type="number" value="0" id="allocationRatioTotal" readonly>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-primary">登録</button>
|
||||
<button type="submit" class="btn btn-primary" id="submit" disabled="true">登録</button>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
@@ -111,6 +95,26 @@
|
||||
|
||||
<div th:replace="~{footer :: footer}"></div>
|
||||
|
||||
<script>
|
||||
|
||||
function inputChange(){
|
||||
let total=0;
|
||||
|
||||
for(let i=4; i<=11; i++){
|
||||
total += Number(document.getElementById(`allocationRatio${i}`).value || 0);
|
||||
if(total == 100){
|
||||
document.getElementById('submit').disabled = false;
|
||||
}else{
|
||||
document.getElementById('submit').disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.getElementById("allocationRatioTotal").value = total;
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<link rel="stylesheet" th:href="@{/css/style.css}">
|
||||
</head>
|
||||
|
||||
<body class="pb-5 pt-5">
|
||||
<body style="padding-top:80px; padding-bottom:80px;">
|
||||
|
||||
<div th:replace="~{header :: header}"></div>
|
||||
<div class="main-container">
|
||||
@@ -19,7 +19,7 @@
|
||||
<h2 class="page-title" th:text="${today}"></h2>
|
||||
|
||||
<div>
|
||||
<ul>
|
||||
<ul class="list-unstyled p-0 m-0">
|
||||
<li th:each="fixedCostForm : ${fixedCostFormList}" class="card shadow-sm mb-3">
|
||||
|
||||
<div class="card-body">
|
||||
@@ -52,21 +52,29 @@
|
||||
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<hr>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="d-grid mt-4">
|
||||
|
||||
<form th:action="@{/category/create}" method="get">
|
||||
|
||||
<input type="hidden"
|
||||
name="today"
|
||||
id="today"
|
||||
th:value="${today}">
|
||||
|
||||
<button class="btn btn-success w-100" type="submit">
|
||||
新規登録
|
||||
</button>
|
||||
|
||||
<form th:action="@{/fixed-cost/create}" method="get">
|
||||
<input type="hidden" name="today" id="today" th:value="${today}">
|
||||
<button type="submit">新規登録</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div th:replace="~{footer :: footer}"></div>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
<select class="form-select" id="transactionType">
|
||||
|
||||
<option value="">選択してください</option>
|
||||
<option value="1">支出</option>
|
||||
<option value="2">収入</option>
|
||||
<option value="0">支出</option>
|
||||
<option value="1">収入</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
@@ -70,7 +70,7 @@
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="amount">金額</label>
|
||||
|
||||
<input class="form-control" type="number" id="amount" th:field="*{amount}" min="0" placeholder="金額を入力してください"
|
||||
<input class="form-control" type="number" id="amount" th:field="*{amount}" min="1" placeholder="金額を入力してください"
|
||||
required>
|
||||
</div>
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
|
||||
transactionType.addEventListener("change", function () {
|
||||
|
||||
if (this.value === "1") {
|
||||
if (this.value === "0") {
|
||||
|
||||
for (let i = 0; i < expenseList.length; i++) {
|
||||
expenseList[i].style.display = "";
|
||||
@@ -104,7 +104,7 @@
|
||||
incomeList[i].style.display = "none";
|
||||
}
|
||||
|
||||
} else if (this.value === "2") {
|
||||
} else if (this.value === "1") {
|
||||
|
||||
for (let i = 0; i < expenseList.length; i++) {
|
||||
expenseList[i].style.display = "none";
|
||||
|
||||
@@ -15,22 +15,22 @@
|
||||
<div class="row">
|
||||
<div class="col border-end">
|
||||
<button type="button" class="btn btn-link text-black text-decoration-none">
|
||||
<a th:href="@{/transaction/create}">入力</a>
|
||||
<a th:href="@{/transaction/create}" class="a-footer">入力</a>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col border-end">
|
||||
<button type="button" class="btn btn-link text-black text-decoration-none">
|
||||
<a th:href="@{/transaction/list}">一覧</a>
|
||||
<a th:href="@{/transaction/list}" class="a-footer">一覧</a>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col border-end">
|
||||
<button type="button" class="btn btn-link text-black text-decoration-none">
|
||||
<a th:href="@{/analysis}">分析</a>
|
||||
<a th:href="@{/analysis}" class="a-footer">分析</a>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col border-end">
|
||||
<button type="button" class="btn btn-link text-black text-decoration-none">
|
||||
<a th:href="@{/goal}">目標</a>
|
||||
<a th:href="@{/goal}" class="a-footer">目標</a>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
|
||||
<div>
|
||||
<label>目標名</label>
|
||||
<input type="text" th:field="*{goalTitle}" required>
|
||||
<input type="text" th:field="*{goalTitle}">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>目標説明</label>
|
||||
<textarea th:field="*{goalSubtitle}" required></textarea>
|
||||
<textarea th:field="*{goalSubtitle}"></textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -52,8 +52,11 @@
|
||||
|
||||
</form>
|
||||
|
||||
<div th:replace="~{footer :: footer}"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div th:replace="~{footer :: footer}"></div>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body class="pb-5 pt-5">
|
||||
<body style="padding-top:80px; padding-bottom:80px;">
|
||||
|
||||
<div th:replace="~{header :: header}"></div>
|
||||
|
||||
@@ -47,6 +47,12 @@
|
||||
|
||||
<br>
|
||||
|
||||
状態:
|
||||
<span class="fw-bold" th:text="${goalForm.status}">
|
||||
</span>
|
||||
|
||||
<br>
|
||||
|
||||
</p>
|
||||
|
||||
</form>
|
||||
@@ -74,16 +80,16 @@
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-grid mt-4">
|
||||
<form th:action="@{/goal}" method="get">
|
||||
|
||||
<button class="btn btn-success w-100" type="submit">
|
||||
戻る
|
||||
</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div th:replace="~{footer :: footer}"></div>
|
||||
|
||||
@@ -189,6 +189,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2 mt-4">
|
||||
|
||||
<form th:action="@{/goal/create}" method="get">
|
||||
|
||||
<button type="submit" class="btn btn-success w-100">
|
||||
@@ -205,6 +207,8 @@
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div th:replace="~{footer :: footer}"></div>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -8,10 +8,9 @@
|
||||
|
||||
<title>Calendar</title>
|
||||
|
||||
<link rel="stylesheet" th:href="@{/css/style.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>
|
||||
@@ -64,7 +63,7 @@
|
||||
<a th:if="${week * 7 + weekDay - firstDayOfWeek + 1 >= 1
|
||||
and week * 7 + weekDay - firstDayOfWeek + 1 <= lastDay}" th:href="@{/transaction/detail(
|
||||
todayDates=${T(java.time.LocalDate).of(year, month, week * 7 + weekDay - firstDayOfWeek + 1)}
|
||||
)}">
|
||||
)}" class="a-footer">
|
||||
|
||||
|
||||
<div
|
||||
|
||||
@@ -100,17 +100,17 @@
|
||||
min="0"
|
||||
max="10000000"
|
||||
required>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="d-grid">
|
||||
<button type="submit"
|
||||
class="btn btn-primary">
|
||||
確定
|
||||
編集
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -5,20 +5,23 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<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}">
|
||||
<title>コース選択</title>
|
||||
</head>
|
||||
|
||||
<body style="padding-bottom: 120px">
|
||||
<body style="padding-bottom: 120px; padding-top: 80px;">
|
||||
<div th:replace="~{header :: header}"></div>
|
||||
<h1 class="page-title">コース選択</h1>
|
||||
|
||||
<div class="d-grid gap-2 mt-4">
|
||||
<th:block th:if="${mode == 'change'}">
|
||||
<form th:action="@{/course/create}" method="get">
|
||||
<button type="submit">新規登録</button>
|
||||
<button class="btn btn-success w-100" type="submit">
|
||||
新規登録
|
||||
</button>
|
||||
</form>
|
||||
|
||||
|
||||
</th:block>
|
||||
|
||||
<form th:action="${mode == 'regist'} ? @{/user/register/return}: @{/change}" method="post">
|
||||
<button type="submit" class="btn btn-primary w-100">確定</button>
|
||||
|
||||
@@ -53,6 +56,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<th:block th:if="${mode=='change'}">
|
||||
<div th:replace="~{footer :: footer}"></div>
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
|
||||
<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/menu.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}">
|
||||
<title>取引登録</title>
|
||||
</head>
|
||||
|
||||
<body style="padding-top:80px; padding-bottom:80px;">
|
||||
@@ -45,11 +44,11 @@
|
||||
選択してください
|
||||
</option>
|
||||
|
||||
<option value="1">
|
||||
<option value="0">
|
||||
支出
|
||||
</option>
|
||||
|
||||
<option value="2">
|
||||
<option value="1">
|
||||
収入
|
||||
</option>
|
||||
|
||||
@@ -124,15 +123,15 @@
|
||||
const tType = '[[${session.tType}]]';
|
||||
|
||||
if (tType == "0") {
|
||||
transactionType.value = 0;
|
||||
} else if (tType == "1") {
|
||||
transactionType.value = 1;
|
||||
} else {
|
||||
transactionType.value = 2;
|
||||
}
|
||||
|
||||
|
||||
transactionType.addEventListener("change", function () {
|
||||
|
||||
if (this.value === "1") {
|
||||
if (this.value === "0") {
|
||||
|
||||
for (let i = 0; i < expenseList.length; i++) {
|
||||
expenseList[i].style.display = "";
|
||||
@@ -142,7 +141,7 @@
|
||||
incomeList[i].style.display = "none";
|
||||
}
|
||||
|
||||
} else if (this.value === "2") {
|
||||
} else if (this.value === "1") {
|
||||
|
||||
for (let i = 0; i < expenseList.length; i++) {
|
||||
expenseList[i].style.display = "none";
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="goalId" class="form-label">目標</label>
|
||||
<label for="goalId" class="form-label">目標貯金額</label>
|
||||
<input type="number" id="goalId" class="form-control" th:field="*{goalId}" min="0" required>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user