|
@@ -1176,18 +1176,8 @@ public class FinancialInstitutionServiceImpl extends ServiceImpl<FinancialInstit
|
|
FileModuleDict.ChildEnum childEnum = FileModuleDict.ChildEnum.FINANCIAL_EXPENDITURE_ATTACHMENT_FILE;
|
|
FileModuleDict.ChildEnum childEnum = FileModuleDict.ChildEnum.FINANCIAL_EXPENDITURE_ATTACHMENT_FILE;
|
|
if (CollectionUtil.isNotEmpty(contractFileList)) {
|
|
if (CollectionUtil.isNotEmpty(contractFileList)) {
|
|
contractFileList.forEach(contractFile -> {
|
|
contractFileList.forEach(contractFile -> {
|
|
- String fileName = contractFile.getOriginalName().substring(0, contractFile.getOriginalName().lastIndexOf("."));
|
|
|
|
- String localFilePath = FileUtil.getAbsolutePath(fileName, contractFile.getType(), childEnum);
|
|
|
|
- File destFile = new File(localFilePath);
|
|
|
|
- if (!destFile.getParentFile().exists()) {
|
|
|
|
- destFile.getParentFile().mkdirs();
|
|
|
|
- }
|
|
|
|
- //新建FileStorage
|
|
|
|
- FileStorage newFileStorage = new FileStorage(contractFile, localFilePath, childEnum);
|
|
|
|
- fileStorageService.add(newFileStorage);
|
|
|
|
- //新建关联关系
|
|
|
|
- AttachmentDto attachmentDto = AttachmentDto.builder().setEntityId(customerExpenditureInfoId).setChildEnum(childEnum).build();
|
|
|
|
- sysAttachmentRefService.saveRef(Arrays.asList(newFileStorage.getId()), attachmentDto);
|
|
|
|
|
|
+ sysAttachmentRefService.copyFile(contractFile, FileModuleDict.ChildEnum.FINANCIAL_EXPENDITURE_DOWNSTREAM_SETTLEMENT_FILE,
|
|
|
|
+ AttachmentDto.builder().setEntityId(customerExpenditureInfoId).build());
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|