Commit 25e96276 authored by tangwei's avatar tangwei

修改文件转化位置

parent 6721c5ed
......@@ -80,7 +80,6 @@ public class WordConverterUtils {
* @param fileService 图片上传接口
*/
public static void wordToHtml(String srcFile, String targetFile, String imagePathStr,String readUrl,FileService fileService,String product,String appKey,String token ) {
//File doc = new File(srcFile);
File html = new File(targetFile);
if ( html.exists()) {
return;
......
......@@ -102,15 +102,6 @@ public class CommandController extends BaseController {
@Value("${file.url}")
private String readUrl;
/**
* 图片存储相对文档路径
*/
@Value("${file.imagePathStr}")
private String imagePathStr;
//本地临时文件夹
@Value("${file.htmlPath}")
private String htmlPath;
/**
* 警情列表
*
......@@ -605,8 +596,19 @@ public class CommandController extends BaseController {
throws Exception {
String fileName =readUrl+fileUrl; //目标文件
if (fileName.endsWith(".doc") || fileName.endsWith(".docx")) {
String htmlFileName = htmlPath + UUID.randomUUID().toString().replaceAll("-", "")+".html";
if (fileName.endsWith(".doc") || fileName.endsWith(".docx")) {
String htmlPath= System.getProperty("user.dir")+File.separator+"lookHtml"+File.separator+"file"+File.separator;
String imagePathStr= System.getProperty("user.dir")+File.separator+"lookHtml"+File.separator+"image"+File.separator;
String name = fileUrl.substring(fileUrl.lastIndexOf('/')+1);
String htmlFileName = htmlPath + name.substring(0, name.indexOf(".")) +".html";
File htmlP = new File(htmlPath);
if (!htmlP.exists()) {
htmlP.mkdirs();
}
File htmlFile = new File(htmlFileName);
WordConverterUtils.wordToHtml(fileName, htmlFileName, imagePathStr,readUrl, remoteSecurityService,product, appKey, token);
FileInputStream fis = new FileInputStream(htmlFile);
......
......@@ -32,7 +32,5 @@ mqtt.topic.command.alert.notice=alertNotice
#跑马灯地震,天气预警信息
mqtt.topic.command.seismometeorology.notice=seismometeorology
file.htmlPath=D:/wwww/file/
file.imagePathStr=D:/wwww/image/
file.url=http://39.98.45.134:9000/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment