|
@@ -562,7 +562,9 @@ public class PdfServiceImpl extends BaseService implements PdfService {
|
|
List<String> codes=casePDF.getCodes();
|
|
List<String> codes=casePDF.getCodes();
|
|
for(String str:codes){
|
|
for(String str:codes){
|
|
document.add(new Paragraph("类"+(codes.indexOf(str)+1), PdfUtils.getContent()));
|
|
document.add(new Paragraph("类"+(codes.indexOf(str)+1), PdfUtils.getContent()));
|
|
- document.add(new Paragraph(str,PdfUtils.getContent()));
|
|
|
|
|
|
+ Paragraph paragraph1=new Paragraph(str,PdfUtils.getCode());
|
|
|
|
+ paragraph.setIndentationLeft(25);
|
|
|
|
+ document.add(paragraph1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -629,7 +631,9 @@ public class PdfServiceImpl extends BaseService implements PdfService {
|
|
document.add(new Paragraph("考试结果:", PdfUtils.getContent()));
|
|
document.add(new Paragraph("考试结果:", PdfUtils.getContent()));
|
|
for(String str:casePDF.getAnswerCode()){
|
|
for(String str:casePDF.getAnswerCode()){
|
|
document.add(new Paragraph("类"+(casePDF.getAnswerCode().indexOf(str)+1)+":",PdfUtils.getContent()));
|
|
document.add(new Paragraph("类"+(casePDF.getAnswerCode().indexOf(str)+1)+":",PdfUtils.getContent()));
|
|
- document.add(new Paragraph(str,PdfUtils.getContent()));
|
|
|
|
|
|
+ Paragraph paragraph=new Paragraph(str,PdfUtils.getCode());
|
|
|
|
+ paragraph.setIndentationLeft(25);
|
|
|
|
+ document.add(paragraph);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
document.add(new Paragraph("考试结果:请下载zip文件包查看报告中的测试脚本等附件。", PdfUtils.getContent()));
|
|
document.add(new Paragraph("考试结果:请下载zip文件包查看报告中的测试脚本等附件。", PdfUtils.getContent()));
|
|
@@ -699,13 +703,13 @@ public class PdfServiceImpl extends BaseService implements PdfService {
|
|
if(file.isDirectory()){
|
|
if(file.isDirectory()){
|
|
getJavaCode(file,codes);
|
|
getJavaCode(file,codes);
|
|
}
|
|
}
|
|
- if(file.getName().contains(".java")){
|
|
|
|
|
|
+ if(FilenameUtils.getExtension(file.getName()).equals("java")){
|
|
StringBuilder stringBuilder=new StringBuilder();
|
|
StringBuilder stringBuilder=new StringBuilder();
|
|
try{
|
|
try{
|
|
BufferedReader br = new BufferedReader(new FileReader(file));
|
|
BufferedReader br = new BufferedReader(new FileReader(file));
|
|
String s;
|
|
String s;
|
|
while((s = br.readLine())!=null){
|
|
while((s = br.readLine())!=null){
|
|
- stringBuilder.append(System.lineSeparator()+s);
|
|
|
|
|
|
+ stringBuilder.append(System.lineSeparator()+s.replaceAll("\t"," "));
|
|
}
|
|
}
|
|
br.close();
|
|
br.close();
|
|
}catch(Exception e){
|
|
}catch(Exception e){
|
|
@@ -757,7 +761,7 @@ public class PdfServiceImpl extends BaseService implements PdfService {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
File file = new File(path);
|
|
File file = new File(path);
|
|
- if (file.getName().contains(".doc") || file.getName().contains(".docx")) {
|
|
|
|
|
|
+ if (FilenameUtils.getExtension(file.getName()).equals("doc") || FilenameUtils.getExtension(file.getName()).equals("docx")) {
|
|
try {
|
|
try {
|
|
FileInputStream fis = new FileInputStream(file);
|
|
FileInputStream fis = new FileInputStream(file);
|
|
XWPFDocument doc = new XWPFDocument(fis);
|
|
XWPFDocument doc = new XWPFDocument(fis);
|