|
|
|
|
@ -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 |
|
|
|
|
*/ |
|
|
|
|
@ -197,7 +205,7 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
.ofNullable(supExternalDepartList) |
|
|
|
|
.filter(list -> !list.isEmpty()) |
|
|
|
|
.map(list -> list.get(0)) |
|
|
|
|
.orElseThrow(() -> new RuntimeException("未查询到"+departDto.getParentName()+"的外部部门信息")); |
|
|
|
|
.orElseThrow(() -> new RuntimeException("未查询到" + departDto.getParentName() + "的外部部门信息")); |
|
|
|
|
|
|
|
|
|
MailQueryParam mailQueryParam = new MailQueryParam(); |
|
|
|
|
mailQueryParam.setSecondDeptId(depart.getExternalId()); |
|
|
|
|
@ -207,7 +215,7 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
globalMapIconVo.setSupervisionPro(supervisionProCount); |
|
|
|
|
globalMapIconVo.setNumSupervisionPro(numSupervisionProCount); |
|
|
|
|
globalMapIconVo.setCaseVerificationPro(caseVerificationProCount); |
|
|
|
|
globalMapIconVo.setComplaintPro(xf12337Count+countryMail+policeMail); |
|
|
|
|
globalMapIconVo.setComplaintPro(xf12337Count + countryMail + policeMail); |
|
|
|
|
globalMapIconVo.setAuditPro(reportProjectCount); |
|
|
|
|
globalMapIconVo.setMailboxNumber(mailCount); |
|
|
|
|
globalMapIconVo.calcTotal(); |
|
|
|
|
@ -219,6 +227,7 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取一级首页的机构问题排名 |
|
|
|
|
* |
|
|
|
|
* @param request |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@ -274,6 +283,7 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取一级首页中间总览数据 |
|
|
|
|
* |
|
|
|
|
* @param request |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@ -327,7 +337,7 @@ public class DatavServiceImpl implements DatavService {
|
|
|
|
|
overview.setNumSupervisionPro(szdcCount); |
|
|
|
|
overview.setCaseVerificationPro(ajhcCount); |
|
|
|
|
overview.setMailboxNumber(jzxxCount); |
|
|
|
|
overview.setComplaintPro(xf12337Count+gjxfCount+gabxfCount); |
|
|
|
|
overview.setComplaintPro(xf12337Count + gjxfCount + gabxfCount); |
|
|
|
|
overview.setAuditPro(sjxmCount); |
|
|
|
|
overview.calcTotal(); |
|
|
|
|
JSONObject data = new JSONObject().fluentPut("overview", overview); |
|
|
|
|
@ -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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|