11 Commits

Author SHA1 Message Date
d65a84ea79 [EDIT]transactionRepositoryにカテゴリ別集計を追記しました。 2026-09-17 13:00:25 +09:00
fbd1746776 Merge branch 's-choi' of https://gitea.it-college.co.jp/2026_09_5H_Spring_KIZAKI/Monegement into n-kawahito 2026-09-17 12:37:53 +09:00
9bc5bd20ac [DELETE&ADD]AnalysisServiceImpl.javaのファイル位置を修正しました 2026-09-17 11:29:54 +09:00
5506f5884b [EDIT]AllocationRepositoryにcategoryId取得の作成 2026-09-17 11:24:37 +09:00
a6a9cb0b63 Merge branch 'k-kobayashi' of https://gitea.it-college.co.jp/2026_09_5H_Spring_KIZAKI/Monegement into n-kawahito 2026-09-17 11:16:43 +09:00
kkazuya
1369d839af Merge branch 's-choi' of https://gitea.it-college.co.jp/2026_09_5H_Spring_KIZAKI/Monegement into k-kobayashi 2026-09-17 11:16:21 +09:00
kkazuya
7f454b852a [ADD] AllocationRepositoryを作成しました。 2026-09-17 11:16:12 +09:00
83e97b7ec1 [ADD]支出分析画面(骨組み)の作成 2026-09-17 10:56:57 +09:00
kkazuya
f1b5e3eaf8 Merge branch 's-choi' of https://gitea.it-college.co.jp/2026_09_5H_Spring_KIZAKI/Monegement into k-kobayashi 2026-09-17 10:49:58 +09:00
kkazuya
59cec2fed7 Merge branch 's-choi' of https://gitea.it-college.co.jp/2026_09_5H_Spring_KIZAKI/Monegement into k-kobayashi 2026-09-17 10:47:23 +09:00
kkazuya
743fe20e9a Merge branch 's-choi' of https://gitea.it-college.co.jp/2026_09_5H_Spring_KIZAKI/Monegement into k-kobayashi 2026-09-17 10:36:08 +09:00
4 changed files with 67 additions and 2 deletions

View File

@@ -1,8 +1,9 @@
package com.example.demo.app.domain.service;
package com.example.demo.app.domain.service.impl;
import org.springframework.stereotype.Service;
import com.example.demo.app.domain.model.AnalysisModel;
import com.example.demo.app.domain.service.AnalysisService;
import lombok.RequiredArgsConstructor;

View File

@@ -1,9 +1,12 @@
package com.example.demo.app.infra.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import com.example.demo.app.infra.entity.AllocationEntity;
public interface AllocationRepository extends JpaRepository<AllocationEntity, Long>{
List<AllocationEntity> findByCourseId(Long courseId);
}

View File

@@ -22,5 +22,6 @@ public interface TransactionRepository extends JpaRepository<TransactionEntity,
@Query("select sum(t.amount) from TransactionEntity t inner join CategoryEntity c on t.categoryId = c.categoryId where (t.userId = :userId and t.transactionDate between :startDate and :endDate) and c.transactionType = 1")
public Integer findTotalIncome(LocalDate startDate, LocalDate endDate, Long userId);
@Query("select sum(t.amount) from TransactionEntity t where t.userEntity.userId = :userId and t.categoryEntity.categoryId = :categoryId and t.transactionDate between :startDate and :endDate")
public Integer findCategoryExpense(LocalDate startDate, LocalDate endDate, Long userId, Long categoryId);
}

View File

@@ -0,0 +1,60 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>分析画面</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<h2 class="text-center">支出分析</h2>
<table class="table text-center">
<thead>
<tr>
<th scope="col">カテゴリ別</th>
<th scope="col">支出</th>
<th scope="col">前月比</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">総支出</th>
<td>¥234,000</td>
<td>+¥38,000</td>
</tr>
</tbody>
</table>
<hr class="border border-primary border-2 opacity-50">
<table class="table text-center">
<thead>
<tr>
<th scope="col">カテゴリ別</th>
<th scope="col">支出</th>
<th scope="col">前月比<br>コース比</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">食費</th>
<td>¥34,000</td>
<td>+¥8,000<br>+¥1,100</td>
</tr>
<tr>
<th scope="row">交通費</th>
<td>¥14,000</td>
<td>+¥8,000<br>+¥1,100</td>
</tr>
<tr>
<th scope="row">日用品</th>
<td>¥4,000</td>
<td>+¥8,000<br>+¥1,100</td>
</tr>
</tbody>
</table>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>