Browse Source

代码调整

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

37
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.ProjectEvaluateConstant;
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.GridIssueCountResultDTO;
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO;
@ -200,7 +199,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
autoSelf.set(false);
}
});
if (autoSelf.get() == true){
if (autoSelf.get()) {
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));
groupByProject.forEach((projectId,projectList) -> {
projectList.forEach(project -> {
switch (project.getActionCode()){
switch (project.getActionCode()) {
case ExtractConstant.EVALUATE_BAD:
project.setScore(ProjectEvaluateConstant.BAD);
break;
@ -241,9 +240,11 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
case ExtractConstant.EVALUATE_PERFECT:
project.setScore(ProjectEvaluateConstant.PERFECT);
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());
});
AtomicReference<Integer> allScore = new AtomicReference<>(0);
@ -285,29 +286,25 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
});
}
// 4. 网格吹哨部门准确率
if (!CollectionUtils.isEmpty(notReturnProjectList)){
if (!CollectionUtils.isEmpty(notReturnProjectList)) {
notReturnProjectList.forEach(not -> {
if (r.getGridId().equals(not.getGridId())){
if (r.getGridId().equals(not.getGridId())) {
r.setTransferRightRatio(not.getTransferRightRatio());
}
});
}
// 5. 网格内解决的项目的满意度
if (null != resultSatisfactionScore){
resultSatisfactionScore.forEach((k,v) -> {
if (r.getGridId().equals(k)){
r.setSatisfactionRatio(v);
}
});
}
resultSatisfactionScore.forEach((k, v) -> {
if (r.getGridId().equals(k)) {
r.setSatisfactionRatio(v);
}
});
// 6. 网格自治项目数
if (null != autoMap){
autoMap.forEach((k,v) -> {
if (r.getGridId().equals(k)){
r.setSelfSolveProjectCount(v);
}
});
}
autoMap.forEach((k, v) -> {
if (r.getGridId().equals(k)) {
r.setSelfSolveProjectCount(v);
}
});
});
delAndInsertGovernAbility(result,customerId,monthId);
return true;

Loading…
Cancel
Save