|
@@ -53,6 +53,7 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.kafka.core.KafkaTemplate;
|
|
|
import org.springframework.scheduling.support.CronExpression;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.context.request.RequestContextHolder;
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
|
@@ -5975,7 +5976,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
@SneakyThrows
|
|
|
@Override
|
|
|
public ResponseBodyVO<PageInfo<ManualProjectTaskVo>> querySceneEvaluationDetail(SimulationManualProjectEvaluationDetailParam param) {
|
|
|
- setPage(param.getCurrentPage() == null ? 1 : param.getCurrentPage(), param.getPageSize() == null ? 10 : param.getPageSize());
|
|
|
+// setPage(param.getCurrentPage() == null ? 1 : param.getCurrentPage(), param.getPageSize() == null ? 10 : param.getPageSize());
|
|
|
// 获取任务包信息
|
|
|
ProjectTaskParam projectTaskParam = new ProjectTaskParam();
|
|
|
projectTaskParam.setPId(param.getId());
|
|
@@ -5992,14 +5993,63 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
SceneEvaluationOperatePO sceneEvaluationOperatePO = sceneEvaluationRuleService.getSceneEvaluationFirst(sceneEvaluationForListParam);
|
|
|
Map<String, SceneComplexityPO> complexityPOMap = sceneEvaluationOperatePO.getSceneComplexityPOMap();
|
|
|
Map<String, SceneRiskPO> riskPOMap = sceneEvaluationOperatePO.getSceneRiskPOMap();
|
|
|
+ List<String> comList = new ArrayList<>();
|
|
|
+ List<String> riskList = new ArrayList<>();
|
|
|
for (ManualProjectTaskVo po : pageInfo.getList()) {
|
|
|
if (complexityPOMap.get(po.getSceneId()) != null) {
|
|
|
po.setComplexity(String.valueOf(complexityPOMap.get(po.getSceneId()).getComplexity()));
|
|
|
po.setComplexityLevel(String.valueOf(complexityPOMap.get(po.getSceneId()).getComplexityLevel()));
|
|
|
+ comList.add(po.getComplexity());
|
|
|
}
|
|
|
if (riskPOMap.get(po.getSceneId()) != null) {
|
|
|
po.setRisk(String.valueOf(riskPOMap.get(po.getSceneId()).getRisk()));
|
|
|
po.setRiskLevel(String.valueOf(riskPOMap.get(po.getSceneId()).getRiskLevel()));
|
|
|
+ riskList.add(po.getRisk());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 计算复杂度显著性
|
|
|
+ if (!CollectionUtils.isEmpty(comList)){
|
|
|
+ Double standardDeviationByStrList = CalculateUtils.getStandardDeviationByStrList(comList);
|
|
|
+ Double avaByStrList = CalculateUtils.getAvaByStrList(comList);
|
|
|
+ if (standardDeviationByStrList != null && avaByStrList != null){
|
|
|
+ for (ManualProjectTaskVo po : pageInfo.getList()) {
|
|
|
+ try {
|
|
|
+ String complexity = po.getComplexity();
|
|
|
+ Double score = po.getScore();
|
|
|
+ if (com.alibaba.cloud.commons.lang.StringUtils.isNotBlank(complexity)){
|
|
|
+ Double aDouble = Double.valueOf(complexity);
|
|
|
+ if (aDouble >= (avaByStrList-standardDeviationByStrList ) && aDouble <= (avaByStrList + standardDeviationByStrList) && score != null && score < 80){
|
|
|
+ po.setComplexitySignificance(true);
|
|
|
+ }else {
|
|
|
+ po.setComplexitySignificance(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ log.info("计算复杂度失败", e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!CollectionUtils.isEmpty(riskList)){
|
|
|
+ Double standardDeviationByStrList = CalculateUtils.getStandardDeviationByStrList(riskList);
|
|
|
+ Double avaByStrList = CalculateUtils.getAvaByStrList(riskList);
|
|
|
+ if (standardDeviationByStrList != null && avaByStrList != null){
|
|
|
+ for (ManualProjectTaskVo po : pageInfo.getList()) {
|
|
|
+ try {
|
|
|
+ String risk = po.getRisk();
|
|
|
+ Double score = po.getScore();
|
|
|
+ if (com.alibaba.cloud.commons.lang.StringUtils.isNotBlank(risk)){
|
|
|
+ Double aDouble = Double.valueOf(risk);
|
|
|
+ if (aDouble >= (avaByStrList-standardDeviationByStrList ) && aDouble <= (avaByStrList + standardDeviationByStrList) && score != null && score < 80){
|
|
|
+ po.setRiskSignificance(true);
|
|
|
+ }else {
|
|
|
+ po.setRiskSignificance(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ log.info("计算危险度失败", e);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|