From 2f1a20ec277e39be52c7139197c50d860238d13d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=8D=E7=88=B1=E5=AD=A6=E4=B9=A0=E7=9A=84=E7=9F=B3?=
=?UTF-8?q?=E5=90=8C=E5=AD=A6?= <2936013465@qq.com>
Date: Fri, 13 Dec 2024 17:59:48 +0800
Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E5=8A=A0=E7=BC=93=E5=AD=98?=
=?UTF-8?q?=E3=80=81=E4=BA=8C=E7=BA=A7=E5=AD=90=E5=B1=8F=E5=B9=95=E6=A1=88?=
=?UTF-8?q?=E4=BB=B6=E6=A0=B8=E6=9F=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 20 +-
.../supervision/SupervisionApplication.java | 2 +
.../supervision/config/RedisCacheConfig.java | 31 +++
.../supervision/config/SwaggerConfig.java | 2 -
...troller.java => DataGlobalController.java} | 95 +++++--
.../datav/DataMailViewController.java | 29 +-
.../datav/DataVCaseVerifController.java | 56 +++-
.../controller/datav/SubOneController.java | 75 +++++-
.../datav/SupervisionNotifyController.java | 49 +++-
.../datav/VideoSuperviseController.java | 27 +-
.../supervision/mapper/NegativeMapper.java | 30 ++-
.../com/biutag/supervision/pojo/Result.java | 4 +-
.../pojo/vo/CaseVerificationMapVo.java | 4 +-
...balMapIconVo.java => GlobalMapIconVo.java} | 4 +-
.../biutag/supervision/pojo/vo/RankVo.java | 12 +-
.../supervision/pojo/vo/SubOneOverViewVo.java | 26 ++
.../pojo/vo/SuperviseMapIconVo.java | 4 +-
.../pojo/vo/VideoSuperviseMapIconVo.java | 4 +-
.../service/CaseVerificationService.java | 4 +-
.../service/CountyStreetDeptService.java | 3 +
...balService.java => DataGlobalService.java} | 29 +-
.../DataSupervisionNotifyServiceImpl.java | 6 +-
.../supervision/service/SubOneService.java | 43 +++
.../service/VideoSuperviseService.java | 4 +-
src/main/resources/application.yml | 3 +-
src/main/resources/mapper/NegativeMapper.xml | 251 +++++++++---------
.../datav/SubOneControllerTest.java | 16 ++
27 files changed, 606 insertions(+), 227 deletions(-)
create mode 100644 src/main/java/com/biutag/supervision/config/RedisCacheConfig.java
rename src/main/java/com/biutag/supervision/controller/datav/{DataGobalController.java => DataGlobalController.java} (58%)
rename src/main/java/com/biutag/supervision/pojo/vo/{GobalMapIconVo.java => GlobalMapIconVo.java} (89%)
create mode 100644 src/main/java/com/biutag/supervision/pojo/vo/SubOneOverViewVo.java
rename src/main/java/com/biutag/supervision/service/{DataGobalService.java => DataGlobalService.java} (83%)
create mode 100644 src/main/java/com/biutag/supervision/service/SubOneService.java
diff --git a/pom.xml b/pom.xml
index a691dd3..f17d01f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,6 +31,7 @@
+
com.google.code.gson
gson
@@ -87,12 +88,13 @@
spring-boot-starter-data-redis-reactive
-
- org.springframework.boot
- spring-boot-devtools
- runtime
- true
-
+
+
+
+
+
+
+
com.mysql
mysql-connector-j
@@ -212,6 +214,10 @@
aspose-words
15.8.0
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
@@ -220,7 +226,7 @@
src/main/resources
false
-
+
src/main/resources
diff --git a/src/main/java/com/biutag/supervision/SupervisionApplication.java b/src/main/java/com/biutag/supervision/SupervisionApplication.java
index b4a1987..359aea6 100644
--- a/src/main/java/com/biutag/supervision/SupervisionApplication.java
+++ b/src/main/java/com/biutag/supervision/SupervisionApplication.java
@@ -2,11 +2,13 @@ package com.biutag.supervision;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
@EnableAsync
+@EnableCaching
@EnableScheduling
@SpringBootApplication
@EnableAspectJAutoProxy
diff --git a/src/main/java/com/biutag/supervision/config/RedisCacheConfig.java b/src/main/java/com/biutag/supervision/config/RedisCacheConfig.java
new file mode 100644
index 0000000..e90ae21
--- /dev/null
+++ b/src/main/java/com/biutag/supervision/config/RedisCacheConfig.java
@@ -0,0 +1,31 @@
+package com.biutag.supervision.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.cache.RedisCacheConfiguration;
+import org.springframework.data.redis.cache.RedisCacheManager;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+
+import java.time.Duration;
+
+/**
+ * @Auther: sh
+ * @Date: 2024/12/13 11:03
+ * @Description: 针对首页大屏的缓存
+ */
+@Configuration
+public class RedisCacheConfig {
+
+ @Bean
+ public RedisCacheManager cacheManager(RedisConnectionFactory redisConnectionFactory) {
+ // 配置统一的缓存过期时间
+ RedisCacheConfiguration cacheConfiguration = RedisCacheConfiguration.defaultCacheConfig()
+ .entryTtl(Duration.ofHours(4)); //
+
+ // 创建一个缓存管理器,使用默认配置,并为所有缓存设置统一的过期时间
+ RedisCacheManager res = RedisCacheManager.builder(redisConnectionFactory)
+ .cacheDefaults(cacheConfiguration) // 设置所有缓存的默认过期时间
+ .build();
+ return res;
+ }
+}
diff --git a/src/main/java/com/biutag/supervision/config/SwaggerConfig.java b/src/main/java/com/biutag/supervision/config/SwaggerConfig.java
index 356c611..a10a27a 100644
--- a/src/main/java/com/biutag/supervision/config/SwaggerConfig.java
+++ b/src/main/java/com/biutag/supervision/config/SwaggerConfig.java
@@ -5,10 +5,8 @@ import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
-import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
@Configuration
public class SwaggerConfig {
diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java b/src/main/java/com/biutag/supervision/controller/datav/DataGlobalController.java
similarity index 58%
rename from src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java
rename to src/main/java/com/biutag/supervision/controller/datav/DataGlobalController.java
index 06f2987..666b46a 100644
--- a/src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java
+++ b/src/main/java/com/biutag/supervision/controller/datav/DataGlobalController.java
@@ -4,13 +4,14 @@ 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.GobalMapIconVo;
+import com.biutag.supervision.pojo.vo.GlobalMapIconVo;
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.DataGlobalService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -32,22 +33,27 @@ import java.util.Optional;
@Tag(name = "数据大屏首页", description = "数据大屏首页")
@RestController
@RequiredArgsConstructor
-@RequestMapping("datav/dataGobalScreen")
-public class DataGobalController {
+@RequestMapping("datav/dataGlobalScreen")
+public class DataGlobalController {
- private final DataGobalService dataGobalService;
+ private final DataGlobalService dataGlobalService;
//region 左边
- // 机构问题排名
+
+ /**
+ * 机构问题排名
+ * @param beginTime 开始时间
+ * @param endTime 结束时间
+ * @return Result
+ */
@Operation(summary = "机构问题排名")
@GetMapping("/getOrganizationRank")
public Result getOrganizationRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 机构问题排名 fxsjlist中必有所有机构,不会为空
- List fxsjlist = dataGobalService.getOrganizeProblemRank(3, beginTime, endTime);
- List jsdwlist = dataGobalService.getOrganizeProblemRank(4, beginTime, endTime);
-
+ List fxsjlist = dataGlobalService.getOrganizeProblemRank(3, beginTime, endTime);
+ List jsdwlist = dataGlobalService.getOrganizeProblemRank(4, beginTime, endTime);
JSONObject res = new JSONObject()
.fluentPut("fxsjlist", fxsjlist)
.fluentPut("jsdwlist", jsdwlist);
@@ -55,13 +61,18 @@ public class DataGobalController {
}
- // 业务类型占比
+ /**
+ * 业务类型占比
+ * @param beginTime 开始时间
+ * @param endTime 结束时间
+ * @return Result
+ */
@Operation(summary = "业务类型占比")
@GetMapping("/getBusinessRate")
public Result getBusinessRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 业务类型占比
- List ywzblist = dataGobalService.getBusinessRate(beginTime, endTime);
+ List ywzblist = dataGlobalService.getBusinessRate(beginTime, endTime);
JSONObject res = new JSONObject().fluentPut("ywzblist", ywzblist);
return Result.success(res);
}
@@ -69,63 +80,89 @@ public class DataGobalController {
//region 中间
- // 获取首页大屏中央数据
+
+ /**
+ * 获取首页大屏中央数据
+ * @param beginTime 开始时间
+ * @param endTime 结束时间
+ * @return Result
+ */
@Operation(summary = "大屏中央数据")
@GetMapping
- public Result getAllGobalCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
+ public Result getAllGlobalCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 获取数据大屏中央总数概览
- JSONObject overview = dataGobalService.getAllGobalCount(beginTime, endTime);
+ JSONObject overview = dataGlobalService.getAllGlobalCount(beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("overview", overview);
return Result.success(data);
}
- // 地图数据
- @Operation(summary = "地图数据")
+ /**
+ * 地图数据
+ * @param beginTime 开始时间
+ * @param endTime 结束时间
+ * @return Result
+ */
+ @Operation(summary = "首页大屏地图数据")
@GetMapping("/getMap")
+ @Cacheable(cacheNames = "globalMap", key = "'p_'+ #endTime")
public Result getMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
-
+// System.out.println("Cache key: p_" + endTime);
// 地图数据
- List gobalTempMapVoList = Optional.ofNullable(dataGobalService.getMapIconInfo(beginTime, endTime)).
+ List GlobalTempMapVoList = Optional.ofNullable(dataGlobalService.getMapIconInfo(beginTime, endTime)).
orElseGet(ArrayList::new);
- JSONObject data = new JSONObject().fluentPut("gobalTempMapVoList", gobalTempMapVoList);
+ JSONObject data = new JSONObject().fluentPut("globalTempMapVoList", GlobalTempMapVoList);
return Result.success(data);
}
- // 数据大屏问题趋势统计(按月展示)
+ /**
+ * 数据大屏问题趋势统计
+ * @param year 年份
+ * @return Result
+ */
@Operation(summary = "数据大屏问题趋势统计")
- @GetMapping("/getGobalRecentlyTrendByMonth")
- public Result getGobalRecentlyTrendByMonth(@RequestParam Integer year) {
- List gobalRecentlyTrendList = dataGobalService.getGobalRecentlyTrendByMonth(String.valueOf(year));
- JSONObject jsonObject = new JSONObject().fluentPut("gobalRecentlyTrendList", gobalRecentlyTrendList);
+ @GetMapping("/getGlobalRecentlyTrendByMonth")
+ public Result getGlobalRecentlyTrendByMonth(@RequestParam Integer year) {
+ List GlobalRecentlyTrendList = dataGlobalService.getGlobalRecentlyTrendByMonth(String.valueOf(year));
+ JSONObject jsonObject = new JSONObject().fluentPut("globalRecentlyTrendList", GlobalRecentlyTrendList);
return Result.success(jsonObject);
}
//endregion
//region 右边
- // 突出问题排名
+
+ /**
+ * 突出问题排名
+ * @param beginTime 开始时间
+ * @param endTime 结束时间
+ * @return Result
+ */
@Operation(summary = "突出问题排名")
@GetMapping("/getStrongProblemRate")
public Result getStrongProblemRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 突出问题排名
- List tcwtlist = dataGobalService.getStrongProblemRank(beginTime, endTime);
+ List tcwtlist = dataGlobalService.getStrongProblemRank(beginTime, endTime);
JSONObject res = new JSONObject().fluentPut("tcwtlist", tcwtlist);
return Result.success(res);
}
- // 问题类型占比
+ /**
+ * 问题类型占比
+ * @param beginTime 开始时间
+ * @param endTime 结束时间
+ * @return Result
+ */
@Operation(summary = "问题类型占比")
@GetMapping("/getProblemBusinessRate")
public Result getProblemBusinessRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
-
// 问题类型占比
- List wtlxlist = dataGobalService.getProblemRate(beginTime, endTime);
+ List wtlxlist = dataGlobalService.getProblemRate(beginTime, endTime);
JSONObject res = new JSONObject().fluentPut("wtlxlist", wtlxlist);
return Result.success(res);
}
diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java b/src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java
index fc97a9e..39c0660 100644
--- a/src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java
+++ b/src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java
@@ -42,7 +42,13 @@ public class DataMailViewController {
private final DataPetitionComplaintMapper dataPetitionComplaintMapper;
// region 左边
- // 初访重访情况
+
+ /**
+ * 初访重访情况
+ * @param beginTime 开始时间
+ * @param endTime 结束时间
+ * @return Result
+ */
@Operation(summary = "初访重访情况")
@GetMapping("/getFirstAndRepeatMail")
public Result getFirstAndRepeatMail(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@@ -71,7 +77,13 @@ public class DataMailViewController {
// endregion
// region 中间
- // 信访数据中央总览统计
+
+ /**
+ * 信访数据中央总览统计
+ * @param beginTime 开始时间
+ * @param endTime 结束时间
+ * @return Result
+ */
@Operation(summary = "信访数据大屏中央数据统计")
@GetMapping("/getAllMailCount")
public Result getAllMailCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@@ -86,6 +98,11 @@ public class DataMailViewController {
}
+ /**
+ * 信访数据大屏信访趋势统计
+ * @param year 年份
+ * @return Result
+ */
@Operation(summary = "信访数据大屏信访趋势统计")
@GetMapping("/getMailTrend")
public Result getMailTrend(@RequestParam Integer year) {
@@ -102,7 +119,13 @@ public class DataMailViewController {
// endregion
// region 右边
- // 缠访集访情况
+
+ /**
+ * 缠访集访情况
+ * @param beginTime 开始时间
+ * @param endTime 结束时间
+ * @return Result
+ */
@Operation(summary = "缠访集访情况")
@GetMapping("/getEntanglementAndMassMail")
public Result getEntanglementAndMassMail(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java
index f41f039..08866ba 100644
--- a/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java
+++ b/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java
@@ -9,6 +9,7 @@ import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo;
import com.biutag.supervision.service.CaseVerificationService;
import lombok.RequiredArgsConstructor;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -18,6 +19,8 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.List;
+import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*;
+
/**
* @author wxc
* @date 2024/10/24
@@ -31,7 +34,13 @@ public class DataVCaseVerifController {
private final CaseVerificationService caseVerificationService;
// region 左边
- // 案件核查大屏分县市局排名
+
+ /**
+ * 案件核查大屏分县市局排名
+ * @param beginTime 开始时间
+ * @param endTime 结束时间
+ * @return Result
+ */
@GetMapping("/getCaseVerificationRank")
public Result getCaseVerificationRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@@ -43,7 +52,12 @@ public class DataVCaseVerifController {
return Result.success(data);
}
- // 案件问题性质
+ /**
+ * 案件问题性质
+ * @param beginTime 开始时间
+ * @param endTime 结束时间
+ * @return Result
+ */
@GetMapping("/getCaseProblemProperty")
public Result getCaseProblemProperty(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@@ -59,7 +73,12 @@ public class DataVCaseVerifController {
// region 中间
- // 案件核查大屏中央数据总览
+ /**
+ * 案件核查大屏中央数据总览
+ * @param beginTime 开始时间
+ * @param endTime 结束时间
+ * @return Result
+ */
@GetMapping("/getAllCaseVerificationCount")
public Result getAllCaseVerificationCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@@ -69,8 +88,14 @@ public class DataVCaseVerifController {
}
- // 案件核查大屏地图
+ /**
+ * 案件核查大屏地图
+ * @param beginTime 开始时间
+ * @param endTime 结束时间
+ * @return Result
+ */
@GetMapping("/getCaseVerificationMap")
+ @Cacheable(cacheNames = "CaseVerificationMap", key = "'p_'+ #endTime")
public Result getCaseVerificationMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
List caseVerificationMapList = caseVerificationService.getCaseVerificationMap(beginTime, endTime);
@@ -78,10 +103,14 @@ public class DataVCaseVerifController {
return Result.success(res);
}
- // 查处问题趋势
+ /**
+ * 查处问题趋势
+ * @param year 年份
+ * @return Result
+ */
@GetMapping("/getCaseVerificationTrend")
public Result getCaseVerificationTrend(@RequestParam Integer year) {
- List proTrendList = caseVerificationService.getCaseVerificationTrend(String.valueOf(year));
+ List proTrendList = caseVerificationService.getCaseVerificationTrend(String.valueOf(year), A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue());
JSONObject data = new JSONObject().fluentPut("proTrendList", proTrendList);
return Result.success(data);
}
@@ -89,7 +118,13 @@ public class DataVCaseVerifController {
// region 右边
- // 案件来源占比 和 问责处理情况
+
+ /**
+ * 案件来源占比 和 问责处理情况
+ * @param beginTime 开始时间
+ * @param endTime 结束时间
+ * @return Result
+ */
@GetMapping("/getCaseSourceRateAndDealSituation")
public Result getCaseSourceRateAndDealSituation(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@@ -102,7 +137,12 @@ public class DataVCaseVerifController {
}
- // 禁闭处理情况 和 停职处理情况
+ /**
+ * 禁闭处理情况 和 停职处理情况
+ * @param beginTime 开始时间
+ * @param endTime 结束时间
+ * @return Result
+ */
@GetMapping("/getConfinementAndPause")
public Result getConfinement(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
diff --git a/src/main/java/com/biutag/supervision/controller/datav/SubOneController.java b/src/main/java/com/biutag/supervision/controller/datav/SubOneController.java
index 785ef9f..ad9f8a8 100644
--- a/src/main/java/com/biutag/supervision/controller/datav/SubOneController.java
+++ b/src/main/java/com/biutag/supervision/controller/datav/SubOneController.java
@@ -3,10 +3,18 @@ package com.biutag.supervision.controller.datav;
import com.alibaba.fastjson.JSONObject;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.CountyStreetDept;
+import com.biutag.supervision.pojo.vo.EchartsVo;
+import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo;
+import com.biutag.supervision.pojo.vo.RankVo;
+import com.biutag.supervision.pojo.vo.SubOneOverViewVo;
import com.biutag.supervision.service.CountyStreetDeptService;
+import com.biutag.supervision.service.NegativeService;
+import com.biutag.supervision.service.SubOneService;
import com.google.gson.Gson;
+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;
@@ -15,6 +23,8 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.*;
+import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*;
+
/**
* @Auther: sh
* @Date: 2024/12/4 16:30
@@ -24,16 +34,50 @@ import java.util.*;
@RequestMapping("datav/sub1/")
@RequiredArgsConstructor
@RestController
+@Slf4j
public class SubOneController {
private final CountyStreetDeptService countyStreetDeptService;
+ private final SubOneService subOneService;
+
+// region 中间
+
+
+ /**
+ * 获取问题趋势
+ *
+ * @param departPId 2级单位的id
+ * @param year 年份
+ * @return EchartsVo的list
+ */
+ @Operation(summary = "获取一级子屏问题趋势")
+ @GetMapping("/getSubOneTrend")
+ public Result getSubOneTrend(@RequestParam Integer departPId, @RequestParam Integer year) {
+ List superviseProTrend = subOneService.getSubOneTrend(departPId, year, XCDC.getValue(), ZXDC.getValue(), SPDC.getValue()); // 督察问题趋势
+ List caseVerifyTrend = subOneService.getSubOneTrend(departPId, year, A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue());
+ List policeCommentTrend = new ArrayList<>();
+ List mailTrend = subOneService.getSubOneTrend(departPId, year, GJXFPT.getValue(), GABXF.getValue(), JZXX.getValue(), XF12337.getValue(), XF_QT.getValue());
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.fluentPut("superviseProTrend", superviseProTrend)
+ .fluentPut("caseVerifyTrend", caseVerifyTrend)
+ .fluentPut("policeCommentTrend", policeCommentTrend)
+ .fluentPut("mailTrend", mailTrend);
+ return Result.success(jsonObject);
+ }
+
+ /**
+ * 获取地图数据
+ * @param departPId 2级单位的id
+ * @return json格式的地图数据
+ */
+ @Operation(summary = "获取一级子屏地图JSON")
@GetMapping("/getSubOneStreetMap")
public Result getSubOneStreetMap(@RequestParam Integer departPId) {
List depts = countyStreetDeptService.getSubOneStreetMap(departPId);
Map geoJson = new HashMap<>();
geoJson.put("type", "FeatureCollection");
- geoJson.put("name", "4062");
+ geoJson.put("name", "临时名字");
List