Compare commits
15 Commits
b128e92598
...
3d5653418a
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d5653418a | |||
| b6d24a3d05 | |||
| 6faaedaa95 | |||
| b6ada277a2 | |||
| b58a996e84 | |||
| 0b89e45386 | |||
| 694cb0f621 | |||
| ff1c43d80b | |||
| 528eadec5a | |||
| 13f2fdedea | |||
| 4e6ca0eea9 | |||
| d67b790c44 | |||
| eddc638c93 | |||
| 8392c6d2da | |||
| 75af719656 |
@@ -1,5 +1,4 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -37,7 +36,7 @@ public class AdminLoanController {
|
||||
public String approvalConfirm(@PathVariable Integer id, Model model, RedirectAttributes ra) {
|
||||
try {
|
||||
model.addAttribute("r", loanService.getView(id, Const.STATUS_WAITING));
|
||||
return "approvalConfirm";
|
||||
return "approvalConfilm";
|
||||
} catch (BusinessException e) {
|
||||
ra.addFlashAttribute("errorMessage", e.getMessage());
|
||||
return "redirect:/admin/applications";
|
||||
@@ -50,7 +49,7 @@ public class AdminLoanController {
|
||||
try {
|
||||
loanService.approve(id, admin);
|
||||
ra.addFlashAttribute("message", "書籍貸出申請を承認しました。");
|
||||
return "redirect:/admin/approval/complete";
|
||||
return "approvalComplete";
|
||||
} catch (BusinessException e) {
|
||||
ra.addFlashAttribute("errorMessage", e.getMessage());
|
||||
return "redirect:/admin/applications";
|
||||
@@ -63,7 +62,7 @@ public class AdminLoanController {
|
||||
try {
|
||||
loanService.reject(id, admin);
|
||||
ra.addFlashAttribute("message", "書籍貸出申請を却下しました。");
|
||||
return "redirect:/admin/approval/complete";
|
||||
return "approvalRejected";
|
||||
} catch (BusinessException e) {
|
||||
ra.addFlashAttribute("errorMessage", e.getMessage());
|
||||
return "redirect:/admin/applications";
|
||||
@@ -116,3 +115,4 @@ public class AdminLoanController {
|
||||
return "complete";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.example.demo.service;
|
||||
|
||||
|
||||
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -18,6 +15,7 @@ import com.example.demo.form.BookForm;
|
||||
import com.example.demo.repository.BookCollectionRepository;
|
||||
|
||||
/** BOOK-02:書籍登録、BOOK-03:書籍編集 */
|
||||
|
||||
@Service
|
||||
public class BookAdminService {
|
||||
private final BookCollectionRepository bookRepository;
|
||||
@@ -83,6 +81,7 @@ public class BookAdminService {
|
||||
if (!errors.isEmpty()) throw new BusinessException(String.join(" ", errors));
|
||||
}
|
||||
|
||||
|
||||
private static void apply(BookCollection b, BookForm f) {
|
||||
b.setIsbn(f.getIsbn());
|
||||
b.setNmBook(f.getNmBook());
|
||||
@@ -90,4 +89,5 @@ public class BookAdminService {
|
||||
b.setPublisher(f.getPublisher().isEmpty() ? null : f.getPublisher());
|
||||
b.setNote(f.getNote().isEmpty() ? null : f.getNote());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user