#115 move method to service
This commit is contained in:
parent
bf515a3fcb
commit
c18ecea13b
@ -83,12 +83,7 @@ public class GrantController {
|
|||||||
|
|
||||||
@PostMapping(value = "/grant", params = "attachPaper")
|
@PostMapping(value = "/grant", params = "attachPaper")
|
||||||
public String attachPaper(GrantDto grantDto) {
|
public String attachPaper(GrantDto grantDto) {
|
||||||
if (!grantDto.getPaperIds().isEmpty()) {
|
grantService.attachPaper(grantDto);
|
||||||
grantDto.getPapers().clear();
|
|
||||||
grantDto.setPapers(grantService.getGrantPapers(grantDto.getPaperIds()));
|
|
||||||
} else {
|
|
||||||
grantDto.getPapers().clear();
|
|
||||||
}
|
|
||||||
return GRANT_PAGE;
|
return GRANT_PAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,4 +176,12 @@ public class GrantService {
|
|||||||
return paperService.findAll();
|
return paperService.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void attachPaper(GrantDto grantDto) {
|
||||||
|
if (!grantDto.getPaperIds().isEmpty()) {
|
||||||
|
grantDto.getPapers().clear();
|
||||||
|
grantDto.setPapers(getGrantPapers(grantDto.getPaperIds()));
|
||||||
|
} else {
|
||||||
|
grantDto.getPapers().clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user