メニュー画面、申請一覧画面(池田さん)、貸出一覧画面

This commit is contained in:
2026-10-23 13:13:40 +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

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

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