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 ba26ab9..e392517 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java @@ -2,14 +2,17 @@ package com.biutag.supervision.controller.datav; import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.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.CaseVerificationService; +import com.biutag.supervision.service.DataCaseVerifService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; @@ -126,7 +129,12 @@ 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); + long total =dataCaseVerifMapper.selectCount(new LambdaQueryWrapper().between(DataCaseVerif::getCreateTime,beginTime,endTime)); + overview.setTotal((int) total); + overview.setRate((double) ((overview.getConfirmed() / total ) * 100)); + JSONObject res = new JSONObject().fluentPut("overview", overview); return Result.success(res); } @@ -144,8 +152,14 @@ public class DataVCaseVerifController { @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) { - endTime = DateUtil.endOfDay(endTime); - List caseVerificationMapList = negativeMapper.getCaseVerificationMap(beginTime, endTime); + Date finalEndTime = DateUtil.endOfDay(endTime); + List caseVerificationMapList = negativeMapper.getCaseVerificationMap(beginTime, finalEndTime); + caseVerificationMapList =caseVerificationMapList.stream().map(s->{ + long total =dataCaseVerifMapper.selectCount(new LambdaQueryWrapper().between(DataCaseVerif::getCreateTime,beginTime,finalEndTime)); + s.setTotal((int) total); + s.setRate((double) ((s.getConfirmed() / total ) * 100)); + return s; + }).toList(); JSONObject res = new JSONObject().fluentPut("caseVerificationMapList", caseVerificationMapList); return Result.success(res); } diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVGlobalController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVGlobalController.java index 590b7c4..afb84f8 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVGlobalController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVGlobalController.java @@ -104,6 +104,8 @@ public class DataVGlobalController { endTime = DateUtil.endOfDay(endTime); // 获取数据大屏中央总数概览 GlobalOverViewVo overview = negativeMapper.getAllGlobalCount(beginTime, endTime); + + MailOverviewVo vo = dataMailService.mailCount(beginTime, endTime); // 局长信箱 long mailboxNumber = negativeService.count(new LambdaQueryWrapper().between(Negative::getCrtTime, beginTime, endTime).eq(Negative::getProblemSourcesCode, ProblemSourcesEnum.JZXX.getValue())); diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java index 1f10267..d46973e 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java @@ -79,16 +79,20 @@ public class DataVRightsComfortController { List tortNames = rpcInfringerResultMapper.selectNamesByTime(beginTime, finalEndTime); long initialListSize = tortNames.size(); long hitPersonNumber = tortNames.stream() - .filter(s -> s.contains(",")) // 筛选出包含逗号的名称 + .filter(s -> s.contains(",")).toList().size(); + // 筛选出包含逗号的名称 + long nums = tortNames.stream() + .filter(s -> s.contains(",")) .mapToLong(s -> s.split(",").length) // 拆分每个名称并计算拆分后的数组长度 .sum();// 计算所有拆分后数组长度的总和 if(tortNames.stream().noneMatch(s -> s.contains(","))){ result.setHitPersonNumber(initialListSize ); }else{ - result.setHitPersonNumber(initialListSize + hitPersonNumber); + result.setHitPersonNumber(initialListSize - nums + hitPersonNumber); } - Map> collect = list.stream().filter(s-> StrUtil.isNotEmpty(s.getInfringerHandle()) && "1".equals(s.getType())) + Map> collect = list.stream() + .filter(s-> StrUtil.isNotEmpty(s.getInfringerHandle()) ) .collect(Collectors.groupingBy(RpcApply::getInfringerHandle)); // 打处情况 result.setPunishmentSituation(collect.keySet().stream().map(name -> { @@ -115,6 +119,7 @@ public class DataVRightsComfortController { CompletableFutureUtil.runSyncObject(()->{ // 维权案件情况 - 分县市局 result.setCountyRightsBarList(rpcApplyMapper.selectProtectRightsBarList(beginTime, finalEndTime, 3)); + }), CompletableFutureUtil.runSyncObject(()->{ @@ -197,13 +202,16 @@ public class DataVRightsComfortController { List tortNames = rpcInfringerResultMapper.selectNamesByOrgTime(beginTime, finalEndTime,departId); long initialListSize = tortNames.size(); long hitPersonNumber = tortNames.stream() - .filter(s -> s.contains(",")) // 筛选出包含逗号的名称 + .filter(s -> s.contains(",")).toList().size(); + // 筛选出包含逗号的名称 + long nums = tortNames.stream() + .filter(s -> s.contains(",")) .mapToLong(s -> s.split(",").length) // 拆分每个名称并计算拆分后的数组长度 .sum();// 计算所有拆分后数组长度的总和 if(tortNames.stream().noneMatch(s -> s.contains(","))){ re.setHitPersonNumber(initialListSize ); }else{ - re.setHitPersonNumber(initialListSize + hitPersonNumber); + re.setHitPersonNumber(initialListSize - nums + hitPersonNumber); } //抚慰金额 CompletableFutureUtil.runSyncObject(() -> { diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index 010096d..a1f0a7c 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -297,12 +297,12 @@ public interface NegativeMapper extends BaseMapper { List getCaseVerificationRank(Date beginTime, Date endTime, int groupId); - @Select("SELECT count(DISTINCT ng.id) AS total, " + + @Select("SELECT " + "COUNT( DISTINCT IF(ng.checkStatus IN (1, 2), ng.id, NULL) ) 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, " + - "IFNULL( ROUND( COUNT( DISTINCT IF(ng.checkStatus IN (1, 2), ng.id, NULL) ) / count(DISTINCT ng.id)*100, 1 ), 0 ) AS rate " + + "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} " + diff --git a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java index a4ae334..189041f 100644 --- a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java @@ -30,7 +30,7 @@ public interface RpcApplyMapper extends BaseMapper { @Select("SELECT " + " ra.case_category as name,COUNT(*) as value" + - " from rpc_apply as ra LEFT JOIN sup_depart sdp on ra.handle_depart_id = sdp.id " + + " from rpc_apply as ra LEFT JOIN sup_depart sdp on ra.second_depart_id = sdp.id " + "WHERE ra.case_type = #{type} " + " and ra.crt_time between #{beginTime} and #{endTime} " + " and ra.case_category is NOT NULL GROUP BY ra.case_category " @@ -78,17 +78,11 @@ public interface RpcApplyMapper extends BaseMapper { " GROUP BY person_type HAVING name is NOT NULL") List getIncidentPolice(Date beginTime, Date endTime); - @Select("SELECT " + - "sd1.short_name AS `name`, " + - "count(*) AS `value` " + - "FROM rpc_apply ra " + - "LEFT JOIN sup_depart sd ON ra.depart_id=sd.id " + - "AND sd.`level`=3 " + - "LEFT JOIN sup_depart sd1 ON sd.pid=sd1.id " + - "AND sd1.`level`=2 " + - "WHERE ra.crt_time BETWEEN #{beginTime} AND #{endTime} " + - "GROUP BY sd1.short_name " + - "HAVING `name` is NOT NULL") + @Select(" select sdp.short_name as name ,COUNT(*) as value from rpc_apply ra " + + " LEFT JOIN sup_depart sdp on ra.second_depart_id = sdp.id " + + " WHERE sdp.statistics_group_id = 3 " + + " and ra.crt_time BETWEEN #{beginTime} and #{endTime} " + + " GROUP BY sdp.short_name HAVING name is NOT NULL ") List getIncidentOrg(Date beginTime, Date endTime); // 二级大屏 diff --git a/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java index 107119e..fd2c6c5 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java @@ -2,6 +2,11 @@ package com.biutag.supervision.pojo.param; import lombok.Getter; import lombok.Setter; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; /** * @author wxc @@ -22,4 +27,9 @@ public class DataCaseVerifQueryParam extends BasePage { private String distributionState; private String checkStatus; // 是否属实 + + + // 问题发现时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List discoveryTime = new ArrayList<>(); } diff --git a/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java b/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java index 306d952..b297bc8 100644 --- a/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java +++ b/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java @@ -42,6 +42,9 @@ public class DataCaseVerifService extends ServiceImpl