Browse Source

研判分析报告--重新区分统计维度

master
buaixuexideshitongxue 2 weeks ago
parent
commit
d98fbafd58
  1. 4
      src/main/java/com/biutag/supervision/pojo/vo/NegativeQueryVo.java
  2. 3
      src/main/java/com/biutag/supervision/service/report/ReportDataService.java
  3. 58
      src/main/java/com/biutag/supervision/service/report/ReportDataServiceImpl.java

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

@ -201,4 +201,8 @@ public class NegativeQueryVo {
@Schema(description = "下发单位名字")
@TableField("issuingDepartName")
private String issuingDepartName;
@Schema(description = "下发层级")
private Integer crtDepartLevel;
}

3
src/main/java/com/biutag/supervision/service/report/ReportDataService.java

@ -2,6 +2,7 @@ package com.biutag.supervision.service.report;
import com.biutag.supervision.pojo.dto.report.ReportViewModel;
import com.biutag.supervision.pojo.param.NegativeQueryParam;
import com.biutag.supervision.pojo.request.negative.ReportGenerationRequest;
public interface ReportDataService {
@ -12,7 +13,7 @@ public interface ReportDataService {
* @param request
* @return
*/
ReportViewModel buildViewModel(ReportGenerationRequest request);
ReportViewModel buildViewModel(NegativeQueryParam request);

58
src/main/java/com/biutag/supervision/service/report/ReportDataServiceImpl.java

@ -4,13 +4,13 @@ import cn.hutool.core.util.StrUtil;
import com.biutag.supervision.constants.enums.CheckStatusEnum;
import com.biutag.supervision.pojo.dto.report.OverviewSection;
import com.biutag.supervision.pojo.dto.report.ReportViewModel;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeBlame;
import com.biutag.supervision.pojo.param.NegativeQueryParam;
import com.biutag.supervision.pojo.param.negativeBlame.NegativeBlameQueryParam;
import com.biutag.supervision.pojo.request.negative.ReportGenerationRequest;
import com.biutag.supervision.pojo.vo.NegativeQueryVo;
import com.biutag.supervision.repository.negative.NegativeResourceService;
import com.biutag.supervision.repository.negativeBlame.NegativeBlameResourceService;
import com.biutag.supervision.service.NegativeQueryService;
import com.biutag.supervision.util.DateCompareRangeUtil;
import com.biutag.supervision.util.ReportTrendUtil;
import com.biutag.supervision.util.TimeUtil;
@ -32,10 +32,13 @@ public class ReportDataServiceImpl implements ReportDataService {
@Resource
private NegativeBlameResourceService negativeBlameResourceService;
@Resource
private NegativeQueryService negativeQueryService;
@Override
public ReportViewModel buildViewModel(ReportGenerationRequest request) {
String periodStart = TimeUtil.formatDate(request.getBeginTime());
String periodEnd = TimeUtil.formatDate(request.getEndTime());
public ReportViewModel buildViewModel(NegativeQueryParam request) {
String periodStart = TimeUtil.formatDate(request.getCrtTime().get(0));
String periodEnd = TimeUtil.formatDate(request.getCrtTime().get(0));
ReportViewModel vm = new ReportViewModel();
vm.setPeriodStart(periodStart);
vm.setPeriodEnd(periodEnd);
@ -52,37 +55,32 @@ public class ReportDataServiceImpl implements ReportDataService {
* @param periodEnd
* @return
*/
private OverviewSection buildOverviewSection(ReportGenerationRequest request, String periodStart, String periodEnd) {
private OverviewSection buildOverviewSection(NegativeQueryParam request, String periodStart, String periodEnd) {
DateCompareRangeUtil.CompareDateRange compareDateRange = DateCompareRangeUtil.buildCompareDateRange(request.getBeginTime(), request.getEndTime());
DateCompareRangeUtil.CompareDateRange compareDateRange = DateCompareRangeUtil.buildCompareDateRange(request.getCrtTime().get(0), request.getCrtTime().get(1));
// 总体数据
NegativeQueryParam ztNegativeQueryParam = new NegativeQueryParam();
ztNegativeQueryParam.setCrtTime(compareDateRange.current());
List<Negative> ztNegativeList = negativeResourceService.query(ztNegativeQueryParam);
List<NegativeQueryVo> ztNegativeList = negativeQueryService.page(request).getRecords();
// 环比数据
NegativeQueryParam hbQueryParam = new NegativeQueryParam();
hbQueryParam.setCrtTime(compareDateRange.mom());
List<Negative> hbNegativList = negativeResourceService.query(hbQueryParam);
request.setCrtTime(compareDateRange.mom());
List<NegativeQueryVo> hbNegativList = negativeQueryService.page(request).getRecords();
// 同比数据
NegativeQueryParam tbQueryParam = new NegativeQueryParam();
tbQueryParam.setCrtTime(compareDateRange.yoy());
List<Negative> tbNegativList = negativeResourceService.query(tbQueryParam);
request.setCrtTime(compareDateRange.yoy());
List<NegativeQueryVo> tbNegativList = negativeQueryService.page(request).getRecords();
// 市局下发数据
List<Negative> sjxfNegativeList = ztNegativeList.stream().filter(one -> Objects.equals(0, one.getCrtDepartLevel())).toList();
List<NegativeQueryVo> sjxfNegativeList = ztNegativeList.stream().filter(one -> Objects.equals(0, one.getCrtDepartLevel())).toList();
// 分县市局下发数据
List<Negative> fxsjxfNegativeList = ztNegativeList.stream().filter(one -> Objects.equals(2, one.getCrtDepartLevel())).toList();
List<NegativeQueryVo> fxsjxfNegativeList = ztNegativeList.stream().filter(one -> Objects.equals(2, one.getCrtDepartLevel())).toList();
// 办结数据
List<Negative> bjNegativeList = ztNegativeList.stream().filter(one -> !Objects.isNull(one.getCompleteDate())).toList();
List<NegativeQueryVo> bjNegativeList = ztNegativeList.stream().filter(one -> !Objects.isNull(one.getCompleteDate())).toList();
// 办结中属实数据
List<Negative> bjssNegativeList = bjNegativeList.stream().filter(one -> CheckStatusEnum.TRUE_LIST.contains(one.getCheckStatusCode())).toList();
List<NegativeQueryVo> bjssNegativeList = bjNegativeList.stream().filter(one -> CheckStatusEnum.TRUE_LIST.contains(one.getCheckStatus())).toList();
// 办结中基本属实数据
List<Negative> bjjbssNegativeList = bjNegativeList.stream().filter(one -> CheckStatusEnum.PART_TRUE_LIST.contains(one.getCheckStatusCode())).toList();
List<NegativeQueryVo> bjjbssNegativeList = bjNegativeList.stream().filter(one -> CheckStatusEnum.PART_TRUE_LIST.contains(one.getCheckStatus())).toList();
// 办结中不属实数据
List<Negative> bjbssNegativeList = bjNegativeList.stream().filter(one -> CheckStatusEnum.FALSE_LIST.contains(one.getCheckStatusCode())).toList();
List<NegativeQueryVo> bjbssNegativeList = bjNegativeList.stream().filter(one -> CheckStatusEnum.FALSE_LIST.contains(one.getCheckStatus())).toList();
// 属实 基本属实中的问责数据
List<String> ssNegativeIds = Stream.concat(bjssNegativeList.stream(), bjjbssNegativeList.stream())
.map(Negative::getId).filter(StrUtil::isNotBlank).distinct().toList();
.map(NegativeQueryVo::getId).filter(StrUtil::isNotBlank).distinct().toList();
NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam();
negativeBlameQueryParam.setNegativeIds(ssNegativeIds);
List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(negativeBlameQueryParam);
@ -144,12 +142,12 @@ public class ReportDataServiceImpl implements ReportDataService {
overviewSection.setVerifiedYoyTrend(ReportTrendUtil.calcTrend(curVerifiedRate, yoyVerifiedRate));
// 集中问题
Map.Entry<String, Long> problemEntry = ReportTrendUtil.topBy(Negative::getProblemSources, bjssNegativeList, bjjbssNegativeList);
Map.Entry<String, Long> problemEntry = ReportTrendUtil.topBy(NegativeQueryVo::getProblemSources, bjssNegativeList, bjjbssNegativeList);
String problemSource = problemEntry != null ? problemEntry.getKey() : null;
Long problemSourceCount = problemEntry != null ? problemEntry.getValue() : 0;
overviewSection.setTopProblemProject(problemSource);
// 重点关注单位
Map.Entry<String, Long> departEntry = ReportTrendUtil.topBy(Negative::getInvolveDepartName, bjssNegativeList, bjjbssNegativeList);
Map.Entry<String, Long> departEntry = ReportTrendUtil.topBy(NegativeQueryVo::getInvolveDepartName, bjssNegativeList, bjjbssNegativeList);
String departName = departEntry != null ? departEntry.getKey() : null;
Long departNameCount = departEntry != null ? departEntry.getValue() : 0;
overviewSection.setTopProblemUnit(departName);
@ -158,9 +156,9 @@ public class ReportDataServiceImpl implements ReportDataService {
// 查实率
private BigDecimal calcVerifiedRate(List<Negative> list) {
private BigDecimal calcVerifiedRate(List<NegativeQueryVo> list) {
// 办结
List<Negative> closed = list.stream().filter(n -> n.getCompleteDate() != null).toList();
List<NegativeQueryVo> closed = list.stream().filter(n -> n.getCompleteDate() != null).toList();
int closedCount = closed.size();
if (closedCount == 0) {
@ -169,12 +167,12 @@ public class ReportDataServiceImpl implements ReportDataService {
// 属实
int verified = (int) closed.stream()
.filter(n -> CheckStatusEnum.TRUE_LIST.contains(n.getCheckStatusCode()))
.filter(n -> CheckStatusEnum.TRUE_LIST.contains(n.getCheckStatus()))
.count();
// 基本属实
int partVerified = (int) closed.stream()
.filter(n -> CheckStatusEnum.PART_TRUE_LIST.contains(n.getCheckStatusCode()))
.filter(n -> CheckStatusEnum.PART_TRUE_LIST.contains(n.getCheckStatus()))
.count();
// 查实率 = (属实 + 基本属实) / 办结

Loading…
Cancel
Save