添加关闭页面回调接口,添加token
This commit is contained in:
+38
-1
@@ -108,6 +108,10 @@ public class OnlyOfficeController {
|
|||||||
@Value("${byd.uploadFileUrl}")
|
@Value("${byd.uploadFileUrl}")
|
||||||
private String bydUploadFileUrl;
|
private String bydUploadFileUrl;
|
||||||
|
|
||||||
|
@Value("${byd.unlockUrl}")
|
||||||
|
private String unlockUrl;
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "分页查询")
|
@ApiOperation(value = "分页查询")
|
||||||
@GetMapping("/pageList")
|
@GetMapping("/pageList")
|
||||||
public Result<IPage<BusProcessModelHis>> pageList(HttpServletRequest req, BusProcessModelHis processModelHis,
|
public Result<IPage<BusProcessModelHis>> pageList(HttpServletRequest req, BusProcessModelHis processModelHis,
|
||||||
@@ -521,6 +525,8 @@ public class OnlyOfficeController {
|
|||||||
public Result<String> updateOnlineFileLogJxInfo(@RequestBody JSONObject json){
|
public Result<String> updateOnlineFileLogJxInfo(@RequestBody JSONObject json){
|
||||||
String jxFileName = json.getString("jxFileName");
|
String jxFileName = json.getString("jxFileName");
|
||||||
String fileId = json.getString("fileId");
|
String fileId = json.getString("fileId");
|
||||||
|
String appId = json.getString("appId");
|
||||||
|
String token = json.getString("Authorization");
|
||||||
String dataType = "1";
|
String dataType = "1";
|
||||||
|
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
@@ -547,7 +553,8 @@ public class OnlyOfficeController {
|
|||||||
|
|
||||||
HttpHeaders headers2 = new HttpHeaders();
|
HttpHeaders headers2 = new HttpHeaders();
|
||||||
headers2.setContentType(MediaType.MULTIPART_FORM_DATA);
|
headers2.setContentType(MediaType.MULTIPART_FORM_DATA);
|
||||||
|
headers2.add("appId",appId);
|
||||||
|
headers2.add("Authorization",token);
|
||||||
// 创建MultiValueMap对象,用于存储请求参数
|
// 创建MultiValueMap对象,用于存储请求参数
|
||||||
MultiValueMap<String, Object> params2 = new LinkedMultiValueMap<>();
|
MultiValueMap<String, Object> params2 = new LinkedMultiValueMap<>();
|
||||||
|
|
||||||
@@ -577,6 +584,7 @@ public class OnlyOfficeController {
|
|||||||
}catch (Exception ex){
|
}catch (Exception ex){
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
logger.error("基线版本文件上传失败:" + ex.getMessage());
|
logger.error("基线版本文件上传失败:" + ex.getMessage());
|
||||||
|
return Result.error("更新基线信息失败!");
|
||||||
}
|
}
|
||||||
logger.info("基线版本文件上传接口结束==========================================");
|
logger.info("基线版本文件上传接口结束==========================================");
|
||||||
|
|
||||||
@@ -587,6 +595,8 @@ public class OnlyOfficeController {
|
|||||||
RestTemplate restTemplate = new RestTemplate();
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
headers.add("appId",appId);
|
||||||
|
headers.add("Authorization",token);
|
||||||
|
|
||||||
// 创建MultiValueMap对象,用于存储请求参数
|
// 创建MultiValueMap对象,用于存储请求参数
|
||||||
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
|
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
|
||||||
@@ -603,6 +613,7 @@ public class OnlyOfficeController {
|
|||||||
}catch (Exception ex){
|
}catch (Exception ex){
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
logger.error("推送保存基线版本文件信息失败:" + ex.getMessage());
|
logger.error("推送保存基线版本文件信息失败:" + ex.getMessage());
|
||||||
|
return Result.error("更新基线信息失败!");
|
||||||
}
|
}
|
||||||
logger.info("推送保存基线版本文件信息结束==========================================");
|
logger.info("推送保存基线版本文件信息结束==========================================");
|
||||||
|
|
||||||
@@ -653,6 +664,32 @@ public class OnlyOfficeController {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "关闭页面回调接口")
|
||||||
|
@GetMapping("/onlyOfficeCloseTab")
|
||||||
|
public Result<String> onlyOfficeCloseTab(String fileId, String appId, String Authorization, HttpServletResponse response, HttpServletRequest request) {
|
||||||
|
try {
|
||||||
|
// String appId = request.getParameter("appId");
|
||||||
|
// String token = request.getParameter("Authorization");
|
||||||
|
String token = Authorization;
|
||||||
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
headers.add("appId",appId);
|
||||||
|
headers.add("Authorization",token);
|
||||||
|
// 创建MultiValueMap对象,用于存储请求参数
|
||||||
|
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
|
||||||
|
params.add("fileId", fileId);
|
||||||
|
// 使用HttpEntity对象包装请求体和请求头
|
||||||
|
HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers);
|
||||||
|
// 发送POST请求并获取响应
|
||||||
|
ResponseEntity<String> responseEntity = restTemplate.postForEntity(unlockUrl, requestEntity, String.class);
|
||||||
|
String body = responseEntity.getBody();
|
||||||
|
logger.info("关闭页面回调接口:" + body);
|
||||||
|
}catch (Exception ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
return Result.OK();
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "|File|在线编辑下载docx文件")
|
@ApiOperation(value = "|File|在线编辑下载docx文件")
|
||||||
@GetMapping("/onlyOfficeDownloadDocxFile")
|
@GetMapping("/onlyOfficeDownloadDocxFile")
|
||||||
|
|||||||
@@ -236,4 +236,5 @@ byd:
|
|||||||
saveBaseLineDocIdUrl: http://127.0.0.1:9998/saveBaseLineDocIdUrl
|
saveBaseLineDocIdUrl: http://127.0.0.1:9998/saveBaseLineDocIdUrl
|
||||||
splitResultUrl: http://127.0.0.1:9998/splitResultUrl
|
splitResultUrl: http://127.0.0.1:9998/splitResultUrl
|
||||||
downLoadFileUrl: http://127.0.0.1:9998/downLoadFileUrl
|
downLoadFileUrl: http://127.0.0.1:9998/downLoadFileUrl
|
||||||
|
unlockUrl: http://127.0.0.1:9998/api/qbp/document/unlock
|
||||||
|
|
||||||
|
|||||||
+1
@@ -220,3 +220,4 @@ byd:
|
|||||||
saveBaseLineDocIdUrl: http://127.0.0.1:9998/api/qbp/organization/saveBaseLineDocId
|
saveBaseLineDocIdUrl: http://127.0.0.1:9998/api/qbp/organization/saveBaseLineDocId
|
||||||
splitResultUrl: http://127.0.0.1:9998/api/qbp/library/structured
|
splitResultUrl: http://127.0.0.1:9998/api/qbp/library/structured
|
||||||
downLoadFileUrl: http://127.0.0.1:9998/ipd-files/file/downLoad
|
downLoadFileUrl: http://127.0.0.1:9998/ipd-files/file/downLoad
|
||||||
|
unlockUrl: http://127.0.0.1:9998/api/qbp/document/unlock
|
||||||
|
|||||||
+1
@@ -232,3 +232,4 @@ byd:
|
|||||||
saveBaseLineDocIdUrl: http://127.0.0.1:9998/saveBaseLineDocIdUrl
|
saveBaseLineDocIdUrl: http://127.0.0.1:9998/saveBaseLineDocIdUrl
|
||||||
splitResultUrl: http://127.0.0.1:9998/splitResultUrl
|
splitResultUrl: http://127.0.0.1:9998/splitResultUrl
|
||||||
downLoadFileUrl: http://127.0.0.1:9998/downLoadFileUrl
|
downLoadFileUrl: http://127.0.0.1:9998/downLoadFileUrl
|
||||||
|
unlockUrl: http://127.0.0.1:9998/api/qbp/document/unlock
|
||||||
|
|||||||
Reference in New Issue
Block a user