|
@@ -98,13 +98,14 @@ public class ScheduleTasks {
|
|
|
//转为pdf
|
|
|
DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
|
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
+ deleteDir1(new File(filePath));
|
|
|
filePath = filePath.replaceAll( "doc","pdf");
|
|
|
- filePath = filePath.replaceAll( "d:","");
|
|
|
}
|
|
|
if (f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
|
+ deleteDir1(new File(filePath));
|
|
|
filePath = filePath.replaceAll( "docx","pdf");
|
|
|
- filePath = filePath.replaceAll( "d:","");
|
|
|
}
|
|
|
+ filePath = filePath.replaceAll( "d:","");
|
|
|
String name = null;
|
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
name = f.getName().replace(ExcelUtils.DOC, "");
|
|
@@ -147,13 +148,14 @@ public class ScheduleTasks {
|
|
|
//转为pdf
|
|
|
DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
|
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
+ deleteDir1(new File(filePath));
|
|
|
filePath = filePath.replaceAll( "doc","pdf");
|
|
|
- filePath = filePath.replaceAll( "d:","");
|
|
|
}
|
|
|
if (f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
|
+ deleteDir1(new File(filePath));
|
|
|
filePath = filePath.replaceAll( "docx","pdf");
|
|
|
- filePath = filePath.replaceAll( "d:","");
|
|
|
}
|
|
|
+ filePath = filePath.replaceAll( "d:","");
|
|
|
String name = null;
|
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
name = f.getName().replace(ExcelUtils.DOC, "");
|
|
@@ -196,13 +198,14 @@ public class ScheduleTasks {
|
|
|
//转为pdf
|
|
|
DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
|
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
+ deleteDir1(new File(filePath));
|
|
|
filePath = filePath.replaceAll( "doc","pdf");
|
|
|
- filePath = filePath.replaceAll( "d:","");
|
|
|
}
|
|
|
if (f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
|
+ deleteDir1(new File(filePath));
|
|
|
filePath = filePath.replaceAll( "docx","pdf");
|
|
|
- filePath = filePath.replaceAll( "d:","");
|
|
|
}
|
|
|
+ filePath = filePath.replaceAll( "d:","");
|
|
|
String name = null;
|
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
name = f.getName().replace(ExcelUtils.DOC, "");
|
|
@@ -245,13 +248,14 @@ public class ScheduleTasks {
|
|
|
//转为pdf
|
|
|
DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
|
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
+ deleteDir1(new File(filePath));
|
|
|
filePath = filePath.replaceAll( "doc","pdf");
|
|
|
- filePath = filePath.replaceAll( "d:","");
|
|
|
}
|
|
|
if (f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
|
+ deleteDir1(new File(filePath));
|
|
|
filePath = filePath.replaceAll( "docx","pdf");
|
|
|
- filePath = filePath.replaceAll( "d:","");
|
|
|
}
|
|
|
+ filePath = filePath.replaceAll( "d:","");
|
|
|
String name = null;
|
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
name = f.getName().replace(ExcelUtils.DOC, "");
|
|
@@ -294,13 +298,14 @@ public class ScheduleTasks {
|
|
|
//转为pdf
|
|
|
DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
|
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
+ deleteDir1(new File(filePath));
|
|
|
filePath = filePath.replaceAll( "doc","pdf");
|
|
|
- filePath = filePath.replaceAll( "d:","");
|
|
|
}
|
|
|
if (f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
|
+ deleteDir1(new File(filePath));
|
|
|
filePath = filePath.replaceAll( "docx","pdf");
|
|
|
- filePath = filePath.replaceAll( "d:","");
|
|
|
}
|
|
|
+ filePath = filePath.replaceAll( "d:","");
|
|
|
String name = null;
|
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
name = f.getName().replace(ExcelUtils.DOC, "");
|
|
@@ -345,6 +350,13 @@ public class ScheduleTasks {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void deleteDir1(File file) {
|
|
|
+ if (file == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ file.delete();
|
|
|
+ }
|
|
|
+
|
|
|
private MultipartFile transtTo(File file) {
|
|
|
MultipartFile mfile = null;
|
|
|
try {
|