From 5890adf6ec23ccb7f1627d974b6271a5fd7790de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E7=88=B1=E5=AD=A6=E4=B9=A0=E7=9A=84=E7=9F=B3?= =?UTF-8?q?=E5=90=8C=E5=AD=A6?= <2936013465@qq.com> Date: Wed, 25 Dec 2024 17:14:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E5=9C=B0=E5=9B=BE=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datav/DataGlobalController.java | 17 ++- .../datav/DataMailViewController.java | 2 +- .../datav/DataVCaseVerifController.java | 2 +- .../datav/DatavRightsComfortController.java | 2 + .../datav/SupervisionNotifyController.java | 26 ++--- .../datav/VideoSuperviseController.java | 2 +- .../subdatav/SubOneCaseVerifController.java | 19 ++-- .../subdatav/SubOneGlobalController.java | 23 ++-- .../subdatav/SubOneMailViewController.java | 14 ++- .../SubOneSupervisionNotifyController.java | 37 ++++-- .../SubOneVideoSuperviseController.java | 29 ++++- .../mapper/DataPetition12337Mapper.java | 5 + .../mapper/DataPetitionComplaintMapper.java | 10 +- .../supervision/mapper/NegativeMapper.java | 105 ++++++++++++++++-- .../supervision/mapper/SupDepartMapper.java | 12 ++ .../supervision/pojo/vo/MailMapIconVo.java | 4 +- .../supervision/service/DataMailService.java | 92 +++++++++++---- .../DataSupervisionNotifyServiceImpl.java | 9 +- .../service/DataMailServiceTest.java | 10 ++ 19 files changed, 315 insertions(+), 105 deletions(-) diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataGlobalController.java b/src/main/java/com/biutag/supervision/controller/datav/DataGlobalController.java index f931579..cd3db20 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataGlobalController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataGlobalController.java @@ -90,7 +90,7 @@ public class DataGlobalController { * @return Result */ @Operation(summary = "大屏中央数据") - @GetMapping + @GetMapping("/getAllGlobalCount") public Result getAllGlobalCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { // 获取数据大屏中央总数概览 @@ -107,13 +107,12 @@ public class DataGlobalController { * @return Result */ @Operation(summary = "首页大屏地图数据") - @GetMapping("/getMap") - // todo: 缓存取时间会出现多级目录 - @Cacheable(cacheNames = "globalMap", key = " #beginTime.toString().substring(0, 10) + '_' + #endTime.toString().substring(0, 10)") - public Result getMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + @GetMapping("/getGlobalMap") + @Cacheable(cacheNames = "Supervision:Screen:GlobalMap", key = "#beginTime.getTime()+'_'+#endTime.getTime()") + public Result getGlobalMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { // 地图数据 - List GlobalTempMapVoList = negativeMapper.getMapIcon(beginTime, endTime); + List GlobalTempMapVoList = negativeMapper.getGlobalMap(beginTime, endTime); JSONObject data = new JSONObject().fluentPut("globalTempMapVoList", GlobalTempMapVoList); return Result.success(data); } @@ -126,7 +125,7 @@ public class DataGlobalController { * @return Result */ @Operation(summary = "数据大屏问题趋势统计") - @GetMapping("/getGlobalRecentlyTrendByMonth") + @GetMapping("/getGlobalTrend") public Result getGlobalRecentlyTrendByMonth(@RequestParam Integer year) { List GlobalRecentlyTrendList = negativeMapper.getGlobalRecentlyTrendByMonth(year.toString()); JSONObject jsonObject = new JSONObject().fluentPut("globalRecentlyTrendList", GlobalRecentlyTrendList); @@ -170,7 +169,7 @@ public class DataGlobalController { public Result getProblemBusinessRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { // 问题类型占比 - List wtlxlist= negativeMapper.selectProblemRate(beginTime, endTime); + List wtlxlist = negativeMapper.selectProblemRate(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 ad1351d..44cedff 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java @@ -115,7 +115,7 @@ public class DataMailViewController { */ @Operation(summary = "信访数据中央地图小图标数据") @GetMapping("/getMailMapIcon") - @Cacheable(cacheNames = "MailMap", key = "'p_'+ #endTime") + @Cacheable(cacheNames = "Supervision:Screen:MailMap", key = "#beginTime.getTime()+'_'+#endTime.getTime()") public Result getMailMapIcon(@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/DataVCaseVerifController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java index 7b39b84..8b9380b 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java @@ -100,7 +100,7 @@ public class DataVCaseVerifController { * @return Result */ @GetMapping("/getCaseVerificationMap") - @Cacheable(cacheNames = "CaseVerificationMap", key = "'p_'+ #endTime") + @Cacheable(cacheNames = "Supervision:Screen:CaseVerificationMap", key = "#beginTime.getTime()+'_'+#endTime.getTime()") public Result getCaseVerificationMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { List caseVerificationMapList = negativeMapper.getCaseVerificationMap(beginTime, endTime); diff --git a/src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java b/src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java index 153b547..27dd36e 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java @@ -16,6 +16,7 @@ import com.biutag.supervision.service.RpcApplyService; import com.biutag.supervision.service.RpcInfringerResultService; 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; @@ -112,6 +113,7 @@ public class DatavRightsComfortController { // 地图图标数据 @GetMapping("/getComfortMapIcon") + @Cacheable(cacheNames = "Supervision:Screen:ComfortMap", key = "#beginTime.getTime()+'_'+#endTime.getTime()") public Result getComfortMapIcon(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { List comfortMapVoList = dataRightsComfortService.getComfortMapIcon(beginTime, endTime); 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 76a066a..6e58975 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java @@ -40,7 +40,7 @@ public class SupervisionNotifyController { private final DataSupervisionNotifyServiceImpl dataSupervisionNotifyService; private final NegativeMapper negativeMapper; -// region 左边 + // region 左边 /** * 获取日常督察情况 @@ -50,11 +50,11 @@ public class SupervisionNotifyController { * @return */ @Operation(summary = "获取日常督察数量概览和整改率排名") - @GetMapping("/rank") + @GetMapping("/getChangedRank") public Result getChangedRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - DayTimeSuperviseVo fxsjRankOverview = negativeMapper.getSuperversionRank(beginTime, endTime, 3); - DayTimeSuperviseVo jsdwRankOverview = negativeMapper.getSuperversionRank(beginTime, endTime, 4); + DayTimeSuperviseVo fxsjRankOverview = negativeMapper.getSupervisionRank(beginTime, endTime, 3); + DayTimeSuperviseVo jsdwRankOverview = negativeMapper.getSupervisionRank(beginTime, endTime, 4); List fxsjChangedRankList = negativeMapper.getChangedRateRank(beginTime, endTime, 3); List jsdwChangedRankList = negativeMapper.getChangedRateRank(beginTime, endTime, 4); JSONObject data = new JSONObject() @@ -81,9 +81,9 @@ public class SupervisionNotifyController { return Result.success(data); } -// endregion + // endregion -// region 中间 + // region 中间 /** * 获取现场督察大屏中央总览 @@ -93,8 +93,8 @@ public class SupervisionNotifyController { * @return */ @Operation(summary = "获取现场督察大屏中央总览") - @GetMapping - public Result getAllSupervisionNotifyCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @GetMapping("/getSupervisionNotifyCount") + public Result getSupervisionNotifyCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { SupervisionNotifyOverView overview = negativeMapper.getAllSupervisionNotifyCount(beginTime, endTime); JSONObject data = new JSONObject().fluentPut("overview", overview); @@ -108,9 +108,9 @@ public class SupervisionNotifyController { * @param endTime 结束时间 * @return List */ - @GetMapping("/getMap") - @Cacheable(cacheNames = "superviseMap", key = "'p_'+ #endTime") - public Result getMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @GetMapping("/getSupervisionNotifyMap") + @Cacheable(cacheNames = "Supervision:Screen:SupervisionNotifyMap", key = "#beginTime.getTime()+'_'+#endTime.getTime()") + public Result getSupervisionNotifyMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { //地图数据 List superviseTempMapVoList = negativeMapper.getSupervisionMapIconInfo(beginTime, endTime); @@ -131,9 +131,9 @@ public class SupervisionNotifyController { return Result.success(data); } -// endregion + // endregion -// region 右边 + // region 右边 /** * 黄赌毒数据 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 5f9048f..37ff2f4 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/VideoSuperviseController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/VideoSuperviseController.java @@ -86,7 +86,7 @@ public class VideoSuperviseController { */ @Operation(summary = "视频督察大屏地图数据") @GetMapping("/getVideoSuperviseMap") - @Cacheable(cacheNames = "videoSuperviseMap", key = "'p_'+ #endTime") + @Cacheable(cacheNames = "Supervision:Screen:VideoSuperviseMap", key = "#beginTime.getTime()+'_'+#endTime.getTime()") public Result getVideoSuperviseMap(@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/subdatav/SubOneCaseVerifController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneCaseVerifController.java index 16a8ef1..5f65c42 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneCaseVerifController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneCaseVerifController.java @@ -106,15 +106,15 @@ public class SubOneCaseVerifController { * @param endTime 结束时间 * @return Result */ -// @GetMapping("/getCaseVerificationMap") -// @Cacheable(cacheNames = "CaseVerificationMap", key = "'p_'+ #endTime") -// public Result getCaseVerificationMap(@RequestParam Integer departId, -// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, -// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { -// List caseVerificationMapList = negativeMapper.getCaseVerificationMap(beginTime, endTime); -// JSONObject res = new JSONObject().fluentPut("caseVerificationMapList", caseVerificationMapList); -// return Result.success(res); -// } + @GetMapping("/getSubOneCaseVerificationMap") + @Cacheable(cacheNames = "Supervision:Screen:SubOneCaseVerificationMap", key = "#departId+'_'+#beginTime.getTime() + '_' +#endTime.getTime()") + public Result getSubOneCaseVerificationMap(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + List caseVerificationMapList = negativeMapper.getSubOneCaseVerificationMap(beginTime, endTime, departId); + JSONObject res = new JSONObject().fluentPut("caseVerificationMapList", caseVerificationMapList); + return Result.success(res); + } /** * 查处问题趋势 @@ -128,7 +128,6 @@ public class SubOneCaseVerifController { List proTrendList = negativeMapper.getSubOneTrend(departId,String.valueOf(year) , A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); JSONObject data = new JSONObject().fluentPut("proTrendList", proTrendList); return Result.success(data); -// return null; } // endregion diff --git a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneGlobalController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneGlobalController.java index 972b8ad..f9045a1 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneGlobalController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneGlobalController.java @@ -129,18 +129,17 @@ public class SubOneGlobalController { * @param endTime 结束时间 * @return Result */ -// @Operation(summary = "首页大屏地图数据") -// @GetMapping("/getSubOneMap") -// // todo: 缓存取时间会出现多级目录 -// @Cacheable(cacheNames = "subOneGlobalMap", key = " #beginTime.toString().substring(0, 10) + '_' + #endTime.toString().substring(0, 10)") -// public Result subOneGlobalMap(@RequestParam Integer departId, -// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, -// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { -// // 地图数据 -// List GlobalTempMapVoList = negativeMapper.getMapIcon(beginTime, endTime); -// JSONObject data = new JSONObject().fluentPut("globalTempMapVoList", GlobalTempMapVoList); -// return Result.success(data); -// } + @Operation(summary = "首页大屏地图数据") + @GetMapping("/getSubOneGlobalMap") + @Cacheable(cacheNames = "Supervision:Screen:SubOneGlobalMap", key = "#departId+'_'+#beginTime.getTime()+'_'+#endTime.getTime()") + public Result getSubOneMap(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + // 地图数据 + List GlobalTempMapVoList = negativeMapper.getSubOneGlobalMap(beginTime, endTime,departId); + JSONObject data = new JSONObject().fluentPut("globalTempMapVoList", GlobalTempMapVoList); + return Result.success(data); + } /** diff --git a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneMailViewController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneMailViewController.java index 49c0cc7..06c0cc8 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneMailViewController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneMailViewController.java @@ -109,12 +109,13 @@ public class SubOneMailViewController { * @return Result */ @Operation(summary = "信访数据中央地图小图标数据") - @GetMapping("/getMailMapIcon") - @Cacheable(cacheNames = "MailMap", key = "'p_'+ #endTime") - public Result getMailMapIcon(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + @GetMapping("/getSubOneMailMapIcon") + @Cacheable(cacheNames = "Supervision:Screen:SubOneMailMap", key = "#departId+'_'+#beginTime.getTime() + '_' +#endTime.getTime()") + public Result getSubOneMailMapIcon(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { // 信访数据总数概览 - List mailMapIconList = dataMailService.getMailMapIcon(beginTime, endTime); + List mailMapIconList = dataMailService.getSubOneMailMapIcon(beginTime, endTime, departId); JSONObject data = new JSONObject().fluentPut("mailMapIconList", mailMapIconList); return Result.success(data); } @@ -128,7 +129,8 @@ public class SubOneMailViewController { */ @Operation(summary = "信访数据大屏信访趋势统计") @GetMapping("/getSubOneMailTrend") - public Result getSubOneMailTrend(@RequestParam Integer departId, @RequestParam Integer year) { + public Result getSubOneMailTrend(@RequestParam Integer departId, + @RequestParam Integer year) { List countryList = dataPetitionComplaintMapper.getSubOneMailTrend(year, 21, departId); List policeList = dataPetitionComplaintMapper.getSubOneMailTrend(year, 22, departId); List manageList = dataPetitionComplaintMapper.getSubOneMailTrend(year, 23, departId); diff --git a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java index 1de9a4d..bfead25 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java @@ -9,6 +9,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; @@ -97,6 +98,24 @@ public class SubOneSupervisionNotifyController { return Result.success(data); } + /** + * 地图小卡片 + * + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return List + */ + @GetMapping("/getSubOneSupervisionMap") + @Cacheable(cacheNames = "Supervision:Screen:SubOneSupervisionMap", key = "#departId+'_'+#beginTime.getTime() + '_' +#endTime.getTime()") + public Result getSubOneSupervisionMap(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + //地图数据 + List superviseTempMapVoList = negativeMapper.getSubOneSupervisionMapIcon(beginTime, endTime, departId); + JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList); + return Result.success(data); + } + /** * 获取现场督察问题趋势 @@ -107,7 +126,7 @@ public class SubOneSupervisionNotifyController { @GetMapping("/getSubOneSupervisionTrend") public Result getSubOneSupervisionTrend(@RequestParam Integer departId, @RequestParam String year) { - List supervisionTrend = negativeMapper.getSubOneTrend(departId.toString(), year, "13", "15"); + List supervisionTrend = negativeMapper.getSubOneTrend(departId.toString(), year, "13", "15"); JSONObject data = new JSONObject().fluentPut("supervisionTrend", supervisionTrend); return Result.success(data); } @@ -146,8 +165,8 @@ public class SubOneSupervisionNotifyController { // 枪支管理数据 @GetMapping("/getSubOneGunController") public Result getSubOneGunController(@RequestParam Integer departId, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { // 枪支管理总览 DayTimeSuperviseVo fxsjGunControllerOverview = negativeMapper.getSubOnePoliceYellowBetOverview(beginTime, endTime, departId, 2); DayTimeSuperviseVo jsdwGunControllerOverview = negativeMapper.getSubOneTeamYellowBetOverview(beginTime, endTime, departId, 2); @@ -166,8 +185,8 @@ public class SubOneSupervisionNotifyController { // 涉企问题数据 @GetMapping("/getSubOneCompanyProblem") public Result getSubOneCompanyProblem(@RequestParam Integer departId, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { // 涉企问题总览 DayTimeSuperviseVo fxsjCompanyProblemOverview = negativeMapper.getSubOnePoliceYellowBetOverview(beginTime, endTime, departId, 3); DayTimeSuperviseVo jsdwCompanyProblemOverview = negativeMapper.getSubOneTeamYellowBetOverview(beginTime, endTime, departId, 3); @@ -186,8 +205,8 @@ public class SubOneSupervisionNotifyController { // 执法办案数据 @GetMapping("/getSubOneHandleCase") public Result getSubOneHandleCase(@RequestParam Integer departId, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { // 执法办案总览 DayTimeSuperviseVo fxsjHandleCaseOverview = negativeMapper.getSubOnePoliceYellowBetOverview(beginTime, endTime, departId, 4); DayTimeSuperviseVo jsdwHandleCaseOverview = negativeMapper.getSubOneTeamYellowBetOverview(beginTime, endTime, departId, 4); @@ -207,8 +226,8 @@ public class SubOneSupervisionNotifyController { // 工作日测酒数据 @GetMapping("/getSubOneCheckBeer") public Result getSubOneCheckBeer(@RequestParam Integer departId, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { // 工作日测酒总览 DayTimeSuperviseVo fxsjCheckBeerOverview = negativeMapper.getSubOnePoliceYellowBetOverview(beginTime, endTime, departId, 5); DayTimeSuperviseVo jsdwCheckBeerOverview = negativeMapper.getSubOneTeamYellowBetOverview(beginTime, endTime, departId, 5); diff --git a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneVideoSuperviseController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneVideoSuperviseController.java index bf55626..52fcbcd 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneVideoSuperviseController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneVideoSuperviseController.java @@ -1,22 +1,27 @@ package com.biutag.supervision.controller.subdatav; import com.alibaba.fastjson.JSONObject; +import com.biutag.supervision.mapper.NegativeMapper; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.vo.EchartsVo; import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo; import com.biutag.supervision.pojo.vo.VideoSuperviseCountVo; +import com.biutag.supervision.pojo.vo.VideoSuperviseMapIconVo; import com.biutag.supervision.service.SubOneVideoSuperviseService; 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; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Optional; import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.SPDC; @@ -32,7 +37,7 @@ import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.SPDC; public class SubOneVideoSuperviseController { private final SubOneVideoSuperviseService subOneVideoSuperviseService; - + private final NegativeMapper negativeMapper; // region 左边 @Operation(summary = "视频督察二级大屏问题数排名") @@ -70,6 +75,28 @@ public class SubOneVideoSuperviseController { } + /** + * 获取视频督察地图数据 + * + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return + */ + @Operation(summary = "视频督察大屏地图数据") + @GetMapping("/getSubOneVideoSuperviseMap") + @Cacheable(cacheNames = "Supervision:Screen:SubOneVideoSuperviseMap", key = "#departId+'_'+#beginTime.getTime() + '_' +#endTime.getTime()") + public Result getSubOneVideoSuperviseMap(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + + // 地图数据 + List videoSuperviseMapIconVoList = Optional.ofNullable(negativeMapper.getSubOneVideoSuperviseMapIconInfo(beginTime, endTime, departId)). + orElseGet(ArrayList::new); + JSONObject data = new JSONObject().fluentPut("videoSuperviseMapIconVoList", videoSuperviseMapIconVoList); + return Result.success(data); + } + + @Operation(summary = "视频督察二级数据大屏问题趋势统计") @GetMapping("/getSubOneVideoSuperviseTrend") public Result getSubOneVideoSuperviseTrend(@RequestParam Integer departId, @RequestParam Integer year) { diff --git a/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java b/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java index 3d82998..ec9995b 100644 --- a/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java +++ b/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java @@ -46,6 +46,11 @@ public interface DataPetition12337Mapper extends BaseMapper { "GROUP BY m.month_name " + "ORDER BY m.month ASC;") List getSubOneMailTrend12337(Integer year, Integer departId); + + @Select("select count(*) from data_petition_12337 " + + "where discover_time between #{beginTime} and #{endTime} " + + "and third_depart_id=#{departId}") + Integer select12337PoliceMailBySourceCode(Date beginTime, Date endTime, Integer departId); } diff --git a/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java b/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java index ca61566..a51f2af 100644 --- a/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java @@ -84,8 +84,7 @@ public interface DataPetitionComplaintMapper extends BaseMapper getTeamMassMailRank(Date beginTime, Date endTime, Integer departId); + + @Select("select count(*) " + + "from data_petition_complaint dpc " + + "where problem_sources_code=#{problemSourcesCode} " + + "and dpc.third_depart_id=#{departId} " + + "and discovery_time BETWEEN #{beginTime} AND #{endTime} ") + Integer selectPoliceMailBySourceCode(Date beginTime, Date endTime, String problemSourcesCode, String departId); } diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index a85f7ef..facc347 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -80,13 +80,14 @@ public interface NegativeMapper extends BaseMapper { "WHERE sd.statistics_group_id=3 " + "GROUP BY sd.short_name " + "ORDER BY totalPro DESC;") - List getMapIcon(Date beginTime, Date endTime); + List getGlobalMap(Date beginTime, Date endTime); List getGlobalRecentlyTrendByMonth(String year); /** * 首页大屏突出问题排名 + * * @param beginTime * @param endTime * @return @@ -118,7 +119,7 @@ public interface NegativeMapper extends BaseMapper { "WHERE problemSourcesCode IN (13) " + "AND sd.statistics_group_id=#{groupId} " + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime};") - DayTimeSuperviseVo getSuperversionRank(Date beginTime, Date endTime, Integer groupId); + DayTimeSuperviseVo getSupervisionRank(Date beginTime, Date endTime, Integer groupId); @Select("SELECT " + "sd.short_name AS label, " + @@ -133,7 +134,7 @@ public interface NegativeMapper extends BaseMapper { "AND sd.statistics_group_id=#{groupId} " + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + "GROUP BY sd.short_name " + - "ORDER BY rate") + "ORDER BY rate desc") List getChangedRateRank(Date beginTime, Date endTime, Integer groupId); @Select("SELECT npr.oneLevelContent as name, count(*) value FROM negative ng, negative_problem_relation npr " + @@ -408,6 +409,24 @@ public interface NegativeMapper extends BaseMapper { "FROM negative ng WHERE ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + "AND ng.second_involve_depart_id=#{departId} ") GlobalOverViewVo getSuoOneAllGlobalCount(Integer departId, Date beginTime, Date endTime); + @Select("SELECT " + + "csd.`name` AS `name`, " + + "csd.dept_name AS policeName, " + + "csd.dept_pid, " + + "csd.dept_id AS departId, " + + "COUNT( DISTINCT ng.id ) AS totalPro, " + + "SUM( IF(problemSourcesCode IN (13,15,16), 1, 0) ) AS supervisePro, " + + "SUM( IF(problemSourcesCode IN (17,18,19,20), 1, 0) ) AS caseVerifyPro, " + + "SUM( IF(problemSourcesCode IN (21,22,23,24,25),1, 0) ) AS mailPro, " + + "SUM( IF(problemSourcesCode IN (2),1, 0) ) AS policePro, " + + "SUM( IF(problemSourcesCode IN (27,28,29,30),1, 0) ) AS reviewPro " + + "FROM county_street_dept csd " + + "LEFT JOIN negative ng ON ng.three_involve_depart_id=csd.dept_id " + + "AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "AND ng.second_involve_depart_id=#{departId} " + + "GROUP BY csd.dept_name " + + "HAVING csd.dept_pid=#{departId} ") + List getSubOneGlobalMap(Date beginTime, Date endTime, Integer departId); @Select("SELECT " + @@ -487,7 +506,7 @@ public interface NegativeMapper extends BaseMapper { "FROM negative ng " + "LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " + "WHERE ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + - "AND ng.problemSourcesCode IN (13,15,16)\n" + + "AND ng.problemSourcesCode IN (13,15,16)" + "AND ng.second_involve_depart_id = #{departPId} " + "AND sd.statistics_group_id!=10 " + "GROUP BY ng.involveDepartName " + @@ -513,7 +532,7 @@ public interface NegativeMapper extends BaseMapper { "FROM negative ng " + "LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " + "WHERE ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + - "AND ng.problemSourcesCode IN (17,18,19,20)\n" + + "AND ng.problemSourcesCode IN (17,18,19,20)" + "AND ng.second_involve_depart_id = #{departPId} " + "AND sd.statistics_group_id=10") SubOneOverViewVo getGlobalPoliceCaseVerifyOverView(Integer departPId, Date beginTime, Date endTime); @@ -525,7 +544,7 @@ public interface NegativeMapper extends BaseMapper { "FROM negative ng " + "LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " + "WHERE ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + - "AND ng.problemSourcesCode IN (17,18,19,20)\n" + + "AND ng.problemSourcesCode IN (17,18,19,20)" + "AND ng.second_involve_depart_id = #{departPId} " + "AND sd.statistics_group_id!=10") SubOneOverViewVo getGlobalTeamCaseVerifyOverView(Integer departPId, Date beginTime, Date endTime); @@ -824,7 +843,7 @@ public interface NegativeMapper extends BaseMapper { "FROM negative ng " + "LEFT JOIN sup_depart sd ON ng.involveDepartId = sd.id " + "WHERE ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + - "AND ng.problemSourcesCode IN (17, 18, 19, 20)\n" + + "AND ng.problemSourcesCode IN (17, 18, 19, 20)" + "AND ng.second_involve_depart_id=#{departId} " + "AND sd.statistics_group_id=10 " + "GROUP BY ng.involveDepartName " + @@ -837,7 +856,7 @@ public interface NegativeMapper extends BaseMapper { "FROM negative ng " + "LEFT JOIN sup_depart sd ON ng.involveDepartId = sd.id " + "WHERE ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + - "AND ng.problemSourcesCode IN (17, 18, 19, 20)\n" + + "AND ng.problemSourcesCode IN (17, 18, 19, 20)" + "AND ng.second_involve_depart_id=#{departId} " + "AND sd.statistics_group_id!=10 " + "GROUP BY ng.involveDepartName " + @@ -870,6 +889,28 @@ public interface NegativeMapper extends BaseMapper { "AND ng.problemSourcesCode in (17, 18, 19, 20); ") CaseVerificationCountVo getSuboOneAllCaseVerificationCount(Date beginTime, Date endTime, Integer departId); + @Select("SELECT " + + "csd.`name` AS `name`, " + + "csd.dept_name AS policeName, " + + "csd.dept_pid, " + + "csd.dept_id AS departId, " + + "COUNT( DISTINCT ng.id ) AS total, " + + "COUNT( DISTINCT IF( ng.checkStatus<>3, ng.id, NULL ) ) AS confirmed, " + + "COUNT( DISTINCT IF( nb.handleResultCode!=14, nb.blameId, NULL ) ) AS dealCasePro, " + + "COUNT( DISTINCT nb.blameIdCode ) AS punishPre, " + + "COUNT( DISTINCT nb.blameDepartId ) AS punishOrg, " + + "IFNULL( ROUND( COUNT( DISTINCT IF( ng.isRectifyCode=1, ng.id, NULL ) )/COUNT( DISTINCT ng.id )*100, 1 ), 0) AS rate " + + "FROM county_street_dept csd " + + "LEFT JOIN negative ng ON ng.three_involve_depart_id=csd.dept_id " + + "AND ng.problemSourcesCode IN (17,18,19,20) " + + "AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "AND ng.second_involve_depart_id=#{departId} " + + "LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + + "GROUP BY csd.dept_name " + + "HAVING csd.dept_pid=#{departId} ") + List getSubOneCaseVerificationMap(Date beginTime, Date endTime, Integer departId); + + @Select("SELECT sdps.label AS `name` , " + "COUNT( DISTINCT ng.id ) AS `value` " + "FROM negative ng " + @@ -903,6 +944,7 @@ public interface NegativeMapper extends BaseMapper { /** * 首页大屏问题类型占比 + * * @param beginTime * @param endTime * @return @@ -910,7 +952,7 @@ public interface NegativeMapper extends BaseMapper { @Select("SELECT " + "npr.oneLevelContent as name, " + "count(*) `value` FROM negative_problem_relation npr " + - "LEFT JOIN negative ng ON ng.id=npr.negativeId\n" + + "LEFT JOIN negative ng ON ng.id=npr.negativeId " + "WHERE checkStatus in (1, 2) " + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + "AND npr.oneLevelContent is not NULL " + @@ -918,6 +960,51 @@ public interface NegativeMapper extends BaseMapper { "ORDER BY `value` desc") List selectProblemRate(Date beginTime, Date endTime); + @Select("SELECT " + + "csd.`name` AS `name`, " + + "csd.dept_name AS policeName, " + + "csd.dept_pid, " + + "csd.dept_id AS departId, " + + "COUNT( DISTINCT ng.id ) AS discoverProblem, " + + "COUNT(DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL)) AS changedProblem, " + + "COUNT(DISTINCT ng.involveDepartId) AS relativeOrg, " + + "COUNT( DISTINCT nb.blameName ) AS relativePer, " + + "IFNULL( ROUND( ( COUNT(DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL)) / COUNT( DISTINCT ng.id ) ) * 100, 1 ), 0) AS changedRate " + + "FROM county_street_dept csd " + + "LEFT JOIN negative ng ON ng.three_involve_depart_id=csd.dept_id " + + "LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " + + "AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "AND ng.checkStatus IN (1,2) " + + "AND ng.problemSourcesCode=16 " + + "AND ng.second_involve_depart_id=#{departId} " + + "GROUP BY csd.dept_name " + + "HAVING csd.dept_pid=#{departId} ") + List getSubOneVideoSuperviseMapIconInfo(Date beginTime, Date endTime, Integer departId); + + + @Select("SELECT " + + "csd.`name` AS `name`, " + + "csd.dept_name AS policeName, " + + "csd.dept_pid, " + + "csd.dept_id AS departId, " + + "COUNT( DISTINCT ng.id ) AS totalPro, " + + "COUNT( DISTINCT IF(ng.problemSourcesCode=13, ng.id, NULL) ) AS xc, " + + "COUNT( DISTINCT IF(ng.problemSourcesCode=15, ng.id, NULL) ) AS zx, " + + "COUNT( DISTINCT IF(ng.isRectifyCode=0, ng.id, NULL) ) AS changing, " + + "COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) ) AS changed , " + + "COUNT( DISTINCT ng.involveDepartId ) AS relationOrg, " + + "COUNT( DISTINCT nb.blameIdCode ) AS personNum, " + + "IFNULL( ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS changedRate " + + "FROM county_street_dept csd " + + "LEFT JOIN negative ng ON ng.three_involve_depart_id=csd.dept_id " + + "AND ng.problemSourcesCode IN (13, 15) " + + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "AND ng.second_involve_depart_id=#{departId} " + + "LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + + "GROUP BY csd.dept_name " + + "HAVING csd.dept_pid=#{departId} ") + List getSubOneSupervisionMapIcon(Date beginTime, Date endTime, Integer departId); + // endregion diff --git a/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java index 258aa1c..0cb85f6 100644 --- a/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java @@ -39,4 +39,16 @@ public interface SupDepartMapper extends BaseMapper { */ @Select("select * from sup_depart where statistics_group_id = #{groupType} ") List selectDepartsByGroupType(Integer groupType); + + /** + * 按pid查询派出所还有它的街道 在街道表里面找的 + * @param departId 所属的单位 Pid + * @return + */ + @Select("SELECT " + + "dept_id AS id, " + + "name AS shortName " + + "FROM county_street_dept WHERE dept_pid=#{departId}") + List selectPoliceDeparts(Integer departId); + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/vo/MailMapIconVo.java b/src/main/java/com/biutag/supervision/pojo/vo/MailMapIconVo.java index 8b3b9d5..c8508f5 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/MailMapIconVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/MailMapIconVo.java @@ -11,8 +11,8 @@ import java.io.Serializable; */ @Data public class MailMapIconVo implements Serializable { - private String name; // 分县市局名字 - private String departId; // 分县市局id + private String name; // 名字 + private String departId; // id private String total; private String countryTotal; diff --git a/src/main/java/com/biutag/supervision/service/DataMailService.java b/src/main/java/com/biutag/supervision/service/DataMailService.java index f8eedd6..84140a0 100644 --- a/src/main/java/com/biutag/supervision/service/DataMailService.java +++ b/src/main/java/com/biutag/supervision/service/DataMailService.java @@ -141,33 +141,36 @@ public class DataMailService extends ServiceImpl countryQueryWrapper = new QueryWrapper<>(); -// countryQueryWrapper.eq("problem_sources_code", 21); -// countryQueryWrapper.between("discovery_time", beginTime, endTime); -// Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper); -// System.out.println("国家信访数量:" + countryMail); -// // 公安部信访 -// QueryWrapper policeQueryWrapper = new QueryWrapper<>(); -// policeQueryWrapper.eq("problem_sources_code", 22); -// policeQueryWrapper.between("discovery_time", beginTime, endTime); -// Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); -// System.out.println("公安部信访数量:" + policeMail); - // 12337信访 +// MailOverviewVo temp = dataPetitionComplaintMapper.selectMailOverviewVo(beginTime, endTime); + MailOverviewVo temp = new MailOverviewVo(); + QueryWrapper countryQueryWrapper = new QueryWrapper<>(); + countryQueryWrapper.eq("problem_sources_code", 21); + countryQueryWrapper.between("discovery_time", beginTime, endTime); + Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper); // 国家信访 + System.out.println("国家信访数量:" + countryMail); + + QueryWrapper policeQueryWrapper = new QueryWrapper<>(); + policeQueryWrapper.eq("problem_sources_code", 22); + policeQueryWrapper.between("discovery_time", beginTime, endTime); + Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); // 公安部信访 + System.out.println("公安部信访数量:" + policeMail); + QueryWrapper queryWrapper12337 = new QueryWrapper<>(); + queryWrapper12337.between("discover_time", beginTime, endTime); Long numberMail = dataPetition12337Mapper.selectCount(queryWrapper12337); temp.setNumberMail(numberMail); System.out.println("12337信访数量:" + numberMail); - Long manageMail = 5812L; + Long manageMail = 5812L; // 12337信访 // 总数 - temp.setTotalMail(temp.getCountryMail() + temp.getPoliceMail() + numberMail ); + Long totalMail = countryMail + policeMail + numberMail; + temp.setCountryMail(countryMail); + temp.setPoliceMail(policeMail); + temp.setNumberMail(numberMail); + temp.setTotalMail(totalMail); temp.setManageMail(manageMail); return temp; } - - public List getMailMapIcon(Date beginTime, Date endTime) { List res = new ArrayList<>(); // 查询所有区县局 @@ -197,18 +200,65 @@ public class DataMailService extends ServiceImpl countryQueryWrapper = new QueryWrapper<>(); + countryQueryWrapper.eq("problem_sources_code", 21); + countryQueryWrapper.eq("second_depart_id", departId); + countryQueryWrapper.between("discovery_time", beginTime, endTime); + Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper); // 国家信访 + + QueryWrapper policeQueryWrapper = new QueryWrapper<>(); + policeQueryWrapper.eq("problem_sources_code", 22); + policeQueryWrapper.eq("second_depart_id", departId); + policeQueryWrapper.between("discovery_time", beginTime, endTime); + Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); // 公安部信访 + System.out.println("公安部信访数量:" + policeMail); + // 12337信访 QueryWrapper queryWrapper12337 = new QueryWrapper<>(); queryWrapper12337.eq("second_depart_id", departId); + queryWrapper12337.between("discover_time", beginTime, endTime); Long numberMail = dataPetition12337Mapper.selectCount(queryWrapper12337); temp.setNumberMail(numberMail); System.out.println("12337信访数量:" + numberMail); Long manageMail = 0L; // 总数 - temp.setTotalMail(temp.getCountryMail() + temp.getPoliceMail() + numberMail ); + Long totalMail = countryMail + policeMail + numberMail; + temp.setCountryMail(countryMail); + temp.setPoliceMail(policeMail); + temp.setNumberMail(numberMail); + temp.setTotalMail(totalMail); temp.setManageMail(manageMail); return temp; } + + public List getSubOneMailMapIcon(Date beginTime, Date endTime, Integer departId) { + List res = new ArrayList<>(); + // 查该区县局下属所有派出所 + List policeDeparts = supDepartMapper.selectPoliceDeparts(departId); + for (SupDepart supDepart : policeDeparts) { + MailMapIconVo mapIconVo = new MailMapIconVo(); + mapIconVo.setName(supDepart.getShortName()); + mapIconVo.setDepartId(supDepart.getId()); + res.add(mapIconVo); + } + // 查询国家信访和公安部信访数据 + for (MailMapIconVo re : res) { + String policeDepartId = re.getDepartId(); + Integer countryTotal = dataPetitionComplaintMapper.selectPoliceMailBySourceCode(beginTime, endTime, GJXFPT.getValue(), policeDepartId); + Integer policeTotal = dataPetitionComplaintMapper.selectPoliceMailBySourceCode(beginTime, endTime, GABXF.getValue(), policeDepartId); + Integer commissionerTotal = 0; // 局长信箱 + // 查询12337 数据 + Integer numTotal = dataPetition12337Mapper.select12337PoliceMailBySourceCode(beginTime, endTime, departId); + Integer total = countryTotal + policeTotal + commissionerTotal + numTotal; + re.setCountryTotal(countryTotal.toString()); + re.setPoliceTotal(policeTotal.toString()); + re.setCommissionerTotal(commissionerTotal.toString()); + re.setNumTotal(numTotal.toString()); + re.setTotal(total.toString()); + } + return res; + } } diff --git a/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java b/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java index c14c8ac..cbb6a63 100644 --- a/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java @@ -42,14 +42,7 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl getChangedRateRank(Integer groupType, Date beginTime, Date endTime) { diff --git a/src/test/java/com/biutag/supervision/service/DataMailServiceTest.java b/src/test/java/com/biutag/supervision/service/DataMailServiceTest.java index 078fb0b..c8d4b9c 100644 --- a/src/test/java/com/biutag/supervision/service/DataMailServiceTest.java +++ b/src/test/java/com/biutag/supervision/service/DataMailServiceTest.java @@ -1,6 +1,7 @@ package com.biutag.supervision.service; import com.biutag.supervision.pojo.vo.MailMapIconVo; +import com.biutag.supervision.pojo.vo.MailOverviewVo; import jakarta.annotation.Resource; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @@ -28,6 +29,15 @@ class DataMailServiceTest { for (MailMapIconVo mailMapIconVo : mailMapIcon) { System.out.println(mailMapIconVo.toString()); } + } + + @Test + void getMailCount() throws ParseException { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + Date begin = formatter.parse("2024-01-01"); + Date end = formatter.parse("2024-12-29"); + MailOverviewVo subOneAllMailCount = dataMailService.getSubOneAllMailCount(begin, end, 3337); + System.out.println(subOneAllMailCount.toString()); } } \ No newline at end of file