Explorar o código

Merge remote-tracking branch 'origin/master'

root %!s(int64=2) %!d(string=hai) anos
pai
achega
19c0889cd0

+ 3 - 0
api-common/src/main/java/api/common/pojo/vo/project/ProjectReportVo.java

@@ -60,6 +60,9 @@ public class ProjectReportVo {
     private String packageName;
     private Integer maxIndex;
 
+    //测试时间(开始时间)
+    private String startTime;
+
 
 }
 

+ 24 - 19
simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java

@@ -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);
 
         }

+ 1 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/project/util/PdfBuilder.java

@@ -16,7 +16,7 @@ public class PdfBuilder extends PdfPageEventForwarder {
     @Override
     public void onEndPage(PdfWriter writer, Document document) {
 
-        Image image = Image.getInstance("classpath:icon/ym.png");
+        Image image = Image.getInstance("classpath:icon/ym_new.png");
         PdfContentByte directContent = writer.getDirectContent();
 
         BaseFont baseFont = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);

BIN=BIN
simulation-resource-server/src/main/resources/fonts/simsun.ttc


+ 1 - 0
simulation-resource-server/src/main/resources/fonts/字体库说明

@@ -1,3 +1,4 @@
 STXINWEI.TTF:华文新魏
 STSONG.TTF:华文宋体
 simhei.ttf:黑体常规
+simsun.ttc:宋体 常规

BIN=BIN
simulation-resource-server/src/main/resources/icon/ym_new.png


+ 2 - 1
simulation-resource-server/src/main/resources/mapper/project/SimulationProjectMapper.xml

@@ -236,7 +236,8 @@
                project_name,
                project_id,
                algorithm_type,
-               evaluation_level
+               evaluation_level,
+               start_time
         from simulation_manual_project
         where is_deleted = '0'
           and id = #{id,jdbcType=VARCHAR}