Browse Source

2024/11/28 17:14 现场督察完成1.0

main
parent
commit
652fa52ee6
  1. 155
      src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java
  2. 1
      src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java
  3. 206
      src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java
  4. 161
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  5. 21
      src/main/java/com/biutag/supervision/pojo/vo/DayTimeSuperviseVo.java
  6. 2
      src/main/java/com/biutag/supervision/pojo/vo/OrganizeProblemRankVo.java
  7. 4
      src/main/java/com/biutag/supervision/pojo/vo/RankVo.java
  8. 147
      src/main/java/com/biutag/supervision/service/DataGobalService.java
  9. 151
      src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java

155
src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java

@ -3,24 +3,24 @@ package com.biutag.supervision.controller.datav;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.vo.*; import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.GobalMapIconVo;
import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo;
import com.biutag.supervision.pojo.vo.StrongProblemRank;
import com.biutag.supervision.service.DataGobalService; import com.biutag.supervision.service.DataGobalService;
import com.biutag.supervision.service.DataSupervisionNotifyServiceImpl;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.activation.DataHandler;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.stream.Collectors;
/** /**
@ -39,49 +39,8 @@ public class DataGobalController {
private final DataGobalService dataGobalService; private final DataGobalService dataGobalService;
/** //region 左边
* 获取数据大屏概览 // 机构问题排名
* 大屏中央数据
*
* @param beginTime
* @param endTime
* @return
*/
@Operation(summary = "大屏中央数据")
@GetMapping
public Result<JSONObject> getAllGobalCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 获取数据大屏中央总数概览
JSONObject overview = dataGobalService.getAllGobalCount(beginTime, endTime);
JSONObject data = new JSONObject()
.fluentPut("overview", overview);
return Result.success(data);
}
/**
* 数据大屏问题趋势统计按月展示
*
* @param year
* @return
*/
@Operation(summary = "数据大屏问题趋势统计")
@GetMapping("/getGobalRecentlyTrendByMonth")
public Result<JSONObject> getGobalRecentlyTrendByMonth(@RequestParam Integer year) {
List<EchartsVo> gobalRecentlyTrendList = dataGobalService.getGobalRecentlyTrendByMonth(String.valueOf(year));
JSONObject jsonObject = new JSONObject()
.fluentPut("gobalRecentlyTrendList", gobalRecentlyTrendList);
return Result.success(jsonObject);
}
/**
* 机构问题排名
*
* @param beginTime
* @param endTime
* @return
*/
@Operation(summary = "机构问题排名") @Operation(summary = "机构问题排名")
@GetMapping("/getOrganizationRank") @GetMapping("/getOrganizationRank")
public Result<JSONObject> getOrganizationRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getOrganizationRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@ -97,13 +56,7 @@ public class DataGobalController {
} }
/** // 业务类型占比
* 业务类型占比
*
* @param beginTime
* @param endTime
* @return
*/
@Operation(summary = "业务类型占比") @Operation(summary = "业务类型占比")
@GetMapping("/getBusinessRate") @GetMapping("/getBusinessRate")
public Result<JSONObject> getBusinessRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getBusinessRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@ -113,34 +66,60 @@ public class DataGobalController {
JSONObject res = new JSONObject().fluentPut("ywzblist", ywzblist); JSONObject res = new JSONObject().fluentPut("ywzblist", ywzblist);
return Result.success(res); return Result.success(res);
} }
//endregion
//region 中间
// 获取首页大屏中央数据
@Operation(summary = "大屏中央数据")
@GetMapping
public Result<JSONObject> getAllGobalCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 获取数据大屏中央总数概览
JSONObject overview = dataGobalService.getAllGobalCount(beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("overview", overview);
return Result.success(data);
}
// 地图数据
@Operation(summary = "地图数据")
@GetMapping("/getMap")
public Result<JSONObject> getMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 地图数据
List<GobalMapIconVo> gobalTempMapVoList = Optional.ofNullable(dataGobalService.getMapIconInfo(beginTime, endTime)).
orElseGet(ArrayList::new);
JSONObject data = new JSONObject().fluentPut("gobalTempMapVoList", gobalTempMapVoList);
return Result.success(data);
}
// 数据大屏问题趋势统计(按月展示)
@Operation(summary = "数据大屏问题趋势统计")
@GetMapping("/getGobalRecentlyTrendByMonth")
public Result<JSONObject> getGobalRecentlyTrendByMonth(@RequestParam Integer year) {
List<EchartsVo> gobalRecentlyTrendList = dataGobalService.getGobalRecentlyTrendByMonth(String.valueOf(year));
JSONObject jsonObject = new JSONObject().fluentPut("gobalRecentlyTrendList", gobalRecentlyTrendList);
return Result.success(jsonObject);
}
//endregion
/** //region 右边
* 突出问题排名 // 突出问题排名
*
* @param beginTime
* @param endTime
* @return
*/
@Operation(summary = "突出问题排名") @Operation(summary = "突出问题排名")
@GetMapping("/getStrongProblemRate") @GetMapping("/getStrongProblemRate")
public Result<JSONObject> getStrongProblemRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getStrongProblemRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 突出问题排名 // 突出问题排名
List<StrongProblemRank> tcwtlist = dataGobalService.getStrongProblemRank(beginTime, endTime); List<StrongProblemRank> tcwtlist = dataGobalService.getStrongProblemRank(beginTime, endTime);
JSONObject res = new JSONObject() JSONObject res = new JSONObject().fluentPut("tcwtlist", tcwtlist);
.fluentPut("tcwtlist", tcwtlist);
return Result.success(res); return Result.success(res);
} }
/** // 问题类型占比
* 问题类型占比
*
* @param beginTime
* @param endTime
* @return
*/
@Operation(summary = "问题类型占比") @Operation(summary = "问题类型占比")
@GetMapping("/getProblemBusinessRate") @GetMapping("/getProblemBusinessRate")
public Result<JSONObject> getProblemBusinessRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getProblemBusinessRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@ -148,33 +127,9 @@ public class DataGobalController {
// 问题类型占比 // 问题类型占比
List<EchartsVo> wtlxlist = dataGobalService.getProblemRate(beginTime, endTime); List<EchartsVo> wtlxlist = dataGobalService.getProblemRate(beginTime, endTime);
JSONObject res = new JSONObject() JSONObject res = new JSONObject().fluentPut("wtlxlist", wtlxlist);
.fluentPut("wtlxlist", wtlxlist);
return Result.success(res); return Result.success(res);
} }
//endregion
/**
* 地图数据
*
* @param beginTime
* @param endTime
* @return
*/
@Operation(summary = "地图数据")
@GetMapping("/getMap")
public Result<JSONObject> getMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 地图数据
List<GobalMapIconVo> gobalTempMapVoList = Optional.ofNullable(dataGobalService.getMapIconInfo(beginTime, endTime)).
orElseGet(ArrayList::new);
JSONObject data = new JSONObject()
.fluentPut("gobalTempMapVoList", gobalTempMapVoList);
return Result.success(data);
}
} }

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

@ -80,7 +80,6 @@ public class DataVCaseVerifController {
@GetMapping("/getAllCaseVerifCount") @GetMapping("/getAllCaseVerifCount")
public Result<JSONObject> getAllCaseVerifCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getAllCaseVerifCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 案件总数(起) // 案件总数(起)
long total = dataCaseVerifService.count(new LambdaQueryWrapper<DataCaseVerif>().between(DataCaseVerif::getDiscoveryTime, beginTime, endTime)); long total = dataCaseVerifService.count(new LambdaQueryWrapper<DataCaseVerif>().between(DataCaseVerif::getDiscoveryTime, beginTime, endTime));
Integer confirmed = dataCaseVerifService.getConfirmed(beginTime, endTime); // 查实案件数 Integer confirmed = dataCaseVerifService.getConfirmed(beginTime, endTime); // 查实案件数

206
src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java

@ -34,78 +34,50 @@ public class SupervisionNotifyController {
private final DataSupervisionNotifyServiceImpl dataSupervisionNotifyService; private final DataSupervisionNotifyServiceImpl dataSupervisionNotifyService;
/**
* 获取现场督察大屏数据
*
* @return
*/
@Operation(summary = "获取所有督察通知相关数量")
@GetMapping
public Result<JSONObject> getAllSupervisionNotifyCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
JSONObject overview = dataSupervisionNotifyService.getAllSupervisionNotifyCount(beginTime, endTime);
//问题类型占比 // region 左边
List<EchartsVo> wtlxList = dataSupervisionNotifyService.getProblemTypeRatio(beginTime, endTime);
//地图数据 //获取日常督察情况
List<SuperviseMapIconVo> superviseTempMapVoList = dataSupervisionNotifyService.getsupervisionMapIconInfo(beginTime, endTime);
// 黄赌毒总览
JSONObject hddOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime);
// 黄毒赌列表
List<RankVo> hddList = dataSupervisionNotifyService.getYellowBet(beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("wtlxList", wtlxList)
.fluentPut("overview", overview)
.fluentPut("superviseTempMapVoList", superviseTempMapVoList)
.fluentPut("hddList", hddList)
.fluentPut("hddOverview", hddOverview);
return Result.success(data);
}
/**
* 获取日常督察排行
*
* @param groupType 分组类型 1: 分县市局 2: 局属单位
* @return
*/
@Operation(summary = "获取日常督察数量概览和整改率排名") @Operation(summary = "获取日常督察数量概览和整改率排名")
@GetMapping("/rank") @GetMapping("/rank")
public Result<JSONObject> getChangedRank(@RequestParam Integer groupType, public Result<JSONObject> getChangedRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
RankVoSup temp = dataSupervisionNotifyService.getSuperversionRank(beginTime, endTime); DayTimeSuperviseVo fxsjRankOverview = dataSupervisionNotifyService.getSuperversionRank(beginTime, endTime, 3);
JSONObject rankOverview = new JSONObject() DayTimeSuperviseVo jsdwRankOverview = dataSupervisionNotifyService.getSuperversionRank(beginTime, endTime, 4);
.fluentPut("proTotal", temp.getProblemNumber()) List<RankVo> fxsjChangedRankList = dataSupervisionNotifyService.getChangedRateRank(3, beginTime, endTime);
.fluentPut("changing", temp.getRectifingNumber()) List<RankVo> jsdwChangedRankList = dataSupervisionNotifyService.getChangedRateRank(4, beginTime, endTime);
.fluentPut("changed", temp.getRectifedNumber())
.fluentPut("correctionRate", temp.getRectifyRate());
List<RankVo> changedRankList = dataSupervisionNotifyService.getChangedRateRank(groupType, beginTime, endTime);
JSONObject data = new JSONObject() JSONObject data = new JSONObject()
.fluentPut("rankOverview", rankOverview) .fluentPut("fxsjRankOverview", fxsjRankOverview)
.fluentPut("changedRankList", changedRankList); .fluentPut("jsdwRankOverview", jsdwRankOverview)
.fluentPut("fxsjChangedRankList", fxsjChangedRankList)
.fluentPut("jsdwChangedRankList", jsdwChangedRankList);
return Result.success(data); return Result.success(data);
} }
//问题类型占比
/** @GetMapping("/getProblemTypeRate")
* 获取现场督察问题趋势 public Result<JSONObject> getProblemTypeRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
*/ @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@GetMapping("/getSupervisionTrend") List<EchartsVo> wtlxList = dataSupervisionNotifyService.getProblemTypeRatio(beginTime, endTime);
public Result<JSONObject> getSupervisionTrend(@RequestParam String year) { JSONObject data = new JSONObject().fluentPut("wtlxList", wtlxList);
List<EchartsVo> supervisionTrend = dataSupervisionNotifyService.getSupervisionTrend(year);
JSONObject data = new JSONObject().fluentPut("supervisionTrend", supervisionTrend);
return Result.success(data); return Result.success(data);
} }
// endregion
// region 中间
/** //获取现场督察大屏中央数据
* 地图数据 @Operation(summary = "获取所有督察通知相关数量")
*/ @GetMapping
public Result<JSONObject> getAllSupervisionNotifyCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
JSONObject overview = dataSupervisionNotifyService.getAllSupervisionNotifyCount(beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("overview", overview);
return Result.success(data);
}
// 地图数据
@GetMapping("/getMap") @GetMapping("/getMap")
public Result<JSONObject> getMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@ -115,35 +87,117 @@ public class SupervisionNotifyController {
return Result.success(data); return Result.success(data);
} }
// 获取现场督察问题趋势
/** @GetMapping("/getSupervisionTrend")
* 问题类型占比 public Result<JSONObject> getSupervisionTrend(@RequestParam String year) {
* List<EchartsVo> supervisionTrend = dataSupervisionNotifyService.getSupervisionTrend(year);
* @return JSONObject data = new JSONObject().fluentPut("supervisionTrend", supervisionTrend);
*/
@GetMapping("/getProblemTypeRate")
public Result<JSONObject> getProblemTypeRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
List<EchartsVo> wtlxList = dataSupervisionNotifyService.getProblemTypeRatio(beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("wtlxList", wtlxList);
return Result.success(data); return Result.success(data);
} }
// endregion
/** // region 右边
* 黄赌毒数据 // 黄赌毒数据
*/
@GetMapping("/getYellowBetDrug") @GetMapping("/getYellowBetDrug")
public Result<JSONObject> getYellowBetDrug(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getYellowBetDrug(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 黄赌毒总览 // 黄赌毒总览
JSONObject hddOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime); DayTimeSuperviseVo fxsjYellowBetOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 3, 1);
DayTimeSuperviseVo jsdwYellowBetOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 4, 1);
// 黄毒赌列表 // 黄毒赌列表
List<RankVo> hddList = dataSupervisionNotifyService.getYellowBet(beginTime, endTime); List<OrganizeProblemRankVo> fxsjYellowBetRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 3, 1);
JSONObject data = new JSONObject().fluentPut("hddOverview", hddOverview).fluentPut("hddList", hddList); List<OrganizeProblemRankVo> jsdwYellowBetRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 4, 1);
JSONObject data = new JSONObject()
.fluentPut("fxsjYellowBetOverview", fxsjYellowBetOverview)
.fluentPut("jsdwYellowBetOverview", jsdwYellowBetOverview)
.fluentPut("fxsjYellowBetRankList", fxsjYellowBetRankList)
.fluentPut("jsdwYellowBetRankList", jsdwYellowBetRankList);
return Result.success(data);
}
// 枪支管理数据
@GetMapping("/getGunController")
public Result<JSONObject> getGunController(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 枪支管理总览
DayTimeSuperviseVo fxsjGunControllerOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 3, 2);
DayTimeSuperviseVo jsdwGunControllerOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 4, 2);
// 枪支管理列表
List<OrganizeProblemRankVo> fxsjGunControllerRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 3, 2);
List<OrganizeProblemRankVo> jsdwGunControllerRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 4, 2);
JSONObject data = new JSONObject()
.fluentPut("fxsjGunControllerOverview", fxsjGunControllerOverview)
.fluentPut("jsdwGunControllerOverview", jsdwGunControllerOverview)
.fluentPut("fxsjGunControllerRankList", fxsjGunControllerRankList)
.fluentPut("jsdwGunControllerRankList", jsdwGunControllerRankList);
return Result.success(data);
}
// 涉企问题数据
@GetMapping("/getCompanyProblem")
public Result<JSONObject> getCompanyProblem(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 涉企问题总览
DayTimeSuperviseVo fxsjCompanyProblemOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 3, 3);
DayTimeSuperviseVo jsdwCompanyProblemOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 4, 3);
// 涉企问题列表
List<OrganizeProblemRankVo> fxsjCompanyProblemRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 3, 3);
List<OrganizeProblemRankVo> jsdwCompanyProblemRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 4, 3);
JSONObject data = new JSONObject()
.fluentPut("fxsjCompanyProblemOverview", fxsjCompanyProblemOverview)
.fluentPut("jsdwCompanyProblemOverview", jsdwCompanyProblemOverview)
.fluentPut("fxsjCompanyProblemRankList", fxsjCompanyProblemRankList)
.fluentPut("jsdwCompanyProblemRankList", jsdwCompanyProblemRankList);
return Result.success(data);
}
// 执法办案数据
@GetMapping("/getHandleCase")
public Result<JSONObject> getHandleCase(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 执法办案总览
DayTimeSuperviseVo fxsjHandleCaseOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 3, 4);
DayTimeSuperviseVo jsdwHandleCaseOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 4, 4);
// 执法办案列表
List<OrganizeProblemRankVo> fxsjHandleCaseRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 3, 4);
List<OrganizeProblemRankVo> jsdwHandleCaseRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 4, 4);
JSONObject data = new JSONObject()
.fluentPut("fxsjHandleCaseOverview", fxsjHandleCaseOverview)
.fluentPut("jsdwHandleCaseOverview", jsdwHandleCaseOverview)
.fluentPut("fxsjHandleCaseRankList", fxsjHandleCaseRankList)
.fluentPut("jsdwHandleCaseRankList", jsdwHandleCaseRankList);
return Result.success(data); return Result.success(data);
} }
// 工作日测酒数据
@GetMapping("/getCheckBeer")
public Result<JSONObject> getCheckBeer(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 工作日测酒总览
DayTimeSuperviseVo fxsjCheckBeerOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 3, 5);
DayTimeSuperviseVo jsdwCheckBeerOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 4, 5);
// 工作日测酒列表
List<OrganizeProblemRankVo> fxsjCheckBeerRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 3, 5);
List<OrganizeProblemRankVo> jsdwCheckBeerRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 4, 5);
JSONObject data = new JSONObject()
.fluentPut("fxsjCheckBeerOverview", fxsjCheckBeerOverview)
.fluentPut("jsdwCheckBeerOverview", jsdwCheckBeerOverview)
.fluentPut("fxsjCheckBeerRankList", fxsjCheckBeerRankList)
.fluentPut("jsdwCheckBeerRankList", jsdwCheckBeerRankList);
return Result.success(data);
}
// endregion
} }

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

@ -30,6 +30,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"ORDER BY `value` DESC ") "ORDER BY `value` DESC ")
List<OrganizeProblemRankVo> selectOrganizeProblemRank(Integer groupType, Date beginTime, Date endTime); List<OrganizeProblemRankVo> selectOrganizeProblemRank(Integer groupType, Date beginTime, Date endTime);
// 业务类型占比
@Select("SELECT businessTypeName as name, count(*) value FROM negative " + @Select("SELECT businessTypeName as name, count(*) value FROM negative " +
"WHERE " + "WHERE " +
"discoveryTime BETWEEN #{beginTime} and #{endTime} and checkStatus=1 " + "discoveryTime BETWEEN #{beginTime} and #{endTime} and checkStatus=1 " +
@ -37,13 +38,6 @@ public interface NegativeMapper extends BaseMapper<Negative> {
List<EchartsVo> selectBusinessRate(Date beginTime, Date endTime); List<EchartsVo> selectBusinessRate(Date beginTime, Date endTime);
@Select("SELECT DATE_FORMAT(ng.discoveryTime, '%Y-%m') AS monthTime, COUNT(*) total FROM negative ng " +
"WHERE YEAR(ng.discoveryTime)=#{year} and checkStatus=1 " +
"GROUP BY monthTime " +
"order BY monthTime asc")
List<RecentTrendByMonthVo> selectRecentTrendByMonth(String year);
@Select("SELECT count(*) FROM negative ng INNER JOIN " + @Select("SELECT count(*) FROM negative ng INNER JOIN " +
" (" + " (" +
" SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " + " SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " +
@ -99,35 +93,40 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}") "AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer seleGobalMapIconInfoSjdc(Date beginTime, Date endTime, Integer departId); Integer seleGobalMapIconInfoSjdc(Date beginTime, Date endTime, Integer departId);
List<EchartsVo> getGobalRecentlyTrendByMonth(String year);
// endregion // endregion
// region 现场督察大屏 // region 现场督察大屏
/** @Select("SELECT count(DISTINCT(ng.id)) as proTotal, " +
* 获取现场督察按二级机构分组和整改状态划分的的问题数 "count(DISTINCT IF(ng.isRectifyCode = 1, ng.id, null) ) as changed, " +
*/ "count(DISTINCT IF(ng.isRectifyCode = 0, ng.id, null) ) as changing, " +
@Select("SELECT COUNT(*) FROM negative n " + "ROUND((COUNT(DISTINCT IF(ng.isRectifyCode = 1, ng.id, null))) / COUNT(DISTINCT ng.id) * 100, 1) AS correctionRate " +
"INNER JOIN ( " + "FROM sup_depart sd " +
" SELECT DISTINCT sd.id " + "INNER JOIN sup_depart sd1 on sd.pid=sd1.id AND sd1.statistics_group_id=#{groupId} " +
" FROM sup_depart sd " + "INNER JOIN negative ng ON sd.id=ng.involveDepartId " +
" INNER JOIN sup_depart sd1 ON sd.pid = sd1.id " + "WHERE ng.problemSourcesCode=13 AND ng.checkStatus<>3 " +
" WHERE sd1.statistics_group_id = #{groupType}" + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
") AS filtered_sd ON n.involveDepartId = filtered_sd.id " + DayTimeSuperviseVo getSuperversionRank(Date beginTime, Date endTime, Integer groupId);
"WHERE n.checkStatus = 1 " +
"AND n.problemSourcesCode = 13 " + @Select("SELECT sd1.short_name as label, " +
"AND n.isRectifyCode=#{isRectify} " + "sd1.id AS departId, " +
"AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime}") "count( DISTINCT ng.id) AS denominator, " +
Long getChangCountByGroupType(Integer groupType, Date beginTime, Date endTime, Integer isRectify); "count( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL )) AS numerator, " +
"ROUND( COUNT(DISTINCT if(ng.isRectifyCode=1, ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS rate, " +
"ROUND( COUNT(DISTINCT if(ng.isRectifyCode=1, ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS value " +
"FROM sup_depart sd " +
"INNER JOIN sup_depart sd1 on sd.pid=sd1.id AND sd1.statistics_group_id=#{groupId} " +
"INNER JOIN negative ng on ng.involveDepartId=sd.id " +
"LEFT JOIN negative_blame nb on ng.id=nb.negativeId " +
"WHERE ng.problemSourcesCode=13 " +
"AND ng.checkStatus<>3 " +
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY label " +
"order by 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 " + @Select("SELECT npr.oneLevelContent as name, count(*) value FROM negative ng, negative_problem_relation npr " +
"WHERE ng.id = npr.negativeId " + "WHERE ng.id = npr.negativeId " +
@ -136,66 +135,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + "AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " +
"AND oneLevelContent is NOT NULL " + "AND oneLevelContent is NOT NULL " +
"GROUP BY oneLevelContent ") "GROUP BY oneLevelContent ")
List<EchartsVo> getProblemTypes(Date beginTime, Date endTime); List<EchartsVo> getProblemTypeRatio(Date beginTime, Date endTime);
List<EchartsVo> getSupervisionTrend(String time);
@Select("SELECT a.departId, a.name, COUNT(DISTINCT c.id) AS totalPro, COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS changing, COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS changed, COUNT(DISTINCT c.involveDepartId) AS relationOrg, COUNT(DISTINCT d.blameIdCode) AS personNum, ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS changedRate\n" +
"FROM statistics_depart a INNER JOIN sup_depart b ON a.departId = b.pid " +
" INNER JOIN negative c ON b.id = c.involveDepartId " +
" LEFT JOIN negative_blame d ON c.id = d.negativeId " +
"WHERE a.groupId = 3 AND discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND problemSourcesCode IN (13, 15) " +
"GROUP BY a.name, a.departId")
List<SuperviseMapIconVo> getMap(Date beginTime, Date endTime);
/**
* 黄赌毒总览
* @param beginTime
* @param endTime
* @return
*/
@Select("SELECT a.name , " +
"COUNT(DISTINCT c.id) AS problem_number, " +
"COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS rectifing_number, " +
"COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS rectifed_number, " +
"COUNT(DISTINCT c.involveDepartId) AS depart_number, " +
"COUNT(DISTINCT d.blameIdCode) AS person_number, " +
"ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS rectify_rate " +
"FROM statistics_depart a INNER JOIN sup_depart b ON a.departId = b.pid " +
"INNER JOIN negative c ON b.id = c.involveDepartId " +
"LEFT JOIN negative_blame d ON c.id = d.negativeId " +
"WHERE a.groupId = 3 AND discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND special_supervision = 1 " +
"GROUP BY a.name " +
"order by problem_number desc")
List<RankVoSupTwo> getYellowBet(Date beginTime, Date endTime);
@Select("SELECT COUNT(DISTINCT c.id) AS problem_number, COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS rectifing_number, COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS rectifed_number, COUNT(DISTINCT c.involveDepartId) AS depart_number, COUNT(DISTINCT d.blameIdCode) AS person_number, ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS rectify_rate " +
"FROM sup_depart b INNER JOIN negative c ON b.id = c.involveDepartId " +
" LEFT JOIN negative_blame d ON c.id = d.negativeId " +
"WHERE discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND problemSourcesCode = 13 ")
RankVoSup getSuperversionRank(Date beginTime, Date endTime);
@Select("SELECT a.name, " +
"COUNT(DISTINCT c.id) AS problem_number, " +
"COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS rectifing_number, " +
"COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS rectifed_number, " +
"COUNT(DISTINCT c.involveDepartId) AS depart_number, " +
"COUNT(DISTINCT d.blameIdCode) AS person_number, " +
"ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS rectify_rate " +
"FROM statistics_depart a INNER JOIN sup_depart b ON a.departId = b.pid " +
" INNER JOIN negative c ON b.id = c.involveDepartId " +
" LEFT JOIN negative_blame d ON c.id = d.negativeId " +
"WHERE a.groupId = 3 AND discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND problemSourcesCode = 13 " +
"GROUP BY a.name " +
"order by rectify_rate desc")
List<RankVoSupTwo> getChangedRateRank(Date beginTime, Date endTime);
@Select("SELECT COUNT(DISTINCT c.id) AS problem_number, " + @Select("SELECT COUNT(DISTINCT c.id) AS problem_number, " +
"COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS rectifing_number, " + "COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS rectifing_number, " +
@ -207,14 +147,41 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"WHERE discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND problemSourcesCode IN (13, 15)") "WHERE discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND problemSourcesCode IN (13, 15)")
RankVoSupTwo getTemp(Date beginTime, Date endTime); RankVoSupTwo getTemp(Date beginTime, Date endTime);
@Select("SELECT a.departId, a.name, COUNT(DISTINCT c.id) AS totalPro, COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS changing, COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS changed, COUNT(DISTINCT c.involveDepartId) AS relationOrg, COUNT(DISTINCT d.blameIdCode) AS personNum, ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS changedRate\n" +
@Select("SELECT COUNT(DISTINCT c.id) AS problem_number, COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS rectifing_number, COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS rectifed_number, COUNT(DISTINCT c.involveDepartId) AS depart_number, COUNT(DISTINCT d.blameIdCode) AS person_number, ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS rectify_rate\n" + "FROM statistics_depart a INNER JOIN sup_depart b ON a.departId = b.pid " +
"FROM sup_depart b INNER JOIN negative c ON b.id = c.involveDepartId " + " INNER JOIN negative c ON b.id = c.involveDepartId " +
" LEFT JOIN negative_blame d ON c.id = d.negativeId " + " LEFT JOIN negative_blame d ON c.id = d.negativeId " +
"WHERE discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND special_supervision = 1 ") "WHERE a.groupId = 3 AND discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND problemSourcesCode IN (13, 15) " +
RankVoSup getYellowBetOverview(Date beginTime, Date endTime); "GROUP BY a.name, a.departId")
List<SuperviseMapIconVo> getMap(Date beginTime, Date endTime);
List<EchartsVo> getGobalRecentlyTrendByMonth(String year); List<EchartsVo> getSupervisionTrend(String time);
@Select("SELECT count(DISTINCT(ng.id)) as proTotal, " +
"count(DISTINCT IF(ng.isRectifyCode = 1, ng.id, null) ) as changed," +
"count(DISTINCT IF(ng.isRectifyCode = 0, ng.id, null) ) as changing," +
"ROUND(COALESCE(COUNT(DISTINCT IF(ng.isRectifyCode = 1, ng.id, NULL)) / NULLIF(COUNT(DISTINCT ng.id), 0), 0) * 100, 1) AS correctionRate " +
"FROM sup_depart sd " +
"INNER JOIN sup_depart sd1 ON sd.pid=sd1.id AND sd1.statistics_group_id=#{groupId} " +
"INNER JOIN negative ng on sd.id=ng.involveDepartId " +
"WHERE ng.checkStatus<>3 " +
"AND ng.problemSourcesCode=15 " +
"AND special_supervision = #{queryType} " +
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
DayTimeSuperviseVo getYellowBetOverview(Date beginTime, Date endTime, Integer groupId, Integer queryType);
@Select("SELECT sd1.short_name as label, " +
"count( DISTINCT ng.id) AS value " +
"FROM sup_depart sd " +
"INNER JOIN sup_depart sd1 on sd.pid=sd1.id AND sd1.statistics_group_id=#{groupId} " +
"INNER JOIN negative ng on sd.id= ng.involveDepartId " +
"WHERE ng.checkStatus<>3 " +
"AND ng.problemSourcesCode=15 " +
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " +
"AND special_supervision = #{queryType} " +
"GROUP BY label " +
"order by value desc")
List<OrganizeProblemRankVo> getYellowBetRankList(Date beginTime, Date endTime, Integer groupId, Integer queryType);
// endregion // endregion

21
src/main/java/com/biutag/supervision/pojo/vo/DayTimeSuperviseVo.java

@ -0,0 +1,21 @@
package com.biutag.supervision.pojo.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Auther: sh
* @Date: 2024/11/28 10:32
* @Description: 日常督察情况总览 也可用于 专项督察情况总览
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DayTimeSuperviseVo {
private Integer proTotal;
private Integer changed;
private Integer changing;
private Double correctionRate;
}

2
src/main/java/com/biutag/supervision/pojo/vo/OrganizeProblemRankVo.java

@ -5,7 +5,7 @@ import lombok.Data;
/** /**
* @Auther: sh * @Auther: sh
* @Date: 2024/11/8 11:17 * @Date: 2024/11/8 11:17
* @Description: 首页大屏机构问题排名VO * @Description: 机构问题排名VO
*/ */
@Data @Data
public class OrganizeProblemRankVo { public class OrganizeProblemRankVo {

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

@ -12,9 +12,9 @@ public class RankVo {
private String label; // 部门名称 private String label; // 部门名称
private String departId; // 部门id private String departId; // 部门id
private String value; // 整改率
private String rate; // 整改率
private String numerator; // 分子 已整改 private String numerator; // 分子 已整改
private String denominator; // 分母 问题数 private String denominator; // 分母 问题数
private String rate; // 整改率
private String value; // 整改率
} }

147
src/main/java/com/biutag/supervision/service/DataGobalService.java

@ -32,13 +32,27 @@ public class DataGobalService {
private final NegativeProblemRelationMapper negativeProblemRelationMapper; private final NegativeProblemRelationMapper negativeProblemRelationMapper;
private final SupDepartMapper supDepartMapper; private final SupDepartMapper supDepartMapper;
/**
* 获取所有大屏统计数据 //region 左边
*
* @param beginTime 开始时间 // 机构问题排名
* @param endTime 结束时间 public List<OrganizeProblemRankVo> getOrganizeProblemRank(Integer groupType, Date beginTime, Date endTime) {
* @return 返回所有大屏统计数据 List<OrganizeProblemRankVo> res = negativeMapper.selectOrganizeProblemRank(groupType, beginTime, endTime);
*/ return res;
}
// 业务类型占比
public List<EchartsVo> getBusinessRate(Date beginTime, Date endTime) {
List<EchartsVo> res = negativeMapper.selectBusinessRate(beginTime, endTime);
return res;
}
//endregion
//region 中间
// 获取首页大屏中央统计数据
public JSONObject getAllGobalCount(Date beginTime, Date endTime) { public JSONObject getAllGobalCount(Date beginTime, Date endTime) {
// 督察问题数量(查实版本) // 督察问题数量(查实版本)
@ -77,74 +91,13 @@ public class DataGobalService {
return overview; return overview;
} }
// 数据大屏问题趋势统计(按月展示)
/**
* 查询核查属实的公共方法
*
* @param checkStatus 检查状态
* @param startTime 开始时间
* @param endTime 结束时间
* @param problemSourcesCodes 问题来源代码数组
* @return 满足条件的记录数
*/
public Long getCountByConditions(Integer checkStatus, Date startTime, Date endTime, Integer... problemSourcesCodes) {
QueryWrapper<Negative> queryWrapper = new QueryWrapper<>();
queryWrapper.ne("checkStatus", checkStatus)
.between("discoveryTime", startTime, endTime)
.and(wrapper -> {
for (int i = 0; i < problemSourcesCodes.length; i++) {
if (i == 0) {
wrapper.eq("problemSourcesCode", problemSourcesCodes[i]);
} else {
wrapper.or().eq("problemSourcesCode", problemSourcesCodes[i]);
}
}
});
return negativeMapper.selectCount(queryWrapper);
}
public List<OrganizeProblemRankVo> getOrganizeProblemRank(Integer groupType, Date beginTime, Date endTime) {
List<OrganizeProblemRankVo> res = negativeMapper.selectOrganizeProblemRank(groupType, beginTime, endTime);
return res;
}
public List<EchartsVo> getBusinessRate(Date beginTime, Date endTime) {
List<EchartsVo> res = negativeMapper.selectBusinessRate(beginTime, endTime);
return res;
}
public List<EchartsVo> getGobalRecentlyTrendByMonth(String year) { public List<EchartsVo> getGobalRecentlyTrendByMonth(String year) {
List<EchartsVo> res = negativeMapper.getGobalRecentlyTrendByMonth(year); List<EchartsVo> res = negativeMapper.getGobalRecentlyTrendByMonth(year);
return res; return res;
} }
/** // 地图数据
* 获取问题类型占比
*
* @param beginTime
* @param endTime
* @return
*/
public List<EchartsVo> getProblemRate(Date beginTime, Date endTime) {
List<EchartsVo> res = negativeProblemRelationMapper.selectProblemRate(beginTime, endTime);
return res;
}
/**
* 获取突出问题排名
* @return
*/
public List<StrongProblemRank> getStrongProblemRank(Date beginTime, Date endTime) {
// 1.获取这段时间的negative id
List<StrongProblemRank> res = negativeProblemRelationMapper.selectStrongProblemRank(beginTime, endTime);
for (int i = 1; i <= res.size(); i++) {
res.get(i - 1).setSort(i);
}
return res;
}
public List<GobalMapIconVo> getMapIconInfo(Date beginTime, Date endTime) { public List<GobalMapIconVo> getMapIconInfo(Date beginTime, Date endTime) {
List<GobalMapIconVo> res = new ArrayList<>(); List<GobalMapIconVo> res = new ArrayList<>();
List<SupDepart> supDeparts = supDepartMapper.selectDepartsByGroupType(3); List<SupDepart> supDeparts = supDepartMapper.selectDepartsByGroupType(3);
@ -171,4 +124,58 @@ public class DataGobalService {
} }
return res; return res;
} }
//endregion
//region 右边
// 获取突出问题排名
public List<StrongProblemRank> getStrongProblemRank(Date beginTime, Date endTime) {
// 1.获取这段时间的negative id
List<StrongProblemRank> res = negativeProblemRelationMapper.selectStrongProblemRank(beginTime, endTime);
for (int i = 1; i <= res.size(); i++) {
res.get(i - 1).setSort(i);
}
return res;
}
// 获取问题类型占比
public List<EchartsVo> getProblemRate(Date beginTime, Date endTime) {
List<EchartsVo> res = negativeProblemRelationMapper.selectProblemRate(beginTime, endTime);
return res;
}
//endregion
/**
* 查询核查属实的公共方法
*
* @param checkStatus 检查状态
* @param startTime 开始时间
* @param endTime 结束时间
* @param problemSourcesCodes 问题来源代码数组
* @return 满足条件的记录数
*/
public Long getCountByConditions(Integer checkStatus, Date startTime, Date endTime, Integer... problemSourcesCodes) {
QueryWrapper<Negative> queryWrapper = new QueryWrapper<>();
queryWrapper.ne("checkStatus", checkStatus)
.between("discoveryTime", startTime, endTime)
.and(wrapper -> {
for (int i = 0; i < problemSourcesCodes.length; i++) {
if (i == 0) {
wrapper.eq("problemSourcesCode", problemSourcesCodes[i]);
} else {
wrapper.or().eq("problemSourcesCode", problemSourcesCodes[i]);
}
}
});
return negativeMapper.selectCount(queryWrapper);
}
} }

151
src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java

@ -22,10 +22,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.Intercept; import org.apache.poi.ss.formula.functions.Intercept;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.IllegalFormatCodePointException;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -40,16 +37,38 @@ import java.util.stream.Collectors;
public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisionNotifyMapper, DataSupervisionNotify> { public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisionNotifyMapper, DataSupervisionNotify> {
private final NegativeMapper negativeMapper; private final NegativeMapper negativeMapper;
private final NegativeBlameMapper negativeBlameMapper;
private final SupDepartMapper supDepartMapper; // region 左边
// 获取日常督察情况总览
public DayTimeSuperviseVo getSuperversionRank(Date beginTime, Date endTime, Integer groupId) {
DayTimeSuperviseVo res = negativeMapper.getSuperversionRank(beginTime, endTime, groupId);
if (res == null) {
return new DayTimeSuperviseVo(0, 0, 0, 0.0);
}
return res;
}
// 获取日常督察整改率排名
public List<RankVo> getChangedRateRank(Integer groupType, Date beginTime, Date endTime) {
// Optional.ofNullable(rankVoRes).orElse(new ArrayList<>());
List<RankVo> rankVoRes = negativeMapper.getChangedRateRank(beginTime, endTime, groupType);
return rankVoRes;
}
//问题类型占比
public List<EchartsVo> getProblemTypeRatio(Date beginTime, Date endTime) {
List<EchartsVo> echartsVos = negativeMapper.getProblemTypeRatio(beginTime, endTime);
return echartsVos;
}
// endregion
// region 中间
/** /**
* 获取所有 现场督察+专项督察 的数量 * 获取所有 现场督察+专项督察 的数量
* 现场督察代码 13 专项督察代码: 15 * 现场督察代码 13 专项督察代码: 15
*
* @param beginTime
* @param endTime
* @return
*/ */
public JSONObject getAllSupervisionNotifyCount(Date beginTime, Date endTime) { public JSONObject getAllSupervisionNotifyCount(Date beginTime, Date endTime) {
@ -86,115 +105,41 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
} }
/** // 获取现场督察问题趋势
* 获取日常督察数量概览
*
* @param groupType
* @param beginTime
* @param endTime
* @return
*/
public JSONObject getDailySupervisionCount(Integer groupType, Date beginTime, Date endTime) {
Long changing = negativeMapper.getChangCountByGroupType(groupType, beginTime, endTime, 0);
Long changed = negativeMapper.getChangCountByGroupType(groupType, beginTime, endTime, 1);
Long proTotal = changed + changing;
// 整改率
double correctionRate = proTotal != 0 ? (changed * 1.0 / proTotal) * 100 : 0;
JSONObject res = new JSONObject()
.fluentPut("proTotal", proTotal)
.fluentPut("changing", changing)
.fluentPut("changed", changed)
.fluentPut("correctionRate", correctionRate);
return res;
}
/**
* 获取日常督察整改率排名
*
* @param groupType
* @param beginTime
* @param endTime
* @return
*/
public List<RankVo> getChangedRateRank(Integer groupType, Date beginTime, Date endTime) {
List<RankVoSupTwo> rankVoRes = negativeMapper.getChangedRateRank(beginTime, endTime);
List<RankVo> res = new ArrayList<>();
for (RankVoSupTwo one : rankVoRes) {
RankVo rankVo = new RankVo();
rankVo.setLabel(one.getName());
rankVo.setValue(one.getRectifyRate());
rankVo.setRate(one.getRectifyRate());
rankVo.setNumerator(one.getRectifedNumber());
rankVo.setDenominator(one.getProblemNumber());
res.add(rankVo);
}
return res;
}
public List<EchartsVo> getProblemTypeRatio(Date beginTime, Date endTime) {
List<EchartsVo> echartsVos = negativeMapper.getProblemTypes(beginTime, endTime);
return echartsVos;
}
public List<EchartsVo> getSupervisionTrend(String year) { public List<EchartsVo> getSupervisionTrend(String year) {
List<EchartsVo> echartsVos = negativeMapper.getSupervisionTrend(year); List<EchartsVo> echartsVos = negativeMapper.getSupervisionTrend(year);
return echartsVos; return echartsVos;
} }
/**
* 包括现场督察和专项 // 地图数据
*
* @param beginTime
* @param endTime
* @return
*/
public List<SuperviseMapIconVo> getsupervisionMapIconInfo(Date beginTime, Date endTime) { public List<SuperviseMapIconVo> getsupervisionMapIconInfo(Date beginTime, Date endTime) {
List<SuperviseMapIconVo> res = negativeMapper.getMap(beginTime, endTime); List<SuperviseMapIconVo> res = negativeMapper.getMap(beginTime, endTime);
return res; return res;
} }
public List<RankVo> getYellowBet(Date beginTime, Date endTime) { // endregion
List<RankVoSupTwo> res = negativeMapper.getYellowBet(beginTime, endTime);
List<RankVo> resv = new ArrayList<>();
if (res == null) {
return resv;
}
for (RankVoSupTwo re : res) {
log.info("名字===========" + re.getName() + "驼峰===============" + re.getProblemNumber() + "非驼峰" + re.getProblemNumber());
RankVo rankVo = new RankVo();
rankVo.setLabel(re.getName());
rankVo.setValue(re.getProblemNumber());
resv.add(rankVo);
}
return resv;
}
// region 右边
public RankVoSup getSuperversionRank(Date beginTime, Date endTime) { // 黄赌毒总览 但是这个查询可以公用
RankVoSup res = negativeMapper.getSuperversionRank(beginTime, endTime); public DayTimeSuperviseVo getYellowBetOverview(Date beginTime, Date endTime, Integer groupId, Integer queryType) {
if (res == null) { DayTimeSuperviseVo res = negativeMapper.getYellowBetOverview(beginTime, endTime, groupId, queryType);
return new RankVoSup("0", "0", "0", "0", "0", "0");
}
return res; return res;
} }
public JSONObject getYellowBetOverview(Date beginTime, Date endTime) { // 黄赌毒排行 但是这个查询可以公用
RankVoSup res = negativeMapper.getYellowBetOverview(beginTime, endTime); public List<OrganizeProblemRankVo> getYellowBetRankList(Date beginTime, Date endTime, Integer groupId, Integer queryType) {
if (res != null) { List<OrganizeProblemRankVo> res = negativeMapper.getYellowBetRankList(beginTime, endTime, groupId, queryType);
return new JSONObject() return res;
.fluentPut("proTotal", res.getProblemNumber())
.fluentPut("changing", res.getRectifingNumber())
.fluentPut("changed", res.getRectifedNumber())
.fluentPut("correctionRate", res.getRectifyRate());
}else {
return new JSONObject()
.fluentPut("problemNumber", "0")
.fluentPut("changing", "0")
.fluentPut("changed", "0")
.fluentPut("correctionRate", "0");
}
} }
// endregion
} }

Loading…
Cancel
Save