|
@ -29,10 +29,7 @@ import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
import java.math.BigDecimal; |
|
|
import java.text.NumberFormat; |
|
|
import java.text.NumberFormat; |
|
|
import java.util.ArrayList; |
|
|
import java.util.*; |
|
|
import java.util.HashMap; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@ -277,16 +274,30 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { |
|
|
//网格办结项目数
|
|
|
//网格办结项目数
|
|
|
List<GridProjectClosedTotalResultDTO> gridProjectClosedTotalList = projectMainService.selectGridClosedProject(customerId, monthId, ExtractConstant.CLOSED); |
|
|
List<GridProjectClosedTotalResultDTO> gridProjectClosedTotalList = projectMainService.selectGridClosedProject(customerId, monthId, ExtractConstant.CLOSED); |
|
|
//网格吹哨部门准确率 【没被退回的项目数/项目总数 】
|
|
|
//网格吹哨部门准确率 【没被退回的项目数/项目总数 】
|
|
|
List<NotReturnProjectResultDTO> notReturnProjectList = projectLogService.selectNotReturnProject(customerId, monthId, ExtractConstant.RETURN_ACTION_CODE, ExtractConstant.GRID_ORG_TYPE); |
|
|
List<TransferRightRatioResultDTO> transferRightRatioResultDTOS = projectMainService.selectTransferRightRatio(customerId, monthId); |
|
|
if (!CollectionUtils.isEmpty(gridIssueShiftProjectRatio) && !CollectionUtils.isEmpty(notReturnProjectList)){ |
|
|
List<TransferRightRatioResultDTO> transferRightRatioResultDTOS1 = projectLogService.selectNotReturn(customerId, monthId); |
|
|
notReturnProjectList.forEach(not -> { |
|
|
if (!CollectionUtils.isEmpty(transferRightRatioResultDTOS1)){ |
|
|
gridIssueShiftProjectRatio.forEach(total -> { |
|
|
transferRightRatioResultDTOS.forEach(r -> { |
|
|
if (not.getGridId().equals(total.getGridId())){ |
|
|
transferRightRatioResultDTOS1.forEach(t -> { |
|
|
not.setTransferRightRatio(getRound(new BigDecimal(not.getNotReturnProject()/total.getProjectTotal()).multiply(NumConstant.ONE_HUNDRED_DECIMAL))); |
|
|
r.setStatus(r.getProjectId().equals(t.getProjectId()) ? true : false); |
|
|
} |
|
|
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
}else { |
|
|
|
|
|
transferRightRatioResultDTOS.forEach(r -> { |
|
|
|
|
|
r.setStatus(false); |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
Map<String, List<TransferRightRatioResultDTO>> groupByGridProject = transferRightRatioResultDTOS.stream().collect(Collectors.groupingBy(TransferRightRatioResultDTO::getGridId)); |
|
|
|
|
|
Map<String,BigDecimal> notReturnMap = new HashMap<>(16); |
|
|
|
|
|
groupByGridProject.forEach((grid,project) -> { |
|
|
|
|
|
AtomicReference<Integer> count = new AtomicReference<>(NumConstant.ZERO); |
|
|
|
|
|
project.forEach(p -> { |
|
|
|
|
|
if (p.getStatus().equals(false)){ |
|
|
|
|
|
count.getAndSet(count.get() + NumConstant.ONE); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
notReturnMap.put(grid,getRound(new BigDecimal(count.get()/project.size()).multiply(NumConstant.ONE_HUNDRED_DECIMAL))); |
|
|
|
|
|
}); |
|
|
//网格内解决的项目的满意度
|
|
|
//网格内解决的项目的满意度
|
|
|
//项目评价(分值定义下非常满意100,满意80,不满意(一般)60)的人数的平均分(每个项目的参加人数的分数和/评论人数=一个项目的平均分)+其他项目得分/已关闭项目总数
|
|
|
//项目评价(分值定义下非常满意100,满意80,不满意(一般)60)的人数的平均分(每个项目的参加人数的分数和/评论人数=一个项目的平均分)+其他项目得分/已关闭项目总数
|
|
|
List<ProjectEvaluateResultDTO> projectEvaluateList = projectLogService.selectProjectEvaluate(customerId, monthId); |
|
|
List<ProjectEvaluateResultDTO> projectEvaluateList = projectLogService.selectProjectEvaluate(customerId, monthId); |
|
@ -355,10 +366,10 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
// 4. 网格吹哨部门准确率
|
|
|
// 4. 网格吹哨部门准确率
|
|
|
if (!CollectionUtils.isEmpty(notReturnProjectList)) { |
|
|
if(notReturnMap != null){ |
|
|
notReturnProjectList.forEach(not -> { |
|
|
notReturnMap.forEach((grid,transferRightRatio) -> { |
|
|
if (r.getGridId().equals(not.getGridId())) { |
|
|
if (r.getGridId().equals(grid)){ |
|
|
r.setTransferRightRatio(not.getTransferRightRatio()); |
|
|
r.setTransferRightRatio(transferRightRatio); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|