公告结构化

This commit is contained in:
zhangqinbin
2023-12-19 10:31:28 +08:00
parent 90b7dc836c
commit 6e4e1e694e

View File

@ -548,7 +548,7 @@ public class WpsServiceImpl implements WpsService {
String url = "";
String dataJson = "";
String callBackUrl = "";
byte[] b = getFileByFileId(in.getFileId());
byte[] b = getFileByFileId(in.getFileId(),in.getFileName());
String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
try {
callBackUrl = kswdownloadUrl+"?key="+URLEncoder.encode(getDownloadEncrypt(in.getFileId(),in.getUserToken()), "utf-8");
@ -686,25 +686,33 @@ public class WpsServiceImpl implements WpsService {
String fileId = downloadDecrypt(key);
return getFileByFileId(fileId);
return getFileByFileId(fileId,fileId);
}
private byte[] getFileByFileId(String id){
private byte[] getFileByFileId(String id,String fileName){
String text = " ";
byte buf[] = text.getBytes();
List<String> businessIdList = new ArrayList<>();
businessIdList.add(id);
Optional<AttachmentDetail> optional = attachmentClient.findByBusinessId(businessIdList);
//上传文件
Boolean uploadB = true;
if(optional!=null&&optional.get()!=null) {
AttachmentDetail detail = optional.get();
List<AttachmentEntity> entityList = detail.get(id);
if(entityList!=null&&entityList.size()>0) {
Optional<byte[]> optional1 = attachmentClient.downloadFileByObjectId(entityList.get(0).getId());
return optional1.get();
uploadB = false;
buf = optional1.get();
}
}
return new byte[0];
if(uploadB){
Optional<UploadObject> op=attachmentClient.upload(id,fileName,buf);
}
return buf;
}
@Override