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 65c8a7e..a1590fa 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java @@ -1,42 +1,24 @@ package com.biutag.supervision.controller.datav; 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; -import com.biutag.supervision.constants.enums.BlameType; -import com.biutag.supervision.constants.enums.InspectCaseEnum; import com.biutag.supervision.mapper.DataCaseVerifMapper; import com.biutag.supervision.mapper.NegativeMapper; import com.biutag.supervision.pojo.Result; -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.CaseVerificationCountVo; -import com.biutag.supervision.pojo.vo.CaseVerificationMapVo; +import com.biutag.supervision.pojo.request.datav.DataVRequest; 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.Date; import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; -import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*; +import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.A12389; /** * @author wxc @@ -51,56 +33,20 @@ public class DataVCaseVerifController { private final DataCaseVerifMapper dataCaseVerifMapper; private final NegativeMapper negativeMapper; - private final NegativeBlameService blameService; - - private final SupPoliceService policeService; private final DatavService datavService; // region 左边 - /** - * 案件核查大屏分县市局排名 - * - * @param beginTime 开始时间 - * @param endTime 结束时间 - * @return Result - */ + @Operation(summary = "分县市局排名") - @GetMapping("/getCaseVerificationRank") - public Result getCaseVerificationRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - endTime = DateUtil.endOfDay(endTime); - List fxsjRankList = negativeMapper.getCaseVerificationRank(beginTime, endTime, 3); - List jsdwRankList = negativeMapper.getCaseVerificationRank(beginTime, endTime, 4); - JSONObject data = new JSONObject() - .fluentPut("fxsjRankList", fxsjRankList) - .fluentPut("jsdwRankList", jsdwRankList); - return Result.success(data); + @PostMapping("/getCaseVerificationRank") + public Result getCaseVerificationRank(@RequestBody DataVRequest request) { + return datavService.getCaseVerificationRank(request); } - /** - * 案件问题性质 - * - * @param beginTime 开始时间 - * @param endTime 结束时间 - * @return Result - */ + + @Operation(summary = "案件问题性质") - @GetMapping("/getCaseProblemProperty") - public Result getCaseProblemProperty(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - endTime = DateUtil.endOfDay(endTime); - List zfbaPieList = dataCaseVerifMapper.getCaseProblemProperty(beginTime, endTime, 6); // 执法办案 - List fwglPieList = dataCaseVerifMapper.getCaseProblemProperty(beginTime, endTime, 11); // 服务管理 - JSONObject data = new JSONObject() - .fluentPut("zfbaPieList", zfbaPieList) - .fluentPut("fwglPieList", fwglPieList); - return Result.success(data); - } - // endregion - /** - * 案件问题性质 - * */ @GetMapping("/getCaseType") public Result getCaseType(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @@ -117,116 +63,46 @@ public class DataVCaseVerifController { return Result.success(jsonObject); } - /** - * 获取禁闭处理情况数据 - * */ - @GetMapping("/getConfinementBar") - public Result getConfinementBar(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){ - endTime = DateUtil.endOfDay(endTime); - List list =dataCaseVerifMapper.getConfinementData(beginTime,endTime); - JSONObject jsonObject =new JSONObject().fluentPut("confinementList",list); - return Result.success(jsonObject); - } - - - // region 中间 - /** - * 案件核查大屏中央数据总览 - * - * @param beginTime 开始时间 - * @param endTime 结束时间 - * @return Result - */ @Operation(summary = "案件核查数据总览") - @GetMapping("/getCaseVerificationCount") - public Result getAllCaseVerificationCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - endTime = DateUtil.endOfDay(endTime); - CaseVerificationCountVo overview = new CaseVerificationCountVo(); - List dataCaseVerifs = dataCaseVerifMapper.selectList(new LambdaQueryWrapper().between(DataCaseVerif::getCreateTime, beginTime, endTime)); - overview.setTotal(dataCaseVerifs.size()); - - 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.setDealCasePro((long) negatives.size()); - List trueValue = List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()); - overview.setConfirmed((int) negatives.stream().filter(item -> StrUtil.isNotBlank(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()) { - overview.setPunishOrg(0L); - overview.setPunishPre(0L); - } else { - List blames = blameService.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 = policeService.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()); - } - JSONObject res = new JSONObject().fluentPut("overview", overview); - return Result.success(res); + @PostMapping("/getCaseVerificationCount") + public Result getAllCaseVerificationCount(@RequestBody DataVRequest request) { + return datavService.getAllCaseVerificationCount(request); } - /** - * 案件核查大屏地图 - * - * @param beginTime 开始时间 - * @param endTime 结束时间 - * @return Result - */ @Operation(summary = "案件核查大屏地图") - @GetMapping("/getCaseVerificationMap") + @PostMapping("/getCaseVerificationMap") // @Cacheable(cacheNames = "Supervision:Screen:CaseVerificationMap", key = "#beginTime.getTime()+'_'+#endTime.getTime()") - public Result getCaseVerificationMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - Date finalEndTime = DateUtil.endOfDay(endTime); - List caseVerificationMapList = negativeMapper.getCaseVerificationMap(beginTime, finalEndTime); - log.info("-------caseVerificationMapList-------"); - JSONObject res = new JSONObject().fluentPut("caseVerificationMapList", caseVerificationMapList); - return Result.success(res); + public Result getCaseVerificationMap(@RequestBody DataVRequest request) { + return datavService.getCaseVerificationMap(request); } - /** - * 查处问题趋势 - * - * @param year 年份 - * @return Result - */ + +// @Operation(summary = "案件核查大屏地图") +// @GetMapping("/getCaseVerificationMap") +//// @Cacheable(cacheNames = "Supervision:Screen:CaseVerificationMap", key = "#beginTime.getTime()+'_'+#endTime.getTime()") +// public Result getCaseVerificationMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, +// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { +// Date finalEndTime = DateUtil.endOfDay(endTime); +// List caseVerificationMapList = negativeMapper.getCaseVerificationMap(beginTime, finalEndTime); +// log.info("-------caseVerificationMapList-------"); +// JSONObject res = new JSONObject().fluentPut("caseVerificationMapList", caseVerificationMapList); +// return Result.success(res); +// } + + @Operation(summary = "查处问题趋势") @GetMapping("/getCaseVerificationTrend") public Result getCaseVerificationTrend(@RequestParam Integer year) { - - List proTrendList = negativeMapper.getTrend(year, A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); + List proTrendList = negativeMapper.getTrend(year, A12389.getValue()); JSONObject data = new JSONObject().fluentPut("proTrendList", proTrendList); return Result.success(data); } -// endregion // region 右边 - - /** - * 案件来源占比 和 问责处理情况 - * - * @param beginTime 开始时间 - * @param endTime 结束时间 - * @return Result - */ @Operation(summary = "案件来源占比 & 问责处理情况") @GetMapping("/getCaseSourceRateAndDealSituation") public Result getCaseSourceRateAndDealSituation(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @@ -241,25 +117,37 @@ public class DataVCaseVerifController { } - /** - * 禁闭处理情况 和 停职处理情况 - * - * @param beginTime 开始时间 - * @param endTime 结束时间 - * @return Result - */ - @Operation(summary = "禁闭处理情况 & 停职处理情况") - @GetMapping("/getConfinementAndPause") - public Result getConfinementAndPause(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + @Operation(summary = "禁闭处理情况") + @GetMapping("/getConfinementBar") + public Result getConfinementBar(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){ endTime = DateUtil.endOfDay(endTime); - List jbclList = negativeMapper.getConfinementAndPause(beginTime,endTime, 1); - List tzclList = negativeMapper.getConfinementAndPause(beginTime, endTime, 2); // 停职 - JSONObject data = new JSONObject() - .fluentPut("jbclList", jbclList) - .fluentPut("tzclList", tzclList); - return Result.success(data); + List list =dataCaseVerifMapper.getConfinementData(beginTime,endTime); + JSONObject jsonObject =new JSONObject().fluentPut("confinementList",list); + return Result.success(jsonObject); } + + + +// /** +// * 禁闭处理情况 和 停职处理情况 +// * +// * @param beginTime 开始时间 +// * @param endTime 结束时间 +// * @return Result +// */ +// @Operation(summary = "禁闭处理情况 & 停职处理情况") +// @GetMapping("/getConfinementAndPause") +// public Result getConfinementAndPause(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, +// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { +// endTime = DateUtil.endOfDay(endTime); +// List jbclList = negativeMapper.getConfinementAndPause(beginTime,endTime, 1); +// List tzclList = negativeMapper.getConfinementAndPause(beginTime, endTime, 2); // 停职 +// JSONObject data = new JSONObject() +// .fluentPut("jbclList", jbclList) +// .fluentPut("tzclList", tzclList); +// return Result.success(data); +// } // endregion diff --git a/src/main/java/com/biutag/supervision/mapper/DataCaseVerifMapper.java b/src/main/java/com/biutag/supervision/mapper/DataCaseVerifMapper.java index 81fbc81..6d380e2 100644 --- a/src/main/java/com/biutag/supervision/mapper/DataCaseVerifMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/DataCaseVerifMapper.java @@ -5,6 +5,7 @@ import com.biutag.supervision.pojo.dto.CaseVerifDepart; import com.biutag.supervision.pojo.dto.common.PieItem; import com.biutag.supervision.pojo.entity.DataCaseVerif; import com.biutag.supervision.pojo.vo.EchartsVo; +import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.Date; @@ -49,7 +50,7 @@ public interface DataCaseVerifMapper extends BaseMapper { " negative_problem_relation npr LEFT JOIN " + " negative ng on npr.negativeId = ng.id " + " where npr.oneLevelCode = #{code} " + - " and ng.problemSourcesCode in (17, 18, 19, 20) " + + " and ng.problemSourcesCode in (17) " + " and ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + " GROUP BY twoLevelContent ") List getCaseTypeNumber(Date beginTime, Date endTime, Integer code); @@ -60,4 +61,18 @@ public interface DataCaseVerifMapper extends BaseMapper { " WHERE start_time BETWEEN #{beginTime} AND #{endTime} " + " GROUP BY matter ") List getConfinementData(Date beginTime, Date endTime); + + + @Select("SELECT dcv.* " + + "FROM data_case_verif dcv " + + "LEFT JOIN sup_depart sd2 " + + " ON sd2.id = dcv.second_depart_id " + + "LEFT JOIN sup_depart sd3 " + + " ON sd3.id = dcv.third_depart_id " + + "WHERE " + + " (dcv.second_depart_id = #{secondDepartId} " + + " OR sd3.pid = #{secondDepartId}) " + + " AND dcv.discovery_time >= #{beginTime} " + + " AND dcv.discovery_time < #{endTime}") + List getListData(@Param("secondDepartId") String secondDepartId, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime); } diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index f5827ca..17b5e03 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -59,45 +59,7 @@ public interface NegativeMapper extends BaseMapper { GlobalOverViewVo getSuoOneAllGlobalCount(Integer departId, Date beginTime, Date endTime); - // 中央总览 todo - @Select("SELECT " + - "count(ng.id) AS totalPro, " + - "COALESCE(SUM(IF(problemSourcesCode IN (13), 1, 0)), 0) AS supervisionPro, " + - "COALESCE(SUM(IF(problemSourcesCode IN (14,15,16), 1, 0)), 0) AS numSupervisionPro, " + - "COALESCE(SUM(IF(problemSourcesCode IN (17,18,19,20), 1, 0)), 0) AS caseVerificationPro, " + - "COALESCE(SUM(IF(problemSourcesCode IN (27,28,29,30), 1, 0)), 0) AS auditPro, " + - "COALESCE(SUM(IF(problemSourcesCode IN (2), 1, 0)), 0) AS talkPro " + - "FROM negative ng " + - "WHERE ng.crtTime BETWEEN #{beginTime} AND #{endTime} ") - GlobalOverViewVo getAllGlobalCount(Date beginTime, Date endTime); - - @Select("SELECT problemSources as name ,COUNT(DISTINCT id) as value " + - "from negative WHERE problemSourcesCode IN (27,28,29,30) " + - "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + - "GROUP BY problemSources " + - "ORDER BY value desc ") - List getBarEchartsVoData(Date beginTime, Date endTime); - - // 地图卡片 - @Select("SELECT " + - "sd.short_name AS `name`, " + - "sd.id AS departId, " + - "COUNT( DISTINCT ng.id ) AS totalPro, " + - "SUM( IF(problemSourcesCode IN (13), 1, 0) ) AS supervisePro, " + - "SUM( IF(problemSourcesCode IN (15,16, 14), 1, 0) ) as numSupervisePro, " + - "SUM( IF(problemSourcesCode IN (17,18,19,20), 1, 0) ) AS caseVerifyPro, " + - "SUM( IF(problemSourcesCode IN (21,22,23,24,25),1, 0) ) AS mailPro, " + - "SUM( IF(problemSourcesCode IN (2),1, 0) ) AS policePro, " + - "SUM( IF(problemSourcesCode IN (27,28,29,30),1, 0) ) AS reviewPro " + - "FROM sup_depart sd " + - "LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id " + - - "AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + - "WHERE sd.statistics_group_id=3 " + - "GROUP BY sd.short_name " + - "ORDER BY totalPro DESC;") - List getGlobalMap(Date beginTime, Date endTime); List getGlobalRecentlyTrendByMonth(String year); @@ -137,48 +99,6 @@ public interface NegativeMapper extends BaseMapper { List selectStrongProblemRank(Date beginTime, Date endTime); -// endregion - - // region 现场督察大屏 - @Select("SELECT " + - "COUNT(DISTINCT ng.id) AS proTotal, " + - "COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS processingNumber, " + - "COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS completedNumber, " + - "IFNULL(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS completedRate " + - "FROM negative ng " + - "LEFT JOIN sup_depart sd ON ng.second_involve_depart_id=sd.id " + - "WHERE problemSourcesCode IN (13) " + - "AND sd.statistics_group_id=#{groupId} " + - "AND crtTime BETWEEN #{beginTime} AND #{endTime};") - DayTimeSuperviseVo getSupervisionRank(Date beginTime, Date endTime, Integer groupId); - - @Select("SELECT " + - "COUNT(DISTINCT ng.id) AS proTotal " + - "FROM negative ng " + - "LEFT JOIN sup_depart sd ON ng.second_involve_depart_id=sd.id " + - "WHERE problemSourcesCode IN (13) " + - "AND crtTime BETWEEN #{beginTime} AND #{endTime};") - DayTimeSuperviseVo getProTotalFun(Date beginTime, Date endTime); - - //现场督察 - @Select("SELECT " + - "sd.short_name AS label, " + - "sd.id AS departId, " + - "COUNT(DISTINCT ng.id) AS denominator, " + - "COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS numerator, " + - " COUNT(DISTINCT IF(ng.crt_depart_level = 0, ng.id, null)) as cityNumber, "+ - " COUNT(DISTINCT IF(ng.crt_depart_level = 2, ng.id, null)) as countyNumber, "+ - "ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1) AS rate, " + - "ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1) AS `value` " + - "FROM negative ng " + - "LEFT JOIN sup_depart sd ON ng.second_involve_depart_id=sd.id " + - "WHERE problemSourcesCode IN (13) " + - "AND sd.statistics_group_id=#{groupId} " + - "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + - "GROUP BY sd.short_name " + - "ORDER BY denominator desc") - //,rate desc - List getChangedRateRank(Date beginTime, Date endTime, Integer groupId); @Select("SELECT npr.oneLevelContent as name, count(*) value FROM negative ng, negative_problem_relation npr " + "WHERE ng.id = npr.negativeId " + @@ -189,18 +109,6 @@ public interface NegativeMapper extends BaseMapper { "GROUP BY oneLevelContent ") List getProblemTypeRatio(Date beginTime, Date endTime); - @Select("SELECT " + - "COALESCE(COUNT(DISTINCT ng.id), 0) AS problemNumber, " + - "COALESCE(COUNT(DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL)), 0) AS processingNumber, " + - "COALESCE(COUNT(DISTINCT IF(ng.processing_status='completed', ng.id, NULL)), 0) AS completedNumber, " + - "COUNT(IF(nb.type ='department' and ng.checkStatus IN ('1','2') and nb.handleResultName != '不予追责' and nb.handleResultCode is not null and nb.handleResultCode != '', nb.blameId, NULL)) AS departNumber, " + - "COUNT(IF(nb.type ='personal' and ng.checkStatus IN ('1','2') and nb.handleResultName != '不予追责' and nb.handleResultCode is not null and nb.handleResultCode != '', nb.blameId, NULL)) AS personNumber, " + - "COALESCE(ROUND(COUNT(DISTINCT IF(ng.processing_status='completed', ng.id, NULL)) / COUNT(DISTINCT ng.id) * 100, 1), 0) AS completedRate " + - "FROM negative ng " + - "LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " + - "WHERE ng.problemSourcesCode IN (13,14, 15) " + - "AND ng.crtTime BETWEEN #{beginTime} AND #{endTime}; ") - SupervisionNotifyOverView getAllSupervisionNotifyCount(Date beginTime, Date endTime); @@ -223,130 +131,9 @@ public interface NegativeMapper extends BaseMapper { - @Select("SELECT " + - "sd.short_name AS `name`, " + - "sd.id AS departId, " + - "COUNT( DISTINCT ng.id ) AS totalPro, " + - "COUNT( DISTINCT IF(ng.problemSourcesCode=13, ng.id, NULL) ) AS xc, " + - "COUNT( DISTINCT IF(ng.problemSourcesCode=15, ng.id, NULL) ) AS zx, " + - "COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS processingNumber, " + - "COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS completedNumber , " + - "SUM(CASE " + - " WHEN nb.type = 'personal' " + - " AND nb.handleResultName != '' " + - " AND nb.handleResultName IS NOT NULL " + - " AND nb.handleResultName != '不予追责' " + - " THEN 1 " + - " ELSE 0 " + - " END) AS personNum, " + - " SUM(CASE " + - " WHEN nb.type = 'department' " + - " AND nb.handleResultName != '' " + - " AND nb.handleResultName IS NOT NULL " + - " AND nb.handleResultName != '不予追责' " + - " THEN 1 " + - " ELSE 0 " + - " END) AS relationOrg, "+ - "IFNULL( ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS completedRate " + - "FROM sup_depart sd " + - "LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id " + - "AND ng.problemSourcesCode IN (13,14, 15)" + - "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + - "LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + - "WHERE sd.statistics_group_id=3 " + - "GROUP BY sd.short_name " + - "ORDER BY completedRate DESC") - List getSupervisionMapIconInfo(Date beginTime, Date endTime); - - - - @Select("select " + - " sd.short_name AS `name`," + - " sd.id AS departId, " + - " COUNT( DISTINCT ng.id ) AS totalPro, " + - " COUNT( DISTINCT IF(ng.problemSourcesCode=13, ng.id, NULL) ) AS xc, " + - " COUNT( DISTINCT IF(ng.problemSourcesCode=15, ng.id, NULL) ) AS zx, " + - " COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS processingNumber, " + - " COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS completedNumber " + - " from sup_depart sd " + - " LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id AND ng.problemSourcesCode IN (13,14, 15) " + - " AND crtTime BETWEEN #{beginTime} AND #{endTime} " + - " WHERE sd.statistics_group_id=3 " + - " GROUP BY sd.short_name " + - " ORDER BY totalPro DESC;" - ) - List getSupervisionMapIconData(Date beginTime, Date endTime); - - - - //获取personNum、relationOrg - @Select( - "select count(*) FROM sup_depart sd " + - " LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id AND ng.problemSourcesCode IN (13,14, 15) " + - " AND crtTime BETWEEN #{beginTime} AND #{endTime} " + - " LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + - " WHERE nb.handleResultName != '' and nb.handleResultName IS NOT NULL and nb.handleResultName != '不予追责' " + - " and nb.type = #{code} and sd.id =#{departId}" - ) - String getSupervisionMapStringData(Date beginTime, Date endTime,String code,String departId); - - //获取completedRate - @Select( - "select " + - " IFNULL( ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) " + - " FROM sup_depart sd" + - " LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id AND ng.problemSourcesCode IN (13,14, 15)" + - " AND crtTime BETWEEN #{beginTime} AND #{endTime}" + - " LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + - " where sd.id =#{departId}" - ) - String getSupervisionMapCompletedRate(Date beginTime, Date endTime,String departId); - - - - @Select("SELECT " + - "COUNT(DISTINCT ng.id) AS proTotal, " + - "COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS processingNumber, " + - "COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS completedNumber , " + - "IFNULL( ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS completedRate " + - "FROM negative ng " + - "LEFT JOIN sup_depart sd ON ng.second_involve_depart_id=sd.id " + - "WHERE ng.special_supervision=#{queryType} " + - "AND sd.statistics_group_id=#{groupId} " + - "AND crtTime BETWEEN #{beginTime} AND #{endTime}; ") - DayTimeSuperviseVo getYellowBetOverview(Date beginTime, Date endTime, Integer groupId, String queryType); - - @Select("SELECT " + - "sd.short_name AS label, " + - "COUNT( DISTINCT ng.id ) AS `value` " + - "FROM negative ng " + - "LEFT JOIN sup_depart sd ON ng.second_involve_depart_id=sd.id " + - "WHERE ng.special_supervision=#{queryType} " + - "AND sd.statistics_group_id=#{groupId} " + - "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + - "GROUP BY sd.short_name " + - "ORDER BY `value` DESC;") - List getYellowBetRankList(Date beginTime, Date endTime, Integer groupId, String queryType); - - - // region 视频督察大屏 - @Select("SELECT " + - "COUNT(DISTINCT ng.id) total," + - "COUNT(DISTINCT IF(ng.checkStatus IN ('1','2'), ng.id, NULL)) AS discoverProblem, " + - "COUNT(DISTINCT IF(ng.processing_status='completed', ng.id, NULL)) AS completionProblem, " + - "COUNT(IF(nb.type ='department' and ng.checkStatus IN ('1','2') and nb.handleResultName != '不予追责' and nb.handleResultCode is not null and nb.handleResultCode != '', nb.blameId, NULL)) AS relativeOrg, " + - "COUNT(IF(nb.type ='personal' and ng.checkStatus IN ('1','2') and nb.handleResultName != '不予追责' and nb.handleResultCode is not null and nb.handleResultCode != '', nb.blameId, NULL)) AS relativePer, " + - "IFNULL( ROUND((COUNT(DISTINCT IF(ng.processing_status='completed', ng.id, NULL)) / COUNT(DISTINCT ng.id)) * 100, 1), 0) AS completionRate " + - "FROM sup_depart sd " + - "INNER JOIN negative ng ON sd.id = ng.involveDepartId " + - "LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " + - "WHERE problemSourcesCode = 16 " + - "and ng.checkStatus in (1, 2) "+ - "AND ng.crtTime BETWEEN #{beginTime} AND #{endTime}") - VideoSuperviseCountVo getAllVideoSuperviseCount(Date beginTime, Date endTime); /** * 问题类型占比 * */ @@ -377,68 +164,7 @@ public interface NegativeMapper extends BaseMapper { ) List getVideoSuperviseProblemRank(String id, Date beginTime, Date endTime); - @Select("SELECT " + - " d.short_name name, " + - " d.id departId, " + - " t.discoverProblem, " + - " t.completionProblem, " + - " t.relativePer, " + - " t.relativeOrg " + - "FROM " + - " sup_depart d " + - " LEFT JOIN ( " + - " SELECT " + - " a.second_involve_depart_id, " + - " count( DISTINCT IF ( a.checkStatus IN ( '1', '2' ), a.id, NULL ) ) discoverProblem, " + - " count( DISTINCT IF ( a.processing_status = 'completed', a.id, NULL ) ) completionProblem, " + - " count( DISTINCT IF ( b.type = 'personal' and b.handleResultName != '不予追责' and b.handleResultCode is not null and b.handleResultCode != '', b.blameEmpNo, NULL ) ) relativePer, " + - " count( DISTINCT IF ( b.type = 'department' and b.handleResultName != '不予追责' and b.handleResultCode is not null and b.handleResultCode != '', b.blameEmpNo, NULL ) ) relativeOrg " + - " FROM " + - " negative a " + - " JOIN negative_blame b ON a.id = b.negativeId " + - " WHERE " + - " a.crtTime BETWEEN #{beginTime} AND #{endTime} AND a.problemSourcesCode = 16 " + - " GROUP BY " + - " a.second_involve_depart_id " + - " ) t ON d.id = t.second_involve_depart_id " + - "WHERE " + - " d.statistics_group_id = 3 " + - "GROUP BY " + - " d.short_name, " + - " d.id") - List getVideoSuperviseMapIconInfo(Date beginTime, Date endTime); - /** - * 涉及人 - * */ - @Select(" select " + - " sup.id as name, " + - " count(*) as value " + - " from negative_problem_relation npr " + - " LEFT JOIN negative ng on npr.negativeId = ng.id " + - " LEFT JOIN sup_depart sup on sup.id = ng.second_involve_depart_id " + - " WHERE " + - " ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + - " and sup.statistics_group_id = 3 " + - " and ng.problemSourcesCode = 16 "+ - " GROUP BY sup.id " - ) - List selectRelativePer(Date beginTime, Date endTime); - - - @Select("SELECT " + - "sup.id as `name`, " + - "COUNT(*) as value " + - "from negative_problem_relation npr " + - "LEFT JOIN negative ng on npr.negativeId = ng.id " + - "LEFT JOIN sup_depart sup on sup.id = ng.three_involve_depart_id " + - "WHERE " + - "ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + - "and sup.pid = #{deptId} " + - "and sup.statistics_group_id = 10 " + - "and ng.problemSourcesCode = 16 " + - "GROUP BY sup.id") - List selectSubOneRelativePer(Date beginTime,Date endTime,Integer deptId); // endregion @@ -455,18 +181,6 @@ public interface NegativeMapper extends BaseMapper { "ORDER BY `value` DESC;") List getCaseVerificationRank(Date beginTime, Date endTime, int groupId); - // 案件核查大屏 -- 中央数据 - @Select("SELECT " + - "COUNT( ng.id ) AS confirmed, " + - "COUNT( DISTINCT IF(ng.checkStatus IN (1, 2), ng.id, NULL) ) AS dealCasePro, " + - "COUNT( DISTINCT IF(ng.checkStatus IN (1, 2) && nb.type = 'personal' and ng.checkStatus IN ('1','2') and nb.handleResultName != '不予追责' and nb.handleResultCode is not null and nb.handleResultCode != '', nb.blameId, NULL) ) AS punishPre, " + - "COUNT( DISTINCT IF(ng.checkStatus IN (1, 2) && nb.type = 'department' and ng.checkStatus IN ('1','2') and nb.handleResultName != '不予追责' and nb.handleResultCode is not null and nb.handleResultCode != '', nb.blameId, NULL) ) AS punishOrg " + - "FROM negative ng " + - "LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + - "WHERE ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + - "AND ng. problemSourcesCode in (17, 18, 19, 20) ") - CaseVerificationCountVo getAllCaseVerificationCount(Date beginTime, Date endTime); - @Select("SELECT " + " d.short_name name, " + @@ -531,8 +245,8 @@ public interface NegativeMapper extends BaseMapper { "INNER JOIN negative_blame nb ON nb.negativeId=ng.id " + "WHERE handleResultName is NOT NULL " + "AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + - "AND ng.problemSourcesCode in (17, 18, 19, 20) " + - "AND ng.checkStatus <>3 " + + "AND ng.problemSourcesCode in (17) " + + "AND ng.check_status_code in (1, 2, 3) " + "GROUP BY nb.handleResultName") List getDealSituation(Date beginTime, Date endTime); @@ -551,35 +265,7 @@ public interface NegativeMapper extends BaseMapper { List getSubOneTrend(String departId, String year, String... args); -// endregion - // region 二级大屏首页大屏 - - @Select("SELECT " + - "sd.short_name AS label, " + - "COUNT(DISTINCT ng.id ) AS `value` " + - "FROM negative ng " + - "LEFT JOIN sup_depart sd ON ng.three_involve_depart_id=sd.id " + - "WHERE ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + - "AND sd.statistics_group_id=10 " + - "AND sd.pid=#{departId} " + - "AND problemSourcesCode IN (2,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30) " + - "GROUP BY sd.short_name " + - "ORDER BY `value` DESC;") - List selectPoliceOrganizeProblemRank(Integer departId, Date beginTime, Date endTime); - - @Select("SELECT " + - "sd.short_name AS label, " + - "COUNT(DISTINCT ng.id ) AS `value` " + - "FROM negative ng " + - "LEFT JOIN sup_depart sd ON ng.three_involve_depart_id=sd.id " + - "WHERE ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + - "AND sd.statistics_group_id!=10 " + - "AND sd.pid=#{departId} " + - "AND problemSourcesCode IN (2,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30) " + - "GROUP BY sd.short_name " + - "ORDER BY `value` DESC;") - List selectTeamOrganizeProblemRank(Integer departId, Date beginTime, Date endTime); @Select("SELECT " + "businessTypeName as name, " + @@ -996,7 +682,7 @@ public interface NegativeMapper extends BaseMapper { @Select("SELECT problemSources AS name, count(ng.id) AS value " + "FROM negative ng " + - "WHERE problemSourcesCode IN (17, 18, 19, 20) AND crtTime BETWEEN #{beginTime} AND #{endTime} " + + "WHERE problemSourcesCode IN (17) AND crtTime BETWEEN #{beginTime} AND #{endTime} " + "GROUP BY problemSources") List getCaseSourceRate(Date beginTime, Date endTime); 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 0e94925..ab6aa78 100644 --- a/src/main/java/com/biutag/supervision/service/datav/DatavService.java +++ b/src/main/java/com/biutag/supervision/service/datav/DatavService.java @@ -278,4 +278,18 @@ public interface DatavService { * @return */ Result getSubOneVideoSuperviseMap(SubDataVRequest request); + + /** + * 案件核查 分县市局排名 + * @param request + * @return + */ + Result getCaseVerificationRank(DataVRequest request); + + /** + * 案件核查 一级地图 + * @param request + * @return + */ + Result getCaseVerificationMap(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 7304bb1..a36d8f5 100644 --- a/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java @@ -122,6 +122,9 @@ public class DatavServiceImpl implements DatavService { @Resource private NegativeBlameResourceService negativeBlameResourceService; + @Resource + private DataCaseVerifMapper dataCaseVerifMapper; + private final String VALID_SIGN = "terminated"; private final String EX_SOURCE = "局长信箱"; @@ -421,51 +424,53 @@ public class DatavServiceImpl implements DatavService { @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); - // 查处问题数 + LambdaQueryWrapper dataCaseVerifLambdaQueryWrapper = new LambdaQueryWrapper<>(); + dataCaseVerifLambdaQueryWrapper.between(DataCaseVerif::getCreateTime, request.getBeginTime(), request.getEndTime()); + List dataCaseVerifs = dataCaseVerifMapper.selectList(dataCaseVerifLambdaQueryWrapper); NegativeQueryParam negativeQueryParam = new NegativeQueryParam(); - negativeQueryParam.setCrtTime(timeRange); - negativeQueryParam.setProblemSourcesCode(List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue())); + negativeQueryParam.setCrtTime(List.of(request.getBeginTime(), request.getEndTime())); + negativeQueryParam.setProblemSourcesCode(List.of(A12389.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()); + // 属实问题 + List 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 negativeBlames = negativeBlameResourceService.query(negativeBlameQueryParam); + // 3. 个人问责 + List 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 seenLead = new HashSet<>(); + List 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 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() * 100; + verificationRate = Math.ceil(rawRate); } - overview.setTotal((int) total); - overview.setConfirmed((int) confirmed); - overview.setDealCasePro((long) dealCasePro); - overview.setRate(rate); + overview.setTotal(dataCaseVerifs.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); } @@ -1678,6 +1683,117 @@ public class DatavServiceImpl implements DatavService { return Result.success(data); } + + @Override + public Result getCaseVerificationRank(DataVRequest request) { + List proCode = List.of(A12389.getValue()); + SupDepartQueryParam supDepartQueryParam = new SupDepartQueryParam(); + supDepartQueryParam.setStatisticsGroupId(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId()); + List fxsjDw = supDepartResourceService.query(supDepartQueryParam); + SupDepartQueryParam jsdwQueryParam = new SupDepartQueryParam(); + jsdwQueryParam.setStatisticsGroupId(DepartGroupEnum.BUREAU_AFFILIATED.getId()); + List jsdwDw = supDepartResourceService.query(jsdwQueryParam); + + List fxsjRankList = new ArrayList<>(); + List jsdwRankList = new ArrayList<>(); + for (SupDepart fxsj : fxsjDw) { + List negatives = negativeMapper.getNegativeListData(fxsj.getId(), request.getBeginTime(), request.getEndTime(), proCode); + if (CollectionUtil.isEmpty(negatives)) { + continue; + } + + OrganizeProblemRankVo organizeProblemRankVo = new OrganizeProblemRankVo(); + organizeProblemRankVo.setLabel(fxsj.getShortName()); + organizeProblemRankVo.setValue(String.valueOf(negatives.size())); + fxsjRankList.add(organizeProblemRankVo); + } + for (SupDepart jsdw : jsdwDw) { + List negatives = negativeMapper.getNegativeListData(jsdw.getId(), request.getBeginTime(), request.getEndTime(), proCode); + if (CollectionUtil.isEmpty(negatives)) { + continue; + } + OrganizeProblemRankVo organizeProblemRankVo = new OrganizeProblemRankVo(); + organizeProblemRankVo.setLabel(jsdw.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 getCaseVerificationMap(DataVRequest request) { + SupDepartQueryParam supDepartQueryParam = new SupDepartQueryParam(); + supDepartQueryParam.setStatisticsGroupId(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId()); + List fxsjDw = supDepartResourceService.query(supDepartQueryParam); + List proCode = List.of(A12389.getValue()); + + List caseVerificationMapList = new ArrayList<>(); + for (SupDepart fxsj : fxsjDw) { + LambdaQueryWrapper dataCaseVerifLambdaQueryWrapper = new LambdaQueryWrapper<>(); + dataCaseVerifLambdaQueryWrapper.between(DataCaseVerif::getCreateTime, request.getBeginTime(), request.getEndTime()); + List dataCaseVerifs = dataCaseVerifMapper.getListData(fxsj.getId(), request.getBeginTime(), request.getEndTime()); + List negatives = negativeMapper.getNegativeListData(fxsj.getId(), request.getBeginTime(), request.getEndTime(), proCode); + List 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 negativeBlames = negativeBlameResourceService.query(negativeBlameQueryParam); + + // 3. 个人问责 + List 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 seenLead = new HashSet<>(); + List 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 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() * 100; + verificationRate = Math.ceil(rawRate); + } + CaseVerificationMapVo caseVerificationMapVo = new CaseVerificationMapVo(); + caseVerificationMapVo.setName(fxsj.getShortName()); + caseVerificationMapVo.setDepartId(fxsj.getId()); + caseVerificationMapVo.setTotal(dataCaseVerifs.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); + } + JSONObject res = new JSONObject().fluentPut("caseVerificationMapList", caseVerificationMapList); + return Result.success(res); + } + public Result getSubOneMailMapIcon() { // ✅ 注意:这里的 name 必须和地图 geojson 区域名一致(一般是“xx街道/园区”)