From b4c197f74d352b3c10d8da2b9054b44dc215788d Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Fri, 27 Mar 2026 20:43:05 +0800 Subject: [PATCH] =?UTF-8?q?fix--=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E5=A4=A7=E5=B1=8F1.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../subdatav/SubOneGlobalController.java | 37 +--- .../supervision/mapper/NegativeMapper.java | 187 +--------------- .../service/datav/DatavServiceImpl.java | 6 +- .../service/subDatav/SubDatavService.java | 7 + .../service/subDatav/SubDatavServiceImpl.java | 199 +++++++++++++++--- .../resources/mapper/SupTaskProblemMapper.xml | 16 +- 6 files changed, 188 insertions(+), 264 deletions(-) diff --git a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneGlobalController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneGlobalController.java index 7a72977..6060851 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneGlobalController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneGlobalController.java @@ -2,19 +2,12 @@ package com.biutag.supervision.controller.subdatav; import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.biutag.supervision.constants.enums.ProblemSourcesEnum; import com.biutag.supervision.mapper.NegativeMapper; import com.biutag.supervision.pojo.Result; -import com.biutag.supervision.pojo.entity.Negative; import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest; import com.biutag.supervision.pojo.vo.EchartsVo; -import com.biutag.supervision.pojo.vo.GlobalMapIconVo; -import com.biutag.supervision.pojo.vo.MailOverviewVo; import com.biutag.supervision.pojo.vo.StrongProblemRank; import com.biutag.supervision.service.CountyStreetDeptService; -import com.biutag.supervision.service.DataMailService; -import com.biutag.supervision.service.NegativeService; import com.biutag.supervision.service.subDatav.SubDatavService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -27,6 +20,8 @@ import org.springframework.web.bind.annotation.*; import java.util.Date; import java.util.List; +import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.ALL; + /** * @Auther: sh * @Date: 2024/12/4 16:30 @@ -42,8 +37,6 @@ public class SubOneGlobalController { private final NegativeMapper negativeMapper; private final CountyStreetDeptService countyStreetDeptService; - private final DataMailService dataMailService; - private final NegativeService negativeService; @Resource @@ -93,33 +86,17 @@ public class SubOneGlobalController { @Operation(summary = "首页大屏地图数据") - @GetMapping("/getSubOneGlobalMap") - public Result getSubOneMap(@RequestParam Integer departId, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - - // 地图数据 - List globalMapIconVoList = negativeMapper.getSubOneGlobalMap(beginTime, endTime, departId); - globalMapIconVoList.forEach(s->{ - long mailboxNumber = negativeService.count(new LambdaQueryWrapper() - .between(Negative::getCrtTime, beginTime, endTime) - .eq(Negative::getProblemSourcesCode, ProblemSourcesEnum.JZXX.getValue()) - .eq(Negative::getThreeInvolveDepartId,s.getDepartId()) - ); - s.setMailboxNumber(mailboxNumber); - MailOverviewVo vo = dataMailService.mailCount(Integer.valueOf(s.getDepartId()),beginTime, endTime); - s.setComplaintPro(vo.getCountryMail() + vo.getPoliceMail() + vo.getNumberMail()); - }); - - JSONObject data = new JSONObject().fluentPut("globalTempMapVoList", globalMapIconVoList); - return Result.success(data); + @PostMapping("/getSubOneGlobalMap") + public Result getSubOneGlobalMap(@RequestBody SubDataVRequest request) { + return subDatavService.getSubOneGlobalMap(request); } @Operation(summary = "数据大屏问题趋势统计") @GetMapping("/getSubOneGlobalTrend") public Result getSubOneGlobalTrend(@RequestParam Integer departId, @RequestParam Integer year) { - List GlobalRecentlyTrendList = negativeMapper.getSubOneTrend(departId.toString(), year.toString()); + + List GlobalRecentlyTrendList = negativeMapper.selectMonthStatByYear(year, departId.toString(), ALL); JSONObject jsonObject = new JSONObject().fluentPut("globalRecentlyTrendList", GlobalRecentlyTrendList); return Result.success(jsonObject); } diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index d112da5..576e9cc 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -161,80 +161,8 @@ public interface NegativeMapper extends BaseMapper { - @Select("SELECT " + - " d.short_name name, " + - " d.id departId, " + - " t1.total, " + - " t.confirmed, " + - " t.dealCasePro, " + - " t.punishPre, " + - " t.punishOrg, " + - "CASE WHEN t1.total = 0 THEN 0 ELSE ROUND(t.confirmed / t1.total * 100) END rate " + - "FROM " + - " sup_depart d " + - " LEFT JOIN ( " + - " SELECT " + - " a.second_involve_depart_id, " + - " count( DISTINCT a.id ) confirmed, " + - " count( DISTINCT IF ( a.checkStatus IN ( '1', '2' ), a.id, NULL ) ) dealCasePro, " + - " 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.blameId, " + - " NULL " + - " ) " + - " ) punishPre, " + - " count( " + - " DISTINCT " + - " IF " + - " ( " + - " b.type = 'department' " + - " AND b.handleResultName != '不予追责' " + - " AND b.handleResultCode IS NOT NULL " + - " AND b.handleResultCode != '', " + - " b.blameEmpNo, " + - " NULL " + - " ) " + - " ) punishOrg " + - " FROM " + - " negative a " + - " JOIN negative_blame b ON a.id = b.negativeId " + - " WHERE " + - " a.crtTime BETWEEN #{beginTime} AND #{endTime} " + - " AND a.problemSourcesCode IN ( 17, 18, 19, 20 ) " + - " GROUP BY " + - " a.second_involve_depart_id " + - " ) t ON d.id = t.second_involve_depart_id " + - " LEFT JOIN ( SELECT second_depart_id, count( 1 ) total FROM data_case_verif WHERE create_time BETWEEN #{beginTime} AND #{endTime} GROUP BY second_depart_id ) t1 ON d.id = t1.second_depart_id " + - "WHERE " + - " d.statistics_group_id = 3 " + - "GROUP BY " + - " d.short_name, " + - " d.id") - List getCaseVerificationMap(Date beginTime, Date endTime); - - @Select("SELECT nb.handleResultName as `name`, count(*) as `value` " + - "FROM negative ng " + - "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.check_status_code in (1, 2, 3) " + - "GROUP BY nb.handleResultName") - List getDealSituation(Date beginTime, Date endTime); - - - - List getMailTrend(Integer year, Integer type); - List getSubOneTrend(String departId, String year); @@ -280,10 +208,10 @@ public interface NegativeMapper extends BaseMapper { "LEFT JOIN sup_depart sd on ng.involveDepartId = sd.id " + "LEFT JOIN sup_depart sdd on sd.pid = sdd.id " + "LEFT JOIN sup_depart sddd on sdd.pid = sddd.id " + - "AND crtTime BETWEEN #{beginTime} AND #{endTime}" + "WHERE npr.threeLevelContent is not NULL " + "AND ng.check_status_code IN (1, 2, 3) " + "AND (sd.id = #{departId} or sdd.id= #{departId} or sddd.id = #{departId} ) " + + "AND ng.crtTime >= #{beginTime} and ng.crtTime < #{endTime} " + "GROUP BY npr.threeLevelContent " + "ORDER BY `value` desc " + " LIMIT 10 OFFSET 1") @@ -298,7 +226,7 @@ public interface NegativeMapper extends BaseMapper { "LEFT JOIN sup_depart sdd on sd.pid = sdd.id " + "LEFT JOIN sup_depart sddd on sdd.pid = sddd.id " + "WHERE ng.check_status_code IN (1, 2, 3) " + - "AND crtTime >= #{beginTime} < #{endTime} " + + "AND ng.crtTime >= #{beginTime} and ng.crtTime < #{endTime} " + "AND npr.oneLevelContent is not NULL " + "AND (sd.id = #{departId} or sdd.id= #{departId} or sddd.id = #{departId} ) " + "GROUP BY npr.oneLevelContent " + @@ -306,48 +234,9 @@ public interface NegativeMapper extends BaseMapper { List selectSubOneProblemRate(Integer departId, Date beginTime, Date endTime); - // region 二级大屏视频督察 - - @Select("SELECT sd.short_name AS label, " + - "count(*) as `value` " + - " FROM negative ng " + - "INNER JOIN sup_depart sd ON ng.three_involve_depart_id=sd.id " + - "AND ng.second_involve_depart_id=#{departId} AND sd.statistics_group_id=10 " + - "WHERE checkStatus <> 3 " + - "AND problemSourcesCode=16 " + - "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + - "and ng.three_involve_depart_id is not null " + - "GROUP BY sd.short_name " + - "ORDER BY `value` DESC ") - List getSuboOneVideoSupervisePoliceProblemRank(Date beginTime, Date endTime, Integer groupId, Integer departId); - - @Select("SELECT sd.short_name AS label, " + - "count(*) as `value` " + - " FROM negative ng " + - "INNER JOIN sup_depart sd ON ng.three_involve_depart_id=sd.id " + - "AND ng.second_involve_depart_id=#{departId} AND sd.statistics_group_id!=10 " + - "WHERE checkStatus <> 3 " + - "AND problemSourcesCode=16 " + - "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + - "and ng.three_involve_depart_id is not null " + - "GROUP BY sd.short_name " + - "ORDER BY `value` DESC ") - List getSuboOneVideoSuperviseTeamProblemRank(Date beginTime, Date endTime, Integer groupId, Integer departId); List getSubOneVideoSuperviseTrend(@Param("year") String year, @Param("problemCode") String problemCode, @Param("departIds") List departIds); - @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 " + - "FROM negative ng " + - "LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " + - "WHERE problemSourcesCode = 16 and ng.second_involve_depart_id = #{departId} " + - "AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} ") - VideoSuperviseCountVo getSubOneAllVideoSuperviseCount(Date beginTime, Date endTime, Integer departId); - @@ -373,37 +262,10 @@ public interface NegativeMapper extends BaseMapper { List getSubOneProblemTypeRatio(Integer departId, Date beginTime, Date endTime); - @Select("SELECT sdps.label AS `name` , " + - "COUNT( DISTINCT ng.id ) AS `value` " + - "FROM negative ng " + - "LEFT JOIN sup_dict_problem_source sdps ON ng.problemSourcesCode= sdps.id " + - "INNER JOIN sup_depart sd ON ng.involveDepartId=sd.id AND sd.pid=#{departId} " + - "WHERE crtTime BETWEEN #{beginTime} AND #{endTime} " + - "AND ng.problemSourcesCode IN (17,18,19,20) " + - "GROUP BY sdps.label") - List getSuboOneCaseSourceRate(Date beginTime, Date endTime, Integer departId); - - @Select("SELECT nb.handleResultName AS `name`, " + - "COUNT( DISTINCT nb.blameId ) AS `value` " + - "FROM negative ng " + - "inner JOIN sup_depart sd on ng.involveDepartId=sd.id AND sd.pid=#{departId} " + - "INNER JOIN negative_blame nb ON ng.id=nb.negativeId " + - "WHERE nb.handleResultName IS NOT NULL " + - "AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + - "AND ng.problemSourcesCode IN (17,18,19,20) " + - "AND ng.checkStatus <>3 " + - "GROUP BY nb.handleResultName") - List getSubOneDealSituation(Date beginTime, Date endTime, Integer departId); List getSubOneCaseVerificationTrend(String year, String departId, String... args); - @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} " + - "GROUP BY problemSources") - List getCaseSourceRate(Date beginTime, Date endTime); - /** * 首页大屏问题类型占比 * @@ -422,51 +284,6 @@ public interface NegativeMapper extends BaseMapper { "ORDER BY `value` desc") List selectProblemRate(Date beginTime, Date endTime); - @Select("SELECT " + - "csd.`name` AS `name`, " + - "csd.dept_name AS policeName, " + - "csd.dept_pid, " + - "csd.dept_id AS departId, " + - "COUNT( DISTINCT ng.id) AS total," + - "COUNT( DISTINCT CASE WHEN ng.checkStatus <> 3 THEN ng.id END) AS discoverProblem, " + - "COUNT(DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS completionProblem, " + - "COUNT(DISTINCT ng.involveDepartId) AS relativeOrg, " + - "COUNT( DISTINCT nb.blameName ) AS relativePer, " + - "IFNULL(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id)*100, 1 ),0) AS completionRate " + - "FROM county_street_dept csd " + - "LEFT JOIN negative ng ON csd.dept_id=ng.three_involve_depart_id " + - "AND checkStatus <>3 " + - "AND problemSourcesCode =16 " + - "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + - "LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + - "GROUP BY csd.dept_name " + - "HAVING csd.dept_pid=#{departId}; ") - List getSubOneVideoSuperviseMapIconInfo(Date beginTime, Date endTime, Integer departId); - - - - - - @Select("SELECT " + - "csd.`name` AS `name`, " + - "csd.dept_name AS policeName, " + - "csd.dept_pid, " + - "csd.dept_id AS departId, " + - "COUNT(DISTINCT IF(ng.isRectifyCode = 0,ng.id,null)) as processingNumber, " + - "COUNT(DISTINCT IF(ng.isRectifyCode = 1,ng.id,null)) as completeNumber, " + - "COUNT( DISTINCT ng.involveDepartId ) AS relationOrg, " + - "COUNT( DISTINCT ng.id ) AS problemNumber, " + - "IFNULL( ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS completeRate " + - "FROM county_street_dept csd " + - "LEFT JOIN negative ng ON ng.three_involve_depart_id=csd.dept_id " + - "WHERE ng.problemSourcesCode in (13,14,15) " + - "and ng.crtTime BETWEEN '2025-01-01 00:00:00.0' AND '2025-06-11 23:59:59.999' " + - "AND ng.second_involve_depart_id= #{departId} " + - "and ng.checkStatus in (1,2) " + - "GROUP BY csd.dept_name " + - "HAVING csd.dept_pid=#{departId} " - ) - List getSubOneSupervisionMapIcon(Date beginTime,Date endTime,Integer departId); List selectListBySampleId(@Param("args") List sampleIdList); 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 86ea579..312a039 100644 --- a/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java @@ -188,10 +188,10 @@ public class DatavServiceImpl implements DatavService { List 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(), STXF.getValue())); + negativeQueryParam.setProblemSourcesCode(List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue())); List negatives = negativeResourceService.query(negativeQueryParam); // 交办案件数 - Set ldjbCode = Set.of(SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue(), STXF.getValue()); + Set ldjbCode = Set.of(SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); List jbNegatvieList = negatives.stream().filter(one -> ldjbCode.contains(one.getProblemSourcesCode())).toList(); long ajhcCount = dataCaseVerifs.size()+ jbNegatvieList.size(); // 局长信箱 @@ -256,7 +256,7 @@ public class DatavServiceImpl implements DatavService { supDepartGroupParam.setChildLevel(3); Map departAndSubDepart = supDepartResourceService.getDepartAndSubDepart(supDepartGroupParam); // 交办 - List proCode = List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue(), STXF.getValue()); + List proCode = List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); for (Map.Entry entry : departAndSubDepart.entrySet()) { String departId = entry.getKey(); DepartAndSubDepartDto departDto = entry.getValue(); diff --git a/src/main/java/com/biutag/supervision/service/subDatav/SubDatavService.java b/src/main/java/com/biutag/supervision/service/subDatav/SubDatavService.java index 2646910..ee3a37b 100644 --- a/src/main/java/com/biutag/supervision/service/subDatav/SubDatavService.java +++ b/src/main/java/com/biutag/supervision/service/subDatav/SubDatavService.java @@ -137,4 +137,11 @@ public interface SubDatavService { Result getSubOneResultCount( SubDataVRequest request); + /** + * 获取二级首页地图数据 + * @param request + * @return + */ + Result getSubOneGlobalMap(SubDataVRequest request); + } diff --git a/src/main/java/com/biutag/supervision/service/subDatav/SubDatavServiceImpl.java b/src/main/java/com/biutag/supervision/service/subDatav/SubDatavServiceImpl.java index ec65c3b..a33c4bc 100644 --- a/src/main/java/com/biutag/supervision/service/subDatav/SubDatavServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/subDatav/SubDatavServiceImpl.java @@ -13,9 +13,12 @@ import com.biutag.supervision.pojo.dto.common.BarItem; import com.biutag.supervision.pojo.dto.common.PieItem; import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.pojo.entity.mailbox.Mail; +import com.biutag.supervision.pojo.entity.report.ReportProject; import com.biutag.supervision.pojo.param.*; +import com.biutag.supervision.pojo.param.dataAudit.DataAuditQueryParam; import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest; import com.biutag.supervision.pojo.vo.*; +import com.biutag.supervision.repository.dataAudit.DataAuditResourceService; import com.biutag.supervision.repository.dataPetitionComplaint.DataPetitionComplaintResourceService; import com.biutag.supervision.repository.mail.MailResourceService; import com.biutag.supervision.repository.negative.NegativeResourceService; @@ -30,6 +33,7 @@ import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.math.RoundingMode; +import java.time.ZoneId; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -45,6 +49,10 @@ import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*; @Service public class SubDatavServiceImpl implements SubDatavService { + @Resource + private DataAuditResourceService dataAuditResourceService; + + @Resource private ReportProjectResourceService reportProjectResourceService; @@ -95,6 +103,9 @@ public class SubDatavServiceImpl implements SubDatavService { private AccountabilityCountUtil accountabilityCountUtil; + @Resource + private DataPetition12337Mapper dataPetition12337Mapper; + private final String VALID_SIGN = "terminated"; private final String EX_SOURCE = "局长信箱"; @@ -123,25 +134,31 @@ public class SubDatavServiceImpl implements SubDatavService { }) .toList(); + List dates = Arrays.asList(request.getBeginTime(), request.getEndTime()); for (SupDepart pcs : pcsList) { - List negatives = negativeMapper.getNegativeListData(pcs.getId(), request.getBeginTime(), request.getEndTime(), ALL); - if (negatives.isEmpty()) { - continue; + + NegativeQueryParam negativeQueryParam = new NegativeQueryParam(); + negativeQueryParam.setCrtTime(dates); + negativeQueryParam.setInvolveDepartIds(Collections.singleton(pcs.getId())); + // 问题数 + long count = negativeResourceService.count(negativeQueryParam); + OrganizeProblemRankVo organizeProblemRankVo = OrganizeProblemRankVo.of(pcs.getShortName()); + if (count > 0) { + organizeProblemRankVo.setValue(String.valueOf(count)); + fxsjlist.add(organizeProblemRankVo); } - OrganizeProblemRankVo organizeProblemRankVo = new OrganizeProblemRankVo(); - organizeProblemRankVo.setLabel(pcs.getShortName()); - organizeProblemRankVo.setValue(String.valueOf(negatives.size())); - fxsjlist.add(organizeProblemRankVo); } for (SupDepart dw : dwList) { - List negatives = negativeMapper.getNegativeListData(dw.getId(), request.getBeginTime(), request.getEndTime(), ALL); - if (negatives.isEmpty()) { - continue; + NegativeQueryParam negativeQueryParam = new NegativeQueryParam(); + negativeQueryParam.setCrtTime(dates); + negativeQueryParam.setInvolveDepartIds(Collections.singleton(dw.getId())); + // 问题数 + long count = negativeResourceService.count(negativeQueryParam); + OrganizeProblemRankVo organizeProblemRankVo = OrganizeProblemRankVo.of(dw.getShortName()); + if (count > 0) { + organizeProblemRankVo.setValue(String.valueOf(count)); + jsdwlist.add(organizeProblemRankVo); } - OrganizeProblemRankVo organizeProblemRankVo = new OrganizeProblemRankVo(); - organizeProblemRankVo.setLabel(dw.getShortName()); - organizeProblemRankVo.setValue(String.valueOf(negatives.size())); - jsdwlist.add(organizeProblemRankVo); } // 排序 @@ -188,13 +205,17 @@ public class SubDatavServiceImpl implements SubDatavService { szdcQueryParam.setProblemSourcesCode(ProblemSourcesEnum.GROUP_14_15_16); long szdcCount = negativeResourceService.count(szdcQueryParam); // 案件核查 - List proCode = List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue(), STXF.getValue()); LambdaQueryWrapper dataCaseVerifLambdaQueryWrapper = new LambdaQueryWrapper<>(); dataCaseVerifLambdaQueryWrapper.between(DataCaseVerif::getCreateTime, request.getBeginTime(), request.getEndTime()); - List dataCaseVerifs = dataCaseVerifMapper.getListData(request.getDepartId(), request.getBeginTime(), request.getEndTime()); - List negatives = negativeMapper.getNegativeListData(request.getDepartId(), request.getBeginTime(), request.getEndTime(), proCode); + dataCaseVerifLambdaQueryWrapper.in(DataCaseVerif::getSecondDepartId, request.getDepartId()); + List 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 negatives = negativeResourceService.query(negativeQueryParam); // 交办案件数 - List jbNegatvieList = negatives.stream().filter(one -> proCode.contains(one.getProblemSourcesCode())).toList(); + Set ldjbCode = Set.of(SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); + List jbNegatvieList = negatives.stream().filter(one -> ldjbCode.contains(one.getProblemSourcesCode())).toList(); long ajhcCount = dataCaseVerifs.size() + jbNegatvieList.size(); @@ -205,17 +226,23 @@ public class SubDatavServiceImpl implements SubDatavService { List supExternalDepartList = supExternalDepartResourceService.query(supExternalDepartQueryParam); Set supExternalDepartIdSet = supExternalDepartList.stream().map(SupExternalDepart::getExternalId).collect(Collectors.toSet()); - MailQueryParam mailQueryParam = new MailQueryParam(); - mailQueryParam.setSecondDeptIds(supExternalDepartIdSet); - mailQueryParam.setMailTime(dates); - long mailCount = mailResourceService.count(mailQueryParam); + LambdaQueryWrapper mailQueryWrapper = new LambdaQueryWrapper<>(); + mailQueryWrapper.ne(Mail::getMailState, VALID_SIGN); + mailQueryWrapper.in(Mail::getSecondDeptId, supExternalDepartIdSet); + mailQueryWrapper.between(Mail::getMailTime, request.getBeginTime(), request.getEndTime()); + long mailCount = mailMapper.selectCount(mailQueryWrapper); + // 12337 - NegativeQueryParam xf12337Param = new NegativeQueryParam(); - xf12337Param.setCrtTime(dates); - xf12337Param.setProblemSourcesCode(Collections.singletonList(ProblemSourcesEnum.XF12337.getValue())); - xf12337Param.setInvolveDepartIds(allDepartIds); - long xf12337Count = negativeResourceService.count(xf12337Param); + QueryWrapper 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); @@ -231,10 +258,18 @@ public class SubDatavServiceImpl implements SubDatavService { // 审计项目数 ReportProjectQueryParam reportProjectQueryParam = new ReportProjectQueryParam(); - reportProjectQueryParam.setArchivingStart(request.getBeginTime()); - reportProjectQueryParam.setArchivingEnd(request.getEndTime()); - reportProjectQueryParam.setAuditUnitIds(allDepartIds); - long sjxmCount = reportProjectResourceService.count(reportProjectQueryParam); + reportProjectQueryParam.setPublicationDateStart(request.getBeginTime()); + reportProjectQueryParam.setPublicationDateEnd(request.getEndTime()); + // 用报审单位 + reportProjectQueryParam.setProjectUnitIds(Collections.singleton(request.getDepartId())); + List reportProjects = reportProjectResourceService.query(reportProjectQueryParam); + // 其他项目总数 + DataAuditQueryParam dataAuditQueryParam = new DataAuditQueryParam(); + dataAuditQueryParam.setAuditTimeStart(request.getBeginTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); + dataAuditQueryParam.setAuditTimeEnd(request.getEndTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); + dataAuditQueryParam.setSecondLevelDeptId(Long.valueOf(request.getDepartId())); + List dataAuditList = dataAuditResourceService.query(dataAuditQueryParam); + long sjxmCount = reportProjects.size() + dataAuditList.size(); overview.setSupervisionPro(xcdcCount); overview.setNumSupervisionPro(szdcCount); @@ -247,6 +282,108 @@ public class SubDatavServiceImpl implements SubDatavService { return Result.success(data); } + // 二级首页地图 + @Override + public Result getSubOneGlobalMap(SubDataVRequest request) { + List globalMapIconVoList = new ArrayList<>(); + List dates = Arrays.asList(request.getBeginTime(), request.getEndTime()); + List policeDeparts = supDepartMapper.selectPoliceDeparts(Integer.valueOf(request.getDepartId())); + + for (SupDepart childDepart : policeDeparts) { + String childDepartId = childDepart.getId(); + GlobalMapIconVo globalMapIconVo = GlobalMapIconVo.of(childDepartId, childDepart.getShortName()); + + // 现场督查 + NegativeQueryParam group13Param = new NegativeQueryParam(); + group13Param.setCrtTime(dates); + group13Param.setInvolveDepartIds(Set.of(childDepartId)); + group13Param.setProblemSourcesCode(ProblemSourcesEnum.GROUP_13); + long supervisionProCount = negativeResourceService.count(group13Param); + + // 数字督察 + NegativeQueryParam group14To16Param = new NegativeQueryParam(); + group14To16Param.setCrtTime(dates); + group14To16Param.setInvolveDepartIds(Set.of(childDepartId)); + group14To16Param.setProblemSourcesCode(ProblemSourcesEnum.GROUP_14_15_16); + long numSupervisionProCount = negativeResourceService.count(group14To16Param); + + // 案件核查 = 12389 + 交办 + List proCode = List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); + List negatives = negativeMapper.getNegativeListData(childDepartId, request.getBeginTime(), request.getEndTime(), proCode); + LambdaQueryWrapper caseVerifLambdaQueryWrapper = new LambdaQueryWrapper<>(); + caseVerifLambdaQueryWrapper.between(DataCaseVerif::getDiscoveryTime, dates.get(0), dates.get(1)); + caseVerifLambdaQueryWrapper.eq(DataCaseVerif::getThirdDepartId, childDepartId); + long dataCaseVerifs = dataCaseVerifMapper.selectCount(caseVerifLambdaQueryWrapper); + + Set ldjbCode = Set.of(SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); + List jbNegatvieList = negatives.stream().filter(one -> ldjbCode.contains(one.getProblemSourcesCode())).toList(); + long caseVerificationProCount = dataCaseVerifs + jbNegatvieList.size(); + + // 12337 + NegativeQueryParam xf12337Param = new NegativeQueryParam(); + xf12337Param.setCrtTime(dates); + xf12337Param.setInvolveDepartIds(Set.of(childDepartId)); + xf12337Param.setProblemSourcesCode(Collections.singletonList(ProblemSourcesEnum.XF12337.getValue())); + long xf12337Count = negativeResourceService.count(xf12337Param); + + // 国家信访 + DataPetitionComplaintQueryParam countryParam = new DataPetitionComplaintQueryParam(); + countryParam.setCreateTime(dates); + countryParam.setThirdDepartIds(Collections.singleton(childDepartId)); + countryParam.setProblemSourcesCode(ProblemSourcesEnum.GJXFPT.getValue()); + long countryMail = dataPetitionComplaintResourceService.count(countryParam); + + // 公安部门信访 + DataPetitionComplaintQueryParam policeParam = new DataPetitionComplaintQueryParam(); + policeParam.setCreateTime(dates); + policeParam.setThirdDepartIds(Collections.singleton(childDepartId)); + policeParam.setProblemSourcesCode(ProblemSourcesEnum.GABXF.getValue()); + long policeMail = dataPetitionComplaintResourceService.count(policeParam); + + // 审计项目数 + ReportProjectQueryParam reportProjectQueryParam = new ReportProjectQueryParam(); + reportProjectQueryParam.setPublicationDateStart(request.getBeginTime()); + reportProjectQueryParam.setPublicationDateEnd(request.getEndTime()); + // 用报审单位 + reportProjectQueryParam.setProjectUnitIds(Collections.singleton(childDepartId)); + List reportProjects = reportProjectResourceService.query(reportProjectQueryParam); + // 其他项目总数 + DataAuditQueryParam dataAuditQueryParam = new DataAuditQueryParam(); + dataAuditQueryParam.setAuditTimeStart(request.getBeginTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); + dataAuditQueryParam.setAuditTimeEnd(request.getEndTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); + dataAuditQueryParam.setThirdLevelDeptId(Long.valueOf(childDepartId.trim())); + List dataAuditList = dataAuditResourceService.query(dataAuditQueryParam); + long sjxmCount = reportProjects.size() + dataAuditList.size(); + + // 局长信箱 + long mailCount = 0; + SupExternalDepartQueryParam externalDepartQueryParam = new SupExternalDepartQueryParam(); + externalDepartQueryParam.setInternalIds(Collections.singleton(childDepartId)); + externalDepartQueryParam.setSource("局长信箱"); + List supExternalDepartList = supExternalDepartResourceService.query(externalDepartQueryParam); + if (CollectionUtil.isNotEmpty(supExternalDepartList)) { + SupExternalDepart externalDepart = supExternalDepartList.get(0); + MailQueryParam mailQueryParam = new MailQueryParam(); + mailQueryParam.setThreeDeptIds(Collections.singleton(externalDepart.getExternalId())); + mailQueryParam.setMailTime(dates); + mailCount = mailResourceService.count(mailQueryParam); + } + + globalMapIconVo.setSupervisionPro(supervisionProCount); + globalMapIconVo.setNumSupervisionPro(numSupervisionProCount); + globalMapIconVo.setCaseVerificationPro(caseVerificationProCount); + globalMapIconVo.setComplaintPro(xf12337Count + countryMail + policeMail); + globalMapIconVo.setAuditPro(sjxmCount); + globalMapIconVo.setMailboxNumber(mailCount); + globalMapIconVo.setTalkPro(0L); + globalMapIconVo.calcTotal(); + globalMapIconVoList.add(globalMapIconVo); + } + + JSONObject mapData = new JSONObject().fluentPut("globalTempMapVoList", globalMapIconVoList); + return Result.success(mapData); + } + // endregion // region 视频督察二级 diff --git a/src/main/resources/mapper/SupTaskProblemMapper.xml b/src/main/resources/mapper/SupTaskProblemMapper.xml index dcd979b..3d805f1 100644 --- a/src/main/resources/mapper/SupTaskProblemMapper.xml +++ b/src/main/resources/mapper/SupTaskProblemMapper.xml @@ -38,21 +38,7 @@ GROUP BY m.month_name ORDER BY m.month ASC; - - +