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> features = new ArrayList<>(); for (CountyStreetDept dept : depts) { @@ -44,6 +88,8 @@ public class SubOneController { properties.put("name", dept.getName()); properties.put("id", dept.getId()); feature.put("properties", properties); // 第二个键值 + log.info("===========现在的id是=============="); + log.info(dept.getId().toString()); feature.put("geometry", new Gson().fromJson(dept.getGeometry(), Object.class)); // 第三个键值 features.add(feature); @@ -53,6 +99,33 @@ public class SubOneController { jsonObject.put("geoJson", geoJson); return Result.success(jsonObject); } +// endregion + + // region右边 + /** + * 获取首页一级子屏案件核查排名 + * @param departPId 2级单位的id + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return 总览和排名 + */ + @Operation(summary = "获取首页一级子屏案件核查排名") + @GetMapping("/getCaseVerifyRank") + public Result 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 caseVerifyPrecinctList = subOneService.getCaseVerifyRank(departPId, 10, beginTime, endTime, A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); // 案件核查派出所排名 + List 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 } diff --git a/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java b/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java index 444398f..ed99041 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java +++ b/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 lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +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; @@ -20,6 +21,9 @@ import java.util.Date; import java.util.List; import java.util.Map; +import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.XCDC; +import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.ZXDC; + /** * @Auther: sh * @Date: 2024/11/7 10:30 @@ -37,7 +41,12 @@ public class SupervisionNotifyController { // region 左边 - //获取日常督察情况 + /** + * 获取日常督察情况 + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return + */ @Operation(summary = "获取日常督察数量概览和整改率排名") @GetMapping("/rank") public Result getChangedRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @@ -54,7 +63,12 @@ public class SupervisionNotifyController { return Result.success(data); } - //问题类型占比 + /** + * 问题类型占比 + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return + */ @GetMapping("/getProblemTypeRate") public Result getProblemTypeRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @@ -67,7 +81,12 @@ public class SupervisionNotifyController { // region 中间 - //获取现场督察大屏中央数据 + /** + * 获取现场督察大屏中央数据 + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return + */ @Operation(summary = "获取所有督察通知相关数量") @GetMapping public Result getAllSupervisionNotifyCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @@ -77,8 +96,14 @@ public class SupervisionNotifyController { return Result.success(data); } - // 地图数据 + /** + * 地图数据 + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return List + */ @GetMapping("/getMap") + @Cacheable(cacheNames = "superviseMap", key = "'p_'+ #endTime") public Result getMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { //地图数据 @@ -87,10 +112,14 @@ public class SupervisionNotifyController { return Result.success(data); } - // 获取现场督察问题趋势 + /** + * 获取现场督察问题趋势 + * @param year 年份 + * @return List + */ @GetMapping("/getSupervisionTrend") public Result getSupervisionTrend(@RequestParam String year) { - List supervisionTrend = dataSupervisionNotifyService.getSupervisionTrend(year); + List supervisionTrend = dataSupervisionNotifyService.getSupervisionTrend(year,XCDC.getValue(), ZXDC.getValue()); JSONObject data = new JSONObject().fluentPut("supervisionTrend", supervisionTrend); return Result.success(data); } @@ -98,7 +127,13 @@ public class SupervisionNotifyController { // endregion // region 右边 - // 黄赌毒数据 + + /** + * 黄赌毒数据 + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return JSONObject + */ @GetMapping("/getYellowBetDrug") public Result getYellowBetDrug(@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/VideoSuperviseController.java b/src/main/java/com/biutag/supervision/controller/datav/VideoSuperviseController.java index d97fa0f..d2d0f4c 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/VideoSuperviseController.java +++ b/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.tags.Tag; import lombok.RequiredArgsConstructor; +import org.springframework.cache.annotation.Cacheable; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @@ -19,6 +20,8 @@ import java.util.Date; import java.util.List; import java.util.Optional; +import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.SPDC; + /** * @Auther: sh * @Date: 2024/11/29 09:32 @@ -35,7 +38,12 @@ public class VideoSuperviseController { //region 左边 - // 获取视频督察大屏问题数排名 + /** + * 获取视频督察大屏问题数排名 + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return + */ @Operation(summary = "视频督察大屏问题数排名") @GetMapping("/getVideoSuperviseProblemRank") public Result getVideoSuperviseProblemRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @@ -51,7 +59,12 @@ public class VideoSuperviseController { //region 中间 - // 获取视频督察中央数据 + /** + * 获取视频督察中央数据 + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return Result + */ @Operation(summary = "视频督察大屏中央数据") @GetMapping("/getAllVideoSuperviseCount") public Result getAllVideoSuperviseCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @@ -62,9 +75,15 @@ public class VideoSuperviseController { return Result.success(data); } - // 获取视频督察地图数据 + /** + * 获取视频督察地图数据 + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return + */ @Operation(summary = "视频督察大屏地图数据") @GetMapping("/getVideoSuperviseMap") + @Cacheable(cacheNames = "videoSuperviseMap", key = "'p_'+ #endTime") public Result getVideoSuperviseMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @@ -79,7 +98,7 @@ public class VideoSuperviseController { @Operation(summary = "数据大屏问题趋势统计") @GetMapping("/getVideoSuperviseTrend") public Result getVideoSuperviseTrend(@RequestParam Integer year) { - List videoSuperviseTrendList = videoSuperviseService.getVideoSuperviseTrend(String.valueOf(year)); + List videoSuperviseTrendList = videoSuperviseService.getVideoSuperviseTrend(String.valueOf(year), SPDC.getValue()); JSONObject jsonObject = new JSONObject().fluentPut("videoSuperviseTrendList", videoSuperviseTrendList); return Result.success(jsonObject); } diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index fdb02b4..97f7e51 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/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.biutag.supervision.pojo.entity.Negative; import com.biutag.supervision.pojo.vo.*; +import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.Date; @@ -47,7 +48,7 @@ public interface NegativeMapper extends BaseMapper { "as temp on ng.involveDepartId=temp.id " + "WHERE ng.checkStatus<>3 AND problemSourcesCode in (13, 15, 16) " + "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 " + " (" + @@ -58,7 +59,7 @@ public interface NegativeMapper extends BaseMapper { "as temp on ng.involveDepartId=temp.id " + "WHERE ng.checkStatus<>3 AND problemSourcesCode=11 " + "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 " + " (" + @@ -69,7 +70,7 @@ public interface NegativeMapper extends BaseMapper { "as temp on ng.involveDepartId=temp.id " + "WHERE ng.checkStatus<>3 AND problemSourcesCode in (21, 22, 23, 24, 25) " + "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 " + " (" + @@ -80,7 +81,7 @@ public interface NegativeMapper extends BaseMapper { "as temp on ng.involveDepartId=temp.id " + "WHERE ng.checkStatus<>3 AND problemSourcesCode=2 " + "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 " + " (" + @@ -91,9 +92,9 @@ public interface NegativeMapper extends BaseMapper { "as temp on ng.involveDepartId=temp.id " + "WHERE ng.checkStatus<>3 AND problemSourcesCode=26 " + "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 getGobalRecentlyTrendByMonth(String year); + List getGlobalRecentlyTrendByMonth(String year); // endregion @@ -164,7 +165,7 @@ public interface NegativeMapper extends BaseMapper { "GROUP BY `name`;") List getSupervisionMapIconInfo(Date beginTime, Date endTime); - List getSupervisionTrend(String time); + List getSupervisionTrend(String time, String[] args); @Select("SELECT count(DISTINCT(ng.id)) as proTotal, " + "count(DISTINCT IF(ng.isRectifyCode = 1, ng.id, null) ) as changed," + @@ -252,12 +253,12 @@ public interface NegativeMapper extends BaseMapper { List getVideoSuperviseMapIconInfo(Date beginTime, Date endTime); - List getVideoSuperviseTrend(String year); + List getVideoSuperviseTrend(String year, String[] args); // endregion -// region 案件核查大屏 + // region 案件核查大屏 @Select("SELECT sd1.short_name AS label, " + "count(DISTINCT ng.id) AS `value` " + "FROM negative ng " + @@ -270,7 +271,7 @@ public interface NegativeMapper extends BaseMapper { "ORDER BY `value` DESC") List getCaseVerificationRank(Date beginTime, Date endTime, int groupId); - List getCaseVerificationTrend(String year); + List getCaseVerificationTrend(String year, String[] args); @Select("SELECT count(DISTINCT ng.id) AS total, " + "COUNT( DISTINCT IF(ng.checkStatus <> 3, ng.id, NULL) ) AS confirmed, " + @@ -333,6 +334,15 @@ public interface NegativeMapper extends BaseMapper { List getMailTrend(Integer year, Integer type); + List getSubOneTrend(@Param("departPId") Integer departPId, @Param("year") Integer year, @Param("args") String[] args); + + + + + List getCaseVerifyRank(Integer departPId, Integer statisticsGroupId, Date beginTime, Date endTime, String[] args); + + SubOneOverViewVo getCaseVerifyOverView(Integer departPId, Integer statisticsGroupId, Date beginTime, Date endTime, String[] args); + // endregion } diff --git a/src/main/java/com/biutag/supervision/pojo/Result.java b/src/main/java/com/biutag/supervision/pojo/Result.java index f9f1ba4..8606a18 100644 --- a/src/main/java/com/biutag/supervision/pojo/Result.java +++ b/src/main/java/com/biutag/supervision/pojo/Result.java @@ -6,10 +6,12 @@ import lombok.Setter; import lombok.experimental.Accessors; import org.springframework.http.HttpStatus; +import java.io.Serializable; + @Accessors(chain = true) @Setter @Getter -public class Result { +public class Result implements Serializable { @Schema(description = "状态码") private int code; diff --git a/src/main/java/com/biutag/supervision/pojo/vo/CaseVerificationMapVo.java b/src/main/java/com/biutag/supervision/pojo/vo/CaseVerificationMapVo.java index fb59c9e..8319e8a 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/CaseVerificationMapVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/CaseVerificationMapVo.java @@ -2,13 +2,15 @@ package com.biutag.supervision.pojo.vo; import lombok.Data; +import java.io.Serializable; + /** * @Auther: sh * @Date: 2024/11/29 19:29 * @Description: */ @Data -public class CaseVerificationMapVo { +public class CaseVerificationMapVo implements Serializable { private String name; private String departId; private Integer total; // 总案件数 diff --git a/src/main/java/com/biutag/supervision/pojo/vo/GobalMapIconVo.java b/src/main/java/com/biutag/supervision/pojo/vo/GlobalMapIconVo.java similarity index 89% rename from src/main/java/com/biutag/supervision/pojo/vo/GobalMapIconVo.java rename to src/main/java/com/biutag/supervision/pojo/vo/GlobalMapIconVo.java index ce79513..05b3908 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/GobalMapIconVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/GlobalMapIconVo.java @@ -5,6 +5,8 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.io.Serializable; + /** * @Auther: sh * @Date: 2024/11/12 16:22 @@ -14,7 +16,7 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @NoArgsConstructor @Builder -public class GobalMapIconVo { +public class GlobalMapIconVo implements Serializable { private String name; // 分县市局名称 private Integer totalPro; // 总问题 diff --git a/src/main/java/com/biutag/supervision/pojo/vo/RankVo.java b/src/main/java/com/biutag/supervision/pojo/vo/RankVo.java index 4cb73c9..3fb3dfa 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/RankVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/RankVo.java @@ -2,19 +2,21 @@ package com.biutag.supervision.pojo.vo; import lombok.Data; +import java.io.Serializable; + /** * @Auther: sh * @Date: 2024/11/7 19:32 * @Description: 带排名的部门 VO */ @Data -public class RankVo { +public class RankVo implements Serializable { private String label; // 部门名称 private String departId; // 部门id - private String numerator; // 分子 已整改 - private String denominator; // 分母 问题数 - private String rate; // 整改率 - private String value; // 整改率 + private String numerator; // 分子 + private String denominator; // 分母 + private String rate; // 率 + private String value; // 率 } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/SubOneOverViewVo.java b/src/main/java/com/biutag/supervision/pojo/vo/SubOneOverViewVo.java new file mode 100644 index 0000000..4535649 --- /dev/null +++ b/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; +} + diff --git a/src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java b/src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java index f25b648..1c47d95 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java @@ -2,13 +2,15 @@ package com.biutag.supervision.pojo.vo; import lombok.Data; +import java.io.Serializable; + /** * @Auther: sh * @Date: 2024/11/16 21:06 * @Description: */ @Data -public class SuperviseMapIconVo { +public class SuperviseMapIconVo implements Serializable { private String name; // 分县市局名 private String totalPro; private String changing; diff --git a/src/main/java/com/biutag/supervision/pojo/vo/VideoSuperviseMapIconVo.java b/src/main/java/com/biutag/supervision/pojo/vo/VideoSuperviseMapIconVo.java index 9b24bf3..585f1fc 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/VideoSuperviseMapIconVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/VideoSuperviseMapIconVo.java @@ -5,6 +5,8 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.io.Serializable; + /** * @Auther: sh * @Date: 2024/11/29 09:50 @@ -14,7 +16,7 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @NoArgsConstructor @Builder -public class VideoSuperviseMapIconVo { +public class VideoSuperviseMapIconVo implements Serializable { private String name; private String departId; diff --git a/src/main/java/com/biutag/supervision/service/CaseVerificationService.java b/src/main/java/com/biutag/supervision/service/CaseVerificationService.java index 77eeb2b..e890ff1 100644 --- a/src/main/java/com/biutag/supervision/service/CaseVerificationService.java +++ b/src/main/java/com/biutag/supervision/service/CaseVerificationService.java @@ -35,8 +35,8 @@ public class CaseVerificationService { - public List getCaseVerificationTrend(String year) { - List res = negativeMapper.getCaseVerificationTrend(year); + public List getCaseVerificationTrend(String year, String...args) { + List res = negativeMapper.getCaseVerificationTrend(year, args); return res; } diff --git a/src/main/java/com/biutag/supervision/service/CountyStreetDeptService.java b/src/main/java/com/biutag/supervision/service/CountyStreetDeptService.java index d1244dc..c757e23 100644 --- a/src/main/java/com/biutag/supervision/service/CountyStreetDeptService.java +++ b/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.pojo.entity.CountyStreetDept; +import com.biutag.supervision.pojo.vo.RankVo; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -29,6 +30,8 @@ public class CountyStreetDeptService { return res; } + + } diff --git a/src/main/java/com/biutag/supervision/service/DataGobalService.java b/src/main/java/com/biutag/supervision/service/DataGlobalService.java similarity index 83% rename from src/main/java/com/biutag/supervision/service/DataGobalService.java rename to src/main/java/com/biutag/supervision/service/DataGlobalService.java index b5e7414..5f24a2a 100644 --- a/src/main/java/com/biutag/supervision/service/DataGobalService.java +++ b/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.biutag.supervision.constants.enums.InspectCaseEnum; 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.SupDepart; import com.biutag.supervision.pojo.vo.*; @@ -25,7 +22,7 @@ import java.util.List; */ @RequiredArgsConstructor @Service -public class DataGobalService { +public class DataGlobalService { private final NegativeMapper negativeMapper; @@ -53,7 +50,7 @@ public class DataGobalService { //region 中间 // 获取首页大屏中央统计数据 - public JSONObject getAllGobalCount(Date beginTime, Date endTime) { + public JSONObject getAllGlobalCount(Date beginTime, Date endTime) { // 督察问题数量(查实版本) Long supervisionPro = getCountByConditions( @@ -92,28 +89,28 @@ public class DataGobalService { } // 数据大屏问题趋势统计(按月展示) - public List getGobalRecentlyTrendByMonth(String year) { - List res = negativeMapper.getGobalRecentlyTrendByMonth(year); + public List getGlobalRecentlyTrendByMonth(String year) { + List res = negativeMapper.getGlobalRecentlyTrendByMonth(year); return res; } // 地图数据 - public List getMapIconInfo(Date beginTime, Date endTime) { - List res = new ArrayList<>(); + public List getMapIconInfo(Date beginTime, Date endTime) { + List res = new ArrayList<>(); List supDeparts = supDepartMapper.selectDepartsByGroupType(3); for (SupDepart supDepart : supDeparts) { - GobalMapIconVo mapIconVo = new GobalMapIconVo(); + GlobalMapIconVo mapIconVo = new GlobalMapIconVo(); mapIconVo.setName(supDepart.getShortName()); mapIconVo.setDepartId(Integer.parseInt(supDepart.getId())); res.add(mapIconVo); } - for (GobalMapIconVo re : res) { + for (GlobalMapIconVo re : res) { Integer departId = re.getDepartId(); - Integer supervisePro = negativeMapper.seleGobalMapIconInfoDc(beginTime, endTime, departId); - Integer caseVerifyPro = negativeMapper.seleGobalMapIconInfoAjhc(beginTime, endTime, departId); - Integer mailPro = negativeMapper.seleGobalMapIconInfoXf(beginTime, endTime, departId); - Integer policePro = negativeMapper.seleGobalMapIconInfoJwpy(beginTime, endTime, departId); - Integer reviewPro = negativeMapper.seleGobalMapIconInfoSjdc(beginTime, endTime, departId); + Integer supervisePro = negativeMapper.seleGlobalMapIconInfoDc(beginTime, endTime, departId); + Integer caseVerifyPro = negativeMapper.seleGlobalMapIconInfoAjhc(beginTime, endTime, departId); + Integer mailPro = negativeMapper.seleGlobalMapIconInfoXf(beginTime, endTime, departId); + Integer policePro = negativeMapper.seleGlobalMapIconInfoJwpy(beginTime, endTime, departId); + Integer reviewPro = negativeMapper.seleGlobalMapIconInfoSjdc(beginTime, endTime, departId); Integer totalPro = supervisePro + caseVerifyPro + mailPro + policePro + reviewPro; re.setTotalPro(totalPro != null ? totalPro : 0); re.setSupervisePro(supervisePro != null ? supervisePro : 0); diff --git a/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java b/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java index 6bb3a4b..b35d01e 100644 --- a/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java @@ -25,6 +25,8 @@ import org.springframework.stereotype.Service; import java.util.*; import java.util.stream.Collectors; +import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.XCDC; + /** * @author 舒云 * @description 针对表【data_supervision_notify】的数据库操作Service实现 @@ -106,8 +108,8 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl getSupervisionTrend(String year) { - List echartsVos = negativeMapper.getSupervisionTrend(year); + public List getSupervisionTrend(String year, String ...args) { + List echartsVos = negativeMapper.getSupervisionTrend(year, args); return echartsVos; } diff --git a/src/main/java/com/biutag/supervision/service/SubOneService.java b/src/main/java/com/biutag/supervision/service/SubOneService.java new file mode 100644 index 0000000..75de3a7 --- /dev/null +++ b/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 getSubOneTrend(Integer departPId, Integer year, String... args) { + List res = negativeMapper.getSubOneTrend(departPId, year, args); + return res; + } + + public List getCaseVerifyRank(Integer departPId, Integer statisticsGroupId, Date beginTime, Date endTime, String... args) { + List 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; + } +} + diff --git a/src/main/java/com/biutag/supervision/service/VideoSuperviseService.java b/src/main/java/com/biutag/supervision/service/VideoSuperviseService.java index 50de971..0a1d638 100644 --- a/src/main/java/com/biutag/supervision/service/VideoSuperviseService.java +++ b/src/main/java/com/biutag/supervision/service/VideoSuperviseService.java @@ -50,8 +50,8 @@ public class VideoSuperviseService { return res; } - public List getVideoSuperviseTrend(String year) { - List res = negativeMapper.getVideoSuperviseTrend(year); + public List getVideoSuperviseTrend(String year, String... args) { + List res = negativeMapper.getVideoSuperviseTrend(year, args); return res; } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index f888d95..d387389 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,10 +1,11 @@ server: port: 8080 spring: + cache: + type: redis profiles: active: @profiles.active@ # active: dev - datasource: dynamic: primary: master diff --git a/src/main/resources/mapper/NegativeMapper.xml b/src/main/resources/mapper/NegativeMapper.xml index b43d165..d37451c 100644 --- a/src/main/resources/mapper/NegativeMapper.xml +++ b/src/main/resources/mapper/NegativeMapper.xml @@ -3,137 +3,142 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + SELECT m.month_name AS `name`, IFNULL(COUNT(ng.id), 0) AS `value` + FROM sup_month_monthname m + LEFT JOIN negative ng ON DATE_FORMAT(ng.discoveryTime, '%m') = m.month + AND YEAR(ng.discoveryTime) = #{year} + AND checkStatus != 3 + GROUP BY m.month_name ORDER BY m.month ASC; + - + SELECT m.month_name AS `name`, IFNULL(COUNT(ng.id), 0) AS `value` + FROM sup_month_monthname 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 + #{item} + GROUP BY m.month_name + ORDER BY m.month ASC; + + + + + + + + + diff --git a/src/test/java/com/biutag/supervision/controller/datav/SubOneControllerTest.java b/src/test/java/com/biutag/supervision/controller/datav/SubOneControllerTest.java index 37d8f44..6ea4e4e 100644 --- a/src/test/java/com/biutag/supervision/controller/datav/SubOneControllerTest.java +++ b/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.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.SubOneService; import com.google.gson.Gson; import jakarta.annotation.Resource; import org.junit.jupiter.api.Test; @@ -13,11 +16,15 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*; + @SpringBootTest public class SubOneControllerTest { @Resource private CountyStreetDeptService countyStreetDeptService; + @Resource + private SubOneService subOneService; @Test public void testSubstr() { List depts = countyStreetDeptService.getTest(4062); @@ -43,4 +50,13 @@ public class SubOneControllerTest { jsonObject.put("geoJson", geoJson); } + @Test + void getSubOneTrend() { + List superviseProTrend = subOneService.getSubOneTrend(22, 2024, XCDC.getValue(), ZXDC.getValue(), SPDC.getValue()); // 督察问题趋势 + System.out.println(superviseProTrend); + } + + @Test + void getSubOneStreetMap() { + } }