|
@@ -233,6 +233,16 @@ public class PrivateStandardServiceImpl extends ServiceImpl<PrivateStandardMappe
|
|
|
}
|
|
|
//先上传文件,上传成功在执行添加
|
|
|
if(dto.getFile() != null){
|
|
|
+ //再去查询当前规范文件是否在数据库中存在未删除的文件
|
|
|
+ List<StandardFile> list = standardFileService.list(Wrappers.<StandardFile>lambdaQuery()
|
|
|
+ .eq(StandardFile::getStandardId, dto.getId()));
|
|
|
+ if(CollectionUtils.isNotEmpty(list)){
|
|
|
+ //删除文件
|
|
|
+ for (StandardFile standardFile : standardFiles) {
|
|
|
+ String pdfName = standardFile.getStandardFileUrl().split("upload")[1];
|
|
|
+ this.newIOSSClient.removeFile("upload" + pdfName);
|
|
|
+ }
|
|
|
+ }
|
|
|
MultipartFile file = dto.getFile();
|
|
|
StandardFile standardFile = new StandardFile();
|
|
|
standardFile.setId(SnowFlakeUtil.getId());
|