提交 d350b6c7 authored 作者: 马晨俊's avatar 马晨俊

mcj:更新

上级 2d5f9627
...@@ -152,7 +152,7 @@ public class Inspector { ...@@ -152,7 +152,7 @@ public class Inspector {
//统计项目语言 //统计项目语言
setReportLanguageAndFrame(); setReportLanguageAndFrame();
//根据扫描结果以及用户配置得出需要使用的规则及技术 //根据扫描结果以及用户配置得出需要使用的规则及技术
ruleTransform(report.getRecastMethod()); ruleTransform(inspectParameter.getRecastMethod());
//解析配置文件集合 //解析配置文件集合
for (Map.Entry<String, List<Path>> entry : configFileTypePathsMapping.entrySet()) { for (Map.Entry<String, List<Path>> entry : configFileTypePathsMapping.entrySet()) {
switch (entry.getKey()) { switch (entry.getKey()) {
...@@ -228,6 +228,7 @@ public class Inspector { ...@@ -228,6 +228,7 @@ public class Inspector {
HashMap<String, List<Warn>> warnMap = getWarnMap(); HashMap<String, List<Warn>> warnMap = getWarnMap();
ruleDao.saveAll(rules); ruleDao.saveAll(rules);
report.setWarnDetails(warnMap); report.setWarnDetails(warnMap);
report.setSupportSize(supportWarns.size());
log.info("评估报告关键技术,{}", warnMap); log.info("评估报告关键技术,{}", warnMap);
return report; return report;
} }
...@@ -268,18 +269,12 @@ public class Inspector { ...@@ -268,18 +269,12 @@ public class Inspector {
*/ */
private void ruleTransform(Integer status) { private void ruleTransform(Integer status) {
if (status == 1) { if (status == 1) {
List<Technology> front = technologyDao.findAllByBackorfrontEquals(1);
List<String> ids = front.stream().map(Technology::getId).collect(Collectors.toList());
this.ruleList = ruleDao.findAllByTechnologyIdIn(ids);
} else {
if (inspectParameter.getRecastMethod() == 1) {
this.ruleList = ruleDao.findAll(); this.ruleList = ruleDao.findAll();
} else { } else {
List<Technology> front = technologyDao.findAllByBackorfrontEquals(1); List<Technology> front = technologyDao.findAllByBackorfrontEquals(1);
List<String> ids = front.stream().map(Technology::getId).collect(Collectors.toList()); List<String> ids = front.stream().map(Technology::getId).collect(Collectors.toList());
this.ruleList = ruleDao.findAllByTechnologyIdIn(ids); this.ruleList = ruleDao.findAllByTechnologyIdIn(ids);
} }
}
Set<String> id = ruleList.stream().map(Rule::getTechnologyId).collect(Collectors.toSet()); Set<String> id = ruleList.stream().map(Rule::getTechnologyId).collect(Collectors.toSet());
List<Technology> technologies = technologyDao.findAllByIdIn(new ArrayList<>(id)); List<Technology> technologies = technologyDao.findAllByIdIn(new ArrayList<>(id));
for (Technology technology : technologies) { for (Technology technology : technologies) {
...@@ -492,9 +487,6 @@ public class Inspector { ...@@ -492,9 +487,6 @@ public class Inspector {
if (supportWarns.size() != 10) { if (supportWarns.size() != 10) {
supportWarns.add(warn); supportWarns.add(warn);
} }
Integer size = report.getSupportSize();
Integer integer = size + 1;
report.setSupportSize(integer);
supportStatus = 1; supportStatus = 1;
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论