Browse Source

fix: 案件核查大屏(优化);维权抚慰优化

master
pengwei 6 months ago
parent
commit
851333c5cb
  1. 18
      src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java
  2. 2
      src/main/java/com/biutag/supervision/controller/datav/DataVGlobalController.java
  3. 18
      src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java
  4. 6
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  5. 18
      src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java
  6. 10
      src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java
  7. 7
      src/main/java/com/biutag/supervision/service/DataCaseVerifService.java

18
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<JSONObject> 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<DataCaseVerif>().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<JSONObject> getCaseVerificationMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
endTime = DateUtil.endOfDay(endTime);
List<CaseVerificationMapVo> caseVerificationMapList = negativeMapper.getCaseVerificationMap(beginTime, endTime);
Date finalEndTime = DateUtil.endOfDay(endTime);
List<CaseVerificationMapVo> caseVerificationMapList = negativeMapper.getCaseVerificationMap(beginTime, finalEndTime);
caseVerificationMapList =caseVerificationMapList.stream().map(s->{
long total =dataCaseVerifMapper.selectCount(new LambdaQueryWrapper<DataCaseVerif>().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);
}

2
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<Negative>().between(Negative::getCrtTime, beginTime, endTime).eq(Negative::getProblemSourcesCode, ProblemSourcesEnum.JZXX.getValue()));

18
src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java

@ -79,16 +79,20 @@ public class DataVRightsComfortController {
List<String> 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<String, List<RpcApply>> collect = list.stream().filter(s-> StrUtil.isNotEmpty(s.getInfringerHandle()) && "1".equals(s.getType()))
Map<String, List<RpcApply>> 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<String> 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(() -> {

6
src/main/java/com/biutag/supervision/mapper/NegativeMapper.java

@ -297,12 +297,12 @@ public interface NegativeMapper extends BaseMapper<Negative> {
List<OrganizeProblemRankVo> 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} " +

18
src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java

@ -30,7 +30,7 @@ public interface RpcApplyMapper extends BaseMapper<RpcApply> {
@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<RpcApply> {
" GROUP BY person_type HAVING name is NOT NULL")
List<EchartsVo> 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<EchartsVo> getIncidentOrg(Date beginTime, Date endTime);
// 二级大屏

10
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<Date> discoveryTime = new ArrayList<>();
}

7
src/main/java/com/biutag/supervision/service/DataCaseVerifService.java

@ -42,6 +42,9 @@ public class DataCaseVerifService extends ServiceImpl<DataCaseVerifMapper, DataC
.eq(StrUtil.isNotBlank(queryParam.getCheckStatus()), DataCaseVerif::getIsReal, queryParam.getCheckStatus())
.eq(StrUtil.isNotBlank(queryParam.getDistributionState()), DataCaseVerif::getDistributionState, queryParam.getDistributionState())
.orderByDesc(DataCaseVerif::getCreateTime);
if( !queryParam.getDiscoveryTime().isEmpty()){
queryWrapper.between(DataCaseVerif::getCreateTime,queryParam.getDiscoveryTime().get(0),queryParam.getDiscoveryTime().get(1));
}
return page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper);
}
@ -131,6 +134,10 @@ public class DataCaseVerifService extends ServiceImpl<DataCaseVerifMapper, DataC
.like(StrUtil.isNotBlank(param.getCheckStatusDesc()), Negative::getCheckStatusDesc, param.getCheckStatusDesc())
.eq(Objects.nonNull(param.getCrtDepartLevel()), Negative::getCrtDepartLevel, param.getCrtDepartLevel())
.orderByDesc(Negative::getDiscoveryTime);
if( !param.getDiscoveryTime().isEmpty()){
queryWrapper.between(Negative::getCrtTime,param.getDiscoveryTime().get(0),param.getDiscoveryTime().get(1));
}
return negativeService.page(page, queryWrapper);
}

Loading…
Cancel
Save