|
|
|
|
@ -2,7 +2,6 @@ package com.biutag.supervision.service.datav;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
|
import cn.hutool.core.util.NumberUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
@ -104,6 +103,9 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private MailMapper mailMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private DataPetition12337Mapper dataPetition12337Mapper; |
|
|
|
|
@Resource |
|
|
|
|
private SupExternalDepartMapper supExternalDepartMapper; |
|
|
|
|
|
|
|
|
|
@ -235,11 +237,13 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
long caseVerificationProCount = negativeResourceService.count(group17To20Param); |
|
|
|
|
|
|
|
|
|
// 12337
|
|
|
|
|
NegativeQueryParam xf12337Param = new NegativeQueryParam(); |
|
|
|
|
xf12337Param.setCrtTime(dates); |
|
|
|
|
xf12337Param.setInvolveDepartIds(allDepartIds); |
|
|
|
|
xf12337Param.setProblemSourcesCode(Collections.singletonList(ProblemSourcesEnum.XF12337.getValue())); |
|
|
|
|
long xf12337Count = negativeResourceService.count(xf12337Param); |
|
|
|
|
QueryWrapper<DataPetition12337> queryWrapper12337 = new QueryWrapper<>(); |
|
|
|
|
queryWrapper12337.between("discover_time", request.getBeginTime(), request.getEndTime()); |
|
|
|
|
queryWrapper12337.and(wrapper -> wrapper |
|
|
|
|
.in("third_depart_id", allDepartIds) |
|
|
|
|
.or() |
|
|
|
|
.in("second_depart_id", allDepartIds)); |
|
|
|
|
long xf12337Count = dataPetition12337Mapper.selectCount(queryWrapper12337); |
|
|
|
|
// 国家信访
|
|
|
|
|
DataPetitionComplaintQueryParam countryParam = new DataPetitionComplaintQueryParam(); |
|
|
|
|
countryParam.setCreateTime(dates); |
|
|
|
|
@ -269,10 +273,16 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
.map(list -> list.get(0)) |
|
|
|
|
.orElseThrow(() -> new RuntimeException("未查询到" + departDto.getParentName() + "的外部部门信息")); |
|
|
|
|
|
|
|
|
|
MailQueryParam mailQueryParam = new MailQueryParam(); |
|
|
|
|
mailQueryParam.setSecondDeptId(depart.getExternalId()); |
|
|
|
|
mailQueryParam.setCreateTime(dates); |
|
|
|
|
long mailCount = mailResourceService.count(mailQueryParam); |
|
|
|
|
// MailQueryParam mailQueryParam = new MailQueryParam();
|
|
|
|
|
// mailQueryParam.setSecondDeptId(depart.getExternalId());
|
|
|
|
|
// mailQueryParam.setMailTime(dates);
|
|
|
|
|
// long mailCount = mailResourceService.count(mailQueryParam);
|
|
|
|
|
|
|
|
|
|
QueryWrapper<Mail> mailQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
mailQueryWrapper.ne("mail_state", VALID_SIGN); |
|
|
|
|
mailQueryWrapper.between("mail_time", request.getBeginTime(), request.getEndTime()); |
|
|
|
|
mailQueryWrapper.in("second_dept_id", depart.getExternalId()); |
|
|
|
|
long mailCount = mailMapper.selectCount(mailQueryWrapper); |
|
|
|
|
|
|
|
|
|
globalMapIconVo.setSupervisionPro(supervisionProCount); |
|
|
|
|
globalMapIconVo.setNumSupervisionPro(numSupervisionProCount); |
|
|
|
|
@ -369,15 +379,22 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
ajhcQueryParam.setCreateTime(dates); |
|
|
|
|
long ajhcCount = dataCaseVerifResourceService.count(ajhcQueryParam); |
|
|
|
|
// 局长信箱
|
|
|
|
|
MailQueryParam mailQueryParam = new MailQueryParam(); |
|
|
|
|
mailQueryParam.setCreateTime(dates); |
|
|
|
|
long jzxxCount = mailResourceService.count(mailQueryParam); |
|
|
|
|
QueryWrapper<Mail> mailQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
mailQueryWrapper.ne("mail_state", VALID_SIGN); |
|
|
|
|
mailQueryWrapper.between("mail_time", request.getBeginTime(), request.getEndTime()); |
|
|
|
|
long jzxxCount = mailMapper.selectCount(mailQueryWrapper); |
|
|
|
|
|
|
|
|
|
// 12337
|
|
|
|
|
NegativeQueryParam xf12337Param = new NegativeQueryParam(); |
|
|
|
|
xf12337Param.setCrtTime(dates); |
|
|
|
|
xf12337Param.setProblemSourcesCode(Collections.singletonList(ProblemSourcesEnum.XF12337.getValue())); |
|
|
|
|
long xf12337Count = negativeResourceService.count(xf12337Param); |
|
|
|
|
// NegativeQueryParam xf12337Param = new NegativeQueryParam();
|
|
|
|
|
// xf12337Param.setCrtTime(dates);
|
|
|
|
|
// xf12337Param.setProblemSourcesCode(Collections.singletonList(ProblemSourcesEnum.XF12337.getValue()));
|
|
|
|
|
// long xf12337Count = negativeResourceService.count(xf12337Param);
|
|
|
|
|
|
|
|
|
|
QueryWrapper<DataPetition12337> queryWrapper12337 = new QueryWrapper<>(); |
|
|
|
|
queryWrapper12337.between("discover_time", request.getBeginTime(), request.getEndTime()); |
|
|
|
|
long xf12337Count = dataPetition12337Mapper.selectCount(queryWrapper12337); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 国家信访
|
|
|
|
|
DataPetitionComplaintQueryParam countryParam = new DataPetitionComplaintQueryParam(); |
|
|
|
|
countryParam.setCreateTime(dates); |
|
|
|
|
@ -423,14 +440,18 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
// region 案件核查
|
|
|
|
|
@Override |
|
|
|
|
public Result<JSONObject> getAllCaseVerificationCount(DataVRequest request) { |
|
|
|
|
// 交办
|
|
|
|
|
Set<String> ldjbCode = Set.of(SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); |
|
|
|
|
CaseVerificationCountVo overview = new CaseVerificationCountVo(); |
|
|
|
|
LambdaQueryWrapper<DataCaseVerif> dataCaseVerifLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
dataCaseVerifLambdaQueryWrapper.between(DataCaseVerif::getCreateTime, request.getBeginTime(), request.getEndTime()); |
|
|
|
|
List<DataCaseVerif> dataCaseVerifs = dataCaseVerifMapper.selectList(dataCaseVerifLambdaQueryWrapper); |
|
|
|
|
NegativeQueryParam negativeQueryParam = new NegativeQueryParam(); |
|
|
|
|
negativeQueryParam.setCrtTime(List.of(request.getBeginTime(), request.getEndTime())); |
|
|
|
|
negativeQueryParam.setProblemSourcesCode(List.of(A12389.getValue())); |
|
|
|
|
negativeQueryParam.setProblemSourcesCode(List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue())); |
|
|
|
|
List<Negative> negatives = negativeResourceService.query(negativeQueryParam); |
|
|
|
|
// 交办案件数
|
|
|
|
|
List<Negative> jbNegatvieList = negatives.stream().filter(one -> ldjbCode.contains(one.getProblemSourcesCode())).toList(); |
|
|
|
|
// 属实问题
|
|
|
|
|
List<Negative> ssNegative = negatives.stream() |
|
|
|
|
.filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); |
|
|
|
|
@ -462,10 +483,10 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
//计算查实率(向上取整)
|
|
|
|
|
Double verificationRate = 0.0; |
|
|
|
|
if (!dataCaseVerifs.isEmpty()) { |
|
|
|
|
double rawRate = (double) ssNegative.size() / dataCaseVerifs.size() * 100; |
|
|
|
|
double rawRate = (double) ssNegative.size() / (dataCaseVerifs.size() + jbNegatvieList.size()) * 100; |
|
|
|
|
verificationRate = Math.round(rawRate * 10) / 10.0; |
|
|
|
|
} |
|
|
|
|
overview.setTotal(dataCaseVerifs.size()); |
|
|
|
|
overview.setTotal(dataCaseVerifs.size() + jbNegatvieList.size()); |
|
|
|
|
overview.setConfirmed(ssNegative.size()); |
|
|
|
|
overview.setDealCasePro((long) negatives.size()); |
|
|
|
|
overview.setPunishPre((long) (personalBlames.size() + leadBlames.size())); |
|
|
|
|
@ -1105,7 +1126,7 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
List<Negative> negativeList = negativeMapper.getChangedRank(fxsj.getId(), request.getBeginTime(), request.getEndTime()); |
|
|
|
|
// 问题数
|
|
|
|
|
int totalPro = negativeList.size(); |
|
|
|
|
if (totalPro==0){ |
|
|
|
|
if (totalPro == 0) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
// 办结数
|
|
|
|
|
@ -1686,7 +1707,7 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Result<JSONObject> getCaseVerificationRank(DataVRequest request) { |
|
|
|
|
List<String> proCode = List.of(A12389.getValue()); |
|
|
|
|
List<String> proCode = List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); |
|
|
|
|
SupDepartQueryParam supDepartQueryParam = new SupDepartQueryParam(); |
|
|
|
|
supDepartQueryParam.setStatisticsGroupId(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId()); |
|
|
|
|
List<SupDepart> fxsjDw = supDepartResourceService.query(supDepartQueryParam); |
|
|
|
|
@ -1736,10 +1757,15 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Result<JSONObject> getCaseVerificationMap(DataVRequest request) { |
|
|
|
|
|
|
|
|
|
// 交办
|
|
|
|
|
Set<String> ldjbCode = Set.of(SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SupDepartQueryParam supDepartQueryParam = new SupDepartQueryParam(); |
|
|
|
|
supDepartQueryParam.setStatisticsGroupId(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId()); |
|
|
|
|
List<SupDepart> fxsjDw = supDepartResourceService.query(supDepartQueryParam); |
|
|
|
|
List<String> proCode = List.of(A12389.getValue()); |
|
|
|
|
List<String> proCode = List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); |
|
|
|
|
|
|
|
|
|
List<CaseVerificationMapVo> caseVerificationMapList = new ArrayList<>(); |
|
|
|
|
for (SupDepart fxsj : fxsjDw) { |
|
|
|
|
@ -1748,6 +1774,8 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
List<DataCaseVerif> dataCaseVerifs = dataCaseVerifMapper.getListData(fxsj.getId(), request.getBeginTime(), request.getEndTime()); |
|
|
|
|
List<Negative> negatives = negativeMapper.getNegativeListData(fxsj.getId(), request.getBeginTime(), request.getEndTime(), proCode); |
|
|
|
|
List<Negative> ssNegative = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); |
|
|
|
|
// 交办案件数
|
|
|
|
|
List<Negative> jbNegatvieList = negatives.stream().filter(one -> ldjbCode.contains(one.getProblemSourcesCode())).toList(); |
|
|
|
|
NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam(); |
|
|
|
|
negativeBlameQueryParam.setNegativeIds(ssNegative.stream().map(Negative::getId).toList()); |
|
|
|
|
List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(negativeBlameQueryParam); |
|
|
|
|
@ -1776,13 +1804,13 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
|
|
|
|
|
Double verificationRate = 0.0; |
|
|
|
|
if (!dataCaseVerifs.isEmpty()) { |
|
|
|
|
double rawRate = (double) ssNegative.size() / dataCaseVerifs.size() * 100; |
|
|
|
|
double rawRate = (double) ssNegative.size() / (dataCaseVerifs.size() + jbNegatvieList.size()) * 100; |
|
|
|
|
verificationRate = Math.round(rawRate * 10) / 10.0; |
|
|
|
|
} |
|
|
|
|
CaseVerificationMapVo caseVerificationMapVo = new CaseVerificationMapVo(); |
|
|
|
|
caseVerificationMapVo.setName(fxsj.getShortName()); |
|
|
|
|
caseVerificationMapVo.setDepartId(fxsj.getId()); |
|
|
|
|
caseVerificationMapVo.setTotal(dataCaseVerifs.size()); |
|
|
|
|
caseVerificationMapVo.setTotal(dataCaseVerifs.size() + jbNegatvieList.size()); |
|
|
|
|
caseVerificationMapVo.setConfirmed(ssNegative.size()); |
|
|
|
|
caseVerificationMapVo.setDealCasePro(negatives.size()); |
|
|
|
|
caseVerificationMapVo.setPunishPre(personalBlames.size() + leadBlames.size()); |
|
|
|
|
@ -1794,6 +1822,313 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
return Result.success(res); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Result<JSONObject> getCaseSourceRateAndDealSituation(DataVRequest request) { |
|
|
|
|
|
|
|
|
|
List<EchartsVo> caseSourceRateList = new ArrayList<>(); |
|
|
|
|
List<EchartsVo> dealSituationPieList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
// 交办
|
|
|
|
|
Set<String> ldjbCode = Set.of(SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); |
|
|
|
|
LambdaQueryWrapper<DataCaseVerif> dataCaseVerifLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
dataCaseVerifLambdaQueryWrapper.between(DataCaseVerif::getCreateTime, request.getBeginTime(), request.getEndTime()); |
|
|
|
|
List<DataCaseVerif> dataCaseVerifs = dataCaseVerifMapper.selectList(dataCaseVerifLambdaQueryWrapper); |
|
|
|
|
NegativeQueryParam negativeQueryParam = new NegativeQueryParam(); |
|
|
|
|
negativeQueryParam.setCrtTime(List.of(request.getBeginTime(), request.getEndTime())); |
|
|
|
|
negativeQueryParam.setProblemSourcesCode(List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue())); |
|
|
|
|
List<Negative> negatives = negativeResourceService.query(negativeQueryParam); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 案件来源占比
|
|
|
|
|
// 1、找到案件核查案件数
|
|
|
|
|
caseSourceRateList.add(new EchartsVo("12389投诉", dataCaseVerifs.size())); |
|
|
|
|
// 2、找交办案件数
|
|
|
|
|
Map<String, List<Negative>> groupedByProblemSource = negatives.stream() |
|
|
|
|
.filter(one -> StrUtil.isNotBlank(one.getProblemSourcesCode())) |
|
|
|
|
.filter(one -> StrUtil.isNotBlank(one.getProblemSources())) |
|
|
|
|
.filter(one -> ldjbCode.contains(one.getProblemSourcesCode())) |
|
|
|
|
.collect(Collectors.groupingBy(Negative::getProblemSources)); |
|
|
|
|
for (Map.Entry<String, List<Negative>> entry : groupedByProblemSource.entrySet()) { |
|
|
|
|
EchartsVo echartsVo = new EchartsVo(); |
|
|
|
|
echartsVo.setName(entry.getKey()); |
|
|
|
|
echartsVo.setValue(entry.getValue().size()); |
|
|
|
|
caseSourceRateList.add(echartsVo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 问责处理情况
|
|
|
|
|
List<Negative> ssNegative = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); |
|
|
|
|
NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam(); |
|
|
|
|
negativeBlameQueryParam.setNegativeIds(ssNegative.stream().map(Negative::getId).toList()); |
|
|
|
|
List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(negativeBlameQueryParam); |
|
|
|
|
Map<String, List<NegativeBlame>> blames = negativeBlames.stream() |
|
|
|
|
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName())) |
|
|
|
|
.filter(one -> !"不予追责".equals(one.getHandleResultName())) |
|
|
|
|
.collect(Collectors.groupingBy(NegativeBlame::getHandleResultName)); |
|
|
|
|
for (Map.Entry<String, List<NegativeBlame>> entry : blames.entrySet()) { |
|
|
|
|
EchartsVo echartsVo = new EchartsVo(); |
|
|
|
|
echartsVo.setName(entry.getKey()); |
|
|
|
|
echartsVo.setValue(entry.getValue().size()); |
|
|
|
|
dealSituationPieList.add(echartsVo); |
|
|
|
|
} |
|
|
|
|
// 过滤0
|
|
|
|
|
caseSourceRateList = filterZero(caseSourceRateList); |
|
|
|
|
dealSituationPieList = filterZero(dealSituationPieList); |
|
|
|
|
JSONObject data = new JSONObject() |
|
|
|
|
.fluentPut("caseSourceRateList", caseSourceRateList) |
|
|
|
|
.fluentPut("dealSituationPieList", dealSituationPieList); |
|
|
|
|
return Result.success(data); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Result<JSONObject> getSubOneCaseVerificationRank(SubDataVRequest request) { |
|
|
|
|
|
|
|
|
|
List<String> proCode = List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); |
|
|
|
|
List<SupDepart> level3ByPidSupDepartList = supDepartResourceService.getLevel3ByPidSupDepartList(request.getDepartId()); |
|
|
|
|
// 派出所
|
|
|
|
|
List<SupDepart> pcsList = level3ByPidSupDepartList.stream() |
|
|
|
|
.filter(one -> StrUtil.isNotBlank(one.getStatisticsGroupId())) |
|
|
|
|
.filter(one -> DepartGroupEnum.PCS.getId().equals(Integer.valueOf(one.getStatisticsGroupId()))) |
|
|
|
|
.toList(); |
|
|
|
|
// 大队
|
|
|
|
|
List<SupDepart> dwList = level3ByPidSupDepartList.stream() |
|
|
|
|
.filter(one -> { |
|
|
|
|
String groupId = one.getStatisticsGroupId(); |
|
|
|
|
return !StrUtil.isNotBlank(groupId) |
|
|
|
|
|| !DepartGroupEnum.PCS.getId().equals(Integer.valueOf(groupId)); |
|
|
|
|
}) |
|
|
|
|
.toList(); |
|
|
|
|
List<OrganizeProblemRankVo> fxsjRankList = new ArrayList<>(); |
|
|
|
|
List<OrganizeProblemRankVo> jsdwRankList = new ArrayList<>(); |
|
|
|
|
for (SupDepart pcs : pcsList) { |
|
|
|
|
List<Negative> negatives = negativeMapper.getNegativeListData(pcs.getId(), request.getBeginTime(), request.getEndTime(), proCode); |
|
|
|
|
if (CollectionUtil.isEmpty(negatives)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
OrganizeProblemRankVo organizeProblemRankVo = new OrganizeProblemRankVo(); |
|
|
|
|
organizeProblemRankVo.setLabel(pcs.getShortName()); |
|
|
|
|
organizeProblemRankVo.setValue(String.valueOf(negatives.size())); |
|
|
|
|
fxsjRankList.add(organizeProblemRankVo); |
|
|
|
|
} |
|
|
|
|
for (SupDepart dw : dwList) { |
|
|
|
|
List<Negative> negatives = negativeMapper.getNegativeListData(dw.getId(), request.getBeginTime(), request.getEndTime(), proCode); |
|
|
|
|
if (CollectionUtil.isEmpty(negatives)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
OrganizeProblemRankVo organizeProblemRankVo = new OrganizeProblemRankVo(); |
|
|
|
|
organizeProblemRankVo.setLabel(dw.getShortName()); |
|
|
|
|
organizeProblemRankVo.setValue(String.valueOf(negatives.size())); |
|
|
|
|
jsdwRankList.add(organizeProblemRankVo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 排序
|
|
|
|
|
fxsjRankList.sort( |
|
|
|
|
Comparator.comparingLong((OrganizeProblemRankVo vo) -> Long.parseLong(vo.getValue())) |
|
|
|
|
.reversed() |
|
|
|
|
); |
|
|
|
|
jsdwRankList.sort( |
|
|
|
|
Comparator.comparingLong((OrganizeProblemRankVo vo) -> Long.parseLong(vo.getValue())) |
|
|
|
|
.reversed() |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
JSONObject data = new JSONObject() |
|
|
|
|
.fluentPut("fxsjRankList", fxsjRankList) |
|
|
|
|
.fluentPut("jsdwRankList", jsdwRankList); |
|
|
|
|
return Result.success(data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Result<JSONObject> getSubOneAllCaseVerificationCount(SubDataVRequest request) { |
|
|
|
|
// 交办
|
|
|
|
|
Set<String> ldjbCode = Set.of(SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); |
|
|
|
|
|
|
|
|
|
List<String> proCode = List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); |
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<DataCaseVerif> dataCaseVerifLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
dataCaseVerifLambdaQueryWrapper.between(DataCaseVerif::getCreateTime, request.getBeginTime(), request.getEndTime()); |
|
|
|
|
List<DataCaseVerif> dataCaseVerifs = dataCaseVerifMapper.getListData(request.getDepartId(), request.getBeginTime(), request.getEndTime()); |
|
|
|
|
List<Negative> negatives = negativeMapper.getNegativeListData(request.getDepartId(), request.getBeginTime(), request.getEndTime(), proCode); |
|
|
|
|
List<Negative> ssNegative = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); |
|
|
|
|
// 交办案件数
|
|
|
|
|
List<Negative> jbNegatvieList = negatives.stream().filter(one -> ldjbCode.contains(one.getProblemSourcesCode())).toList(); |
|
|
|
|
NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam(); |
|
|
|
|
negativeBlameQueryParam.setNegativeIds(ssNegative.stream().map(Negative::getId).toList()); |
|
|
|
|
List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(negativeBlameQueryParam); |
|
|
|
|
|
|
|
|
|
// 3. 个人问责
|
|
|
|
|
List<NegativeBlame> personalBlames = negativeBlames.stream() |
|
|
|
|
.filter(one -> BlameType.personal.name().equals(one.getType())) |
|
|
|
|
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName())) |
|
|
|
|
.filter(one -> !"不予追责".equals(one.getHandleResultName())) |
|
|
|
|
.toList(); |
|
|
|
|
// 4. 领导问责(按 negativeId + 领导姓名 + 领导处理结果 去重)
|
|
|
|
|
Set<String> seenLead = new HashSet<>(); |
|
|
|
|
List<NegativeBlame> leadBlames = negativeBlames.stream() |
|
|
|
|
.filter(one -> StrUtil.isNotBlank(one.getLeadHandleResultName())) |
|
|
|
|
.filter(one -> !"不予追责".equals(one.getLeadHandleResultName())) |
|
|
|
|
.filter(one -> seenLead.add( |
|
|
|
|
one.getNegativeId() + "_" + one.getLeadHandleResultName() + "_" + one.getLeadName() |
|
|
|
|
)) |
|
|
|
|
.toList(); |
|
|
|
|
// 5. 单位问责
|
|
|
|
|
List<NegativeBlame> unitBlames = negativeBlames.stream() |
|
|
|
|
.filter(one -> BlameType.department.name().equals(one.getType())) |
|
|
|
|
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName())) |
|
|
|
|
.filter(one -> !"不予追责".equals(one.getHandleResultName())) |
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
Double verificationRate = 0.0; |
|
|
|
|
if (!dataCaseVerifs.isEmpty()) { |
|
|
|
|
double rawRate = (double) ssNegative.size() / (dataCaseVerifs.size() + jbNegatvieList.size()) * 100; |
|
|
|
|
verificationRate = Math.round(rawRate * 10) / 10.0; |
|
|
|
|
} |
|
|
|
|
CaseVerificationCountVo overview = new CaseVerificationCountVo(); |
|
|
|
|
overview.setTotal(dataCaseVerifs.size() + jbNegatvieList.size()); |
|
|
|
|
overview.setConfirmed(ssNegative.size()); |
|
|
|
|
overview.setDealCasePro((long) negatives.size()); |
|
|
|
|
overview.setPunishPre((long) (personalBlames.size() + leadBlames.size())); |
|
|
|
|
overview.setPunishOrg((long) unitBlames.size()); |
|
|
|
|
overview.setRate(verificationRate); |
|
|
|
|
JSONObject res = new JSONObject().fluentPut("overview", overview); |
|
|
|
|
return Result.success(res); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Result<JSONObject> getSubOneCaseVerificationMap(SubDataVRequest request) { |
|
|
|
|
|
|
|
|
|
// 交办
|
|
|
|
|
Set<String> ldjbCode = Set.of(SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); |
|
|
|
|
List<String> proCode = List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); |
|
|
|
|
// 查该区县局下属所有派出所
|
|
|
|
|
List<SupDepart> policeDeparts = supDepartMapper.selectPoliceDeparts(Integer.valueOf(request.getDepartId())); |
|
|
|
|
List<CaseVerificationMapVo> caseVerificationMapList = new ArrayList<>(); |
|
|
|
|
for (SupDepart pcs : policeDeparts) { |
|
|
|
|
// 案件核查
|
|
|
|
|
LambdaQueryWrapper<DataCaseVerif> dataCaseVerifLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
dataCaseVerifLambdaQueryWrapper.between(DataCaseVerif::getCreateTime, request.getBeginTime(), request.getEndTime()); |
|
|
|
|
dataCaseVerifLambdaQueryWrapper.eq(DataCaseVerif::getThirdDepartId, pcs.getId()); |
|
|
|
|
List<DataCaseVerif> dataCaseVerifs = dataCaseVerifMapper.selectList(dataCaseVerifLambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
// 所有查处数据
|
|
|
|
|
List<Negative> negatives = negativeMapper.getNegativeListData(pcs.getId(), request.getBeginTime(), request.getEndTime(), proCode); |
|
|
|
|
// 交办案件数
|
|
|
|
|
List<Negative> jbNegatvieList = negatives.stream().filter(one -> ldjbCode.contains(one.getProblemSourcesCode())).toList(); |
|
|
|
|
// 问责情况
|
|
|
|
|
List<Negative> ssNegative = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); |
|
|
|
|
NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam(); |
|
|
|
|
negativeBlameQueryParam.setNegativeIds(ssNegative.stream().map(Negative::getId).toList()); |
|
|
|
|
List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(negativeBlameQueryParam); |
|
|
|
|
|
|
|
|
|
// 3. 个人问责
|
|
|
|
|
List<NegativeBlame> personalBlames = negativeBlames.stream() |
|
|
|
|
.filter(one -> BlameType.personal.name().equals(one.getType())) |
|
|
|
|
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName())) |
|
|
|
|
.filter(one -> !"不予追责".equals(one.getHandleResultName())) |
|
|
|
|
.toList(); |
|
|
|
|
// 4. 领导问责(按 negativeId + 领导姓名 + 领导处理结果 去重)
|
|
|
|
|
Set<String> seenLead = new HashSet<>(); |
|
|
|
|
List<NegativeBlame> leadBlames = negativeBlames.stream() |
|
|
|
|
.filter(one -> StrUtil.isNotBlank(one.getLeadHandleResultName())) |
|
|
|
|
.filter(one -> !"不予追责".equals(one.getLeadHandleResultName())) |
|
|
|
|
.filter(one -> seenLead.add( |
|
|
|
|
one.getNegativeId() + "_" + one.getLeadHandleResultName() + "_" + one.getLeadName() |
|
|
|
|
)) |
|
|
|
|
.toList(); |
|
|
|
|
// 5. 单位问责
|
|
|
|
|
List<NegativeBlame> unitBlames = negativeBlames.stream() |
|
|
|
|
.filter(one -> BlameType.department.name().equals(one.getType())) |
|
|
|
|
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName())) |
|
|
|
|
.filter(one -> !"不予追责".equals(one.getHandleResultName())) |
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
int totalCaseCount = dataCaseVerifs.size() + jbNegatvieList.size(); |
|
|
|
|
double verificationRate = 0.0; |
|
|
|
|
if (totalCaseCount > 0) { |
|
|
|
|
double rawRate = (double) ssNegative.size() / totalCaseCount * 100; |
|
|
|
|
verificationRate = Math.round(rawRate * 10) / 10.0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
CaseVerificationMapVo caseVerificationMapVo = new CaseVerificationMapVo(); |
|
|
|
|
caseVerificationMapVo.setName(pcs.getShortName()); |
|
|
|
|
caseVerificationMapVo.setDepartId(pcs.getId()); |
|
|
|
|
caseVerificationMapVo.setTotal(dataCaseVerifs.size() + jbNegatvieList.size()); |
|
|
|
|
caseVerificationMapVo.setConfirmed(ssNegative.size()); |
|
|
|
|
caseVerificationMapVo.setDealCasePro(negatives.size()); |
|
|
|
|
caseVerificationMapVo.setPunishPre(personalBlames.size() + leadBlames.size()); |
|
|
|
|
caseVerificationMapVo.setPunishOrg(unitBlames.size()); |
|
|
|
|
caseVerificationMapVo.setRate(verificationRate); |
|
|
|
|
caseVerificationMapList.add(caseVerificationMapVo); |
|
|
|
|
} |
|
|
|
|
caseVerificationMapList.forEach(CaseVerificationMapVo::initDefaultIfNull); |
|
|
|
|
JSONObject res = new JSONObject().fluentPut("caseVerificationMapList", caseVerificationMapList); |
|
|
|
|
return Result.success(res); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Result<JSONObject> getSubOneCaseSourceRateAndDealSituation(SubDataVRequest request) { |
|
|
|
|
List<EchartsVo> caseSourceRateList = new ArrayList<>(); |
|
|
|
|
List<EchartsVo> dealSituationPieList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
// 总
|
|
|
|
|
List<String> proCode = List.of(A12389.getValue(),SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); |
|
|
|
|
// 交办
|
|
|
|
|
Set<String> ldjbCode = Set.of(SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); |
|
|
|
|
// 案件核查 || 12389
|
|
|
|
|
List<DataCaseVerif> dataCaseVerifs = dataCaseVerifMapper.getListData(request.getDepartId(), request.getBeginTime(), request.getEndTime()); |
|
|
|
|
// 交办
|
|
|
|
|
List<Negative> negatives = negativeMapper.getNegativeListData(request.getDepartId(), request.getBeginTime(), request.getEndTime(), proCode); |
|
|
|
|
|
|
|
|
|
// 案件来源占比
|
|
|
|
|
// 1、找到案件核查案件数
|
|
|
|
|
caseSourceRateList.add(new EchartsVo("12389投诉", dataCaseVerifs.size())); |
|
|
|
|
// 2、找交办案件数
|
|
|
|
|
Map<String, List<Negative>> groupedByProblemSource = negatives.stream() |
|
|
|
|
.filter(one -> StrUtil.isNotBlank(one.getProblemSourcesCode())) |
|
|
|
|
.filter(one -> StrUtil.isNotBlank(one.getProblemSources())) |
|
|
|
|
.filter(one -> ldjbCode.contains(one.getProblemSourcesCode())) |
|
|
|
|
.collect(Collectors.groupingBy(Negative::getProblemSources)); |
|
|
|
|
for (Map.Entry<String, List<Negative>> entry : groupedByProblemSource.entrySet()) { |
|
|
|
|
EchartsVo echartsVo = new EchartsVo(); |
|
|
|
|
echartsVo.setName(entry.getKey()); |
|
|
|
|
echartsVo.setValue(entry.getValue().size()); |
|
|
|
|
caseSourceRateList.add(echartsVo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 问责处理情况
|
|
|
|
|
List<Negative> ssNegative = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); |
|
|
|
|
NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam(); |
|
|
|
|
negativeBlameQueryParam.setNegativeIds(ssNegative.stream().map(Negative::getId).toList()); |
|
|
|
|
List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(negativeBlameQueryParam); |
|
|
|
|
Map<String, List<NegativeBlame>> blames = negativeBlames.stream() |
|
|
|
|
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName())) |
|
|
|
|
.filter(one -> !"不予追责".equals(one.getHandleResultName())) |
|
|
|
|
.collect(Collectors.groupingBy(NegativeBlame::getHandleResultName)); |
|
|
|
|
for (Map.Entry<String, List<NegativeBlame>> entry : blames.entrySet()) { |
|
|
|
|
EchartsVo echartsVo = new EchartsVo(); |
|
|
|
|
echartsVo.setName(entry.getKey()); |
|
|
|
|
echartsVo.setValue(entry.getValue().size()); |
|
|
|
|
dealSituationPieList.add(echartsVo); |
|
|
|
|
} |
|
|
|
|
// 过滤0
|
|
|
|
|
caseSourceRateList = filterZero(caseSourceRateList); |
|
|
|
|
dealSituationPieList = filterZero(dealSituationPieList); |
|
|
|
|
|
|
|
|
|
JSONObject data = new JSONObject() |
|
|
|
|
.fluentPut("caseSourceRateList", caseSourceRateList) |
|
|
|
|
.fluentPut("dealSituationPieList", dealSituationPieList); |
|
|
|
|
return Result.success(data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private List<EchartsVo> filterZero(List<EchartsVo> list) { |
|
|
|
|
return list.stream() |
|
|
|
|
.filter(e -> e.getValue() != null && e.getValue() > 0) |
|
|
|
|
.toList(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Result<JSONObject> getSubOneMailMapIcon() { |
|
|
|
|
|
|
|
|
|
// ✅ 注意:这里的 name 必须和地图 geojson 区域名一致(一般是“xx街道/园区”)
|
|
|
|
|
|