Compare commits
41 Commits
d41e4dac7c
...
07c62be1bd
| Author | SHA1 | Date | |
|---|---|---|---|
| 07c62be1bd | |||
| 906b9d8353 | |||
|
|
7de868d37b | ||
| a0220cb01a | |||
|
|
d7d6b9b3f5 | ||
|
|
19615ef3f4 | ||
|
|
f059dc9f53 | ||
|
|
0ce3d392a9 | ||
|
|
0a48649741 | ||
| 6cf069772e | |||
|
|
24caa7f6e2 | ||
|
|
004ea0d5b9 | ||
|
|
1488f42039 | ||
|
|
21dd389deb | ||
|
|
bef3b58ef4 | ||
|
|
268df2f363 | ||
|
|
a6a42295c4 | ||
|
|
ab48f30b6e | ||
|
|
0723c559f0 | ||
| 47fb36b066 | |||
|
|
7548257db6 | ||
|
|
93473b1822 | ||
|
|
853af1ec43 | ||
|
|
36af7db10b | ||
| 771d28edfe | |||
|
|
2a29f53479 | ||
|
|
4f46641774 | ||
|
|
15458cd2cd | ||
|
|
990814ee78 | ||
|
|
d507d68e1b | ||
| d841bc52e4 | |||
|
|
536a98767d | ||
| 4398b1554b | |||
|
|
401542974c | ||
| 970f47b8b2 | |||
|
|
1be82da0a6 | ||
|
|
a7112b7bc0 | ||
|
|
593e58db8c | ||
|
|
a6d075a686 | ||
|
|
5bf0e41745 | ||
|
|
d098a7bf9e |
@@ -0,0 +1,13 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@Controller
|
||||
public class ApprovalReceive {
|
||||
@GetMapping("/approvalReceive")
|
||||
public String approvalReceive() {
|
||||
return "approvalReceive";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,28 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import com.example.demo.entity.Book;
|
||||
import com.example.demo.service.BookServiceImpl;
|
||||
|
||||
@Controller
|
||||
public class BookController {
|
||||
@Autowired
|
||||
private BookServiceImpl bookService;
|
||||
|
||||
@GetMapping("/book")
|
||||
public String book() {
|
||||
public String book(Model model) {
|
||||
|
||||
List<Book> aaa = bookService.findAll();
|
||||
|
||||
// DBから取得したデータをHTMLで扱えるようにする
|
||||
model.addAttribute("book",bookService.findAll());
|
||||
return "book";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -8,6 +10,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
import com.example.demo.entity.BookInsert;
|
||||
import com.example.demo.repository.BookCategoryRepository;
|
||||
import com.example.demo.repository.SubCategoryRepository;
|
||||
import com.example.demo.service.BookInsertService;
|
||||
|
||||
@Controller
|
||||
@@ -18,10 +21,13 @@ private BookInsertService bookInsertService;
|
||||
|
||||
@Autowired
|
||||
private BookCategoryRepository categoryRepository;
|
||||
@Autowired
|
||||
private SubCategoryRepository subCategoryRepository;
|
||||
|
||||
@GetMapping("/bookInsert")
|
||||
public String bookInsert(Model model) {
|
||||
model.addAttribute("categoryList",categoryRepository.findAll());
|
||||
model.addAttribute("subCategoryList",subCategoryRepository.findAll());
|
||||
model.addAttribute("bookInsert",new BookInsert());
|
||||
return "bookInsert";
|
||||
}
|
||||
@@ -31,22 +37,36 @@ private BookCategoryRepository categoryRepository;
|
||||
// 確認画面から戻る: POSTされた入力中の値がformに入ったまま入力画面へ
|
||||
@PostMapping("/bookInsertConfirm")
|
||||
public String bookInsertConfirm(BookInsert bookInsert,Model model) {
|
||||
bookInsertService.save(bookInsert);
|
||||
model.addAttribute("bookInsert",bookInsert);
|
||||
return "bookInsertConfirm";
|
||||
}
|
||||
|
||||
@PostMapping("/bookInsert")
|
||||
public String bookInsertBack(BookInsert bookInsert,Model model) {
|
||||
|
||||
model.addAttribute("categoryList",categoryRepository.findAll());
|
||||
|
||||
model.addAttribute("subCategoryList",new ArrayList<>());
|
||||
model.addAttribute("bookInsert",bookInsert);
|
||||
return "bookInsert";
|
||||
}
|
||||
|
||||
@PostMapping("/bookInsert/category")
|
||||
public String changeCategory(BookInsert bookInsert,Model model) {
|
||||
//カテゴリプルダウンに表示するデータを取得
|
||||
model.addAttribute("categoryList",categoryRepository.findAll());
|
||||
|
||||
model.addAttribute("subCategoryList",subCategoryRepository.findByBookCategory_BookCategoryId(bookInsert.getBookCategoryId()));
|
||||
model.addAttribute("bookInsert", bookInsert);
|
||||
|
||||
return "bookInsert";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//画面で選択したカテゴリbookInsert.getBookCategoryId())
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
@Controller
|
||||
public class BookUpdateConfirmController {
|
||||
|
||||
@PostMapping("/updateconfirm")
|
||||
public String updateConfirm() {
|
||||
return "updateconfirm";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
@Controller
|
||||
public class BookUpdateController {
|
||||
|
||||
@PostMapping("/update")
|
||||
public String update() {
|
||||
return "update";
|
||||
}
|
||||
|
||||
@PostMapping("/bookUpdate")
|
||||
public String bookUpdate() {
|
||||
return "book";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@Controller
|
||||
public class LendListController {
|
||||
@GetMapping("/lendList")
|
||||
public String lendList() {
|
||||
return "lendList";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,77 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
import jakarta.servlet.http.HttpSession;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.BindingResult;
|
||||
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.AccountEntity;
|
||||
import com.example.demo.form.LoginForm;
|
||||
import com.example.demo.service.LoginService;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
public class LoginController {
|
||||
|
||||
@GetMapping("/login")
|
||||
public String showLogin() {
|
||||
return "login";
|
||||
private final LoginService loginService;
|
||||
|
||||
// Boot起動直後にログイン画面に移動する用のメソッド
|
||||
@GetMapping("/")
|
||||
public String index(HttpSession session) {
|
||||
if (session.getAttribute("loginEmployee") != null) {
|
||||
return "redirect:/topmenu";
|
||||
}
|
||||
return "redirect:/login";
|
||||
}
|
||||
|
||||
@PostMapping("/doLogin")
|
||||
public String doLogin() {
|
||||
@GetMapping("/login")
|
||||
public String loginForm(Model model, HttpSession session) {
|
||||
if (session.getAttribute("loginEmployee") != null) {
|
||||
return "redirect:/topmenu";
|
||||
}
|
||||
|
||||
model.addAttribute("loginForm", new LoginForm());
|
||||
return "login";
|
||||
}
|
||||
|
||||
// 実際のログイン処理
|
||||
@PostMapping("/login")
|
||||
public String doLogin(
|
||||
@Valid @ModelAttribute LoginForm loginForm,
|
||||
BindingResult bindingResult,
|
||||
Model model,
|
||||
HttpSession session) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return "login";
|
||||
}
|
||||
|
||||
AccountEntity accountEntity = loginService.login(loginForm);
|
||||
if (accountEntity == null) {
|
||||
model.addAttribute("loginError",
|
||||
"ログインIDまたはパスワードが正しくありません");
|
||||
return "login";
|
||||
}
|
||||
|
||||
session.setAttribute("loginEmployee", accountEntity);
|
||||
return "redirect:/topmenu";
|
||||
}
|
||||
|
||||
// ログアウト処理
|
||||
@GetMapping("/logout")
|
||||
public String logout(HttpSession session) {
|
||||
session.invalidate();
|
||||
return "redirect:/login";
|
||||
}
|
||||
|
||||
// 各画面からトップメニューへの遷移用
|
||||
@GetMapping("/topmenu")
|
||||
public String showTopMenu() {
|
||||
return "topmenu";
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@Controller
|
||||
public class PasswordChangeController {
|
||||
|
||||
@GetMapping("/passwordChange")
|
||||
public String showPasswordChange() {
|
||||
|
||||
return "passwordChange";
|
||||
}
|
||||
}
|
||||
40
src/main/java/com/example/demo/entity/AccountEntity.java
Normal file
40
src/main/java/com/example/demo/entity/AccountEntity.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package com.example.demo.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
/*
|
||||
* accountテーブル用のEntityクラス
|
||||
* ログイン時やセッションでの管理者判別に使う
|
||||
*/
|
||||
|
||||
@Entity
|
||||
@Table(name = "account")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class AccountEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name="login_info_id")
|
||||
private Integer loginInfoId;
|
||||
|
||||
@Column(name="employee_id")
|
||||
private Integer employeeId;
|
||||
|
||||
@Column(name="password_hash")
|
||||
private String passwordHash;
|
||||
|
||||
@Column(name="admin_flag")
|
||||
private int adminFlag;
|
||||
|
||||
}
|
||||
95
src/main/java/com/example/demo/entity/Book.java
Normal file
95
src/main/java/com/example/demo/entity/Book.java
Normal file
@@ -0,0 +1,95 @@
|
||||
package com.example.demo.entity;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.OneToOne;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Entity // このクラスがDBのテーブルに対応することを表す
|
||||
@Data
|
||||
@Table(name = "book")
|
||||
public class Book {
|
||||
|
||||
//図書ID
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "book_id", nullable = false)
|
||||
private int bookId;
|
||||
|
||||
// 図書管理ID(BK-1など)
|
||||
@Column(name = "book_manage_id", nullable = true)
|
||||
private String bookManageId;
|
||||
|
||||
// タイトル
|
||||
@Column(name = "title", nullable = false)
|
||||
private String title;
|
||||
|
||||
//ISBN
|
||||
@Column(name = "isbn", nullable = false)
|
||||
private String isbn;
|
||||
|
||||
// 著者名
|
||||
@Column(name = "author", nullable = false)
|
||||
private String author;
|
||||
|
||||
// 出版社
|
||||
@Column(name = "publisher", nullable = true)
|
||||
private String publisher;
|
||||
|
||||
// 出版日
|
||||
@Column(name = "publication_date", nullable = true)
|
||||
private Date publicationDate;
|
||||
|
||||
// サブカテゴリーID!!
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "book_subcategory_id", nullable = false)
|
||||
private BookSubcategory bookSubcategory;
|
||||
|
||||
// 保管場所
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "location_id", nullable = false)
|
||||
private StorageLocation storageLocation;
|
||||
|
||||
|
||||
// 本の状態
|
||||
@Column(name = "condition_s", nullable = false)
|
||||
private int condition;
|
||||
|
||||
// 登録日
|
||||
@Column(name = "created_at", nullable = false)
|
||||
private Date createdAt;
|
||||
|
||||
// 更新日
|
||||
@Column(name = "updated_at", nullable = false)
|
||||
private Date updatedAt;
|
||||
|
||||
//削除フラグ
|
||||
@Column(name = "is_deleted", nullable = false)
|
||||
private Integer isDeleted;
|
||||
|
||||
// 寄贈者社員ID??
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "donor_id", nullable = false)
|
||||
private Employee employee;
|
||||
|
||||
//備考
|
||||
@Column(name = "description", nullable = true)
|
||||
private String description;
|
||||
|
||||
//申請承認フラグ
|
||||
@Column(name = "book_approval", nullable = false)
|
||||
private Integer bookApproval;
|
||||
|
||||
@OneToOne(mappedBy = "book")
|
||||
private BookLend bookLends;
|
||||
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.example.demo.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.OneToMany;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
import lombok.Data;
|
||||
@@ -12,11 +16,13 @@ import lombok.Data;
|
||||
@Table(name="book_category")
|
||||
public class BookCategory {
|
||||
|
||||
|
||||
@Id
|
||||
@Column(name = "book_category_id")
|
||||
private Integer bookCategoryId;
|
||||
|
||||
@Column(name = "book_category_name")
|
||||
private String bookCategoryName;
|
||||
|
||||
@OneToMany(mappedBy = "bookCategory")
|
||||
private List<BookSubcategory> BookSubcategories = new ArrayList<>();
|
||||
}
|
||||
@@ -1,32 +1,75 @@
|
||||
package com.example.demo.entity;
|
||||
import java.time.LocalDate;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.persistence.Transient;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Entity // このクラスがDBのテーブルに対応することを表す
|
||||
@Table(name = "book")
|
||||
@Data
|
||||
public class BookInsert {
|
||||
|
||||
@Id // 主キー
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY) // 自動採番
|
||||
private Long Id;
|
||||
@Column(name = "book_id")
|
||||
private Integer bookId;
|
||||
|
||||
private String bookId;
|
||||
@Column(name = "book_manage_id")
|
||||
private String bookManageId;
|
||||
|
||||
@Column(name = "title")
|
||||
private String title;
|
||||
private Integer isbn;
|
||||
|
||||
@Column(name = "isbn")
|
||||
private String isbn;
|
||||
|
||||
@Column(name = "author")
|
||||
private String author;
|
||||
private String category;
|
||||
private String subcategory;
|
||||
private Integer publisher;
|
||||
private Integer publicationDate;
|
||||
private String location;
|
||||
private String condition;
|
||||
private String donor;
|
||||
private String discription;
|
||||
|
||||
@Column(name = "book_subcategory_id")
|
||||
private Integer subcategory;
|
||||
|
||||
@Column(name = "publisher")
|
||||
private String publisher;
|
||||
|
||||
@Column(name = "publication_date")
|
||||
private String publicationDate;
|
||||
|
||||
@Column(name = "location_id")
|
||||
private Integer location;
|
||||
|
||||
@Column(name = "condition_s")
|
||||
private Integer condition;
|
||||
|
||||
@Column(name = "donor_id")
|
||||
private Integer donor;
|
||||
|
||||
@Column(name = "description")
|
||||
private String description;
|
||||
|
||||
@Column(name = "created_at")
|
||||
private LocalDate createdAt;
|
||||
|
||||
@Column(name = "updated_at")
|
||||
private LocalDate updatedAt;
|
||||
|
||||
@Column(name = "is_deleted")
|
||||
private Integer isDeleted;
|
||||
|
||||
@Column(name = "book_approval")
|
||||
private Integer bookApproval;
|
||||
|
||||
@Transient
|
||||
private Integer bookCategoryId;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
46
src/main/java/com/example/demo/entity/BookLend.java
Normal file
46
src/main/java/com/example/demo/entity/BookLend.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.example.demo.entity;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.OneToOne;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Entity // このクラスがDBのテーブルに対応することを表す
|
||||
@Data
|
||||
@Table(name = "book_lend")
|
||||
public class BookLend {
|
||||
//貸出ID
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "lend_Id", nullable = false)
|
||||
private int lendId;
|
||||
|
||||
// 図書管理ID(BK-1など)
|
||||
@OneToOne
|
||||
@JoinColumn(name = "book_manage_id", referencedColumnName = "book_manage_id",nullable = false)
|
||||
private Book book;
|
||||
|
||||
// 図書管理ID(BK-1など)
|
||||
@Column(name = "employee_id", nullable = false)
|
||||
private Integer employeeId;
|
||||
|
||||
// 貸出日
|
||||
@Column(name = "book_lend_date", nullable = false)
|
||||
private Date bookLendDate;
|
||||
|
||||
// 返却日
|
||||
@Column(name = "book_return_date", nullable = false)
|
||||
private Date bookReturnDate;
|
||||
|
||||
// 貸出状態
|
||||
@Column(name = "book_status", nullable = false)
|
||||
private Integer bookStatus;
|
||||
}
|
||||
34
src/main/java/com/example/demo/entity/BookSubcategory.java
Normal file
34
src/main/java/com/example/demo/entity/BookSubcategory.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.example.demo.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.OneToMany;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name = "book_subcategory")
|
||||
public class BookSubcategory {
|
||||
@Id
|
||||
@Column(name = "book_subcategory_id")
|
||||
private Integer bookSubcategoryId;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "book_category_id", nullable = false)
|
||||
private BookCategory bookCategory;
|
||||
|
||||
@Column(name = "book_subcategory_name")
|
||||
private String bookSubcategoryName;
|
||||
|
||||
@OneToMany(mappedBy = "bookSubcategory")
|
||||
private List<Book> Books = new ArrayList<>();
|
||||
|
||||
}
|
||||
37
src/main/java/com/example/demo/entity/Employee.java
Normal file
37
src/main/java/com/example/demo/entity/Employee.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.example.demo.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.OneToMany;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Entity // このクラスがDBのテーブルに対応することを表す
|
||||
@Data
|
||||
@Table(name = "employee")
|
||||
public class Employee {
|
||||
//社員ID
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "employee_Id", nullable = false)
|
||||
private int employeeId;
|
||||
|
||||
// 社員名
|
||||
@Column(name = "employee_name", nullable = false)
|
||||
private String employeeName;
|
||||
|
||||
//部署ID
|
||||
@Column(name = "department_id", nullable = false)
|
||||
private Integer departmentId;
|
||||
|
||||
@OneToMany(mappedBy = "employee")
|
||||
private List<Book> employees = new ArrayList<>();
|
||||
|
||||
}
|
||||
34
src/main/java/com/example/demo/entity/StorageLocation.java
Normal file
34
src/main/java/com/example/demo/entity/StorageLocation.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.example.demo.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.OneToMany;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Entity // このクラスがDBのテーブルに対応することを表す
|
||||
@Data
|
||||
@Table(name = "storage_location")
|
||||
public class StorageLocation {
|
||||
//保管場所ID
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "location_id", nullable = false)
|
||||
private int locationId;
|
||||
|
||||
// 保管場所名
|
||||
@Column(name = "location_name", nullable = false)
|
||||
private String locationName;
|
||||
|
||||
@OneToMany(mappedBy = "storageLocation")
|
||||
private List<Book> Location = new ArrayList<>();
|
||||
|
||||
|
||||
}
|
||||
5
src/main/java/com/example/demo/form/BookForm.java
Normal file
5
src/main/java/com/example/demo/form/BookForm.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.form;
|
||||
|
||||
public class BookForm {
|
||||
|
||||
}
|
||||
17
src/main/java/com/example/demo/form/LoginForm.java
Normal file
17
src/main/java/com/example/demo/form/LoginForm.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.example.demo.form;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LoginForm {
|
||||
|
||||
@NotNull(message = "社員IDを入力してください")
|
||||
private Integer employeeId;
|
||||
|
||||
@NotBlank(message = "パスワードを入力してください")
|
||||
private String passwordHash;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.example.demo.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import com.example.demo.entity.AccountEntity;
|
||||
|
||||
public interface AccountRepository extends JpaRepository<AccountEntity,Integer>{
|
||||
|
||||
AccountEntity findByEmployeeId (Integer employeeId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.example.demo.repository;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import com.example.demo.entity.Book;
|
||||
|
||||
public interface BookRepository extends JpaRepository<Book, Integer>{
|
||||
|
||||
}
|
||||
@@ -6,6 +6,6 @@ import com.example.demo.entity.BookInsert;
|
||||
|
||||
public interface BookInsertService {
|
||||
String regist(BookInsert book);
|
||||
|
||||
List<BookInsert> findAll();
|
||||
void save(BookInsert bookInsert);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.example.demo.service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -17,8 +18,6 @@ import com.example.demo.repository.BookInsertRepository;
|
||||
@Override
|
||||
public String regist(BookInsert book) {
|
||||
// DTO → エンティティへ詰め替えて保存
|
||||
bookInsertRepository.save(book);
|
||||
book.setBookId("bk"+book.getId());
|
||||
bookInsertRepository.save(book); // 保存
|
||||
return "登録が完了しました";
|
||||
}
|
||||
@@ -27,7 +26,22 @@ import com.example.demo.repository.BookInsertRepository;
|
||||
public List<BookInsert> findAll() {
|
||||
return bookInsertRepository.findAll(); // 全件取得
|
||||
}
|
||||
|
||||
public void save(BookInsert bookInsert) {
|
||||
bookInsert.setCreatedAt(LocalDate.now());//登録日時設定
|
||||
bookInsert.setUpdatedAt(LocalDate.now());//更新日時設定
|
||||
bookInsert.setIsDeleted(0);//削除フラグ設定
|
||||
bookInsert.setBookApproval(0);//承認フラグ(承認されていないため0)
|
||||
bookInsertRepository.save(bookInsert);
|
||||
//BK〇〇〇〇形式で管理IDを作る
|
||||
String manageId="BK-" + bookInsert.getBookId();//BookId取得→BK形式に変換
|
||||
bookInsert.setBookManageId(manageId);
|
||||
|
||||
bookInsertRepository.save(bookInsert);//データベースに保存
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ※BookService インタフェースにも List<Review> findAll(); を追加すること
|
||||
|
||||
|
||||
11
src/main/java/com/example/demo/service/BookService.java
Normal file
11
src/main/java/com/example/demo/service/BookService.java
Normal file
@@ -0,0 +1,11 @@
|
||||
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();
|
||||
}
|
||||
35
src/main/java/com/example/demo/service/BookServiceImpl.java
Normal file
35
src/main/java/com/example/demo/service/BookServiceImpl.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.example.demo.service;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.example.demo.entity.Book;
|
||||
import com.example.demo.repository.BookRepository;
|
||||
|
||||
@Service
|
||||
public class BookServiceImpl{
|
||||
|
||||
@Autowired
|
||||
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() {
|
||||
return bookRepository.findAll();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
31
src/main/java/com/example/demo/service/LoginService.java
Normal file
31
src/main/java/com/example/demo/service/LoginService.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.example.demo.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.example.demo.entity.AccountEntity;
|
||||
import com.example.demo.form.LoginForm;
|
||||
import com.example.demo.repository.AccountRepository;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class LoginService {
|
||||
|
||||
private final AccountRepository accountRepository;
|
||||
|
||||
public AccountEntity login(LoginForm form) {
|
||||
AccountEntity accountEntity =
|
||||
accountRepository.findByEmployeeId(form.getEmployeeId());
|
||||
|
||||
if(accountEntity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if(!accountEntity.getPasswordHash().equals(form.getPasswordHash()))
|
||||
return null;
|
||||
|
||||
return accountEntity;
|
||||
}
|
||||
|
||||
}
|
||||
62
src/main/resources/static/js/passwordChange.js
Normal file
62
src/main/resources/static/js/passwordChange.js
Normal file
@@ -0,0 +1,62 @@
|
||||
function togglePassword(id) {
|
||||
|
||||
const input = document.getElementById(id);
|
||||
|
||||
if (input === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (input.type === "password") {
|
||||
input.type = "text";
|
||||
} else {
|
||||
input.type = "password";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function clearForm() {
|
||||
|
||||
const form = document.getElementById("pwForm");
|
||||
|
||||
if (form === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
form.reset();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function showCompletedPopup() {
|
||||
|
||||
const completedDialog = document.getElementById("completedDialog");
|
||||
|
||||
if (completedDialog === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
completedDialog.showModal();
|
||||
}
|
||||
|
||||
function goTopMenu() {
|
||||
|
||||
const topMenuUrl = document.body.dataset.topmenuUrl;
|
||||
|
||||
if (topMenuUrl) {
|
||||
window.location.href = topMenuUrl;
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href = "/topmenu";
|
||||
}
|
||||
|
||||
function goLogin(){
|
||||
const loginUrl = document.body.dataset.loginUrl;
|
||||
|
||||
if (loginUrl){
|
||||
window.location.href = loginUrl;
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href="/login"
|
||||
}
|
||||
@@ -1,10 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>寄贈申請 受信BOX</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>寄贈申請 受信BOX</h1>
|
||||
<!-- action先要修正 -->
|
||||
<form action="/approvalReceive" method="GET">
|
||||
<input type="submit" value="承認" class="btn">
|
||||
</form>
|
||||
|
||||
<!-- action先要修正 -->
|
||||
<form action="/approvalReceive" method="GET">
|
||||
<input type="submit" value="却下" class="btn">
|
||||
</form>
|
||||
|
||||
<!-- 新規登録画面へ遷移 -->
|
||||
<form action="/bookInsert" method="GET">
|
||||
<input type="submit" value="登録" class="btn">
|
||||
</form>
|
||||
|
||||
<!-- action先要修正 -->
|
||||
<form action="/approvalReceive" method="GET">
|
||||
<input type="submit" value="戻る" class="btn">
|
||||
</form>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,18 +1,100 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>社内図書一覧</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form method="post" action="bookLend">
|
||||
<div class="container">
|
||||
<h1>社内図書一覧</h1>
|
||||
<div class="float-end">
|
||||
</div>
|
||||
<form method="get" action="bookLend">
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>図書ID</th>
|
||||
<th>ISBN</th>
|
||||
<th>タイトル</th>
|
||||
<th>著者名</th>
|
||||
<th>出版社</th>
|
||||
<th>出版日</th>
|
||||
<th>カテゴリー名</th>
|
||||
<th>サブカテゴリー名</th>
|
||||
<th>保管場所</th>
|
||||
<th>本の状態</th>
|
||||
<th>登録日時</th>
|
||||
<th>更新日時</th>
|
||||
<th>寄贈者</th>
|
||||
<th>貸出状態??</th>
|
||||
<th>操作??</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr th:each="book : ${book}">
|
||||
|
||||
<td th:text="*{book.bookManageId}"></td>
|
||||
<td th:text="*{book.isbn}"></td>
|
||||
<td th:text="*{book.title}"></td>
|
||||
<td th:text="*{book.author}"></td>
|
||||
<td th:text="*{book.publisher}"></td>
|
||||
<td th:text="*{book.publicationDate}"></td>
|
||||
<td th:text="*{book.bookSubcategory.bookCategory.bookCategoryName}"></td>
|
||||
<td th:text="*{book.bookSubcategory.bookSubcategoryName}"></td>
|
||||
<td th:text="*{book.storageLocation.locationName}"></td>
|
||||
<td th:text="*{book.condition}"></td>
|
||||
<td th:text="*{book.createdAt}"></td>
|
||||
<td th:text="*{book.updatedAt}"></td>
|
||||
<td th:text="*{book.employee != null ? book.employee.employeeId : '-'}"></td>
|
||||
<td th:text="*{book.bookLends != null ? book.bookLends.bookStatus : '-'}"></td>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</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>
|
||||
<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>
|
||||
|
||||
</html>
|
||||
@@ -12,10 +12,18 @@
|
||||
<br>
|
||||
<br><br>
|
||||
|
||||
<form action="/bookInsertConfirm" method="POST">
|
||||
<form action="/bookInsertConfirm" method="POST" th:object="${bookInsert}">
|
||||
|
||||
<label for="bookId">図書管理ID</label><br>
|
||||
<input type="text" id="bookId" name="bookId" placeholder="図書管理Idを入力" th:value="${bookInsert.bookId}" required>
|
||||
<label for="bookId">図書ID</label><br>
|
||||
<input type="text"
|
||||
id="bookId"
|
||||
placeholder="登録時に自動採番されます" readonly>
|
||||
<br><br>
|
||||
|
||||
<label for="bookmanageId">図書管理ID</label><br>
|
||||
<input type="text"
|
||||
id="bookManageId"
|
||||
placeholder="登録時に自動採番されます" readonly>
|
||||
<br><br>
|
||||
|
||||
<label for="title">タイトル</label><br>
|
||||
@@ -23,7 +31,7 @@
|
||||
<br><br>
|
||||
|
||||
<label for="isbn">ISBN</label><br>
|
||||
<input type="text" id="isbn" name="isbn" th:value="${bookInsert.isbn}" required>
|
||||
<input type="text" id="isbn" name="isbn" placeholder="ISBNを入力" th:value="${bookInsert.isbn}" required>
|
||||
<br><br>
|
||||
|
||||
<label for="title">著者名</label><br>
|
||||
@@ -31,11 +39,31 @@
|
||||
<br><br>
|
||||
|
||||
<label for="category">カテゴリ</label><br>
|
||||
<input type="text" id="category" name="category" placeholder="カテゴリを選択" th:value="${bookInsert.category}" required>
|
||||
<select th:field="*{bookCategoryId}"
|
||||
onchange="
|
||||
this.form.action='/bookInsert/category';
|
||||
this.form.submit();">
|
||||
|
||||
<option value="">
|
||||
選択してください
|
||||
</option>
|
||||
|
||||
<option th:each="category : ${categoryList}"
|
||||
th:value="${category.bookCategoryId}"
|
||||
th:text="${category.bookCategoryName}">
|
||||
</option>
|
||||
|
||||
</select>
|
||||
<br><br>
|
||||
|
||||
<label for="subcategory">サブカテゴリ</label><br>
|
||||
<input type="text" id="subcategory" name="subcategory" placeholder="サブカテゴリを選択" th:value="${bookInsert.subcategory}" required>
|
||||
<select th:field="*{subcategory}">
|
||||
<option value="">選択してください</option>
|
||||
<option th:each="sub:${subCategoryList}"
|
||||
th:value="${sub.bookSubcategoryId}"
|
||||
th:text="${sub.bookSubcategoryName}">
|
||||
</option>
|
||||
</select>
|
||||
<br><br>
|
||||
|
||||
<label for="publisher">主パン者</label><br>
|
||||
@@ -47,19 +75,20 @@
|
||||
<br><br>
|
||||
|
||||
<label for="location">保管場所</label><br>
|
||||
<select id="location" name="location" required >
|
||||
<option value="undecided">未確定</option>
|
||||
<option value="area">開発エリア書棚</option>
|
||||
<option value="rack">会議室前ラック</option>
|
||||
<select name="location">
|
||||
<option value="1">未確定</option>
|
||||
<option value="2">開発エリア書棚</option>
|
||||
<option value="3">会議室前ラック</option>
|
||||
</select>
|
||||
<br><br>
|
||||
|
||||
<label for="condition">図書状態</label><br>
|
||||
<select id="condition" name="condition" required th:value="${bookInsert.condition}">
|
||||
<option value="new">新品同様</option>
|
||||
<option value="good">良好</option>
|
||||
<option value="use">使用感あり</option>
|
||||
<option value="pain">傷みあり</option>
|
||||
<select name="condition">
|
||||
<option value="0">不明</option>
|
||||
<option value="1">新品同様</option>
|
||||
<option value="2">良好</option>
|
||||
<option value="3">使用感あり</option>
|
||||
<option value="4">傷みあり</option>
|
||||
</select>
|
||||
<br><br>
|
||||
|
||||
@@ -67,13 +96,15 @@
|
||||
<input type="text" id="donor" name="donor" th:value="${bookInsert.donor}">
|
||||
<br><br>
|
||||
|
||||
<label for="discription">備考</label><br>
|
||||
<input type="text" id="discription" name="discription" th:value="${bookInsert.discription}">
|
||||
<!--
|
||||
<label for="description">備考</label><br>
|
||||
<input type="text" id="description" name="description" th:value="${bookInsert.description}">
|
||||
<br><br>
|
||||
</label>
|
||||
</label>-->
|
||||
|
||||
|
||||
<input type="submit" value="確認画面へ" class="btn">
|
||||
</form>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
@@ -13,17 +13,18 @@
|
||||
<!-- もどる: 入力中の値を持って入力画面へ -->
|
||||
<form method="post" th:action="@{/bookInsert}" >
|
||||
<input type="hidden" name="bookId" th:value="${bookInsert.bookId}">
|
||||
<input type="hidden" name="bookmanageId" th:value="${bookInsert.bookManageId}">
|
||||
<input type="hidden" name="title" th:value="${bookInsert.title}">
|
||||
<input type="hidden" name="isbn" th:value="${bookInsert.isbn}">
|
||||
<input type="hidden" name="author" th:value="${bookInsert.author}">
|
||||
<input type="hidden" name="category" th:value="${bookInsert.category}">
|
||||
<input type="hidden" name="category" th:value="${bookInsert.bookCategoryId}">
|
||||
<input type="hidden" name="subcategory" th:value="${bookInsert.subcategory}">
|
||||
<input type="hidden" name="publisher" th:value="${bookInsert.publisher}">
|
||||
<input type="hidden" name="publicationDate" th:value="${bookInsert.publicationDate}">
|
||||
<input type="hidden" name="location" th:value="${bookInsert.location}">
|
||||
<input type="hidden" name="condition" th:value="${bookInsert.condition}">
|
||||
<input type="hidden" name="donor" th:value="${bookInsert.donor}">
|
||||
<input type="hidden" name="discription" th:value="${bookInsert.discription}">
|
||||
<input type="hidden" name="description" th:value="${bookInsert.description}">
|
||||
<button type="submit">もどる</button>
|
||||
</form>
|
||||
</form>
|
||||
|
||||
48
src/main/resources/templates/lendList.html
Normal file
48
src/main/resources/templates/lendList.html
Normal file
@@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>貸出中図書一覧</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>貸出中図書一覧</h1>
|
||||
|
||||
<!-- action先要修正 -->
|
||||
<form action="/lendList" method="GET">
|
||||
<input type="submit" value="返却" class="btn">
|
||||
</form>
|
||||
|
||||
<!-- 以下ポップアップ -->
|
||||
<div id="registerModal" class="modal-overlay">
|
||||
|
||||
<div class="modal">
|
||||
|
||||
<div class="modal-message">
|
||||
返却処理が完了しました!
|
||||
</div>
|
||||
|
||||
<div class="modal-buttons">
|
||||
|
||||
<!-- OK -->
|
||||
<form method="get" action="/lendList">
|
||||
|
||||
<button type="submit" class="modal-btn">
|
||||
OK
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,29 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>ログイン</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>ログイン</h1>
|
||||
<form action="doLogin"
|
||||
method="post"
|
||||
th:object="${loginInfoForm}">
|
||||
|
||||
<div class="msgBox error" th:if="${messageError} != null">
|
||||
<span class="error" th:text="${messageError.message}"></span>
|
||||
<p class="message message-error" th:if="${loginError}" th:text="${loginError}">
|
||||
</p>
|
||||
|
||||
<form th:action="@{/login}" th:object="${loginForm}" method="post">
|
||||
<div class="form-group">
|
||||
<label for="employeeId">社員ID</label>
|
||||
<input id="employeeId" type="text" th:field="*{employeeId}">
|
||||
<p class="field-error" th:errors="*{employeeId}"></p>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td class="btnArea" colspan="2">
|
||||
<input type="submit" value="ログイン"/>
|
||||
<button onclick="clearInput()">リセット</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="form-group">
|
||||
<label for="passwordHash">パスワード</label>
|
||||
<input id="passwordHash" type="password" th:field="*{passwordHash}">
|
||||
<p class="field-error" th:errors="*{passwordHash}"></p>
|
||||
</div>
|
||||
|
||||
<input type="submit" value="ログイン">
|
||||
<input type="reset" value="リセット">
|
||||
</form>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
377
src/main/resources/templates/passwordChange.html
Normal file
377
src/main/resources/templates/passwordChange.html
Normal file
@@ -0,0 +1,377 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org" lang="ja">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>ShareBooks|パスワード変更</title>
|
||||
</head>
|
||||
|
||||
<body th:data-topmenu-url="@{/topmenu}">
|
||||
|
||||
<!-- ヘッダー -->
|
||||
<div class="header-bar">
|
||||
|
||||
<div class="header-left">
|
||||
ShareBooks
|
||||
</div>
|
||||
|
||||
<div class="header-right">
|
||||
|
||||
<span class="bell">
|
||||
🔔
|
||||
<span class="badge">3</span>
|
||||
</span>
|
||||
|
||||
<span class="user">
|
||||
テストユーザー(一般)
|
||||
</span>
|
||||
|
||||
<button type="button" class="logout">
|
||||
ログアウト
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layout">
|
||||
|
||||
<!-- サイドバー -->
|
||||
<div class="sidebar">
|
||||
|
||||
<div class="section-label">
|
||||
共通画面
|
||||
</div>
|
||||
|
||||
<a class="side-menu" th:href="@{/topmenu}">
|
||||
トップメニュー
|
||||
</a>
|
||||
|
||||
<div class="active">
|
||||
パスワード再設定
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- メイン -->
|
||||
<div class="main-area">
|
||||
|
||||
<!-- パンくずリスト -->
|
||||
<div class="breadcrumb">
|
||||
|
||||
<a th:href="@{/topmenu}">
|
||||
トップメニュー
|
||||
</a>
|
||||
|
||||
> パスワード再設定
|
||||
|
||||
</div>
|
||||
|
||||
<h1 class="page-title">
|
||||
パスワード再設定
|
||||
</h1>
|
||||
|
||||
<p class="page-desc">
|
||||
現在のパスワードと新しいパスワードを入力し、
|
||||
「確定」ボタンを押してください。
|
||||
</p>
|
||||
|
||||
<p class="required-note">
|
||||
(※)は必須項目です。
|
||||
</p>
|
||||
|
||||
<div class="content-columns">
|
||||
|
||||
<!-- 左カラム -->
|
||||
<div class="left-column">
|
||||
|
||||
<div class="form-card">
|
||||
|
||||
<h2>
|
||||
パスワード再設定入力
|
||||
</h2>
|
||||
|
||||
<!--
|
||||
簡易実装のため、フォーム送信は行いません。
|
||||
-->
|
||||
<form id="pwForm" onsubmit="return false;">
|
||||
|
||||
<!-- 現在のパスワード -->
|
||||
<div class="form-group">
|
||||
|
||||
<label for="currentPassword">
|
||||
現在のパスワード
|
||||
<span class="req">(※)</span>
|
||||
</label>
|
||||
|
||||
<div class="input-with-icon">
|
||||
|
||||
<input
|
||||
type="password"
|
||||
id="currentPassword"
|
||||
name="currentPassword"
|
||||
autocomplete="current-password"
|
||||
placeholder="現在のパスワードを入力してください">
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="toggle-password"
|
||||
aria-label="現在のパスワードの表示を切り替える"
|
||||
onclick="togglePassword('currentPassword')">
|
||||
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
|
||||
<path
|
||||
d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z">
|
||||
</path>
|
||||
|
||||
<circle
|
||||
cx="12"
|
||||
cy="12"
|
||||
r="3">
|
||||
</circle>
|
||||
|
||||
</svg>
|
||||
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 新しいパスワード -->
|
||||
<div class="form-group">
|
||||
|
||||
<label for="newPassword">
|
||||
新しいパスワード
|
||||
<span class="req">(※)</span>
|
||||
</label>
|
||||
|
||||
<div class="input-with-icon">
|
||||
|
||||
<input
|
||||
type="password"
|
||||
id="newPassword"
|
||||
name="newPassword"
|
||||
autocomplete="new-password"
|
||||
placeholder="新しいパスワードを入力してください">
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="toggle-password"
|
||||
aria-label="新しいパスワードの表示を切り替える"
|
||||
onclick="togglePassword('newPassword')">
|
||||
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
|
||||
<path
|
||||
d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z">
|
||||
</path>
|
||||
|
||||
<circle
|
||||
cx="12"
|
||||
cy="12"
|
||||
r="3">
|
||||
</circle>
|
||||
|
||||
</svg>
|
||||
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<p class="field-hint">
|
||||
※ 半角英数字・記号を含む8文字以上16文字以下で入力してください。
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 確認用パスワード -->
|
||||
<div class="form-group">
|
||||
|
||||
<label for="confirmPassword">
|
||||
新しいパスワードの確認
|
||||
<span class="req">(※)</span>
|
||||
</label>
|
||||
|
||||
<div class="input-with-icon">
|
||||
|
||||
<input
|
||||
type="password"
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
autocomplete="new-password"
|
||||
placeholder="新しいパスワードをもう一度入力してください">
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="toggle-password"
|
||||
aria-label="確認用パスワードの表示を切り替える"
|
||||
onclick="togglePassword('confirmPassword')">
|
||||
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
|
||||
<path
|
||||
d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z">
|
||||
</path>
|
||||
|
||||
<circle
|
||||
cx="12"
|
||||
cy="12"
|
||||
r="3">
|
||||
</circle>
|
||||
|
||||
</svg>
|
||||
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<p class="field-hint">
|
||||
※ 確認のため、もう一度新しいパスワードを入力してください。
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 注意事項 -->
|
||||
<div class="notice-box">
|
||||
|
||||
<div class="notice-title">
|
||||
注意事項
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 操作ボタン -->
|
||||
<div class="button-row">
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary"
|
||||
onclick="goTopMenu()">
|
||||
トップメニューへ戻る
|
||||
</button>
|
||||
|
||||
<div class="btn-group-right">
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary"
|
||||
onclick="clearForm()">
|
||||
クリア
|
||||
</button>
|
||||
|
||||
<!-- ダイアログを表示 -->
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
onclick="showCompletedPopup()">
|
||||
確定
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 右カラム -->
|
||||
<div class="right-column">
|
||||
|
||||
<div class="constraint-panel">
|
||||
|
||||
<div class="panel-title">
|
||||
パスワードの制約
|
||||
</div>
|
||||
|
||||
<div class="group-label">
|
||||
使用可能文字
|
||||
</div>
|
||||
|
||||
<div class="chars-value">
|
||||
半角英数字・記号
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="group-label">
|
||||
制約
|
||||
</div>
|
||||
|
||||
<ul class="constraint-list">
|
||||
<li>✓ 8文字以上16文字以下</li>
|
||||
<li>✓ 1つ以上の小文字を使用</li>
|
||||
<li>✓ 1つ以上の大文字を使用</li>
|
||||
<li>✓ 1つ以上の数字を使用</li>
|
||||
<li>✓ 1つ以上の記号を使用</li>
|
||||
</ul>
|
||||
|
||||
<div class="example-box">
|
||||
|
||||
<div class="example-label">
|
||||
設定例
|
||||
</div>
|
||||
|
||||
<div class="example-value">
|
||||
Abcdef12!
|
||||
</div>
|
||||
|
||||
<div class="example-note">
|
||||
(9文字、英字大小・数字・記号を含む)
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
© 2026 ShareBooks
|
||||
</div>
|
||||
|
||||
<dialog id="completedDialog">
|
||||
|
||||
<h2>
|
||||
変更完了
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
パスワードの変更が完了しました。
|
||||
</p>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onclick="goLogin()">
|
||||
完了
|
||||
</button>
|
||||
|
||||
</dialog>
|
||||
|
||||
<script th:src="@{/js/passwordChange.js}"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,16 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>トップメニュー</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="header-bar">
|
||||
|
||||
<div class="header-left">
|
||||
ShareBooks
|
||||
</div>
|
||||
|
||||
<div class="header-right">
|
||||
|
||||
<span class="user">
|
||||
テストユーザー(一般)
|
||||
</span>
|
||||
|
||||
<a class="button-link" th:href="@{/logout}">
|
||||
ログアウト
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<h1>
|
||||
メインメニュー
|
||||
</h1>
|
||||
|
||||
|
||||
<!-- ===== 共通:社内図書一覧 ===== -->
|
||||
<a class="card" href="${pageContext.request.contextPath}/BookServlet">
|
||||
|
||||
<a class="card" href="/book">
|
||||
|
||||
<h3>社内図書一覧</h3>
|
||||
|
||||
@@ -23,7 +49,7 @@
|
||||
|
||||
<!-- ===== 共通:寄贈申請 ===== -->
|
||||
|
||||
<a class="card" href="${pageContext.request.contextPath}/employee">
|
||||
<a class="card" href="/bookApproval">
|
||||
|
||||
<h3>寄贈申請</h3>
|
||||
|
||||
@@ -48,7 +74,7 @@
|
||||
<hr>
|
||||
|
||||
|
||||
<a class="card" href="${pageContext.request.contextPath}/lendList">
|
||||
<a class="card" href="/lendList">
|
||||
|
||||
<h3>貸出中図書一覧</h3>
|
||||
|
||||
@@ -59,7 +85,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<a class="card" href="${pageContext.request.contextPath}/bookApproval-list">
|
||||
<a class="card" href="/approvalReceive">
|
||||
|
||||
<h3>寄贈申請受信BOX</h3>
|
||||
|
||||
@@ -68,5 +94,16 @@
|
||||
</p>
|
||||
</a>
|
||||
|
||||
<hr>
|
||||
|
||||
<a class="card" href="/passwordChange">
|
||||
<h3>パスワード変更</h3>
|
||||
|
||||
<p>
|
||||
初期パスワードを<br> 変更します。
|
||||
</p>
|
||||
</a>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -5,6 +5,13 @@
|
||||
<title>図書情報更新入力</title>
|
||||
</head>
|
||||
<body>
|
||||
更新入力画面
|
||||
|
||||
<form method="post" action="updateconfirm">
|
||||
<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>
|
||||
</html>
|
||||
24
src/main/resources/templates/updateConfirm.html
Normal file
24
src/main/resources/templates/updateConfirm.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>更新内容確認</title>
|
||||
</head>
|
||||
<body>
|
||||
更新内容確認画面
|
||||
|
||||
<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>
|
||||
|
||||
<form method="post" action="bookUpdate">
|
||||
<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>
|
||||
</html>
|
||||
Reference in New Issue
Block a user