fix: 修改删除能谱功能 增加日志输入和文件夹判断
This commit is contained in:
parent
561a7eb610
commit
d6fa1992bd
|
@ -39,6 +39,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||||
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@ -173,6 +174,12 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
||||||
// 删除本地文件
|
// 删除本地文件
|
||||||
List<String> fails = new ArrayList<>();
|
List<String> fails = new ArrayList<>();
|
||||||
for (String path : needDel) {
|
for (String path : needDel) {
|
||||||
|
log.info("删除能谱文件:{}", path);
|
||||||
|
File file = new File(path);
|
||||||
|
if (file.isDirectory()) {
|
||||||
|
fails.add(path);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
boolean success = FileUtil.del(path);
|
boolean success = FileUtil.del(path);
|
||||||
if (!success) fails.add(path);
|
if (!success) fails.add(path);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user