貸出テーブルの「ステータス」が「1:承認待」の情報を全件取得

This commit is contained in:
s-sakiyama
2026-10-22 15:32:06 +09:00
parent 16f4aacf23
commit 85d1d3715b

View File

@@ -155,4 +155,25 @@ public class ReturnService {
borrowRepository.save(borrow); borrowRepository.save(borrow);
} }
//貸出テーブルの「ステータス」が「1:承認待」の情報を全件取得
public List<LeadingListModel> getAwaitingApprovalList() {
List<LeadingListModel> result = new ArrayList<LeadingListModel>();
List<Borrow_booksEntity> borrow = borrowRepository.findByStatus('1');
for (Borrow_booksEntity borrow_booksEntity : borrow) {
String nmEmployee = employeeRepository.findById(borrow_booksEntity.getIdApplicant()).get().getNmEmployee();
String nmBook = book_CollectionRepository.findById(borrow_booksEntity.getIdBook()).get().getNmBook();
LeadingListModel a = new LeadingListModel(borrow_booksEntity.getIdRequest(),
nmEmployee,
nmBook,
borrow_booksEntity.getDateRequest(),
borrow_booksEntity.getDateBorrow(),
borrow_booksEntity.getDateScheduledReturn());
result.add(a);
}
return result;
}
} }