|
@@ -192,7 +192,7 @@ public class PrivateStandardServiceImpl extends ServiceImpl<PrivateStandardMappe
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public boolean updateTypeByTwo(List<PrivateStandardDTO> data,
|
|
|
List<Long> delIds,
|
|
|
List<Long> delFileIds,
|
|
@@ -235,15 +235,16 @@ public class PrivateStandardServiceImpl extends ServiceImpl<PrivateStandardMappe
|
|
|
if(dto.getFile() != null){
|
|
|
//再去查询当前规范文件是否在数据库中存在未删除的文件
|
|
|
List<StandardFile> list = standardFileService.list(Wrappers.<StandardFile>lambdaQuery()
|
|
|
- .eq(StandardFile::getStandardId, dto.getId()));
|
|
|
+ .eq(StandardFile::getStandardId, dto.getId())
|
|
|
+ .eq(StandardFile::getIsDeleted, 0));
|
|
|
if(CollectionUtils.isNotEmpty(list)){
|
|
|
//删除文件
|
|
|
- for (StandardFile standardFile : standardFiles) {
|
|
|
+ for (StandardFile standardFile : list) {
|
|
|
String pdfName = standardFile.getStandardFileUrl().split("upload")[1];
|
|
|
this.newIOSSClient.removeFile("upload" + pdfName);
|
|
|
standardFile.setIsDeleted(1);
|
|
|
}
|
|
|
- standardFileService.saveOrUpdateBatch(standardFiles);
|
|
|
+ standardFileService.saveOrUpdateBatch(list);
|
|
|
}
|
|
|
MultipartFile file = dto.getFile();
|
|
|
StandardFile standardFile = new StandardFile();
|