|
@@ -95,17 +95,18 @@ public class ScheduleTasks {
|
|
for (File f : files) {
|
|
for (File f : files) {
|
|
if (f.getName().endsWith(ExcelUtils.DOC) || f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
if (f.getName().endsWith(ExcelUtils.DOC) || f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
MultipartFile mfile = transtTo(f);
|
|
MultipartFile mfile = transtTo(f);
|
|
- String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + f.getName());
|
|
|
|
- //转为pdf
|
|
|
|
|
|
+ String extName = ""; // 扩展名格式:
|
|
|
|
+ extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
|
|
|
|
+ String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + extName); //转为pdf
|
|
DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
|
|
DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
|
|
- if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
|
- deleteDir1(new File(filePath));
|
|
|
|
- filePath = filePath.replaceAll( "doc","pdf");
|
|
|
|
- }
|
|
|
|
- if (f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
|
|
- deleteDir1(new File(filePath));
|
|
|
|
- filePath = filePath.replaceAll( "docx","pdf");
|
|
|
|
- }
|
|
|
|
|
|
+// if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
|
+// deleteDir1(new File(filePath));
|
|
|
|
+// filePath = filePath.replaceAll( "doc","pdf");
|
|
|
|
+// }
|
|
|
|
+// 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;
|
|
String name = null;
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
@@ -125,7 +126,9 @@ public class ScheduleTasks {
|
|
else
|
|
else
|
|
{
|
|
{
|
|
MultipartFile mfile = transtTo(f);
|
|
MultipartFile mfile = transtTo(f);
|
|
- String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + f.getName());
|
|
|
|
|
|
+ String extName = ""; // 扩展名格式:
|
|
|
|
+ extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
|
|
|
|
+ String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + extName);
|
|
filePath = filePath.replaceAll( "d:","");
|
|
filePath = filePath.replaceAll( "d:","");
|
|
FaultEntity fault = new FaultEntity();
|
|
FaultEntity fault = new FaultEntity();
|
|
fault.setFault_name(f.getName().replace( ".pdf",""));
|
|
fault.setFault_name(f.getName().replace( ".pdf",""));
|
|
@@ -145,17 +148,18 @@ public class ScheduleTasks {
|
|
for (File f : files) {
|
|
for (File f : files) {
|
|
if (f.getName().endsWith(ExcelUtils.DOC) || f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
if (f.getName().endsWith(ExcelUtils.DOC) || f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
MultipartFile mfile = transtTo(f);
|
|
MultipartFile mfile = transtTo(f);
|
|
- String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + f.getName());
|
|
|
|
- //转为pdf
|
|
|
|
|
|
+ String extName = ""; // 扩展名格式:
|
|
|
|
+ extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
|
|
|
|
+ String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + extName); //转为pdf
|
|
DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
|
|
DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
|
|
- if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
|
- deleteDir1(new File(filePath));
|
|
|
|
- filePath = filePath.replaceAll( "doc","pdf");
|
|
|
|
- }
|
|
|
|
- if (f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
|
|
- deleteDir1(new File(filePath));
|
|
|
|
- filePath = filePath.replaceAll( "docx","pdf");
|
|
|
|
- }
|
|
|
|
|
|
+// if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
|
+// deleteDir1(new File(filePath));
|
|
|
|
+// filePath = filePath.replaceAll( "doc","pdf");
|
|
|
|
+// }
|
|
|
|
+// 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;
|
|
String name = null;
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
@@ -175,7 +179,9 @@ public class ScheduleTasks {
|
|
else
|
|
else
|
|
{
|
|
{
|
|
MultipartFile mfile = transtTo(f);
|
|
MultipartFile mfile = transtTo(f);
|
|
- String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + f.getName());
|
|
|
|
|
|
+ String extName = ""; // 扩展名格式:
|
|
|
|
+ extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
|
|
|
|
+ String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + extName);
|
|
filePath = filePath.replaceAll( "d:","");
|
|
filePath = filePath.replaceAll( "d:","");
|
|
BookEntity book = new BookEntity();
|
|
BookEntity book = new BookEntity();
|
|
book.setBook_name(f.getName().replace( ".pdf",""));
|
|
book.setBook_name(f.getName().replace( ".pdf",""));
|
|
@@ -195,17 +201,18 @@ public class ScheduleTasks {
|
|
for (File f : files) {
|
|
for (File f : files) {
|
|
if (f.getName().endsWith(ExcelUtils.DOC) || f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
if (f.getName().endsWith(ExcelUtils.DOC) || f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
MultipartFile mfile = transtTo(f);
|
|
MultipartFile mfile = transtTo(f);
|
|
- String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + f.getName());
|
|
|
|
- //转为pdf
|
|
|
|
|
|
+ String extName = ""; // 扩展名格式:
|
|
|
|
+ extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
|
|
|
|
+ String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + extName); //转为pdf
|
|
DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
|
|
DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
|
|
- if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
|
- deleteDir1(new File(filePath));
|
|
|
|
- filePath = filePath.replaceAll( "doc","pdf");
|
|
|
|
- }
|
|
|
|
- if (f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
|
|
- deleteDir1(new File(filePath));
|
|
|
|
- filePath = filePath.replaceAll( "docx","pdf");
|
|
|
|
- }
|
|
|
|
|
|
+// if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
|
+// deleteDir1(new File(filePath));
|
|
|
|
+// filePath = filePath.replaceAll( "doc","pdf");
|
|
|
|
+// }
|
|
|
|
+// 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;
|
|
String name = null;
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
@@ -224,17 +231,18 @@ public class ScheduleTasks {
|
|
}
|
|
}
|
|
else if (f.getName().endsWith(ExcelUtils.XLS) || f.getName().endsWith(ExcelUtils.XLSX)) {
|
|
else if (f.getName().endsWith(ExcelUtils.XLS) || f.getName().endsWith(ExcelUtils.XLSX)) {
|
|
MultipartFile mfile = transtTo(f);
|
|
MultipartFile mfile = transtTo(f);
|
|
- String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + f.getName());
|
|
|
|
- //转为pdf
|
|
|
|
|
|
+ String extName = ""; // 扩展名格式:
|
|
|
|
+ extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
|
|
|
|
+ String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + extName); //转为pdf
|
|
ExcelToPdf.convertExcel2Pdf(filePath, sourcePath1);
|
|
ExcelToPdf.convertExcel2Pdf(filePath, sourcePath1);
|
|
- if (f.getName().endsWith(ExcelUtils.XLS)) {
|
|
|
|
- deleteDir1(new File(filePath));
|
|
|
|
- filePath = filePath.replaceAll( "xls","pdf");
|
|
|
|
- }
|
|
|
|
- if (f.getName().endsWith(ExcelUtils.XLSX)) {
|
|
|
|
- deleteDir1(new File(filePath));
|
|
|
|
- filePath = filePath.replaceAll( "xlsx","pdf");
|
|
|
|
- }
|
|
|
|
|
|
+// if (f.getName().endsWith(ExcelUtils.XLS)) {
|
|
|
|
+// deleteDir1(new File(filePath));
|
|
|
|
+// filePath = filePath.replaceAll( "xls","pdf");
|
|
|
|
+// }
|
|
|
|
+// if (f.getName().endsWith(ExcelUtils.XLSX)) {
|
|
|
|
+// deleteDir1(new File(filePath));
|
|
|
|
+// filePath = filePath.replaceAll( "xlsx","pdf");
|
|
|
|
+// }
|
|
filePath = filePath.replaceAll( "d:","");
|
|
filePath = filePath.replaceAll( "d:","");
|
|
String name = null;
|
|
String name = null;
|
|
if (f.getName().endsWith(ExcelUtils.XLS)) {
|
|
if (f.getName().endsWith(ExcelUtils.XLS)) {
|
|
@@ -253,7 +261,9 @@ public class ScheduleTasks {
|
|
else
|
|
else
|
|
{
|
|
{
|
|
MultipartFile mfile = transtTo(f);
|
|
MultipartFile mfile = transtTo(f);
|
|
- String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + f.getName());
|
|
|
|
|
|
+ String extName = ""; // 扩展名格式:
|
|
|
|
+ extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
|
|
|
|
+ String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + extName);
|
|
filePath = filePath.replaceAll( "d:","");
|
|
filePath = filePath.replaceAll( "d:","");
|
|
CardEntity card = new CardEntity();
|
|
CardEntity card = new CardEntity();
|
|
card.setCard_name(f.getName().replace( ".pdf",""));
|
|
card.setCard_name(f.getName().replace( ".pdf",""));
|
|
@@ -273,17 +283,19 @@ public class ScheduleTasks {
|
|
for (File f : files) {
|
|
for (File f : files) {
|
|
if (f.getName().endsWith(ExcelUtils.DOC) || f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
if (f.getName().endsWith(ExcelUtils.DOC) || f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
MultipartFile mfile = transtTo(f);
|
|
MultipartFile mfile = transtTo(f);
|
|
- String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + f.getName());
|
|
|
|
|
|
+ String extName = ""; // 扩展名格式:
|
|
|
|
+ extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
|
|
|
|
+ String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + extName);
|
|
//转为pdf
|
|
//转为pdf
|
|
DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
|
|
DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
|
|
- if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
|
- deleteDir1(new File(filePath));
|
|
|
|
- filePath = filePath.replaceAll( "doc","pdf");
|
|
|
|
- }
|
|
|
|
- if (f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
|
|
- deleteDir1(new File(filePath));
|
|
|
|
- filePath = filePath.replaceAll( "docx","pdf");
|
|
|
|
- }
|
|
|
|
|
|
+// if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
|
+// deleteDir1(new File(filePath));
|
|
|
|
+// filePath = filePath.replaceAll( "doc","pdf");
|
|
|
|
+// }
|
|
|
|
+// 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;
|
|
String name = null;
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
@@ -303,7 +315,9 @@ public class ScheduleTasks {
|
|
else
|
|
else
|
|
{
|
|
{
|
|
MultipartFile mfile = transtTo(f);
|
|
MultipartFile mfile = transtTo(f);
|
|
- String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + f.getName());
|
|
|
|
|
|
+ String extName = ""; // 扩展名格式:
|
|
|
|
+ extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
|
|
|
|
+ String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + extName);
|
|
filePath = filePath.replaceAll( "d:","");
|
|
filePath = filePath.replaceAll( "d:","");
|
|
ManuelEntity manuel = new ManuelEntity();
|
|
ManuelEntity manuel = new ManuelEntity();
|
|
manuel.setManuel_name(f.getName().replace( ".pdf",""));
|
|
manuel.setManuel_name(f.getName().replace( ".pdf",""));
|
|
@@ -323,17 +337,19 @@ public class ScheduleTasks {
|
|
for (File f : files) {
|
|
for (File f : files) {
|
|
if (f.getName().endsWith(ExcelUtils.DOC) || f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
if (f.getName().endsWith(ExcelUtils.DOC) || f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
MultipartFile mfile = transtTo(f);
|
|
MultipartFile mfile = transtTo(f);
|
|
- String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + f.getName());
|
|
|
|
|
|
+ String extName = ""; // 扩展名格式:
|
|
|
|
+ extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
|
|
|
|
+ String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + extName);
|
|
//转为pdf
|
|
//转为pdf
|
|
DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
|
|
DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
|
|
- if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
|
- deleteDir1(new File(filePath));
|
|
|
|
- filePath = filePath.replaceAll( "doc","pdf");
|
|
|
|
- }
|
|
|
|
- if (f.getName().endsWith(ExcelUtils.DOCX)) {
|
|
|
|
- deleteDir1(new File(filePath));
|
|
|
|
- filePath = filePath.replaceAll( "docx","pdf");
|
|
|
|
- }
|
|
|
|
|
|
+// if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
|
|
+// deleteDir1(new File(filePath));
|
|
|
|
+// filePath = filePath.replaceAll( "doc","pdf");
|
|
|
|
+// }
|
|
|
|
+// 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;
|
|
String name = null;
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
if (f.getName().endsWith(ExcelUtils.DOC)) {
|
|
@@ -353,7 +369,9 @@ public class ScheduleTasks {
|
|
else
|
|
else
|
|
{
|
|
{
|
|
MultipartFile mfile = transtTo(f);
|
|
MultipartFile mfile = transtTo(f);
|
|
- String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + f.getName());
|
|
|
|
|
|
+ String extName = ""; // 扩展名格式:
|
|
|
|
+ extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
|
|
|
|
+ String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + extName);
|
|
filePath = filePath.replaceAll( "d:","");
|
|
filePath = filePath.replaceAll( "d:","");
|
|
OutlineEntity outline = new OutlineEntity();
|
|
OutlineEntity outline = new OutlineEntity();
|
|
outline.setOutline_name(f.getName().replace( ".pdf",""));
|
|
outline.setOutline_name(f.getName().replace( ".pdf",""));
|