Compare commits
7 Commits
5489761a8b
...
y-ogawa
| Author | SHA1 | Date | |
|---|---|---|---|
| e72fd9feb7 | |||
| a22189ba6e | |||
| 06d0d4b019 | |||
|
|
a80e99da7f | ||
|
|
40733ad01f | ||
|
|
3576a76137 | ||
|
|
53fd6ae2db |
@@ -1,56 +1,53 @@
|
|||||||
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.ModelAttribute;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
|
||||||
|
import com.example.demo.form.ReturnForm;
|
||||||
|
import com.example.demo.service.ReturnService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 書籍貸出承認確認用のコントローラ
|
* 書籍貸出承認確認用のコントローラ
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
public class ApprovalConfirmController {
|
public class ApprovalConfirmController {
|
||||||
|
|
||||||
// ログ出力用インスタンス
|
// HttpSession httpSession;
|
||||||
// private final static Logger LOGGER = Logger.getLogger(ApprovalConfirmController.class.getName());
|
ReturnService returnService;
|
||||||
|
|
||||||
// エラーメッセージ用の定数フィールド
|
@Autowired
|
||||||
// private final static String SEVERE_ERROR_MESSAGE = "エラーが発生しました!";
|
ApprovalConfirmController(ReturnService returnService) {
|
||||||
|
this.returnService = returnService;
|
||||||
// HttpSession httpSession;
|
|
||||||
// Request request;
|
|
||||||
//
|
|
||||||
// @Autowired
|
|
||||||
// public ApprovalConfirmController(
|
|
||||||
// HttpSession httpSession,
|
|
||||||
// Request request) {
|
|
||||||
// this.httpSession = httpSession;
|
|
||||||
// this.request = request;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @ModelAttribute
|
|
||||||
// public ApprovalForm approvalForm() {
|
|
||||||
// return new ApprovalForm();
|
|
||||||
// }
|
|
||||||
|
|
||||||
@RequestMapping(value = "/approvalConfirm", method = RequestMethod.POST)
|
|
||||||
public String AprrvalForm() {
|
|
||||||
|
|
||||||
System.out.println("a");
|
|
||||||
return "bookList";
|
|
||||||
// try {
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// return ;
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// // ログイン情報の破棄
|
|
||||||
// httpSession.invalidate();
|
|
||||||
//
|
|
||||||
// e.printStackTrace();
|
|
||||||
//
|
|
||||||
// // エラーログ出力
|
|
||||||
// LOGGER.log(Level.SEVERE, SEVERE_ERROR_MESSAGE, e);
|
|
||||||
// // エラー画面遷移
|
|
||||||
// return "error";
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ModelAttribute
|
||||||
|
ReturnForm returnForm() {
|
||||||
|
return new ReturnForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/approvalConfirm", method = { RequestMethod.POST, RequestMethod.GET })
|
||||||
|
public String ApporvalForm(Model model) {
|
||||||
|
//System.out.println("a");
|
||||||
|
try {
|
||||||
|
//仮の値を入れる 貸出テーブルのID
|
||||||
|
Integer id = 1;
|
||||||
|
//申請IDを元に取得
|
||||||
|
ReturnForm approvalresultForm = returnService.getReturnForm(id);
|
||||||
|
approvalresultForm.setIdRequest(id);
|
||||||
|
|
||||||
|
//returnFormに値をセット
|
||||||
|
// 画面に返す為の情報をセット
|
||||||
|
model.addAttribute("returnForm", approvalresultForm);
|
||||||
|
return "approvalConfirm";
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "error";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,73 @@
|
|||||||
package com.example.demo.controller;
|
package com.example.demo.controller;
|
||||||
|
|
||||||
|
import jakarta.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
|
||||||
|
import com.example.demo.form.ReturnForm;
|
||||||
|
import com.example.demo.service.ReturnService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 書籍貸出完了・却下処理用のコントローラ
|
* 書籍貸出承認完了・却下処理用のコントローラ
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
public class ApprovalConfirmResultController {
|
public class ApprovalConfirmResultController {
|
||||||
|
|
||||||
|
HttpSession httpSession;
|
||||||
|
ReturnService returnService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public ApprovalConfirmResultController(HttpSession httpSession, ReturnService returnService) {
|
||||||
|
this.httpSession = httpSession;
|
||||||
|
this.returnService = returnService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModelAttribute
|
||||||
|
ReturnForm returnForm() {
|
||||||
|
return new ReturnForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
//承認完了画面表示処理
|
||||||
|
@RequestMapping(value = "/approvalComplete", method = RequestMethod.POST)
|
||||||
|
public String approvalComplete(ReturnForm returnForm) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
//セッションからIDを拾いたい
|
||||||
|
httpSession.getAttribute("");
|
||||||
|
//いったん1ということで
|
||||||
|
int id = 1;
|
||||||
|
|
||||||
|
returnService.setReturnComplete(returnForm.getIdRequest(), id);
|
||||||
|
|
||||||
|
return "approvalComplete";
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "error";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//却下完了画面表示処理
|
||||||
|
@RequestMapping(value = "/approvalRejected", method = RequestMethod.POST)
|
||||||
|
public String approvalRejected(ReturnForm returnForm) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
//セッションからIDを拾いたい
|
||||||
|
httpSession.getAttribute("");
|
||||||
|
//いったん1ということで
|
||||||
|
int id = 1;
|
||||||
|
|
||||||
|
returnService.setReturnRejected(returnForm.getIdRequest(), id);
|
||||||
|
|
||||||
|
return "approvalRejected";
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "error";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,29 @@
|
|||||||
package com.example.demo.controller;
|
package com.example.demo.controller;
|
||||||
|
|
||||||
|
import jakarta.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
|
||||||
import com.example.demo.form.ReturnForm;
|
import com.example.demo.form.ReturnForm;
|
||||||
|
import com.example.demo.service.ReturnService;
|
||||||
|
|
||||||
//返却完了用のコントローラー
|
//返却完了用のコントローラー
|
||||||
@Controller
|
@Controller
|
||||||
public class ReturnCompleteController {
|
public class ReturnCompleteController {
|
||||||
|
|
||||||
|
HttpSession httpSession;
|
||||||
|
ReturnService rerurnService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public ReturnCompleteController(HttpSession httpSession, ReturnService rerurnService) {
|
||||||
|
this.httpSession = httpSession;
|
||||||
|
this.rerurnService = rerurnService;
|
||||||
|
}
|
||||||
|
|
||||||
@ModelAttribute
|
@ModelAttribute
|
||||||
ReturnForm returnForm() {
|
ReturnForm returnForm() {
|
||||||
return new ReturnForm();
|
return new ReturnForm();
|
||||||
@@ -21,14 +34,13 @@ public class ReturnCompleteController {
|
|||||||
public String returnComplete(ReturnForm returnForm) {
|
public String returnComplete(ReturnForm returnForm) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
System.out.println(returnForm.getNmBook());
|
//セッションからIDを拾いたい
|
||||||
|
httpSession.getAttribute("");
|
||||||
|
//いったん1ということで
|
||||||
|
int id = 1;
|
||||||
|
|
||||||
|
rerurnService.setReturn(returnForm.getIdRequest(), id);
|
||||||
|
|
||||||
//各種 必要な値をDBから取得,セッションからログイン者の情報
|
|
||||||
//蔵書テーブルの貸出フラグを貸出可、
|
|
||||||
//貸出テーブルのステータスを返却済、
|
|
||||||
//返却日を当日日付、
|
|
||||||
//更新者を更新した人のID、
|
|
||||||
//更新日を当日日付に更新する。
|
|
||||||
return "returnComplete";
|
return "returnComplete";
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -8,15 +8,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
|
||||||
import com.example.demo.form.ReturnForm;
|
import com.example.demo.form.ReturnForm;
|
||||||
import com.example.demo.service.RerurnService;
|
import com.example.demo.service.ReturnService;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class ReturnConfirmController {
|
public class ReturnConfirmController {
|
||||||
|
|
||||||
RerurnService rerurnService;
|
ReturnService rerurnService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
ReturnConfirmController(RerurnService rerurnService) {
|
ReturnConfirmController(ReturnService rerurnService) {
|
||||||
this.rerurnService = rerurnService;
|
this.rerurnService = rerurnService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,9 +31,12 @@ public class ReturnConfirmController {
|
|||||||
//仮の値を入れる
|
//仮の値を入れる
|
||||||
Integer id = 1;
|
Integer id = 1;
|
||||||
//申請IDを元に取得
|
//申請IDを元に取得
|
||||||
|
ReturnForm resultForm = rerurnService.getReturnForm(id);
|
||||||
|
resultForm.setIdRequest(id);
|
||||||
|
|
||||||
//returnFormに値をセット
|
//returnFormに値をセット
|
||||||
// 画面に返す為の情報をセット
|
// 画面に返す為の情報をセット
|
||||||
model.addAttribute("returnForm", rerurnService.getReturnForm(id));
|
model.addAttribute("returnForm", resultForm);
|
||||||
return "returnConfirm";
|
return "returnConfirm";
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
package com.example.demo.service;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.example.demo.form.ReturnForm;
|
|
||||||
import com.example.demo.repository.Book_CollectionRepository;
|
|
||||||
import com.example.demo.repository.Borrow_BooksRepository;
|
|
||||||
import com.example.demo.repository.EmployeeRepository;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class RerurnService {
|
|
||||||
|
|
||||||
Book_CollectionRepository book_CollectionRepository;
|
|
||||||
Borrow_BooksRepository borrowRepository;
|
|
||||||
EmployeeRepository employeeRepository;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
public RerurnService(
|
|
||||||
Book_CollectionRepository book_CollectionRepository,
|
|
||||||
Borrow_BooksRepository borrowRepository,
|
|
||||||
EmployeeRepository employeeRepository) {
|
|
||||||
this.book_CollectionRepository = book_CollectionRepository;
|
|
||||||
this.borrowRepository = borrowRepository;
|
|
||||||
this.employeeRepository = employeeRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ReturnForm getReturnForm(int id) {
|
|
||||||
ReturnForm result = new ReturnForm();
|
|
||||||
var borrow = borrowRepository.findById(id);
|
|
||||||
result.setDateRequest(borrow.get().getDateRequest());//申請日
|
|
||||||
result.setDateBorrow(borrow.get().getDateBorrow());//貸出日
|
|
||||||
result.setDateScheduledReturn(borrow.get().getDateScheduledReturn());//返却予定日
|
|
||||||
|
|
||||||
var emp = employeeRepository.findById(borrow.get().getIdApplicant());
|
|
||||||
result.setNmEmployee(emp.get().getNmEmployee());//申請者名、社員名
|
|
||||||
|
|
||||||
var book = book_CollectionRepository.findById(borrow.get().getIdBook());
|
|
||||||
result.setIsBn(book.get().getIsBn());//ISBN
|
|
||||||
result.setNmBook(book.get().getNmBook());//書籍名
|
|
||||||
result.setPubLisher(book.get().getPubLisher());//出版社
|
|
||||||
result.setNoteText(book.get().getNoteText());
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
package com.example.demo.service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.example.demo.entity.Borrow_booksEntity;
|
||||||
|
import com.example.demo.form.ReturnForm;
|
||||||
|
import com.example.demo.repository.Book_CollectionRepository;
|
||||||
|
import com.example.demo.repository.Borrow_BooksRepository;
|
||||||
|
import com.example.demo.repository.EmployeeRepository;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ReturnService {
|
||||||
|
|
||||||
|
Book_CollectionRepository book_CollectionRepository;
|
||||||
|
Borrow_BooksRepository borrowRepository;
|
||||||
|
EmployeeRepository employeeRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public ReturnService(
|
||||||
|
Book_CollectionRepository book_CollectionRepository,
|
||||||
|
Borrow_BooksRepository borrowRepository,
|
||||||
|
EmployeeRepository employeeRepository) {
|
||||||
|
this.book_CollectionRepository = book_CollectionRepository;
|
||||||
|
this.borrowRepository = borrowRepository;
|
||||||
|
this.employeeRepository = employeeRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReturnForm getReturnForm(int id) {
|
||||||
|
ReturnForm result = new ReturnForm();
|
||||||
|
Optional<Borrow_booksEntity> borrow = borrowRepository.findById(id);
|
||||||
|
// System.out.println(borrow);
|
||||||
|
result.setDateRequest(borrow.get().getDateRequest());//申請日
|
||||||
|
result.setDateBorrow(borrow.get().getDateBorrow());//貸出日
|
||||||
|
result.setDateScheduledReturn(borrow.get().getDateScheduledReturn());//返却予定日
|
||||||
|
|
||||||
|
var emp = employeeRepository.findById(borrow.get().getIdApplicant());
|
||||||
|
result.setNmEmployee(emp.get().getNmEmployee());//申請者名、社員名
|
||||||
|
|
||||||
|
var book = book_CollectionRepository.findById(borrow.get().getIdBook());
|
||||||
|
result.setIsBn(book.get().getIsBn());//ISBN
|
||||||
|
result.setNmBook(book.get().getNmBook());//書籍名
|
||||||
|
result.setPubLisher(book.get().getPubLisher());//出版社
|
||||||
|
result.setNoteText(book.get().getNoteText());
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReturn(int id_request, int id_employee) {
|
||||||
|
var borrow = borrowRepository.findById(id_request);
|
||||||
|
var book = book_CollectionRepository.findById(borrow.get().getIdBook());
|
||||||
|
book.get().setFlgLending('0');//「貸出フラグ」を【貸出可】
|
||||||
|
borrow.get().setStatus('0');//貸出テーブルの「ステータス」を【返却済
|
||||||
|
borrow.get().setDateReturn(new Date());//「返却日」を当日日付
|
||||||
|
borrow.get().setIdUpdate(id_employee);//「更新者」を更新した人のID
|
||||||
|
borrow.get().setDateUpdate(new Date());//「更新日」を当日日付に更新する。
|
||||||
|
|
||||||
|
borrowRepository.save(borrow.get());
|
||||||
|
book_CollectionRepository.save(book.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
//貸出承認
|
||||||
|
public void setReturnComplete(int id_request, int id_employee) {
|
||||||
|
var borrow = borrowRepository.findById(id_request);
|
||||||
|
var book = book_CollectionRepository.findById(borrow.get().getIdBook());
|
||||||
|
|
||||||
|
borrow.get().setStatus('2');//貸出テーブルの「ステータス」を【貸出中】
|
||||||
|
borrow.get().setDateApproval(new Date());//「承認日」を当日日付
|
||||||
|
borrow.get().setIdUpdate(id_employee);//「更新者」を更新した人のID
|
||||||
|
borrow.get().setDateUpdate(new Date());//「更新日」を当日日付に更新する。
|
||||||
|
|
||||||
|
borrowRepository.save(borrow.get());
|
||||||
|
book_CollectionRepository.save(book.get());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//却下
|
||||||
|
//貸出テーブルの「ステータス」を【却下】、「更新者」を却下した人のID、「更新日」を当日日付に更新する。
|
||||||
|
//また、蔵書テーブルの「貸出フラグ」を【貸出可】に更新する。
|
||||||
|
public void setReturnRejected(int id_request, int id_employee) {
|
||||||
|
|
||||||
|
var borrow = borrowRepository.findById(id_request);
|
||||||
|
var book = book_CollectionRepository.findById(borrow.get().getIdBook());
|
||||||
|
|
||||||
|
book.get().setFlgLending('0');//「貸出フラグ」を【貸出可】
|
||||||
|
borrow.get().setStatus('9');//貸出テーブルの「ステータス」を【却下】
|
||||||
|
borrow.get().setIdUpdate(id_employee);//「更新者」を却下した人のID
|
||||||
|
borrow.get().setDateUpdate(new Date());//「更新日」を当日日付に更新する。
|
||||||
|
|
||||||
|
borrowRepository.save(borrow.get());
|
||||||
|
book_CollectionRepository.save(book.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,39 +2,16 @@
|
|||||||
<html xmlns:th="http://www.thymeleaf.org">
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
<title>書籍貸出承認画面</title>
|
||||||
<!-- 外部のスクリプトファイルを読み込む -->
|
|
||||||
<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>
|
</head>
|
||||||
|
<div style="text-align: right;">
|
||||||
|
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
||||||
|
</div>
|
||||||
<body>
|
<body>
|
||||||
<h2>書籍貸出申請を承認しました。</h2>
|
<h2>書籍貸出申請を承認しました。</h2>
|
||||||
<br/>
|
<br/>
|
||||||
<a href="javascript:insertSubmit()">承認待ち一覧に戻る</a> | <a href="showMenu">メニューに戻る</a>
|
<a href="javascript:insertSubmit()">承認待ち一覧に戻る</a> | <a href="showMenu">メニューに戻る</a>
|
||||||
</body>
|
</body>
|
||||||
<script type="text/javascript">
|
|
||||||
function insertSubmit() {
|
|
||||||
const form = document.createElement('form');
|
|
||||||
form.setAttribute('method', 'post');
|
|
||||||
form.setAttribute('action', 'approvalConfirm');
|
|
||||||
|
|
||||||
// 動的送信用のHidden
|
|
||||||
// 動的にFormを作成する場合は何かしら送信しないと、正しく動作しない
|
|
||||||
const inputField = document.createElement("input");
|
|
||||||
inputField.setAttribute("type", "hidden");
|
|
||||||
inputField.setAttribute("value", "select");
|
|
||||||
|
|
||||||
form.appendChild(inputField);
|
|
||||||
|
|
||||||
// フォームをDOMに追加
|
|
||||||
document.body.appendChild(form);
|
|
||||||
|
|
||||||
form.submit();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</html>
|
</html>
|
||||||
@@ -1,39 +1,28 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html xmlns:th="http://www.thymeleaf.org">
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
<head>
|
<head>
|
||||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
<meta charset="UTF-8">
|
||||||
<!-- 外部のスクリプトファイルを読み込む -->
|
<title>書籍貸出承認確認</title>
|
||||||
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>登録内容確認
|
<div style="text-align: right;">
|
||||||
<div class="rightSection">
|
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
||||||
<span class="loginInfo">ログイン者名:<span th:text="${session.loginUser.nmEmployee}"></span></span>
|
</div>
|
||||||
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
|
||||||
</div>
|
<form action ="approvalComplete"
|
||||||
</h1>
|
method="post"
|
||||||
<!-- 変数名は変更したが、中身は変更していない -->
|
th:object="${returnForm}">
|
||||||
<!-- ボタンや遷移も手を付けていない -->
|
|
||||||
<form action="approvalConfirm"
|
|
||||||
method="post">
|
|
||||||
|
|
||||||
<div class="msgBox error" th:if="${messageError != null}">
|
|
||||||
<span class="error" th:each="message : ${messageError.message}" th:text="${message}"></span>
|
|
||||||
</div>
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="header">申請ID</th>
|
<th class="header">申請ID</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input class="readOnly"
|
<input class="readOnly"
|
||||||
name="idRquest"
|
name="idRequest"
|
||||||
readonly="readonly"
|
readonly="readonly"
|
||||||
type="text"
|
th:field="*{idRequest}"
|
||||||
value="自動で設定されます"/>
|
type="text"/>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -44,7 +33,7 @@
|
|||||||
<input class="readOnly"
|
<input class="readOnly"
|
||||||
name="nmEmployee"
|
name="nmEmployee"
|
||||||
readonly="readonly"
|
readonly="readonly"
|
||||||
th:value="*{nmEmployee}"
|
th:field="*{nmEmployee}"
|
||||||
type="text"/>
|
type="text"/>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
@@ -54,9 +43,9 @@
|
|||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input class="readOnly"
|
<input class="readOnly"
|
||||||
name="dataRequest"
|
name="dateRequest"
|
||||||
readonly="readonly"
|
readonly="readonly"
|
||||||
th:value="*{dataRequest}"
|
th:field="*{dateRequest}"
|
||||||
type="text"/>
|
type="text"/>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
@@ -68,7 +57,7 @@
|
|||||||
<input class="readOnly"
|
<input class="readOnly"
|
||||||
name="isBn"
|
name="isBn"
|
||||||
readonly="readonly"
|
readonly="readonly"
|
||||||
th:value="*{isBn}"
|
th:field="*{isBn}"
|
||||||
type="text"/>
|
type="text"/>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
@@ -80,7 +69,7 @@
|
|||||||
<input class="readOnly"
|
<input class="readOnly"
|
||||||
name="nmBook"
|
name="nmBook"
|
||||||
readonly="readonly"
|
readonly="readonly"
|
||||||
th:value="*{nmBook}"
|
th:field="*{nmBook}"
|
||||||
type="text"/>
|
type="text"/>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
@@ -90,9 +79,9 @@
|
|||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input class="readOnly"
|
<input class="readOnly"
|
||||||
name="publisher"
|
name="pubLisher"
|
||||||
readonly="readonly"
|
readonly="readonly"
|
||||||
th:value="*{publisher}"
|
th:field="*{pubLisher}"
|
||||||
type="text"/>
|
type="text"/>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
@@ -102,9 +91,9 @@
|
|||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input class="readOnly"
|
<input class="readOnly"
|
||||||
name="note"
|
name="noteText"
|
||||||
readonly="readonly"
|
readonly="readonly"
|
||||||
th:value="*{note}"
|
th:field="*{noteText}"
|
||||||
type="text"/>
|
type="text"/>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
@@ -116,7 +105,7 @@
|
|||||||
<input class="readOnly"
|
<input class="readOnly"
|
||||||
name="dateBorrow"
|
name="dateBorrow"
|
||||||
readonly="readonly"
|
readonly="readonly"
|
||||||
th:value="*{dateBorrow}"
|
th:field="*{dateBorrow}"
|
||||||
type="text"/>
|
type="text"/>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
@@ -128,25 +117,24 @@
|
|||||||
<input class="readOnly"
|
<input class="readOnly"
|
||||||
name="dateScheduledReturn"
|
name="dateScheduledReturn"
|
||||||
readonly="readonly"
|
readonly="readonly"
|
||||||
th:value="*{date_scheduled_return}"
|
th:field="*{dateScheduledReturn}"
|
||||||
type="text"/>
|
type="text"/>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="btnArea" colspan="2">
|
<td class="btn" colspan="2">
|
||||||
<input type="submit" value="承認"/>
|
<input type="submit" name="action" formaction="approvalComplete" value="承認"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="btnArea" colspan="2">
|
<td class="btn" colspan="2">
|
||||||
<input type="submit" value="却下"/>
|
<input type="submit" name="action" formaction="approvalRejected" value="却下"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<br/>
|
<br/>
|
||||||
<a href="javascript:insertSubmit()">承認待ち一覧に戻る</a>
|
<a href="javascript:insertSubmit()">承認待ち一覧に戻る</a>
|
||||||
</form>
|
</form>
|
||||||
|
</body>
|
||||||
</body>
|
|
||||||
</html>
|
</html>
|
||||||
@@ -2,39 +2,15 @@
|
|||||||
<html xmlns:th="http://www.thymeleaf.org">
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
<title>書籍貸出却下画面</title>
|
||||||
<!-- 外部のスクリプトファイルを読み込む -->
|
|
||||||
<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>
|
</head>
|
||||||
|
<div style="text-align: right;">
|
||||||
|
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
||||||
|
</div>
|
||||||
<body>
|
<body>
|
||||||
<h2>書籍貸出申請を却下しました。</h2>
|
<h2>書籍貸出申請を却下しました。</h2>
|
||||||
<br/>
|
<br/>
|
||||||
<a href="javascript:insertSubmit()">承認待ち一覧に戻る</a> | <a href="showMenu">メニューに戻る</a>
|
<a href="javascript:insertSubmit()">承認待ち一覧に戻る</a> | <a href="showMenu">メニューに戻る</a>
|
||||||
</body>
|
</body>
|
||||||
<script type="text/javascript">
|
|
||||||
function insertSubmit() {
|
|
||||||
const form = document.createElement('form');
|
|
||||||
form.setAttribute('method', 'post');
|
|
||||||
form.setAttribute('action', 'approvalConfirm');
|
|
||||||
|
|
||||||
// 動的送信用のHidden
|
|
||||||
// 動的にFormを作成する場合は何かしら送信しないと、正しく動作しない
|
|
||||||
const inputField = document.createElement("input");
|
|
||||||
inputField.setAttribute("type", "hidden");
|
|
||||||
inputField.setAttribute("value", "select");
|
|
||||||
|
|
||||||
form.appendChild(inputField);
|
|
||||||
|
|
||||||
// フォームをDOMに追加
|
|
||||||
document.body.appendChild(form);
|
|
||||||
|
|
||||||
form.submit();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</html>
|
</html>
|
||||||
14
team1/src/main/resources/templates/error.html
Normal file
14
team1/src/main/resources/templates/error.html
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>エラー</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>エラーが発生しました。</h1>
|
||||||
|
|
||||||
|
<div>ログインからやり直してください。</div>
|
||||||
|
<a href="login">ログイン</a>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user