Browse Source

2024/11/27 18:25 各个屏幕问题趋势显示,案件核查中央数据

main
parent
commit
9070716ece
  1. 90
      src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java
  2. 24
      src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java
  3. 48
      src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java
  4. 29
      src/main/java/com/biutag/supervision/mapper/DataCaseVerifMapper.java
  5. 13
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  6. 2
      src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java
  7. 26
      src/main/java/com/biutag/supervision/service/DataCaseVerifService.java
  8. 4
      src/main/java/com/biutag/supervision/service/DataGobalService.java
  9. 10
      src/main/resources/application-dev.yml

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

@ -18,6 +18,7 @@ import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.stream.Collectors;
@ -52,8 +53,6 @@ public class DataGobalController {
@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);
@ -66,49 +65,23 @@ public class DataGobalController {
* @param year
* @return
*/
@Operation(summary = "数据大屏问题趋势统计(按年展示)")
@Operation(summary = "数据大屏问题趋势统计")
@GetMapping("/getGobalRecentlyTrendByMonth")
public Result<JSONObject> getGobalRecentlyTrendByMonth(@RequestParam Integer year) {
List<RecentTrendByMonthVo> recentTrendVoList = dataGobalService.getGobalRecentlyTrendByMonth(String.valueOf(year));
ArrayList<String> monthList = new ArrayList<>();
ArrayList<String> totalList = new ArrayList<>();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
// 要展示到的月份 从那个月开始
YearMonth endMonth = YearMonth.of(year, new Date().getMonth());
YearMonth startMonth = YearMonth.of(year, 1);
for (RecentTrendByMonthVo recentTrendByMonthVo : recentTrendVoList) {
YearMonth trendMonth = YearMonth.parse(recentTrendByMonthVo.getMonthTime(), formatter);
while (startMonth.isBefore(trendMonth)) {
String res = startMonth.format(formatter);
monthList.add(res); // 添加到monthList
totalList.add("0"); // 插入没有数据的月份,总数为0
startMonth = startMonth.plusMonths(1);
}
String res = trendMonth.format(formatter);
monthList.add(res);
totalList.add(recentTrendByMonthVo.getTotal());
startMonth = trendMonth.plusMonths(1);
}
// 添加从最后一个有数据的月份到当前月份的缺失月份
while (!startMonth.isAfter(endMonth)) {
String res = startMonth.format(formatter);
monthList.add(res); // 添加到monthList
totalList.add("0"); // 插入没有数据的月份,总数为0
startMonth = startMonth.plusMonths(1);
}
// 截取月份
List<String> monthOnlyList = monthList.stream()
.map(date -> date.substring(date.indexOf('-') + 1) + "月")
.collect(Collectors.toList());
List<EchartsVo> gobalRecentlyTrendList = dataGobalService.getGobalRecentlyTrendByMonth(String.valueOf(year));
JSONObject jsonObject = new JSONObject()
.fluentPut("monthList", monthOnlyList)
.fluentPut("totalList", totalList);
.fluentPut("gobalRecentlyTrendList", gobalRecentlyTrendList);
return Result.success(jsonObject);
}
/**
* 机构问题排名
*
* @param beginTime
* @param endTime
* @return
*/
@Operation(summary = "机构问题排名")
@GetMapping("/getOrganizationRank")
public Result<JSONObject> getOrganizationRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@ -124,6 +97,13 @@ public class DataGobalController {
}
/**
* 业务类型占比
*
* @param beginTime
* @param endTime
* @return
*/
@Operation(summary = "业务类型占比")
@GetMapping("/getBusinessRate")
public Result<JSONObject> getBusinessRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@ -135,6 +115,13 @@ public class DataGobalController {
}
/**
* 突出问题排名
*
* @param beginTime
* @param endTime
* @return
*/
@Operation(summary = "突出问题排名")
@GetMapping("/getStrongProblemRate")
public Result<JSONObject> getStrongProblemRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@ -147,6 +134,13 @@ public class DataGobalController {
}
/**
* 问题类型占比
*
* @param beginTime
* @param endTime
* @return
*/
@Operation(summary = "问题类型占比")
@GetMapping("/getProblemBusinessRate")
public Result<JSONObject> getProblemBusinessRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@ -160,20 +154,26 @@ public class DataGobalController {
}
/**
* 地图数据
*
* @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) {
public Result<JSONObject> getMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 地图数据
List<GobalMapIconVo> gobalTempMapVoList = dataGobalService.getMapIconInfo(beginTime, endTime);
if (gobalTempMapVoList == null || gobalTempMapVoList.size() == 0) {
gobalTempMapVoList = new ArrayList<>();
}
List<GobalMapIconVo> gobalTempMapVoList = Optional.ofNullable(dataGobalService.getMapIconInfo(beginTime, endTime)).
orElseGet(ArrayList::new);
JSONObject data = new JSONObject()
.fluentPut("gobalTempMapVoList", gobalTempMapVoList);
return Result.success(data);
}

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

@ -77,6 +77,30 @@ public class DataVCaseVerifController {
}
@GetMapping("/getAllCaseVerifCount")
public Result<JSONObject> getAllCaseVerifCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 案件总数(起)
long total = dataCaseVerifService.count(new LambdaQueryWrapper<DataCaseVerif>().between(DataCaseVerif::getDiscoveryTime, beginTime, endTime));
Integer confirmed = dataCaseVerifService.getConfirmed(beginTime, endTime); // 查实案件数
Integer investigateAndPunish = dataCaseVerifService.getInvestigateAndPunish(beginTime, endTime); // 查处问题(个)
Integer accountablePeopleNumber = dataCaseVerifService.getAccountablePeopleNumber(beginTime, endTime); // 问责人次
Integer accountableDepartNumber = dataCaseVerifService.getAccountableDepartNumber(beginTime, endTime); // 问责单位数、
Double confirmedRate = confirmed.doubleValue() / total * 100; // 查实率
JSONObject overview = new JSONObject().fluentPut("confirmed", confirmed)
.fluentPut("investigateAndPunish", investigateAndPunish)
.fluentPut("accountablePeopleNumber", accountablePeopleNumber)
.fluentPut("accountableDepartNumber", accountableDepartNumber)
.fluentPut("confirmedRate", confirmedRate)
.fluentPut("total", total);
JSONObject res = new JSONObject().fluentPut("overview", overview);
return Result.success(res);
}
@GetMapping("/trend")
public Result<JSONObject> caseVerifTrend(
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,

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

@ -51,7 +51,6 @@ public class SupervisionNotifyController {
//地图数据
List<SuperviseMapIconVo> superviseTempMapVoList = dataSupervisionNotifyService.getsupervisionMapIconInfo(beginTime, endTime);
// 黄赌毒总览
JSONObject hddOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime);
@ -94,16 +93,57 @@ public class SupervisionNotifyController {
/**
* 获取督察问题趋势
* 获取现场督察问题趋势
*/
@GetMapping("/getSupervisionTrend")
public Result<JSONObject> getSupervisionTrend(@RequestParam String year) {
String temp = year + "-11-30";
List<EchartsVo> supervisionTrend = dataSupervisionNotifyService.getSupervisionTrend(temp);
List<EchartsVo> supervisionTrend = dataSupervisionNotifyService.getSupervisionTrend(year);
JSONObject data = new JSONObject().fluentPut("supervisionTrend", supervisionTrend);
return Result.success(data);
}
/**
* 地图数据
*/
@GetMapping("/getMap")
public Result<JSONObject> getMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
//地图数据
List<SuperviseMapIconVo> superviseTempMapVoList = dataSupervisionNotifyService.getsupervisionMapIconInfo(beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList);
return Result.success(data);
}
/**
* 问题类型占比
*
* @return
*/
@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);
}
/**
* 黄赌毒数据
*/
@GetMapping("/getYellowBetDrug")
public Result<JSONObject> getYellowBetDrug(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 黄赌毒总览
JSONObject hddOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime);
// 黄毒赌列表
List<RankVo> hddList = dataSupervisionNotifyService.getYellowBet(beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("hddOverview", hddOverview).fluentPut("hddList", hddList);
return Result.success(data);
}
}

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

@ -32,4 +32,33 @@ public interface DataCaseVerifMapper extends BaseMapper<DataCaseVerif> {
"GROUP BY name " +
"ORDER BY value asc;")
List<EchartsVo> selectTrend(Date beginTime, Date endTime, Integer months);
/**
* 查实案件数
* @param beginTime
* @param endTime
* @return
*/
@Select("SELECT count(*) total FROM negative ng " +
"WHERE ng.checkStatus<>3 " +
"AND ng.problemSourcesCode IN (17, 18, 19, 20) " +
"AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer getConfirmed(Date beginTime, Date endTime);
@Select("")
Integer getInvestigateAndPunish(Date beginTime, Date endTime);
@Select("SELECT count(DISTINCT( nb.blameName)) as total FROM negative ng " +
"LEFT JOIN negative_blame nb on ng.id = nb.negativeId " +
"WHERE ng.problemSourcesCode in(17, 18, 19, 20)" +
"and ng.checkStatus<>3 " +
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer getAccountablePeopleNumber(Date beginTime, Date endTime);
@Select("SELECT count(DISTINCT(involveDepartName)) as total FROM negative ng " +
"WHERE problemSourcesCode in(17, 18, 19, 20) " +
"and ng.checkStatus<>3 " +
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer getAccountableDepartNumber(Date beginTime, Date endTime);
}

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

@ -139,12 +139,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
List<EchartsVo> getProblemTypes(Date beginTime, Date endTime);
@Select("SELECT DATE_FORMAT(discoveryTime, '%m') AS `name`, COUNT(*) AS `value` FROM negative " +
"WHERE discoveryTime BETWEEN DATE_FORMAT(CONCAT(YEAR(#{time}), '-01-01'), '%Y-%m-%d') AND #{time} " +
" AND checkStatus <> 3 " +
" AND problemSourcesCode IN (13, 15) " +
"GROUP BY DATE_FORMAT(discoveryTime, '%Y-%m') " +
"ORDER BY DATE_FORMAT(discoveryTime, '%Y-%m'); ")
List<EchartsVo> getSupervisionTrend(String time);
@ -173,8 +168,8 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"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 " +
"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")
@ -219,6 +214,8 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"WHERE discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND special_supervision = 1 ")
RankVoSup getYellowBetOverview(Date beginTime, Date endTime);
List<EchartsVo> getGobalRecentlyTrendByMonth(String year);
// endregion
}

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

@ -14,8 +14,8 @@ public class SuperviseMapIconVo {
private String changing;
private String changed;
private String relationOrg;
private String changedRate;
private String personNum;
private String changedRate;
private String departId;
}

26
src/main/java/com/biutag/supervision/service/DataCaseVerifService.java

@ -17,6 +17,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
@RequiredArgsConstructor
@ -24,6 +25,7 @@ import java.util.List;
public class DataCaseVerifService extends ServiceImpl<DataCaseVerifMapper, DataCaseVerif> {
private final NegativeService negativeService;
private final DataCaseVerifMapper dataCaseVerifMapper;
public Page<DataCaseVerif> page(DataCaseVerifQueryParam queryParam) {
LambdaQueryWrapper<DataCaseVerif> queryWrapper = new LambdaQueryWrapper<>();
@ -101,4 +103,28 @@ public class DataCaseVerifService extends ServiceImpl<DataCaseVerifMapper, DataC
return true;
}
public Integer getConfirmed(Date beginTime, Date endTime) {
Integer res = dataCaseVerifMapper.getConfirmed(beginTime, endTime);
return res;
}
public Integer getInvestigateAndPunish(Date beginTime, Date endTime) {
// Integer res = dataCaseVerifMapper.getInvestigateAndPunish(beginTime, endTime);
return 0;
}
public Integer getAccountablePeopleNumber(Date beginTime, Date endTime) {
Integer res = dataCaseVerifMapper.getAccountablePeopleNumber(beginTime, endTime);
return res;
}
public Integer getAccountableDepartNumber(Date beginTime, Date endTime) {
Integer res = dataCaseVerifMapper.getAccountableDepartNumber(beginTime, endTime);
return res;
}
}

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

@ -113,8 +113,8 @@ public class DataGobalService {
return res;
}
public List<RecentTrendByMonthVo> getGobalRecentlyTrendByMonth(String year) {
List<RecentTrendByMonthVo> res = negativeMapper.selectRecentTrendByMonth(year);
public List<EchartsVo> getGobalRecentlyTrendByMonth(String year) {
List<EchartsVo> res = negativeMapper.getGobalRecentlyTrendByMonth(year);
return res;
}

10
src/main/resources/application-dev.yml

@ -26,11 +26,11 @@ spring:
url: jdbc:mysql://172.31.217.20:31868/negative?serverTimezone=GMT%2B8
username: root
password: ip12341234
test1:
url: jdbc:sqlserver://8.155.28.101:1433;databaseName=test1
username: SA
password: shihao&&200003
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
# test1:
# url: jdbc:sqlserver://8.155.28.101:1433;databaseName=test1
# username: SA
# password: shihao&&200003
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
druid:
min-evictable-idle-time-millis: 300000
test-on-borrow: false

Loading…
Cancel
Save