Compare commits

...

5 Commits

  1. 3
      src/main/java/com/biutag/supervision/constants/enums/DepartGroupEnum.java
  2. 11
      src/main/java/com/biutag/supervision/controller/data/VideoInspectionController.java
  3. 230
      src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java
  4. 67
      src/main/java/com/biutag/supervision/controller/datav/DataVGlobalController.java
  5. 78
      src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java
  6. 101
      src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java
  7. 110
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneVideoSuperviseController.java
  8. 17
      src/main/java/com/biutag/supervision/mapper/DataCaseVerifMapper.java
  9. 341
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  10. 3
      src/main/java/com/biutag/supervision/pojo/request/datav/DataVRequest.java
  11. 10
      src/main/java/com/biutag/supervision/pojo/vo/VideoSuperviseCountVo.java
  12. 64
      src/main/java/com/biutag/supervision/service/datav/DatavService.java
  13. 722
      src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java
  14. 17
      src/main/resources/mapper/SupTaskProblemMapper.xml

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

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

11
src/main/java/com/biutag/supervision/controller/data/VideoInspectionController.java

@ -74,7 +74,16 @@ public class VideoInspectionController {
if (externalDepartList.isEmpty()) {
return Result.success(new Page<VideoInspectionVo>().setRecords(new ArrayList<>()).setTotal(0));
}
queryWrapper.in("i.fsdw_gajgjgdm", departService.getAllNodeIds(externalDepartList.stream().map(SupExternalDepart::getExternalId).toList()));
List<String> externalIds = externalDepartList.stream()
.map(SupExternalDepart::getExternalId)
.toList();
List<String> allNodeIds = departService.getAllNodeIds(externalIds);
if (allNodeIds == null || allNodeIds.isEmpty()) {
return Result.success(new Page<VideoInspectionVo>().setRecords(new ArrayList<>()).setTotal(0));
}
queryWrapper.in("i.fsdw_gajgjgdm", allNodeIds);
}
queryWrapper.orderByDesc("i.rqsj");
return Result.success(dataAlarmDispositionInfoMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper));

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

@ -1,42 +1,24 @@
package com.biutag.supervision.controller.datav;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
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.mapper.DataCaseVerifMapper;
import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.DataCaseVerif;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeBlame;
import com.biutag.supervision.pojo.entity.SupPolice;
import com.biutag.supervision.pojo.vo.CaseVerificationCountVo;
import com.biutag.supervision.pojo.vo.CaseVerificationMapVo;
import com.biutag.supervision.pojo.request.datav.DataVRequest;
import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo;
import com.biutag.supervision.service.NegativeBlameService;
import com.biutag.supervision.service.SupPoliceService;
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 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.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.A12389;
/**
* @author wxc
@ -51,56 +33,20 @@ public class DataVCaseVerifController {
private final DataCaseVerifMapper dataCaseVerifMapper;
private final NegativeMapper negativeMapper;
private final NegativeBlameService blameService;
private final SupPoliceService policeService;
private final DatavService datavService;
// region 左边
/**
* 案件核查大屏分县市局排名
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "分县市局排名")
@GetMapping("/getCaseVerificationRank")
public Result<JSONObject> getCaseVerificationRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
endTime = DateUtil.endOfDay(endTime);
List<OrganizeProblemRankVo> fxsjRankList = negativeMapper.getCaseVerificationRank(beginTime, endTime, 3);
List<OrganizeProblemRankVo> jsdwRankList = negativeMapper.getCaseVerificationRank(beginTime, endTime, 4);
JSONObject data = new JSONObject()
.fluentPut("fxsjRankList", fxsjRankList)
.fluentPut("jsdwRankList", jsdwRankList);
return Result.success(data);
@PostMapping("/getCaseVerificationRank")
public Result<JSONObject> getCaseVerificationRank(@RequestBody DataVRequest request) {
return datavService.getCaseVerificationRank(request);
}
/**
* 案件问题性质
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "案件问题性质")
@GetMapping("/getCaseProblemProperty")
public Result<JSONObject> getCaseProblemProperty(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
endTime = DateUtil.endOfDay(endTime);
List<EchartsVo> zfbaPieList = dataCaseVerifMapper.getCaseProblemProperty(beginTime, endTime, 6); // 执法办案
List<EchartsVo> fwglPieList = dataCaseVerifMapper.getCaseProblemProperty(beginTime, endTime, 11); // 服务管理
JSONObject data = new JSONObject()
.fluentPut("zfbaPieList", zfbaPieList)
.fluentPut("fwglPieList", fwglPieList);
return Result.success(data);
}
// endregion
/**
* 案件问题性质
* */
@GetMapping("/getCaseType")
public Result<JSONObject> getCaseType(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@ -117,116 +63,46 @@ public class DataVCaseVerifController {
return Result.success(jsonObject);
}
/**
* 获取禁闭处理情况数据
* */
@GetMapping("/getConfinementBar")
public Result<JSONObject> getConfinementBar(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){
endTime = DateUtil.endOfDay(endTime);
List<EchartsVo> list =dataCaseVerifMapper.getConfinementData(beginTime,endTime);
JSONObject jsonObject =new JSONObject().fluentPut("confinementList",list);
return Result.success(jsonObject);
}
// region 中间
/**
* 案件核查大屏中央数据总览
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "案件核查数据总览")
@GetMapping("/getCaseVerificationCount")
public Result<JSONObject> getAllCaseVerificationCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
endTime = DateUtil.endOfDay(endTime);
CaseVerificationCountVo overview = new CaseVerificationCountVo();
List<DataCaseVerif> dataCaseVerifs = dataCaseVerifMapper.selectList(new LambdaQueryWrapper<DataCaseVerif>().between(DataCaseVerif::getCreateTime, beginTime, endTime));
overview.setTotal(dataCaseVerifs.size());
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>()
.between(Negative::getCrtTime, beginTime, endTime)
.in(Negative::getProblemSourcesCode, List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue())));
overview.setDealCasePro((long) negatives.size());
List<String> trueValue = List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue());
overview.setConfirmed((int) negatives.stream().filter(item -> StrUtil.isNotBlank(item.getCheckStatus()) && trueValue.contains(item.getCheckStatus())).count());
double rate = overview.getTotal() == 0 ? 0 : NumberUtil.round((double) overview.getConfirmed() / overview.getTotal() * 100, 0).doubleValue();
overview.setRate(rate);
if (negatives.isEmpty()) {
overview.setPunishOrg(0L);
overview.setPunishPre(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();
log.info("问责单位 数量:{}", departBlames.size());
if (departBlames.isEmpty()) {
overview.setPunishOrg(0L);
} else {
log.info("问责单位 领导警号集合:{}", departBlames.stream().map(NegativeBlame::getBlameEmpNo).collect(Collectors.toSet()));
long count = policeService.count(new LambdaQueryWrapper<SupPolice>().in(SupPolice::getEmpNo, departBlames.stream().map(NegativeBlame::getBlameEmpNo).collect(Collectors.toSet())));
overview.setPunishOrg(count);
}
overview.setPunishPre(blames.stream().filter(item -> BlameType.personal.name().equals(item.getType())).count());
}
JSONObject res = new JSONObject().fluentPut("overview", overview);
return Result.success(res);
@PostMapping("/getCaseVerificationCount")
public Result<JSONObject> getAllCaseVerificationCount(@RequestBody DataVRequest request) {
return datavService.getAllCaseVerificationCount(request);
}
/**
* 案件核查大屏地图
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "案件核查大屏地图")
@GetMapping("/getCaseVerificationMap")
@PostMapping("/getCaseVerificationMap")
// @Cacheable(cacheNames = "Supervision:Screen:CaseVerificationMap", key = "#beginTime.getTime()+'_'+#endTime.getTime()")
public Result<JSONObject> getCaseVerificationMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
Date finalEndTime = DateUtil.endOfDay(endTime);
List<CaseVerificationMapVo> caseVerificationMapList = negativeMapper.getCaseVerificationMap(beginTime, finalEndTime);
log.info("-------caseVerificationMapList-------");
JSONObject res = new JSONObject().fluentPut("caseVerificationMapList", caseVerificationMapList);
return Result.success(res);
public Result<JSONObject> getCaseVerificationMap(@RequestBody DataVRequest request) {
return datavService.getCaseVerificationMap(request);
}
/**
* 查处问题趋势
*
* @param year 年份
* @return Result<JSONObject>
*/
// @Operation(summary = "案件核查大屏地图")
// @GetMapping("/getCaseVerificationMap")
//// @Cacheable(cacheNames = "Supervision:Screen:CaseVerificationMap", key = "#beginTime.getTime()+'_'+#endTime.getTime()")
// public Result<JSONObject> getCaseVerificationMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// Date finalEndTime = DateUtil.endOfDay(endTime);
// List<CaseVerificationMapVo> caseVerificationMapList = negativeMapper.getCaseVerificationMap(beginTime, finalEndTime);
// log.info("-------caseVerificationMapList-------");
// JSONObject res = new JSONObject().fluentPut("caseVerificationMapList", caseVerificationMapList);
// return Result.success(res);
// }
@Operation(summary = "查处问题趋势")
@GetMapping("/getCaseVerificationTrend")
public Result<JSONObject> getCaseVerificationTrend(@RequestParam Integer year) {
List<EchartsVo> proTrendList = negativeMapper.getTrend(year, A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue());
List<EchartsVo> proTrendList = negativeMapper.getTrend(year, A12389.getValue());
JSONObject data = new JSONObject().fluentPut("proTrendList", proTrendList);
return Result.success(data);
}
// endregion
// region 右边
/**
* 案件来源占比 问责处理情况
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "案件来源占比 & 问责处理情况")
@GetMapping("/getCaseSourceRateAndDealSituation")
public Result<JSONObject> getCaseSourceRateAndDealSituation(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@ -241,25 +117,37 @@ public class DataVCaseVerifController {
}
/**
* 禁闭处理情况 停职处理情况
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "禁闭处理情况 & 停职处理情况")
@GetMapping("/getConfinementAndPause")
public Result<JSONObject> getConfinementAndPause(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@Operation(summary = "禁闭处理情况")
@GetMapping("/getConfinementBar")
public Result<JSONObject> getConfinementBar(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){
endTime = DateUtil.endOfDay(endTime);
List<EchartsVo> jbclList = negativeMapper.getConfinementAndPause(beginTime,endTime, 1);
List<EchartsVo> tzclList = negativeMapper.getConfinementAndPause(beginTime, endTime, 2); // 停职
JSONObject data = new JSONObject()
.fluentPut("jbclList", jbclList)
.fluentPut("tzclList", tzclList);
return Result.success(data);
List<EchartsVo> list =dataCaseVerifMapper.getConfinementData(beginTime,endTime);
JSONObject jsonObject =new JSONObject().fluentPut("confinementList",list);
return Result.success(jsonObject);
}
// /**
// * 禁闭处理情况 和 停职处理情况
// *
// * @param beginTime 开始时间
// * @param endTime 结束时间
// * @return Result<JSONObject>
// */
// @Operation(summary = "禁闭处理情况 & 停职处理情况")
// @GetMapping("/getConfinementAndPause")
// public Result<JSONObject> getConfinementAndPause(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// endTime = DateUtil.endOfDay(endTime);
// List<EchartsVo> jbclList = negativeMapper.getConfinementAndPause(beginTime,endTime, 1);
// List<EchartsVo> tzclList = negativeMapper.getConfinementAndPause(beginTime, endTime, 2); // 停职
// JSONObject data = new JSONObject()
// .fluentPut("jbclList", jbclList)
// .fluentPut("tzclList", tzclList);
// return Result.success(data);
// }
// endregion

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

@ -113,33 +113,6 @@ public class DataVGlobalController {
//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);
}
/**
* 地图数据
*
* @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数据")

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

@ -47,7 +47,7 @@ public class DataVSupervisionNotifyController {
}
@Operation(summary = "问题类型占比")
@Operation(summary = "问题涉及方面分布")
@GetMapping("/getProblemTypeRate")
public Result<JSONObject> getProblemTypeRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@ -65,42 +65,15 @@ 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);
@PostMapping("/getSupervisionNotifyMap")
public Result<JSONObject> getSupervisionNotifyMap(@RequestBody DataVRequest request) {
return datavService.getSupervisionNotifyMap(request);
}
/**
* 获取现场督察问题趋势
*
* @param year 年份
* @return List<EchartsVo>
*/
@Operation(summary = "问题趋势")
@GetMapping("/getSupervisionTrend")
public Result<JSONObject> getSupervisionTrend(@RequestParam Integer year) {
@ -113,43 +86,12 @@ public class DataVSupervisionNotifyController {
// region 右边
/**
* 获取问题数
* @param beginTime 开始时间
* @param endTime 结束时间
* @return JSONObject
*/
@Operation(summary = "黄赌毒数据")
@GetMapping("/getYellowBetDrug")
public Result<JSONObject> getYellowBetDrug(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime,
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);
@PostMapping("/getYellowBetDrug")
public Result<JSONObject> getYellowBetDrug(@RequestBody DataVRequest request) {
return datavService.getYellowBetDrug(request);
}
/**
* 督察工作动态
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return JSONObject
*/
@Operation(summary = "督察工作动态")
@GetMapping("/getWorkDynamics")
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 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.WvpDeviceChannelMapper;
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.request.datav.DataVRequest;
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 io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -28,8 +15,8 @@ import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.stream.Collectors;
import java.util.Date;
import java.util.List;
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 {
private final NegativeMapper negativeMapper;
private final NegativeBlameService blameService;
private final WvpDeviceChannelMapper wvpDeviceChannelMapper;
private final SupPoliceService policeService;
private final DatavService datavService;
@ -89,88 +73,19 @@ public class DataVVideoSuperviseController {
//endregion
//region 中间
/**
* 获取视频督察中央数据
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "中央数据")
@GetMapping("/getAllVideoSuperviseCount")
public Result<JSONObject> getAllVideoSuperviseCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
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());
@PostMapping("/getAllVideoSuperviseCount")
public Result<JSONObject> getAllVideoSuperviseCount(@RequestBody DataVRequest request) {
return datavService.getAllVideoSuperviseCount(request);
}
JSONObject data = new JSONObject().fluentPut("overview", overview);
return Result.success(data);
}
/**
* 获取视频督察地图数据
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@Operation(summary = "获取视频督察地图数据")
@GetMapping("/getVideoSuperviseMap")
public Result<JSONObject> getVideoSuperviseMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 优化1: 快速失败检查
if (beginTime == null || endTime == null) {
return Result.success(new JSONObject().fluentPut("videoSuperviseMapIconVoList", Collections.emptyList()));
@PostMapping("/getVideoSuperviseMap")
public Result<JSONObject> getVideoSuperviseMap(@RequestBody DataVRequest request) {
return datavService.getVideoSuperviseMap(request);
}
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 = "问题趋势统计")
@GetMapping("/getVideoSuperviseTrend")

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

@ -1,27 +1,19 @@
package com.biutag.supervision.controller.subdatav;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.biutag.supervision.mapper.NegativeMapper;
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.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.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.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.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
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 {
private final SubOneVideoSuperviseService subOneVideoSuperviseService;
private final NegativeMapper negativeMapper;
// region 左边
/**
* 问题数排名
*
* @param departId 部门id分县市局ID
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
private final DatavService datavService;
@Operation(summary = "问题数排名")
@GetMapping("/getSubOneVideoSuperviseProblemRank")
public Result<JSONObject> getSubOneVideoSuperviseProblemRank(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@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);
@PostMapping("/getSubOneVideoSuperviseProblemRank")
public Result<JSONObject> getSubOneVideoSuperviseProblemRank(@RequestBody SubDataVRequest request) {
return datavService.getSubOneVideoSuperviseProblemRank(request);
}
// endregion
// region 中间
/**
* 中央总览数据
*
* @param departId 部门id分县市局ID
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "视频督察二级大屏中央数据")
@GetMapping("/getSubOneAllVideoSuperviseCount")
public Result<JSONObject> getSubOneAllVideoSuperviseCount(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@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);
@PostMapping("/getSubOneAllVideoSuperviseCount")
public Result<JSONObject> getSubOneAllVideoSuperviseCount(@RequestBody SubDataVRequest request) {
return datavService.getSubOneAllVideoSuperviseCount(request);
}
/**
* 地图Icon数据
*
* @param departId 部门id分县市局ID
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@Operation(summary = "地图Icon数据")
@GetMapping("/getSubOneVideoSuperviseMap")
public Result<JSONObject> getSubOneVideoSuperviseMap(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@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);
@PostMapping("/getSubOneVideoSuperviseMap")
public Result<JSONObject> getSubOneVideoSuperviseMap(@RequestBody SubDataVRequest request) {
return datavService.getSubOneVideoSuperviseMap(request);
}
/**
* 视频督察二级数据大屏问题趋势统计
* @param departId 部门id分县市局ID
* @param year 年份
* @return
*/
@Operation(summary = "问题趋势统计")
@GetMapping("/getSubOneVideoSuperviseTrend")
public Result<JSONObject> getSubOneVideoSuperviseTrend(@RequestParam Integer departId, @RequestParam Integer year) {
@ -129,18 +64,10 @@ public class SubOneVideoSuperviseController {
return Result.success(jsonObject);
}
// endregion
// region 右边
/**
* 视频督察二级数据大屏问题类型占比
* @param departId 部门id分县市局ID
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@Operation(summary = "视频督察二级数据大屏问题类型占比")
@GetMapping("/getSubOneVideoSuperviseProblemTypeRate")
public Result<JSONObject> getSubOneVideoSuperviseProblemTypeRate(@RequestParam Integer departId,
@ -150,6 +77,5 @@ public class SubOneVideoSuperviseController {
JSONObject jsonObject = new JSONObject().fluentPut("subOneVideoSuperviseProblemTypeRate", subOneVideoSuperviseProblemTypeRate);
return Result.success(jsonObject);
}
// endregion
}

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

@ -5,6 +5,7 @@ import com.biutag.supervision.pojo.dto.CaseVerifDepart;
import com.biutag.supervision.pojo.dto.common.PieItem;
import com.biutag.supervision.pojo.entity.DataCaseVerif;
import com.biutag.supervision.pojo.vo.EchartsVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.Date;
@ -49,7 +50,7 @@ public interface DataCaseVerifMapper extends BaseMapper<DataCaseVerif> {
" negative_problem_relation npr LEFT JOIN " +
" negative ng on npr.negativeId = ng.id " +
" where npr.oneLevelCode = #{code} " +
" and ng.problemSourcesCode in (17, 18, 19, 20) " +
" and ng.problemSourcesCode in (17) " +
" and ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
" GROUP BY twoLevelContent ")
List<EchartsVo> getCaseTypeNumber(Date beginTime, Date endTime, Integer code);
@ -60,4 +61,18 @@ public interface DataCaseVerifMapper extends BaseMapper<DataCaseVerif> {
" WHERE start_time BETWEEN #{beginTime} AND #{endTime} " +
" GROUP BY matter ")
List<EchartsVo> getConfinementData(Date beginTime, Date endTime);
@Select("SELECT dcv.* " +
"FROM data_case_verif dcv " +
"LEFT JOIN sup_depart sd2 " +
" ON sd2.id = dcv.second_depart_id " +
"LEFT JOIN sup_depart sd3 " +
" ON sd3.id = dcv.third_depart_id " +
"WHERE " +
" (dcv.second_depart_id = #{secondDepartId} " +
" OR sd3.pid = #{secondDepartId}) " +
" AND dcv.discovery_time >= #{beginTime} " +
" AND dcv.discovery_time < #{endTime}")
List<DataCaseVerif> getListData(@Param("secondDepartId") String secondDepartId, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);
}

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

@ -59,45 +59,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
GlobalOverViewVo getSuoOneAllGlobalCount(Integer departId, Date beginTime, Date endTime);
// 中央总览 todo
@Select("SELECT " +
"count(ng.id) AS totalPro, " +
"COALESCE(SUM(IF(problemSourcesCode IN (13), 1, 0)), 0) AS supervisionPro, " +
"COALESCE(SUM(IF(problemSourcesCode IN (14,15,16), 1, 0)), 0) AS numSupervisionPro, " +
"COALESCE(SUM(IF(problemSourcesCode IN (17,18,19,20), 1, 0)), 0) AS caseVerificationPro, " +
"COALESCE(SUM(IF(problemSourcesCode IN (27,28,29,30), 1, 0)), 0) AS auditPro, " +
"COALESCE(SUM(IF(problemSourcesCode IN (2), 1, 0)), 0) AS talkPro " +
"FROM negative ng " +
"WHERE ng.crtTime BETWEEN #{beginTime} AND #{endTime} ")
GlobalOverViewVo getAllGlobalCount(Date beginTime, Date endTime);
@Select("SELECT problemSources as name ,COUNT(DISTINCT id) as value " +
"from negative WHERE problemSourcesCode IN (27,28,29,30) " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY problemSources " +
"ORDER BY value desc ")
List<EchartsVo> getBarEchartsVoData(Date beginTime, Date endTime);
// 地图卡片
@Select("SELECT " +
"sd.short_name AS `name`, " +
"sd.id AS departId, " +
"COUNT( DISTINCT ng.id ) AS totalPro, " +
"SUM( IF(problemSourcesCode IN (13), 1, 0) ) AS supervisePro, " +
"SUM( IF(problemSourcesCode IN (15,16, 14), 1, 0) ) as numSupervisePro, " +
"SUM( IF(problemSourcesCode IN (17,18,19,20), 1, 0) ) AS caseVerifyPro, " +
"SUM( IF(problemSourcesCode IN (21,22,23,24,25),1, 0) ) AS mailPro, " +
"SUM( IF(problemSourcesCode IN (2),1, 0) ) AS policePro, " +
"SUM( IF(problemSourcesCode IN (27,28,29,30),1, 0) ) AS reviewPro " +
"FROM sup_depart sd " +
"LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id " +
"AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"WHERE sd.statistics_group_id=3 " +
"GROUP BY sd.short_name " +
"ORDER BY totalPro DESC;")
List<GlobalMapIconVo> getGlobalMap(Date beginTime, Date endTime);
List<EchartsVo> getGlobalRecentlyTrendByMonth(String year);
@ -137,70 +99,16 @@ public interface NegativeMapper extends BaseMapper<Negative> {
List<StrongProblemRank> selectStrongProblemRank(Date beginTime, Date endTime);
// endregion
// region 现场督察大屏
@Select("SELECT " +
"COUNT(DISTINCT ng.id) AS proTotal, " +
"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, " +
"IFNULL(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS completedRate " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.second_involve_depart_id=sd.id " +
"WHERE problemSourcesCode IN (13) " +
"AND sd.statistics_group_id=#{groupId} " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime};")
DayTimeSuperviseVo getSupervisionRank(Date beginTime, Date endTime, Integer groupId);
@Select("SELECT " +
"COUNT(DISTINCT ng.id) AS proTotal " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.second_involve_depart_id=sd.id " +
"WHERE problemSourcesCode IN (13) " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime};")
DayTimeSuperviseVo getProTotalFun(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, " +
" COUNT(DISTINCT IF(ng.crt_depart_level = 0, ng.id, null)) as cityNumber, "+
" COUNT(DISTINCT IF(ng.crt_depart_level = 2, ng.id, null)) as countyNumber, "+
"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 negative ng " +
"LEFT JOIN sup_depart sd ON ng.second_involve_depart_id=sd.id " +
"WHERE problemSourcesCode IN (13) " +
"AND sd.statistics_group_id=#{groupId} " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY sd.short_name " +
"ORDER BY denominator desc")
//,rate desc
List<RankVo> getChangedRateRank(Date beginTime, Date endTime, Integer groupId);
@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.checkStatus<>3 " +
"and ng.check_status_code in (1, 2, 3) " +
"AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND oneLevelContent is NOT NULL " +
"GROUP BY oneLevelContent ")
List<EchartsVo> getProblemTypeRatio(Date beginTime, Date endTime);
@Select("SELECT " +
"COALESCE(COUNT(DISTINCT ng.id), 0) AS problemNumber, " +
"COALESCE(COUNT(DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL)), 0) AS processingNumber, " +
"COALESCE(COUNT(DISTINCT IF(ng.processing_status='completed', ng.id, NULL)), 0) AS completedNumber, " +
"COUNT(IF(nb.type ='department' and ng.checkStatus IN ('1','2') and nb.handleResultName != '不予追责' and nb.handleResultCode is not null and nb.handleResultCode != '', nb.blameId, NULL)) AS departNumber, " +
"COUNT(IF(nb.type ='personal' and ng.checkStatus IN ('1','2') and nb.handleResultName != '不予追责' and nb.handleResultCode is not null and nb.handleResultCode != '', nb.blameId, NULL)) AS personNumber, " +
"COALESCE(ROUND(COUNT(DISTINCT IF(ng.processing_status='completed', ng.id, NULL)) / COUNT(DISTINCT ng.id) * 100, 1), 0) AS completedRate " +
"FROM negative ng " +
"LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " +
"WHERE ng.problemSourcesCode IN (13,14, 15) " +
"AND ng.crtTime BETWEEN #{beginTime} AND #{endTime}; ")
SupervisionNotifyOverView getAllSupervisionNotifyCount(Date beginTime, Date endTime);
@ -223,130 +131,9 @@ public interface NegativeMapper extends BaseMapper<Negative> {
@Select("SELECT " +
"sd.short_name AS `name`, " +
"sd.id AS departId, " +
"COUNT( DISTINCT ng.id ) AS totalPro, " +
"COUNT( DISTINCT IF(ng.problemSourcesCode=13, ng.id, NULL) ) AS xc, " +
"COUNT( DISTINCT IF(ng.problemSourcesCode=15, ng.id, NULL) ) AS zx, " +
"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 , " +
"SUM(CASE " +
" WHEN nb.type = 'personal' " +
" AND nb.handleResultName != '' " +
" AND nb.handleResultName IS NOT NULL " +
" AND nb.handleResultName != '不予追责' " +
" THEN 1 " +
" ELSE 0 " +
" END) AS personNum, " +
" SUM(CASE " +
" WHEN nb.type = 'department' " +
" AND nb.handleResultName != '' " +
" AND nb.handleResultName IS NOT NULL " +
" AND nb.handleResultName != '不予追责' " +
" THEN 1 " +
" ELSE 0 " +
" END) AS relationOrg, "+
"IFNULL( ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS completedRate " +
"FROM sup_depart sd " +
"LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id " +
"AND ng.problemSourcesCode IN (13,14, 15)" +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
"LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " +
"WHERE sd.statistics_group_id=3 " +
"GROUP BY sd.short_name " +
"ORDER BY completedRate DESC")
List<SuperviseMapIconVo> getSupervisionMapIconInfo(Date beginTime, Date endTime);
@Select("select " +
" sd.short_name AS `name`," +
" sd.id AS departId, " +
" COUNT( DISTINCT ng.id ) AS totalPro, " +
" COUNT( DISTINCT IF(ng.problemSourcesCode=13, ng.id, NULL) ) AS xc, " +
" COUNT( DISTINCT IF(ng.problemSourcesCode=15, ng.id, NULL) ) AS zx, " +
" 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 " +
" from sup_depart sd " +
" LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id AND ng.problemSourcesCode IN (13,14, 15) " +
" AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
" WHERE sd.statistics_group_id=3 " +
" GROUP BY sd.short_name " +
" ORDER BY totalPro DESC;"
)
List<SuperviseMapIconVo> getSupervisionMapIconData(Date beginTime, Date endTime);
//获取personNum、relationOrg
@Select(
"select count(*) FROM sup_depart sd " +
" LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id AND ng.problemSourcesCode IN (13,14, 15) " +
" AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
" LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " +
" WHERE nb.handleResultName != '' and nb.handleResultName IS NOT NULL and nb.handleResultName != '不予追责' " +
" and nb.type = #{code} and sd.id =#{departId}"
)
String getSupervisionMapStringData(Date beginTime, Date endTime,String code,String departId);
//获取completedRate
@Select(
"select " +
" IFNULL( ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) " +
" FROM sup_depart sd" +
" LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id AND ng.problemSourcesCode IN (13,14, 15)" +
" AND crtTime BETWEEN #{beginTime} AND #{endTime}" +
" LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " +
" where sd.id =#{departId}"
)
String getSupervisionMapCompletedRate(Date beginTime, Date endTime,String departId);
@Select("SELECT " +
"COUNT(DISTINCT ng.id) AS proTotal, " +
"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 , " +
"IFNULL( ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS completedRate " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.second_involve_depart_id=sd.id " +
"WHERE ng.special_supervision=#{queryType} " +
"AND sd.statistics_group_id=#{groupId} " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime}; ")
DayTimeSuperviseVo getYellowBetOverview(Date beginTime, Date endTime, Integer groupId, String queryType);
@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.special_supervision=#{queryType} " +
"AND sd.statistics_group_id=#{groupId} " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY sd.short_name " +
"ORDER BY `value` DESC;")
List<OrganizeProblemRankVo> getYellowBetRankList(Date beginTime, Date endTime, Integer groupId, String queryType);
// region 视频督察大屏
@Select("SELECT " +
"COUNT(DISTINCT ng.id) total," +
"COUNT(DISTINCT IF(ng.checkStatus IN ('1','2'), ng.id, NULL)) AS discoverProblem, " +
"COUNT(DISTINCT IF(ng.processing_status='completed', ng.id, NULL)) AS completionProblem, " +
"COUNT(IF(nb.type ='department' and ng.checkStatus IN ('1','2') and nb.handleResultName != '不予追责' and nb.handleResultCode is not null and nb.handleResultCode != '', nb.blameId, NULL)) AS relativeOrg, " +
"COUNT(IF(nb.type ='personal' and ng.checkStatus IN ('1','2') and nb.handleResultName != '不予追责' and nb.handleResultCode is not null and nb.handleResultCode != '', nb.blameId, NULL)) AS relativePer, " +
"IFNULL( ROUND((COUNT(DISTINCT IF(ng.processing_status='completed', ng.id, NULL)) / COUNT(DISTINCT ng.id)) * 100, 1), 0) AS completionRate " +
"FROM sup_depart sd " +
"INNER JOIN negative ng ON sd.id = ng.involveDepartId " +
"LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " +
"WHERE problemSourcesCode = 16 " +
"and ng.checkStatus in (1, 2) "+
"AND ng.crtTime BETWEEN #{beginTime} AND #{endTime}")
VideoSuperviseCountVo getAllVideoSuperviseCount(Date beginTime, Date endTime);
/**
* 问题类型占比
* */
@ -377,69 +164,8 @@ public interface NegativeMapper extends BaseMapper<Negative> {
)
List<Negative> getVideoSuperviseProblemRank(String id, Date beginTime, Date endTime);
@Select("SELECT " +
" d.short_name name, " +
" d.id departId, " +
" t.discoverProblem, " +
" t.completionProblem, " +
" t.relativePer, " +
" t.relativeOrg " +
"FROM " +
" sup_depart d " +
" LEFT JOIN ( " +
" SELECT " +
" a.second_involve_depart_id, " +
" count( DISTINCT IF ( a.checkStatus IN ( '1', '2' ), a.id, NULL ) ) discoverProblem, " +
" count( DISTINCT IF ( a.processing_status = 'completed', a.id, NULL ) ) completionProblem, " +
" count( DISTINCT IF ( b.type = 'personal' and b.handleResultName != '不予追责' and b.handleResultCode is not null and b.handleResultCode != '', b.blameEmpNo, NULL ) ) relativePer, " +
" count( DISTINCT IF ( b.type = 'department' and b.handleResultName != '不予追责' and b.handleResultCode is not null and b.handleResultCode != '', b.blameEmpNo, NULL ) ) relativeOrg " +
" FROM " +
" negative a " +
" JOIN negative_blame b ON a.id = b.negativeId " +
" WHERE " +
" a.crtTime BETWEEN #{beginTime} AND #{endTime} AND a.problemSourcesCode = 16 " +
" GROUP BY " +
" a.second_involve_depart_id " +
" ) t ON d.id = t.second_involve_depart_id " +
"WHERE " +
" d.statistics_group_id = 3 " +
"GROUP BY " +
" d.short_name, " +
" d.id")
List<VideoSuperviseMapIconVo> getVideoSuperviseMapIconInfo(Date beginTime, Date endTime);
/**
* 涉及人
* */
@Select(" select " +
" sup.id as name, " +
" count(*) as value " +
" from negative_problem_relation npr " +
" LEFT JOIN negative ng on npr.negativeId = ng.id " +
" LEFT JOIN sup_depart sup on sup.id = ng.second_involve_depart_id " +
" WHERE " +
" ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
" and sup.statistics_group_id = 3 " +
" and ng.problemSourcesCode = 16 "+
" GROUP BY sup.id "
)
List<EchartsVo> selectRelativePer(Date beginTime, Date endTime);
@Select("SELECT " +
"sup.id as `name`, " +
"COUNT(*) as value " +
"from negative_problem_relation npr " +
"LEFT JOIN negative ng on npr.negativeId = ng.id " +
"LEFT JOIN sup_depart sup on sup.id = ng.three_involve_depart_id " +
"WHERE " +
"ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"and sup.pid = #{deptId} " +
"and sup.statistics_group_id = 10 " +
"and ng.problemSourcesCode = 16 " +
"GROUP BY sup.id")
List<EchartsVo> selectSubOneRelativePer(Date beginTime,Date endTime,Integer deptId);
// endregion
// region 案件核查大屏
@ -455,18 +181,6 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"ORDER BY `value` DESC;")
List<OrganizeProblemRankVo> getCaseVerificationRank(Date beginTime, Date endTime, int groupId);
// 案件核查大屏 -- 中央数据
@Select("SELECT " +
"COUNT( ng.id ) AS confirmed, " +
"COUNT( DISTINCT IF(ng.checkStatus IN (1, 2), ng.id, NULL) ) AS dealCasePro, " +
"COUNT( DISTINCT IF(ng.checkStatus IN (1, 2) && nb.type = 'personal' and ng.checkStatus IN ('1','2') and nb.handleResultName != '不予追责' and nb.handleResultCode is not null and nb.handleResultCode != '', nb.blameId, NULL) ) AS punishPre, " +
"COUNT( DISTINCT IF(ng.checkStatus IN (1, 2) && nb.type = 'department' and ng.checkStatus IN ('1','2') and nb.handleResultName != '不予追责' and nb.handleResultCode is not null and nb.handleResultCode != '', nb.blameId, NULL) ) AS punishOrg " +
"FROM negative ng " +
"LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " +
"WHERE ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND ng. problemSourcesCode in (17, 18, 19, 20) ")
CaseVerificationCountVo getAllCaseVerificationCount(Date beginTime, Date endTime);
@Select("SELECT " +
" d.short_name name, " +
@ -531,8 +245,8 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"INNER JOIN negative_blame nb ON nb.negativeId=ng.id " +
"WHERE handleResultName is NOT NULL " +
"AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND ng.problemSourcesCode in (17, 18, 19, 20) " +
"AND ng.checkStatus <>3 " +
"AND ng.problemSourcesCode in (17) " +
"AND ng.check_status_code in (1, 2, 3) " +
"GROUP BY nb.handleResultName")
List<EchartsVo> getDealSituation(Date beginTime, Date endTime);
@ -551,35 +265,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
List<EchartsVo> getSubOneTrend(String departId, String year, String... args);
// 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.three_involve_depart_id=sd.id " +
"WHERE ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND sd.statistics_group_id=10 " +
"AND sd.pid=#{departId} " +
"AND problemSourcesCode IN (2,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30) " +
"GROUP BY sd.short_name " +
"ORDER BY `value` DESC;")
List<OrganizeProblemRankVo> selectPoliceOrganizeProblemRank(Integer departId, Date beginTime, Date endTime);
@Select("SELECT " +
"sd.short_name AS label, " +
"COUNT(DISTINCT ng.id ) AS `value` " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.three_involve_depart_id=sd.id " +
"WHERE ng.crtTime BETWEEN #{beginTime} AND #{endTime} " +
"AND sd.statistics_group_id!=10 " +
"AND sd.pid=#{departId} " +
"AND problemSourcesCode IN (2,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30) " +
"GROUP BY sd.short_name " +
"ORDER BY `value` DESC;")
List<OrganizeProblemRankVo> selectTeamOrganizeProblemRank(Integer departId, Date beginTime, Date endTime);
@Select("SELECT " +
"businessTypeName as name, " +
@ -996,7 +682,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
@Select("SELECT problemSources AS name, count(ng.id) AS value " +
"FROM negative ng " +
"WHERE problemSourcesCode IN (17, 18, 19, 20) AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
"WHERE problemSourcesCode IN (17) AND crtTime BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY problemSources")
List<EchartsVo> getCaseSourceRate(Date beginTime, Date endTime);
@ -1083,5 +769,24 @@ public interface NegativeMapper extends BaseMapper<Negative> {
List<Negative> getChangedRank(String id, Date beginTime, Date endTime);
List<Negative> getNegativeListData(
@Param("id") String id,
@Param("beginTime") Date beginTime,
@Param("endTime") Date endTime,
@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
}

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

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

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

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

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

@ -228,4 +228,68 @@ public interface DatavService {
* @return
*/
Result<SupervisionNotifyOverView> getSupervisionNotifyCount(DataVRequest request);
/**
* 现场专项地图
* @param request
* @return
*/
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);
/**
* 案件核查 分县市局排名
* @param request
* @return
*/
Result<JSONObject> getCaseVerificationRank(DataVRequest request);
/**
* 案件核查 一级地图
* @param request
* @return
*/
Result<JSONObject> getCaseVerificationMap(DataVRequest request);
}

722
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.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
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.common.UserContextHolder;
import com.biutag.supervision.constants.AppConstants;
import com.biutag.supervision.constants.enums.*;
import com.biutag.supervision.constants.enums.invest.DeleteStatusEnum;
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.mailbox.Mail;
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.dataAudit.DataAuditQueryParam;
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.*;
@ -30,11 +29,11 @@ import com.biutag.supervision.repository.dataCaseVerif.DataCaseVerifResourceServ
import com.biutag.supervision.repository.dataPetitionComplaint.DataPetitionComplaintResourceService;
import com.biutag.supervision.repository.mail.MailResourceService;
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.supExternalDepart.SupExternalDepartResourceService;
import com.biutag.supervision.repository.supdepart.SupDepartResourceService;
import com.biutag.supervision.service.*;
import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -43,7 +42,6 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.ZoneId;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -92,26 +90,12 @@ public class DatavServiceImpl implements DatavService {
@Resource
private NegativeService negativeService;
@Resource
private RpcApplyService rpcApplyService;
@Resource
private SupDepartService supDepartService;
@Resource
private RpcApplyMapper rpcApplyMapper;
@Resource
private RpcPacksComfortService rpcPacksComfortService;
@Resource
private RpcComfortPacksService rpcComfortPacksService;
@Resource
private RpcComfortPacksMapper rpcComfortPacksMapper;
@Resource
private RpcApplyPersonService rpcApplyPersonService;
@Resource
private DataPetitionComplaintMapper dataPetitionComplaintMapper;
@ -135,7 +119,11 @@ public class DatavServiceImpl implements DatavService {
@Resource
private SuperviseReportService superviseReportService;
@Resource
private NegativeBlameResourceService negativeBlameResourceService;
@Resource
private DataCaseVerifMapper dataCaseVerifMapper;
private final String VALID_SIGN = "terminated";
private final String EX_SOURCE = "局长信箱";
@ -436,51 +424,53 @@ public class DatavServiceImpl implements DatavService {
@Override
public Result<JSONObject> getAllCaseVerificationCount(DataVRequest request) {
CaseVerificationCountVo overview = new CaseVerificationCountVo();
List<Date> timeRange = List.of(request.getBeginTime(), request.getEndTime());
// 总案件数
DataCaseVerifQueryParam dataCaseVerifQueryParam = new DataCaseVerifQueryParam();
dataCaseVerifQueryParam.setCreateTime(timeRange);
long total = dataCaseVerifResourceService.count(dataCaseVerifQueryParam);
// 查处问题数
LambdaQueryWrapper<DataCaseVerif> dataCaseVerifLambdaQueryWrapper = new LambdaQueryWrapper<>();
dataCaseVerifLambdaQueryWrapper.between(DataCaseVerif::getCreateTime, request.getBeginTime(), request.getEndTime());
List<DataCaseVerif> dataCaseVerifs = dataCaseVerifMapper.selectList(dataCaseVerifLambdaQueryWrapper);
NegativeQueryParam negativeQueryParam = new NegativeQueryParam();
negativeQueryParam.setCrtTime(timeRange);
negativeQueryParam.setProblemSourcesCode(List.of(A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()));
negativeQueryParam.setCrtTime(List.of(request.getBeginTime(), request.getEndTime()));
negativeQueryParam.setProblemSourcesCode(List.of(A12389.getValue()));
List<Negative> negatives = negativeResourceService.query(negativeQueryParam);
int dealCasePro = negatives.size();
// 查实案件数
Set<String> trueValue = Set.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue());
long confirmed = negatives.stream()
.map(Negative::getCheckStatus)
.filter(Objects::nonNull)
.filter(trueValue::contains)
.count();
// 查实率
double rate = total == 0 ? 0D : NumberUtil.round((double) confirmed / total * 100, 0).doubleValue();
// 问责人次 和问责单位数
if (negatives.isEmpty()) {
overview.setPunishOrg(0L);
overview.setPunishPre(0L);
} else {
List<NegativeBlame> blames = negativeBlameService.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();
log.info("问责单位 数量:{}", departBlames.size());
if (departBlames.isEmpty()) {
overview.setPunishOrg(0L);
} else {
log.info("问责单位 领导警号集合:{}", departBlames.stream().map(NegativeBlame::getBlameEmpNo).collect(Collectors.toSet()));
long count = supPoliceService.count(new LambdaQueryWrapper<SupPolice>().in(SupPolice::getEmpNo, departBlames.stream().map(NegativeBlame::getBlameEmpNo).collect(Collectors.toSet())));
overview.setPunishOrg(count);
}
overview.setPunishPre(blames.stream().filter(item -> BlameType.personal.name().equals(item.getType())).count());
}
overview.setTotal((int) total);
overview.setConfirmed((int) confirmed);
overview.setDealCasePro((long) dealCasePro);
overview.setRate(rate);
// 属实问题
List<Negative> ssNegative = negatives.stream()
.filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList();
NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam();
negativeBlameQueryParam.setNegativeIds(ssNegative.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();
//计算查实率(向上取整)
Double verificationRate = 0.0;
if (!dataCaseVerifs.isEmpty()) {
double rawRate = (double) ssNegative.size() / dataCaseVerifs.size() * 100;
verificationRate = Math.ceil(rawRate);
}
overview.setTotal(dataCaseVerifs.size());
overview.setConfirmed(ssNegative.size());
overview.setDealCasePro((long) negatives.size());
overview.setPunishPre((long) (personalBlames.size() + leadBlames.size()));
overview.setPunishOrg((long) unitBlames.size());
overview.setRate(verificationRate);
JSONObject res = new JSONObject().fluentPut("overview", overview);
return Result.success(res);
}
@ -1053,7 +1043,7 @@ public class DatavServiceImpl implements DatavService {
List<Negative> fxsjList = negativeMapper.getVideoSuperviseProblemRank(fxsj.getId(), request.getBeginTime(), request.getEndTime());
// 总数
long total = fxsjList.size();
if (total==0){
if (total == 0) {
continue;
}
// 市局下发
@ -1071,7 +1061,7 @@ public class DatavServiceImpl implements DatavService {
List<Negative> fxsjList = negativeMapper.getVideoSuperviseProblemRank(jsdw.getId(), request.getBeginTime(), request.getEndTime());
// 总数
long total = fxsjList.size();
if (total==0){
if (total == 0) {
continue;
}
// 市局下发
@ -1143,7 +1133,7 @@ public class DatavServiceImpl implements DatavService {
List<Negative> negativeList = negativeMapper.getChangedRank(jsdw.getId(), request.getBeginTime(), request.getEndTime());
// 问题数
int totalPro = negativeList.size();
if (totalPro==0){
if (totalPro == 0) {
continue;
}
// 办结数
@ -1216,40 +1206,47 @@ public class DatavServiceImpl implements DatavService {
List<Negative> processingList = negatives.stream().filter(item -> ProcessingStatusEnum.processing.name().equals(item.getProcessingStatus())).toList();
LambdaQueryWrapper<SuperviseReport> superviseReportLambdaQueryWrapper = new LambdaQueryWrapper<>();
UserAuth user = UserContextHolder.getCurrentUser();
// 权限
if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode())) {
if (user.getAuthDepartIds().isEmpty() || user.getRoleCodes().isEmpty()) {
//特殊处理
overView.setReportNumber(0L);
}
List<String> orgIds = supDepartService.getAllNodeIds(user.getAuthDepartIds());
superviseReportLambdaQueryWrapper.in(SuperviseReport::getCrtDepartId, orgIds);
}
// UserAuth user = UserContextHolder.getCurrentUser();
// // 权限
// if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode())) {
// if (user.getAuthDepartIds().isEmpty() || user.getRoleCodes().isEmpty()) {
// //特殊处理
// overView.setReportNumber(0L);
// }
// List<String> orgIds = supDepartService.getAllNodeIds(user.getAuthDepartIds());
// superviseReportLambdaQueryWrapper.in(SuperviseReport::getCrtDepartId, orgIds);
// }
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();
CompletableFuture.allOf(
CompletableFutureUtil.runSyncObject(() -> {
long personNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper<NegativeBlame>().in(NegativeBlame::getNegativeId, negativeIds)
.eq(NegativeBlame::getType, "personal")
.isNotNull(NegativeBlame::getBlameName)
.ne(NegativeBlame::getBlameName, "")
.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();
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();
// 通报问题数
overView.setProblemNumber(negatives.size());
@ -1259,9 +1256,544 @@ public class DatavServiceImpl implements DatavService {
overView.setProcessingNumber((long) processingList.size());
// 已办结
overView.setCompletedNumber((long) completedList.size());
// 问责单位数
overView.setDepartNumber((long) unitBlames.size());
overView.setPersonNumber((long) (personalBlames.size() + leadBlames.size()));
return Result.success(overView);
}
@Override
public Result<JSONObject> getSupervisionNotifyMap(DataVRequest request) {
List<SuperviseMapIconVo> superviseTempMapVoList = new ArrayList<>();
SupDepartQueryParam supDepartQueryParam = new SupDepartQueryParam();
supDepartQueryParam.setStatisticsGroupId(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId());
List<SupDepart> fxsjDw = supDepartResourceService.query(supDepartQueryParam);
List<String> proCode = List.of(XCDC.getValue(), LMGZ.getValue(), ZXDC.getValue());
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();
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()));
superviseTempMapVoList.add(superviseMapIconVo);
}
JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList);
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("3");
supDepartGroupParam.setPid(request.getDepartId());
List<SupDepart> supDepartList = supDepartResourceService.query(supDepartGroupParam);
// 派出所
List<SupDepart> pcsList = supDepartList.stream()
.filter(one -> StrUtil.isNotBlank(one.getStatisticsGroupId()))
.filter(one -> DepartGroupEnum.PCS.getId().equals(Integer.valueOf(one.getStatisticsGroupId())))
.toList();
// 大队
List<SupDepart> dwList = supDepartList.stream()
.filter(one -> {
String groupId = one.getStatisticsGroupId();
return !StrUtil.isNotBlank(groupId)
|| !DepartGroupEnum.PCS.getId().equals(Integer.valueOf(groupId));
})
.toList();
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);
}
@Override
public Result<JSONObject> getCaseVerificationRank(DataVRequest request) {
List<String> proCode = List.of(A12389.getValue());
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);
List<OrganizeProblemRankVo> fxsjRankList = new ArrayList<>();
List<OrganizeProblemRankVo> jsdwRankList = new ArrayList<>();
for (SupDepart fxsj : fxsjDw) {
List<Negative> negatives = negativeMapper.getNegativeListData(fxsj.getId(), request.getBeginTime(), request.getEndTime(), proCode);
if (CollectionUtil.isEmpty(negatives)) {
continue;
}
OrganizeProblemRankVo organizeProblemRankVo = new OrganizeProblemRankVo();
organizeProblemRankVo.setLabel(fxsj.getShortName());
organizeProblemRankVo.setValue(String.valueOf(negatives.size()));
fxsjRankList.add(organizeProblemRankVo);
}
for (SupDepart jsdw : jsdwDw) {
List<Negative> negatives = negativeMapper.getNegativeListData(jsdw.getId(), request.getBeginTime(), request.getEndTime(), proCode);
if (CollectionUtil.isEmpty(negatives)) {
continue;
}
OrganizeProblemRankVo organizeProblemRankVo = new OrganizeProblemRankVo();
organizeProblemRankVo.setLabel(jsdw.getShortName());
organizeProblemRankVo.setValue(String.valueOf(negatives.size()));
jsdwRankList.add(organizeProblemRankVo);
}
// 排序
fxsjRankList.sort(
Comparator.comparingLong((OrganizeProblemRankVo vo) -> Long.parseLong(vo.getValue()))
.reversed()
);
jsdwRankList.sort(
Comparator.comparingLong((OrganizeProblemRankVo vo) -> Long.parseLong(vo.getValue()))
.reversed()
);
JSONObject data = new JSONObject()
.fluentPut("fxsjRankList", fxsjRankList)
.fluentPut("jsdwRankList", jsdwRankList);
return Result.success(data);
}
@Override
public Result<JSONObject> getCaseVerificationMap(DataVRequest request) {
SupDepartQueryParam supDepartQueryParam = new SupDepartQueryParam();
supDepartQueryParam.setStatisticsGroupId(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId());
List<SupDepart> fxsjDw = supDepartResourceService.query(supDepartQueryParam);
List<String> proCode = List.of(A12389.getValue());
List<CaseVerificationMapVo> caseVerificationMapList = new ArrayList<>();
for (SupDepart fxsj : fxsjDw) {
LambdaQueryWrapper<DataCaseVerif> dataCaseVerifLambdaQueryWrapper = new LambdaQueryWrapper<>();
dataCaseVerifLambdaQueryWrapper.between(DataCaseVerif::getCreateTime, request.getBeginTime(), request.getEndTime());
List<DataCaseVerif> dataCaseVerifs = dataCaseVerifMapper.getListData(fxsj.getId(), request.getBeginTime(), request.getEndTime());
List<Negative> negatives = negativeMapper.getNegativeListData(fxsj.getId(), request.getBeginTime(), request.getEndTime(), proCode);
List<Negative> ssNegative = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList();
NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam();
negativeBlameQueryParam.setNegativeIds(ssNegative.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();
Double verificationRate = 0.0;
if (!dataCaseVerifs.isEmpty()) {
double rawRate = (double) ssNegative.size() / dataCaseVerifs.size() * 100;
verificationRate = Math.ceil(rawRate);
}
CaseVerificationMapVo caseVerificationMapVo = new CaseVerificationMapVo();
caseVerificationMapVo.setName(fxsj.getShortName());
caseVerificationMapVo.setDepartId(fxsj.getId());
caseVerificationMapVo.setTotal(dataCaseVerifs.size());
caseVerificationMapVo.setConfirmed(ssNegative.size());
caseVerificationMapVo.setDealCasePro(negatives.size());
caseVerificationMapVo.setPunishPre(personalBlames.size() + leadBlames.size());
caseVerificationMapVo.setPunishOrg(unitBlames.size());
caseVerificationMapVo.setRate(verificationRate);
caseVerificationMapList.add(caseVerificationMapVo);
}
JSONObject res = new JSONObject().fluentPut("caseVerificationMapList", caseVerificationMapList);
return Result.success(res);
}
public Result<JSONObject> getSubOneMailMapIcon() {
// ✅ 注意:这里的 name 必须和地图 geojson 区域名一致(一般是“xx街道/园区”)

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

@ -122,4 +122,21 @@
</select>
<!-- 根据部门ID、时间范围和问题来源编码查询问题列表 -->
<select id="getNegativeListData" resultType="com.biutag.supervision.pojo.entity.Negative">
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.problemSourcesCode in
<foreach collection='codes' item='code' open='(' separator=',' close=')'>
#{code}
</foreach>
and ng.crtTime >= #{beginTime}
and ng.crtTime &lt;= #{endTime}
AND (sd.id = #{id} OR sdd.id = #{id} OR sddd.id = #{id})
</select>
</mapper>

Loading…
Cancel
Save