diff --git a/adc-da-main/src/main/resources/application-dev.properties b/adc-da-main/src/main/resources/application-dev.properties index 2490f6e5..475a573d 100644 --- a/adc-da-main/src/main/resources/application-dev.properties +++ b/adc-da-main/src/main/resources/application-dev.properties @@ -72,4 +72,8 @@ OCR.ocrPath=/data/slrs/ocrResultFile/ # OCR文件请求下载或在线预览时URL OCR.ocrDownPath=/data/slrs/ocrResultFile/ OCR.times=20 -OCR.convertType=BOTH \ No newline at end of file +OCR.convertType=BOTH + +# 在线编辑的调用 +onlyoffice.url=http://47.92.92.38:8103/7.2.1-34/ConvertService.ashx +#onlyoffice.url=http://10.100.5.116:8088/7.2.1-34/ConvertService.ashx \ No newline at end of file diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java index 0a27713a..b471436a 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussionessStand/service/impl/SarBussionessStandServiceImpl.java @@ -112,6 +112,9 @@ public class SarBussionessStandServiceImpl extends ServiceImpl map = new HashMap<>(); - map.put("async",false); - map.put("filetype","docx"); - map.put("key",key); - map.put("outputtype","pdf"); - - map.put("title","test.pdf"); - map.put("url","https://srms.foton.com.cn/file/"+onlineFilePath); + map.put("title",titleName+".pdf"); + map.put("url","https://10.100.5.111:3306/file/"+onlineFilePath); //map.put("url","https://srms.foton.com.cn/file/model/task_768330d8/task_768330d8_top_768330d8_node.docx"); - JSONObject requestJson = new JSONObject(map); - // 创建HttpClientBuilder - HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); - // HttpClient - CloseableHttpClient closeableHttpClient = httpClientBuilder.build(); - HttpPost httpPost = new HttpPost(url); - // 设置请求和传输超时时间 - RequestConfig requestConfig = RequestConfig.custom() - .setSocketTimeout(60000) - .setConnectionRequestTimeout(60000) - .setConnectTimeout(60000) - .build(); - httpPost.setConfig(requestConfig); - CloseableHttpResponse response = null; - try { - //设置post请求方式为JSON - StringEntity data = new StringEntity(String.valueOf(requestJson), "UTF-8"); - data.setContentType("application/json; charset=UTF-8"); - httpPost.setEntity(data); - - - //发送post请求 - response = closeableHttpClient.execute(httpPost); - if (response == null || response.getStatusLine() == null) { - throw new Exception("发送POST请求失败,返回结果为空!"); - } - - - //返回状态是否200 - int statusCode = response.getStatusLine().getStatusCode(); - if (statusCode == HttpStatus.SC_OK) { - //得到请求结果 - + logger.info("===========================================返回状态是否200==============================="); HttpEntity entityRes = response.getEntity(); - if (entityRes != null) { - String responsetData = EntityUtils.toString(entityRes, "UTF-8"); - String fileUrl = analysisXML(responsetData); - + logger.info("===========================================返回的文件路径"+fileUrl+"==============================="); return fileUrl; - } - } else { - throw new Exception("发送POST-JSON请求出错:" + response); - } - } catch (Exception e) { - throw new Exception("发送POST请求出现异常," + e.getMessage()); - } finally { - try { - // 关闭连接释放资源 - if (response != null) { - response.close(); - } if (closeableHttpClient != null) { - closeableHttpClient.close(); - } } catch (IOException e) {