s3
This commit is contained in:
@@ -1,6 +1,39 @@
|
|||||||
package com.example.demo.controller;
|
package com.example.demo.controller;
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
public class BookController {
|
public class BookController {
|
||||||
|
|
||||||
|
=======
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import com.example.demo.service.BookService;
|
||||||
|
|
||||||
|
|
||||||
|
/** BOOK-01:書籍検索(bookList.html) */
|
||||||
|
@Controller
|
||||||
|
public class BookController {
|
||||||
|
private final BookService bookService;
|
||||||
|
|
||||||
|
public BookController(BookService bookService) {
|
||||||
|
this.bookService = bookService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** メニューの「書籍一覧」=条件なし(全件)、検索ボタン=条件付きで同じURLを使う */
|
||||||
|
@GetMapping("/books")
|
||||||
|
public String list(@RequestParam(defaultValue = "") String nmBook,
|
||||||
|
@RequestParam(defaultValue = "") String publisher,
|
||||||
|
@RequestParam(defaultValue = "") String note,
|
||||||
|
Model model) {
|
||||||
|
model.addAttribute("books", bookService.searchLendable(nmBook, publisher, note));
|
||||||
|
// 検索条件を保持
|
||||||
|
model.addAttribute("nmBook", nmBook);
|
||||||
|
model.addAttribute("publisher", publisher);
|
||||||
|
model.addAttribute("note", note);
|
||||||
|
return "bookList";
|
||||||
|
}
|
||||||
|
>>>>>>> b128e9259883a00e9d25fdaae48e3fe54ddd290a
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html xmlns:th="http://www.thymeleaf.org">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>書籍貸出申請画面</title>
|
|
||||||
<!-- <link rel="stylesheet" th:href="@{/css/style.css}">-->
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<table>
|
|
||||||
<!-- エラーメッセージ -->
|
|
||||||
<div class="msgBox error" th:if="${messageError != null}">
|
|
||||||
<span class="error" th:text="${messageError.message}"></span>
|
|
||||||
<th class="header">蔵書ID</th>
|
|
||||||
<td>
|
|
||||||
<input placeholder="蔵書ID" th:field="*{id_book}" type="number" />
|
|
||||||
</td>
|
|
||||||
<th class="header">書籍名</th>
|
|
||||||
<td>
|
|
||||||
<input placeholder="蔵書ID" th:field="*{nm_book}" type="text" />
|
|
||||||
</td>
|
|
||||||
<th class="header">貸出日</th>
|
|
||||||
<td>
|
|
||||||
<input placeholder="貸出日" th:field="*{date_borrow}" type="text" />
|
|
||||||
</td>
|
|
||||||
<th class="header">返却予定日</th>
|
|
||||||
<td>
|
|
||||||
<input placeholder="返却予定日" th:field="*{date_schedule_return}" type="text" />
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<a href="applicationComplete/html" class="btn"> 申請</a>
|
|
||||||
</table>
|
|
||||||
<a href="@{/application}">申請情報入力</a>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
42
book-rent/src/main/resources/templates/bookConfirm.html
Normal file
42
book-rent/src/main/resources/templates/bookConfirm.html
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>書籍情報確認</title>
|
||||||
|
<link rel="stylesheet" th:href="@{/css/style.css}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div th:replace="~{fragments/header :: header}"></div>
|
||||||
|
<main>
|
||||||
|
<h1>書籍情報確認</h1>
|
||||||
|
<div class="card">
|
||||||
|
<h2 th:text="${title}">書籍登録</h2>
|
||||||
|
<table>
|
||||||
|
<tr><th>ISBN</th><td th:text="${form.isbn}"></td></tr>
|
||||||
|
<tr><th>書籍名</th><td th:text="${form.nmBook}"></td></tr>
|
||||||
|
<tr><th>書籍名よみ</th><td th:text="${form.knBook}"></td></tr>
|
||||||
|
<tr><th>出版社</th><td th:text="${form.publisher}"></td></tr>
|
||||||
|
<tr><th>特記事項</th><td th:text="${form.note}"></td></tr>
|
||||||
|
</table>
|
||||||
|
<form th:action="@{${base + '/execute'}}" method="post" style="display:inline">
|
||||||
|
<input type="hidden" name="idBook" th:value="${form.idBook}">
|
||||||
|
<input type="hidden" name="isbn" th:value="${form.isbn}">
|
||||||
|
<input type="hidden" name="nmBook" th:value="${form.nmBook}">
|
||||||
|
<input type="hidden" name="knBook" th:value="${form.knBook}">
|
||||||
|
<input type="hidden" name="publisher" th:value="${form.publisher}">
|
||||||
|
<input type="hidden" name="note" th:value="${form.note}">
|
||||||
|
<button type="submit" th:text="${title == '書籍登録'} ? '登録' : '編集'">登録</button>
|
||||||
|
</form>
|
||||||
|
<form th:action="@{${base + '/input'}}" method="post" style="display:inline">
|
||||||
|
<input type="hidden" name="idBook" th:value="${form.idBook}">
|
||||||
|
<input type="hidden" name="isbn" th:value="${form.isbn}">
|
||||||
|
<input type="hidden" name="nmBook" th:value="${form.nmBook}">
|
||||||
|
<input type="hidden" name="knBook" th:value="${form.knBook}">
|
||||||
|
<input type="hidden" name="publisher" th:value="${form.publisher}">
|
||||||
|
<input type="hidden" name="note" th:value="${form.note}">
|
||||||
|
<button type="submit" class="sub">書籍情報入力に戻る</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
34
book-rent/src/main/resources/templates/bookInput.html
Normal file
34
book-rent/src/main/resources/templates/bookInput.html
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>書籍情報入力</title>
|
||||||
|
<link rel="stylesheet" th:href="@{/css/style.css}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div th:replace="~{fragments/header :: header}"></div>
|
||||||
|
<main>
|
||||||
|
<h1>書籍情報入力</h1>
|
||||||
|
<div class="error" th:if="${errorMessage}" th:text="${errorMessage}"></div>
|
||||||
|
<div class="error" th:each="e : ${errors}" th:text="${e}"></div>
|
||||||
|
<div class="card">
|
||||||
|
<h2 th:text="${title}">書籍登録</h2>
|
||||||
|
<form th:action="@{${base + '/confirm'}}" method="post">
|
||||||
|
<input type="hidden" name="idBook" th:value="${form.idBook}">
|
||||||
|
<label for="isbn">ISBN(必須・13文字以内)</label>
|
||||||
|
<input type="text" id="isbn" name="isbn" th:value="${form.isbn}" maxlength="13">
|
||||||
|
<label for="nmBook">書籍名(必須・50文字以内)</label>
|
||||||
|
<input type="text" id="nmBook" name="nmBook" th:value="${form.nmBook}" maxlength="50">
|
||||||
|
<label for="knBook">書籍名よみ(100文字以内)</label>
|
||||||
|
<input type="text" id="knBook" name="knBook" th:value="${form.knBook}" maxlength="100">
|
||||||
|
<label for="publisher">出版社(50文字以内)</label>
|
||||||
|
<input type="text" id="publisher" name="publisher" th:value="${form.publisher}" maxlength="50">
|
||||||
|
<label for="note">特記事項</label>
|
||||||
|
<input type="text" id="note" name="note" th:value="${form.note}">
|
||||||
|
<p><button type="submit" th:text="${title} + '確認'">確認</button>
|
||||||
|
<a class="btn sub" th:href="@{/books}">書籍一覧に戻る</a></p>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>書籍一覧</title>
|
<title>書籍一覧</title>
|
||||||
|
<<<<<<< HEAD
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@@ -105,5 +106,66 @@
|
|||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
=======
|
||||||
|
<link rel="stylesheet" th:href="@{/css/style.css}">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div th:replace="~{fragments/header :: header}"></div>
|
||||||
|
<main>
|
||||||
|
<h1>書籍一覧</h1>
|
||||||
|
<div class="error" th:if="${errorMessage}" th:text="${errorMessage}"></div>
|
||||||
|
<div class="card">
|
||||||
|
<form th:action="@{/books}" method="get">
|
||||||
|
<label for="nmBook">書籍名</label>
|
||||||
|
<input type="text" id="nmBook" name="nmBook" th:value="${nmBook}">
|
||||||
|
<label for="publisher">出版社</label>
|
||||||
|
<input type="text" id="publisher" name="publisher" th:value="${publisher}">
|
||||||
|
<label for="note">特記事項</label>
|
||||||
|
<input type="text" id="note" name="note" th:value="${note}">
|
||||||
|
<p><button type="submit">検索</button>
|
||||||
|
<a class="btn sub" th:href="@{/menu}">メニューに戻る</a>
|
||||||
|
<a class="btn" th:if="${session.loginUser.admin}" th:href="@{/admin/books/new}">書籍新規登録</a>
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<h2>検索結果</h2>
|
||||||
|
<p th:if="${#lists.isEmpty(books)}">該当する書籍はありません。</p>
|
||||||
|
<table th:unless="${#lists.isEmpty(books)}">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>蔵書ID</th>
|
||||||
|
<th>ISBN</th>
|
||||||
|
<th>書籍名</th>
|
||||||
|
<th>書籍名よみ</th>
|
||||||
|
<th>出版社</th>
|
||||||
|
<th>特記事項</th>
|
||||||
|
<th>操作</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr th:each="b : ${books}">
|
||||||
|
<td th:text="${b.idBook}"></td>
|
||||||
|
<td th:text="${b.isbn}"></td>
|
||||||
|
<td th:text="${b.nmBook}"></td>
|
||||||
|
<td th:text="${b.knBook}"></td>
|
||||||
|
<td th:text="${b.publisher}"></td>
|
||||||
|
<td th:text="${b.note}"></td>
|
||||||
|
<td>
|
||||||
|
<!-- 一般:貸出申請(LOAN-01) / 管理者:編集(BOOK-03) -->
|
||||||
|
<a class="btn" th:unless="${session.loginUser.admin}"
|
||||||
|
th:href="@{/loan/apply(idBook=${b.idBook})}">貸出申請</a>
|
||||||
|
<a class="btn" th:if="${session.loginUser.admin}"
|
||||||
|
th:href="@{/admin/books/edit(idBook=${b.idBook})}">編集</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
>>>>>>> b128e9259883a00e9d25fdaae48e3fe54ddd290a
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
19
book-rent/src/main/resources/templates/complete.html
Normal file
19
book-rent/src/main/resources/templates/complete.html
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>完了</title>
|
||||||
|
<link rel="stylesheet" th:href="@{/css/style.css}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div th:replace="~{fragments/header :: header}"></div>
|
||||||
|
<main>
|
||||||
|
<h1>完了</h1>
|
||||||
|
<div class="info" th:text="${message} ?: '処理が完了しました。'"></div>
|
||||||
|
<p>
|
||||||
|
<a class="btn" th:href="@{${backUrl}}" th:text="${backLabel}">戻る</a>
|
||||||
|
<a class="btn sub" th:href="@{/menu}">メニューに戻る</a>
|
||||||
|
</p>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
38
book-rent/src/main/resources/templates/loanApplyConfirm.html
Normal file
38
book-rent/src/main/resources/templates/loanApplyConfirm.html
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>書籍貸出申請確認</title>
|
||||||
|
<link rel="stylesheet" th:href="@{/css/style.css}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div th:replace="~{fragments/header :: header}"></div>
|
||||||
|
<main>
|
||||||
|
<h1>書籍貸出申請確認</h1>
|
||||||
|
<div class="card">
|
||||||
|
<table>
|
||||||
|
<tr><th>書籍名</th><td th:text="${book.nmBook}"></td></tr>
|
||||||
|
<tr><th>ISBN</th><td th:text="${book.isbn}"></td></tr>
|
||||||
|
<tr><th>出版社</th><td th:text="${book.publisher}"></td></tr>
|
||||||
|
<tr><th>特記事項</th><td th:text="${book.note}"></td></tr>
|
||||||
|
</table>
|
||||||
|
<table>
|
||||||
|
<tr><th>貸出日</th><td th:text="${dateBorrow}"></td></tr>
|
||||||
|
<tr><th>返却予定日</th><td th:text="${dateScheduledReturn}"></td></tr>
|
||||||
|
</table>
|
||||||
|
<form th:action="@{/loan/apply/execute}" method="post" style="display:inline">
|
||||||
|
<input type="hidden" name="idBook" th:value="${idBook}">
|
||||||
|
<input type="hidden" name="dateBorrow" th:value="${dateBorrow}">
|
||||||
|
<input type="hidden" name="dateScheduledReturn" th:value="${dateScheduledReturn}">
|
||||||
|
<button type="submit">申請</button>
|
||||||
|
</form>
|
||||||
|
<form th:action="@{/loan/apply/input}" method="post" style="display:inline">
|
||||||
|
<input type="hidden" name="idBook" th:value="${idBook}">
|
||||||
|
<input type="hidden" name="dateBorrow" th:value="${dateBorrow}">
|
||||||
|
<input type="hidden" name="dateScheduledReturn" th:value="${dateScheduledReturn}">
|
||||||
|
<button type="submit" class="sub">申請情報入力に戻る</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
33
book-rent/src/main/resources/templates/loanApplyInput.html
Normal file
33
book-rent/src/main/resources/templates/loanApplyInput.html
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>書籍貸出申請</title>
|
||||||
|
<link rel="stylesheet" th:href="@{/css/style.css}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div th:replace="~{fragments/header :: header}"></div>
|
||||||
|
<main>
|
||||||
|
<h1>書籍貸出申請</h1>
|
||||||
|
<div class="error" th:if="${errorMessage}" th:text="${errorMessage}"></div>
|
||||||
|
<div class="error" th:each="e : ${errors}" th:text="${e}"></div>
|
||||||
|
<div class="card">
|
||||||
|
<table>
|
||||||
|
<tr><th>書籍名</th><td th:text="${book.nmBook}"></td></tr>
|
||||||
|
<tr><th>ISBN</th><td th:text="${book.isbn}"></td></tr>
|
||||||
|
<tr><th>出版社</th><td th:text="${book.publisher}"></td></tr>
|
||||||
|
<tr><th>特記事項</th><td th:text="${book.note}"></td></tr>
|
||||||
|
</table>
|
||||||
|
<form th:action="@{/loan/apply/confirm}" method="post">
|
||||||
|
<input type="hidden" name="idBook" th:value="${idBook}">
|
||||||
|
<label for="dateBorrow">貸出日</label>
|
||||||
|
<input type="date" id="dateBorrow" name="dateBorrow" th:value="${dateBorrow}">
|
||||||
|
<label for="dateScheduledReturn">返却予定日</label>
|
||||||
|
<input type="date" id="dateScheduledReturn" name="dateScheduledReturn" th:value="${dateScheduledReturn}">
|
||||||
|
<p><button type="submit">申請確認</button>
|
||||||
|
<a class="btn sub" th:href="@{/books}">書籍一覧に戻る</a></p>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user