Compare commits

..

6 Commits

  1. 2
      src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java
  2. 14
      src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java
  3. 44
      src/main/java/com/biutag/supervision/controller/datav/DataVMailViewController.java
  4. 38
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneCaseVerifController.java
  5. 291
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java
  6. 34
      src/main/java/com/biutag/supervision/mapper/DataCaseVerifMapper.java
  7. 339
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  8. 6
      src/main/java/com/biutag/supervision/pojo/request/subdatav/SubDataVRequest.java
  9. 4
      src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java
  10. 61
      src/main/java/com/biutag/supervision/service/SubOneSupervisionNotifyService.java
  11. 7
      src/main/java/com/biutag/supervision/service/datav/DatavService.java
  12. 113
      src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java
  13. 18
      src/main/java/com/biutag/supervision/service/subDatav/SubDatavService.java
  14. 348
      src/main/java/com/biutag/supervision/service/subDatav/SubDatavServiceImpl.java
  15. 27
      src/main/resources/mapper/SupTaskProblemMapper.xml

2
src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java

@ -84,5 +84,5 @@ public enum ProblemSourcesEnum {
public static final List<String> GROUP_27_28_29_30 = List.of("27", "28", "29", "30");
public static final List<String> GROUP_21_22_23_24_25 = List.of("21", "22", "23", "24", "25");
}

14
src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java

@ -91,20 +91,6 @@ public class DataVCaseVerifController {
}
// region 右边
@Deprecated
@Operation(summary = "案件来源占比 & 问责处理情况")
@GetMapping("/getCaseSourceRateAndDealSituation")
public Result<JSONObject> getCaseSourceRateAndDealSituation(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
endTime = DateUtil.endOfDay(endTime);
List<EchartsVo> caseSourceRateList = negativeMapper.getCaseSourceRate(beginTime, endTime);
List<EchartsVo> dealSituationPieList = negativeMapper.getDealSituation(beginTime, endTime);
JSONObject data = new JSONObject()
.fluentPut("caseSourceRateList", caseSourceRateList)
.fluentPut("dealSituationPieList", dealSituationPieList);
return Result.success(data);
}
@Operation(summary = "案件来源占比 & 问责处理情况")
@PostMapping("/getCaseSourceRateAndDealSituation")

44
src/main/java/com/biutag/supervision/controller/datav/DataVMailViewController.java

@ -2,24 +2,18 @@ package com.biutag.supervision.controller.datav;
import com.alibaba.fastjson.JSONObject;
import com.biutag.supervision.mapper.DataPetition12337Mapper;
import com.biutag.supervision.mapper.NegativeBlameMapper;
import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.request.datav.DataVRequest;
import com.biutag.supervision.pojo.vo.BlameStats;
import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.service.DataMailService;
import com.biutag.supervision.service.datav.DatavService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -36,7 +30,6 @@ public class DataVMailViewController {
private final DataMailService dataMailService;
private final DataPetition12337Mapper dataPetition12337Mapper;
private final NegativeMapper negativeMapper;
private final NegativeBlameMapper negativeBlameMapper;
private final DatavService datavService;
// region 左边
@ -89,42 +82,11 @@ public class DataVMailViewController {
return datavService.getEntanglementAndMassMail(request);
}
/**
* 追责问责情况
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "追责问责情况")
@GetMapping("/getResultCount")
public Result<Map<String,Integer>> getResultCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){
List<BlameStats> list = negativeBlameMapper.selectBlameStatsCount(beginTime,endTime);
Map<String,Integer> blameMap = new HashMap<>();
list.forEach(s->{
if(s.getResultName().indexOf("、") > 0){
for (String name:s.getResultName().split("、")){
if(!name.contains("不") && !name.contains("追责")){
if(blameMap.containsKey(name)){
blameMap.put(name,blameMap.get(name) + s.getResultCount());
}else{
blameMap.put(name,s.getResultCount());
}
}
}
}else{
if(!s.getResultName().contains("不") && !s.getResultName().contains("追责")){
if(blameMap.containsKey(s.getResultName())){
blameMap.put(s.getResultName(),blameMap.get(s.getResultName()) + s.getResultCount());
}else{
blameMap.put(s.getResultName(),s.getResultCount());
}
@PostMapping("/getResultCount")
public Result<JSONObject> getResultCount(@RequestBody DataVRequest request){
return datavService.getResultCount(request);
}
}
});
return Result.success(blameMap);
}
}

38
src/main/java/com/biutag/supervision/controller/subdatav/SubOneCaseVerifController.java

@ -47,18 +47,17 @@ public class SubOneCaseVerifController {
public Result<JSONObject> getCaseProblemProperty(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
List<EchartsVo> zfbaPieList = negativeMapper.getCaseProblemProperty(beginTime, endTime, departId, 6); // 执法办案
List<EchartsVo> fwglPieList = negativeMapper.getCaseProblemProperty(beginTime, endTime, departId, 11); // 服务管理
// List<EchartsVo> jgjjPieList = dataCaseVerifMapper.getCaseProblemProperty(beginTime, endTime, 6); // 警规
endTime = DateUtil.endOfDay(endTime);
List<EchartsVo> zfbaPieList = dataCaseVerifMapper.getCaseProblemProperty(beginTime, endTime, departId, 5); // 执法办案
List<EchartsVo> fwglPieList = dataCaseVerifMapper.getCaseProblemProperty(beginTime, endTime, departId, 1); // 服务管理
List<EchartsVo> jgjjPieList = dataCaseVerifMapper.getCaseProblemProperty(beginTime, endTime, departId,4); // 警规
JSONObject data = new JSONObject()
.fluentPut("zfbaPieList", zfbaPieList)
.fluentPut("fwglPieList", fwglPieList);
.fluentPut("fwglPieList", fwglPieList)
.fluentPut("jgjjPieList", jgjjPieList);
return Result.success(data);
}
// endregion
// region 中间
@Operation(summary = "中央数据总览")
@PostMapping("/getSubOneAllCaseVerificationCount")
@ -71,7 +70,6 @@ public class SubOneCaseVerifController {
@Operation(summary = "地图Icon数据")
@PostMapping("/getSubOneCaseVerificationMap")
// @Cacheable(cacheNames = "Supervision:Screen:SubOneCaseVerificationMap", key = "#departId+'_'+#beginTime.getTime() + '_' +#endTime.getTime()")
public Result<JSONObject> getSubOneCaseVerificationMap(@RequestBody SubDataVRequest request) {
return subDatavService.getSubOneCaseVerificationMap(request);
@ -90,33 +88,13 @@ public class SubOneCaseVerifController {
@GetMapping("/getSubOneCaseVerificationTrend")
public Result<JSONObject> getSubOneCaseVerificationTrend(@RequestParam String departId,
@RequestParam Integer year) {
List<EchartsVo> proTrendList = negativeMapper.getSubOneTrend(departId, String.valueOf(year), A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue());
List<String> proCode = List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue());
List<EchartsVo> proTrendList = negativeMapper.selectMonthStatByYear(year, departId, proCode);
JSONObject data = new JSONObject().fluentPut("proTrendList", proTrendList);
return Result.success(data);
}
/**
* 案件来源占比 问责处理情况
*
* @param departId 部门id (分县市局ID)
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "案件来源占比 & 问责处理情况")
@GetMapping("/getSubOneCaseSourceRateAndDealSituation")
public Result<JSONObject> getSubOneCaseSourceRateAndDealSituation(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
List<EchartsVo> caseSourceRateList = negativeMapper.getSuboOneCaseSourceRate(beginTime, endTime, departId);
List<EchartsVo> dealSituationPieList = negativeMapper.getSubOneDealSituation(beginTime, endTime, departId);
JSONObject data = new JSONObject()
.fluentPut("caseSourceRateList", caseSourceRateList)
.fluentPut("dealSituationPieList", dealSituationPieList);
return Result.success(data);
}
@Operation(summary = "案件来源占比 & 问责处理情况")
@PostMapping("/getSubOneCaseSourceRateAndDealSituation")

291
src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java

@ -1,260 +1,70 @@
package com.biutag.supervision.controller.subdatav;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.CountyStreetDeptMapper;
import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.pojo.vo.*;
import com.biutag.supervision.service.*;
import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil;
import com.biutag.supervision.pojo.entity.News;
import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest;
import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.service.NewsService;
import com.biutag.supervision.service.subDatav.SubDatavService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import static com.biutag.supervision.constants.WorkDynamicConstants.DCGZDT;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*;
/**
* @Auther: sh
* @Date: 2024/12/17 10:58
* @Description: 二级大屏现场督察
* 二级大屏现场专项
*/
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("datav/sub1/supervisonNotify")
@Tag(name = "现场督察二级大屏", description = "现场督察二级大屏")
@Tag(name = "现场专项二级大屏", description = "现场专项二级大屏")
public class SubOneSupervisionNotifyController {
private final SubOneSupervisionNotifyService subOneSupervisionNotifyService;
private final NegativeMapper negativeMapper;
private final NewsService newsService;
private final NegativeBlameService negativeBlameService;
private final CountyStreetDeptMapper countyStreetDeptMapper;
private final SuperviseReportService superviseReportService;
private final SupDepartService departService;
// region 左边
/**
* 获取日常督察情况
*
* @param departId 部门id (分县市局ID)
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@Operation(summary = "日常督察情况")
@GetMapping("/getSubOneChangedRank")
public Result<JSONObject> getSubOneChangedRank(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
DayTimeSuperviseVo policeRankOverview = negativeMapper.getPoliceRankOverview(departId, beginTime, endTime);
DayTimeSuperviseVo teamRankOverview = negativeMapper.getTeamRankOverview(departId, beginTime, endTime);
List<RankVo> policeChangedRankList = negativeMapper.getPoliceChangedRankList(departId, beginTime, endTime);
List<RankVo> teamChangedRankList = negativeMapper.getTeamChangedRankList(departId, beginTime, endTime);
private final SubDatavService subDatavService;
private final NegativeMapper negativeMapper;
DayTimeSuperviseVo vo = negativeMapper.selectRankOverview(departId,beginTime,endTime);
if(vo.getProTotal() == null || vo.getProTotal() == 0 || vo.getChanged() == 0){
vo.setCorrectionRate(0.0);
}else{
BigDecimal result = new BigDecimal(vo.getChanged() * 100)
.divide(new BigDecimal(vo.getProTotal()), 1, RoundingMode.HALF_UP);
vo.setCorrectionRate(result.doubleValue());
@Operation(summary = "现场督察卡片")
@PostMapping("/getSubOneChangedRank")
public Result<JSONObject> getSubOneChangedRank(@RequestBody SubDataVRequest request) {
return subDatavService.getSubOneChangedRank(request);
}
JSONObject data = new JSONObject()
.fluentPut("overview",vo)
.fluentPut("fxsjRankOverview", policeRankOverview)
.fluentPut("jsdwRankOverview", teamRankOverview)
.fluentPut("fxsjChangedRankList", policeChangedRankList)
.fluentPut("jsdwChangedRankList", teamChangedRankList);
return Result.success(data);
}
public Long isZero(Long val){
return val != null?val:0L;
}
/**
* 问题类型占比
*
* @param departId 部门id (分县市局ID)
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@Operation(summary = "问题类型占比")
@Operation(summary = "问题涉及方面分布")
@GetMapping("/getSubOneProblemTypeRate")
public Result<JSONObject> getSubOneProblemTypeRate(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
List<EchartsVo> wtlxList = subOneSupervisionNotifyService.getSubOneProblemTypeRatio(departId, beginTime, endTime);
List<EchartsVo> wtlxList = negativeMapper.getSubOneProblemTypeRatio(departId, beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("wtlxList", wtlxList);
return Result.success(data);
}
// endregion
// region 中间
/**
* 大屏中央总览数据
*
* @param departId 部门id (分县市局ID)
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@Operation(summary = "中央总览数据")
@GetMapping("/getSubOneSupervisionNotifyCount")
public Result<JSONObject> getAllSubOneSupervisionNotifyCount(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
endTime = DateUtil.endOfDay(endTime);
//, ProblemSourcesEnum.SPDC.getValue() 去除视频督察
//获取时间范围内 属于对应二级单位的数据
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>().between(Negative::getCrtTime, beginTime, endTime)
.eq(Negative::getSecondInvolveDepartId,departId)
.in(Negative::getProblemSourcesCode, List.of(ProblemSourcesEnum.XCDC.getValue(), ProblemSourcesEnum.LMGZ.getValue(), ProblemSourcesEnum.ZXDC.getValue())));
SupervisionNotifyOverView overView = new SupervisionNotifyOverView();
//属实的
List<String> negativeIds = negatives.stream().filter(item -> InspectCaseEnum.isItTure(item.getCheckStatus())).map(Negative::getId).toList();
overView.setProblemNumber(negatives.size());
//已办结的
overView.setCompletedNumber(negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).count());
//办理中
overView.setProcessingNumber(negatives.size() - overView.getCompletedNumber());
//问题期数
Long problemQuarter = superviseReportService.count(new LambdaQueryWrapper<SuperviseReport>()
.eq(SuperviseReport::getCrtDepartId,departId)
.between(SuperviseReport::getCrtTime,beginTime,endTime));
overView.setProblemQuarter(problemQuarter);
LambdaQueryWrapper<SuperviseReport> queryWrapper=new LambdaQueryWrapper<>();
List<String> orgIds = departService.getAllNodeIds(String.valueOf(departId));
queryWrapper.in(SuperviseReport::getCrtDepartId, orgIds);
overView.setReportNumber(superviseReportService.count(queryWrapper));
// 办结率
// overView.setCompletedRate(overView.getProblemNumber() == 0 ? 0: NumberUtil.roundHalfEven(NumberUtil.mul(NumberUtil.div(overView.getCompletedNumber(), overView.getProblemNumber()), 100), 0).doubleValue());
CompletableFuture.allOf(
CompletableFutureUtil.runSyncObject(() -> {
//问责人数
long personNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper<NegativeBlame>().in(NegativeBlame::getNegativeId, negativeIds)
.eq(NegativeBlame::getType, "personal")
.ne(NegativeBlame::getHandleResultName, "不予追责")
.isNotNull(NegativeBlame::getHandleResultName)
.ne(NegativeBlame::getHandleResultName, ""));
overView.setPersonNumber(personNumber);
}),
CompletableFutureUtil.runSyncObject(() -> {
//问责单位
long departNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper<NegativeBlame>().in(NegativeBlame::getNegativeId, negativeIds)
.eq(NegativeBlame::getType, "department")
.ne(NegativeBlame::getHandleResultName, "不予追责")
.isNotNull(NegativeBlame::getHandleResultName)
.ne(NegativeBlame::getHandleResultName, ""));
overView.setDepartNumber(departNumber);
})
).join();
JSONObject data = new JSONObject().fluentPut("overview", overView);
return Result.success(data);
@Operation(summary = "现场专项中心总览数据")
@PostMapping("/getSubOneSupervisionNotifyCount")
public Result<JSONObject> getAllSubOneSupervisionNotifyCount(@RequestBody SubDataVRequest request) {
return subDatavService.getAllSubOneSupervisionNotifyCount(request);
}
/**
* 地图小卡片
*
* @param departId 部门id (分县市局ID)
* @param beginTime 开始时间
* @param endTime 结束时间
*/
@Operation(summary = "地图小卡片")
@GetMapping("/getSubOneSupervisionMap")
public Result<JSONObject> getSubOneSupervisionMap(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
List<CountyStreetDept> streetDepts = countyStreetDeptMapper.selectList(new LambdaQueryWrapper<CountyStreetDept>().eq(CountyStreetDept::getDeptPid,departId));
List<SuperviseMapIconVo> overViews = new ArrayList<>();
if(ArrayUtil.isNotEmpty(streetDepts)){
streetDepts.forEach(s->{
SuperviseMapIconVo superviseMapIconVo =new SuperviseMapIconVo();
superviseMapIconVo.setName(s.getName());
superviseMapIconVo.setDepartId(s.getDeptId());
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>().between(Negative::getCrtTime, beginTime, endTime)
.eq(Negative::getThreeInvolveDepartId,s.getDeptId())
.in(Negative::getProblemSourcesCode, List.of(ProblemSourcesEnum.XCDC.getValue(), ProblemSourcesEnum.LMGZ.getValue(), ProblemSourcesEnum.ZXDC.getValue())));
if(!negatives.isEmpty()){
List<String> negativeIds = negatives.stream().filter(item -> InspectCaseEnum.isItTure(item.getCheckStatus())).map(Negative::getId).toList();
// 办结率
// superviseMapIconVo.setCompletedRate(superviseMapIconVo.getProblemNumber() == 0 ? 0: NumberUtil.roundHalfEven(NumberUtil.mul(NumberUtil.div(superviseMapIconVo.getCompletedNumber(), superviseMapIconVo.getProblemNumber()), 100), 0).doubleValue());
//问责人数 、问责单位数
CompletableFuture.allOf(
CompletableFutureUtil.runSyncObject(()->{
superviseMapIconVo.setTotalPro(negatives.size());
//已办理
superviseMapIconVo.setCompletedNumber((int) negatives.stream().filter(item ->ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).count());
//办理中
superviseMapIconVo.setProcessingNumber(negatives.size() - superviseMapIconVo.getCompletedNumber());
}),
CompletableFutureUtil.runSyncObject(() -> {
//问责人数
long personNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper<NegativeBlame>().in(NegativeBlame::getNegativeId, negativeIds)
.eq(NegativeBlame::getType, "personal")
.ne(NegativeBlame::getHandleResultName, "不予追责")
.isNotNull(NegativeBlame::getHandleResultName)
.ne(NegativeBlame::getHandleResultName, ""));
superviseMapIconVo.setPersonNum(String.valueOf(personNumber));
}),
CompletableFutureUtil.runSyncObject(() -> {
//问责单位
long departNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper<NegativeBlame>().in(NegativeBlame::getNegativeId, negativeIds)
.eq(NegativeBlame::getType, "department")
.ne(NegativeBlame::getHandleResultName, "不予追责")
.isNotNull(NegativeBlame::getHandleResultName)
.ne(NegativeBlame::getHandleResultName, ""));
superviseMapIconVo.setRelationOrg(String.valueOf(departNumber));
})
).join();
overViews.add(superviseMapIconVo);
}
});
}
JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", overViews);
return Result.success(data);
@Operation(summary = "现场专项二级地图")
@PostMapping("/getSubOneSupervisionNotifyMap")
public Result<JSONObject> getSubOneSupervisionNotifyMap(@RequestBody SubDataVRequest request) {
return subDatavService.getSubOneSupervisionNotifyMap(request);
}
/**
* 获取现场督察问题趋势
*
* @param departId 部门id (分县市局ID)
* @param year 年份
* @return List<EchartsVo>
*/
@Operation(summary = "问题趋势")
@GetMapping("/getSubOneSupervisionTrend")
public Result<JSONObject> getSubOneSupervisionTrend(@RequestParam Integer departId,
@ -264,62 +74,19 @@ public class SubOneSupervisionNotifyController {
return Result.success(data);
}
// endregion
// region 右边
/**
* 黄赌毒数据
*
* @param departId 部门id (分县市局ID)
* @param beginTime 开始时间
* @param endTime 结束时间
* @return JSONObject
*/
@Operation(summary = "黄赌毒数据")
@GetMapping("/getSubOneYellowBetDrug")
public Result<JSONObject> getYellowBetDrug(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime,@RequestParam Integer type) {
// 黄赌毒总览
DayTimeSuperviseVo fxsjYellowBetOverview = negativeMapper.getSubOnePoliceYellowBetOverview(beginTime, endTime, departId, type);
DayTimeSuperviseVo jsdwYellowBetOverview = negativeMapper.getSubOneTeamYellowBetOverview(beginTime, endTime, departId, type);
// 黄毒赌列表
List<OrganizeProblemRankVo> fxsjYellowBetRankList = negativeMapper.getSubOnePoliceYellowBetRankList(beginTime, endTime, departId, type);
List<OrganizeProblemRankVo> jsdwYellowBetRankList = negativeMapper.getSubOneTeamYellowBetRankList(beginTime, endTime, departId, type);
DayTimeSuperviseVo overview = new DayTimeSuperviseVo().addVO(fxsjYellowBetOverview,jsdwYellowBetOverview);
JSONObject data = new JSONObject()
.fluentPut("overview",overview)
.fluentPut("fxsjYellowBetOverview", fxsjYellowBetOverview)
.fluentPut("jsdwYellowBetOverview", jsdwYellowBetOverview)
.fluentPut("fxsjYellowBetRankList", fxsjYellowBetRankList)
.fluentPut("jsdwYellowBetRankList", jsdwYellowBetRankList);
return Result.success(data);
@PostMapping("/getSubOneYellowBetDrug")
public Result<JSONObject> getSubOneYellowBetDrug(@RequestBody SubDataVRequest request) {
return subDatavService.getSubOneYellowBetDrug(request);
}
/**
* 督察工作动态
*
* @param departId 部门id (分县市局ID)
* @param beginTime 开始时间
* @param endTime 结束时间
* @return JSONObject
*/
@Operation(summary = "督察工作动态")
@Operation(summary = "现场专项工作动态")
@GetMapping("/getSubOneWorkDynamics")
public Result<List<News>> getSubOneWorkDynamics(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
endTime = DateUtil.endOfDay(endTime);
List<News> newsList = newsService.getWorkDynamics(beginTime, endTime, DCGZDT, departId.toString());
return Result.success(newsList);
}
// endregion
}

34
src/main/java/com/biutag/supervision/mapper/DataCaseVerifMapper.java

@ -20,24 +20,11 @@ public interface DataCaseVerifMapper extends BaseMapper<DataCaseVerif> {
@Select("select involve_problem name, count(originId) value from data_case_verif where business_type_name = #{businessTypeName} and discovery_time between #{beginTime} and #{endTime} group by involve_problem")
List<PieItem> selectInvolveProblemGroupByBusinessTypeName(String businessTypeName, Date beginTime, Date endTime);
@Select("SELECT problemSources AS name, count(ng.id) AS value " +
"FROM negative ng " +
"WHERE problemSourcesCode IN (17, 18, 19, 20) " +
"GROUP BY problemSources")
List<EchartsVo> getCaseSourceRate(Date beginTime, Date endTime);
@Select("SELECT npr.threeLevelContent AS `name`, count(*) AS `value` " +
"FROM negative ng " +
"INNER JOIN negative_problem_relation npr ON ng.id=npr.negativeId " +
"WHERE ng.checkStatus in (1, 2) " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND ng.problemSourcesCode IN (17, 18, 19, 20) " +
"AND businessTypeCode = #{businessId} " +
"GROUP BY threeLevelContent ")
List<EchartsVo> getCaseProblemProperty(Date beginTime, Date endTime, Integer businessId);
/**
* 案件问题性质
@ -57,6 +44,25 @@ public interface DataCaseVerifMapper extends BaseMapper<DataCaseVerif> {
@Select("SELECT " +
" npr.twoLevelContent AS name, " +
" COUNT(*) AS `value` " +
"FROM " +
"negative ng " +
"LEFT JOIN negative_problem_relation npr ON ng.id = npr.negativeId " +
"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.check_status_code IN (1, 2, 3) " +
"AND ng.problemSourcesCode IN (17,18,19,20) " +
"AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND npr.oneLevelCode = #{code} " +
"AND (sd.id = #{departId} OR sdd.id = #{departId} OR sddd.id = #{departId}) " +
"GROUP BY npr.twoLevelContent ")
List<EchartsVo> getCaseProblemProperty(Date beginTime, Date endTime, Integer departId, Integer code);
@Select(" SELECT matter as name, COUNT(*) as value from confinement " +
" WHERE start_time BETWEEN #{beginTime} AND #{endTime} " +
" GROUP BY matter ")

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

@ -100,35 +100,22 @@ public interface NegativeMapper extends BaseMapper<Negative> {
@Select("SELECT npr.oneLevelContent as name, count(*) value FROM negative ng, negative_problem_relation npr " +
"WHERE ng.id = npr.negativeId " +
"AND ng.problemSourcesCode in (13,14, 15) " +
"and ng.check_status_code in (1, 2, 3) " +
"AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND oneLevelContent is NOT NULL " +
"GROUP BY oneLevelContent ")
@Select("SELECT " +
"npr.oneLevelContent as `name`, " +
"count(*) as `value` " +
"FROM negative ng " +
"LEFT JOIN negative_problem_relation npr on ng.id = npr.negativeId " +
"WHERE ng.problemSourcesCode IN (13, 14, 15) " +
"AND ng.check_status_code IN (1, 2, 3) " +
"AND ng.crtTime >= #{beginTime} AND ng.crtTime < #{endTime} " +
"AND npr.oneLevelContent is not NULL " +
"GROUP BY npr.oneLevelContent; ")
List<EchartsVo> getProblemTypeRatio(Date beginTime, Date endTime);
@Select("SELECT " +
" sd.short_name AS label, " +
" COUNT(DISTINCT ng.id) AS denominator, " +
" COUNT(DISTINCT IF(ng.isRectifyCode = 1, ng.id, NULL)) AS numerator, " +
" COUNT( DISTINCT IF(COALESCE(ng.isRectifyCode, 0) != 1, ng.id, NULL)) AS processingNumber, " +
" IFNULL( ROUND( COUNT(DISTINCT IF(ng.isRectifyCode = 1, ng.id, NULL)) / NULLIF(COUNT(DISTINCT ng.id), 0) * 100, 0 ), 0 ) AS value " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.second_involve_depart_id = sd.id " +
"LEFT JOIN sup_depart sd2 ON ng.three_involve_depart_id = sd2.id " +
"WHERE ng.problemSourcesCode IN (27, 28, 29, 30) " +
"AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND sd.statistics_group_id = #{groupId} " +
"GROUP BY second_involve_depart_id, sd.short_name " +
"ORDER BY VALUE DESC;")
List<AuditNegativeVo> getAuditNegativeVo(Date beginTime, Date endTime,String groupId);
@ -166,20 +153,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
// endregion
// region 案件核查大屏
@Select("SELECT " +
"sd.short_name AS label, " +
"COUNT( DISTINCT ng.id ) AS `value` " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.second_involve_depart_id = sd.id " +
"WHERE ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND sd.statistics_group_id=#{groupId} " +
"AND ng.problemSourcesCode IN (17,18,19,20) " +
"GROUP BY sd.short_name " +
"ORDER BY `value` DESC;")
List<OrganizeProblemRankVo> getCaseVerificationRank(Date beginTime, Date endTime, int groupId);
@Select("SELECT " +
@ -250,14 +224,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"GROUP BY nb.handleResultName")
List<EchartsVo> getDealSituation(Date beginTime, Date endTime);
@Select("SELECT npr.threeLevelContent AS `name`, " +
"count(DISTINCT(ng.id)) as `value` FROM negative ng " +
"INNER JOIN negative_blame nb ON nb.negativeId=ng.id AND nb.superviseMeasuresCode=#{type} " +
"INNER JOIN negative_problem_relation npr ON ng.id=npr.negativeId " +
"WHERE ng.checkStatus in (1, 2) " +
"AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY npr.threeLevelContent")
List<EchartsVo> getConfinementAndPause(Date beginTime, Date endTime, Integer type);
List<EchartsVo> getMailTrend(Integer year, Integer type);
@ -381,278 +348,27 @@ public interface NegativeMapper extends BaseMapper<Negative> {
List<EchartsVo> getSubOneVideoSuperviseProblemTypeRate(Integer departId, Date beginTime, Date endTime);
// region 二级大屏现场督察
//分县级 - 现场督察
@Select("SELECT " +
"COUNT(DISTINCT ng.id) AS proTotal, " +
"COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS changing, " +
"COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS changed, " +
"IFNULL(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS correctionRate " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " +
"WHERE ng.problemSourcesCode IN (13) " +
"AND ng.second_involve_depart_id=#{departId} " +
"AND sd.statistics_group_id=10 " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} ")
DayTimeSuperviseVo getPoliceRankOverview(Integer departId, Date beginTime, Date endTime);
@Select("SELECT " +
"COUNT(DISTINCT ng.id) AS proTotal, " +
"COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS changing, " +
"COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS changed, " +
"IFNULL(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS correctionRate " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " +
"WHERE ng.problemSourcesCode IN (13) " +
"AND ng.second_involve_depart_id=#{departId} " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} ")
DayTimeSuperviseVo selectRankOverview(Integer departId, Date beginTime, Date endTime);
//分县级 - 现场督察
@Select("SELECT " +
"COUNT(DISTINCT ng.id) AS proTotal, " +
"COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS changing, " +
"COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS changed, " +
"IFNULL(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS correctionRate " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " +
"WHERE ng.problemSourcesCode IN (13) " +
"AND ng.second_involve_depart_id=#{departId} " +
"AND sd.statistics_group_id!=10 " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} ")
DayTimeSuperviseVo getTeamRankOverview(Integer departId, Date beginTime, Date endTime);
//分县级 - 现场督察
@Select("SELECT " +
"sd.short_name AS label, " +
"COUNT(DISTINCT ng.id) AS denominator, " +
"COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS numerator, " +
"ifnull(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1),0) AS rate, " +
"ifnull(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1),0) AS value " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " +
"WHERE ng.problemSourcesCode IN (13) " +
"AND ng.second_involve_depart_id=#{departId} " +
"AND sd.statistics_group_id=10 " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY sd.short_name " +
"ORDER BY denominator DESC;")
List<RankVo> getPoliceChangedRankList(Integer departId, Date beginTime, Date endTime);
//分县级 - 现场督察
@Select("SELECT " +
"sd.short_name AS label, " +
"COUNT(DISTINCT ng.id) AS denominator, " +
"COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) ) AS numerator, " +
"ifnull(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1),0) AS rate, " +
"ifnull(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1),0) AS value " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " +
"WHERE ng.problemSourcesCode IN (13) " +
"AND ng.second_involve_depart_id=#{departId} " +
"AND sd.statistics_group_id!=10 " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY sd.short_name " +
"ORDER BY denominator DESC;")
List<RankVo> getTeamChangedRankList(Integer departId, Date beginTime, Date endTime);
@Select("SELECT sd.short_name as label, " +
"sd.id AS departId, " +
"count( DISTINCT ng.id) AS denominator, " +
"count( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL )) AS numerator, " +
"ROUND( COUNT(DISTINCT if(ng.processing_status='completed', ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS rate, " +
"ROUND( COUNT(DISTINCT if(ng.processing_status='completed', ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS value " +
"FROM sup_depart sd " +
"INNER JOIN negative ng on ng.involveDepartId=sd.id AND sd.statistics_group_id=10 AND sd.pid=#{departId} " +
"LEFT JOIN negative_blame nb on ng.id=nb.negativeId " +
"WHERE ng.problemSourcesCode=13 " +
"AND ng.checkStatus<>3 " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY label " +
"order by rate desc;")
List<RankVo> getSubOnePoliceChangedRateRank(Integer departId, Date beginTime, Date endTime);
@Select("SELECT sd.short_name as label, " +
"sd.id AS departId, " +
"count( DISTINCT ng.id) AS denominator, " +
"count( DISTINCT IF(ng.processing_status='completed', ng.id, NULL )) AS numerator, " +
"ROUND( COUNT(DISTINCT if(ng.processing_status='completed', ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS rate, " +
"ROUND( COUNT(DISTINCT if(ng.processing_status='completed', ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS value " +
"FROM sup_depart sd " +
"INNER JOIN negative ng on ng.involveDepartId=sd.id AND sd.statistics_group_id!=10 AND sd.pid=#{departId} " +
"LEFT JOIN negative_blame nb on ng.id=nb.negativeId " +
"WHERE ng.problemSourcesCode=13 " +
"AND ng.checkStatus<>3 " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY label " +
"order by rate desc;")
List<RankVo> getSubOneTeamChangedRateRank(Integer departId, Date beginTime, Date endTime);
@Select("SELECT npr.oneLevelContent as name, " +
"count(*) value " +
"FROM negative ng " +
"INNER JOIN negative_problem_relation npr ON ng.id = npr.negativeId " +
"INNER JOIN sup_depart sd ON ng.involveDepartId=sd.id AND sd.pid=#{departId} " +
"WHERE ng.problemSourcesCode in (13, 15) " +
"and ng.checkStatus<>3 " +
"AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND oneLevelContent is NOT NULL " +
"GROUP BY oneLevelContent ")
List<EchartsVo> getSubOneProblemTypeRatio(Integer departId, Date beginTime, Date endTime);
@Select("SELECT " +
"COUNT( DISTINCT ng.id ) AS problemNumber, " +
"COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS processingNumber, " +
"COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS completedNumber , " +
"COUNT( DISTINCT ng.involveDepartId ) AS departNumber, " +
"COUNT( DISTINCT nb.blameIdCode ) AS personNumber, " +
"ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) )/COUNT( DISTINCT ng.id) * 100, 1) AS rectifyRate " +
"FROM negative ng " +
"LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " +
"WHERE ng.problemSourcesCode IN (13, 15) " +
"AND ng.second_involve_depart_id=#{departId} " +
"AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} ")
SupervisionNotifyOverView getAllSubOneSupervisionNotifyCount(Integer departId, Date beginTime, Date endTime);
@Select("SELECT m.month_name AS `name`, IFNULL(COUNT(temp.id), 0) AS `value` FROM sup_month_monthname m " +
"LEFT JOIN " +
"( " +
"SELECT ng.* FROM negative ng INNER JOIN sup_depart sd ON ng.involveDepartId=sd.id WHERE sd.pid=#{departId} AND ng.checkStatus != 3 AND ng.problemSourcesCode IN (13, 15) " +
") AS temp ON DATE_FORMAT(temp.crtTime, '%m') = m.month " +
"AND YEAR(temp.crtTime) = #{year} " +
"GROUP by m.month_name " +
"ORDER BY m.month ASC;")
List<EchartsVo> getSubOneSupervisionTrend(Integer departId, String year);
@Select("SELECT " +
"COUNT(DISTINCT ng.id) AS proTotal, " +
"COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS changing, " +
"COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS changed, " +
"ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1) AS correctionRate " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " +
"WHERE ng.special_supervision=#{specialType} " +
"AND ng.second_involve_depart_id=#{departId} " +
"AND sd.statistics_group_id=10 " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime}; ")
DayTimeSuperviseVo getSubOnePoliceYellowBetOverview(Date beginTime, Date endTime, Integer departId, Integer specialType);
@Select("SELECT " +
"COUNT(DISTINCT ng.id) AS proTotal, " +
"COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS changing, " +
"COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS changed, " +
"ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1) AS correctionRate " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " +
"WHERE ng.special_supervision=#{specialType} " +
"AND ng.second_involve_depart_id=#{departId} " +
"AND sd.statistics_group_id!=10 " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime}; ")
DayTimeSuperviseVo getSubOneTeamYellowBetOverview(Date beginTime, Date endTime, Integer departId, Integer specialType);
@Select("SELECT " +
"sd.short_name AS label, " +
"COUNT( DISTINCT ng.id ) AS `value` " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " +
"WHERE ng.special_supervision=#{specialType} " +
"AND ng.second_involve_depart_id=#{departId} " +
"AND sd.statistics_group_id=10 " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY sd.short_name " +
"ORDER BY `value` DESC; ")
List<OrganizeProblemRankVo> getSubOnePoliceYellowBetRankList(Date beginTime, Date endTime, Integer departId, Integer specialType);
@Select("SELECT " +
"sd.short_name AS label, " +
"COUNT( DISTINCT ng.id ) AS `value` " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " +
"WHERE ng.special_supervision=#{specialType} " +
"AND ng.second_involve_depart_id=#{departId} " +
"AND sd.statistics_group_id!=10 " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY sd.short_name " +
"ORDER BY `value` DESC; ")
List<OrganizeProblemRankVo> getSubOneTeamYellowBetRankList(Date beginTime, Date endTime, Integer departId, Integer specialType);
// endregion
// region 二级大屏案件核查
@Select("SELECT " +
"ng.involveDepartName AS label, " +
"COUNT( DISTINCT ng.id ) AS `value` " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.involveDepartId = sd.id " +
"WHERE ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND ng.problemSourcesCode IN (17, 18, 19, 20)" +
"AND ng.second_involve_depart_id=#{departId} " +
"AND sd.statistics_group_id=10 " +
"GROUP BY ng.involveDepartName " +
"ORDER BY `value` DESC; ")
List<OrganizeProblemRankVo> getPoliceCaseVerificationRank(Date beginTime, Date endTime, Integer departId);
@Select("SELECT " +
"ng.involveDepartName AS label, " +
"COUNT( DISTINCT ng.id ) AS `value` " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.involveDepartId = sd.id " +
"WHERE ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND ng.problemSourcesCode IN (17, 18, 19, 20)" +
"AND ng.second_involve_depart_id=#{departId} " +
"AND sd.statistics_group_id!=10 " +
"GROUP BY ng.involveDepartName " +
"ORDER BY `value` DESC; ")
List<OrganizeProblemRankVo> getTeamCaseVerificationRank(Date beginTime, Date endTime, Integer departId);
@Select("SELECT npr.threeLevelContent AS name, " +
"COUNT(*) AS `value` FROM negative ng " +
"INNER JOIN sup_depart sd ON ng.involveDepartId=sd.id " +
"INNER JOIN negative_problem_relation npr ON ng.id=npr.negativeId " +
"WHERE ng.check_status_code in (1, 2, 3) " +
"AND sd.pid = #{departId} " +
"AND ng.problemSourcesCode IN (17,18,19,20) " +
"AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND ng.businessTypeCode = #{businessType} " +
"GROUP BY npr.threeLevelContent " +
"ORDER BY `value` DESC ")
List<EchartsVo> getCaseProblemProperty(Date beginTime, Date endTime, Integer departId, Integer businessType);
@Select("SELECT count(DISTINCT ng.id) AS total, " +
"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 " +
"npr.oneLevelContent as `name`, " +
"count(*) as `value` " +
"FROM negative ng " +
"LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " +
"WHERE ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND ng.second_involve_depart_id=#{departId} " +
"AND ng.problemSourcesCode in (17, 18, 19, 20)")
CaseVerificationCountVo getSuboOneAllCaseVerificationCount(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 ng.id ) AS total, " +
"COUNT( DISTINCT IF( ng.checkStatus<>3, ng.id, NULL ) ) AS confirmed, " +
"COUNT( DISTINCT IF( nb.handleResultCode!=14, nb.blameId, NULL ) ) AS dealCasePro, " +
"COUNT( DISTINCT nb.blameIdCode ) AS punishPre, " +
"COUNT( DISTINCT nb.blameDepartId ) AS punishOrg, " +
"IFNULL( ROUND( COUNT( DISTINCT IF( ng.isRectifyCode=1, ng.id, NULL ) )/COUNT( DISTINCT ng.id )*100, 1 ), 0) AS rate " +
"FROM county_street_dept csd " +
"LEFT JOIN negative ng ON ng.three_involve_depart_id=csd.dept_id " +
"AND ng.problemSourcesCode IN (17,18,19,20) " +
"AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND ng.second_involve_depart_id=#{departId} " +
"LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " +
"GROUP BY csd.dept_name " +
"HAVING csd.dept_pid=#{departId} ")
List<CaseVerificationMapVo> getSubOneCaseVerificationMap(Date beginTime, Date endTime, Integer departId);
"LEFT JOIN negative_problem_relation npr on ng.id = npr.negativeId " +
"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.problemSourcesCode IN (13, 14, 15) " +
"AND ng.check_status_code IN (1, 2, 3) " +
"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; ")
List<EchartsVo> getSubOneProblemTypeRatio(Integer departId, Date beginTime, Date endTime);
@Select("SELECT sdps.label AS `name` , " +
@ -788,5 +504,12 @@ public interface NegativeMapper extends BaseMapper<Negative> {
)
List<Negative> getYellowBetNegativeList(String id, Date beginTime, Date endTime, String specialSupervision);
List<EchartsVo> selectMonthStatByYear(
@Param("year") Integer year,
@Param("departId") String departId,
@Param("problemSourcesCodeList") List<String> problemSourcesCodeList
);
// endregion
}

6
src/main/java/com/biutag/supervision/pojo/request/subdatav/SubDataVRequest.java

@ -31,6 +31,12 @@ public class SubDataVRequest implements ParamChecked {
@Schema(description = "部门Id")
private String departId;
@Schema(description = "专项督察类型")
private String specialSupervision;
@Schema(description = "审计类型")
private String auditType;
@Override
public void check() {
if (Objects.isNull(beginTime) || Objects.isNull(endTime)){

4
src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java

@ -1,5 +1,6 @@
package com.biutag.supervision.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
@ -19,5 +20,8 @@ public class SuperviseMapIconVo implements Serializable {
private String relationOrg;
private String personNum;
private String completedRate;
@Schema(description = "通报期数")
private String reportNumber;
}

61
src/main/java/com/biutag/supervision/service/SubOneSupervisionNotifyService.java

@ -1,61 +0,0 @@
package com.biutag.supervision.service;
import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.RankVo;
import com.biutag.supervision.pojo.vo.SupervisionNotifyOverView;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* @Auther: sh
* @Date: 2024/12/17 16:27
* @Description: 现场督察二级大屏服务
*/
@RequiredArgsConstructor
@Service
public class SubOneSupervisionNotifyService {
private final NegativeMapper negativeMapper;
// public DayTimeSuperviseVo getChangedRankOverView(Integer groupId, Integer departId, Date beginTime, Date endTime) {
// DayTimeSuperviseVo res;
// if (groupId != null && groupId == 10) {
// res = negativeMapper.getPoliceChangedRankOverView(departId, beginTime, endTime);
// } else {
// res = negativeMapper.getTeamChangedRankOverView(departId, beginTime, endTime);
// }
// return res;
// }
public List<RankVo> getSubOneChangedRateRank(Integer groupId, Integer departId, Date beginTime, Date endTime) {
List<RankVo> res;
if (groupId != null && groupId == 10) {
res = negativeMapper.getSubOnePoliceChangedRateRank(departId, beginTime, endTime);
} else {
res = negativeMapper.getSubOneTeamChangedRateRank(departId, beginTime, endTime);
}
return res;
}
public List<EchartsVo> getSubOneProblemTypeRatio(Integer departId, Date beginTime, Date endTime) {
List<EchartsVo> res = negativeMapper.getSubOneProblemTypeRatio(departId, beginTime, endTime);
return res;
}
public SupervisionNotifyOverView getAllSubOneSupervisionNotifyCount(Integer departId, Date beginTime, Date endTime) {
SupervisionNotifyOverView res = negativeMapper.getAllSubOneSupervisionNotifyCount(departId, beginTime, endTime);
return res;
}
public List<EchartsVo> getSubOneSupervisionTrend(Integer departId, String year) {
List<EchartsVo> res = negativeMapper.getSubOneSupervisionTrend(departId, year);
return res;
}
}

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

@ -209,4 +209,11 @@ public interface DatavService {
* @return
*/
Result<JSONObject> getAuditNegativeVo(DataVRequest request);
/**
* 信访追责问责情况
* @param request
* @return
*/
Result<JSONObject> getResultCount(DataVRequest request);
}

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

@ -37,6 +37,7 @@ import com.biutag.supervision.service.*;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import net.logstash.logback.encoder.org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
@ -131,6 +132,9 @@ public class DatavServiceImpl implements DatavService {
@Resource
private DataCaseVerifMapper dataCaseVerifMapper;
@Resource
private SupDepartService supDepartService;
private static final String NO_BLAME = "不予追责";
private static final BigDecimal WAN = new BigDecimal("10000");
@ -709,53 +713,36 @@ public class DatavServiceImpl implements DatavService {
List<SupDepart> fxsjDw = supDepartResourceService.query(supDepartQueryParam);
List<String> proCode = List.of(XCDC.getValue(), LMGZ.getValue(), ZXDC.getValue());
SupDepartGroupParam supDepartGroupParam = new SupDepartGroupParam();
supDepartGroupParam.setGroupId(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId());
supDepartGroupParam.setParentLevel(2);
supDepartGroupParam.setChildLevel(3);
Map<String, DepartAndSubDepartDto> departAndSubDepart = supDepartResourceService.getDepartAndSubDepart(supDepartGroupParam);
for (SupDepart fxsj : fxsjDw) {
SuperviseMapIconVo superviseMapIconVo = new SuperviseMapIconVo();
List<Negative> negatives = negativeMapper.getNegativeListData(fxsj.getId(), request.getBeginTime(), request.getEndTime(), proCode);
List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList();
List<Negative> processingList = negatives.stream().filter(item -> ProcessingStatusEnum.processing.name().equals(item.getProcessingStatus())).toList();
// 暂不用通报期数
// LambdaQueryWrapper<SuperviseReport> superviseReportLambdaQueryWrapper = new LambdaQueryWrapper<>();
// superviseReportLambdaQueryWrapper.between(SuperviseReport::getCrtTime, request.getBeginTime(), request.getEndTime());
// superviseReportLambdaQueryWrapper.eq(SuperviseReport::getType, "1");
// 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();
NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam();
negativeBlameQueryParam.setNegativeIds(negativeIds);
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();
// 通报期数
LambdaQueryWrapper<SuperviseReport> superviseReportLambdaQueryWrapper = new LambdaQueryWrapper<>();
superviseReportLambdaQueryWrapper.between(SuperviseReport::getCrtTime, request.getBeginTime(), request.getEndTime());
superviseReportLambdaQueryWrapper.eq(SuperviseReport::getType, "1");
Set<String> allDepartIds = Optional.ofNullable(departAndSubDepart.get(fxsj.getId()))
.map(DepartAndSubDepartDto::getAllDepartIds)
.orElse(Collections.emptySet());
superviseReportLambdaQueryWrapper.in(CollectionUtil.isNotEmpty(allDepartIds), SuperviseReport::getCrtDepartId, allDepartIds);
List<SuperviseReport> superviseReportList = superviseReportService.list(superviseReportLambdaQueryWrapper);
BlameResult blameResult = this.buildBlameResult(negatives);
superviseMapIconVo.setDepartId(fxsj.getId());
superviseMapIconVo.setName(fxsj.getShortName());
superviseMapIconVo.setTotalPro(negatives.size());
superviseMapIconVo.setProcessingNumber(processingList.size());
superviseMapIconVo.setCompletedNumber(completedList.size());
superviseMapIconVo.setRelationOrg(String.valueOf(unitBlames.size()));
superviseMapIconVo.setPersonNum(String.valueOf(personalBlames.size() + leadBlames.size()));
superviseMapIconVo.setRelationOrg(String.valueOf(blameResult.unitBlames().size()));
superviseMapIconVo.setPersonNum(String.valueOf(blameResult.personalBlames().size() + blameResult.leadBlames().size()));
superviseMapIconVo.setReportNumber(String.valueOf(superviseReportList.size()));
superviseTempMapVoList.add(superviseMapIconVo);
}
JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList);
@ -1201,6 +1188,30 @@ public class DatavServiceImpl implements DatavService {
return Result.success(data);
}
@Override
public Result<JSONObject> getResultCount(DataVRequest request) {
List<EchartsVo> resultCountArray = new ArrayList<>();
NegativeQueryParam negativeQueryParam = new NegativeQueryParam();
negativeQueryParam.setCrtTime(List.of(request.getBeginTime(), request.getEndTime()));
negativeQueryParam.setProblemSourcesCode(GROUP_21_22_23_24_25);
List<Negative> negatives = negativeResourceService.query(negativeQueryParam);
BlameResult blameResult = this.buildBlameResult(negatives);
List<NegativeBlame> negativeBlames = blameResult.personalBlames();
Map<String, List<NegativeBlame>> blames = negativeBlames.stream()
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName()))
.filter(one -> !NO_BLAME.equals(one.getHandleResultName()))
.collect(Collectors.groupingBy(NegativeBlame::getHandleResultName));
for (Map.Entry<String, List<NegativeBlame>> entry : blames.entrySet()) {
EchartsVo echartsVo = new EchartsVo();
echartsVo.setName(entry.getKey());
echartsVo.setValue(entry.getValue().size());
resultCountArray.add(echartsVo);
}
this.filterZero(resultCountArray);
JSONObject data = new JSONObject().fluentPut("resultCountArray", resultCountArray);
return Result.success(data);
}
// endregion
// region审计监督一级
@ -1326,7 +1337,7 @@ public class DatavServiceImpl implements DatavService {
BigDecimal qtsjje = this.sumAmount(dataAuditList, DataAudit::getAuditAmount, new BigDecimal(1));
// 其他审计审减问题金额
BigDecimal qtsjwtje = this.sumAmount(dataAuditList, DataAudit::getIssueAmount, new BigDecimal(1));
overview.setProjectNumber(BigDecimal.valueOf(reportProjects.size()+ dataAuditList.size()));
overview.setProjectNumber(BigDecimal.valueOf(reportProjects.size() + dataAuditList.size()));
overview.setAuditAmount(zftzje.add(qtsjje));
overview.setAuditSjAmount(zftzsjje.add(qtsjwtje));
overview.setNegativeNumber(negativeListData.size());
@ -1370,10 +1381,7 @@ public class DatavServiceImpl implements DatavService {
List<DataAudit> dataAuditList = dataAuditResourceService.query(dataAuditQueryParam);
NegativeQueryParam negativeQueryParam = new NegativeQueryParam();
negativeQueryParam.setCrtTime(List.of(request.getBeginTime(), request.getEndTime()));
negativeQueryParam.setProblemSourcesCode(GROUP_27_28_29_30);
List<Negative> negativeListData = negativeResourceService.query(negativeQueryParam);
List<Negative> negativeListData = negativeMapper.getNegativeListData(key, request.getBeginTime(), request.getEndTime(), GROUP_27_28_29_30);
BlameResult blameResult = this.buildBlameResult(negativeListData);
// 政府投资总金额
@ -1385,7 +1393,7 @@ public class DatavServiceImpl implements DatavService {
// 其他审计审减问题金额
BigDecimal qtsjwtje = this.sumAmount(dataAuditList, DataAudit::getIssueAmount, new BigDecimal(1));
auditSuperviseMapIconVo.setProjectNumber(reportProjects.size()+ dataAuditList.size());
auditSuperviseMapIconVo.setProjectNumber(reportProjects.size() + dataAuditList.size());
auditSuperviseMapIconVo.setAuditAmount(zftzje.add(qtsjje));
auditSuperviseMapIconVo.setAuditSjAmount(zftzsjje.add(qtsjwtje));
auditSuperviseMapIconVo.setNegativeNumber(negativeListData.size());
@ -1514,7 +1522,6 @@ public class DatavServiceImpl implements DatavService {
// endregion
// region 辅助方法
private List<EchartsVo> filterZero(List<EchartsVo> list) {
return list.stream()
@ -1525,13 +1532,14 @@ public class DatavServiceImpl implements DatavService {
public record BlameResult(
List<NegativeBlame> personalBlames,
List<NegativeBlame> leadBlames
List<NegativeBlame> leadBlames,
List<NegativeBlame> unitBlames
) {
}
public BlameResult buildBlameResult(List<Negative> negativeListData) {
if (CollUtil.isEmpty(negativeListData)) {
return new BlameResult(List.of(), List.of());
return new BlameResult(List.of(), List.of(), List.of());
}
// 1. 筛选有效 negative
List<Negative> validNegatives = negativeListData.stream()
@ -1539,7 +1547,7 @@ public class DatavServiceImpl implements DatavService {
|| CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode()))
.toList();
if (CollUtil.isEmpty(validNegatives)) {
return new BlameResult(List.of(), List.of());
return new BlameResult(List.of(), List.of(), List.of());
}
// 2. 查询问责数据
NegativeBlameQueryParam param = new NegativeBlameQueryParam();
@ -1548,7 +1556,7 @@ public class DatavServiceImpl implements DatavService {
.toList());
List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(param);
if (CollUtil.isEmpty(negativeBlames)) {
return new BlameResult(List.of(), List.of());
return new BlameResult(List.of(), List.of(), List.of());
}
// 3. 个人问责
List<NegativeBlame> personalBlames = negativeBlames.stream()
@ -1565,7 +1573,13 @@ public class DatavServiceImpl implements DatavService {
one.getNegativeId() + "_" + one.getLeadHandleResultName() + "_" + one.getLeadName()
))
.toList();
return new BlameResult(personalBlames, leadBlames);
// 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();
return new BlameResult(personalBlames, leadBlames, unitBlames);
}
private LocalDateTime toLocalDateTime(Date date) {
@ -1652,9 +1666,6 @@ public class DatavServiceImpl implements DatavService {
// endregion
public Result<JSONObject> getSubOneMailMapIcon() {
// ✅ 注意:这里的 name 必须和地图 geojson 区域名一致(一般是“xx街道/园区”)

18
src/main/java/com/biutag/supervision/service/subDatav/SubDatavService.java

@ -50,6 +50,7 @@ public interface SubDatavService {
*/
Result<JSONObject> getSubOneVideoSuperviseMap(SubDataVRequest request);
/**
* 维权抚慰 二级大屏 维权案件情况
* @param request
@ -116,4 +117,21 @@ public interface SubDatavService {
// 案件来源占比 & 问责处理情况
Result<JSONObject> getSubOneCaseSourceRateAndDealSituation(SubDataVRequest request);
/**
* 现场专项二级现场督察卡片
* @param request
* @return
*/
Result<JSONObject> getSubOneChangedRank(SubDataVRequest request);
// 现场专项地图
Result<JSONObject> getSubOneSupervisionNotifyMap(SubDataVRequest request);
// 现场专项中心总览数据
Result<JSONObject> getAllSubOneSupervisionNotifyCount(SubDataVRequest request);
// 黄赌毒数据
Result<JSONObject> getSubOneYellowBetDrug(SubDataVRequest request);
}

348
src/main/java/com/biutag/supervision/service/subDatav/SubDatavServiceImpl.java

@ -19,8 +19,6 @@ import com.biutag.supervision.pojo.param.negativeBlame.NegativeBlameQueryParam;
import com.biutag.supervision.pojo.request.datav.DataVRequest;
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.dataCaseVerif.DataCaseVerifResourceService;
import com.biutag.supervision.repository.dataPetitionComplaint.DataPetitionComplaintResourceService;
import com.biutag.supervision.repository.mail.MailResourceService;
import com.biutag.supervision.repository.negative.NegativeResourceService;
@ -28,7 +26,10 @@ import com.biutag.supervision.repository.negativeBlame.NegativeBlameResourceServ
import com.biutag.supervision.repository.reportproject.ReportProjectResourceService;
import com.biutag.supervision.repository.supExternalDepart.SupExternalDepartResourceService;
import com.biutag.supervision.repository.supdepart.SupDepartResourceService;
import com.biutag.supervision.service.*;
import com.biutag.supervision.service.DataMailService;
import com.biutag.supervision.service.DataPetition12337Service;
import com.biutag.supervision.service.NegativeBlameService;
import com.biutag.supervision.service.SuperviseReportService;
import com.biutag.supervision.service.datav.DatavServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
@ -40,6 +41,7 @@ import java.time.ZoneId;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*;
@ -73,23 +75,9 @@ public class SubDatavServiceImpl implements SubDatavService {
@Resource
private SupExternalDepartResourceService supExternalDepartResourceService;
@Resource
private DataCaseVerifResourceService dataCaseVerifResourceService;
@Resource
private SupPoliceService supPoliceService;
@Resource
private DataAuditResourceService dataAuditResourceService;
@Resource
private NegativeService negativeService;
@Resource
private RpcApplyMapper rpcApplyMapper;
@Resource
private RpcComfortPacksMapper rpcComfortPacksMapper;
@Resource
private DataPetitionComplaintMapper dataPetitionComplaintMapper;
@ -114,8 +102,6 @@ public class SubDatavServiceImpl implements SubDatavService {
@Resource
private NegativeMapper negativeMapper;
@Resource
private SuperviseReportService superviseReportService;
@Resource
private NegativeBlameResourceService negativeBlameResourceService;
@ -123,6 +109,9 @@ public class SubDatavServiceImpl implements SubDatavService {
@Resource
private DataCaseVerifMapper dataCaseVerifMapper;
@Resource
private SuperviseReportService superviseReportService;
private static final String NO_BLAME = "不予追责";
private static final BigDecimal WAN = new BigDecimal("10000");
@ -429,6 +418,252 @@ public class SubDatavServiceImpl implements SubDatavService {
}
// endregion
// region 现场专项二级
// 现场督察卡片
public Result<JSONObject> getSubOneChangedRank(SubDataVRequest request) {
List<SupDepart> level3ByPidSupDepartList = supDepartResourceService.getLevel3ByPidSupDepartList(request.getDepartId());
List<SupDepart> policeDeparts = level3ByPidSupDepartList.stream()
.filter(one -> StrUtil.isNotBlank(one.getStatisticsGroupId()))
.filter(one -> DepartGroupEnum.PCS.getId().equals(Integer.valueOf(one.getStatisticsGroupId())))
.toList();
List<SupDepart> teamDeparts = level3ByPidSupDepartList.stream()
.filter(one -> {
String groupId = one.getStatisticsGroupId();
return !StrUtil.isNotBlank(groupId) || !DepartGroupEnum.PCS.getId().equals(Integer.valueOf(groupId));
})
.toList();
List<RankVo> fxsjChangedRankList = new ArrayList<>();
List<RankVo> jsdwChangedRankList = new ArrayList<>();
for (SupDepart pcs : policeDeparts) {
List<Negative> negativeList = negativeMapper.getChangedRank(pcs.getId(), request.getBeginTime(), request.getEndTime());
int totalPro = negativeList.size();
if (totalPro == 0) {
continue;
}
// 办结数
long completed = negativeList.stream().filter(Objects::nonNull).filter(one -> ProcessingStatusEnum.completed.name().equals(one.getProcessingStatus())).count();
// 市局下发
long sjxf = negativeList.stream().filter(Objects::nonNull).filter(one -> Integer.valueOf(0).equals(one.getCrtDepartLevel())).count();
// 县局下发
long xjxf = negativeList.stream().filter(Objects::nonNull).filter(one -> Integer.valueOf(2).equals(one.getCrtDepartLevel())).count();
String rate = BigDecimal.valueOf(completed)
.multiply(BigDecimal.valueOf(100))
.divide(BigDecimal.valueOf(totalPro), 1, RoundingMode.HALF_UP)
.toString();
RankVo rankVo = new RankVo();
rankVo.setLabel(pcs.getShortName());
rankVo.setDepartId(pcs.getId());
rankVo.setCityNumber(String.valueOf(sjxf));
rankVo.setCountyNumber(String.valueOf(xjxf));
rankVo.setNumerator(String.valueOf(completed));
rankVo.setDenominator(String.valueOf(totalPro));
rankVo.setValue(rate);
rankVo.setRate(rate);
fxsjChangedRankList.add(rankVo);
}
for (SupDepart dw : teamDeparts) {
List<Negative> negativeList = negativeMapper.getChangedRank(dw.getId(), request.getBeginTime(), request.getEndTime());
int totalPro = negativeList.size();
if (totalPro == 0) {
continue;
}
long completed = negativeList.stream()
.filter(Objects::nonNull)
.filter(one -> ProcessingStatusEnum.completed.name().equals(one.getProcessingStatus()))
.count();
long sjxf = negativeList.stream().filter(Objects::nonNull).filter(one -> Integer.valueOf(0).equals(one.getCrtDepartLevel())).count();
long xjxf = negativeList.stream().filter(Objects::nonNull).filter(one -> Integer.valueOf(2).equals(one.getCrtDepartLevel())).count();
String rate = BigDecimal.valueOf(completed)
.multiply(BigDecimal.valueOf(100))
.divide(BigDecimal.valueOf(totalPro), 1, RoundingMode.HALF_UP)
.toString();
RankVo rankVo = new RankVo();
rankVo.setLabel(dw.getShortName());
rankVo.setDepartId(dw.getId());
rankVo.setCityNumber(String.valueOf(sjxf));
rankVo.setCountyNumber(String.valueOf(xjxf));
rankVo.setNumerator(String.valueOf(completed));
rankVo.setDenominator(String.valueOf(totalPro));
rankVo.setValue(rate);
rankVo.setRate(rate);
jsdwChangedRankList.add(rankVo);
}
fxsjChangedRankList.sort(Comparator.comparingLong((RankVo vo) -> Long.parseLong(vo.getDenominator())).reversed());
jsdwChangedRankList.sort(Comparator.comparingLong((RankVo vo) -> Long.parseLong(vo.getDenominator())).reversed());
long total = Stream.concat(fxsjChangedRankList.stream(), jsdwChangedRankList.stream())
.mapToLong(vo -> Long.parseLong(vo.getDenominator()))
.sum();
long completed = Stream.concat(fxsjChangedRankList.stream(), jsdwChangedRankList.stream())
.mapToLong(vo -> Long.parseLong(vo.getNumerator()))
.sum();
long processing = total - completed;
double rate = total == 0 ? 0.0 : BigDecimal.valueOf(completed)
.multiply(BigDecimal.valueOf(100))
.divide(BigDecimal.valueOf(total), 1, RoundingMode.HALF_UP)
.doubleValue();
DayTimeSuperviseVo overview = new DayTimeSuperviseVo();
overview.setProTotal((int) total);
overview.setProcessingNumber(processing);
overview.setCompletedNumber(completed);
overview.setCompletedRate(rate);
JSONObject data = new JSONObject()
.fluentPut("overview", overview)
.fluentPut("fxsjChangedRankList", fxsjChangedRankList)
.fluentPut("jsdwChangedRankList", jsdwChangedRankList);
return Result.success(data);
}
// 现场专项地图
@Override
public Result<JSONObject> getSubOneSupervisionNotifyMap(SubDataVRequest request) {
List<SuperviseMapIconVo> superviseTempMapVoList = new ArrayList<>();
List<SupDepart> policeDeparts = supDepartMapper.selectPoliceDeparts(Integer.valueOf(request.getDepartId()));
List<String> proCode = List.of(XCDC.getValue(), LMGZ.getValue(), ZXDC.getValue());
for (SupDepart supDepart : policeDeparts) {
List<Negative> negatives = negativeMapper.getNegativeListData(supDepart.getId(), request.getBeginTime(), request.getEndTime(), proCode);
if (negatives.isEmpty()) {
continue;
}
List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList();
List<Negative> processingList = negatives.stream().filter(item -> ProcessingStatusEnum.processing.name().equals(item.getProcessingStatus())).toList();
// 通报期数
LambdaQueryWrapper<SuperviseReport> superviseReportLambdaQueryWrapper = new LambdaQueryWrapper<>();
superviseReportLambdaQueryWrapper.between(SuperviseReport::getCrtTime, request.getBeginTime(), request.getEndTime());
superviseReportLambdaQueryWrapper.eq(SuperviseReport::getType, "1");
superviseReportLambdaQueryWrapper.eq(SuperviseReport::getCrtDepartId, request.getDepartId());
List<SuperviseReport> superviseReportList = superviseReportService.list(superviseReportLambdaQueryWrapper);
DatavServiceImpl.BlameResult blameResult = this.buildBlameResult(negatives);
SuperviseMapIconVo superviseMapIconVo = new SuperviseMapIconVo();
superviseMapIconVo.setName(supDepart.getShortName());
superviseMapIconVo.setDepartId(supDepart.getId());
superviseMapIconVo.setTotalPro(negatives.size());
superviseMapIconVo.setCompletedNumber(completedList.size());
superviseMapIconVo.setProcessingNumber(processingList.size());
superviseMapIconVo.setPersonNum(String.valueOf(blameResult.personalBlames().size() + blameResult.leadBlames().size()));
superviseMapIconVo.setRelationOrg(String.valueOf(blameResult.unitBlames().size()));
superviseMapIconVo.setReportNumber(String.valueOf(superviseReportList.size()));
superviseTempMapVoList.add(superviseMapIconVo);
}
JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList);
return Result.success(data);
}
@Override
public Result<JSONObject> getAllSubOneSupervisionNotifyCount(SubDataVRequest request) {
SupervisionNotifyOverView overView = new SupervisionNotifyOverView();
List<String> proCode = List.of(XCDC.getValue(), LMGZ.getValue(), ZXDC.getValue());
List<Negative> negatives = negativeMapper.getNegativeListData(request.getDepartId(), request.getBeginTime(), request.getEndTime(), proCode);
List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList();
List<Negative> processingList = negatives.stream().filter(item -> ProcessingStatusEnum.processing.name().equals(item.getProcessingStatus())).toList();
SupDepartGroupParam supDepartGroupParam = new SupDepartGroupParam();
supDepartGroupParam.setGroupId(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId());
supDepartGroupParam.setParentLevel(2);
supDepartGroupParam.setChildLevel(3);
Map<String, DepartAndSubDepartDto> departAndSubDepart = supDepartResourceService.getDepartAndSubDepart(supDepartGroupParam);
Set<String> allDepartIds = Optional.ofNullable(departAndSubDepart.get(request.getDepartId()))
.map(DepartAndSubDepartDto::getAllDepartIds)
.orElse(Collections.emptySet());
LambdaQueryWrapper<SuperviseReport> superviseReportLambdaQueryWrapper = new LambdaQueryWrapper<>();
superviseReportLambdaQueryWrapper.between(SuperviseReport::getCrtTime, request.getBeginTime(), request.getEndTime());
superviseReportLambdaQueryWrapper.eq(SuperviseReport::getType, "1");
superviseReportLambdaQueryWrapper.in(CollectionUtil.isNotEmpty(allDepartIds), SuperviseReport::getCrtDepartId, allDepartIds);
List<SuperviseReport> superviseReportList = superviseReportService.list(superviseReportLambdaQueryWrapper);
DatavServiceImpl.BlameResult blameResult = this.buildBlameResult(negatives);
overView.setProblemNumber(negatives.size());
overView.setProcessingNumber((long) processingList.size());
overView.setCompletedNumber((long) completedList.size());
overView.setReportNumber((long) superviseReportList.size());
overView.setDepartNumber((long) blameResult.unitBlames().size());
overView.setPersonNumber((long) (blameResult.leadBlames().size() + blameResult.personalBlames().size()));
return Result.success(new JSONObject().fluentPut("overview", overView));
}
@Override
public Result<JSONObject> getSubOneYellowBetDrug(SubDataVRequest request) {
List<OrganizeProblemRankVo> fxsjYellowBetRankList = new ArrayList<>();
List<OrganizeProblemRankVo> jsdwYellowBetRankList = new ArrayList<>();
List<SupDepart> level3ByPidSupDepartList = supDepartResourceService.getLevel3ByPidSupDepartList(request.getDepartId());
List<SupDepart> policeDeparts = level3ByPidSupDepartList.stream()
.filter(one -> StrUtil.isNotBlank(one.getStatisticsGroupId()))
.filter(one -> DepartGroupEnum.PCS.getId().equals(Integer.valueOf(one.getStatisticsGroupId())))
.toList();
List<SupDepart> teamDeparts = level3ByPidSupDepartList.stream()
.filter(one -> {
String groupId = one.getStatisticsGroupId();
return !StrUtil.isNotBlank(groupId) || !DepartGroupEnum.PCS.getId().equals(Integer.valueOf(groupId));
})
.toList();
Map<String, Negative> totalNegativeMap = new LinkedHashMap<>();
for (SupDepart pcs : policeDeparts) {
List<Negative> negativeList = negativeMapper.getYellowBetNegativeList(pcs.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(pcs.getShortName());
organizeProblemRankVo.setValue(String.valueOf(negativeList.size()));
fxsjYellowBetRankList.add(organizeProblemRankVo);
}
for (SupDepart dw : teamDeparts) {
List<Negative> negativeList = negativeMapper.getYellowBetNegativeList(dw.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(dw.getShortName());
organizeProblemRankVo.setValue(String.valueOf(negativeList.size()));
jsdwYellowBetRankList.add(organizeProblemRankVo);
}
fxsjYellowBetRankList.sort(Comparator.comparingInt((OrganizeProblemRankVo vo) -> Integer.parseInt(vo.getValue())).reversed());
jsdwYellowBetRankList.sort(Comparator.comparingInt((OrganizeProblemRankVo vo) -> Integer.parseInt(vo.getValue())).reversed());
List<Negative> totalNegativeList = new ArrayList<>(totalNegativeMap.values());
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("fxsjYellowBetRankList", fxsjYellowBetRankList)
.fluentPut("jsdwYellowBetRankList", jsdwYellowBetRankList);
return Result.success(data);
}
// endregion
// region 案件核查二级
// 排名
@Override
@ -956,7 +1191,7 @@ public class SubDatavServiceImpl implements SubDatavService {
public DatavServiceImpl.BlameResult buildBlameResult(List<Negative> negativeListData) {
if (CollUtil.isEmpty(negativeListData)) {
return new DatavServiceImpl.BlameResult(List.of(), List.of());
return new DatavServiceImpl.BlameResult(List.of(), List.of(), List.of());
}
// 1. 筛选有效 negative
List<Negative> validNegatives = negativeListData.stream()
@ -964,7 +1199,7 @@ public class SubDatavServiceImpl implements SubDatavService {
|| CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode()))
.toList();
if (CollUtil.isEmpty(validNegatives)) {
return new DatavServiceImpl.BlameResult(List.of(), List.of());
return new DatavServiceImpl.BlameResult(List.of(), List.of(), List.of());
}
// 2. 查询问责数据
NegativeBlameQueryParam param = new NegativeBlameQueryParam();
@ -973,7 +1208,7 @@ public class SubDatavServiceImpl implements SubDatavService {
.toList());
List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(param);
if (CollUtil.isEmpty(negativeBlames)) {
return new DatavServiceImpl.BlameResult(List.of(), List.of());
return new DatavServiceImpl.BlameResult(List.of(), List.of(), List.of());
}
// 3. 个人问责
List<NegativeBlame> personalBlames = negativeBlames.stream()
@ -990,7 +1225,13 @@ public class SubDatavServiceImpl implements SubDatavService {
one.getNegativeId() + "_" + one.getLeadHandleResultName() + "_" + one.getLeadName()
))
.toList();
return new DatavServiceImpl.BlameResult(personalBlames, leadBlames);
// 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();
return new DatavServiceImpl.BlameResult(personalBlames, leadBlames, unitBlames);
}
private LocalDateTime toLocalDateTime(Date date) {
@ -1060,6 +1301,67 @@ public class SubDatavServiceImpl implements SubDatavService {
.divide(WAN, 2, RoundingMode.HALF_UP);
}
public Result<JSONObject> mockData() {
List<RankVo> fxsj = new ArrayList<>();
List<RankVo> jsdw = new ArrayList<>();
fxsj.add(build("城东派出所", "pcs_001", 15, 20, 8, 12));
fxsj.add(build("城西派出所", "pcs_002", 10, 18, 6, 12));
fxsj.add(build("开发区派出所", "pcs_003", 20, 30, 10, 20));
jsdw.add(build("刑侦大队", "team_001", 12, 15, 7, 8));
jsdw.add(build("治安大队", "team_002", 8, 12, 5, 7));
jsdw.add(build("网安大队", "team_003", 10, 25, 12, 13));
long total = Stream.concat(fxsj.stream(), jsdw.stream())
.mapToLong(vo -> Long.parseLong(vo.getDenominator()))
.sum();
long completed = Stream.concat(fxsj.stream(), jsdw.stream())
.mapToLong(vo -> Long.parseLong(vo.getNumerator()))
.sum();
long processing = total - completed;
double rate = total == 0 ? 0.0 :
BigDecimal.valueOf(completed)
.multiply(BigDecimal.valueOf(100))
.divide(BigDecimal.valueOf(total), 1, RoundingMode.HALF_UP)
.doubleValue();
DayTimeSuperviseVo overview = new DayTimeSuperviseVo();
overview.setProTotal((int) total);
overview.setProcessingNumber(processing);
overview.setCompletedNumber(completed);
overview.setCompletedRate(rate);
JSONObject data = new JSONObject()
.fluentPut("overview", overview)
.fluentPut("fxsjChangedRankList", fxsj)
.fluentPut("jsdwChangedRankList", jsdw);
return Result.success(data);
}
private RankVo build(String name, String id, int completed, int total, int city, int county) {
RankVo vo = new RankVo();
vo.setLabel(name);
vo.setDepartId(id);
vo.setNumerator(String.valueOf(completed));
vo.setDenominator(String.valueOf(total));
vo.setCityNumber(String.valueOf(city));
vo.setCountyNumber(String.valueOf(county));
String rate = BigDecimal.valueOf(completed)
.multiply(BigDecimal.valueOf(100))
.divide(BigDecimal.valueOf(total), 1, RoundingMode.HALF_UP)
.toString();
vo.setRate(rate);
vo.setValue(rate);
return vo;
}
// endregion

27
src/main/resources/mapper/SupTaskProblemMapper.xml

@ -139,4 +139,31 @@
</select>
<select id="selectMonthStatByYear" resultType="com.biutag.supervision.pojo.vo.EchartsVo">
SELECT
m.month_name AS name,
COUNT(t.id) AS value
FROM sup_month_monthname m
LEFT JOIN (
SELECT
ng.id,
ng.crtTime
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 YEAR(ng.crtTime) = #{year}
<if test="problemSourcesCodeList != null and problemSourcesCodeList.size() > 0">
AND ng.problemSourcesCode IN
<foreach collection="problemSourcesCodeList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND ( sd.id = #{departId} OR sdd.id = #{departId} OR sddd.id = #{departId} ) ) t
ON MONTH(t.crtTime) = CAST(m.month AS UNSIGNED)
GROUP BY m.month, m.month_name
ORDER BY CAST(m.month AS UNSIGNED) ASC
</select>
</mapper>

Loading…
Cancel
Save