|
|
|
|
@ -1,28 +1,28 @@
|
|
|
|
|
package com.biutag.supervision.service.report.impl; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.biutag.supervision.constants.enums.CheckStatusEnum; |
|
|
|
|
import com.biutag.supervision.constants.enums.ProcessingStatusEnum; |
|
|
|
|
import com.biutag.supervision.pojo.dto.report.OverviewSection; |
|
|
|
|
import com.biutag.supervision.pojo.dto.report.accountability.ReportAccountabilityStatsRequestDTO; |
|
|
|
|
import com.biutag.supervision.pojo.dto.report.accountability.ReportAccountabilityStatsResponseDTO; |
|
|
|
|
import com.biutag.supervision.pojo.dto.report.base.ReportBaseQueryRequestDTO; |
|
|
|
|
import com.biutag.supervision.pojo.dto.report.base.ReportBaseQueryResponseDTO; |
|
|
|
|
import com.biutag.supervision.pojo.dto.report.closed.ClosedStatsCalcRequestDTO; |
|
|
|
|
import com.biutag.supervision.pojo.dto.report.closed.ClosedStatsCalcResponseDTO; |
|
|
|
|
import com.biutag.supervision.pojo.dto.report.overview.ReportOverviewSectionRequestDTO; |
|
|
|
|
import com.biutag.supervision.pojo.param.NegativeQueryParam; |
|
|
|
|
import com.biutag.supervision.pojo.vo.NegativeQueryVo; |
|
|
|
|
import com.biutag.supervision.service.report.ReportAccountabilityStatsService; |
|
|
|
|
import com.biutag.supervision.service.report.ReportBaseQueryService; |
|
|
|
|
import com.biutag.supervision.service.report.ReportClosedStatsService; |
|
|
|
|
import com.biutag.supervision.service.report.ReportOverviewSectionService; |
|
|
|
|
import com.biutag.supervision.util.ReportTrendUtil; |
|
|
|
|
import jakarta.annotation.Resource; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @ClassName ReportOverviewSectionServiceImpl |
|
|
|
|
@ -31,6 +31,7 @@ import java.util.stream.Stream;
|
|
|
|
|
* @Date 2026/3/9 |
|
|
|
|
*/ |
|
|
|
|
@Service |
|
|
|
|
@Slf4j |
|
|
|
|
public class ReportOverviewSectionServiceImpl implements ReportOverviewSectionService { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -47,6 +48,13 @@ public class ReportOverviewSectionServiceImpl implements ReportOverviewSectionSe
|
|
|
|
|
@Resource |
|
|
|
|
private ReportAccountabilityStatsService reportAccountabilityStatsService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 办结/查实统计服务 |
|
|
|
|
*/ |
|
|
|
|
@Resource |
|
|
|
|
private ReportClosedStatsService reportClosedStatsService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 构建总体概览数据 |
|
|
|
|
* |
|
|
|
|
@ -58,7 +66,7 @@ public class ReportOverviewSectionServiceImpl implements ReportOverviewSectionSe
|
|
|
|
|
if (requestDTO == null || requestDTO.getNegativeQueryParam() == null) { |
|
|
|
|
return new OverviewSection(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
log.info("总览数据开始计算======================================================================================="); |
|
|
|
|
NegativeQueryParam request = requestDTO.getNegativeQueryParam(); |
|
|
|
|
String periodStart = requestDTO.getPeriodStart(); |
|
|
|
|
String periodEnd = requestDTO.getPeriodEnd(); |
|
|
|
|
@ -68,201 +76,124 @@ public class ReportOverviewSectionServiceImpl implements ReportOverviewSectionSe
|
|
|
|
|
baseRequestDTO.setNegativeQueryParam(request); |
|
|
|
|
ReportBaseQueryResponseDTO baseQueryResponseDTO = reportBaseQueryService.queryBaseData(baseRequestDTO); |
|
|
|
|
|
|
|
|
|
List<NegativeQueryVo> ztNegativeList = baseQueryResponseDTO.getCurrentList(); |
|
|
|
|
List<NegativeQueryVo> hbNegativeList = baseQueryResponseDTO.getMomList(); |
|
|
|
|
List<NegativeQueryVo> tbNegativeList = baseQueryResponseDTO.getYoyList(); |
|
|
|
|
|
|
|
|
|
// 市局下发数据
|
|
|
|
|
List<NegativeQueryVo> sjxfNegativeList = ztNegativeList.stream() |
|
|
|
|
List<NegativeQueryVo> currentList = baseQueryResponseDTO.getCurrentList(); |
|
|
|
|
List<NegativeQueryVo> momList = baseQueryResponseDTO.getMomList(); |
|
|
|
|
List<NegativeQueryVo> yoyList = baseQueryResponseDTO.getYoyList(); |
|
|
|
|
|
|
|
|
|
// 2. 基础分组数据
|
|
|
|
|
List<NegativeQueryVo> cityIssuedList = currentList.stream() |
|
|
|
|
.filter(one -> Objects.equals(0, one.getCrtDepartLevel())) |
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
// 分县市局下发数据
|
|
|
|
|
List<NegativeQueryVo> fxsjxfNegativeList = ztNegativeList.stream() |
|
|
|
|
List<NegativeQueryVo> countyIssuedList = currentList.stream() |
|
|
|
|
.filter(one -> Objects.equals(2, one.getCrtDepartLevel())) |
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
// 本期办结数据
|
|
|
|
|
List<NegativeQueryVo> bjNegativeList = ztNegativeList.stream() |
|
|
|
|
.filter(one -> ProcessingStatusEnum.completed.name().equals(one.getProcessingStatus())) |
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
// 本期办结中属实数据
|
|
|
|
|
List<NegativeQueryVo> bjssNegativeList = bjNegativeList.stream() |
|
|
|
|
.filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode())) |
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
// 本期办结中基本属实数据
|
|
|
|
|
List<NegativeQueryVo> bjjbssNegativeList = bjNegativeList.stream() |
|
|
|
|
.filter(one -> CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())) |
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
// 本期办结中不属实数据
|
|
|
|
|
List<NegativeQueryVo> bjbssNegativeList = bjNegativeList.stream() |
|
|
|
|
.filter(one -> CheckStatusEnum.FALSE_SET.contains(one.getCheckStatusCode())) |
|
|
|
|
.toList(); |
|
|
|
|
// 3. 办结/查实统计
|
|
|
|
|
ClosedStatsCalcResponseDTO currentClosedStats = calculateClosedStats(currentList); |
|
|
|
|
ClosedStatsCalcResponseDTO momClosedStats = calculateClosedStats(momList); |
|
|
|
|
ClosedStatsCalcResponseDTO yoyClosedStats = calculateClosedStats(yoyList); |
|
|
|
|
|
|
|
|
|
// 本期属实 + 基本属实问题ID,用于计算问责数据
|
|
|
|
|
List<String> ssNegativeIds = Stream.concat(bjssNegativeList.stream(), bjjbssNegativeList.stream()) |
|
|
|
|
.map(NegativeQueryVo::getId) |
|
|
|
|
.filter(StrUtil::isNotBlank) |
|
|
|
|
.distinct() |
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
ReportAccountabilityStatsRequestDTO currentRequestDTO = new ReportAccountabilityStatsRequestDTO(); |
|
|
|
|
currentRequestDTO.setNegativeIds(ssNegativeIds); |
|
|
|
|
ReportAccountabilityStatsResponseDTO currentAccountabilityStats = |
|
|
|
|
reportAccountabilityStatsService.calculateAccountabilityStats(currentRequestDTO); |
|
|
|
|
// 4. 问责统计
|
|
|
|
|
ReportAccountabilityStatsResponseDTO currentAccountabilityStats = calculateAccountabilityStats(currentList); |
|
|
|
|
ReportAccountabilityStatsResponseDTO momAccountabilityStats = calculateAccountabilityStats(momList); |
|
|
|
|
ReportAccountabilityStatsResponseDTO yoyAccountabilityStats = calculateAccountabilityStats(yoyList); |
|
|
|
|
|
|
|
|
|
// ==================== 环比问责数据 ====================
|
|
|
|
|
// 5. 环比/同比基础值
|
|
|
|
|
int currentTotal = currentList.size(); |
|
|
|
|
int momTotal = momList.size(); |
|
|
|
|
int yoyTotal = yoyList.size(); |
|
|
|
|
|
|
|
|
|
// 环比办结数据
|
|
|
|
|
List<NegativeQueryVo> hbBjNegativeList = hbNegativeList.stream() |
|
|
|
|
.filter(one -> ProcessingStatusEnum.completed.name().equals(one.getProcessingStatus())) |
|
|
|
|
.toList(); |
|
|
|
|
BigDecimal currentVerifiedRate = defaultZero(currentClosedStats.getVerifiedRate()); |
|
|
|
|
BigDecimal momVerifiedRate = defaultZero(momClosedStats.getVerifiedRate()); |
|
|
|
|
BigDecimal yoyVerifiedRate = defaultZero(yoyClosedStats.getVerifiedRate()); |
|
|
|
|
|
|
|
|
|
// 环比办结中属实数据
|
|
|
|
|
List<NegativeQueryVo> hbBjssNegativeList = hbBjNegativeList.stream() |
|
|
|
|
.filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode())) |
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
// 环比办结中基本属实数据
|
|
|
|
|
List<NegativeQueryVo> hbBjjbssNegativeList = hbBjNegativeList.stream() |
|
|
|
|
.filter(one -> CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())) |
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
// 环比属实 + 基本属实问题ID
|
|
|
|
|
List<String> hbNegativeIds = Stream.concat(hbBjssNegativeList.stream(), hbBjjbssNegativeList.stream()) |
|
|
|
|
.map(NegativeQueryVo::getId) |
|
|
|
|
.filter(StrUtil::isNotBlank) |
|
|
|
|
.distinct() |
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
ReportAccountabilityStatsRequestDTO momRequestDTO = new ReportAccountabilityStatsRequestDTO(); |
|
|
|
|
momRequestDTO.setNegativeIds(hbNegativeIds); |
|
|
|
|
ReportAccountabilityStatsResponseDTO momAccountabilityStats = |
|
|
|
|
reportAccountabilityStatsService.calculateAccountabilityStats(momRequestDTO); |
|
|
|
|
|
|
|
|
|
// ==================== 同比问责数据 ====================
|
|
|
|
|
|
|
|
|
|
// 同比办结数据
|
|
|
|
|
List<NegativeQueryVo> tbBjNegativeList = tbNegativeList.stream() |
|
|
|
|
.filter(one -> ProcessingStatusEnum.completed.name().equals(one.getProcessingStatus())) |
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
// 同比办结中属实数据
|
|
|
|
|
List<NegativeQueryVo> tbBjssNegativeList = tbBjNegativeList.stream() |
|
|
|
|
.filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode())) |
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
// 同比办结中基本属实数据
|
|
|
|
|
List<NegativeQueryVo> tbBjjbssNegativeList = tbBjNegativeList.stream() |
|
|
|
|
.filter(one -> CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())) |
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
// 同比属实 + 基本属实问题ID
|
|
|
|
|
List<String> tbNegativeIds = Stream.concat(tbBjssNegativeList.stream(), tbBjjbssNegativeList.stream()) |
|
|
|
|
.map(NegativeQueryVo::getId) |
|
|
|
|
.filter(StrUtil::isNotBlank) |
|
|
|
|
.distinct() |
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
ReportAccountabilityStatsRequestDTO yoyRequestDTO = new ReportAccountabilityStatsRequestDTO(); |
|
|
|
|
yoyRequestDTO.setNegativeIds(tbNegativeIds); |
|
|
|
|
ReportAccountabilityStatsResponseDTO yoyAccountabilityStats = |
|
|
|
|
reportAccountabilityStatsService.calculateAccountabilityStats(yoyRequestDTO); |
|
|
|
|
|
|
|
|
|
// 本期、环比、同比问题总数
|
|
|
|
|
int current = ztNegativeList.size(); |
|
|
|
|
int mom = hbNegativeList.size(); |
|
|
|
|
int yoy = tbNegativeList.size(); |
|
|
|
|
int currentAccountabilityTotal = currentAccountabilityStats.getTotal(); |
|
|
|
|
int momAccountabilityTotal = momAccountabilityStats.getTotal(); |
|
|
|
|
int yoyAccountabilityTotal = yoyAccountabilityStats.getTotal(); |
|
|
|
|
|
|
|
|
|
// 6. 组装结果
|
|
|
|
|
OverviewSection overviewSection = new OverviewSection(); |
|
|
|
|
|
|
|
|
|
// 统计区间
|
|
|
|
|
overviewSection.setPeriodStart(periodStart); |
|
|
|
|
overviewSection.setPeriodEnd(periodEnd); |
|
|
|
|
|
|
|
|
|
// 总下发数及环比、同比
|
|
|
|
|
overviewSection.setTotalIssued(ztNegativeList.size()); |
|
|
|
|
overviewSection.setMomRate(ReportTrendUtil.calcRate(current, mom)); |
|
|
|
|
overviewSection.setMomTrend(ReportTrendUtil.calcTrend(current, mom)); |
|
|
|
|
overviewSection.setYoyRate(ReportTrendUtil.calcRate(current, yoy)); |
|
|
|
|
overviewSection.setYoyTrend(ReportTrendUtil.calcTrend(current, yoy)); |
|
|
|
|
|
|
|
|
|
// 市局 / 分县市局下发情况
|
|
|
|
|
overviewSection.setCityIssued(sjxfNegativeList.size()); |
|
|
|
|
overviewSection.setCityRate(ReportTrendUtil.percent(sjxfNegativeList.size(), ztNegativeList.size())); |
|
|
|
|
overviewSection.setCountyIssued(fxsjxfNegativeList.size()); |
|
|
|
|
overviewSection.setCountyRate(ReportTrendUtil.percent(fxsjxfNegativeList.size(), ztNegativeList.size())); |
|
|
|
|
|
|
|
|
|
// 办结情况
|
|
|
|
|
overviewSection.setClosedCount(bjNegativeList.size()); |
|
|
|
|
overviewSection.setVerifiedCount(bjssNegativeList.size()); |
|
|
|
|
overviewSection.setBasicallyVerifiedCount(bjjbssNegativeList.size()); |
|
|
|
|
overviewSection.setUnverifiedCount(bjbssNegativeList.size()); |
|
|
|
|
|
|
|
|
|
// 查实率及环比、同比
|
|
|
|
|
BigDecimal curVerifiedRate = calcVerifiedRate(ztNegativeList); |
|
|
|
|
BigDecimal momVerifiedRate = calcVerifiedRate(hbNegativeList); |
|
|
|
|
BigDecimal yoyVerifiedRate = calcVerifiedRate(tbNegativeList); |
|
|
|
|
|
|
|
|
|
overviewSection.setVerifiedRate(curVerifiedRate); |
|
|
|
|
overviewSection.setVerifiedMomRate(ReportTrendUtil.calcRate(curVerifiedRate, momVerifiedRate)); |
|
|
|
|
overviewSection.setVerifiedMomTrend(ReportTrendUtil.calcTrend(curVerifiedRate, momVerifiedRate)); |
|
|
|
|
overviewSection.setVerifiedYoyRate(ReportTrendUtil.calcRate(curVerifiedRate, yoyVerifiedRate)); |
|
|
|
|
overviewSection.setVerifiedYoyTrend(ReportTrendUtil.calcTrend(curVerifiedRate, yoyVerifiedRate)); |
|
|
|
|
|
|
|
|
|
// 问责数据及环比、同比
|
|
|
|
|
int accountabilityTotal = currentAccountabilityStats.getTotal(); |
|
|
|
|
overviewSection.setAccountabilityTotal(accountabilityTotal); |
|
|
|
|
// 总下发
|
|
|
|
|
overviewSection.setTotalIssued(currentTotal); |
|
|
|
|
overviewSection.setMomRate(ReportTrendUtil.calcRate(currentTotal, momTotal)); |
|
|
|
|
overviewSection.setMomTrend(ReportTrendUtil.calcTrend(currentTotal, momTotal)); |
|
|
|
|
overviewSection.setYoyRate(ReportTrendUtil.calcRate(currentTotal, yoyTotal)); |
|
|
|
|
overviewSection.setYoyTrend(ReportTrendUtil.calcTrend(currentTotal, yoyTotal)); |
|
|
|
|
|
|
|
|
|
// 市局 / 分县市局下发
|
|
|
|
|
overviewSection.setCityIssued(cityIssuedList.size()); |
|
|
|
|
overviewSection.setCityRate(ReportTrendUtil.percent(cityIssuedList.size(), currentTotal)); |
|
|
|
|
overviewSection.setCountyIssued(countyIssuedList.size()); |
|
|
|
|
overviewSection.setCountyRate(ReportTrendUtil.percent(countyIssuedList.size(), currentTotal)); |
|
|
|
|
|
|
|
|
|
// 办结 / 核查
|
|
|
|
|
overviewSection.setClosedCount(currentClosedStats.getClosedCount()); |
|
|
|
|
overviewSection.setVerifiedCount(currentClosedStats.getVerifiedCount()); |
|
|
|
|
overviewSection.setBasicallyVerifiedCount(currentClosedStats.getBasicallyVerifiedCount()); |
|
|
|
|
overviewSection.setUnverifiedCount(currentClosedStats.getUnverifiedCount()); |
|
|
|
|
overviewSection.setVerifiedAndBasicallyVerifiedCount(currentClosedStats.getVerifiedCount() + currentClosedStats.getBasicallyVerifiedCount()); |
|
|
|
|
|
|
|
|
|
// 查实率
|
|
|
|
|
overviewSection.setVerifiedRate(currentVerifiedRate); |
|
|
|
|
overviewSection.setVerifiedMomRate(ReportTrendUtil.calcRate(currentVerifiedRate, momVerifiedRate)); |
|
|
|
|
overviewSection.setVerifiedMomTrend(ReportTrendUtil.calcTrend(currentVerifiedRate, momVerifiedRate)); |
|
|
|
|
overviewSection.setVerifiedYoyRate(ReportTrendUtil.calcRate(currentVerifiedRate, yoyVerifiedRate)); |
|
|
|
|
overviewSection.setVerifiedYoyTrend(ReportTrendUtil.calcTrend(currentVerifiedRate, yoyVerifiedRate)); |
|
|
|
|
|
|
|
|
|
// 问责统计
|
|
|
|
|
overviewSection.setAccountabilityProblemTotal(currentAccountabilityStats.getAccountabilityNegativeCount()); |
|
|
|
|
overviewSection.setAccountabilityTotal(currentAccountabilityTotal); |
|
|
|
|
overviewSection.setPersonalAccountability(currentAccountabilityStats.getPersonal()); |
|
|
|
|
overviewSection.setUnitAccountability(currentAccountabilityStats.getUnit()); |
|
|
|
|
overviewSection.setAccountabilityMomRate(ReportTrendUtil.calcRate(accountabilityTotal, momAccountabilityStats.getTotal())); |
|
|
|
|
overviewSection.setAccountabilityMomTrend(ReportTrendUtil.calcTrend(accountabilityTotal, momAccountabilityStats.getTotal())); |
|
|
|
|
overviewSection.setAccountabilityYoyRate(ReportTrendUtil.calcRate(accountabilityTotal, yoyAccountabilityStats.getTotal())); |
|
|
|
|
overviewSection.setAccountabilityYoyTrend(ReportTrendUtil.calcTrend(accountabilityTotal, yoyAccountabilityStats.getTotal())); |
|
|
|
|
|
|
|
|
|
// 集中问题
|
|
|
|
|
Map.Entry<String, Long> problemEntry = |
|
|
|
|
ReportTrendUtil.topBy(NegativeQueryVo::getProblemSources, bjssNegativeList, bjjbssNegativeList); |
|
|
|
|
overviewSection.setAccountabilityMomRate(ReportTrendUtil.calcRate(currentAccountabilityTotal, momAccountabilityTotal)); |
|
|
|
|
overviewSection.setAccountabilityMomTrend(ReportTrendUtil.calcTrend(currentAccountabilityTotal, momAccountabilityTotal)); |
|
|
|
|
overviewSection.setAccountabilityYoyRate(ReportTrendUtil.calcRate(currentAccountabilityTotal, yoyAccountabilityTotal)); |
|
|
|
|
overviewSection.setAccountabilityYoyTrend(ReportTrendUtil.calcTrend(currentAccountabilityTotal, yoyAccountabilityTotal)); |
|
|
|
|
|
|
|
|
|
// 集中问题(基于属实 + 基本属实)
|
|
|
|
|
Map.Entry<String, Long> problemEntry = ReportTrendUtil.topBy( |
|
|
|
|
NegativeQueryVo::getProblemSources, |
|
|
|
|
currentClosedStats.getVerifiedList(), |
|
|
|
|
currentClosedStats.getBasicallyVerifiedList() |
|
|
|
|
); |
|
|
|
|
overviewSection.setTopProblemProject(problemEntry != null ? problemEntry.getKey() : null); |
|
|
|
|
|
|
|
|
|
// 重点关注单位
|
|
|
|
|
Map.Entry<String, Long> departEntry = |
|
|
|
|
ReportTrendUtil.topBy(NegativeQueryVo::getInvolveDepartName, bjssNegativeList, bjjbssNegativeList); |
|
|
|
|
// 重点关注单位(基于属实 + 基本属实)
|
|
|
|
|
Map.Entry<String, Long> departEntry = ReportTrendUtil.topBy(NegativeQueryVo::getInvolveDepartName, |
|
|
|
|
currentClosedStats.getVerifiedList(), |
|
|
|
|
currentClosedStats.getBasicallyVerifiedList() |
|
|
|
|
); |
|
|
|
|
overviewSection.setTopProblemUnit(departEntry != null ? departEntry.getKey() : null); |
|
|
|
|
log.info("总览数据计算结束======================================================================================="); |
|
|
|
|
return overviewSection; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private ClosedStatsCalcResponseDTO calculateClosedStats(List<NegativeQueryVo> list) { |
|
|
|
|
ClosedStatsCalcRequestDTO requestDTO = new ClosedStatsCalcRequestDTO(); |
|
|
|
|
requestDTO.setNegativeQueryVoList(list); |
|
|
|
|
return reportClosedStatsService.calculateClosedStats(requestDTO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 计算查实率 |
|
|
|
|
* 查实率 = (属实数 + 基本属实数)/ 办结数 * 100 |
|
|
|
|
* |
|
|
|
|
* @param list 问题数据列表 |
|
|
|
|
* @return 查实率 |
|
|
|
|
* 统一计算问责统计 |
|
|
|
|
*/ |
|
|
|
|
private BigDecimal calcVerifiedRate(List<NegativeQueryVo> list) { |
|
|
|
|
// 办结数据
|
|
|
|
|
List<NegativeQueryVo> closed = list.stream() |
|
|
|
|
.filter(one -> ProcessingStatusEnum.completed.name().equals(one.getProcessingStatus())) |
|
|
|
|
.toList(); |
|
|
|
|
private ReportAccountabilityStatsResponseDTO calculateAccountabilityStats(List<NegativeQueryVo> list) { |
|
|
|
|
ReportAccountabilityStatsRequestDTO requestDTO = new ReportAccountabilityStatsRequestDTO(); |
|
|
|
|
requestDTO.setNegativeQueryVoList(list); |
|
|
|
|
return reportAccountabilityStatsService.calculateAccountabilityStats(requestDTO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int closedCount = closed.size(); |
|
|
|
|
if (closedCount == 0) { |
|
|
|
|
return BigDecimal.ZERO; |
|
|
|
|
private BigDecimal defaultZero(BigDecimal value) { |
|
|
|
|
return value == null ? BigDecimal.ZERO : value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 属实数
|
|
|
|
|
int verified = (int) closed.stream() |
|
|
|
|
.filter(n -> CheckStatusEnum.TRUE_SET.contains(n.getCheckStatusCode())) |
|
|
|
|
.count(); |
|
|
|
|
|
|
|
|
|
// 基本属实数
|
|
|
|
|
int partVerified = (int) closed.stream() |
|
|
|
|
.filter(n -> CheckStatusEnum.PART_TRUE_SET.contains(n.getCheckStatusCode())) |
|
|
|
|
.count(); |
|
|
|
|
|
|
|
|
|
return ReportTrendUtil.percent(verified + partVerified, closedCount); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |