This commit is contained in:
zhangyx
2021-03-25 16:28:56 +08:00
parent 56486f2c2e
commit dfbb00e3e0

View File

@ -47,14 +47,14 @@ public class BizBidClientVersionServiceImpl extends BaseServiceImpl<BizBidClient
String objectInfo = documentCenterService.getFileObjectDetail(objectId);
log.info("文档中心文件下载返回数据:"+ JsonUtils.objectToJson(objectInfo));
Optional<byte[]> optionalBytes = modelConvertor.toByteArray(objectInfo);
log.info("文档中心文件下载返回数据转为byte[]数据:"+ JsonUtils.objectToJson(optionalBytes));
log.info("文档中心文件下载返回数据转为byte[]数据:"+ optionalBytes.get());
FileOutputStream fileOutputStream = null;
if(optionalBytes.isPresent()){
ByteArrayOutputStream fileStream = new ByteArrayOutputStream();
fileStream.write(optionalBytes.get());
log.info("文档中心文件下载返回数据转为ByteArrayOutputStream数据"+ JsonUtils.objectToJson(fileStream));
log.info("文档中心文件下载返回数据转为ByteArrayOutputStream数据"+fileStream);
fileOutputStream.write(fileStream.toByteArray());
log.info("文档中心文件下载返回数据转为ByteArrayOutputStream数据"+ JsonUtils.objectToJson(fileOutputStream));
log.info("文档中心文件下载返回数据转为ByteArrayOutputStream数据"+fileOutputStream);
}
return fileOutputStream;
}
@ -66,14 +66,14 @@ public class BizBidClientVersionServiceImpl extends BaseServiceImpl<BizBidClient
String objectInfo = documentCenterService.getObjectDetail(objectId);
log.info("文档中心s文件下载返回数据"+ JsonUtils.objectToJson(objectInfo));
Optional<byte[]> optionalBytes = modelConvertor.toByteArray(objectInfo);
log.info("文档中心s文件下载返回数据转为byte[]数据:"+ JsonUtils.objectToJson(optionalBytes));
log.info("文档中心s文件下载返回数据转为byte[]数据:"+ optionalBytes.get());
FileOutputStream fileOutputStream = null;
if(optionalBytes.isPresent()){
ByteArrayOutputStream fileStream = new ByteArrayOutputStream();
fileStream.write(optionalBytes.get());
log.info("文档中心s文件下载返回数据转为ByteArrayOutputStream数据"+ JsonUtils.objectToJson(fileStream));
log.info("文档中心s文件下载返回数据转为ByteArrayOutputStream数据"+fileStream);
fileOutputStream.write(fileStream.toByteArray());
log.info("文档中心s文件下载返回数据转为ByteArrayOutputStream数据"+ JsonUtils.objectToJson(fileOutputStream));
log.info("文档中心s文件下载返回数据转为ByteArrayOutputStream数据"+fileOutputStream);
}
return fileOutputStream;
}
@ -85,15 +85,15 @@ public class BizBidClientVersionServiceImpl extends BaseServiceImpl<BizBidClient
String objectInfo = documentCenterService.getObjectDetail(objectId);
log.info("文档中心s文件下载返回数据"+ JsonUtils.objectToJson(objectInfo));
Optional<byte[]> optionalBytes = modelConvertor.toByteArray(objectInfo);
log.info("文档中心s文件下载返回数据转为byte[]数据:"+ JsonUtils.objectToJson(optionalBytes));
log.info("文档中心s文件下载返回数据转为byte[]数据:"+ optionalBytes.get());
FileOutputStream fileOutputStream = null;
if(optionalBytes.isPresent()){
ByteArrayOutputStream fileStream = new ByteArrayOutputStream();
fileStream.write(optionalBytes.get());
log.info("文档中心s文件下载返回数据转为ByteArrayOutputStream数据"+ JsonUtils.objectToJson(fileStream));
log.info("文档中心s文件下载返回数据转为ByteArrayOutputStream数据"+fileStream);
fileOutputStream = new FileOutputStream("C:\\test.txt");
fileOutputStream.write(fileStream.toByteArray());
log.info("文档中心s文件下载返回数据转为ByteArrayOutputStream数据"+ JsonUtils.objectToJson(fileOutputStream));
log.info("文档中心s文件下载返回数据转为ByteArrayOutputStream数据"+fileOutputStream);
}
return fileOutputStream;
}