|
@@ -823,12 +823,21 @@ public class ContractMakingServiceImpl implements ContractMakingService {
|
|
if (split.length == 2) {
|
|
if (split.length == 2) {
|
|
id = Long.parseLong(split[1]);
|
|
id = Long.parseLong(split[1]);
|
|
}
|
|
}
|
|
- File file = newContractMakingService.createContractDocument(type, id, contractInfo);
|
|
|
|
- fileList.add(file);
|
|
|
|
|
|
+ File newFile = newContractMakingService.createContractDocument(type, id, contractInfo);
|
|
|
|
+ for (File file : fileList) {
|
|
|
|
+ if (file.getName().equals(newFile.getName())) {
|
|
|
|
+ String fileName = newFile.getName().substring(newFile.getName().lastIndexOf("."));
|
|
|
|
+ String extension = newFile.getName().substring(newFile.getName().lastIndexOf(".") + 1);
|
|
|
|
+ File renameFile = new File(newFile.getParentFile(), fileName + UUID.randomUUID() + extension);
|
|
|
|
+ newFile.renameTo(renameFile);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ fileList.add(newFile);
|
|
}
|
|
}
|
|
if (CollectionUtil.isNotEmpty(fileList)) {
|
|
if (CollectionUtil.isNotEmpty(fileList)) {
|
|
// 打包成zip文件
|
|
// 打包成zip文件
|
|
File file = downloadZip(fileList, "线上签署合同模板", FileModuleDict.ChildEnum.CONTRACT_FILE_PREVIEW);
|
|
File file = downloadZip(fileList, "线上签署合同模板", FileModuleDict.ChildEnum.CONTRACT_FILE_PREVIEW);
|
|
|
|
+
|
|
fileStorageService.downloadFile(response, file);
|
|
fileStorageService.downloadFile(response, file);
|
|
}
|
|
}
|
|
}
|
|
}
|