Compare commits
4 Commits
y-kumaki
...
d7e12cc4f1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7e12cc4f1 | ||
|
|
772d0ef594 | ||
|
|
14e060588c | ||
|
|
67a8576a59 |
@@ -6,8 +6,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|
||||||
import com.example.demo.entity.Book;
|
import com.example.demo.entity.Book;
|
||||||
|
import com.example.demo.form.BookSearchForm;
|
||||||
import com.example.demo.service.BookServiceImpl;
|
import com.example.demo.service.BookServiceImpl;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@@ -15,14 +18,43 @@ public class BookController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private BookServiceImpl bookService;
|
private BookServiceImpl bookService;
|
||||||
|
|
||||||
|
/* 一覧表示 */
|
||||||
@GetMapping("/book")
|
@GetMapping("/book")
|
||||||
public String book(Model model) {
|
public String book(Model model) {
|
||||||
|
|
||||||
List<Book> aaa = bookService.findAll();
|
List<Book> aaa = bookService.findAll();
|
||||||
|
|
||||||
// DBから取得したデータをHTMLで扱えるようにする
|
// DBから取得したデータをHTMLで扱えるようにする
|
||||||
model.addAttribute("book",bookService.findAll());
|
model.addAttribute("book", bookService.findAll());
|
||||||
|
|
||||||
|
model.addAttribute("bookSearchForm", new BookSearchForm());
|
||||||
|
|
||||||
return "book";
|
return "book";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 検索処理 */
|
||||||
|
@GetMapping("/searchBooks")
|
||||||
|
public String searchBooks(@ModelAttribute BookSearchForm bookSearchForm,
|
||||||
|
Model model) {
|
||||||
|
|
||||||
|
model.addAttribute("book", bookService.findBooks(bookSearchForm.getKeyword()));
|
||||||
|
|
||||||
|
model.addAttribute("bookSearchForm", bookSearchForm);
|
||||||
|
|
||||||
|
return "book";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* クリア処理 */
|
||||||
|
@PostMapping("/clearBookList")
|
||||||
|
public String clearBookList(Model model) {
|
||||||
|
|
||||||
|
model.addAttribute("book", bookService.findAll());
|
||||||
|
|
||||||
|
model.addAttribute("bookSearchForm", new BookSearchForm());
|
||||||
|
|
||||||
|
// 一覧表示画面に戻る
|
||||||
|
return "/book";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +1,13 @@
|
|||||||
package com.example.demo.controller;
|
package com.example.demo.controller;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
|
|
||||||
import com.example.demo.service.BookLendService;
|
|
||||||
|
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class LendListController {
|
public class LendListController {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private BookLendService lendlistService;
|
|
||||||
|
|
||||||
@GetMapping("/lendList")
|
@GetMapping("/lendList")
|
||||||
public String list(Model model) {
|
public String lendList() {
|
||||||
|
|
||||||
// findAllを使って、DBから一覧を取得 でバックで取得したのを確認
|
|
||||||
model.addAttribute("list",lendlistService.findAll());
|
|
||||||
|
|
||||||
return "lendList";
|
return "lendList";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/return-book")
|
|
||||||
public String retun(@RequestParam(name="lendId") int returnBook){
|
|
||||||
|
|
||||||
lendlistService.regist(returnBook);
|
|
||||||
|
|
||||||
|
|
||||||
return "bookLendResult";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class Book {
|
|||||||
private int bookId;
|
private int bookId;
|
||||||
|
|
||||||
// 図書管理ID(BK-1など)
|
// 図書管理ID(BK-1など)
|
||||||
@Column(name = "book_manage_id", nullable = true, unique = true)
|
@Column(name = "book_manage_id", nullable = true)
|
||||||
private String bookManageId;
|
private String bookManageId;
|
||||||
|
|
||||||
// タイトル
|
// タイトル
|
||||||
@@ -78,7 +78,7 @@ public class Book {
|
|||||||
|
|
||||||
// 寄贈者社員ID??
|
// 寄贈者社員ID??
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "donor_id", nullable = true)
|
@JoinColumn(name = "donor_id", nullable = false)
|
||||||
private Employee employee;
|
private Employee employee;
|
||||||
|
|
||||||
//備考
|
//備考
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import jakarta.persistence.GeneratedValue;
|
|||||||
import jakarta.persistence.GenerationType;
|
import jakarta.persistence.GenerationType;
|
||||||
import jakarta.persistence.Id;
|
import jakarta.persistence.Id;
|
||||||
import jakarta.persistence.JoinColumn;
|
import jakarta.persistence.JoinColumn;
|
||||||
import jakarta.persistence.ManyToOne;
|
|
||||||
import jakarta.persistence.OneToOne;
|
import jakarta.persistence.OneToOne;
|
||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
@@ -29,9 +28,9 @@ public class BookLend {
|
|||||||
@JoinColumn(name = "book_manage_id", referencedColumnName = "book_manage_id",nullable = false)
|
@JoinColumn(name = "book_manage_id", referencedColumnName = "book_manage_id",nullable = false)
|
||||||
private Book book;
|
private Book book;
|
||||||
|
|
||||||
@ManyToOne
|
// 図書管理ID(BK-1など)
|
||||||
@JoinColumn(name = "employee_id", nullable = false)
|
@Column(name = "employee_id", nullable = false)
|
||||||
private Employee employeeBooklend;
|
private Integer employeeId;
|
||||||
|
|
||||||
// 貸出日
|
// 貸出日
|
||||||
@Column(name = "book_lend_date", nullable = false)
|
@Column(name = "book_lend_date", nullable = false)
|
||||||
|
|||||||
@@ -34,7 +34,4 @@ public class Employee {
|
|||||||
@OneToMany(mappedBy = "employee")
|
@OneToMany(mappedBy = "employee")
|
||||||
private List<Book> employees = new ArrayList<>();
|
private List<Book> employees = new ArrayList<>();
|
||||||
|
|
||||||
@OneToMany(mappedBy = "employeeBooklend")
|
|
||||||
private List<BookLend> employeesBooklend = new ArrayList<>();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
package com.example.demo.form;
|
|
||||||
|
|
||||||
public class BookForm {
|
|
||||||
|
|
||||||
}
|
|
||||||
10
src/main/java/com/example/demo/form/BookSearchForm.java
Normal file
10
src/main/java/com/example/demo/form/BookSearchForm.java
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package com.example.demo.form;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class BookSearchForm {
|
||||||
|
private String keyword;
|
||||||
|
}
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package com.example.demo.repository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import com.example.demo.entity.BookLend;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public interface BookLendRepository extends JpaRepository<BookLend, Integer> {
|
|
||||||
|
|
||||||
List<BookLend> findBybookStatus(Integer bookStatus);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,20 @@
|
|||||||
package com.example.demo.repository;
|
package com.example.demo.repository;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.data.repository.query.Param;
|
||||||
|
|
||||||
import com.example.demo.entity.Book;
|
import com.example.demo.entity.Book;
|
||||||
|
|
||||||
public interface BookRepository extends JpaRepository<Book, Integer>{
|
public interface BookRepository extends JpaRepository<Book, Integer>{
|
||||||
|
@Query("""
|
||||||
|
SELECT b FROM Book b
|
||||||
|
WHERE b.title LIKE %:keyword%
|
||||||
|
OR b.publisher LIKE %:keyword%
|
||||||
|
OR b.author LIKE %:keyword%
|
||||||
|
""")
|
||||||
|
List<Book> searchBooks(@Param("keyword")String keyword);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
package com.example.demo.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.example.demo.entity.BookLend;
|
|
||||||
import com.example.demo.repository.BookLendRepository;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class BookLendService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private BookLendRepository bookLendRepository;
|
|
||||||
|
|
||||||
public List<BookLend> findAll() {
|
|
||||||
return bookLendRepository.findBybookStatus(1);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional
|
|
||||||
public void regist(Integer lendId) {
|
|
||||||
|
|
||||||
BookLend booklend = bookLendRepository.findById(lendId).orElse(null);
|
|
||||||
|
|
||||||
booklend.setBookStatus(0);
|
|
||||||
|
|
||||||
bookLendRepository.save(booklend);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
package com.example.demo.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.example.demo.entity.Book;
|
|
||||||
|
|
||||||
public interface BookService {
|
|
||||||
String booklist(Book book);
|
|
||||||
|
|
||||||
List<java.awt.print.Book> findAll();
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.example.demo.service;
|
package com.example.demo.service;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -10,26 +9,17 @@ import com.example.demo.entity.Book;
|
|||||||
import com.example.demo.repository.BookRepository;
|
import com.example.demo.repository.BookRepository;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class BookServiceImpl{
|
public class BookServiceImpl {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private BookRepository bookRepository;
|
private BookRepository bookRepository;
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public String booklist(com.example.demo.entity.Book book) {
|
|
||||||
// Book booklist = new Book();
|
|
||||||
// booklist.setBookId(book.getBookId());
|
|
||||||
//
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public List<Book> findAll() {
|
public List<Book> findAll() {
|
||||||
return bookRepository.findAll();
|
return bookRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Book> findBooks(String keyword){
|
||||||
|
return bookRepository.searchBooks(keyword);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,12 +12,33 @@
|
|||||||
<h1>社内図書一覧</h1>
|
<h1>社内図書一覧</h1>
|
||||||
<div class="float-end">
|
<div class="float-end">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<form class="input-group" th:action="@{/searchBooks}" th:object="${bookSearchForm}" method="get">
|
||||||
|
|
||||||
|
<input type="text" th:field="*{keyword}" class="form-control" placeholder="キーワードを入力">
|
||||||
|
|
||||||
|
<button class="btn btn-outline-success" type="submit">
|
||||||
|
検索
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form method="post" th:action="@{/clearBookList}">
|
||||||
|
<button class="button button-secondary" type="submit">
|
||||||
|
クリア
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<p>※「タイトル」「出版社」「著者名」で検索</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<form method="get" action="bookLend">
|
<form method="get" action="bookLend">
|
||||||
|
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>図書ID</th>
|
<th>図書管理ID</th>
|
||||||
<th>ISBN</th>
|
<th>ISBN</th>
|
||||||
<th>タイトル</th>
|
<th>タイトル</th>
|
||||||
<th>著者名</th>
|
<th>著者名</th>
|
||||||
@@ -30,13 +51,13 @@
|
|||||||
<th>登録日時</th>
|
<th>登録日時</th>
|
||||||
<th>更新日時</th>
|
<th>更新日時</th>
|
||||||
<th>寄贈者</th>
|
<th>寄贈者</th>
|
||||||
<th>貸出状態??</th>
|
<th>貸出状態</th>
|
||||||
<th>操作??</th>
|
<th>操作</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr th:each="book : ${book}">
|
<tr th:each="book : ${book}" th:if="${book.bookManageId != null}">
|
||||||
|
|
||||||
<td th:text="*{book.bookManageId}"></td>
|
<td th:text="*{book.bookManageId}"></td>
|
||||||
<td th:text="*{book.isbn}"></td>
|
<td th:text="*{book.isbn}"></td>
|
||||||
@@ -47,52 +68,47 @@
|
|||||||
<td th:text="*{book.bookSubcategory.bookCategory.bookCategoryName}"></td>
|
<td th:text="*{book.bookSubcategory.bookCategory.bookCategoryName}"></td>
|
||||||
<td th:text="*{book.bookSubcategory.bookSubcategoryName}"></td>
|
<td th:text="*{book.bookSubcategory.bookSubcategoryName}"></td>
|
||||||
<td th:text="*{book.storageLocation.locationName}"></td>
|
<td th:text="*{book.storageLocation.locationName}"></td>
|
||||||
<td th:text="*{book.condition}"></td>
|
<td th:text="*{book.condition == 0 ? '分からない':
|
||||||
|
book.condition == 1 ? '新品':
|
||||||
|
book.condition == 2 ? '良好':
|
||||||
|
book.condition == 3 ? '使用感あり':
|
||||||
|
book.condition == 4 ? '痛みあり':
|
||||||
|
'不明'}">
|
||||||
|
</td>
|
||||||
<td th:text="*{book.createdAt}"></td>
|
<td th:text="*{book.createdAt}"></td>
|
||||||
<td th:text="*{book.updatedAt}"></td>
|
<td th:text="*{book.updatedAt}"></td>
|
||||||
<td th:text="*{book.employee != null ? book.employee.employeeId : '-'}"></td>
|
<td th:text="*{book.employee != null ? book.employee.employeeName : '-'}"></td>
|
||||||
<td th:text="*{book.bookLends != null ? book.bookLends.bookStatus : '-'}"></td>
|
<td
|
||||||
|
th:text="*{book.bookLends != null ? (book.bookLends.bookStatus == 0 ? '貸出可': '貸出不可') : '貸出可'}">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<form method="post" action="/bookLend">
|
||||||
|
<input type="hidden" name="bookManageId" th:value="*{book.bookManageId}">
|
||||||
|
<button type="submit"
|
||||||
|
th:disabled="*{book.bookLends != null && book.bookLends.bookStatus == 1}">
|
||||||
|
貸出
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
<form method="post" action="/updateconfirm">
|
||||||
|
<input type="hidden" name="bookManageId" th:value="*{book.bookManageId}">
|
||||||
|
<button type="submit">更新</button>
|
||||||
|
</form>
|
||||||
|
<form method="get" action="/delete">
|
||||||
|
<input type="hidden" name="bookManageId" th:value="*{book.bookManageId}">
|
||||||
|
<button type="submit">削除</button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr th:if="${#lists.isEmpty(book)}">
|
||||||
|
<td colspan="15">
|
||||||
|
該当する図書がありません
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
<button type="submit" class="btn-login">
|
|
||||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
|
||||||
stroke-linejoin="round">
|
|
||||||
<path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4" />
|
|
||||||
<polyline points="10 17 15 12 10 7" />
|
|
||||||
<line x1="15" y1="12" x2="3" y2="12" />
|
|
||||||
</svg>
|
|
||||||
貸出
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<button type="submit" class="btn-login">
|
|
||||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
|
||||||
stroke-linejoin="round">
|
|
||||||
<path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4" />
|
|
||||||
<polyline points="10 17 15 12 10 7" />
|
|
||||||
<line x1="15" y1="12" x2="3" y2="12" />
|
|
||||||
</svg>
|
|
||||||
貸出
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<form method="post" action="update">
|
|
||||||
<button type="submit" class="btn-login">
|
|
||||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
|
||||||
stroke-linejoin="round">
|
|
||||||
<path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4" />
|
|
||||||
<polyline points="10 17 15 12 10 7" />
|
|
||||||
<line x1="15" y1="12" x2="3" y2="12" />
|
|
||||||
</svg>
|
|
||||||
更新
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,20 +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>
|
|
||||||
<h1>返却処理が完了しました。</h1>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
<form th:action="@{/lendList}" method="get">
|
|
||||||
<button type="submit" th:value="貸出">貸出中図書一覧に戻る</button>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
@@ -1,62 +1,47 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html xmlns:th="http://www.thymeleaf.org">
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>貸出中図書一覧</title>
|
<title>貸出中図書一覧</title>
|
||||||
<link rel="stylesheet" th:href="@{/css/style.css}">
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>貸出中図書一覧</h1>
|
<h1>貸出中図書一覧</h1>
|
||||||
|
|
||||||
|
<!-- action先要修正 -->
|
||||||
<table>
|
<form action="/lendList" method="GET">
|
||||||
|
<input type="submit" value="返却" class="btn">
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>社員ID</th>
|
|
||||||
<th>社員名</th>
|
|
||||||
<th>管理ID</th>
|
|
||||||
<th>タイトル</th>
|
|
||||||
<th>返却予定日</th>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
<tr th:each="booklist : ${list}">
|
|
||||||
|
|
||||||
<td th:text="*{booklist.employeeBooklend.employeeId}"></td>
|
|
||||||
<td th:text="*{booklist.employeeBooklend.employeeName}"></td>
|
|
||||||
<td th:text="*{booklist.book.bookManageId}"></td>
|
|
||||||
<td th:text="*{booklist.book.title}"></td>
|
|
||||||
<td th:text="*{booklist.bookReturnDate}"></td>
|
|
||||||
|
|
||||||
|
|
||||||
<td>
|
|
||||||
<form th:action="@{/return-book}" method="get">
|
|
||||||
<button type="submit" name="lendId" th:value="${booklist.lendId}"
|
|
||||||
onclick="return MoveCheck();">返却
|
|
||||||
</button>
|
|
||||||
</form>
|
</form>
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
<!-- 以下ポップアップ -->
|
||||||
|
<div id="registerModal" class="modal-overlay">
|
||||||
|
|
||||||
</tbody>
|
<div class="modal">
|
||||||
|
|
||||||
</table>
|
<div class="modal-message">
|
||||||
|
返却処理が完了しました!
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-buttons">
|
||||||
|
|
||||||
|
<!-- OK -->
|
||||||
|
<form method="get" action="/lendList">
|
||||||
|
|
||||||
|
<button type="submit" class="modal-btn">
|
||||||
|
OK
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
function MoveCheck() {
|
</div>
|
||||||
return window.confirm("返却処理を実行します。よろしいですか?");
|
|
||||||
}
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user