修改导入的bug

This commit is contained in:
chenxudong 2024-12-02 17:13:30 +08:00
parent 520d1885f7
commit 03ee38a3f0
3 changed files with 4 additions and 5 deletions

View File

@ -49,7 +49,7 @@
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into ed_data_info (id, replace into ed_data_info (id,
category_type_id, parent_id, category_id, category_type_id, parent_id, category_id,
category_name, category_status, category_name, category_status,
creator, creator_name, gmt_create, creator, creator_name, gmt_create,

View File

@ -38,7 +38,7 @@
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into ed_data_info (category_id, replace into ed_data_info (category_id,
data_id, data_no, data_name, data_id, data_no, data_name,
data_type, file_type, version, data_type, file_type, version,
content, implant_json, data_status, content, implant_json, data_status,

View File

@ -228,7 +228,7 @@ public class EDDataFacadeImpl implements EDDataFacade {
Map<String, String> result = new HashMap<>(); Map<String, String> result = new HashMap<>();
List<String> dataIdList = Arrays.asList(dataIdArr.split(",")); List<String> dataIdList = Arrays.asList(dataIdArr.split(","));
if(dataIdList.size() > 0) { if(!dataIdList.isEmpty()) {
String filePath = edDataService.exportData(dataIdList); String filePath = edDataService.exportData(dataIdList);
Assert.isTrue(FileUtil.exist(filePath), "下载文件不存在。"); Assert.isTrue(FileUtil.exist(filePath), "下载文件不存在。");
@ -313,13 +313,12 @@ public class EDDataFacadeImpl implements EDDataFacade {
return new ArrayList<>(); return new ArrayList<>();
} }
List<Integer> uploadedFileChunkNums = FileUtil.listFileNames(destPath) return FileUtil.listFileNames(destPath)
.stream() .stream()
.filter(e -> !e.endsWith(".comac")) .filter(e -> !e.endsWith(".comac"))
.map(e -> e.replace(UPLOAD_FILE_CHUNK_SUFFIX, "")) .map(e -> e.replace(UPLOAD_FILE_CHUNK_SUFFIX, ""))
.map(Integer::parseInt) .map(Integer::parseInt)
.collect(Collectors.toList()); .collect(Collectors.toList());
return uploadedFileChunkNums;
} }
// TODO 需要验证如果一个分片上传一半网络断开则该分片的存储情况 // TODO 需要验证如果一个分片上传一半网络断开则该分片的存储情况