From 87f9cf76f82d383cafae6578d6a2ae3ed17956c8 Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Tue, 20 Jan 2026 11:55:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=88=E4=BB=B6=E6=A0=B8=E6=9F=A5=E4=B8=80?= =?UTF-8?q?=E7=BA=A7=E5=A4=A7=E5=B1=8F--=E6=80=BB=E8=A7=88=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datav/DataVCaseVerifController.java | 28 +++---- .../pojo/vo/CaseVerificationCountVo.java | 24 ++++-- .../service/datav/DatavService.java | 7 ++ .../service/datav/DatavServiceImpl.java | 79 ++++++++++++++++--- 4 files changed, 105 insertions(+), 33 deletions(-) diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java index cab8d51..442a1a3 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java @@ -6,7 +6,6 @@ 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.InspectCaseEnum; -import com.biutag.supervision.constants.enums.ProcessingStatusEnum; import com.biutag.supervision.mapper.DataCaseVerifMapper; import com.biutag.supervision.mapper.NegativeMapper; import com.biutag.supervision.pojo.Result; @@ -14,20 +13,21 @@ import com.biutag.supervision.pojo.entity.DataCaseVerif; import com.biutag.supervision.pojo.entity.Negative; import com.biutag.supervision.pojo.entity.NegativeBlame; import com.biutag.supervision.pojo.entity.SupPolice; -import com.biutag.supervision.pojo.vo.*; +import com.biutag.supervision.pojo.request.datav.DataVRequest; +import com.biutag.supervision.pojo.vo.CaseVerificationCountVo; +import com.biutag.supervision.pojo.vo.CaseVerificationMapVo; +import com.biutag.supervision.pojo.vo.EchartsVo; +import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo; import com.biutag.supervision.service.NegativeBlameService; import com.biutag.supervision.service.SupPoliceService; +import com.biutag.supervision.service.datav.DatavService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.format.annotation.DateTimeFormat; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; -import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Objects; @@ -51,6 +51,7 @@ public class DataVCaseVerifController { private final NegativeBlameService blameService; private final SupPoliceService policeService; + private final DatavService datavService; // region 左边 @@ -140,15 +141,6 @@ public class DataVCaseVerifController { public Result getAllCaseVerificationCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { endTime = DateUtil.endOfDay(endTime); -// "IFNULL( ROUND( COUNT( DISTINCT IF(ng.checkStatus IN (1, 2), ng.id, NULL) ) / count(DISTINCT ng.id)*100, 1 ), 0 ) AS rate " -// CaseVerificationCountVo overview = negativeMapper.getAllCaseVerificationCount(beginTime, endTime); -// List list = Arrays.asList( A12389.getValue(),SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); - - -// overview.setConfirmed((int) confirmed); -//// overview.setRate((double) ((overview.getConfirmed() / total * 100) )); -// overview.setRate(NumberUtil.div((Number) (overview.getConfirmed() * 100),total ).doubleValue()); - CaseVerificationCountVo overview = new CaseVerificationCountVo(); List dataCaseVerifs = dataCaseVerifMapper.selectList(new LambdaQueryWrapper().between(DataCaseVerif::getCreateTime, beginTime, endTime)); overview.setTotal(dataCaseVerifs.size()); @@ -156,9 +148,9 @@ public class DataVCaseVerifController { List negatives = negativeMapper.selectList(new LambdaQueryWrapper() .between(Negative::getCrtTime, beginTime, endTime) .in(Negative::getProblemSourcesCode, List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()))); - overview.setConfirmed(negatives.size()); + overview.setDealCasePro((long) negatives.size()); List trueValue = List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()); - overview.setDealCasePro(negatives.stream().filter(item -> Objects.nonNull(item.getCheckStatus()) && trueValue.contains(item.getCheckStatus())).count()); + overview.setConfirmed((int) negatives.stream().filter(item -> Objects.nonNull(item.getCheckStatus()) && trueValue.contains(item.getCheckStatus())).count()); double rate = overview.getTotal() == 0 ? 0 : NumberUtil.round((double) overview.getConfirmed() / overview.getTotal() * 100, 0).doubleValue(); overview.setRate(rate); if (negatives.isEmpty()) { diff --git a/src/main/java/com/biutag/supervision/pojo/vo/CaseVerificationCountVo.java b/src/main/java/com/biutag/supervision/pojo/vo/CaseVerificationCountVo.java index 8a684e5..6dad3e9 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/CaseVerificationCountVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/CaseVerificationCountVo.java @@ -1,5 +1,6 @@ package com.biutag.supervision.pojo.vo; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** @@ -10,12 +11,23 @@ import lombok.Data; @Data public class CaseVerificationCountVo { - private Integer total; // 总案件数 - private Integer confirmed; // 已查实案件数 - private Long dealCasePro; // 查处理案件数 - private Long punishPre; // 问责人数 - private Long punishOrg; // 问责单位数 - private Double rate; // 查实率 + @Schema(description = "案件总数") + private Integer total; + + @Schema(description = "查实案件数") + private Integer confirmed; + + @Schema(description = "查处问题数") + private Long dealCasePro; + + @Schema(description = "问责人数") + private Long punishPre; + + @Schema(description = "问责单位数") + private Long punishOrg; + + @Schema(description = "查实率") + private Double rate; } diff --git a/src/main/java/com/biutag/supervision/service/datav/DatavService.java b/src/main/java/com/biutag/supervision/service/datav/DatavService.java index 3dadf2d..e113a53 100644 --- a/src/main/java/com/biutag/supervision/service/datav/DatavService.java +++ b/src/main/java/com/biutag/supervision/service/datav/DatavService.java @@ -40,4 +40,11 @@ public interface DatavService { * @return */ Result getAllGlobalCount(DataVRequest request); + + /** + * 案件核查总览数据 + * @param request + * @return + */ + Result getAllCaseVerificationCount(DataVRequest request); } diff --git a/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java b/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java index 8f2778e..72f1374 100644 --- a/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java @@ -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 getAuditMap(DataVRequest request) { List 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,13 +283,14 @@ public class DatavServiceImpl implements DatavService { /** * 获取一级首页中间总览数据 + * * @param request * @return */ @Override public Result getAllGlobalCount(DataVRequest request) { - GlobalOverViewVo overview = GlobalOverViewVo.of(); + GlobalOverViewVo overview = GlobalOverViewVo.of(); List dates = Arrays.asList(request.getBeginTime(), request.getEndTime()); // 现场督查 NegativeQueryParam xcdcQueryParam = new NegativeQueryParam(); @@ -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 getAllCaseVerificationCount(DataVRequest request) { + CaseVerificationCountVo overview = new CaseVerificationCountVo(); + List 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 negatives = negativeResourceService.query(negativeQueryParam); + int dealCasePro = negatives.size(); + // 查实案件数 + Set 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 blames = negativeBlameService.list(new LambdaQueryWrapper() + .in(NegativeBlame::getNegativeId, negatives.stream().map(Negative::getId).toList()) + .isNotNull(NegativeBlame::getHandleResultCode) + .ne(NegativeBlame::getHandleResultCode, "") + .ne(NegativeBlame::getHandleResultName, "不予追责")); + List 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().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); + } }