提交 金山pws接口

This commit is contained in:
zhangqinbin
2023-09-15 13:36:37 +08:00
parent 71c0a947b1
commit 9fc4188437
2 changed files with 11 additions and 3 deletions

View File

@ -106,7 +106,6 @@ public class WpsController {
public BaseResponse<String> getKSFile(@PathVariable String id) { public BaseResponse<String> getKSFile(@PathVariable String id) {
return BaseResponse.success(this.wpsService.getKSWpsFile(id)); return BaseResponse.success(this.wpsService.getKSWpsFile(id));
} }
/** /**
* 沃文档回调-保存文档 * 沃文档回调-保存文档
* @param token * @param token

View File

@ -482,9 +482,18 @@ public class WpsServiceImpl implements WpsService {
@Override @Override
public String getKSWpsFile(String id){ public String getKSWpsFile(String id){
Optional<AttachmentEntity> optional=attachmentClient.findByObjectId(id);
Optional<byte[]> optional1 = attachmentClient.downloadFileByObjectId(optional.get().getId()); List<String> businessIdList = new ArrayList<>();
businessIdList.add(id);
Optional<AttachmentDetail> optional = attachmentClient.findByBusinessId(businessIdList);
AttachmentDetail detail = optional.get();
List<AttachmentEntity> entityList = detail.get(id);
Optional<byte[]> optional1 = attachmentClient.downloadFileByObjectId(entityList.get(0).getId());
return new String(Base64.getEncoder().encode(optional1.get())); return new String(Base64.getEncoder().encode(optional1.get()));
} }