Resolve "Реализовать уведомление о смене статуса статьи" #140
@ -67,6 +67,9 @@ public class PaperService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public Integer update(PaperDto paperDto) throws IOException {
|
public Integer update(PaperDto paperDto) throws IOException {
|
||||||
Paper paper = paperRepository.findOne(paperDto.getId());
|
Paper paper = paperRepository.findOne(paperDto.getId());
|
||||||
|
if(paper != null && paper.getStatus() != paperDto.getStatus()){
|
||||||
|
sendMessageAboutStatusChange(paper.getStatus(),paperDto);
|
||||||
|
}
|
||||||
if (paperDto.getTmpFileName() != null && paper.getFileData() != null) {
|
if (paperDto.getTmpFileName() != null && paper.getFileData() != null) {
|
||||||
fileService.deleteFile(paper.getFileData());
|
fileService.deleteFile(paper.getFileData());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user