政企WPS
This commit is contained in:
@ -66,6 +66,8 @@ public class WpsController {
|
||||
|
||||
@Value("${KingSoftWps.kswpsurl}")
|
||||
private String kswpsurl;
|
||||
@Value("${KingSoftWps.tempDocFileId}")
|
||||
private String tempDocFileId;
|
||||
|
||||
/* 附件工具 */
|
||||
@Autowired
|
||||
@ -287,9 +289,7 @@ public class WpsController {
|
||||
log.info(" file2 fileId"+fileId);
|
||||
|
||||
List<String> businessIdList = new ArrayList<>();
|
||||
|
||||
businessIdList.add(fileId[0]);
|
||||
|
||||
Optional<AttachmentDetail> optional = attachmentClient.findByBusinessId(businessIdList);
|
||||
|
||||
String fileName = fileIdName;
|
||||
@ -312,10 +312,18 @@ public class WpsController {
|
||||
}
|
||||
}
|
||||
}
|
||||
//没有上传过文件 使用临时文件显示
|
||||
if(uploadB){
|
||||
buf = this.wpsService.uploadTempFile(fileId[0]);
|
||||
fileLength = String.valueOf(buf.length);
|
||||
//Optional<UploadObject> op=attachmentClient.upload(fileId[0],fileName,buf);
|
||||
List<String> businessIdList2 = new ArrayList<>();
|
||||
businessIdList2.add(tempDocFileId);
|
||||
Optional<AttachmentDetail> optional2 = attachmentClient.findByBusinessId(businessIdList2);
|
||||
AttachmentDetail detail = optional2.get();
|
||||
List<AttachmentEntity> entityList = detail.get(fileId[0]);
|
||||
Optional<byte[]> optional1 = attachmentClient.downloadFileByObjectId(entityList.get(0).getId());
|
||||
if(optional1!=null&&optional1.isPresent()) {
|
||||
fileLength = String.valueOf(optional1.get().length);
|
||||
buf = optional1.get();
|
||||
}
|
||||
}
|
||||
|
||||
try{
|
||||
|
@ -718,7 +718,6 @@ public class WpsServiceImpl implements WpsService {
|
||||
}
|
||||
if(uploadB){
|
||||
buf = uploadTempFile(fileExtension);
|
||||
//Optional<UploadObject> op=attachmentClient.upload(id,fileName,buf);
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
Reference in New Issue
Block a user