公告结构化
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user