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";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="employeeInfoForm : ${employeeInfoFormList}">
|
||||
<tr th:each="employeeInfoForm : ${applicationList}">
|
||||
<td th:text="${employeeInfoForm.idRequest}"></td>
|
||||
<td th:text="${employeeInfoForm.nmApplicant}"></td>
|
||||
<td th:text="${employeeInfoForm.nmBook}"></td>
|
||||
@@ -59,7 +59,7 @@
|
||||
</table>
|
||||
</th:block>
|
||||
|
||||
<th:block th:if="${employeeInfoFormList == null or employeeInfoFormList.size() == 0}">
|
||||
<th:block th:if="${applicationList == null or borrowList.isEmpty()}">
|
||||
<!-- 検索結果が0件の場合 -->
|
||||
現在書籍貸出の申請はありません。
|
||||
</th:block>
|
||||
|
||||
@@ -43,5 +43,4 @@
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user