|
@@ -869,7 +869,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
totalScoreRatio = Double.valueOf(totalSceneScoreNum) / Double.valueOf(totalSceneNum) * 100;
|
|
|
// 汇总得分率计算方式修改
|
|
|
// algorithmScoreVo.setScoreRatio(saveTwoDecimalPlaces(totalScoreRatio));
|
|
|
- algorithmScoreVo.setScoreRatio(NumberUtil.cut(totalScoreRatio,2));
|
|
|
+ algorithmScoreVo.setScoreRatio(NumberUtil.cut(totalScoreRatio, 2));
|
|
|
algorithmScoreVoList.add(algorithmScoreVo);
|
|
|
projectReportVo.setScoreRatio(saveTwoDecimalPlaces(totalScoreRatio));
|
|
|
projectReportVo.setAlgorithmScore(saveTwoDecimalPlaces(totalScore));
|
|
@@ -2850,35 +2850,32 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
List<AlgorithmScoreVo> algorithmScoreList = vo.getAlgorithmScoreList();
|
|
|
|
|
|
- StringBuffer stringBuffer = new StringBuffer(" " + vo.getAlgorithmName() + "在");
|
|
|
- int size1 = algorithmScoreList.size();
|
|
|
- for (int i = 0; i < size1; i++) {
|
|
|
- AlgorithmScoreVo v = algorithmScoreList.get(i);
|
|
|
+ StringBuilder stringBuilder = new StringBuilder(" " + vo.getAlgorithmName() + "在");
|
|
|
+ for (AlgorithmScoreVo v : algorithmScoreList) {
|
|
|
if ("汇总".equals(v.getProjectName())) {
|
|
|
continue;
|
|
|
}
|
|
|
- stringBuffer.append(v.getProjectName() + "项目的" + v.getSceneNum() + "个场景中,测试得分为" + v.getScore() +
|
|
|
- ",得分率为" + v.getScoreRatio() + "%;");
|
|
|
-
|
|
|
+ stringBuilder.append(v.getProjectName()).append("项目的").append(v.getSceneNum()).append("个场景中,测试得分为").append(v.getScore()).append(",得分率为").append(v.getScoreRatio()).append("%;");
|
|
|
}
|
|
|
- String substring = stringBuffer.substring(0, stringBuffer.lastIndexOf(";"));
|
|
|
+ String substring = stringBuilder.substring(0, stringBuilder.lastIndexOf(";"));
|
|
|
|
|
|
addElement(document, substring + ",详见表2-1。", null, bf3, 15, false, 30, false);
|
|
|
addElement(document, "表2-1 测试得分表", null, bf3, 15, false, 30, true);
|
|
|
|
|
|
- /*
|
|
|
- 测试得分表
|
|
|
- */
|
|
|
+ //表 2-1 测试得分表
|
|
|
setBlankLineSpacing(20, font, document);
|
|
|
- //表头
|
|
|
PdfPTable pdfPTable = new PdfPTable(5);
|
|
|
- pdfPTable.setHeaderRows(1);//换页每页显示表头
|
|
|
- addTitleList(pdfPTable, font, new String[]{"测试项目", "场景数量", "测试权重(%)", "测试得分", "得分率(%)"});
|
|
|
+ pdfPTable.setHeaderRows(1); //换页每页显示表头
|
|
|
+ addTitleList(pdfPTable, font, new String[]{"测试项目", "场景数量", "测试权重(%)", "测试得分", "得分率(%)"}, true);
|
|
|
|
|
|
//数据
|
|
|
for (AlgorithmScoreVo asv : algorithmScoreList) {
|
|
|
String[] data = new String[]{
|
|
|
- asv.getProjectName(), String.valueOf(asv.getSceneNum()), asv.getWeight(), String.valueOf(asv.getScore()), String.valueOf(asv.getScoreRatio())
|
|
|
+ asv.getProjectName(),
|
|
|
+ String.valueOf(asv.getSceneNum()),
|
|
|
+ asv.getWeight(),
|
|
|
+ String.valueOf(asv.getScore()),
|
|
|
+ String.valueOf(asv.getScoreRatio())
|
|
|
};
|
|
|
|
|
|
addDataList(pdfPTable, font, data);
|
|
@@ -2894,21 +2891,20 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
addElement(document, " 算法在本次场景测试包中的表现见表3-1.", null, bf3, 15, false, 30, false);
|
|
|
addElement(document, "表3-1 算法测试评分细则", null, bf3, 15, false, 30, true);
|
|
|
|
|
|
- /**
|
|
|
- * 算法评分细则
|
|
|
- */
|
|
|
+ //* -------------------------------- 算法评分细则 --------------------------------
|
|
|
|
|
|
setBlankLineSpacing(20, font, document);
|
|
|
|
|
|
List<Map> subListScoreLiTitle = vo.getSubListScoreLiTitle();
|
|
|
int size = subListScoreLiTitle.size();
|
|
|
+ // 表 3-1 算法评分细则
|
|
|
PdfPTable pdfPTable2 = new PdfPTable(size);
|
|
|
pdfPTable2.setHeaderRows(1);
|
|
|
String[] slt = new String[size];
|
|
|
for (int i = 0; i < size; i++) {
|
|
|
slt[i] = subListScoreLiTitle.get(i).get("label").toString();
|
|
|
}
|
|
|
- addTitleList(pdfPTable2, font, slt);
|
|
|
+ addTitleList(pdfPTable2, font, slt, true);
|
|
|
|
|
|
List<SubScListVo> subListScoreLi = vo.getSubListScoreLi();
|
|
|
|
|
@@ -3066,7 +3062,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
int r = score.compareTo(new BigDecimal("100"));
|
|
|
//小于100
|
|
|
- if (r == -1) {
|
|
|
+ if (r < 0) {
|
|
|
xy100b++;
|
|
|
deFenShuoMing.append("在" + m + "指标中的" + sc1.getSceneId() + "中,测试得分为" + sceneScore + ";");
|
|
|
}
|
|
@@ -3164,7 +3160,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
for (int i = 0; i < size2; i++) {
|
|
|
slt2[i] = scoreLiTitle.get(i).get("label").toString();
|
|
|
}
|
|
|
- addTitleList(pdfPTable3, font, slt2);
|
|
|
+ addTitleList(pdfPTable3, font, slt2, true);
|
|
|
|
|
|
List<String[]> list2 = new ArrayList<>();
|
|
|
|
|
@@ -4932,9 +4928,6 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
/**
|
|
|
* 默认字体
|
|
|
- *
|
|
|
- * @param font
|
|
|
- * @return
|
|
|
*/
|
|
|
private Font defaultFont(BaseFont font) {
|
|
|
return new Font(font, 14);
|
|
@@ -4942,10 +4935,6 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
/**
|
|
|
* 添加表头
|
|
|
- *
|
|
|
- * @param pdfPTable
|
|
|
- * @param font
|
|
|
- * @param titleList
|
|
|
*/
|
|
|
private void addTitleList(PdfPTable pdfPTable, BaseFont font, String[] titleList) {
|
|
|
for (String title : titleList) {
|
|
@@ -4953,9 +4942,32 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
pdfPCell.setBackgroundColor(BaseColor.LIGHT_GRAY);
|
|
|
pdfPCell.setHorizontalAlignment(1);
|
|
|
pdfPTable.addCell(pdfPCell);
|
|
|
-
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 水平垂直居中添加表头
|
|
|
+ */
|
|
|
+ private void addTitleList(PdfPTable pdfPTable, BaseFont font, String[] titleList, boolean center) {
|
|
|
+ if (center) {
|
|
|
+ for (String title : titleList) {
|
|
|
+ PdfPCell pdfPCell = new PdfPCell();
|
|
|
+ pdfPCell.setBackgroundColor(BaseColor.LIGHT_GRAY); // 单元格底色
|
|
|
+ pdfPCell.setHorizontalAlignment(Element.ALIGN_CENTER); // 水平居中
|
|
|
+ pdfPCell.setUseAscender(true); // 垂直居中
|
|
|
+ pdfPCell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 垂直居中
|
|
|
+ final Paragraph paragraph = new Paragraph(title, defaultFont(font));
|
|
|
+ pdfPCell.setPhrase(paragraph);
|
|
|
+ pdfPTable.addCell(pdfPCell);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (String title : titleList) {
|
|
|
+ PdfPCell pdfPCell = new PdfPCell(new Paragraph(title, defaultFont(font)));
|
|
|
+ pdfPCell.setBackgroundColor(BaseColor.LIGHT_GRAY);
|
|
|
+ pdfPCell.setHorizontalAlignment(1);
|
|
|
+ pdfPTable.addCell(pdfPCell);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|