修改空指针问题
This commit is contained in:
+2
-1
@@ -564,6 +564,7 @@ public class OnlyOfficeController {
|
||||
// 发送POST请求并获取响应
|
||||
ResponseEntity<String> responseEntity2 = restTemplate2.postForEntity(bydUploadFileUrl, requestEntity2, String.class);
|
||||
String body2 = responseEntity2.getBody();
|
||||
logger.info("基线版本文件上传接口结果:" + body2);
|
||||
JSONObject jsonObject2 = JSONObject.parseObject(body2);
|
||||
String data = jsonObject2.getString("data");
|
||||
createTimeLatestOnlineFileLog.setBydJxFileId(data);
|
||||
@@ -571,7 +572,7 @@ public class OnlyOfficeController {
|
||||
createTimeLatestOnlineFileLog2.setBydJxFileId(data);
|
||||
|
||||
this.onlineFileLogDao.insert(createTimeLatestOnlineFileLog2);
|
||||
logger.info("基线版本文件上传接口结果:" + body2);
|
||||
// logger.info("基线版本文件上传接口结果:" + body2);
|
||||
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
|
||||
+27
-21
@@ -564,34 +564,40 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
||||
public String onlyOfficePreview(JSONObject json) {
|
||||
StringBuilder resultSb = new StringBuilder();
|
||||
String fileId = json.getString("fileId");
|
||||
String watermark = json.getString("watermark");
|
||||
// String watermark = json.getString("watermark");
|
||||
|
||||
// 查询历史信息:1 是 2 否
|
||||
String queryType = json.getString("queryType");
|
||||
if (StringUtils.equals(CommonConstant.ONLIOFFICE_QUERY_TYPE_1,queryType)) {
|
||||
OnlineFileLog onlineFileLog = onlineFileLogDao.selectById(fileId);
|
||||
|
||||
StringBuffer downloadFileUrl = new StringBuffer();
|
||||
downloadFileUrl.append(downloadUrl).append(onlineFileLog.getFilePath() == null ? "" : onlineFileLog.getFilePath());
|
||||
resultSb.append(previewHistoryUrl);
|
||||
resultSb.append("oldFileName=").append(onlineFileLog.getFileName()).append("&");
|
||||
resultSb.append("fileType=").append("docx").append("&");
|
||||
resultSb.append("attId=").append(onlineFileLog.getAttFileId()).append("&");
|
||||
resultSb.append("fileUrl=").append(downloadFileUrl.toString()).append("&");
|
||||
resultSb.append("key=").append(DateUtils.getCurrentTimestamp()).append("&");
|
||||
resultSb.append("filePath=").append(onlineFileLog.getFilePath()).append("&");
|
||||
resultSb.append("fileName=").append(onlineFileLog.getFileName());
|
||||
if(ObjectUtils.isNotEmpty(onlineFileLog)){
|
||||
StringBuffer downloadFileUrl = new StringBuffer();
|
||||
downloadFileUrl.append(downloadUrl).append(onlineFileLog.getFilePath() == null ? "" : onlineFileLog.getFilePath());
|
||||
resultSb.append(previewHistoryUrl);
|
||||
resultSb.append("oldFileName=").append(onlineFileLog.getFileName()).append("&");
|
||||
resultSb.append("fileType=").append("docx").append("&");
|
||||
resultSb.append("attId=").append(onlineFileLog.getAttFileId()).append("&");
|
||||
resultSb.append("fileUrl=").append(downloadFileUrl.toString()).append("&");
|
||||
resultSb.append("key=").append(DateUtils.getCurrentTimestamp()).append("&");
|
||||
resultSb.append("filePath=").append(onlineFileLog.getFilePath()).append("&");
|
||||
resultSb.append("fileName=").append(onlineFileLog.getFileName());
|
||||
}else{
|
||||
log.error("onlineFileLog为空,fileId="+fileId);
|
||||
}
|
||||
} else if (StringUtils.equals(CommonConstant.ONLIOFFICE_QUERY_TYPE_2,queryType)) {
|
||||
BusProcessModelHis busProcessModelHis = this.processEditFile(fileId);
|
||||
|
||||
resultSb.append(onlyOfficePreviewUrl);
|
||||
resultSb.append("oldFileName=").append(busProcessModelHis.getFileName()).append("&");
|
||||
resultSb.append("fileType=").append("docx").append("&");
|
||||
resultSb.append("attId=").append(busProcessModelHis.getId()).append("&");
|
||||
resultSb.append("fileUrl=").append(busProcessModelHis.getDownLoadUrl()).append("&");
|
||||
resultSb.append("key=").append(DateUtils.getCurrentTimestamp()).append("&");
|
||||
resultSb.append("filePath=").append(busProcessModelHis.getEditFilePath()).append("&");
|
||||
resultSb.append("fileName=").append(busProcessModelHis.getFileName());
|
||||
if(ObjectUtils.isNotEmpty(busProcessModelHis)){
|
||||
resultSb.append(onlyOfficePreviewUrl);
|
||||
resultSb.append("oldFileName=").append(busProcessModelHis.getFileName()).append("&");
|
||||
resultSb.append("fileType=").append("docx").append("&");
|
||||
resultSb.append("attId=").append(busProcessModelHis.getId()).append("&");
|
||||
resultSb.append("fileUrl=").append(busProcessModelHis.getDownLoadUrl()).append("&");
|
||||
resultSb.append("key=").append(DateUtils.getCurrentTimestamp()).append("&");
|
||||
resultSb.append("filePath=").append(busProcessModelHis.getEditFilePath()).append("&");
|
||||
resultSb.append("fileName=").append(busProcessModelHis.getFileName());
|
||||
}else{
|
||||
log.error("busProcessModelHis为空,fileId="+fileId);
|
||||
}
|
||||
}
|
||||
return resultSb.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user