|
@@ -799,6 +799,13 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
projectReportVo.setProjectName(poParam.getProjectName());
|
|
|
projectReportVo.setAlgorithmName(algorithmBaseInfoVo.getAlgorithmName());
|
|
|
projectReportVo.setAlgorithmDescribe(algorithmBaseInfoVo.getDescription());
|
|
|
+
|
|
|
+ //添加开始时间
|
|
|
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ if(poParam.getStartTime() != null){
|
|
|
+ projectReportVo.setStartTime(dateFormat.format(poParam.getStartTime()));
|
|
|
+ }
|
|
|
+
|
|
|
String sceneNames;
|
|
|
|
|
|
// 算法测试得分表
|
|
@@ -2780,7 +2787,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
lineFeed(document, 4, 1);
|
|
|
|
|
|
//添加首页
|
|
|
- BaseFont bf = BaseFont.createFont("fonts/STXINWEI.TTF", BaseFont.IDENTITY_H,
|
|
|
+ BaseFont bf = BaseFont.createFont("fonts/simsun.ttc,1", BaseFont.IDENTITY_H,
|
|
|
BaseFont.NOT_EMBEDDED);
|
|
|
Font f1 = new Font(bf, 48, Font.BOLD);
|
|
|
Paragraph elm1 = new Paragraph("ICV仿真云平台", f1);
|
|
@@ -2793,6 +2800,14 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
elm2.setAlignment(Element.ALIGN_CENTER);
|
|
|
document.add(elm2);
|
|
|
|
|
|
+ //测试时间(开始时间)
|
|
|
+ lineFeed(document, 16, 2);
|
|
|
+ Font f3 = new Font(bf, 18);
|
|
|
+ Paragraph elm3 = new Paragraph(vo.getStartTime(), f3);
|
|
|
+ elm3.setAlignment(Element.ALIGN_CENTER);
|
|
|
+ document.add(elm3);
|
|
|
+
|
|
|
+
|
|
|
//下一页
|
|
|
document.setPageSize(PageSize.A4);
|
|
|
document.newPage();
|
|
@@ -2804,39 +2819,28 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
addElement(document, "算法名称:", vo.getAlgorithmName(), bf3, 15, true, 0, false);
|
|
|
addElement(document, "算法得分:", vo.getAlgorithmScore().toString(), bf3, 15, true, 30, false);
|
|
|
addElement(document, "测试等级:", vo.getEvaluationLevel(), bf3, 15, true, 30, false);
|
|
|
- ///TODO 测试时间需要添加
|
|
|
- addElement(document, "测试时间:", "", bf3, 15, true, 30, false);
|
|
|
+
|
|
|
|
|
|
BaseFont bf4 = BaseFont.createFont("fonts/simhei.ttf", BaseFont.IDENTITY_H,
|
|
|
BaseFont.NOT_EMBEDDED);
|
|
|
|
|
|
- addElement(document, "1. 算法描述与简评", null, bf4, 16, false, 70, false);
|
|
|
+ addElement(document, "1. 算法描述与简评", null, bf4, 16, false, 40, false);
|
|
|
addElement(document, "1. 1 算法描述:", null, bf3, 15, false, 30, false);
|
|
|
addElement(document, " " + vo.getAlgorithmDescribe(), null, bf3, 15, false, 30, false);
|
|
|
addElement(document, "1. 2 算法简评:", null, bf3, 15, false, 30, false);
|
|
|
- String[] LevelArr = {"优秀(G)", "良好(A)", "一般(M)", "较差(P)"};
|
|
|
- String Level = "";
|
|
|
- String evaluationLevel = vo.getEvaluationLevel();
|
|
|
- if ("G".equals(evaluationLevel)) {
|
|
|
- Level = LevelArr[0];
|
|
|
- } else if ("A".equals(evaluationLevel)) {
|
|
|
- Level = LevelArr[1];
|
|
|
- } else if ("M".equals(evaluationLevel)) {
|
|
|
- Level = LevelArr[2];
|
|
|
- } else if ("P".equals(evaluationLevel)) {
|
|
|
- Level = LevelArr[3];
|
|
|
- }
|
|
|
|
|
|
//此处为了方便直接截取 ”算法简评“ 字段后半段,不再重新获取数据
|
|
|
String algorithmEvaluation = vo.getAlgorithmEvaluation();
|
|
|
String s = algorithmEvaluation.substring(algorithmEvaluation.lastIndexOf("级评价,") + 4);
|
|
|
+ s = s.replace("(", "");
|
|
|
+ s = s.replace(")", "");
|
|
|
|
|
|
addElement(document, " " + vo.getAlgorithmName() + "测试得分为" + vo.getAlgorithmScore() +
|
|
|
- ",依据图1-1的标准,该算法获得" + Level + "级评价," + s, null, bf3,
|
|
|
+ ",依据图1-1的标准,该算法获得" + vo.getEvaluationLevel() + "级评价," + s, null, bf3,
|
|
|
15, false, 30, false);
|
|
|
|
|
|
Image image = Image.getInstance("classpath:icon/pjdj.png");
|
|
|
- image.scaleAbsolute(320, 100);
|
|
|
+ image.scaleAbsolute(500, 150);
|
|
|
image.setAlignment(Element.ALIGN_CENTER);
|
|
|
document.add(image);
|
|
|
|
|
@@ -2865,7 +2869,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
/*
|
|
|
测试得分表
|
|
|
*/
|
|
|
- lineFeed(document, 3, 2);
|
|
|
+ setBlankLineSpacing(20, font, document);
|
|
|
//表头
|
|
|
PdfPTable pdfPTable = new PdfPTable(5);
|
|
|
pdfPTable.setHeaderRows(1);//换页每页显示表头
|
|
@@ -4874,6 +4878,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
for (String title : titleList) {
|
|
|
PdfPCell pdfPCell = new PdfPCell(new Paragraph(title, defaultFont(font)));
|
|
|
pdfPCell.setBackgroundColor(BaseColor.LIGHT_GRAY);
|
|
|
+ pdfPCell.setHorizontalAlignment(1);
|
|
|
pdfPTable.addCell(pdfPCell);
|
|
|
|
|
|
}
|