|
|
|
|
@ -3,13 +3,11 @@ package com.biutag.supervision.controller.datav;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.biutag.supervision.pojo.Result; |
|
|
|
|
import com.biutag.supervision.pojo.vo.EchartsVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.RecentMailTrendByMonthVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.RecentTrendByMonthVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.*; |
|
|
|
|
import com.biutag.supervision.service.DataGobalService; |
|
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
|
import jakarta.activation.DataHandler; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import org.springframework.format.annotation.DateTimeFormat; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
@ -19,6 +17,7 @@ import java.time.format.DateTimeFormatter;
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.function.BiConsumer; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -51,7 +50,7 @@ public class DataGobalController {
|
|
|
|
|
// 获取数据大屏中央总数概览
|
|
|
|
|
JSONObject overview = dataGobalService.getAllGobalCount(beginTime, endTime); |
|
|
|
|
|
|
|
|
|
// 获取数据大屏各机构问题排名
|
|
|
|
|
// 机构问题排名 fxsjlist中必有所有机构,不会为空
|
|
|
|
|
List<OrganizeProblemRankVo> fxsjlist = dataGobalService.getOrganizeProblemRank(3, beginTime, endTime); |
|
|
|
|
List<OrganizeProblemRankVo> jsdwlist = dataGobalService.getOrganizeProblemRank(4, beginTime, endTime); |
|
|
|
|
|
|
|
|
|
@ -61,34 +60,73 @@ public class DataGobalController {
|
|
|
|
|
// 问题类型占比
|
|
|
|
|
List<EchartsVo> wtlxlist = dataGobalService.getProblemRate(beginTime, endTime); |
|
|
|
|
|
|
|
|
|
// 突出问题排名
|
|
|
|
|
List<StrongProblemRank> tcwtlist = dataGobalService.getStrongProblemRank(beginTime, endTime); |
|
|
|
|
|
|
|
|
|
// 地图显示结果
|
|
|
|
|
List<GobalMapIconVo> gobalMapVoList = new ArrayList<>(); |
|
|
|
|
fxsjlist.forEach(item -> { |
|
|
|
|
// 添加总数
|
|
|
|
|
GobalMapIconVo gobalMapVo = new GobalMapIconVo(); |
|
|
|
|
gobalMapVo.setName(item.getLabel()); |
|
|
|
|
gobalMapVo.setTotalPro(Integer.parseInt(item.getValue())); |
|
|
|
|
gobalMapVoList.add(gobalMapVo); |
|
|
|
|
}); |
|
|
|
|
// 市县分局的督察问题
|
|
|
|
|
List<CommonVo> superviseProList = dataGobalService.getSuperviseProTotal(beginTime, endTime); |
|
|
|
|
List<CommonVo> caseVerifyProList = dataGobalService.getCaseVerifyProTotal(beginTime, endTime); |
|
|
|
|
List<CommonVo> mailProList = dataGobalService.getMailProTotal(beginTime, endTime); |
|
|
|
|
List<CommonVo> policeProList = dataGobalService.getPoliceProTotal(beginTime, endTime); |
|
|
|
|
List<CommonVo> reviewProList = dataGobalService.getReviewProTotal(beginTime, endTime); |
|
|
|
|
List<GobalMapIconVo> gobalTempMapVoList = new ArrayList<>(); |
|
|
|
|
if (false) { |
|
|
|
|
updateProList(superviseProList, gobalMapVoList, GobalMapIconVo::setSupervisePro); |
|
|
|
|
updateProList(caseVerifyProList, gobalMapVoList, GobalMapIconVo::setCaseVerifyPro); |
|
|
|
|
updateProList(mailProList, gobalMapVoList, GobalMapIconVo::setMailPro); |
|
|
|
|
updateProList(policeProList, gobalMapVoList, GobalMapIconVo::setPolicePro); |
|
|
|
|
updateProList(reviewProList, gobalMapVoList, GobalMapIconVo::setReviewPro); |
|
|
|
|
}else { |
|
|
|
|
|
|
|
|
|
gobalTempMapVoList.add(new GobalMapIconVo("芙蓉分局", 11,11,11,11,11,11)); |
|
|
|
|
gobalTempMapVoList.add(new GobalMapIconVo("天心分局", 11,11,11,11,11,11)); |
|
|
|
|
gobalTempMapVoList.add(new GobalMapIconVo("岳麓分局", 11,11,11,11,11,11)); |
|
|
|
|
gobalTempMapVoList.add(new GobalMapIconVo("开福分局", 11,11,11,11,11,11)); |
|
|
|
|
gobalTempMapVoList.add(new GobalMapIconVo("雨花分局", 11,11,11,11,11,11)); |
|
|
|
|
gobalTempMapVoList.add(new GobalMapIconVo("长沙县局", 11,11,11,11,11,11)); |
|
|
|
|
gobalTempMapVoList.add(new GobalMapIconVo("望城分局", 11,11,11,11,11,11)); |
|
|
|
|
gobalTempMapVoList.add(new GobalMapIconVo("宁乡市局", 11,11,11,11,11,11)); |
|
|
|
|
gobalTempMapVoList.add(new GobalMapIconVo("浏阳市局", 11,11,11,11,11,11)); |
|
|
|
|
gobalTempMapVoList.add(new GobalMapIconVo("高新分局", 11,11,11,11,11,11)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject data = new JSONObject().fluentPut("overview", overview) |
|
|
|
|
.fluentPut("fxsjlist", fxsjlist) |
|
|
|
|
.fluentPut("jsdwlist", jsdwlist) |
|
|
|
|
.fluentPut("ywzblist", ywzblist) |
|
|
|
|
.fluentPut("wtlxlist", wtlxlist); |
|
|
|
|
.fluentPut("wtlxlist", wtlxlist) |
|
|
|
|
.fluentPut("tcwtlist", tcwtlist) |
|
|
|
|
.fluentPut("gobalMapVoList", gobalMapVoList) |
|
|
|
|
.fluentPut("gobalTempMapVoList", gobalTempMapVoList); |
|
|
|
|
return Result.success(data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "机构问题排名") |
|
|
|
|
@GetMapping("{groupType}") |
|
|
|
|
public Result<JSONObject> getOrganizeProblemRank( |
|
|
|
|
@PathVariable Integer groupType, |
|
|
|
|
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, |
|
|
|
|
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { |
|
|
|
|
|
|
|
|
|
List<OrganizeProblemRankVo> fxsjlist = dataGobalService.getOrganizeProblemRank(groupType, beginTime, endTime); |
|
|
|
|
List<OrganizeProblemRankVo> jsdwlist = dataGobalService.getOrganizeProblemRank(groupType, beginTime, endTime); |
|
|
|
|
JSONObject data = new JSONObject() |
|
|
|
|
.fluentPut("fxsjlist", fxsjlist) |
|
|
|
|
.fluentPut("jsdwlist", jsdwlist); |
|
|
|
|
return Result.success(data); |
|
|
|
|
public void updateProList(List<CommonVo> proList, List<GobalMapIconVo> gobalMapVoList, BiConsumer<GobalMapIconVo, Integer> setter) { |
|
|
|
|
for (GobalMapIconVo gobalMapIconVo : gobalMapVoList) { |
|
|
|
|
for (CommonVo commonVo : proList) { |
|
|
|
|
if (gobalMapIconVo.getName().equals(commonVo.getName())) { |
|
|
|
|
Integer temp = Integer.parseInt(commonVo.getValue()); |
|
|
|
|
setter.accept(gobalMapIconVo, Integer.parseInt(commonVo.getValue()) + temp); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 数据大屏问题趋势统计(按月) |
|
|
|
|
* |
|
|
|
|
* @param year |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@ -127,7 +165,7 @@ public class DataGobalController {
|
|
|
|
|
} |
|
|
|
|
// 截取月份
|
|
|
|
|
List<String> monthOnlyList = monthList.stream() |
|
|
|
|
.map(date -> date.substring(date.indexOf('-') + 1)+"月") |
|
|
|
|
.map(date -> date.substring(date.indexOf('-') + 1) + "月") |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
JSONObject jsonObject = new JSONObject() |
|
|
|
|
.fluentPut("monthList", monthOnlyList) |
|
|
|
|
|