Browse Source

pdf代码格式化

root 2 years ago
parent
commit
a96bc9b0ce

+ 140 - 142
simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java

@@ -2628,18 +2628,18 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         Document document = new Document(PageSize.A4);
         OutputStream os = null;
         try {
-            HttpServletResponse response = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getResponse();
+            HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
 
             //获取要生成的数据
-            ResponseBodyVO bodyVO = selectProjectReportById(param);
-            ProjectReportVo vo = (ProjectReportVo)bodyVO.getInfo();
+            ResponseBodyVO<ProjectReportVo> bodyVO = selectProjectReportById(param);
+            ProjectReportVo vo = bodyVO.getInfo();
 
             //下载 or 保存本地
-            if(param.getIsCreateLocalPdfFile() != null && param.getIsCreateLocalPdfFile() == true){
+            if (param.getIsCreateLocalPdfFile() != null && param.getIsCreateLocalPdfFile()) {
                 File file = new File(param.getLocalPdfFilePath());
-                os = new BufferedOutputStream(new FileOutputStream(file));
-            }else{
-                String fileName=vo.getProjectId()+"_"+vo.getProjectName();
+                os = new BufferedOutputStream(Files.newOutputStream(file.toPath()));
+            } else {
+                String fileName = vo.getProjectId() + "_" + vo.getProjectName();
                 response.setContentType("application/x-download");
                 response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".pdf");
                 os = new BufferedOutputStream(response.getOutputStream());
@@ -2682,66 +2682,65 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
             BaseFont bf3 = BaseFont.createFont("fonts/STSONG.TTF", BaseFont.IDENTITY_H,
                     BaseFont.NOT_EMBEDDED);
-            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);
+            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);
+            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. 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);
+            addElement(document, "1. 算法描述与简评", null, bf4, 16, false, 70, 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)){
+            if ("G".equals(evaluationLevel)) {
                 Level = LevelArr[0];
-            }else if("A".equals(evaluationLevel)){
+            } else if ("A".equals(evaluationLevel)) {
                 Level = LevelArr[1];
-            }else if("M".equals(evaluationLevel)){
+            } else if ("M".equals(evaluationLevel)) {
                 Level = LevelArr[2];
-            }else if("P".equals(evaluationLevel)){
+            } else if ("P".equals(evaluationLevel)) {
                 Level = LevelArr[3];
             }
 
             //此处为了方便直接截取 ”算法简评“ 字段后半段,不再重新获取数据
             String algorithmEvaluation = vo.getAlgorithmEvaluation();
-            String s = algorithmEvaluation.substring(algorithmEvaluation.lastIndexOf("级评价,")+4);
+            String s = algorithmEvaluation.substring(algorithmEvaluation.lastIndexOf("级评价,") + 4);
 
-            addElement(document,"       "+vo.getAlgorithmName()+"测试得分为"+vo.getAlgorithmScore()+
-                            ",依据图1-1的标准,该算法获得"+Level+"级评价,"+s,null, bf3,
+            addElement(document, "       " + vo.getAlgorithmName() + "测试得分为" + vo.getAlgorithmScore() +
+                            ",依据图1-1的标准,该算法获得" + Level + "级评价," + s, null, bf3,
                     15, false, 30, false);
 
             Image image = Image.getInstance("classpath:icon/pjdj.png");
-            image.scaleAbsolute(320,100);
+            image.scaleAbsolute(320, 100);
             image.setAlignment(Element.ALIGN_CENTER);
             document.add(image);
 
-            addElement(document,"图1-1 评价标准",null, bf3, 15, false, 30, true);
+            addElement(document, "图1-1 评价标准", null, bf3, 15, false, 30, true);
 
-            addElement(document,"2. 测试得分说明",null, bf4, 16, false, 70, false);
+            addElement(document, "2. 测试得分说明", null, bf4, 16, false, 70, false);
 
             List<AlgorithmScoreVo> algorithmScoreList = vo.getAlgorithmScoreList();
 
-            StringBuffer stringBuffer = new StringBuffer("       " + vo.getAlgorithmName() + "在");
+            StringBuilder stringBuffer = new StringBuilder("       " + vo.getAlgorithmName() + "在");
             int size1 = algorithmScoreList.size();
-            for(int i=0; i<size1; i++){
-                AlgorithmScoreVo v = algorithmScoreList.get(i);
-                if("汇总".equals(v.getProjectName())){
+            for (AlgorithmScoreVo v : algorithmScoreList) {
+                if ("汇总".equals(v.getProjectName())) {
                     continue;
                 }
-                stringBuffer.append(v.getProjectName()+"项目的"+v.getSceneNum()+"个场景中,测试得分为"+v.getScore()+
-                        ",得分率为"+v.getScoreRatio()+"%;");
+                stringBuffer.append(v.getProjectName() + "项目的" + v.getSceneNum() + "个场景中,测试得分为" + v.getScore() +
+                        ",得分率为" + v.getScoreRatio() + "%;");
 
             }
             String substring = stringBuffer.substring(0, stringBuffer.lastIndexOf(";"));
 
-            addElement(document,substring+",详见表2-1。",null, bf3, 15, false, 30, false);
-            addElement(document,"表2-1 测试得分表",null, bf3, 15, false, 30, true);
+            addElement(document, substring + ",详见表2-1。", null, bf3, 15, false, 30, false);
+            addElement(document, "表2-1 测试得分表", null, bf3, 15, false, 30, true);
 
             /*
             测试得分表
@@ -2750,10 +2749,10 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
             //表头
             PdfPTable pdfPTable = new PdfPTable(5);
             pdfPTable.setHeaderRows(1);//换页每页显示表头
-            addTitleList(pdfPTable, font, new String[]{"测试项目","场景数量","测试权重(%)","测试得分","得分率(%)"});
+            addTitleList(pdfPTable, font, new String[]{"测试项目", "场景数量", "测试权重(%)", "测试得分", "得分率(%)"});
 
             //数据
-            for(AlgorithmScoreVo asv : algorithmScoreList){
+            for (AlgorithmScoreVo asv : algorithmScoreList) {
                 String[] data = new String[]{
                         asv.getProjectName(), String.valueOf(asv.getSceneNum()), asv.getWeight(), String.valueOf(asv.getScore()), String.valueOf(asv.getScoreRatio())
                 };
@@ -2762,27 +2761,27 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
             }
             document.add(pdfPTable);
 
-            addElement(document,"3. 算法测试评分情况",null, bf4, 16, false, 70, false);
-            addElement(document,"       为排除其他因素的干扰,科学评价算法效果,本报告将测试场景分为仿真异常场景、未参与评分场景、未达标场景和达标场景4类:",null, bf3, 15, false, 30, false);
-            addElement(document,"       1. 仿真异常场景指的是在仿真过程中报aborted错误的场景,参与得分权重,测试结果均赋0分;",null, bf3, 15, false, 30, false);
-            addElement(document,"       2. 评分失败场景是指因为场景与评分规则不匹配导致程序报错无法对仿真结果进行打分的场景,参与得分权重,测试结果均赋0分;",null, bf3, 15, false, 30, false);
-            addElement(document,"       3. 未达标场景是指仿真测试未得到满分的场景;",null, bf3, 15, false, 30, false);
-            addElement(document,"       4. 达标场景是指仿真测试得到满分的场景。",null, bf3, 15, false, 30, false);
-            addElement(document,"       算法在本次场景测试包中的表现见表3-1.",null, bf3, 15, false, 30, false);
-            addElement(document,"表3-1 算法测试评分细则",null, bf3, 15, false, 30, true);
+            addElement(document, "3. 算法测试评分情况", null, bf4, 16, false, 70, false);
+            addElement(document, "       为排除其他因素的干扰,科学评价算法效果,本报告将测试场景分为仿真异常场景、未参与评分场景、未达标场景和达标场景4类:", null, bf3, 15, false, 30, false);
+            addElement(document, "       1. 仿真异常场景指的是在仿真过程中报aborted错误的场景,参与得分权重,测试结果均赋0分;", null, bf3, 15, false, 30, false);
+            addElement(document, "       2. 评分失败场景是指因为场景与评分规则不匹配导致程序报错无法对仿真结果进行打分的场景,参与得分权重,测试结果均赋0分;", null, bf3, 15, false, 30, false);
+            addElement(document, "       3. 未达标场景是指仿真测试未得到满分的场景;", null, bf3, 15, false, 30, false);
+            addElement(document, "       4. 达标场景是指仿真测试得到满分的场景。", null, bf3, 15, false, 30, false);
+            addElement(document, "       算法在本次场景测试包中的表现见表3-1.", null, bf3, 15, false, 30, false);
+            addElement(document, "表3-1 算法测试评分细则", null, bf3, 15, false, 30, true);
 
             /**
              * 算法评分细则
              */
 
-            setBlankLineSpacing(20,font,document);
+            setBlankLineSpacing(20, font, document);
 
             List<Map> subListScoreLiTitle = vo.getSubListScoreLiTitle();
             int size = subListScoreLiTitle.size();
             PdfPTable pdfPTable2 = new PdfPTable(size);
             pdfPTable2.setHeaderRows(1);
             String[] slt = new String[size];
-            for(int i=0; i<size; i++){
+            for (int i = 0; i < size; i++) {
                 slt[i] = subListScoreLiTitle.get(i).get("label").toString();
             }
             addTitleList(pdfPTable2, font, slt);
@@ -2790,49 +2789,49 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
             List<SubScListVo> subListScoreLi = vo.getSubListScoreLi();
 
             List<String[]> list = new ArrayList<>();
-            for(SubScListVo slv : subListScoreLi){
+            for (SubScListVo slv : subListScoreLi) {
                 String[] slsi = new String[size];
-                for(int i=0;i<size;i++){
+                for (int i = 0; i < size; i++) {
                     slsi[i] = "";
                 }
                 //目前最多支持到6级指标
-                for(int i=0; i<size-4; i++){
-                    if(i==0){
-                        if(slv.getSublistName1() != null){
+                for (int i = 0; i < size - 4; i++) {
+                    if (i == 0) {
+                        if (slv.getSublistName1() != null) {
                             slsi[i] = slv.getSublistName1();
                         }
 
-                    }else if(i==1){
-                        if(slv.getSublistName2() != null){
+                    } else if (i == 1) {
+                        if (slv.getSublistName2() != null) {
                             slsi[i] = slv.getSublistName2();
                         }
 
-                    }else if(i==2){
-                        if(slv.getSublistName3() != null){
+                    } else if (i == 2) {
+                        if (slv.getSublistName3() != null) {
                             slsi[i] = slv.getSublistName3();
                         }
 
-                    }else if(i==3){
-                        if(slv.getSublistName4() != null){
+                    } else if (i == 3) {
+                        if (slv.getSublistName4() != null) {
                             slsi[i] = slv.getSublistName4();
                         }
 
-                    }else if(i==4){
-                        if(slv.getSublistName5() != null){
+                    } else if (i == 4) {
+                        if (slv.getSublistName5() != null) {
                             slsi[i] = slv.getSublistName5();
                         }
 
-                    }else if(i==5){
-                        if(slv.getSublistName6() != null){
+                    } else if (i == 5) {
+                        if (slv.getSublistName6() != null) {
                             slsi[i] = slv.getSublistName6();
                         }
 
                     }
                 }
-                slsi[size-4] = slv.getSceneNum();
-                slsi[size-3] = slv.getNotStandardSceneNum();
-                slsi[size-2] = slv.getLastScore();
-                slsi[size-1] = slv.getFirstScore();
+                slsi[size - 4] = slv.getSceneNum();
+                slsi[size - 3] = slv.getNotStandardSceneNum();
+                slsi[size - 2] = slv.getLastScore();
+                slsi[size - 1] = slv.getFirstScore();
 
                 list.add(slsi);
 
@@ -2845,21 +2844,21 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
             Map<String, Integer> combineCoordList = (Map<String, Integer>) map.get("combineCoordList");
             List<String> skipCoordList = (List<String>) map.get("skipCoordList");
 
-            for(int i=0; i<list.size();i++){
+            for (int i = 0; i < list.size(); i++) {
                 String[] strings = list.get(i);
-                for(int j=0; j<strings.length; j++){
-                    String coord = i+","+j;
+                for (int j = 0; j < strings.length; j++) {
+                    String coord = i + "," + j;
 
                     //是否要跳过
                     boolean contains = skipCoordList.contains(coord);
-                    if(contains){
+                    if (contains) {
                         continue;
                     }
-                    PdfPCell pdfPCell = new PdfPCell(new Paragraph(strings[j],defaultFont(font)));
+                    PdfPCell pdfPCell = new PdfPCell(new Paragraph(strings[j], defaultFont(font)));
 
                     //是否要合并
-                    Integer n =  combineCoordList.get(coord);
-                    if(n != null){
+                    Integer n = combineCoordList.get(coord);
+                    if (n != null) {
                         pdfPCell.setRowspan(n);
                     }
 
@@ -2877,60 +2876,60 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 //            lineFeed(document, 2, 2);
 
             List<SceneScListVo> sceneScoreLi = vo.getSceneScoreLi();
-            addElement(document,"4. 详细场景得分说明",null, bf4, 16, false, 0, false);
+            addElement(document, "4. 详细场景得分说明", null, bf4, 16, false, 0, false);
             StringBuffer s1 = new StringBuffer("       " + vo.getAlgorithmName());
             boolean b = true;
-            for(int i=0; i<size1; i++){
+            for (int i = 0; i < size1; i++) {
                 AlgorithmScoreVo v = algorithmScoreList.get(i);
                 Double score = v.getScore();
-                if(100 > score){
+                if (100 > score) {
                     b = false;
                     break;
                 }
             }
             String substring1 = "";
             StringBuffer stringBuffer2 = new StringBuffer("       ");
-            if(b){
+            if (b) {
                 //得分都为100
-                for(int i=0; i<size1; i++){
+                for (int i = 0; i < size1; i++) {
                     AlgorithmScoreVo v = algorithmScoreList.get(i);
-                    if("汇总".equals(v.getProjectName())){
+                    if ("汇总".equals(v.getProjectName())) {
                         continue;
                     }
-                    stringBuffer2.append(vo.getAlgorithmName()+"在指标中的"+v.getSceneNum()+"个场景均表现良好,测试得分为"+v.getScore()+
+                    stringBuffer2.append(vo.getAlgorithmName() + "在指标中的" + v.getSceneNum() + "个场景均表现良好,测试得分为" + v.getScore() +
                             ";");
                 }
                 substring1 = stringBuffer2.substring(0, stringBuffer2.lastIndexOf(";"));
                 substring1 += "。详见表4-1。";
 
-            }else{
+            } else {
                 //得分有小于100的
-                for(int i=0; i<size1; i++){
+                for (int i = 0; i < size1; i++) {
                     AlgorithmScoreVo v = algorithmScoreList.get(i);
-                    if("汇总".equals(v.getProjectName())){
+                    if ("汇总".equals(v.getProjectName())) {
                         continue;
                     }
                     Integer sceneNum = v.getSceneNum();
                     String projectName = v.getProjectName();
 
-                    for(SceneScListVo v1 : sceneScoreLi){
-                        if(projectName.equals(v1.getSublistName1())){
+                    for (SceneScListVo v1 : sceneScoreLi) {
+                        if (projectName.equals(v1.getSublistName1())) {
                             String sceneScore = v1.getSceneScore();
                             BigDecimal score = new BigDecimal("0");
-                            if(sceneScore != null && !"".equals(sceneScore)){
+                            if (sceneScore != null && !"".equals(sceneScore)) {
                                 score = new BigDecimal(sceneScore);
                             }
                             int r = score.compareTo(new BigDecimal("100"));
-                            if(r == -1){
-                                stringBuffer2.append(vo.getAlgorithmName()+"在"+v1.getSublistName1()+"指标中的"+v1.getSceneId()+"中,"+"测试得分为"+v1.getSceneScore()+";");
+                            if (r == -1) {
+                                stringBuffer2.append(vo.getAlgorithmName() + "在" + v1.getSublistName1() + "指标中的" + v1.getSceneId() + "中," + "测试得分为" + v1.getSceneScore() + ";");
                                 sceneNum--;
                             }
                         }
                     }
                     substring1 = stringBuffer2.substring(0, stringBuffer2.lastIndexOf(";"));
-                    if(sceneNum > 0){
-                        substring1 += ",在其他"+sceneNum+"个场景表现良好,测试得分100分";
-                    }else{
+                    if (sceneNum > 0) {
+                        substring1 += ",在其他" + sceneNum + "个场景表现良好,测试得分100分";
+                    } else {
                         substring1 += "。详见表4-1。";
                     }
 
@@ -2939,8 +2938,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
             }
 
-            addElement(document,substring1,null, bf3, 15, false, 30, false);
-            addElement(document,"表4-1 详细得分情况",null, bf3, 15, false, 30, true);
+            addElement(document, substring1, null, bf3, 15, false, 30, false);
+            addElement(document, "表4-1 详细得分情况", null, bf3, 15, false, 30, true);
 
 
             /*
@@ -2953,64 +2952,64 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
             sceneScoreElements.setAlignment(Element.ALIGN_CENTER); //居中
             document.add(sceneScoreElements);*/
 
-            setBlankLineSpacing(20,font,document);
+            setBlankLineSpacing(20, font, document);
 
             List<Map> scoreLiTitle = vo.getSceneScoreLiTitle();
             int size2 = scoreLiTitle.size();
             PdfPTable pdfPTable3 = new PdfPTable(size2);
             pdfPTable3.setHeaderRows(1);
             String[] slt2 = new String[size2];
-            for(int i=0; i<size2; i++){
+            for (int i = 0; i < size2; i++) {
                 slt2[i] = scoreLiTitle.get(i).get("label").toString();
             }
             addTitleList(pdfPTable3, font, slt2);
 
             List<String[]> list2 = new ArrayList<>();
 
-            for(SceneScListVo sslv : sceneScoreLi){
+            for (SceneScListVo sslv : sceneScoreLi) {
                 String[] ssli = new String[size2];
-                for(int i=0;i<size2;i++){
+                for (int i = 0; i < size2; i++) {
                     ssli[i] = "";
                 }
                 //目前最多支持到6级指标
-                for(int i=0; i<size2-5; i++){
-                    if(i==0){
-                        if(sslv.getSublistName1() != null){
+                for (int i = 0; i < size2 - 5; i++) {
+                    if (i == 0) {
+                        if (sslv.getSublistName1() != null) {
                             ssli[i] = sslv.getSublistName1();
                         }
 
-                    }else if(i==1){
-                        if(sslv.getSublistName2() != null){
+                    } else if (i == 1) {
+                        if (sslv.getSublistName2() != null) {
                             ssli[i] = sslv.getSublistName2();
                         }
 
-                    }else if(i==2){
-                        if(sslv.getSublistName3() != null){
+                    } else if (i == 2) {
+                        if (sslv.getSublistName3() != null) {
                             ssli[i] = sslv.getSublistName3();
                         }
 
-                    }else if(i==3){
-                        if(sslv.getSublistName4() != null){
+                    } else if (i == 3) {
+                        if (sslv.getSublistName4() != null) {
                             ssli[i] = sslv.getSublistName4();
                         }
 
-                    }else if(i==4){
-                        if(sslv.getSublistName5() != null){
+                    } else if (i == 4) {
+                        if (sslv.getSublistName5() != null) {
                             ssli[i] = sslv.getSublistName5();
                         }
 
-                    }else if(i==5){
-                        if(sslv.getSublistName6() != null){
+                    } else if (i == 5) {
+                        if (sslv.getSublistName6() != null) {
                             ssli[i] = sslv.getSublistName6();
                         }
 
                     }
                 }
-                ssli[size2-5] = sslv.getSceneId();
-                ssli[size2-4] = sslv.getSceneIdType();
-                ssli[size2-3] = sslv.getSceneScore();
-                ssli[size2-2] = sslv.getTargetEvaluate();
-                ssli[size2-1] = sslv.getScoreExplain();
+                ssli[size2 - 5] = sslv.getSceneId();
+                ssli[size2 - 4] = sslv.getSceneIdType();
+                ssli[size2 - 3] = sslv.getSceneScore();
+                ssli[size2 - 2] = sslv.getTargetEvaluate();
+                ssli[size2 - 1] = sslv.getScoreExplain();
 
                 list2.add(ssli);
 
@@ -3024,20 +3023,20 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
             boolean b2 = false;
             int num2 = 0;
-            for(int i=0; i<list2.size();i++){
+            for (int i = 0; i < list2.size(); i++) {
                 String[] strings = list2.get(i);
-                for(int j=0; j<strings.length; j++){
-                    String coord = i+","+j;
+                for (int j = 0; j < strings.length; j++) {
+                    String coord = i + "," + j;
 
                     //是否要跳过
                     boolean contains = skipCoordList2.contains(coord);
-                    if(contains){
+                    if (contains) {
                         continue;
                     }
-                    PdfPCell pdfPCell = new PdfPCell(new Paragraph(strings[j],defaultFont(font)));
+                    PdfPCell pdfPCell = new PdfPCell(new Paragraph(strings[j], defaultFont(font)));
                     //是否要合并
-                    Integer n =  combineCoordList2.get(coord);
-                    if(n != null){
+                    Integer n = combineCoordList2.get(coord);
+                    if (n != null) {
                         pdfPCell.setRowspan(n);
                     }
 
@@ -3354,11 +3353,10 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
             document.add(pdfPTable3);*/
 
 
-        } catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
 
-        }
-        finally {
+        } finally {
             document.close();
             try {
                 os.close();
@@ -3370,12 +3368,12 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
     }
 
     public void lineFeed(Document document, int length, int type) throws DocumentException {
-        if(type == 1){
-            for(int i=0; i<length; i++){
+        if (type == 1) {
+            for (int i = 0; i < length; i++) {
                 document.add(Chunk.NEWLINE);
             }
-        }else if(type == 2){
-            for(int i=0; i<length; i++){
+        } else if (type == 2) {
+            for (int i = 0; i < length; i++) {
                 document.add(new Phrase("\n"));
             }
         }
@@ -3384,17 +3382,17 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
     private void addElement(Document document, String val1, String val2, BaseFont f, int fontSize, boolean isBold, int leading, boolean isCenter) throws DocumentException {
         Font ft;
         Paragraph elm;
-        if(isBold){
+        if (isBold) {
             ft = new Font(f, fontSize, Font.BOLD);
-        }else{
+        } else {
             ft = new Font(f, fontSize);
         }
-        if(val2 != null && !"".equals(val2)){
-            elm = new Paragraph(leading,val1+val2, ft);
-        }else{
+        if (val2 != null && !"".equals(val2)) {
+            elm = new Paragraph(leading, val1 + val2, ft);
+        } else {
             elm = new Paragraph(leading, val1, ft);
         }
-        if(isCenter){
+        if (isCenter) {
             elm.setAlignment(Element.ALIGN_CENTER);
         }
         document.add(elm);
@@ -4955,7 +4953,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         List<Map> colourList = new LinkedList();
         algorithmListGy.forEach(vo -> {
             Map colourMap = new HashMap();
-            colourMap.put("code",vo.getId());
+            colourMap.put("code", vo.getId());
             colourMap.put("name", vo.getName());
             colourMap.put("vo", vo);
             colourList.add(colourMap);
@@ -4967,12 +4965,12 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         List<Map> colourList1 = new LinkedList();
         algorithmListSy.forEach(vo -> {
             Map colourMap = new HashMap();
-            colourMap.put("code",vo.getId());
+            colourMap.put("code", vo.getId());
             colourMap.put("name", vo.getName());
             colourMap.put("vo", vo);
             colourList1.add(colourMap);
         });
-        typeMap1.put("children",colourList1 );
+        typeMap1.put("children", colourList1);
         treeList.add(typeMap);
         treeList.add(typeMap1);
      /*   List<DropDownNewVo> listGSy = new ArrayList<>();
@@ -5060,7 +5058,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         List<Map> colourList = new LinkedList();
         vehicleGyList.forEach(vo -> {
             Map colourMap = new HashMap();
-            colourMap.put("code",vo.getId());
+            colourMap.put("code", vo.getId());
             colourMap.put("name", vo.getName());
             colourMap.put("vo", vo);
             colourList.add(colourMap);
@@ -5072,12 +5070,12 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         List<Map> colourList1 = new LinkedList();
         vehicleSyList.forEach(vo -> {
             Map colourMap = new HashMap();
-            colourMap.put("code",vo.getId());
+            colourMap.put("code", vo.getId());
             colourMap.put("name", vo.getName());
             colourMap.put("vo", vo);
             colourList1.add(colourMap);
         });
-        typeMap1.put("children",colourList1 );
+        typeMap1.put("children", colourList1);
         treeList.add(typeMap);
         treeList.add(typeMap1);
 
@@ -5117,7 +5115,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         List<Map> colourList = new LinkedList();
         scenePackageGyList.forEach(vo -> {
             Map colourMap = new HashMap();
-            colourMap.put("code",vo.getId());
+            colourMap.put("code", vo.getId());
             colourMap.put("name", vo.getName());
             colourMap.put("vo", vo);
             colourList.add(colourMap);
@@ -5129,12 +5127,12 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         List<Map> colourList1 = new LinkedList();
         scenePackageSyList.forEach(vo -> {
             Map colourMap = new HashMap();
-            colourMap.put("code",vo.getId());
+            colourMap.put("code", vo.getId());
             colourMap.put("name", vo.getName());
             colourMap.put("vo", vo);
             colourList1.add(colourMap);
         });
-        typeMap1.put("children",colourList1 );
+        typeMap1.put("children", colourList1);
         treeList.add(typeMap);
         treeList.add(typeMap1);
         DropDownTypeNewVo dropDownTypeNewVo = new DropDownTypeNewVo();