5 Commits

Author SHA1 Message Date
549538f8a4 メニュー画面、申請一覧画面(池田さん)、貸出一覧画面 2026-10-23 13:13:40 +09:00
s-sakiyama
341365aa81 LoginInfoFormの情報から管理者Flgを返す 2026-10-23 09:35:24 +09:00
s-sakiyama
5a5bfd9112 ログイン機能 2026-10-22 15:55:31 +09:00
s-sakiyama
85d1d3715b 貸出テーブルの「ステータス」が「1:承認待」の情報を全件取得 2026-10-22 15:32:06 +09:00
s-sakiyama
16f4aacf23 貸出申請機能 2026-10-22 15:15:03 +09:00
6 changed files with 54 additions and 6 deletions

View File

@@ -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";
}
}

View File

@@ -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)
//返却確認ページにアクセスしたときに実行されるメソッド //返却確認ページにアクセスしたときに実行されるメソッド

View File

@@ -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");

View File

@@ -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>

View File

@@ -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>

View File

@@ -43,5 +43,4 @@
</div> </div>
</body> </body>
</html> </html>