Compare commits
5 Commits
76c299ca3e
...
549538f8a4
| Author | SHA1 | Date | |
|---|---|---|---|
| 549538f8a4 | |||
|
|
341365aa81 | ||
|
|
5a5bfd9112 | ||
|
|
85d1d3715b | ||
|
|
16f4aacf23 |
@@ -0,0 +1,49 @@
|
|||||||
|
package com.example.demo.controller;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import com.example.demo.service.ReturnService;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class ApplicationListController{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ReturnService returnService;
|
||||||
|
|
||||||
|
public ApplicationListController(ReturnService returnService) {
|
||||||
|
this.returnService = returnService;
|
||||||
|
}
|
||||||
|
|
||||||
|
//applicationListにアクセスしたときに実行されるメソッド
|
||||||
|
@RequestMapping(value = "/applicationList", method = RequestMethod.GET)
|
||||||
|
public String index(Model model) {
|
||||||
|
//サービスから一覧を取得し、getAwaitingApprovalListという名前でHTMLに渡す
|
||||||
|
model.addAttribute("applicationList", returnService.getAwaitingApprovalList());
|
||||||
|
return "applicationList";
|
||||||
|
}
|
||||||
|
|
||||||
|
//メニュー画面に戻るURLへMapping
|
||||||
|
@RequestMapping(value = "/menu", method = RequestMethod.GET)
|
||||||
|
public String menu() {
|
||||||
|
return "menu";
|
||||||
|
}
|
||||||
|
|
||||||
|
//申請承認待ちページに遷移するためのMapping
|
||||||
|
@RequestMapping(value = "/returnApproval", method = RequestMethod.GET)
|
||||||
|
//返却確認ページにアクセスしたときに実行されるメソッド
|
||||||
|
public String returnApproval(
|
||||||
|
//URLから送られた申請IDを受け取る
|
||||||
|
@RequestParam("idRequest") Integer idRequest, Model model) {
|
||||||
|
//受け取った申請IDをidRequestという名前でModelに登録してHTMLに渡す
|
||||||
|
model.addAttribute("idRequest", idRequest);
|
||||||
|
//上記で渡すHTMLのURL
|
||||||
|
return "returnApproval";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ public class LendingListController {
|
|||||||
public String menu() {
|
public String menu() {
|
||||||
return "menu";
|
return "menu";
|
||||||
}
|
}
|
||||||
|
|
||||||
//書籍返却ページに遷移
|
//書籍返却ページに遷移
|
||||||
@RequestMapping(value = "/returnConfirm", method = RequestMethod.GET)
|
@RequestMapping(value = "/returnConfirm", method = RequestMethod.GET)
|
||||||
//返却確認ページにアクセスしたときに実行されるメソッド
|
//返却確認ページにアクセスしたときに実行されるメソッド
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public class MenuController {
|
|||||||
// public String showmenu() {
|
// public String showmenu() {
|
||||||
// return "menu";
|
// return "menu";
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@GetMapping("/menu")
|
@GetMapping("/menu")
|
||||||
public String menu(HttpSession session, Model model) {
|
public String menu(HttpSession session, Model model) {
|
||||||
Character FlgAdmin = (Character) session.getAttribute("FlgAdmin");
|
Character FlgAdmin = (Character) session.getAttribute("FlgAdmin");
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr th:each="employeeInfoForm : ${employeeInfoFormList}">
|
<tr th:each="employeeInfoForm : ${applicationList}">
|
||||||
<td th:text="${employeeInfoForm.idRequest}"></td>
|
<td th:text="${employeeInfoForm.idRequest}"></td>
|
||||||
<td th:text="${employeeInfoForm.nmApplicant}"></td>
|
<td th:text="${employeeInfoForm.nmApplicant}"></td>
|
||||||
<td th:text="${employeeInfoForm.nmBook}"></td>
|
<td th:text="${employeeInfoForm.nmBook}"></td>
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</th:block>
|
</th:block>
|
||||||
|
|
||||||
<th:block th:if="${employeeInfoFormList == null or employeeInfoFormList.size() == 0}">
|
<th:block th:if="${applicationList == null or borrowList.isEmpty()}">
|
||||||
<!-- 検索結果が0件の場合 -->
|
<!-- 検索結果が0件の場合 -->
|
||||||
現在書籍貸出の申請はありません。
|
現在書籍貸出の申請はありません。
|
||||||
</th:block>
|
</th:block>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<title>貸出中書籍一覧</title>
|
<title>貸出中書籍一覧</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>
|
<h1>
|
||||||
<div class="rightSection">
|
<div class="rightSection">
|
||||||
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
<button class="logoutButton" onclick="logoutSubmit()">ログアウト</button>
|
||||||
|
|||||||
@@ -43,5 +43,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user