Browse Source

代码调整

dev_shibei_match
jianjun 5 years ago
parent
commit
8faa729e53
  1. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java

@ -6,7 +6,6 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.ExtractConstant; import com.epmet.constant.ExtractConstant;
import com.epmet.constant.ProjectEvaluateConstant; import com.epmet.constant.ProjectEvaluateConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao;
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO;
import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO;
@ -200,7 +199,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
autoSelf.set(false); autoSelf.set(false);
} }
}); });
if (autoSelf.get() == true){ if (autoSelf.get()) {
count.getAndSet(count.get() + NumConstant.ONE); count.getAndSet(count.get() + NumConstant.ONE);
} }
}); });
@ -231,7 +230,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
Map<String, List<ProjectEvaluateResultDTO>> groupByProject = projectEvaluateInfoList.stream().collect(Collectors.groupingBy(ProjectEvaluateResultDTO::getProjectId)); Map<String, List<ProjectEvaluateResultDTO>> groupByProject = projectEvaluateInfoList.stream().collect(Collectors.groupingBy(ProjectEvaluateResultDTO::getProjectId));
groupByProject.forEach((projectId,projectList) -> { groupByProject.forEach((projectId,projectList) -> {
projectList.forEach(project -> { projectList.forEach(project -> {
switch (project.getActionCode()){ switch (project.getActionCode()) {
case ExtractConstant.EVALUATE_BAD: case ExtractConstant.EVALUATE_BAD:
project.setScore(ProjectEvaluateConstant.BAD); project.setScore(ProjectEvaluateConstant.BAD);
break; break;
@ -241,9 +240,11 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
case ExtractConstant.EVALUATE_PERFECT: case ExtractConstant.EVALUATE_PERFECT:
project.setScore(ProjectEvaluateConstant.PERFECT); project.setScore(ProjectEvaluateConstant.PERFECT);
break; break;
default:
log.warn("calGridIndexGovernAbility orther projectEvaluate,actionCode:{}", project.getActionCode());
} }
}); });
Integer projectAllScore = projectList.stream().collect(Collectors.summingInt(ProjectEvaluateResultDTO::getScore)); Integer projectAllScore = projectList.stream().mapToInt(ProjectEvaluateResultDTO::getScore).sum();
scoreMap.put(projectId,projectAllScore/projectList.size()); scoreMap.put(projectId,projectAllScore/projectList.size());
}); });
AtomicReference<Integer> allScore = new AtomicReference<>(0); AtomicReference<Integer> allScore = new AtomicReference<>(0);
@ -285,29 +286,25 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
}); });
} }
// 4. 网格吹哨部门准确率 // 4. 网格吹哨部门准确率
if (!CollectionUtils.isEmpty(notReturnProjectList)){ if (!CollectionUtils.isEmpty(notReturnProjectList)) {
notReturnProjectList.forEach(not -> { notReturnProjectList.forEach(not -> {
if (r.getGridId().equals(not.getGridId())){ if (r.getGridId().equals(not.getGridId())) {
r.setTransferRightRatio(not.getTransferRightRatio()); r.setTransferRightRatio(not.getTransferRightRatio());
} }
}); });
} }
// 5. 网格内解决的项目的满意度 // 5. 网格内解决的项目的满意度
if (null != resultSatisfactionScore){ resultSatisfactionScore.forEach((k, v) -> {
resultSatisfactionScore.forEach((k,v) -> { if (r.getGridId().equals(k)) {
if (r.getGridId().equals(k)){
r.setSatisfactionRatio(v); r.setSatisfactionRatio(v);
} }
}); });
}
// 6. 网格自治项目数 // 6. 网格自治项目数
if (null != autoMap){ autoMap.forEach((k, v) -> {
autoMap.forEach((k,v) -> { if (r.getGridId().equals(k)) {
if (r.getGridId().equals(k)){
r.setSelfSolveProjectCount(v); r.setSelfSolveProjectCount(v);
} }
}); });
}
}); });
delAndInsertGovernAbility(result,customerId,monthId); delAndInsertGovernAbility(result,customerId,monthId);
return true; return true;

Loading…
Cancel
Save