Compare commits
48 Commits
5fa2cd6230
...
y-nakano
| Author | SHA1 | Date | |
|---|---|---|---|
| 549538f8a4 | |||
| 76c299ca3e | |||
| 3fb3be36d5 | |||
|
|
341365aa81 | ||
| 693dcfaf62 | |||
|
|
5a5bfd9112 | ||
|
|
85d1d3715b | ||
| 20460cd2d9 | |||
|
|
16f4aacf23 | ||
|
|
307f8951b3 | ||
|
|
773284fd04 | ||
| 6563734ad9 | |||
|
|
8124e8633c | ||
|
|
09f451e7f6 | ||
|
|
a80e99da7f | ||
|
|
40733ad01f | ||
|
|
3576a76137 | ||
|
|
5489761a8b | ||
|
|
53fd6ae2db | ||
|
|
6b7c6d3abf | ||
|
|
7239374b40 | ||
|
|
053e33fd0b | ||
|
|
6fbd55e7d8 | ||
|
|
1cf896b986 | ||
|
|
02eb671aab | ||
| f5b6fcdc40 | |||
|
|
caa47d310a | ||
|
|
b2dc911b67 | ||
| a1f623cc90 | |||
|
|
f2ec9e2456 | ||
|
|
2968750da3 | ||
| ba81a9b50f | |||
| f3a6b683b3 | |||
|
|
acd3a5bef6 | ||
|
|
b5e96c2695 | ||
|
|
356783bd63 | ||
|
|
c4dad54a8d | ||
|
|
89a7d71259 | ||
| 49693b28d4 | |||
|
|
34c6725c16 | ||
| 4fb0f51dc4 | |||
|
|
0895519da3 | ||
| c5142cdfdf | |||
| 53485523b0 | |||
|
|
03c675dd33 | ||
| 6b0fcad592 | |||
| 077b53243a | |||
| ef84f8ff26 |
@@ -74,16 +74,6 @@
|
||||
<artifactId>spring-boot-starter-webmvc-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.example</groupId>
|
||||
<artifactId>HelloSpring</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.example.rhizome</groupId>
|
||||
<artifactId>EM-Spring</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.example.demo.controller;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import com.example.demo.service.ReturnService;
|
||||
|
||||
@Controller
|
||||
public class ApplicationListController{
|
||||
|
||||
@Autowired
|
||||
ReturnService returnService;
|
||||
|
||||
public ApplicationListController(ReturnService returnService) {
|
||||
this.returnService = returnService;
|
||||
}
|
||||
|
||||
//applicationListにアクセスしたときに実行されるメソッド
|
||||
@RequestMapping(value = "/applicationList", method = RequestMethod.GET)
|
||||
public String index(Model model) {
|
||||
//サービスから一覧を取得し、getAwaitingApprovalListという名前でHTMLに渡す
|
||||
model.addAttribute("applicationList", returnService.getAwaitingApprovalList());
|
||||
return "applicationList";
|
||||
}
|
||||
|
||||
//メニュー画面に戻るURLへMapping
|
||||
@RequestMapping(value = "/menu", method = RequestMethod.GET)
|
||||
public String menu() {
|
||||
return "menu";
|
||||
}
|
||||
|
||||
//申請承認待ちページに遷移するためのMapping
|
||||
@RequestMapping(value = "/returnApproval", method = RequestMethod.GET)
|
||||
//返却確認ページにアクセスしたときに実行されるメソッド
|
||||
public String returnApproval(
|
||||
//URLから送られた申請IDを受け取る
|
||||
@RequestParam("idRequest") Integer idRequest, Model model) {
|
||||
//受け取った申請IDをidRequestという名前でModelに登録してHTMLに渡す
|
||||
model.addAttribute("idRequest", idRequest);
|
||||
//上記で渡すHTMLのURL
|
||||
return "returnApproval";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import com.example.demo.service.ReturnService;
|
||||
|
||||
@Controller
|
||||
public class LendingListController {
|
||||
|
||||
@Autowired
|
||||
ReturnService returnService;
|
||||
|
||||
public LendingListController(ReturnService returnService) {
|
||||
this.returnService = returnService;
|
||||
}
|
||||
|
||||
//貸出中書籍一覧を表示
|
||||
@RequestMapping(value = "/lendingList", method = RequestMethod.GET)
|
||||
//lendingListにアクセスしたときに実行されるメソッド
|
||||
public String index(Model model) {
|
||||
//サービスと連携する処理
|
||||
//サービスから一覧を取得し、borrowListという名前でHTMLに渡す
|
||||
model.addAttribute("borrowList", returnService.getBorrowList());
|
||||
//表示するHTML
|
||||
return "lendingList";
|
||||
}
|
||||
|
||||
//メニューに戻る
|
||||
@RequestMapping(value = "/menu", method = RequestMethod.GET)
|
||||
public String menu() {
|
||||
return "menu";
|
||||
}
|
||||
|
||||
//書籍返却ページに遷移
|
||||
@RequestMapping(value = "/returnConfirm", method = RequestMethod.GET)
|
||||
//返却確認ページにアクセスしたときに実行されるメソッド
|
||||
public String returnConfirm(
|
||||
//URLから送られた申請IDを受け取る
|
||||
@RequestParam("idRequest") Integer idRequest, Model model) {
|
||||
//受け取った申請IDをidRequestという名前でHTMLに渡す
|
||||
model.addAttribute("idRequest", idRequest);
|
||||
//上記で渡すHTMLのURL
|
||||
return "returnConfirm";
|
||||
}
|
||||
|
||||
//@GetMapping("/lendingList")//登録されているデータを取得する役割を果たす
|
||||
// public String show(Model model) {
|
||||
// List<X> x = xservice.getX();
|
||||
// model.addAttribute("Y", x);
|
||||
// return LendingListService.select;
|
||||
// }
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
import jakarta.servlet.http.HttpSession;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
|
||||
@Controller
|
||||
public class MenuController {
|
||||
|
||||
// @RequestMapping(value = "/menu", method = RequestMethod.GET)
|
||||
// public String showmenu() {
|
||||
// return "menu";
|
||||
// }
|
||||
|
||||
@GetMapping("/menu")
|
||||
public String menu(HttpSession session, Model model) {
|
||||
Character FlgAdmin = (Character) session.getAttribute("FlgAdmin");
|
||||
model.addAttribute("FlgAdmin", FlgAdmin);
|
||||
return "menu";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.example.demo.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class LeadingListModel {
|
||||
//データの保持
|
||||
private final Integer idRequest;
|
||||
private final String nmBook;
|
||||
private final String nmEmployee;
|
||||
private final Date dateRequest;
|
||||
private final Date dateBorrow;
|
||||
private final Date dateScheduledReturn;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
//package com.example.demo.service;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
//import jakarta.transaction.Transactional;
|
||||
//
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//
|
||||
//import com.example.demo.model.LeadingListModel;
|
||||
//import com.example.demo.repository.Borrow_BooksRepository;
|
||||
//
|
||||
//@Service
|
||||
//@Transactional
|
||||
//public class LendingListService {
|
||||
//
|
||||
// @Autowired
|
||||
// Borrow_BooksRepository borrowrepo;
|
||||
//
|
||||
// public LendingListService(Borrow_BooksRepository borrowrepo) {
|
||||
// this.borrowrepo = borrowrepo;
|
||||
// }
|
||||
//
|
||||
// //貸出中書籍の一覧を取得したい
|
||||
// public List<LeadingListModel>getBorrowList(){
|
||||
// //リポジトリに取得を託す。取得したらコントローラーに返す
|
||||
// return borrowrepo.findLendingList();
|
||||
// }
|
||||
//
|
||||
// public List<LeadingListDto> getBorrowList(){
|
||||
// List<Borrow_booksEntity> borrowentity = Borrow_BooksRepository.findAll();
|
||||
// leadinglistdto.status(equals("2"));
|
||||
// }
|
||||
//}
|
||||
5
team1/src/main/java/com/example/demo/service/S.java
Normal file
5
team1/src/main/java/com/example/demo/service/S.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.service;
|
||||
|
||||
public class S {
|
||||
|
||||
}
|
||||
@@ -18,7 +18,7 @@
|
||||
<!--クラス名確認すること(現在仮入力)-->
|
||||
<form action="confirmLending" id="lendingForm" method="post" th:object="${lendingForm}">
|
||||
<table>
|
||||
<!--蔵所ID、書籍名はreadonlyにて固定-->
|
||||
<!--蔵書ID、書籍名はreadonlyにて固定-->
|
||||
<tr>
|
||||
<th class="header">蔵書ID</th>
|
||||
<td><input type="text" th:field="*{id_book}" readonly="readonly"></td>
|
||||
|
||||
69
team1/src/main/resources/templates/applicationList.html
Normal file
69
team1/src/main/resources/templates/applicationList.html
Normal file
@@ -0,0 +1,69 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
||||
<!-- 外部のスクリプトファイルを読み込む -->
|
||||
<script th:src="@{/js/common.js}"></script>
|
||||
<!-- CSSの読み込み -->
|
||||
<link rel="stylesheet" th:href="@{/css/all.css}">
|
||||
<link rel=stylesheet th:href="@{/css/style.css}" type="text/css">
|
||||
<title>検索</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="rightSection">
|
||||
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
||||
</div>
|
||||
|
||||
<div class="header-spacing"></div>
|
||||
<a href="showMenu">メニューに戻る</a>
|
||||
|
||||
<div class="header-spacing"></div>
|
||||
<h1><span>検索結果</span></h1>
|
||||
|
||||
<div class="header-spacing"></div>
|
||||
<th:block th:if="${employeeInfoFormList != null and employeeInfoFormList.size() > 0}">
|
||||
<!-- 検索結果が1件以上ある場合 -->
|
||||
<table class="table-grid table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 100px;">申請ID</th>
|
||||
<th style="width: 100px;">申請者名</th>
|
||||
<th style="width: 100px;">書籍名</th>
|
||||
<th style="width: 100px;">申請日</th>
|
||||
<th style="width: 100px;">貸出日</th>
|
||||
<th style="width: 100px;">返却予定日</th>
|
||||
<th style="width: 100px;">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="employeeInfoForm : ${applicationList}">
|
||||
<td th:text="${employeeInfoForm.idRequest}"></td>
|
||||
<td th:text="${employeeInfoForm.nmApplicant}"></td>
|
||||
<td th:text="${employeeInfoForm.nmBook}"></td>
|
||||
<td th:text="${employeeInfoForm.dateRequest}"></td>
|
||||
<td th:text="${employeeInfoForm.dateBorrow}"></td>
|
||||
<td th:text="${employeeInfoForm.dateReturn}"></td>
|
||||
<td th:text="${employeeInfoForm.dateRequest}"></td>
|
||||
|
||||
|
||||
<td>
|
||||
<form action="/approve" method="get">
|
||||
<input name="idRequest" th:value="${employeeInfoForm.idRequest}" type="hidden">
|
||||
<input type="submit" value="承認">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</th:block>
|
||||
|
||||
<th:block th:if="${applicationList == null or borrowList.isEmpty()}">
|
||||
<!-- 検索結果が0件の場合 -->
|
||||
現在書籍貸出の申請はありません。
|
||||
</th:block>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
54
team1/src/main/resources/templates/lendingList.html
Normal file
54
team1/src/main/resources/templates/lendingList.html
Normal file
@@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
||||
<title>貸出中書籍一覧</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>
|
||||
<div class="rightSection">
|
||||
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
||||
</div>
|
||||
</h1>
|
||||
<a href="menu">メニューに戻る</a>
|
||||
<h1><span>検索結果</span></h1>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 150px;">申請ID</th>
|
||||
<th style="width: 150px;">申請者名</th>
|
||||
<th style="width: 150px;">書籍名</th>
|
||||
<th style="width: 150px;">申請日</th>
|
||||
<th style="width: 150px;">貸出日</th>
|
||||
<th style="width: 150px;">返却予定日</th>
|
||||
<th style="width: 150px;">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="borrow : ${borrowList}">
|
||||
<td th:text="${borrow.idRequest}"></td>
|
||||
<td th:text="${borrow.nmEmployee}"></td>
|
||||
<td th:text="${borrow.nmBook}"></td>
|
||||
<td th:text="${borrow.dateRequest}"></td>
|
||||
<td th:text="${borrow.dateBorrow}"></td>
|
||||
<td th:text="${borrow.dateScheduledReturn}"></td>
|
||||
<td>
|
||||
<!--返却フォーム-->
|
||||
<form action="/returnConfirm" method="get">
|
||||
<!--送信するデータ名、送信する値、送信する指定-->
|
||||
<input name="idRequest" th:value="${borrow.idRequest}" type="hidden">
|
||||
<input type="submit" value="返却">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<th:block th:if="${borrowList == null or borrowList.isEmpty()}">
|
||||
貸出中の書籍はありません
|
||||
</th:block>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
46
team1/src/main/resources/templates/menu.html
Normal file
46
team1/src/main/resources/templates/menu.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>メニュー</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>
|
||||
<div class="rightSection">
|
||||
<button class="logoutButton" th:onclick="logoutSubmit()">ログアウト</button>
|
||||
</div>
|
||||
</h1>
|
||||
|
||||
<!-- 管理者フラグのチェック処理-->
|
||||
|
||||
|
||||
<!-- 一般ユーザー向けのメニュー-->
|
||||
<table class="menuClass">
|
||||
<tr>
|
||||
<td>
|
||||
<a class="menuClass" th:href="@{/bookList}"><i class="fas fa-search"></i>書籍検索</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- 管理者向けのメニュー-->
|
||||
<div th:if="${FlgAdmin == '1'}">
|
||||
<table class="menuClass">
|
||||
<tr>
|
||||
<td>
|
||||
<a class="menuClass" href="@{/application}"><i
|
||||
class="fas fa-search"></i>書籍貸出申請一覧</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a class="menuClass" href="@{/lendingList}"><i class="fas fa-search"></i>貸出中書籍一覧</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user