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