Browse Source

地图加缓存、二级子屏幕案件核查

main
parent
commit
2f1a20ec27
  1. 18
      pom.xml
  2. 2
      src/main/java/com/biutag/supervision/SupervisionApplication.java
  3. 31
      src/main/java/com/biutag/supervision/config/RedisCacheConfig.java
  4. 2
      src/main/java/com/biutag/supervision/config/SwaggerConfig.java
  5. 95
      src/main/java/com/biutag/supervision/controller/datav/DataGlobalController.java
  6. 29
      src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java
  7. 56
      src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java
  8. 75
      src/main/java/com/biutag/supervision/controller/datav/SubOneController.java
  9. 49
      src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java
  10. 27
      src/main/java/com/biutag/supervision/controller/datav/VideoSuperviseController.java
  11. 28
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  12. 4
      src/main/java/com/biutag/supervision/pojo/Result.java
  13. 4
      src/main/java/com/biutag/supervision/pojo/vo/CaseVerificationMapVo.java
  14. 4
      src/main/java/com/biutag/supervision/pojo/vo/GlobalMapIconVo.java
  15. 12
      src/main/java/com/biutag/supervision/pojo/vo/RankVo.java
  16. 26
      src/main/java/com/biutag/supervision/pojo/vo/SubOneOverViewVo.java
  17. 4
      src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java
  18. 4
      src/main/java/com/biutag/supervision/pojo/vo/VideoSuperviseMapIconVo.java
  19. 4
      src/main/java/com/biutag/supervision/service/CaseVerificationService.java
  20. 3
      src/main/java/com/biutag/supervision/service/CountyStreetDeptService.java
  21. 29
      src/main/java/com/biutag/supervision/service/DataGlobalService.java
  22. 6
      src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java
  23. 43
      src/main/java/com/biutag/supervision/service/SubOneService.java
  24. 4
      src/main/java/com/biutag/supervision/service/VideoSuperviseService.java
  25. 3
      src/main/resources/application.yml
  26. 239
      src/main/resources/mapper/NegativeMapper.xml
  27. 16
      src/test/java/com/biutag/supervision/controller/datav/SubOneControllerTest.java

18
pom.xml

@ -31,6 +31,7 @@
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.google.code.gson</groupId> <groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId> <artifactId>gson</artifactId>
@ -87,12 +88,13 @@
<artifactId>spring-boot-starter-data-redis-reactive</artifactId> <artifactId>spring-boot-starter-data-redis-reactive</artifactId>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>org.springframework.boot</groupId> <!-- <groupId>org.springframework.boot</groupId>-->
<artifactId>spring-boot-devtools</artifactId> <!-- <artifactId>spring-boot-devtools</artifactId>-->
<scope>runtime</scope> <!-- <scope>runtime</scope>-->
<optional>true</optional> <!-- <optional>true</optional>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>com.mysql</groupId> <groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId> <artifactId>mysql-connector-j</artifactId>
@ -212,6 +214,10 @@
<artifactId>aspose-words</artifactId> <artifactId>aspose-words</artifactId>
<version>15.8.0</version> <version>15.8.0</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies> </dependencies>

2
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.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
@EnableAsync @EnableAsync
@EnableCaching
@EnableScheduling @EnableScheduling
@SpringBootApplication @SpringBootApplication
@EnableAspectJAutoProxy @EnableAspectJAutoProxy

31
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;
}
}

2
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.Contact;
import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License; 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.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
@Configuration @Configuration
public class SwaggerConfig { public class SwaggerConfig {

95
src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java → 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.alibaba.fastjson.JSONObject;
import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.vo.EchartsVo; 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.OrganizeProblemRankVo;
import com.biutag.supervision.pojo.vo.StrongProblemRank; 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.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -32,22 +33,27 @@ import java.util.Optional;
@Tag(name = "数据大屏首页", description = "数据大屏首页") @Tag(name = "数据大屏首页", description = "数据大屏首页")
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("datav/dataGobalScreen") @RequestMapping("datav/dataGlobalScreen")
public class DataGobalController { public class DataGlobalController {
private final DataGobalService dataGobalService; private final DataGlobalService dataGlobalService;
//region 左边 //region 左边
// 机构问题排名
/**
* 机构问题排名
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@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,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 机构问题排名 fxsjlist中必有所有机构,不会为空 // 机构问题排名 fxsjlist中必有所有机构,不会为空
List<OrganizeProblemRankVo> fxsjlist = dataGobalService.getOrganizeProblemRank(3, beginTime, endTime); List<OrganizeProblemRankVo> fxsjlist = dataGlobalService.getOrganizeProblemRank(3, beginTime, endTime);
List<OrganizeProblemRankVo> jsdwlist = dataGobalService.getOrganizeProblemRank(4, beginTime, endTime); List<OrganizeProblemRankVo> jsdwlist = dataGlobalService.getOrganizeProblemRank(4, beginTime, endTime);
JSONObject res = new JSONObject() JSONObject res = new JSONObject()
.fluentPut("fxsjlist", fxsjlist) .fluentPut("fxsjlist", fxsjlist)
.fluentPut("jsdwlist", jsdwlist); .fluentPut("jsdwlist", jsdwlist);
@ -55,13 +61,18 @@ public class DataGobalController {
} }
// 业务类型占比 /**
* 业务类型占比
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@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,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 业务类型占比 // 业务类型占比
List<EchartsVo> ywzblist = dataGobalService.getBusinessRate(beginTime, endTime); List<EchartsVo> ywzblist = dataGlobalService.getBusinessRate(beginTime, endTime);
JSONObject res = new JSONObject().fluentPut("ywzblist", ywzblist); JSONObject res = new JSONObject().fluentPut("ywzblist", ywzblist);
return Result.success(res); return Result.success(res);
} }
@ -69,63 +80,89 @@ public class DataGobalController {
//region 中间 //region 中间
// 获取首页大屏中央数据
/**
* 获取首页大屏中央数据
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "大屏中央数据") @Operation(summary = "大屏中央数据")
@GetMapping @GetMapping
public Result<JSONObject> getAllGobalCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getAllGlobalCount(@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 overview = dataGobalService.getAllGobalCount(beginTime, endTime); JSONObject overview = dataGlobalService.getAllGlobalCount(beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("overview", overview); JSONObject data = new JSONObject().fluentPut("overview", overview);
return Result.success(data); return Result.success(data);
} }
// 地图数据 /**
@Operation(summary = "地图数据") * 地图数据
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "首页大屏地图数据")
@GetMapping("/getMap") @GetMapping("/getMap")
@Cacheable(cacheNames = "globalMap", key = "'p_'+ #endTime")
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) {
// System.out.println("Cache key: p_" + endTime);
// 地图数据 // 地图数据
List<GobalMapIconVo> gobalTempMapVoList = Optional.ofNullable(dataGobalService.getMapIconInfo(beginTime, endTime)). List<GlobalMapIconVo> GlobalTempMapVoList = Optional.ofNullable(dataGlobalService.getMapIconInfo(beginTime, endTime)).
orElseGet(ArrayList::new); orElseGet(ArrayList::new);
JSONObject data = new JSONObject().fluentPut("gobalTempMapVoList", gobalTempMapVoList); JSONObject data = new JSONObject().fluentPut("globalTempMapVoList", GlobalTempMapVoList);
return Result.success(data); return Result.success(data);
} }
// 数据大屏问题趋势统计(按月展示) /**
* 数据大屏问题趋势统计
* @param year 年份
* @return Result<JSONObject>
*/
@Operation(summary = "数据大屏问题趋势统计") @Operation(summary = "数据大屏问题趋势统计")
@GetMapping("/getGobalRecentlyTrendByMonth") @GetMapping("/getGlobalRecentlyTrendByMonth")
public Result<JSONObject> getGobalRecentlyTrendByMonth(@RequestParam Integer year) { public Result<JSONObject> getGlobalRecentlyTrendByMonth(@RequestParam Integer year) {
List<EchartsVo> gobalRecentlyTrendList = dataGobalService.getGobalRecentlyTrendByMonth(String.valueOf(year)); List<EchartsVo> GlobalRecentlyTrendList = dataGlobalService.getGlobalRecentlyTrendByMonth(String.valueOf(year));
JSONObject jsonObject = new JSONObject().fluentPut("gobalRecentlyTrendList", gobalRecentlyTrendList); JSONObject jsonObject = new JSONObject().fluentPut("globalRecentlyTrendList", GlobalRecentlyTrendList);
return Result.success(jsonObject); return Result.success(jsonObject);
} }
//endregion //endregion
//region 右边 //region 右边
// 突出问题排名
/**
* 突出问题排名
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@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 = dataGlobalService.getStrongProblemRank(beginTime, endTime);
JSONObject res = new JSONObject().fluentPut("tcwtlist", tcwtlist); JSONObject res = new JSONObject().fluentPut("tcwtlist", tcwtlist);
return Result.success(res); return Result.success(res);
} }
// 问题类型占比 /**
* 问题类型占比
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@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,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 问题类型占比 // 问题类型占比
List<EchartsVo> wtlxlist = dataGobalService.getProblemRate(beginTime, endTime); List<EchartsVo> wtlxlist = dataGlobalService.getProblemRate(beginTime, endTime);
JSONObject res = new JSONObject().fluentPut("wtlxlist", wtlxlist); JSONObject res = new JSONObject().fluentPut("wtlxlist", wtlxlist);
return Result.success(res); return Result.success(res);
} }

29
src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java

@ -42,7 +42,13 @@ public class DataMailViewController {
private final DataPetitionComplaintMapper dataPetitionComplaintMapper; private final DataPetitionComplaintMapper dataPetitionComplaintMapper;
// region 左边 // region 左边
// 初访重访情况
/**
* 初访重访情况
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "初访重访情况") @Operation(summary = "初访重访情况")
@GetMapping("/getFirstAndRepeatMail") @GetMapping("/getFirstAndRepeatMail")
public Result<JSONObject> getFirstAndRepeatMail(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getFirstAndRepeatMail(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@ -71,7 +77,13 @@ public class DataMailViewController {
// endregion // endregion
// region 中间 // region 中间
// 信访数据中央总览统计
/**
* 信访数据中央总览统计
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "信访数据大屏中央数据统计") @Operation(summary = "信访数据大屏中央数据统计")
@GetMapping("/getAllMailCount") @GetMapping("/getAllMailCount")
public Result<JSONObject> getAllMailCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getAllMailCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@ -86,6 +98,11 @@ public class DataMailViewController {
} }
/**
* 信访数据大屏信访趋势统计
* @param year 年份
* @return Result<JSONObject>
*/
@Operation(summary = "信访数据大屏信访趋势统计") @Operation(summary = "信访数据大屏信访趋势统计")
@GetMapping("/getMailTrend") @GetMapping("/getMailTrend")
public Result<JSONObject> getMailTrend(@RequestParam Integer year) { public Result<JSONObject> getMailTrend(@RequestParam Integer year) {
@ -102,7 +119,13 @@ public class DataMailViewController {
// endregion // endregion
// region 右边 // region 右边
// 缠访集访情况
/**
* 缠访集访情况
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "缠访集访情况") @Operation(summary = "缠访集访情况")
@GetMapping("/getEntanglementAndMassMail") @GetMapping("/getEntanglementAndMassMail")
public Result<JSONObject> getEntanglementAndMassMail(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getEntanglementAndMassMail(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,

56
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.pojo.vo.OrganizeProblemRankVo;
import com.biutag.supervision.service.CaseVerificationService; import com.biutag.supervision.service.CaseVerificationService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; 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.Date;
import java.util.List; import java.util.List;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*;
/** /**
* @author wxc * @author wxc
* @date 2024/10/24 * @date 2024/10/24
@ -31,7 +34,13 @@ public class DataVCaseVerifController {
private final CaseVerificationService caseVerificationService; private final CaseVerificationService caseVerificationService;
// region 左边 // region 左边
// 案件核查大屏分县市局排名
/**
* 案件核查大屏分县市局排名
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@GetMapping("/getCaseVerificationRank") @GetMapping("/getCaseVerificationRank")
public Result<JSONObject> getCaseVerificationRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getCaseVerificationRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@ -43,7 +52,12 @@ public class DataVCaseVerifController {
return Result.success(data); return Result.success(data);
} }
// 案件问题性质 /**
* 案件问题性质
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@GetMapping("/getCaseProblemProperty") @GetMapping("/getCaseProblemProperty")
public Result<JSONObject> getCaseProblemProperty(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getCaseProblemProperty(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@ -59,7 +73,12 @@ public class DataVCaseVerifController {
// region 中间 // region 中间
// 案件核查大屏中央数据总览 /**
* 案件核查大屏中央数据总览
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@GetMapping("/getAllCaseVerificationCount") @GetMapping("/getAllCaseVerificationCount")
public Result<JSONObject> getAllCaseVerificationCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getAllCaseVerificationCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@ -69,8 +88,14 @@ public class DataVCaseVerifController {
} }
// 案件核查大屏地图 /**
* 案件核查大屏地图
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@GetMapping("/getCaseVerificationMap") @GetMapping("/getCaseVerificationMap")
@Cacheable(cacheNames = "CaseVerificationMap", key = "'p_'+ #endTime")
public Result<JSONObject> getCaseVerificationMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getCaseVerificationMap(@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<CaseVerificationMapVo> caseVerificationMapList = caseVerificationService.getCaseVerificationMap(beginTime, endTime); List<CaseVerificationMapVo> caseVerificationMapList = caseVerificationService.getCaseVerificationMap(beginTime, endTime);
@ -78,10 +103,14 @@ public class DataVCaseVerifController {
return Result.success(res); return Result.success(res);
} }
// 查处问题趋势 /**
* 查处问题趋势
* @param year 年份
* @return Result<JSONObject>
*/
@GetMapping("/getCaseVerificationTrend") @GetMapping("/getCaseVerificationTrend")
public Result<JSONObject> getCaseVerificationTrend(@RequestParam Integer year) { public Result<JSONObject> getCaseVerificationTrend(@RequestParam Integer year) {
List<EchartsVo> proTrendList = caseVerificationService.getCaseVerificationTrend(String.valueOf(year)); List<EchartsVo> proTrendList = caseVerificationService.getCaseVerificationTrend(String.valueOf(year), A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue());
JSONObject data = new JSONObject().fluentPut("proTrendList", proTrendList); JSONObject data = new JSONObject().fluentPut("proTrendList", proTrendList);
return Result.success(data); return Result.success(data);
} }
@ -89,7 +118,13 @@ public class DataVCaseVerifController {
// region 右边 // region 右边
// 案件来源占比 和 问责处理情况
/**
* 案件来源占比 问责处理情况
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@GetMapping("/getCaseSourceRateAndDealSituation") @GetMapping("/getCaseSourceRateAndDealSituation")
public Result<JSONObject> getCaseSourceRateAndDealSituation(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getCaseSourceRateAndDealSituation(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@ -102,7 +137,12 @@ public class DataVCaseVerifController {
} }
// 禁闭处理情况 和 停职处理情况 /**
* 禁闭处理情况 停职处理情况
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@GetMapping("/getConfinementAndPause") @GetMapping("/getConfinementAndPause")
public Result<JSONObject> getConfinement(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getConfinement(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {

75
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.alibaba.fastjson.JSONObject;
import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.CountyStreetDept; 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.CountyStreetDeptService;
import com.biutag.supervision.service.NegativeService;
import com.biutag.supervision.service.SubOneService;
import com.google.gson.Gson; import com.google.gson.Gson;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -15,6 +23,8 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.*; import java.util.*;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*;
/** /**
* @Auther: sh * @Auther: sh
* @Date: 2024/12/4 16:30 * @Date: 2024/12/4 16:30
@ -24,16 +34,50 @@ import java.util.*;
@RequestMapping("datav/sub1/") @RequestMapping("datav/sub1/")
@RequiredArgsConstructor @RequiredArgsConstructor
@RestController @RestController
@Slf4j
public class SubOneController { public class SubOneController {
private final CountyStreetDeptService countyStreetDeptService; private final CountyStreetDeptService countyStreetDeptService;
private final SubOneService subOneService;
// region 中间
/**
* 获取问题趋势
*
* @param departPId 2级单位的id
* @param year 年份
* @return EchartsVo的list
*/
@Operation(summary = "获取一级子屏问题趋势")
@GetMapping("/getSubOneTrend")
public Result<JSONObject> getSubOneTrend(@RequestParam Integer departPId, @RequestParam Integer year) {
List<EchartsVo> superviseProTrend = subOneService.getSubOneTrend(departPId, year, XCDC.getValue(), ZXDC.getValue(), SPDC.getValue()); // 督察问题趋势
List<EchartsVo> caseVerifyTrend = subOneService.getSubOneTrend(departPId, year, A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue());
List<EchartsVo> policeCommentTrend = new ArrayList<>();
List<EchartsVo> 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") @GetMapping("/getSubOneStreetMap")
public Result<JSONObject> getSubOneStreetMap(@RequestParam Integer departPId) { public Result<JSONObject> getSubOneStreetMap(@RequestParam Integer departPId) {
List<CountyStreetDept> depts = countyStreetDeptService.getSubOneStreetMap(departPId); List<CountyStreetDept> depts = countyStreetDeptService.getSubOneStreetMap(departPId);
Map<String, Object> geoJson = new HashMap<>(); Map<String, Object> geoJson = new HashMap<>();
geoJson.put("type", "FeatureCollection"); geoJson.put("type", "FeatureCollection");
geoJson.put("name", "4062"); geoJson.put("name", "临时名字");
List<Map<String, Object>> features = new ArrayList<>(); List<Map<String, Object>> features = new ArrayList<>();
for (CountyStreetDept dept : depts) { for (CountyStreetDept dept : depts) {
@ -44,6 +88,8 @@ public class SubOneController {
properties.put("name", dept.getName()); properties.put("name", dept.getName());
properties.put("id", dept.getId()); properties.put("id", dept.getId());
feature.put("properties", properties); // 第二个键值 feature.put("properties", properties); // 第二个键值
log.info("===========现在的id是==============");
log.info(dept.getId().toString());
feature.put("geometry", new Gson().fromJson(dept.getGeometry(), Object.class)); // 第三个键值 feature.put("geometry", new Gson().fromJson(dept.getGeometry(), Object.class)); // 第三个键值
features.add(feature); features.add(feature);
@ -53,6 +99,33 @@ public class SubOneController {
jsonObject.put("geoJson", geoJson); jsonObject.put("geoJson", geoJson);
return Result.success(jsonObject); return Result.success(jsonObject);
} }
// endregion
// region右边
/**
* 获取首页一级子屏案件核查排名
* @param departPId 2级单位的id
* @param beginTime 开始时间
* @param endTime 结束时间
* @return 总览和排名
*/
@Operation(summary = "获取首页一级子屏案件核查排名")
@GetMapping("/getCaseVerifyRank")
public Result<JSONObject> getCaseVerifyRank(@RequestParam Integer departPId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
SubOneOverViewVo caseVerifyPrecinctOverView = subOneService.getCaseVerifyOverView(departPId, 10, beginTime, endTime, A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue());
SubOneOverViewVo caseVerifyTeamOverView = subOneService.getCaseVerifyOverView(departPId, -1, beginTime, endTime, A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue());
List<RankVo> caseVerifyPrecinctList = subOneService.getCaseVerifyRank(departPId, 10, beginTime, endTime, A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); // 案件核查派出所排名
List<RankVo> caseVerifyTeamList = subOneService.getCaseVerifyRank(departPId, -1, beginTime, endTime, A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); // 案件核查大队排名
JSONObject jsonObject = new JSONObject();
jsonObject.fluentPut("caseVerifyPrecinctOverView", caseVerifyPrecinctOverView)
.fluentPut("caseVerifyTeamOverView", caseVerifyTeamOverView)
.fluentPut("caseVerifyPrecinctList", caseVerifyPrecinctList)
.fluentPut("caseVerifyTeamList", caseVerifyTeamList);
return Result.success(jsonObject);
}
// endregion
} }

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

@ -8,6 +8,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -20,6 +21,9 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.XCDC;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.ZXDC;
/** /**
* @Auther: sh * @Auther: sh
* @Date: 2024/11/7 10:30 * @Date: 2024/11/7 10:30
@ -37,7 +41,12 @@ public class SupervisionNotifyController {
// region 左边 // region 左边
//获取日常督察情况 /**
* 获取日常督察情况
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@Operation(summary = "获取日常督察数量概览和整改率排名") @Operation(summary = "获取日常督察数量概览和整改率排名")
@GetMapping("/rank") @GetMapping("/rank")
public Result<JSONObject> getChangedRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getChangedRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@ -54,7 +63,12 @@ public class SupervisionNotifyController {
return Result.success(data); return Result.success(data);
} }
//问题类型占比 /**
* 问题类型占比
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@GetMapping("/getProblemTypeRate") @GetMapping("/getProblemTypeRate")
public Result<JSONObject> getProblemTypeRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getProblemTypeRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@ -67,7 +81,12 @@ public class SupervisionNotifyController {
// region 中间 // region 中间
//获取现场督察大屏中央数据 /**
* 获取现场督察大屏中央数据
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@Operation(summary = "获取所有督察通知相关数量") @Operation(summary = "获取所有督察通知相关数量")
@GetMapping @GetMapping
public Result<JSONObject> getAllSupervisionNotifyCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getAllSupervisionNotifyCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@ -77,8 +96,14 @@ public class SupervisionNotifyController {
return Result.success(data); return Result.success(data);
} }
// 地图数据 /**
* 地图数据
* @param beginTime 开始时间
* @param endTime 结束时间
* @return List<SuperviseMapIconVo>
*/
@GetMapping("/getMap") @GetMapping("/getMap")
@Cacheable(cacheNames = "superviseMap", key = "'p_'+ #endTime")
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) {
//地图数据 //地图数据
@ -87,10 +112,14 @@ public class SupervisionNotifyController {
return Result.success(data); return Result.success(data);
} }
// 获取现场督察问题趋势 /**
* 获取现场督察问题趋势
* @param year 年份
* @return List<EchartsVo>
*/
@GetMapping("/getSupervisionTrend") @GetMapping("/getSupervisionTrend")
public Result<JSONObject> getSupervisionTrend(@RequestParam String year) { public Result<JSONObject> getSupervisionTrend(@RequestParam String year) {
List<EchartsVo> supervisionTrend = dataSupervisionNotifyService.getSupervisionTrend(year); List<EchartsVo> supervisionTrend = dataSupervisionNotifyService.getSupervisionTrend(year,XCDC.getValue(), ZXDC.getValue());
JSONObject data = new JSONObject().fluentPut("supervisionTrend", supervisionTrend); JSONObject data = new JSONObject().fluentPut("supervisionTrend", supervisionTrend);
return Result.success(data); return Result.success(data);
} }
@ -98,7 +127,13 @@ public class SupervisionNotifyController {
// endregion // endregion
// region 右边 // region 右边
// 黄赌毒数据
/**
* 黄赌毒数据
* @param beginTime 开始时间
* @param endTime 结束时间
* @return JSONObject
*/
@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) {

27
src/main/java/com/biutag/supervision/controller/datav/VideoSuperviseController.java

@ -7,6 +7,7 @@ import com.biutag.supervision.service.VideoSuperviseService;
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 lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -19,6 +20,8 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.SPDC;
/** /**
* @Auther: sh * @Auther: sh
* @Date: 2024/11/29 09:32 * @Date: 2024/11/29 09:32
@ -35,7 +38,12 @@ public class VideoSuperviseController {
//region 左边 //region 左边
// 获取视频督察大屏问题数排名 /**
* 获取视频督察大屏问题数排名
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@Operation(summary = "视频督察大屏问题数排名") @Operation(summary = "视频督察大屏问题数排名")
@GetMapping("/getVideoSuperviseProblemRank") @GetMapping("/getVideoSuperviseProblemRank")
public Result<JSONObject> getVideoSuperviseProblemRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getVideoSuperviseProblemRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@ -51,7 +59,12 @@ public class VideoSuperviseController {
//region 中间 //region 中间
// 获取视频督察中央数据 /**
* 获取视频督察中央数据
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "视频督察大屏中央数据") @Operation(summary = "视频督察大屏中央数据")
@GetMapping("/getAllVideoSuperviseCount") @GetMapping("/getAllVideoSuperviseCount")
public Result<JSONObject> getAllVideoSuperviseCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getAllVideoSuperviseCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@ -62,9 +75,15 @@ public class VideoSuperviseController {
return Result.success(data); return Result.success(data);
} }
// 获取视频督察地图数据 /**
* 获取视频督察地图数据
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@Operation(summary = "视频督察大屏地图数据") @Operation(summary = "视频督察大屏地图数据")
@GetMapping("/getVideoSuperviseMap") @GetMapping("/getVideoSuperviseMap")
@Cacheable(cacheNames = "videoSuperviseMap", key = "'p_'+ #endTime")
public Result<JSONObject> getVideoSuperviseMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getVideoSuperviseMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@ -79,7 +98,7 @@ public class VideoSuperviseController {
@Operation(summary = "数据大屏问题趋势统计") @Operation(summary = "数据大屏问题趋势统计")
@GetMapping("/getVideoSuperviseTrend") @GetMapping("/getVideoSuperviseTrend")
public Result<JSONObject> getVideoSuperviseTrend(@RequestParam Integer year) { public Result<JSONObject> getVideoSuperviseTrend(@RequestParam Integer year) {
List<EchartsVo> videoSuperviseTrendList = videoSuperviseService.getVideoSuperviseTrend(String.valueOf(year)); List<EchartsVo> videoSuperviseTrendList = videoSuperviseService.getVideoSuperviseTrend(String.valueOf(year), SPDC.getValue());
JSONObject jsonObject = new JSONObject().fluentPut("videoSuperviseTrendList", videoSuperviseTrendList); JSONObject jsonObject = new JSONObject().fluentPut("videoSuperviseTrendList", videoSuperviseTrendList);
return Result.success(jsonObject); return Result.success(jsonObject);
} }

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

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.Negative; import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.vo.*; import com.biutag.supervision.pojo.vo.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.Date; import java.util.Date;
@ -47,7 +48,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"as temp on ng.involveDepartId=temp.id " + "as temp on ng.involveDepartId=temp.id " +
"WHERE ng.checkStatus<>3 AND problemSourcesCode in (13, 15, 16) " + "WHERE ng.checkStatus<>3 AND problemSourcesCode in (13, 15, 16) " +
"AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}") "AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer seleGobalMapIconInfoDc(Date beginTime, Date endTime, Integer departId); Integer seleGlobalMapIconInfoDc(Date beginTime, Date endTime, Integer departId);
@Select("SELECT count(*) FROM negative ng INNER JOIN " + @Select("SELECT count(*) FROM negative ng INNER JOIN " +
" (" + " (" +
@ -58,7 +59,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"as temp on ng.involveDepartId=temp.id " + "as temp on ng.involveDepartId=temp.id " +
"WHERE ng.checkStatus<>3 AND problemSourcesCode=11 " + "WHERE ng.checkStatus<>3 AND problemSourcesCode=11 " +
"AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}") "AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer seleGobalMapIconInfoAjhc(Date beginTime, Date endTime, Integer departId); Integer seleGlobalMapIconInfoAjhc(Date beginTime, Date endTime, Integer departId);
@Select("SELECT count(*) FROM negative ng INNER JOIN " + @Select("SELECT count(*) FROM negative ng INNER JOIN " +
" (" + " (" +
@ -69,7 +70,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"as temp on ng.involveDepartId=temp.id " + "as temp on ng.involveDepartId=temp.id " +
"WHERE ng.checkStatus<>3 AND problemSourcesCode in (21, 22, 23, 24, 25) " + "WHERE ng.checkStatus<>3 AND problemSourcesCode in (21, 22, 23, 24, 25) " +
"AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}") "AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer seleGobalMapIconInfoXf(Date beginTime, Date endTime, Integer departId); Integer seleGlobalMapIconInfoXf(Date beginTime, Date endTime, Integer departId);
@Select("SELECT count(*) FROM negative ng INNER JOIN " + @Select("SELECT count(*) FROM negative ng INNER JOIN " +
" (" + " (" +
@ -80,7 +81,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"as temp on ng.involveDepartId=temp.id " + "as temp on ng.involveDepartId=temp.id " +
"WHERE ng.checkStatus<>3 AND problemSourcesCode=2 " + "WHERE ng.checkStatus<>3 AND problemSourcesCode=2 " +
"AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}") "AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer seleGobalMapIconInfoJwpy(Date beginTime, Date endTime, Integer departId); Integer seleGlobalMapIconInfoJwpy(Date beginTime, Date endTime, Integer departId);
@Select("SELECT count(*) FROM negative ng INNER JOIN " + @Select("SELECT count(*) FROM negative ng INNER JOIN " +
" (" + " (" +
@ -91,9 +92,9 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"as temp on ng.involveDepartId=temp.id " + "as temp on ng.involveDepartId=temp.id " +
"WHERE ng.checkStatus<>3 AND problemSourcesCode=26 " + "WHERE ng.checkStatus<>3 AND problemSourcesCode=26 " +
"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 seleGlobalMapIconInfoSjdc(Date beginTime, Date endTime, Integer departId);
List<EchartsVo> getGobalRecentlyTrendByMonth(String year); List<EchartsVo> getGlobalRecentlyTrendByMonth(String year);
// endregion // endregion
@ -164,7 +165,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"GROUP BY `name`;") "GROUP BY `name`;")
List<SuperviseMapIconVo> getSupervisionMapIconInfo(Date beginTime, Date endTime); List<SuperviseMapIconVo> getSupervisionMapIconInfo(Date beginTime, Date endTime);
List<EchartsVo> getSupervisionTrend(String time); List<EchartsVo> getSupervisionTrend(String time, String[] args);
@Select("SELECT count(DISTINCT(ng.id)) as proTotal, " + @Select("SELECT count(DISTINCT(ng.id)) as proTotal, " +
"count(DISTINCT IF(ng.isRectifyCode = 1, ng.id, null) ) as changed," + "count(DISTINCT IF(ng.isRectifyCode = 1, ng.id, null) ) as changed," +
@ -252,7 +253,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
List<VideoSuperviseMapIconVo> getVideoSuperviseMapIconInfo(Date beginTime, Date endTime); List<VideoSuperviseMapIconVo> getVideoSuperviseMapIconInfo(Date beginTime, Date endTime);
List<EchartsVo> getVideoSuperviseTrend(String year); List<EchartsVo> getVideoSuperviseTrend(String year, String[] args);
// endregion // endregion
@ -270,7 +271,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"ORDER BY `value` DESC") "ORDER BY `value` DESC")
List<OrganizeProblemRankVo> getCaseVerificationRank(Date beginTime, Date endTime, int groupId); List<OrganizeProblemRankVo> getCaseVerificationRank(Date beginTime, Date endTime, int groupId);
List<EchartsVo> getCaseVerificationTrend(String year); List<EchartsVo> getCaseVerificationTrend(String year, String[] args);
@Select("SELECT count(DISTINCT ng.id) AS total, " + @Select("SELECT count(DISTINCT ng.id) AS total, " +
"COUNT( DISTINCT IF(ng.checkStatus <> 3, ng.id, NULL) ) AS confirmed, " + "COUNT( DISTINCT IF(ng.checkStatus <> 3, ng.id, NULL) ) AS confirmed, " +
@ -333,6 +334,15 @@ public interface NegativeMapper extends BaseMapper<Negative> {
List<EchartsVo> getMailTrend(Integer year, Integer type); List<EchartsVo> getMailTrend(Integer year, Integer type);
List<EchartsVo> getSubOneTrend(@Param("departPId") Integer departPId, @Param("year") Integer year, @Param("args") String[] args);
List<RankVo> getCaseVerifyRank(Integer departPId, Integer statisticsGroupId, Date beginTime, Date endTime, String[] args);
SubOneOverViewVo getCaseVerifyOverView(Integer departPId, Integer statisticsGroupId, Date beginTime, Date endTime, String[] args);
// endregion // endregion
} }

4
src/main/java/com/biutag/supervision/pojo/Result.java

@ -6,10 +6,12 @@ import lombok.Setter;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import java.io.Serializable;
@Accessors(chain = true) @Accessors(chain = true)
@Setter @Setter
@Getter @Getter
public class Result<T> { public class Result<T> implements Serializable {
@Schema(description = "状态码") @Schema(description = "状态码")
private int code; private int code;

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

@ -2,13 +2,15 @@ package com.biutag.supervision.pojo.vo;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
/** /**
* @Auther: sh * @Auther: sh
* @Date: 2024/11/29 19:29 * @Date: 2024/11/29 19:29
* @Description: * @Description:
*/ */
@Data @Data
public class CaseVerificationMapVo { public class CaseVerificationMapVo implements Serializable {
private String name; private String name;
private String departId; private String departId;
private Integer total; // 总案件数 private Integer total; // 总案件数

4
src/main/java/com/biutag/supervision/pojo/vo/GobalMapIconVo.java → src/main/java/com/biutag/supervision/pojo/vo/GlobalMapIconVo.java

@ -5,6 +5,8 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.io.Serializable;
/** /**
* @Auther: sh * @Auther: sh
* @Date: 2024/11/12 16:22 * @Date: 2024/11/12 16:22
@ -14,7 +16,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Builder @Builder
public class GobalMapIconVo { public class GlobalMapIconVo implements Serializable {
private String name; // 分县市局名称 private String name; // 分县市局名称
private Integer totalPro; // 总问题 private Integer totalPro; // 总问题

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

@ -2,19 +2,21 @@ package com.biutag.supervision.pojo.vo;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
/** /**
* @Auther: sh * @Auther: sh
* @Date: 2024/11/7 19:32 * @Date: 2024/11/7 19:32
* @Description: 带排名的部门 VO * @Description: 带排名的部门 VO
*/ */
@Data @Data
public class RankVo { public class RankVo implements Serializable {
private String label; // 部门名称 private String label; // 部门名称
private String departId; // 部门id private String departId; // 部门id
private String numerator; // 分子 已整改 private String numerator; // 分子
private String denominator; // 分母 问题数 private String denominator; // 分母
private String rate; // 整改 private String rate; // 率
private String value; // 整改 private String value; // 率
} }

26
src/main/java/com/biutag/supervision/pojo/vo/SubOneOverViewVo.java

@ -0,0 +1,26 @@
package com.biutag.supervision.pojo.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Auther: sh
* @Date: 2024/12/13 16:24
* @Description: 首页大屏一级子屏的总览vo
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SubOneOverViewVo implements Serializable {
// 首页大屏一级子屏的各种总览,从左到右对应
private String one;
private String two;
private String three;
private String four;
private String five;
private String six;
}

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

@ -2,13 +2,15 @@ package com.biutag.supervision.pojo.vo;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
/** /**
* @Auther: sh * @Auther: sh
* @Date: 2024/11/16 21:06 * @Date: 2024/11/16 21:06
* @Description: * @Description:
*/ */
@Data @Data
public class SuperviseMapIconVo { public class SuperviseMapIconVo implements Serializable {
private String name; // 分县市局名 private String name; // 分县市局名
private String totalPro; private String totalPro;
private String changing; private String changing;

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

@ -5,6 +5,8 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.io.Serializable;
/** /**
* @Auther: sh * @Auther: sh
* @Date: 2024/11/29 09:50 * @Date: 2024/11/29 09:50
@ -14,7 +16,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Builder @Builder
public class VideoSuperviseMapIconVo { public class VideoSuperviseMapIconVo implements Serializable {
private String name; private String name;
private String departId; private String departId;

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

@ -35,8 +35,8 @@ public class CaseVerificationService {
public List<EchartsVo> getCaseVerificationTrend(String year) { public List<EchartsVo> getCaseVerificationTrend(String year, String...args) {
List<EchartsVo> res = negativeMapper.getCaseVerificationTrend(year); List<EchartsVo> res = negativeMapper.getCaseVerificationTrend(year, args);
return res; return res;
} }

3
src/main/java/com/biutag/supervision/service/CountyStreetDeptService.java

@ -3,6 +3,7 @@ package com.biutag.supervision.service;
import com.biutag.supervision.mapper.CountyStreetDeptMapper; import com.biutag.supervision.mapper.CountyStreetDeptMapper;
import com.biutag.supervision.pojo.entity.CountyStreetDept; import com.biutag.supervision.pojo.entity.CountyStreetDept;
import com.biutag.supervision.pojo.vo.RankVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -29,6 +30,8 @@ public class CountyStreetDeptService {
return res; return res;
} }
} }

29
src/main/java/com/biutag/supervision/service/DataGobalService.java → src/main/java/com/biutag/supervision/service/DataGlobalService.java

@ -4,9 +4,6 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.biutag.supervision.constants.enums.InspectCaseEnum; import com.biutag.supervision.constants.enums.InspectCaseEnum;
import com.biutag.supervision.mapper.*; import com.biutag.supervision.mapper.*;
import com.biutag.supervision.pojo.dto.CaseVerifDepart;
import com.biutag.supervision.pojo.entity.DataCaseVerif;
import com.biutag.supervision.pojo.entity.DataSupervisionNotify;
import com.biutag.supervision.pojo.entity.Negative; import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.SupDepart; import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.vo.*; import com.biutag.supervision.pojo.vo.*;
@ -25,7 +22,7 @@ import java.util.List;
*/ */
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service
public class DataGobalService { public class DataGlobalService {
private final NegativeMapper negativeMapper; private final NegativeMapper negativeMapper;
@ -53,7 +50,7 @@ public class DataGobalService {
//region 中间 //region 中间
// 获取首页大屏中央统计数据 // 获取首页大屏中央统计数据
public JSONObject getAllGobalCount(Date beginTime, Date endTime) { public JSONObject getAllGlobalCount(Date beginTime, Date endTime) {
// 督察问题数量(查实版本) // 督察问题数量(查实版本)
Long supervisionPro = getCountByConditions( Long supervisionPro = getCountByConditions(
@ -92,28 +89,28 @@ public class DataGobalService {
} }
// 数据大屏问题趋势统计(按月展示) // 数据大屏问题趋势统计(按月展示)
public List<EchartsVo> getGobalRecentlyTrendByMonth(String year) { public List<EchartsVo> getGlobalRecentlyTrendByMonth(String year) {
List<EchartsVo> res = negativeMapper.getGobalRecentlyTrendByMonth(year); List<EchartsVo> res = negativeMapper.getGlobalRecentlyTrendByMonth(year);
return res; return res;
} }
// 地图数据 // 地图数据
public List<GobalMapIconVo> getMapIconInfo(Date beginTime, Date endTime) { public List<GlobalMapIconVo> getMapIconInfo(Date beginTime, Date endTime) {
List<GobalMapIconVo> res = new ArrayList<>(); List<GlobalMapIconVo> res = new ArrayList<>();
List<SupDepart> supDeparts = supDepartMapper.selectDepartsByGroupType(3); List<SupDepart> supDeparts = supDepartMapper.selectDepartsByGroupType(3);
for (SupDepart supDepart : supDeparts) { for (SupDepart supDepart : supDeparts) {
GobalMapIconVo mapIconVo = new GobalMapIconVo(); GlobalMapIconVo mapIconVo = new GlobalMapIconVo();
mapIconVo.setName(supDepart.getShortName()); mapIconVo.setName(supDepart.getShortName());
mapIconVo.setDepartId(Integer.parseInt(supDepart.getId())); mapIconVo.setDepartId(Integer.parseInt(supDepart.getId()));
res.add(mapIconVo); res.add(mapIconVo);
} }
for (GobalMapIconVo re : res) { for (GlobalMapIconVo re : res) {
Integer departId = re.getDepartId(); Integer departId = re.getDepartId();
Integer supervisePro = negativeMapper.seleGobalMapIconInfoDc(beginTime, endTime, departId); Integer supervisePro = negativeMapper.seleGlobalMapIconInfoDc(beginTime, endTime, departId);
Integer caseVerifyPro = negativeMapper.seleGobalMapIconInfoAjhc(beginTime, endTime, departId); Integer caseVerifyPro = negativeMapper.seleGlobalMapIconInfoAjhc(beginTime, endTime, departId);
Integer mailPro = negativeMapper.seleGobalMapIconInfoXf(beginTime, endTime, departId); Integer mailPro = negativeMapper.seleGlobalMapIconInfoXf(beginTime, endTime, departId);
Integer policePro = negativeMapper.seleGobalMapIconInfoJwpy(beginTime, endTime, departId); Integer policePro = negativeMapper.seleGlobalMapIconInfoJwpy(beginTime, endTime, departId);
Integer reviewPro = negativeMapper.seleGobalMapIconInfoSjdc(beginTime, endTime, departId); Integer reviewPro = negativeMapper.seleGlobalMapIconInfoSjdc(beginTime, endTime, departId);
Integer totalPro = supervisePro + caseVerifyPro + mailPro + policePro + reviewPro; Integer totalPro = supervisePro + caseVerifyPro + mailPro + policePro + reviewPro;
re.setTotalPro(totalPro != null ? totalPro : 0); re.setTotalPro(totalPro != null ? totalPro : 0);
re.setSupervisePro(supervisePro != null ? supervisePro : 0); re.setSupervisePro(supervisePro != null ? supervisePro : 0);

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

@ -25,6 +25,8 @@ import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.XCDC;
/** /**
* @author 舒云 * @author 舒云
* @description 针对表data_supervision_notify的数据库操作Service实现 * @description 针对表data_supervision_notify的数据库操作Service实现
@ -106,8 +108,8 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
// 获取现场督察问题趋势 // 获取现场督察问题趋势
public List<EchartsVo> getSupervisionTrend(String year) { public List<EchartsVo> getSupervisionTrend(String year, String ...args) {
List<EchartsVo> echartsVos = negativeMapper.getSupervisionTrend(year); List<EchartsVo> echartsVos = negativeMapper.getSupervisionTrend(year, args);
return echartsVos; return echartsVos;
} }

43
src/main/java/com/biutag/supervision/service/SubOneService.java

@ -0,0 +1,43 @@
package com.biutag.supervision.service;
import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.RankVo;
import com.biutag.supervision.pojo.vo.SubOneOverViewVo;
import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* @Auther: sh
* @Date: 2024/12/12 15:59
* @Description: 一级子屏业务层
*/
@RequiredArgsConstructor
@Service
public class SubOneService {
@Resource
private NegativeMapper negativeMapper;
public List<EchartsVo> getSubOneTrend(Integer departPId, Integer year, String... args) {
List<EchartsVo> res = negativeMapper.getSubOneTrend(departPId, year, args);
return res;
}
public List<RankVo> getCaseVerifyRank(Integer departPId, Integer statisticsGroupId, Date beginTime, Date endTime, String... args) {
List<RankVo> res = negativeMapper.getCaseVerifyRank(departPId, statisticsGroupId, beginTime, endTime, args);
return res;
}
public SubOneOverViewVo getCaseVerifyOverView(Integer departPId, Integer statisticsGroupId, Date beginTime, Date endTime, String... args) {
SubOneOverViewVo res = negativeMapper.getCaseVerifyOverView(departPId, statisticsGroupId, beginTime, endTime, args);
return res;
}
}

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

@ -50,8 +50,8 @@ public class VideoSuperviseService {
return res; return res;
} }
public List<EchartsVo> getVideoSuperviseTrend(String year) { public List<EchartsVo> getVideoSuperviseTrend(String year, String... args) {
List<EchartsVo> res = negativeMapper.getVideoSuperviseTrend(year); List<EchartsVo> res = negativeMapper.getVideoSuperviseTrend(year, args);
return res; return res;
} }

3
src/main/resources/application.yml

@ -1,10 +1,11 @@
server: server:
port: 8080 port: 8080
spring: spring:
cache:
type: redis
profiles: profiles:
active: @profiles.active@ active: @profiles.active@
# active: dev # active: dev
datasource: datasource:
dynamic: dynamic:
primary: master primary: master

239
src/main/resources/mapper/NegativeMapper.xml

@ -3,137 +3,142 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.biutag.supervision.mapper.NegativeMapper"> <mapper namespace="com.biutag.supervision.mapper.NegativeMapper">
<select id="getSupervisionTrend" resultType="com.biutag.supervision.pojo.vo.EchartsVo"> <!-- 首页大屏 -->
SELECT m.monthName AS `name`, IFNULL(COUNT(ng.discoveryTime), 0) AS `value` <select id="getGlobalRecentlyTrendByMonth" resultType="com.biutag.supervision.pojo.vo.EchartsVo">
FROM ( SELECT m.month_name AS `name`, IFNULL(COUNT(ng.id), 0) AS `value`
SELECT '01' AS month, '1月' AS monthName UNION ALL FROM sup_month_monthname m
SELECT '02', '2月' UNION ALL LEFT JOIN negative ng ON DATE_FORMAT(ng.discoveryTime, '%m') = m.month
SELECT '03', '3月' UNION ALL AND YEAR(ng.discoveryTime) = #{year}
SELECT '04', '4月' UNION ALL AND checkStatus != 3
SELECT '05', '5月' UNION ALL GROUP BY m.month_name
SELECT '06', '6月' UNION ALL
SELECT '07', '7月' UNION ALL
SELECT '08', '8月' UNION ALL
SELECT '09', '9月' UNION ALL
SELECT '10', '10月' UNION ALL
SELECT '11', '11月' UNION ALL
SELECT '12', '12月' ) m LEFT JOIN negative ng
ON DATE_FORMAT(ng.discoveryTime, '%m') = m.month
AND YEAR(ng.discoveryTime) = #{time}
AND ng.checkStatus != 3
AND ng.problemSourcesCode IN (13, 15)
GROUP BY m.monthName
ORDER BY m.month ASC; ORDER BY m.month ASC;
</select> </select>
<!-- 视频督察大屏问题趋势 -->
<select id="getVideoSuperviseTrend" resultType="com.biutag.supervision.pojo.vo.EchartsVo"> <select id="getVideoSuperviseTrend" resultType="com.biutag.supervision.pojo.vo.EchartsVo">
SELECT SELECT m.month_name AS `name`, IFNULL(COUNT(ng.id), 0) AS `value`
m.monthName AS `name`, FROM sup_month_monthname m
IFNULL(COUNT(ng.discoveryTime), 0) AS `value` LEFT JOIN negative ng ON DATE_FORMAT(ng.discoveryTime, '%m') = m.month
FROM (
SELECT '01' AS month, '1月' AS monthName UNION ALL
SELECT '02', '2月' UNION ALL
SELECT '03', '3月' UNION ALL
SELECT '04', '4月' UNION ALL
SELECT '05', '5月' UNION ALL
SELECT '06', '6月' UNION ALL
SELECT '07', '7月' UNION ALL
SELECT '08', '8月' UNION ALL
SELECT '09', '9月' UNION ALL
SELECT '10', '10月' UNION ALL
SELECT '11', '11月' UNION ALL
SELECT '12', '12月'
) m
LEFT JOIN
negative ng on DATE_FORMAT(ng.discoveryTime, '%m')=m.month
AND YEAR(ng.discoveryTime) = #{year} AND YEAR(ng.discoveryTime) = #{year}
AND checkStatus!=3 AND ng.checkStatus != 3
AND ng.problemSourcesCode =16 AND ng.problemSourcesCode =
GROUP BY <foreach item="item" index="index" collection="args" open="(" separator="," close=")">#{item}</foreach>
m.monthName GROUP BY m.month_name
ORDER BY ORDER BY m.month ASC;
m.month ASC;
</select> </select>
<select id="getGobalRecentlyTrendByMonth" resultType="com.biutag.supervision.pojo.vo.EchartsVo"> <!-- 现场督察大屏问题趋势 -->
SELECT <select id="getSupervisionTrend" resultType="com.biutag.supervision.pojo.vo.EchartsVo">
m.monthName AS `name`, SELECT m.month_name AS `name`, IFNULL(COUNT(ng.id), 0) AS `value`
IFNULL(COUNT(ng.discoveryTime), 0) AS `value` FROM sup_month_monthname m
FROM ( LEFT JOIN negative ng ON DATE_FORMAT(ng.discoveryTime, '%m') = m.month
SELECT '01' AS month, '1月' AS monthName UNION ALL AND YEAR(ng.discoveryTime) = #{time}
SELECT '02', '2月' UNION ALL AND ng.checkStatus != 3
SELECT '03', '3月' UNION ALL AND ng.problemSourcesCode IN
SELECT '04', '4月' UNION ALL <foreach item="item" index="index" collection="args" open="(" separator="," close=")">#{item}</foreach>
SELECT '05', '5月' UNION ALL GROUP BY m.month_name
SELECT '06', '6月' UNION ALL ORDER BY m.month ASC;
SELECT '07', '7月' UNION ALL
SELECT '08', '8月' UNION ALL
SELECT '09', '9月' UNION ALL
SELECT '10', '10月' UNION ALL
SELECT '11', '11月' UNION ALL
SELECT '12', '12月'
) m
LEFT JOIN
negative ng on DATE_FORMAT(ng.discoveryTime, '%m')=m.month
AND YEAR(ng.discoveryTime)=#{year}
AND checkStatus!=3
GROUP BY
m.monthName
ORDER BY
m.month ASC;
</select> </select>
<!-- 案件核查 -->
<select id="getCaseVerificationTrend" resultType="com.biutag.supervision.pojo.vo.EchartsVo"> <select id="getCaseVerificationTrend" resultType="com.biutag.supervision.pojo.vo.EchartsVo">
SELECT SELECT m.month_name AS `name`, IFNULL(COUNT(ng.id), 0) AS `value`
m.monthName AS `name`, FROM sup_month_monthname m
IFNULL(COUNT(ng.discoveryTime), 0) AS `value` LEFT JOIN negative ng ON DATE_FORMAT(ng.discoveryTime, '%m') = m.month
FROM (
SELECT '01' AS month, '1月' AS monthName UNION ALL
SELECT '02', '2月' UNION ALL
SELECT '03', '3月' UNION ALL
SELECT '04', '4月' UNION ALL
SELECT '05', '5月' UNION ALL
SELECT '06', '6月' UNION ALL
SELECT '07', '7月' UNION ALL
SELECT '08', '8月' UNION ALL
SELECT '09', '9月' UNION ALL
SELECT '10', '10月' UNION ALL
SELECT '11', '11月' UNION ALL
SELECT '12', '12月'
) m
LEFT JOIN
negative ng on DATE_FORMAT(ng.discoveryTime, '%m')=m.month
AND YEAR(ng.discoveryTime) = #{year} AND YEAR(ng.discoveryTime) = #{year}
AND checkStatus!=3 AND ng.checkStatus != 3
AND ng.problemSourcesCode IN (17, 18, 19, 20) AND ng.problemSourcesCode IN
GROUP BY <foreach item="item" index="index" collection="args" open="(" separator="," close=")">#{item}</foreach>
m.monthName GROUP BY m.month_name
ORDER BY ORDER BY m.month ASC;
m.month ASC;
</select> </select>
<!-- 信访投诉大屏问题趋势 -->
<select id="getMailTrend" resultType="com.biutag.supervision.pojo.vo.EchartsVo"> <select id="getMailTrend" resultType="com.biutag.supervision.pojo.vo.EchartsVo">
SELECT SELECT m.monthName AS `name`,
m.monthName AS `name`,
IFNULL(COUNT(dpc.discovery_time), 0) AS `value` IFNULL(COUNT(dpc.discovery_time), 0) AS `value`
FROM ( FROM (SELECT '01' AS month, '1月' AS monthName
SELECT '01' AS month, '1月' AS monthName UNION ALL UNION ALL
SELECT '02', '2月' UNION ALL SELECT '02', '2月'
SELECT '03', '3月' UNION ALL UNION ALL
SELECT '04', '4月' UNION ALL SELECT '03', '3月'
SELECT '05', '5月' UNION ALL UNION ALL
SELECT '06', '6月' UNION ALL SELECT '04', '4月'
SELECT '07', '7月' UNION ALL UNION ALL
SELECT '08', '8月' UNION ALL SELECT '05', '5月'
SELECT '09', '9月' UNION ALL UNION ALL
SELECT '10', '10月' UNION ALL SELECT '06', '6月'
SELECT '11', '11月' UNION ALL UNION ALL
SELECT '12', '12月' SELECT '07', '7月'
) m LEFT JOIN UNION ALL
SELECT '08', '8月'
UNION ALL
SELECT '09', '9月'
UNION ALL
SELECT '10', '10月'
UNION ALL
SELECT '11', '11月'
UNION ALL
SELECT '12', '12月') m
LEFT JOIN
data_petition_complaint dpc on DATE_FORMAT(dpc.discovery_time, '%m') = m.month data_petition_complaint dpc on DATE_FORMAT(dpc.discovery_time, '%m') = m.month
AND YEAR(dpc.discovery_time) = #{year} AND YEAR(dpc.discovery_time) = #{year}
AND dpc.problem_sources_code = #{type} AND dpc.problem_sources_code = #{type}
GROUP BY GROUP BY m.monthName
m.monthName ORDER BY m.month ASC;
ORDER BY </select>
m.month ASC; <!-- 首页一级子屏的问题趋势 -->
<select id="getSubOneTrend" resultType="com.biutag.supervision.pojo.vo.EchartsVo">
SELECT m.month_name AS `name`, IFNULL(temp.`value`, 0) AS `value`
FROM sup_month_monthname m
LEFT JOIN
(
SELECT DATE_FORMAT(ng.discoveryTime, '%m') as `month`, COUNT(ng.id) AS `value`
FROM negative ng LEFT JOIN sup_depart sd on ng.involveDepartId = sd.id
WHERE YEAR(ng.discoveryTime) = #{year} AND checkStatus != 3
AND ng.problemSourcesCode IN
<foreach item="item" index="index" collection="args" open="(" separator="," close=")">#{item}</foreach>
AND sd.pid = #{departPId}
GROUP BY DATE_FORMAT(ng.discoveryTime, '%m')
) as temp
ON temp.`month` = m.`month`
ORDER BY m.month ASC;
</select>
<!-- 首页一级子屏的案件核查排行 -->
<select id="getCaseVerifyRank" resultType="com.biutag.supervision.pojo.vo.RankVo">
SELECT temp.short_name AS label,
temp.id AS departId,
COUNT(IF(checkIdCode != 3, checkIdCode, NULL)) AS numerator,
COUNT(DISTINCT ng.id) AS denominator,
COUNT(DISTINCT ng.id) AS `value`
FROM negative ng
INNER JOIN
(SELECT id, short_name FROM sup_depart sd
WHERE sd.pid = #{departPId}
<if test="statisticsGroupId != 0">AND statistics_group_id = #{statisticsGroupId}</if>
<if test="statisticsGroupId == 0">AND statistics_group_id != 10</if>
) AS temp
ON ng.involveDepartId = temp.id
WHERE ng.problemSourcesCode IN
<foreach collection="args" item="arg" open="(" separator="," close=")">#{arg}</foreach>
AND discoveryTime BETWEEN #{beginTime} AND #{endTime}
GROUP BY temp.short_name
ORDER BY denominator DESC;
</select>
<!-- 首页一级子屏的案件核查总览 -->
<select id="getCaseVerifyOverView" resultType="com.biutag.supervision.pojo.vo.SubOneOverViewVo">
SELECT COUNT(DISTINCT ng.id) as one,
COUNT( IF(checkIdCode!=3,checkIdCode,NULL)) AS two,
COALESCE(ROUND(COUNT(IF(checkIdCode != 3, checkIdCode, NULL)) / NULLIF(COUNT(DISTINCT ng.id), 0) * 100, 1), 0)
AS three
FROM negative ng INNER JOIN
(SELECT id, short_name FROM sup_depart sd
WHERE sd.pid = #{departPId}
<if test="statisticsGroupId != 0">AND statistics_group_id = #{statisticsGroupId}</if>
<if test="statisticsGroupId == 0">AND statistics_group_id != 10</if>
) AS temp
ON ng.involveDepartId = temp.id
WHERE ng.problemSourcesCode IN
<foreach collection="args" item="arg" open="(" separator="," close=")">#{arg}</foreach>
AND discoveryTime BETWEEN #{beginTime} AND #{endTime};
</select> </select>

16
src/test/java/com/biutag/supervision/controller/datav/SubOneControllerTest.java

@ -2,7 +2,10 @@ package com.biutag.supervision.controller.datav;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.biutag.supervision.pojo.entity.CountyStreetDept; import com.biutag.supervision.pojo.entity.CountyStreetDept;
import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.RankVo;
import com.biutag.supervision.service.CountyStreetDeptService; import com.biutag.supervision.service.CountyStreetDeptService;
import com.biutag.supervision.service.SubOneService;
import com.google.gson.Gson; import com.google.gson.Gson;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -13,11 +16,15 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*;
@SpringBootTest @SpringBootTest
public class SubOneControllerTest { public class SubOneControllerTest {
@Resource @Resource
private CountyStreetDeptService countyStreetDeptService; private CountyStreetDeptService countyStreetDeptService;
@Resource
private SubOneService subOneService;
@Test @Test
public void testSubstr() { public void testSubstr() {
List<CountyStreetDept> depts = countyStreetDeptService.getTest(4062); List<CountyStreetDept> depts = countyStreetDeptService.getTest(4062);
@ -43,4 +50,13 @@ public class SubOneControllerTest {
jsonObject.put("geoJson", geoJson); jsonObject.put("geoJson", geoJson);
} }
@Test
void getSubOneTrend() {
List<EchartsVo> superviseProTrend = subOneService.getSubOneTrend(22, 2024, XCDC.getValue(), ZXDC.getValue(), SPDC.getValue()); // 督察问题趋势
System.out.println(superviseProTrend);
}
@Test
void getSubOneStreetMap() {
}
} }

Loading…
Cancel
Save