Browse Source

fix--视频督察大屏接口sql改代码重构

master
parent
commit
38ed972baf
  1. 3
      src/main/java/com/biutag/supervision/constants/enums/DepartGroupEnum.java
  2. 67
      src/main/java/com/biutag/supervision/controller/datav/DataVGlobalController.java
  3. 73
      src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java
  4. 101
      src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java
  5. 110
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneVideoSuperviseController.java
  6. 14
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  7. 3
      src/main/java/com/biutag/supervision/pojo/request/datav/DataVRequest.java
  8. 10
      src/main/java/com/biutag/supervision/pojo/vo/VideoSuperviseCountVo.java
  9. 43
      src/main/java/com/biutag/supervision/service/datav/DatavService.java
  10. 484
      src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java

3
src/main/java/com/biutag/supervision/constants/enums/DepartGroupEnum.java

@ -12,7 +12,8 @@ import lombok.Getter;
public enum DepartGroupEnum { public enum DepartGroupEnum {
COUNTY_CITY_BUREAUS(3, "分县市局"), COUNTY_CITY_BUREAUS(3, "分县市局"),
BUREAU_AFFILIATED(4, "局属单位"); BUREAU_AFFILIATED(4, "局属单位"),
PCS(12, "派出所");
private Integer id; private Integer id;

67
src/main/java/com/biutag/supervision/controller/datav/DataVGlobalController.java

@ -113,33 +113,6 @@ public class DataVGlobalController {
//region 中间 //region 中间
/**
* 获取首页大屏中央数据
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "大屏中央数据")
@GetMapping("/getAllGlobalCount")
public Result<JSONObject> getAllGlobalCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
endTime = DateUtil.endOfDay(endTime);
// 获取数据大屏中央总数概览
GlobalOverViewVo overview = negativeMapper.getAllGlobalCount(beginTime, endTime);
long caseVerificationPro =dataCaseVerifMapper.selectCount(new LambdaQueryWrapper<DataCaseVerif>().between(DataCaseVerif::getCreateTime,beginTime,endTime));
overview.setCaseVerificationPro(caseVerificationPro);
MailOverviewVo vo = dataMailService.mailCount(beginTime, endTime);
// 局长信箱
// long mailboxNumber = negativeService.count(new LambdaQueryWrapper<Negative>().between(Negative::getCrtTime, beginTime, endTime).eq(Negative::getProblemSourcesCode, ProblemSourcesEnum.JZXX.getValue()));
long mailboxNumber = mailMapper.selectMailDataCount(beginTime,endTime);
overview.setMailboxNumber(mailboxNumber);
overview.setComplaintPro(vo.getCountryMail() + vo.getPoliceMail() + vo.getNumberMail());
JSONObject data = new JSONObject().fluentPut("overview", overview);
return Result.success(data);
}
/** /**
* 获取首页大屏中央数据 * 获取首页大屏中央数据
* *
@ -152,46 +125,6 @@ public class DataVGlobalController {
return datavService.getAllGlobalCount(request); return datavService.getAllGlobalCount(request);
} }
/**
* 地图数据
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
* 弃用 请看 {@link #getGlobalMap(DataVRequest)}
*/
@Operation(summary = "首页大屏地图Icon数据")
@Deprecated
@GetMapping("/getGlobalMap")
// @Cacheable(cacheNames = "Supervision:Screen:GlobalMap", key = "#beginTime.getTime()+'_'+#endTime.getTime()")
public Result<JSONObject> getGlobalMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
Date bigEndTime = DateUtil.endOfDay(endTime);
// 地图数据
List<GlobalMapIconVo> mapIconVos = new ArrayList<>();
List<SupDepart> list = supDepartMapper.selectList(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getStatisticsGroupId,"3"));
list.forEach((s)->{
Integer departId =Integer.valueOf(s.getId());
GlobalMapIconVo vos=new GlobalMapIconVo();
GlobalOverViewVo overview = negativeMapper.getSuoOneAllGlobalCount(departId, beginTime, bigEndTime);
MailOverviewVo vo = dataMailService.mailCount(departId,beginTime, bigEndTime);
// 局长信箱
long mailboxNumber = negativeService.count(new LambdaQueryWrapper<Negative>()
.between(Negative::getCrtTime, beginTime, bigEndTime)
.eq(Negative::getProblemSourcesCode, ProblemSourcesEnum.JZXX.getValue())
.eq(Negative::getSecondInvolveDepartId,departId)
);
overview.setMailboxNumber(mailboxNumber);
overview.setComplaintPro(vo.getCountryMail() + vo.getPoliceMail() + vo.getNumberMail());
BeanUtil.copyProperties(overview,vos);
vos.setName(s.getShortName());
vos.setDepartId(s.getId());
mapIconVos.add(vos);
});
JSONObject data = new JSONObject().fluentPut("globalTempMapVoList", mapIconVos);
return Result.success(data);
}
@Operation(description = "首页大屏地图Icon数据") @Operation(description = "首页大屏地图Icon数据")

73
src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java

@ -47,7 +47,7 @@ public class DataVSupervisionNotifyController {
} }
@Operation(summary = "问题类型占比") @Operation(summary = "问题涉及方面分布")
@GetMapping("/getProblemTypeRate") @GetMapping("/getProblemTypeRate")
public Result<JSONObject> getProblemTypeRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getProblemTypeRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@ -73,41 +73,7 @@ public class DataVSupervisionNotifyController {
/**
* 地图小卡片
*
* @param beginTime 开始时间
* @param endTime 结束时间
*/
@Operation(summary = "获取现场专项地图数据")
@GetMapping("/getSupervisionNotifyMap")
public Result<JSONObject> getSupervisionNotifyMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
endTime = DateUtil.endOfDay(endTime);
//地图数据
List<SuperviseMapIconVo> superviseTempMapVoList = negativeMapper.getSupervisionMapIconData(beginTime, endTime);
//数据补充
Date finalEndTime = endTime;
superviseTempMapVoList.forEach(s->{
String relationOrg =negativeMapper.getSupervisionMapStringData(beginTime, finalEndTime,"department",s.getDepartId()) ;
String personNum =negativeMapper.getSupervisionMapStringData(beginTime, finalEndTime,"personal",s.getDepartId()) ;;
// String completedRate = negativeMapper.getSupervisionMapCompletedRate(beginTime, finalEndTime,s.getDepartId());
// double rate = s.getTotalPro() == 0 ? 0: NumberUtil.round((double) s.getCompletedNumber() / s.getTotalPro() * 100, 2).doubleValue();
// s.setCompletedRate(String.valueOf(rate));
s.setPersonNum(personNum);
s.setRelationOrg(relationOrg);
});
JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList);
return Result.success(data);
}
/**
* 获取现场督察问题趋势
*
* @param year 年份
* @return List<EchartsVo>
*/
@Operation(summary = "问题趋势") @Operation(summary = "问题趋势")
@GetMapping("/getSupervisionTrend") @GetMapping("/getSupervisionTrend")
public Result<JSONObject> getSupervisionTrend(@RequestParam Integer year) { public Result<JSONObject> getSupervisionTrend(@RequestParam Integer year) {
@ -120,43 +86,12 @@ public class DataVSupervisionNotifyController {
// region 右边 // region 右边
/**
* 获取问题数
* @param beginTime 开始时间
* @param endTime 结束时间
* @return JSONObject
*/
@Operation(summary = "黄赌毒数据") @Operation(summary = "黄赌毒数据")
@GetMapping("/getYellowBetDrug") @PostMapping("/getYellowBetDrug")
public Result<JSONObject> getYellowBetDrug(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getYellowBetDrug(@RequestBody DataVRequest request) {
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime, return datavService.getYellowBetDrug(request);
String dictValue) {
endTime = DateUtil.endOfDay(endTime);
// 分县市局
DayTimeSuperviseVo countyOverview = negativeMapper.getYellowBetOverview(beginTime, endTime, 3, dictValue);
List<OrganizeProblemRankVo> countyRankList = negativeMapper.getYellowBetRankList(beginTime, endTime, 3, dictValue);
// 局属单位
DayTimeSuperviseVo bureauOverview = negativeMapper.getYellowBetOverview(beginTime, endTime, 4, dictValue);
List<OrganizeProblemRankVo> bureauRankList = negativeMapper.getYellowBetRankList(beginTime, endTime, 4, dictValue);
DayTimeSuperviseVo overView = new DayTimeSuperviseVo().addVO(countyOverview,bureauOverview);
JSONObject data = new JSONObject()
.fluentPut("overView",overView)
.fluentPut("countyOverview", countyOverview)
.fluentPut("countyRankList", countyRankList)
.fluentPut("bureauOverview", bureauOverview)
.fluentPut("bureauRankList", bureauRankList);
return Result.success(data);
} }
/**
* 督察工作动态
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return JSONObject
*/
@Operation(summary = "督察工作动态") @Operation(summary = "督察工作动态")
@GetMapping("/getWorkDynamics") @GetMapping("/getWorkDynamics")
public Result<List<News>> getWorkDynamics(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<List<News>> getWorkDynamics(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,

101
src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java

@ -2,25 +2,12 @@ package com.biutag.supervision.controller.datav;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.biutag.supervision.constants.enums.BlameType;
import com.biutag.supervision.constants.enums.InspectCaseEnum;
import com.biutag.supervision.constants.enums.ProblemSourcesEnum;
import com.biutag.supervision.constants.enums.ProcessingStatusEnum;
import com.biutag.supervision.mapper.NegativeMapper; import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.mapper.WvpDeviceChannelMapper; import com.biutag.supervision.mapper.WvpDeviceChannelMapper;
import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.Result;
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.entity.WvpDeviceChannel; import com.biutag.supervision.pojo.entity.WvpDeviceChannel;
import com.biutag.supervision.pojo.request.datav.DataVRequest; import com.biutag.supervision.pojo.request.datav.DataVRequest;
import com.biutag.supervision.pojo.vo.EchartsVo; import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo;
import com.biutag.supervision.pojo.vo.VideoSuperviseCountVo;
import com.biutag.supervision.pojo.vo.VideoSuperviseMapIconVo;
import com.biutag.supervision.service.NegativeBlameService;
import com.biutag.supervision.service.SupPoliceService;
import com.biutag.supervision.service.datav.DatavService; import com.biutag.supervision.service.datav.DatavService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@ -28,8 +15,8 @@ import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.Date;
import java.util.stream.Collectors; import java.util.List;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.SPDC; import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.SPDC;
@ -45,10 +32,7 @@ import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.SPDC;
public class DataVVideoSuperviseController { public class DataVVideoSuperviseController {
private final NegativeMapper negativeMapper; private final NegativeMapper negativeMapper;
private final NegativeBlameService blameService;
private final WvpDeviceChannelMapper wvpDeviceChannelMapper; private final WvpDeviceChannelMapper wvpDeviceChannelMapper;
private final SupPoliceService policeService;
private final DatavService datavService; private final DatavService datavService;
@ -89,88 +73,19 @@ public class DataVVideoSuperviseController {
//endregion //endregion
//region 中间 //region 中间
/**
* 获取视频督察中央数据
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "中央数据") @Operation(summary = "中央数据")
@GetMapping("/getAllVideoSuperviseCount") @PostMapping("/getAllVideoSuperviseCount")
public Result<JSONObject> getAllVideoSuperviseCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getAllVideoSuperviseCount(@RequestBody DataVRequest request) {
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { return datavService.getAllVideoSuperviseCount(request);
endTime = DateUtil.endOfDay(endTime);
// 获取视频督察中央数据
// VideoSuperviseCountVo overview = negativeMapper.getAllVideoSuperviseCount(beginTime, endTime);
VideoSuperviseCountVo overview = new VideoSuperviseCountVo();
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>().between(Negative::getCrtTime, beginTime, endTime)
.eq(Negative::getProblemSourcesCode, SPDC.getValue()));
overview.setTotal(negatives.size());
overview.setCompletionProblem(negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).count());
List<String> trueValue = List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue());
overview.setDiscoverProblem(negatives.stream().filter(item -> Objects.nonNull(item.getCheckStatus()) && trueValue.contains(item.getCheckStatus())).count());
if (negatives.isEmpty()) {
overview.setRelativeOrg(0L);
overview.setRelativePer(0L);
} else {
List<NegativeBlame> blames = blameService.list(new LambdaQueryWrapper<NegativeBlame>()
.in(NegativeBlame::getNegativeId, negatives.stream().map(Negative::getId).toList())
.isNotNull(NegativeBlame::getHandleResultCode)
.ne(NegativeBlame::getHandleResultCode, "")
.ne(NegativeBlame::getHandleResultName, "不予追责"));
List<NegativeBlame> departBlames = blames.stream().filter(item -> BlameType.department.name().equals(item.getType())).toList();
if (departBlames.isEmpty()) {
overview.setRelativeOrg(0L);
} else {
long count = policeService.list(new LambdaQueryWrapper<SupPolice>().in(SupPolice::getEmpNo, departBlames.stream().map(NegativeBlame::getBlameEmpNo).collect(Collectors.toSet()))).stream().map(SupPolice::getOrgId).distinct().count();
overview.setRelativeOrg(count);
}
overview.setRelativePer(blames.stream().filter(item -> BlameType.personal.name().equals(item.getType())).count());
} }
JSONObject data = new JSONObject().fluentPut("overview", overview);
return Result.success(data);
}
/**
* 获取视频督察地图数据
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@Operation(summary = "获取视频督察地图数据") @Operation(summary = "获取视频督察地图数据")
@GetMapping("/getVideoSuperviseMap") @PostMapping("/getVideoSuperviseMap")
public Result<JSONObject> getVideoSuperviseMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getVideoSuperviseMap(@RequestBody DataVRequest request) {
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { return datavService.getVideoSuperviseMap(request);
// 优化1: 快速失败检查
if (beginTime == null || endTime == null) {
return Result.success(new JSONObject().fluentPut("videoSuperviseMapIconVoList", Collections.emptyList()));
} }
endTime =DateUtil.endOfDay(endTime);
// 地图数据
List<VideoSuperviseMapIconVo> videoSuperviseMapIconVoList = Optional.ofNullable(negativeMapper.getVideoSuperviseMapIconInfo(beginTime, endTime)).
orElseGet(ArrayList::new);
videoSuperviseMapIconVoList.forEach(VideoSuperviseMapIconVo::initDefaultIfNull);
// List<EchartsVo> list = negativeMapper.selectRelativePer(beginTime,endTime);
// videoSuperviseMapIconVoList.forEach(s->{
// List<EchartsVo> echartsVoList= list.stream().filter(b->b.getName().contains(s.getDepartId())).toList();
// if(!echartsVoList.isEmpty()){
// int relativePer = echartsVoList.get(0).getValue();
// s.setRelativePer(relativePer);
// }
// });
JSONObject data = new JSONObject().fluentPut("videoSuperviseMapIconVoList", videoSuperviseMapIconVoList);
return Result.success(data);
}
// 获取视频督察大屏中央问题趋势统计 // 获取视频督察大屏中央问题趋势统计
@Operation(summary = "问题趋势统计") @Operation(summary = "问题趋势统计")
@GetMapping("/getVideoSuperviseTrend") @GetMapping("/getVideoSuperviseTrend")

110
src/main/java/com/biutag/supervision/controller/subdatav/SubOneVideoSuperviseController.java

@ -1,27 +1,19 @@
package com.biutag.supervision.controller.subdatav; package com.biutag.supervision.controller.subdatav;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest;
import com.biutag.supervision.pojo.vo.EchartsVo; import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo;
import com.biutag.supervision.pojo.vo.VideoSuperviseCountVo;
import com.biutag.supervision.pojo.vo.VideoSuperviseMapIconVo;
import com.biutag.supervision.service.SubOneVideoSuperviseService; import com.biutag.supervision.service.SubOneVideoSuperviseService;
import com.biutag.supervision.service.datav.DatavService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Optional;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.SPDC; import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.SPDC;
@ -37,90 +29,33 @@ import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.SPDC;
public class SubOneVideoSuperviseController { public class SubOneVideoSuperviseController {
private final SubOneVideoSuperviseService subOneVideoSuperviseService; private final SubOneVideoSuperviseService subOneVideoSuperviseService;
private final NegativeMapper negativeMapper; private final DatavService datavService;
// region 左边
/**
* 问题数排名
*
* @param departId 部门id分县市局ID
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@Operation(summary = "问题数排名") @Operation(summary = "问题数排名")
@GetMapping("/getSubOneVideoSuperviseProblemRank") @PostMapping("/getSubOneVideoSuperviseProblemRank")
public Result<JSONObject> getSubOneVideoSuperviseProblemRank(@RequestParam Integer departId, public Result<JSONObject> getSubOneVideoSuperviseProblemRank(@RequestBody SubDataVRequest request) {
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, return datavService.getSubOneVideoSuperviseProblemRank(request);
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
List<OrganizeProblemRankVo> policeVideoSuperviseProblemRankList = subOneVideoSuperviseService.getSuboOneVideoSuperviseProblemRank(beginTime, endTime, 10, departId);
List<OrganizeProblemRankVo> teamVideoSuperviseProblemRankList = subOneVideoSuperviseService.getSuboOneVideoSuperviseProblemRank(beginTime, endTime, -1, departId);
JSONObject data = new JSONObject();
data.fluentPut("policeVideoSuperviseProblemRankList", policeVideoSuperviseProblemRankList);
data.fluentPut("teamVideoSuperviseProblemRankList", teamVideoSuperviseProblemRankList);
return Result.success(data);
} }
// endregion
// region 中间
/**
* 中央总览数据
*
* @param departId 部门id分县市局ID
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "视频督察二级大屏中央数据") @Operation(summary = "视频督察二级大屏中央数据")
@GetMapping("/getSubOneAllVideoSuperviseCount") @PostMapping("/getSubOneAllVideoSuperviseCount")
public Result<JSONObject> getSubOneAllVideoSuperviseCount(@RequestParam Integer departId, public Result<JSONObject> getSubOneAllVideoSuperviseCount(@RequestBody SubDataVRequest request) {
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, return datavService.getSubOneAllVideoSuperviseCount(request);
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
endTime =DateUtil.endOfDay(endTime);
VideoSuperviseCountVo overview = subOneVideoSuperviseService.getSubOneAllVideoSuperviseCount(beginTime, DateUtil.endOfDay(endTime), departId);
JSONObject data = new JSONObject().fluentPut("overview", overview);
return Result.success(data);
} }
/**
* 地图Icon数据
*
* @param departId 部门id分县市局ID
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@Operation(summary = "地图Icon数据") @Operation(summary = "地图Icon数据")
@GetMapping("/getSubOneVideoSuperviseMap") @PostMapping("/getSubOneVideoSuperviseMap")
public Result<JSONObject> getSubOneVideoSuperviseMap(@RequestParam Integer departId, public Result<JSONObject> getSubOneVideoSuperviseMap(@RequestBody SubDataVRequest request) {
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, return datavService.getSubOneVideoSuperviseMap(request);
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
endTime =DateUtil.endOfDay(endTime);
// 地图数据
List<VideoSuperviseMapIconVo> videoSuperviseMapIconVoList = Optional.ofNullable(negativeMapper.getSubOneVideoSuperviseMapIconInfo(beginTime, endTime, departId)).
orElseGet(ArrayList::new);
List<EchartsVo> list =negativeMapper.selectSubOneRelativePer(beginTime,endTime,departId);
videoSuperviseMapIconVoList.forEach(s->{
List<EchartsVo> echartsVoList= list.stream().filter(b->b.getName().contains(s.getDepartId())).toList();
if(!echartsVoList.isEmpty()){
int relativePer = echartsVoList.get(0).getValue();
s.setRelativePer(relativePer);
}
});
JSONObject data = new JSONObject().fluentPut("videoSuperviseMapIconVoList", videoSuperviseMapIconVoList);
return Result.success(data);
} }
/**
* 视频督察二级数据大屏问题趋势统计
* @param departId 部门id分县市局ID
* @param year 年份
* @return
*/
@Operation(summary = "问题趋势统计") @Operation(summary = "问题趋势统计")
@GetMapping("/getSubOneVideoSuperviseTrend") @GetMapping("/getSubOneVideoSuperviseTrend")
public Result<JSONObject> getSubOneVideoSuperviseTrend(@RequestParam Integer departId, @RequestParam Integer year) { public Result<JSONObject> getSubOneVideoSuperviseTrend(@RequestParam Integer departId, @RequestParam Integer year) {
@ -129,18 +64,10 @@ public class SubOneVideoSuperviseController {
return Result.success(jsonObject); return Result.success(jsonObject);
} }
// endregion
// region 右边
/**
* 视频督察二级数据大屏问题类型占比
* @param departId 部门id分县市局ID
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@Operation(summary = "视频督察二级数据大屏问题类型占比") @Operation(summary = "视频督察二级数据大屏问题类型占比")
@GetMapping("/getSubOneVideoSuperviseProblemTypeRate") @GetMapping("/getSubOneVideoSuperviseProblemTypeRate")
public Result<JSONObject> getSubOneVideoSuperviseProblemTypeRate(@RequestParam Integer departId, public Result<JSONObject> getSubOneVideoSuperviseProblemTypeRate(@RequestParam Integer departId,
@ -150,6 +77,5 @@ public class SubOneVideoSuperviseController {
JSONObject jsonObject = new JSONObject().fluentPut("subOneVideoSuperviseProblemTypeRate", subOneVideoSuperviseProblemTypeRate); JSONObject jsonObject = new JSONObject().fluentPut("subOneVideoSuperviseProblemTypeRate", subOneVideoSuperviseProblemTypeRate);
return Result.success(jsonObject); return Result.success(jsonObject);
} }
// endregion
} }

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

@ -183,7 +183,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
@Select("SELECT npr.oneLevelContent as name, count(*) value FROM negative ng, negative_problem_relation npr " + @Select("SELECT npr.oneLevelContent as name, count(*) value FROM negative ng, negative_problem_relation npr " +
"WHERE ng.id = npr.negativeId " + "WHERE ng.id = npr.negativeId " +
"AND ng.problemSourcesCode in (13,14, 15) " + "AND ng.problemSourcesCode in (13,14, 15) " +
"and ng.checkStatus<>3 " + "and ng.check_status_code in (1, 2, 3) " +
"AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + "AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND oneLevelContent is NOT NULL " + "AND oneLevelContent is NOT NULL " +
"GROUP BY oneLevelContent ") "GROUP BY oneLevelContent ")
@ -1090,5 +1090,17 @@ public interface NegativeMapper extends BaseMapper<Negative> {
@Param("codes") List<String> codes @Param("codes") List<String> codes
); );
@Select("select ng.* from negative ng " +
"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 " +
"where " +
"ng.special_supervision =#{specialSupervision} " +
"and ng.crtTime >= #{beginTime} " +
"and ng.crtTime <= #{endTime} " +
"AND (sd.id =#{id} OR sdd.id=#{id} or sddd.id=#{id});"
)
List<Negative> getYellowBetNegativeList(String id, Date beginTime, Date endTime, String specialSupervision);
// endregion // endregion
} }

3
src/main/java/com/biutag/supervision/pojo/request/datav/DataVRequest.java

@ -27,6 +27,9 @@ public class DataVRequest implements ParamChecked {
@Schema(description = "结束时间") @Schema(description = "结束时间")
private Date endTime; private Date endTime;
@Schema(description = "专项督察类型")
private String specialSupervision;
@Override @Override
public void check() { public void check() {

10
src/main/java/com/biutag/supervision/pojo/vo/VideoSuperviseCountVo.java

@ -1,5 +1,6 @@
package com.biutag.supervision.pojo.vo; package com.biutag.supervision.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@ -14,10 +15,19 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor @NoArgsConstructor
public class VideoSuperviseCountVo { public class VideoSuperviseCountVo {
@Schema(description = "问题数")
private Integer total; private Integer total;
@Schema(description = "查实问题数")
private Long discoverProblem; private Long discoverProblem;
@Schema(description = "办结问题数")
private Long completionProblem; private Long completionProblem;
@Schema(description = "问责单位问题数")
private Long relativeOrg; private Long relativeOrg;
@Schema(description = "问责个人数")
private Long relativePer; private Long relativePer;
private Double completionRate; private Double completionRate;
} }

43
src/main/java/com/biutag/supervision/service/datav/DatavService.java

@ -235,4 +235,47 @@ public interface DatavService {
* @return * @return
*/ */
Result<JSONObject> getSupervisionNotifyMap(DataVRequest request); Result<JSONObject> getSupervisionNotifyMap(DataVRequest request);
/**
* 现场专项一级--黄赌毒
* @param request
* @return
*/
Result<JSONObject> getYellowBetDrug(DataVRequest request);
/**
* 视频督察 地图数据
* @param request
* @return
*/
Result<JSONObject> getVideoSuperviseMap(DataVRequest request);
/**
* 视频督察 总览
* @param request
* @return
*/
Result<JSONObject> getAllVideoSuperviseCount(DataVRequest request);
/**
* 视频督察 问题数排名
* @param request
* @return
*/
Result<JSONObject> getSubOneVideoSuperviseProblemRank(SubDataVRequest request);
/**
* 视频督察 二级总览
* @param request
* @return
*/
Result<JSONObject> getSubOneAllVideoSuperviseCount(SubDataVRequest request);
/**
* 视频督察 二级地图
* @param request
* @return
*/
Result<JSONObject> getSubOneVideoSuperviseMap(SubDataVRequest request);
} }

484
src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java

@ -3,11 +3,10 @@ package com.biutag.supervision.service.datav;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.AppConstants;
import com.biutag.supervision.constants.enums.*; import com.biutag.supervision.constants.enums.*;
import com.biutag.supervision.constants.enums.invest.DeleteStatusEnum; import com.biutag.supervision.constants.enums.invest.DeleteStatusEnum;
import com.biutag.supervision.constants.enums.invest.ReportProjectNodeEnum; import com.biutag.supervision.constants.enums.invest.ReportProjectNodeEnum;
@ -19,9 +18,9 @@ import com.biutag.supervision.pojo.dto.common.PieItem;
import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.pojo.entity.mailbox.Mail; import com.biutag.supervision.pojo.entity.mailbox.Mail;
import com.biutag.supervision.pojo.entity.report.ReportProject; import com.biutag.supervision.pojo.entity.report.ReportProject;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.pojo.param.*; import com.biutag.supervision.pojo.param.*;
import com.biutag.supervision.pojo.param.dataAudit.DataAuditQueryParam; import com.biutag.supervision.pojo.param.dataAudit.DataAuditQueryParam;
import com.biutag.supervision.pojo.param.negativeBlame.NegativeBlameQueryParam;
import com.biutag.supervision.pojo.request.datav.DataVRequest; import com.biutag.supervision.pojo.request.datav.DataVRequest;
import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest; import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest;
import com.biutag.supervision.pojo.vo.*; import com.biutag.supervision.pojo.vo.*;
@ -30,11 +29,11 @@ import com.biutag.supervision.repository.dataCaseVerif.DataCaseVerifResourceServ
import com.biutag.supervision.repository.dataPetitionComplaint.DataPetitionComplaintResourceService; import com.biutag.supervision.repository.dataPetitionComplaint.DataPetitionComplaintResourceService;
import com.biutag.supervision.repository.mail.MailResourceService; import com.biutag.supervision.repository.mail.MailResourceService;
import com.biutag.supervision.repository.negative.NegativeResourceService; import com.biutag.supervision.repository.negative.NegativeResourceService;
import com.biutag.supervision.repository.negativeBlame.NegativeBlameResourceService;
import com.biutag.supervision.repository.reportproject.ReportProjectResourceService; import com.biutag.supervision.repository.reportproject.ReportProjectResourceService;
import com.biutag.supervision.repository.supExternalDepart.SupExternalDepartResourceService; import com.biutag.supervision.repository.supExternalDepart.SupExternalDepartResourceService;
import com.biutag.supervision.repository.supdepart.SupDepartResourceService; import com.biutag.supervision.repository.supdepart.SupDepartResourceService;
import com.biutag.supervision.service.*; import com.biutag.supervision.service.*;
import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -43,7 +42,6 @@ import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -92,26 +90,12 @@ public class DatavServiceImpl implements DatavService {
@Resource @Resource
private NegativeService negativeService; private NegativeService negativeService;
@Resource
private RpcApplyService rpcApplyService;
@Resource
private SupDepartService supDepartService;
@Resource @Resource
private RpcApplyMapper rpcApplyMapper; private RpcApplyMapper rpcApplyMapper;
@Resource
private RpcPacksComfortService rpcPacksComfortService;
@Resource
private RpcComfortPacksService rpcComfortPacksService;
@Resource @Resource
private RpcComfortPacksMapper rpcComfortPacksMapper; private RpcComfortPacksMapper rpcComfortPacksMapper;
@Resource
private RpcApplyPersonService rpcApplyPersonService;
@Resource @Resource
private DataPetitionComplaintMapper dataPetitionComplaintMapper; private DataPetitionComplaintMapper dataPetitionComplaintMapper;
@ -135,7 +119,8 @@ public class DatavServiceImpl implements DatavService {
@Resource @Resource
private SuperviseReportService superviseReportService; private SuperviseReportService superviseReportService;
@Resource
private NegativeBlameResourceService negativeBlameResourceService;
private final String VALID_SIGN = "terminated"; private final String VALID_SIGN = "terminated";
private final String EX_SOURCE = "局长信箱"; private final String EX_SOURCE = "局长信箱";
@ -1053,7 +1038,7 @@ public class DatavServiceImpl implements DatavService {
List<Negative> fxsjList = negativeMapper.getVideoSuperviseProblemRank(fxsj.getId(), request.getBeginTime(), request.getEndTime()); List<Negative> fxsjList = negativeMapper.getVideoSuperviseProblemRank(fxsj.getId(), request.getBeginTime(), request.getEndTime());
// 总数 // 总数
long total = fxsjList.size(); long total = fxsjList.size();
if (total==0){ if (total == 0) {
continue; continue;
} }
// 市局下发 // 市局下发
@ -1071,7 +1056,7 @@ public class DatavServiceImpl implements DatavService {
List<Negative> fxsjList = negativeMapper.getVideoSuperviseProblemRank(jsdw.getId(), request.getBeginTime(), request.getEndTime()); List<Negative> fxsjList = negativeMapper.getVideoSuperviseProblemRank(jsdw.getId(), request.getBeginTime(), request.getEndTime());
// 总数 // 总数
long total = fxsjList.size(); long total = fxsjList.size();
if (total==0){ if (total == 0) {
continue; continue;
} }
// 市局下发 // 市局下发
@ -1143,7 +1128,7 @@ public class DatavServiceImpl implements DatavService {
List<Negative> negativeList = negativeMapper.getChangedRank(jsdw.getId(), request.getBeginTime(), request.getEndTime()); List<Negative> negativeList = negativeMapper.getChangedRank(jsdw.getId(), request.getBeginTime(), request.getEndTime());
// 问题数 // 问题数
int totalPro = negativeList.size(); int totalPro = negativeList.size();
if (totalPro==0){ if (totalPro == 0) {
continue; continue;
} }
// 办结数 // 办结数
@ -1230,26 +1215,33 @@ public class DatavServiceImpl implements DatavService {
superviseReportLambdaQueryWrapper.eq(SuperviseReport::getType, "1"); superviseReportLambdaQueryWrapper.eq(SuperviseReport::getType, "1");
List<SuperviseReport> superviseReportList = superviseReportService.list(superviseReportLambdaQueryWrapper); List<SuperviseReport> superviseReportList = superviseReportService.list(superviseReportLambdaQueryWrapper);
List<String> negativeIds = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).map(Negative::getId).toList(); List<String> negativeIds = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).map(Negative::getId).toList();
CompletableFuture.allOf(
CompletableFutureUtil.runSyncObject(() -> { NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam();
long personNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper<NegativeBlame>().in(NegativeBlame::getNegativeId, negativeIds) negativeBlameQueryParam.setNegativeIds(negativeIds);
.eq(NegativeBlame::getType, "personal") List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(negativeBlameQueryParam);
.isNotNull(NegativeBlame::getBlameName)
.ne(NegativeBlame::getBlameName, "") // 3. 个人问责
.ne(NegativeBlame::getHandleResultName, "不予追责") List<NegativeBlame> personalBlames = negativeBlames.stream()
.isNotNull(NegativeBlame::getHandleResultName) .filter(one -> BlameType.personal.name().equals(one.getType()))
.ne(NegativeBlame::getHandleResultName, "")); .filter(one -> StrUtil.isNotBlank(one.getHandleResultName()))
overView.setPersonNumber(personNumber); .filter(one -> !"不予追责".equals(one.getHandleResultName()))
}), .toList();
CompletableFutureUtil.runSyncObject(() -> { // 4. 领导问责(按 negativeId + 领导姓名 + 领导处理结果 去重)
long departNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper<NegativeBlame>().in(NegativeBlame::getNegativeId, negativeIds) Set<String> seenLead = new HashSet<>();
.eq(NegativeBlame::getType, "department") List<NegativeBlame> leadBlames = negativeBlames.stream()
.ne(NegativeBlame::getHandleResultName, "不予追责") .filter(one -> BlameType.personal.name().equals(one.getType()))
.isNotNull(NegativeBlame::getHandleResultName) .filter(one -> StrUtil.isNotBlank(one.getLeadHandleResultName()))
.ne(NegativeBlame::getHandleResultName, "")); .filter(one -> !"不予追责".equals(one.getLeadHandleResultName()))
overView.setDepartNumber(departNumber); .filter(one -> seenLead.add(
}) one.getNegativeId() + "_" + one.getLeadHandleResultName() + "_" + one.getLeadName()
).join(); ))
.toList();
// 5. 单位问责
List<NegativeBlame> unitBlames = negativeBlames.stream()
.filter(one -> BlameType.department.name().equals(one.getType()))
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName()))
.filter(one -> !"不予追责".equals(one.getHandleResultName()))
.toList();
// 通报问题数 // 通报问题数
overView.setProblemNumber(negatives.size()); overView.setProblemNumber(negatives.size());
@ -1259,6 +1251,9 @@ public class DatavServiceImpl implements DatavService {
overView.setProcessingNumber((long) processingList.size()); overView.setProcessingNumber((long) processingList.size());
// 已办结 // 已办结
overView.setCompletedNumber((long) completedList.size()); overView.setCompletedNumber((long) completedList.size());
// 问责单位数
overView.setDepartNumber((long) unitBlames.size());
overView.setPersonNumber((long) (personalBlames.size() + leadBlames.size()));
return Result.success(overView); return Result.success(overView);
} }
@ -1282,37 +1277,400 @@ public class DatavServiceImpl implements DatavService {
// superviseReportLambdaQueryWrapper.eq(SuperviseReport::getType, "1"); // superviseReportLambdaQueryWrapper.eq(SuperviseReport::getType, "1");
// List<SuperviseReport> superviseReportList = superviseReportService.list(superviseReportLambdaQueryWrapper); // List<SuperviseReport> superviseReportList = superviseReportService.list(superviseReportLambdaQueryWrapper);
List<String> negativeIds = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).map(Negative::getId).toList(); List<String> negativeIds = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).map(Negative::getId).toList();
CompletableFuture.allOf(
CompletableFutureUtil.runSyncObject(() -> {
long personNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper<NegativeBlame>().in(NegativeBlame::getNegativeId, negativeIds) NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam();
.eq(NegativeBlame::getType, "personal") negativeBlameQueryParam.setNegativeIds(negativeIds);
.isNotNull(NegativeBlame::getBlameName) List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(negativeBlameQueryParam);
.ne(NegativeBlame::getBlameName, "")
.ne(NegativeBlame::getHandleResultName, "不予追责") // 3. 个人问责
.isNotNull(NegativeBlame::getHandleResultName) List<NegativeBlame> personalBlames = negativeBlames.stream()
.ne(NegativeBlame::getHandleResultName, "")); .filter(one -> BlameType.personal.name().equals(one.getType()))
superviseMapIconVo.setPersonNum(String.valueOf(personNumber)); .filter(one -> StrUtil.isNotBlank(one.getHandleResultName()))
}), .filter(one -> !"不予追责".equals(one.getHandleResultName()))
CompletableFutureUtil.runSyncObject(() -> { .toList();
long departNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper<NegativeBlame>().in(NegativeBlame::getNegativeId, negativeIds) // 4. 领导问责(按 negativeId + 领导姓名 + 领导处理结果 去重)
.eq(NegativeBlame::getType, "department") Set<String> seenLead = new HashSet<>();
.ne(NegativeBlame::getHandleResultName, "不予追责") List<NegativeBlame> leadBlames = negativeBlames.stream()
.isNotNull(NegativeBlame::getHandleResultName) .filter(one -> BlameType.personal.name().equals(one.getType()))
.ne(NegativeBlame::getHandleResultName, "")); .filter(one -> StrUtil.isNotBlank(one.getLeadHandleResultName()))
superviseMapIconVo.setRelationOrg(String.valueOf(departNumber)); .filter(one -> !"不予追责".equals(one.getLeadHandleResultName()))
}) .filter(one -> seenLead.add(
).join(); one.getNegativeId() + "_" + one.getLeadHandleResultName() + "_" + one.getLeadName()
))
.toList();
// 5. 单位问责
List<NegativeBlame> unitBlames = negativeBlames.stream()
.filter(one -> BlameType.department.name().equals(one.getType()))
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName()))
.filter(one -> !"不予追责".equals(one.getHandleResultName()))
.toList();
superviseMapIconVo.setDepartId(fxsj.getId()); superviseMapIconVo.setDepartId(fxsj.getId());
superviseMapIconVo.setName(fxsj.getShortName()); superviseMapIconVo.setName(fxsj.getShortName());
superviseMapIconVo.setTotalPro(negatives.size()); superviseMapIconVo.setTotalPro(negatives.size());
superviseMapIconVo.setProcessingNumber(processingList.size()); superviseMapIconVo.setProcessingNumber(processingList.size());
superviseMapIconVo.setCompletedNumber(completedList.size()); superviseMapIconVo.setCompletedNumber(completedList.size());
superviseMapIconVo.setRelationOrg(String.valueOf(unitBlames.size()));
superviseMapIconVo.setPersonNum(String.valueOf(personalBlames.size() + leadBlames.size()));
superviseTempMapVoList.add(superviseMapIconVo); superviseTempMapVoList.add(superviseMapIconVo);
} }
JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList); JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList);
return Result.success(data); return Result.success(data);
} }
@Override
public Result<JSONObject> getYellowBetDrug(DataVRequest request) {
List<OrganizeProblemRankVo> countyRankList = new ArrayList<>();
List<OrganizeProblemRankVo> bureauRankList = new ArrayList<>();
SupDepartQueryParam supDepartQueryParam = new SupDepartQueryParam();
supDepartQueryParam.setStatisticsGroupId(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId());
List<SupDepart> fxsjDw = supDepartResourceService.query(supDepartQueryParam);
SupDepartQueryParam jsdwQueryParam = new SupDepartQueryParam();
jsdwQueryParam.setStatisticsGroupId(DepartGroupEnum.BUREAU_AFFILIATED.getId());
List<SupDepart> jsdwDw = supDepartResourceService.query(jsdwQueryParam);
Map<String, Negative> totalNegativeMap = new LinkedHashMap<>();
for (SupDepart fxsj : fxsjDw) {
List<Negative> negativeList = negativeMapper.getYellowBetNegativeList(fxsj.getId(), request.getBeginTime(), request.getEndTime(), request.getSpecialSupervision());
if (CollectionUtil.isEmpty(negativeList)) {
continue;
}
for (Negative negative : negativeList) {
totalNegativeMap.put(negative.getId(), negative);
}
OrganizeProblemRankVo organizeProblemRankVo = new OrganizeProblemRankVo();
organizeProblemRankVo.setLabel(fxsj.getShortName());
organizeProblemRankVo.setValue(String.valueOf(negativeList.size()));
countyRankList.add(organizeProblemRankVo);
}
for (SupDepart jsdw : jsdwDw) {
List<Negative> negativeList = negativeMapper.getYellowBetNegativeList(jsdw.getId(), request.getBeginTime(), request.getEndTime(), request.getSpecialSupervision());
if (CollectionUtil.isEmpty(negativeList)) {
continue;
}
for (Negative negative : negativeList) {
totalNegativeMap.put(negative.getId(), negative);
}
OrganizeProblemRankVo organizeProblemRankVo = new OrganizeProblemRankVo();
organizeProblemRankVo.setLabel(jsdw.getShortName());
organizeProblemRankVo.setValue(String.valueOf(negativeList.size()));
bureauRankList.add(organizeProblemRankVo);
}
// 排序
countyRankList.sort(Comparator.comparingInt((OrganizeProblemRankVo vo) -> Integer.parseInt(vo.getValue())).reversed());
bureauRankList.sort(Comparator.comparingInt((OrganizeProblemRankVo vo) -> Integer.parseInt(vo.getValue())).reversed());
List<Negative> totalNegativeList = new ArrayList<>(totalNegativeMap.values());
// List<Negative> processingList = totalNegativeList.stream().filter(item -> ProcessingStatusEnum.processing.name().equals(item.getProcessingStatus())).toList();
// List<Negative> completedList = totalNegativeList.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList();
long processingCount = totalNegativeList.stream()
.filter(item -> ProcessingStatusEnum.processing.name().equals(item.getProcessingStatus()))
.count();
long completedCount = totalNegativeList.stream()
.filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus()))
.count();
DayTimeSuperviseVo overView = new DayTimeSuperviseVo();
overView.setProTotal(totalNegativeList.size());
overView.setProcessingNumber(processingCount);
overView.setCompletedNumber(completedCount);
double completedRate = totalNegativeList.isEmpty()
? 0D
: BigDecimal.valueOf(completedCount)
.multiply(BigDecimal.valueOf(100))
.divide(BigDecimal.valueOf(totalNegativeList.size()), 2, RoundingMode.HALF_UP)
.doubleValue();
overView.setCompletedRate(completedRate);
JSONObject data = new JSONObject()
.fluentPut("overView", overView)
// .fluentPut("countyOverview", countyOverview)
.fluentPut("countyRankList", countyRankList)
// .fluentPut("bureauOverview", bureauOverview)
.fluentPut("bureauRankList", bureauRankList);
return Result.success(data);
}
@Override
public Result<JSONObject> getAllVideoSuperviseCount(DataVRequest request) {
NegativeQueryParam negativeQueryParam = new NegativeQueryParam();
negativeQueryParam.setProblemSourcesCode(List.of(SPDC.getValue()));
negativeQueryParam.setCrtTime(List.of(request.getBeginTime(), request.getEndTime()));
List<Negative> negatives = negativeResourceService.query(negativeQueryParam);
List<Negative> ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList();
List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList();
NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam();
negativeBlameQueryParam.setNegativeIds(ssList.stream().map(Negative::getId).toList());
List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(negativeBlameQueryParam);
// 3. 个人问责
List<NegativeBlame> 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<String> seenLead = new HashSet<>();
List<NegativeBlame> leadBlames = negativeBlames.stream()
.filter(one -> BlameType.personal.name().equals(one.getType()))
.filter(one -> StrUtil.isNotBlank(one.getLeadHandleResultName()))
.filter(one -> !"不予追责".equals(one.getLeadHandleResultName()))
.filter(one -> seenLead.add(
one.getNegativeId() + "_" + one.getLeadHandleResultName() + "_" + one.getLeadName()
))
.toList();
// 5. 单位问责
List<NegativeBlame> unitBlames = negativeBlames.stream()
.filter(one -> BlameType.department.name().equals(one.getType()))
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName()))
.filter(one -> !"不予追责".equals(one.getHandleResultName()))
.toList();
VideoSuperviseCountVo overview = new VideoSuperviseCountVo();
overview.setTotal(negatives.size());
overview.setCompletionProblem((long) completedList.size());
overview.setDiscoverProblem((long) ssList.size());
overview.setRelativeOrg((long) unitBlames.size());
overview.setRelativePer((long) (personalBlames.size() + leadBlames.size()));
JSONObject data = new JSONObject().fluentPut("overview", overview);
return Result.success(data);
}
@Override
public Result<JSONObject> getVideoSuperviseMap(DataVRequest request) {
SupDepartQueryParam supDepartQueryParam = new SupDepartQueryParam();
supDepartQueryParam.setStatisticsGroupId(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId());
List<SupDepart> fxsjDw = supDepartResourceService.query(supDepartQueryParam);
List<String> proCode = List.of(SPDC.getValue());
List<VideoSuperviseMapIconVo> videoSuperviseMapIconVoList = new ArrayList<>();
for (SupDepart fxsj : fxsjDw) {
List<Negative> negatives = negativeMapper.getNegativeListData(fxsj.getId(), request.getBeginTime(), request.getEndTime(), proCode);
List<Negative> ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList();
List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList();
NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam();
negativeBlameQueryParam.setNegativeIds(ssList.stream().map(Negative::getId).toList());
List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(negativeBlameQueryParam);
// 3. 个人问责
List<NegativeBlame> 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<String> seenLead = new HashSet<>();
List<NegativeBlame> 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<NegativeBlame> unitBlames = negativeBlames.stream()
.filter(one -> BlameType.department.name().equals(one.getType()))
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName()))
.filter(one -> !"不予追责".equals(one.getHandleResultName()))
.toList();
VideoSuperviseMapIconVo videoSuperviseMapIconVo = new VideoSuperviseMapIconVo();
videoSuperviseMapIconVo.setName(fxsj.getShortName());
videoSuperviseMapIconVo.setDepartId(fxsj.getId());
videoSuperviseMapIconVo.setDiscoverProblem(ssList.size());
videoSuperviseMapIconVo.setCompletionProblem(completedList.size());
videoSuperviseMapIconVo.setRelativeOrg(unitBlames.size());
videoSuperviseMapIconVo.setRelativePer(personalBlames.size() + leadBlames.size());
videoSuperviseMapIconVoList.add(videoSuperviseMapIconVo);
}
videoSuperviseMapIconVoList.forEach(VideoSuperviseMapIconVo::initDefaultIfNull);
JSONObject data = new JSONObject().fluentPut("videoSuperviseMapIconVoList", videoSuperviseMapIconVoList);
return Result.success(data);
}
@Override
public Result<JSONObject> getSubOneVideoSuperviseProblemRank(SubDataVRequest request) {
List<OrganizeProblemRankVo> policeVideoSuperviseProblemRankList = new ArrayList<>();
List<OrganizeProblemRankVo> teamVideoSuperviseProblemRankList = new ArrayList<>();
SupDepartQueryParam supDepartGroupParam = new SupDepartQueryParam();
supDepartGroupParam.setLevel("2");
List<SupDepart> supDepartList = supDepartResourceService.query(supDepartGroupParam);
Map<Boolean, List<SupDepart>> partitionedMap = supDepartList.stream()
.collect(Collectors.partitioningBy(one ->
request.getDepartId().equals(one.getPid()) &&
DepartGroupEnum.PCS.getId().equals(Integer.valueOf(one.getStatisticsGroupId()))
));
List<SupDepart> pcsList = partitionedMap.get(true); // 派出所
List<SupDepart> dwList = partitionedMap.get(false); // 大队
for (SupDepart pcs : pcsList) {
List<Negative> fxsjList = negativeMapper.getVideoSuperviseProblemRank(pcs.getId(), request.getBeginTime(), request.getEndTime());
// 总数
long total = fxsjList.size();
if (total == 0) {
continue;
}
// 市局下发
long sjxf = fxsjList.stream().filter(one -> Integer.valueOf(0).equals(one.getCrtDepartLevel())).count();
// 县局下发
long xjxf = fxsjList.stream().filter(one -> Integer.valueOf(2).equals(one.getCrtDepartLevel())).count();
OrganizeProblemRankVo organizeProblemRankVo = new OrganizeProblemRankVo();
organizeProblemRankVo.setLabel(pcs.getShortName());
organizeProblemRankVo.setCityNumber(String.valueOf(sjxf));
organizeProblemRankVo.setCountyNumber(String.valueOf(xjxf));
organizeProblemRankVo.setValue(String.valueOf(total));
policeVideoSuperviseProblemRankList.add(organizeProblemRankVo);
}
for (SupDepart dw : dwList) {
List<Negative> fxsjList = negativeMapper.getVideoSuperviseProblemRank(dw.getId(), request.getBeginTime(), request.getEndTime());
// 总数
long total = fxsjList.size();
if (total == 0) {
continue;
}
// 市局下发
long sjxf = fxsjList.stream().filter(one -> Integer.valueOf(0).equals(one.getCrtDepartLevel())).count();
// 县局下发
long xjxf = fxsjList.stream().filter(one -> Integer.valueOf(2).equals(one.getCrtDepartLevel())).count();
OrganizeProblemRankVo organizeProblemRankVo = new OrganizeProblemRankVo();
organizeProblemRankVo.setLabel(dw.getShortName());
organizeProblemRankVo.setCityNumber(String.valueOf(sjxf));
organizeProblemRankVo.setCountyNumber(String.valueOf(xjxf));
organizeProblemRankVo.setValue(String.valueOf(total));
teamVideoSuperviseProblemRankList.add(organizeProblemRankVo);
}
// 排序
policeVideoSuperviseProblemRankList.sort(
Comparator.comparingLong((OrganizeProblemRankVo vo) -> Long.parseLong(vo.getValue()))
.reversed()
);
teamVideoSuperviseProblemRankList.sort(
Comparator.comparingLong((OrganizeProblemRankVo vo) -> Long.parseLong(vo.getValue()))
.reversed()
);
JSONObject data = new JSONObject();
data.fluentPut("policeVideoSuperviseProblemRankList", policeVideoSuperviseProblemRankList);
data.fluentPut("teamVideoSuperviseProblemRankList", teamVideoSuperviseProblemRankList);
return Result.success(data);
}
@Override
public Result<JSONObject> getSubOneAllVideoSuperviseCount(SubDataVRequest request) {
List<Negative> negatives = negativeMapper.getNegativeListData(request.getDepartId(), request.getBeginTime(), request.getEndTime(), List.of(SPDC.getValue()));
List<Negative> ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList();
List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList();
NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam();
negativeBlameQueryParam.setNegativeIds(ssList.stream().map(Negative::getId).toList());
List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(negativeBlameQueryParam);
// 3. 个人问责
List<NegativeBlame> 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<String> seenLead = new HashSet<>();
List<NegativeBlame> leadBlames = negativeBlames.stream()
.filter(one -> BlameType.personal.name().equals(one.getType()))
.filter(one -> StrUtil.isNotBlank(one.getLeadHandleResultName()))
.filter(one -> !"不予追责".equals(one.getLeadHandleResultName()))
.filter(one -> seenLead.add(
one.getNegativeId() + "_" + one.getLeadHandleResultName() + "_" + one.getLeadName()
))
.toList();
// 5. 单位问责
List<NegativeBlame> unitBlames = negativeBlames.stream()
.filter(one -> BlameType.department.name().equals(one.getType()))
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName()))
.filter(one -> !"不予追责".equals(one.getHandleResultName()))
.toList();
VideoSuperviseCountVo overview = new VideoSuperviseCountVo();
overview.setTotal(negatives.size());
overview.setCompletionProblem((long) completedList.size());
overview.setDiscoverProblem((long) ssList.size());
overview.setRelativeOrg((long) unitBlames.size());
overview.setRelativePer((long) (personalBlames.size() + leadBlames.size()));
JSONObject data = new JSONObject().fluentPut("overview", overview);
return Result.success(data);
}
@Override
public Result<JSONObject> getSubOneVideoSuperviseMap(SubDataVRequest request) {
List<VideoSuperviseMapIconVo> videoSuperviseMapIconVoList = new ArrayList<>();
String departId = request.getDepartId();
Date beginTime = request.getBeginTime();
Date endTime = request.getEndTime();
List<String> proCode = List.of(SPDC.getValue());
// 查该区县局下属所有派出所
List<SupDepart> policeDeparts = supDepartMapper.selectPoliceDeparts(Integer.valueOf(departId));
for (SupDepart pcs : policeDeparts) {
List<Negative> negatives = negativeMapper.getNegativeListData(pcs.getId(), request.getBeginTime(), request.getEndTime(), proCode);
List<Negative> ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList();
List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList();
NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam();
negativeBlameQueryParam.setNegativeIds(ssList.stream().map(Negative::getId).toList());
List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(negativeBlameQueryParam);
// 3. 个人问责
List<NegativeBlame> 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<String> seenLead = new HashSet<>();
List<NegativeBlame> 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<NegativeBlame> unitBlames = negativeBlames.stream()
.filter(one -> BlameType.department.name().equals(one.getType()))
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName()))
.filter(one -> !"不予追责".equals(one.getHandleResultName()))
.toList();
VideoSuperviseMapIconVo videoSuperviseMapIconVo = new VideoSuperviseMapIconVo();
videoSuperviseMapIconVo.setName(pcs.getShortName());
videoSuperviseMapIconVo.setDepartId(pcs.getId());
videoSuperviseMapIconVo.setDiscoverProblem(ssList.size());
videoSuperviseMapIconVo.setCompletionProblem(completedList.size());
videoSuperviseMapIconVo.setRelativeOrg(unitBlames.size());
videoSuperviseMapIconVo.setRelativePer(personalBlames.size() + leadBlames.size());
videoSuperviseMapIconVoList.add(videoSuperviseMapIconVo);
}
videoSuperviseMapIconVoList.forEach(VideoSuperviseMapIconVo::initDefaultIfNull);
JSONObject data = new JSONObject().fluentPut("videoSuperviseMapIconVoList", videoSuperviseMapIconVoList);
return Result.success(data);
}
public Result<JSONObject> getSubOneMailMapIcon() { public Result<JSONObject> getSubOneMailMapIcon() {
// ✅ 注意:这里的 name 必须和地图 geojson 区域名一致(一般是“xx街道/园区”) // ✅ 注意:这里的 name 必须和地图 geojson 区域名一致(一般是“xx街道/园区”)

Loading…
Cancel
Save