Merge branch 'n-kawahito' of https://gitea.it-college.co.jp/2026_09_5H_Spring_KIZAKI/Monegement into k-kobayashi
This commit is contained in:
@@ -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 org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.example.demo.app.domain.model.AnalysisModel;
|
import com.example.demo.app.domain.model.AnalysisModel;
|
||||||
|
import com.example.demo.app.domain.service.AnalysisService;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.example.demo.app.infra.repository;
|
package com.example.demo.app.infra.repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
import com.example.demo.app.infra.entity.AllocationEntity;
|
import com.example.demo.app.infra.entity.AllocationEntity;
|
||||||
|
|
||||||
public interface AllocationRepository extends JpaRepository<AllocationEntity, Long>{
|
public interface AllocationRepository extends JpaRepository<AllocationEntity, Long>{
|
||||||
|
|
||||||
|
List<AllocationEntity> findByCourseId(Long courseId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,5 +21,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")
|
@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);
|
public Integer findTotalIncome(LocalDate startDate, LocalDate endDate, Long userId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
60
src/main/resources/templates/analysis.html
Normal file
60
src/main/resources/templates/analysis.html
Normal 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>
|
||||||
Reference in New Issue
Block a user