Merge branch 's-choi' of https://gitea.it-college.co.jp/2026_09_5H_Spring_KIZAKI/Monegement into s-morimto
This commit is contained in:
@@ -28,6 +28,7 @@ import com.example.demo.app.domain.service.UserService;
|
|||||||
import com.example.demo.app.presentation.form.CategoryForm;
|
import com.example.demo.app.presentation.form.CategoryForm;
|
||||||
import com.example.demo.app.presentation.form.Expense;
|
import com.example.demo.app.presentation.form.Expense;
|
||||||
import com.example.demo.app.presentation.form.FixedCostForm;
|
import com.example.demo.app.presentation.form.FixedCostForm;
|
||||||
|
import com.example.demo.app.presentation.form.GoalForm;
|
||||||
import com.example.demo.app.presentation.form.Income;
|
import com.example.demo.app.presentation.form.Income;
|
||||||
import com.example.demo.app.presentation.form.TransactionForm;
|
import com.example.demo.app.presentation.form.TransactionForm;
|
||||||
import com.example.demo.app.presentation.form.UserForm;
|
import com.example.demo.app.presentation.form.UserForm;
|
||||||
@@ -371,19 +372,24 @@ public class TransactionController {
|
|||||||
model.addAttribute("totalIncome", totalIncome);
|
model.addAttribute("totalIncome", totalIncome);
|
||||||
model.addAttribute("totalExpense", totalExpense);
|
model.addAttribute("totalExpense", totalExpense);
|
||||||
|
|
||||||
// List<GoalForm> goalForm = GoalForm.convertFrom(goalService.getGoalByUserId(loginUser.getUserId()));
|
List<GoalForm> goalForm = GoalForm.convertFrom(goalService.getGoalByUserId(loginUser.getUserId()));
|
||||||
|
|
||||||
UserForm userForm = UserForm.convertFrom(userService.findByUserId(loginUser.getUserId()));
|
UserForm userForm = UserForm.convertFrom(userService.findByUserId(loginUser.getUserId()));
|
||||||
|
|
||||||
// model.addAttribute("achievementRate", goalForm.getAchievementRate());
|
List<GoalForm> resultList = goalForm.stream().filter(goal -> goal.getGoalComplete() == 0)
|
||||||
//
|
.collect(Collectors.toList());
|
||||||
// model.addAttribute("currentAmount", goalForm.getCurrentAmount());
|
|
||||||
//
|
GoalForm result = resultList.getFirst();
|
||||||
// model.addAttribute("targetAmount", goalForm.getTargetAmount());
|
|
||||||
|
model.addAttribute("achievementRate", result.getAchievementRate());
|
||||||
|
|
||||||
|
model.addAttribute("currentAmount", result.getCurrentAmount());
|
||||||
|
|
||||||
|
model.addAttribute("targetAmount", result.getTargetAmount());
|
||||||
|
|
||||||
model.addAttribute("saving", userForm.getSaving());
|
model.addAttribute("saving", userForm.getSaving());
|
||||||
|
|
||||||
// model.addAttribute("deadline", goalForm.getDeadline());
|
model.addAttribute("deadline", result.getDeadline());
|
||||||
|
|
||||||
return "menu";
|
return "menu";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user