|
|
|
|
@ -1,9 +1,12 @@
|
|
|
|
|
package com.biutag.supervision.service.datav; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
|
import cn.hutool.core.util.NumberUtil; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.biutag.supervision.constants.enums.BlameType; |
|
|
|
|
import com.biutag.supervision.constants.enums.DepartGroupEnum; |
|
|
|
|
import com.biutag.supervision.constants.enums.InspectCaseEnum; |
|
|
|
|
import com.biutag.supervision.constants.enums.ProblemSourcesEnum; |
|
|
|
|
import com.biutag.supervision.constants.enums.invest.DeleteStatusEnum; |
|
|
|
|
import com.biutag.supervision.pojo.Result; |
|
|
|
|
@ -11,13 +14,11 @@ import com.biutag.supervision.pojo.dto.DepartAndSubDepartDto;
|
|
|
|
|
import com.biutag.supervision.pojo.entity.Negative; |
|
|
|
|
import com.biutag.supervision.pojo.entity.NegativeBlame; |
|
|
|
|
import com.biutag.supervision.pojo.entity.SupExternalDepart; |
|
|
|
|
import com.biutag.supervision.pojo.entity.SupPolice; |
|
|
|
|
import com.biutag.supervision.pojo.entity.report.ReportProject; |
|
|
|
|
import com.biutag.supervision.pojo.param.*; |
|
|
|
|
import com.biutag.supervision.pojo.request.datav.DataVRequest; |
|
|
|
|
import com.biutag.supervision.pojo.vo.AuditSuperviseMapIconVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.GlobalMapIconVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.GlobalOverViewVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.*; |
|
|
|
|
import com.biutag.supervision.repository.dataCaseVerif.DataCaseVerifResourceService; |
|
|
|
|
import com.biutag.supervision.repository.dataPetitionComplaint.DataPetitionComplaintResourceService; |
|
|
|
|
import com.biutag.supervision.repository.mail.MailResourceService; |
|
|
|
|
@ -26,6 +27,7 @@ import com.biutag.supervision.repository.reportproject.ReportProjectResourceServ
|
|
|
|
|
import com.biutag.supervision.repository.supExternalDepart.SupExternalDepartResourceService; |
|
|
|
|
import com.biutag.supervision.repository.supdepart.SupDepartResourceService; |
|
|
|
|
import com.biutag.supervision.service.NegativeBlameService; |
|
|
|
|
import com.biutag.supervision.service.SupPoliceService; |
|
|
|
|
import jakarta.annotation.Resource; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
@ -33,6 +35,8 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @ClassName DatavServiceImpl |
|
|
|
|
* @Description DatavServiceImpl |
|
|
|
|
@ -67,6 +71,9 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
@Resource |
|
|
|
|
private DataCaseVerifResourceService dataCaseVerifResourceService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private SupPoliceService supPoliceService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Result<JSONObject> getAuditMap(DataVRequest request) { |
|
|
|
|
List<AuditSuperviseMapIconVo> auditSuperviseMapIconVoList = new ArrayList<>(); |
|
|
|
|
@ -125,6 +132,7 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取一级首页的地图数据 |
|
|
|
|
* |
|
|
|
|
* @param request |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@ -219,6 +227,7 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取一级首页的机构问题排名 |
|
|
|
|
* |
|
|
|
|
* @param request |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@ -274,6 +283,7 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取一级首页中间总览数据 |
|
|
|
|
* |
|
|
|
|
* @param request |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@ -348,5 +358,56 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
return supDepartResourceService.getDepartAndSubDepart(supDepartGroupParam); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// region 案件核查
|
|
|
|
|
@Override |
|
|
|
|
public Result<JSONObject> getAllCaseVerificationCount(DataVRequest request) { |
|
|
|
|
CaseVerificationCountVo overview = new CaseVerificationCountVo(); |
|
|
|
|
List<Date> timeRange = List.of(request.getBeginTime(), request.getEndTime()); |
|
|
|
|
// 总案件数
|
|
|
|
|
DataCaseVerifQueryParam dataCaseVerifQueryParam = new DataCaseVerifQueryParam(); |
|
|
|
|
dataCaseVerifQueryParam.setCreateTime(timeRange); |
|
|
|
|
long total = dataCaseVerifResourceService.count(dataCaseVerifQueryParam); |
|
|
|
|
// 查处问题数
|
|
|
|
|
NegativeQueryParam negativeQueryParam = new NegativeQueryParam(); |
|
|
|
|
negativeQueryParam.setCrtTime(timeRange); |
|
|
|
|
negativeQueryParam.setProblemSourcesCode(List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue())); |
|
|
|
|
List<Negative> negatives = negativeResourceService.query(negativeQueryParam); |
|
|
|
|
int dealCasePro = negatives.size(); |
|
|
|
|
// 查实案件数
|
|
|
|
|
Set<String> trueValue = Set.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()); |
|
|
|
|
long confirmed = negatives.stream() |
|
|
|
|
.map(Negative::getCheckStatus) |
|
|
|
|
.filter(Objects::nonNull) |
|
|
|
|
.filter(trueValue::contains) |
|
|
|
|
.count(); |
|
|
|
|
// 查实率
|
|
|
|
|
double rate = total == 0 ? 0D : NumberUtil.round((double) confirmed / total * 100, 0).doubleValue(); |
|
|
|
|
// 问责人次 和问责单位数
|
|
|
|
|
if (negatives.isEmpty()) { |
|
|
|
|
overview.setPunishOrg(0L); |
|
|
|
|
overview.setPunishPre(0L); |
|
|
|
|
} else { |
|
|
|
|
List<NegativeBlame> blames = negativeBlameService.list(new LambdaQueryWrapper<NegativeBlame>() |
|
|
|
|
.in(NegativeBlame::getNegativeId, negatives.stream().map(Negative::getId).toList()) |
|
|
|
|
.isNotNull(NegativeBlame::getHandleResultCode) |
|
|
|
|
.ne(NegativeBlame::getHandleResultCode, "") |
|
|
|
|
.ne(NegativeBlame::getHandleResultName, "不予追责")); |
|
|
|
|
List<NegativeBlame> departBlames = blames.stream().filter(item -> BlameType.department.name().equals(item.getType())).toList(); |
|
|
|
|
log.info("问责单位 数量:{}", departBlames.size()); |
|
|
|
|
if (departBlames.isEmpty()) { |
|
|
|
|
overview.setPunishOrg(0L); |
|
|
|
|
} else { |
|
|
|
|
log.info("问责单位 领导警号集合:{}", departBlames.stream().map(NegativeBlame::getBlameEmpNo).collect(Collectors.toSet())); |
|
|
|
|
long count = supPoliceService.count(new LambdaQueryWrapper<SupPolice>().in(SupPolice::getEmpNo, departBlames.stream().map(NegativeBlame::getBlameEmpNo).collect(Collectors.toSet()))); |
|
|
|
|
overview.setPunishOrg(count); |
|
|
|
|
} |
|
|
|
|
overview.setPunishPre(blames.stream().filter(item -> BlameType.personal.name().equals(item.getType())).count()); |
|
|
|
|
} |
|
|
|
|
overview.setTotal((int) total); |
|
|
|
|
overview.setConfirmed((int) confirmed); |
|
|
|
|
overview.setDealCasePro((long) dealCasePro); |
|
|
|
|
overview.setRate(rate); |
|
|
|
|
JSONObject res = new JSONObject().fluentPut("overview", overview); |
|
|
|
|
return Result.success(res); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|