|
|
@ -832,9 +832,6 @@ public class InspectOfflineServiceImpl implements IOfflineDataService { |
|
|
|
List<TaskObjectSyncBO> taskObjects = JsonFileUtil.readJsonFile(upload + "/HZ_ST_EX_OBJECT.json", TaskObjectSyncBO.class); |
|
|
|
List<TaskObjectSyncBO> taskObjects = JsonFileUtil.readJsonFile(upload + "/HZ_ST_EX_OBJECT.json", TaskObjectSyncBO.class); |
|
|
|
List<TaskObjectProjectContentBO> projectContents = JsonFileUtil.readJsonFile(upload + "/HZ_ST_EX_OBJECT_PROJECT_CONTENT.json", TaskObjectProjectContentBO.class); |
|
|
|
List<TaskObjectProjectContentBO> projectContents = JsonFileUtil.readJsonFile(upload + "/HZ_ST_EX_OBJECT_PROJECT_CONTENT.json", TaskObjectProjectContentBO.class); |
|
|
|
|
|
|
|
|
|
|
|
// 内容图片
|
|
|
|
|
|
|
|
this.batchCurrentImg(upload, eventRecords); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 文件上传
|
|
|
|
// 文件上传
|
|
|
|
this.batchUploadImg(upload, eventRecords); |
|
|
|
this.batchUploadImg(upload, eventRecords); |
|
|
|
this.batchUploadImg(upload, eventAttachments); |
|
|
|
this.batchUploadImg(upload, eventAttachments); |
|
|
@ -876,49 +873,6 @@ public class InspectOfflineServiceImpl implements IOfflineDataService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 上传内容文件 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param sourceDir |
|
|
|
|
|
|
|
* @param data |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private void batchCurrentImg(String sourceDir, List<? extends SyncBO> data) { |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(data)) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.forEach(bo -> { |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(bo.getCurrentValues())) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<String> urls = bo.getCurrentValues().stream().map(o -> { |
|
|
|
|
|
|
|
if (StringUtils.isBlank(o) || !o.contains("file:")) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/**wxq begin**/ |
|
|
|
|
|
|
|
String fileName = o.substring(o.lastIndexOf("/") >= 0 ? o.lastIndexOf("/") + 1 : 0); |
|
|
|
|
|
|
|
File file = new File(sourceDir + "/" + fileName); |
|
|
|
|
|
|
|
if (!file.exists()) { |
|
|
|
|
|
|
|
throw new RuntimeException("文件名称为:" + fileName + "不存在,上传失败!"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
R<BladeFile> r = null; |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
MultipartFile multipartFile = this.getMultipartFile(file); |
|
|
|
|
|
|
|
r = ossClient.putFile(multipartFile); |
|
|
|
|
|
|
|
if (!r.isSuccess()) { |
|
|
|
|
|
|
|
throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
BladeFile bladeFile = r.getData(); |
|
|
|
|
|
|
|
return bladeFile != null ? bladeFile.getLink() : null; |
|
|
|
|
|
|
|
} catch (Exception ex) { |
|
|
|
|
|
|
|
throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r.toString(), ex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).filter(StringUtils::isNotBlank).collect(Collectors.toList()); |
|
|
|
|
|
|
|
bo.setCurrentValues(urls); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 上传文件 |
|
|
|
* 上传文件 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param sourceDir |
|
|
|
* @param sourceDir |
|
|
@ -955,7 +909,7 @@ public class InspectOfflineServiceImpl implements IOfflineDataService { |
|
|
|
} catch (Exception ex) { |
|
|
|
} catch (Exception ex) { |
|
|
|
throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r.toString(), ex); |
|
|
|
throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r.toString(), ex); |
|
|
|
} |
|
|
|
} |
|
|
|
}).filter(StringUtils::isNotBlank).collect(Collectors.toList()); |
|
|
|
}).filter(o -> StringUtils.isNotBlank(o)).collect(Collectors.toList()); |
|
|
|
bo.setFiles(urls); |
|
|
|
bo.setFiles(urls); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|