|
|
@@ -284,4 +284,20 @@ public class CoreRegisterBookPdfServiceImpl extends ServiceImpl<CoreRegisterBook
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Integer deleteWithFile(Long id) {
|
|
|
+ final CoreRegisterBookPdf record = getById(id);
|
|
|
+ final String fileUrl = record.getFileUrl();
|
|
|
+ if (ObjectUtil.isNotEmpty(fileUrl)){
|
|
|
+ String localPathPrefix = fileService.getLocalPathPrefix().getData();
|
|
|
+ String staticPathPrefix = fileService.getStaticPathPrefix().getData();
|
|
|
+ final String filePath = fileUrl.replace(staticPathPrefix, localPathPrefix);
|
|
|
+ final File file = new File(filePath);
|
|
|
+ if (file.exists()){
|
|
|
+ file.delete();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return coreRegisterBookPdfMapper.deleteById(id);
|
|
|
+ }
|
|
|
}
|