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 0b7b417..f931579 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataGlobalController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataGlobalController.java @@ -10,6 +10,7 @@ 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.apache.ibatis.annotations.Select; import org.springframework.cache.annotation.Cacheable; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.web.bind.annotation.GetMapping; @@ -37,6 +38,7 @@ public class DataGlobalController { private final DataGlobalService dataGlobalService; private final NegativeMapper negativeMapper; private final NegativeProblemRelationMapper negativeProblemRelationMapper; + //region 左边 /** @@ -51,7 +53,7 @@ public class DataGlobalController { public Result getOrganizationRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { List fxsjlist = negativeMapper.selectOrganizeProblemRank(3, beginTime, endTime); - List jsdwlist = negativeMapper.selectOrganizeProblemRank(3, beginTime, endTime); + List jsdwlist = negativeMapper.selectOrganizeProblemRank(4, beginTime, endTime); JSONObject res = new JSONObject() .fluentPut("fxsjlist", fxsjlist) .fluentPut("jsdwlist", jsdwlist); @@ -147,7 +149,10 @@ public class DataGlobalController { public Result getStrongProblemRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { // 突出问题排名 - List tcwtlist = dataGlobalService.getStrongProblemRank(beginTime, endTime); + List tcwtlist = negativeMapper.selectStrongProblemRank(beginTime, endTime); + for (int i = 1; i <= tcwtlist.size(); i++) { + tcwtlist.get(i - 1).setSort(i); + } JSONObject res = new JSONObject().fluentPut("tcwtlist", tcwtlist); return Result.success(res); } @@ -165,7 +170,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 = negativeProblemRelationMapper.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 f406826..ad1351d 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java @@ -59,17 +59,19 @@ public class DataMailViewController { public Result getFirstAndRepeatMail(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { // 初访重访情况总览 - MailFirstAndRepeatOverviewVo firstAndRepeatOverview = dataPetitionComplaintMapper.getFirstAndRepeatOverview(beginTime, endTime); + MailFirstAndRepeatOverviewVo fxjsFirstAndRepeatOverview = dataPetitionComplaintMapper.getFirstAndRepeatOverview(beginTime, endTime, 3); + MailFirstAndRepeatOverviewVo bwzdFirstAndRepeatOverview = dataPetitionComplaintMapper.getFirstAndRepeatOverview(beginTime, endTime, 4); // 初访重访分类数据排行 - List fxsjFirstRankList = dataPetitionComplaintMapper.getMailRank(beginTime, endTime, 3, RepeatEnum.FIRST_MAIL.getId()); - List fxsjRepeatRankList = dataPetitionComplaintMapper.getMailRank(beginTime, endTime, 3, RepeatEnum.REPEAT_MAIL.getId()); + List fxsjFirstRankList = dataPetitionComplaintMapper.getMailRank(beginTime, endTime, 3, RepeatEnum.FIRST_MAIL.getId()); // 1 + List fxsjRepeatRankList = dataPetitionComplaintMapper.getMailRank(beginTime, endTime, 3, RepeatEnum.REPEAT_MAIL.getId()); // 2 List fxsjLeaderViewRankList = dataPetitionComplaintMapper.getMailLeaderRank(beginTime, endTime, 3); List bwzdFirstRankList = dataPetitionComplaintMapper.getMailRank(beginTime, endTime, 4, RepeatEnum.FIRST_MAIL.getId()); List bwzdRepeatRankList = dataPetitionComplaintMapper.getMailRank(beginTime, endTime, 4, RepeatEnum.REPEAT_MAIL.getId()); List bwzdLeaderViewRankList = dataPetitionComplaintMapper.getMailLeaderRank(beginTime, endTime, 4); JSONObject data = new JSONObject() - .fluentPut("firstAndRepeatOverview", firstAndRepeatOverview) + .fluentPut("fxjsFirstAndRepeatOverview", fxjsFirstAndRepeatOverview) + .fluentPut("bwzdFirstAndRepeatOverview", bwzdFirstAndRepeatOverview) .fluentPut("fxsjFirstRankList", fxsjFirstRankList) .fluentPut("fxsjRepeatRankList", fxsjRepeatRankList) .fluentPut("fxsjLeaderViewRankList", fxsjLeaderViewRankList) @@ -95,7 +97,7 @@ public class DataMailViewController { public Result getAllMailCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { // 信访数据总数概览 - JSONObject overview = dataMailService.allMailCount(beginTime, endTime); + MailOverviewVo overview = dataMailService.allMailCount(beginTime, endTime); System.out.println("信访总览================================"); System.out.println(overview); // MailOverviewVo overview = dataMailService.getAllMailCount(beginTime, endTime); @@ -132,10 +134,10 @@ public class DataMailViewController { @Operation(summary = "信访数据大屏信访趋势统计") @GetMapping("/getMailTrend") public Result getMailTrend(@RequestParam Integer year) { - List countryList = negativeMapper.getMailTrend(year, 21); - List policeList = negativeMapper.getMailTrend(year, 22); - List manageList = negativeMapper.getMailTrend(year, 23); - List numberList = dataPetition12337Mapper.getMailTrend12337(year); + List countryList = negativeMapper.getMailTrend(year, 21); + List policeList = negativeMapper.getMailTrend(year, 22); + List manageList = negativeMapper.getMailTrend(year, 23); + List numberList = dataPetition12337Mapper.getMailTrend12337(year); JSONObject data = new JSONObject().fluentPut("countryList", countryList) .fluentPut("policeList", policeList) .fluentPut("manageList", manageList) @@ -157,19 +159,21 @@ public class DataMailViewController { @GetMapping("/getEntanglementAndMassMail") public Result getEntanglementAndMassMail(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - // 缠访集访情况 - MailEntanglementMassOverviewVo mailEntanglementMassOverview = dataMailService.getEntanglementAndMassOverview(beginTime, endTime); + // 缠访集访情况总览 + MailEntanglementMassOverviewVo fxsjMailEntanglementMassOverview = dataPetitionComplaintMapper.getEntanglementAndMassOverview(beginTime, endTime, 3); + MailEntanglementMassOverviewVo bwzdMailEntanglementMassOverview = dataPetitionComplaintMapper.getEntanglementAndMassOverview(beginTime, endTime, 4); - List fxsjLeaderReviewList=dataPetitionComplaintMapper.getMailLeaderRank(beginTime, endTime, 3); - List fxsjEntanglementList=dataPetitionComplaintMapper.getEntanglementMailRank(beginTime, endTime, 3); - List fxsjMassList=dataPetitionComplaintMapper.getMassMailRank(beginTime, endTime, 3); + List fxsjLeaderReviewList = dataPetitionComplaintMapper.getMailLeaderRank(beginTime, endTime, 3); + List fxsjEntanglementList = dataPetitionComplaintMapper.getEntanglementMailRank(beginTime, endTime, 3); + List fxsjMassList = dataPetitionComplaintMapper.getMassMailRank(beginTime, endTime, 3); List bwzdLeaderReviewList = dataPetitionComplaintMapper.getMailLeaderRank(beginTime, endTime, 4); - List bwzdEntanglementList =dataPetitionComplaintMapper.getEntanglementMailRank(beginTime, endTime, 4); - List bwzdMassList =dataPetitionComplaintMapper.getMassMailRank(beginTime, endTime, 4); + List bwzdEntanglementList = dataPetitionComplaintMapper.getEntanglementMailRank(beginTime, endTime, 4); + List bwzdMassList = dataPetitionComplaintMapper.getMassMailRank(beginTime, endTime, 4); JSONObject data = new JSONObject() - .fluentPut("mailEntanglementMassOverview", mailEntanglementMassOverview) + .fluentPut("fxsjMailEntanglementMassOverview", fxsjMailEntanglementMassOverview) + .fluentPut("bwzdMailEntanglementMassOverview", bwzdMailEntanglementMassOverview) .fluentPut("fxsjLeaderReviewList", fxsjLeaderReviewList) .fluentPut("fxsjEntanglementList", fxsjEntanglementList) .fluentPut("fxsjMassList", fxsjMassList) @@ -178,6 +182,6 @@ public class DataMailViewController { .fluentPut("bwzdMassList", bwzdMassList); return Result.success(data); } - + // endregion } 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 3474d2f..153b547 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java @@ -1,6 +1,7 @@ package com.biutag.supervision.controller.datav; import com.alibaba.fastjson.JSONObject; +import com.biutag.supervision.mapper.RpcApplyMapper; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.dto.common.PieItem; import com.biutag.supervision.pojo.entity.CountyStreetDept; @@ -8,6 +9,7 @@ import com.biutag.supervision.pojo.model.DataRightsComfortModel; import com.biutag.supervision.pojo.vo.ComfortCountVO; import com.biutag.supervision.pojo.vo.EchartsVo; import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo; +import com.biutag.supervision.pojo.vo.RightsComfortMapVo; import com.biutag.supervision.service.CountyStreetDeptService; import com.biutag.supervision.service.DataRightsComfortService; import com.biutag.supervision.service.RpcApplyService; @@ -32,11 +34,9 @@ import java.util.*; @RestController public class DatavRightsComfortController { - private final RpcApplyService rpcApplyService; private final DataRightsComfortService dataRightsComfortService; - private final RpcInfringerResultService rpcInfringerResultService; - + private final RpcApplyMapper rpcApplyMapper; @GetMapping public Result rightsComfort(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @@ -73,8 +73,8 @@ public class DatavRightsComfortController { @GetMapping("/getRightsAndComfortRank") public Result getRightsAndComfortRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - List fxsjRightsRankList = dataRightsComfortService.getRightsRank(beginTime, endTime, 3); // 分县市局维权排名 - List jsdwRightsRankList = dataRightsComfortService.getRightsRank(beginTime, endTime, 4); // 分县市局维权排名 + List fxsjRightsRankList = rpcApplyMapper.getRightsRank(beginTime, endTime, 3);; // 分县市局维权排名 + List jsdwRightsRankList = rpcApplyMapper.getRightsRank(beginTime, endTime, 4);; // 分县市局维权排名 JSONObject data = new JSONObject() .fluentPut("fxsjRightsRankList", fxsjRightsRankList) .fluentPut("jsdwRightsRankList", jsdwRightsRankList); @@ -109,6 +109,17 @@ public class DatavRightsComfortController { return Result.success(data); } + + // 地图图标数据 + @GetMapping("/getComfortMapIcon") + 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); + JSONObject jsonObject = new JSONObject(); + jsonObject.fluentPut("comfortMapVoList", comfortMapVoList); + return Result.success(jsonObject); + } + // 打处情况 @GetMapping("/getPunishmentSituation") public Result getPunishmentSituation(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @@ -122,20 +133,23 @@ public class DatavRightsComfortController { @GetMapping("/getComfortSituation") public Result getComfortSituation(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - List comfortSituationList = dataRightsComfortService.selectComfortSituation(beginTime, endTime); + List comfortSituationList = rpcApplyMapper.selectComfortSituation(beginTime, endTime); JSONObject data = new JSONObject().fluentPut("comfortSituationList", comfortSituationList); return Result.success(data); } -// endregion + // endregion // region 右边 -// 民辅警受伤人数情况和受伤类别 + // 民辅警受伤人数情况和受伤类别 @GetMapping("/getPoliceHurtSituationAndHurtType") public Result getPoliceHurtSituationAndHurtType(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - List policeHurtSituationList = dataRightsComfortService.getPoliceHurtSituation(beginTime, endTime); - JSONObject data = new JSONObject().fluentPut("policeHurtSituationList", policeHurtSituationList); + List policeHurtSituationList = rpcApplyMapper.getPoliceHurtSituation(beginTime, endTime); // 人数情况 + List policeHurtTypeList = rpcApplyMapper.getPoliceHurtType(beginTime, endTime); // 受伤类别 + JSONObject data = new JSONObject() + .fluentPut("policeHurtSituationList", policeHurtSituationList) + .fluentPut("policeHurtTypeList", policeHurtTypeList); return Result.success(data); } @@ -144,11 +158,11 @@ public class DatavRightsComfortController { public Result getCaseAriseSituationRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { // 发案环节 - List incidentLinkList = dataRightsComfortService.getIncidentLink(beginTime, endTime); + List incidentLinkList =rpcApplyMapper.getIncidentLink(beginTime, endTime); // 发案警种 List incidentPoliceTypeList = new ArrayList<>(); // 发案单位 - List incidentOrgList = dataRightsComfortService.getIncidentOrg(beginTime, endTime); + List incidentOrgList = rpcApplyMapper.getIncidentOrg(beginTime, endTime); JSONObject data = new JSONObject() .fluentPut("incidentLinkList", incidentLinkList) @@ -156,10 +170,6 @@ public class DatavRightsComfortController { .fluentPut("incidentOrgList", incidentOrgList); return Result.success(data); } - - - - -// endregion + // endregion } 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 513868c..16a8ef1 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneCaseVerifController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneCaseVerifController.java @@ -125,7 +125,7 @@ public class SubOneCaseVerifController { @GetMapping("/getSubOneCaseVerificationTrend") public Result getSubOneCaseVerificationTrend(@RequestParam String departId, @RequestParam Integer year) { - List proTrendList = negativeMapper.getSubOneCaseVerificationTrend(String.valueOf(year), departId, A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); + 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; 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 e9a9e85..972b8ad 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneGlobalController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneGlobalController.java @@ -2,11 +2,11 @@ package com.biutag.supervision.controller.subdatav; import com.alibaba.fastjson.JSONObject; import com.biutag.supervision.mapper.NegativeMapper; +import com.biutag.supervision.mapper.NegativeProblemRelationMapper; import com.biutag.supervision.pojo.Result; -import com.biutag.supervision.pojo.vo.EchartsVo; -import com.biutag.supervision.pojo.vo.RankVo; -import com.biutag.supervision.pojo.vo.SubOneOverViewVo; +import com.biutag.supervision.pojo.vo.*; import com.biutag.supervision.service.CountyStreetDeptService; +import com.biutag.supervision.service.DataGlobalService; import com.biutag.supervision.service.SubOneService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -35,122 +35,172 @@ import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*; @Slf4j public class SubOneGlobalController { - private final CountyStreetDeptService countyStreetDeptService; - private final SubOneService subOneService; private final NegativeMapper negativeMapper; + private final DataGlobalService dataGlobalService; + private final NegativeProblemRelationMapper negativeProblemRelationMapper; + private final CountyStreetDeptService countyStreetDeptService; - // region左边 - @Operation(summary = "获取首页二级大屏督察问题排名") - @GetMapping("/getSubOneSupervisionRank") - public Result getSubOneSupervisionRank(@RequestParam Integer departPId, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - SubOneOverViewVo supervisionPrecinctOverView = negativeMapper.getSubOneGlobalPoliceSupervisionRankOverView(departPId, beginTime, endTime); - SubOneOverViewVo supervisionTeamOverView = negativeMapper.getSubOneGlobalTeamSupervisionRankOverView(departPId, beginTime, endTime); - List supervisionPrecinctList = negativeMapper.getSubOneGlobalPrecinctSupervisionRank(departPId, beginTime, endTime); - List supervisionTeamList = negativeMapper.getSubOneGlobalTeamSupervisionRank(departPId, beginTime, endTime); - JSONObject jsonObject = new JSONObject(); - jsonObject.fluentPut("supervisionPrecinctOverView", supervisionPrecinctOverView) - .fluentPut("supervisionTeamOverView", supervisionTeamOverView) - .fluentPut("supervisionPrecinctList", supervisionPrecinctList) - .fluentPut("supervisionTeamList", supervisionTeamList); - return Result.success(jsonObject); + + /** + * 获取地图数据 + * + * @param departId 2级单位的id + * @return json格式的地图数据 + */ + @Operation(summary = "获取二级大屏地图JSON") + @GetMapping("/getSubOneStreetMap") + @Cacheable(cacheNames = "subOneStreetMap", key = "'p_'+ #departId") + public Result getSubOneStreetMap(@RequestParam Integer departId) { + JSONObject res = countyStreetDeptService.getSubOneStreetMap(departId); + return Result.success(res); } -// endregion + //region 左边 + + /** + * 机构问题排名 + * + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return Result + */ + @Operation(summary = "机构问题排名") + @GetMapping("/getSubOneOrganizationRank") + public Result getSubOneOrganizationRank(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + List fxsjlist = negativeMapper.selectPoliceOrganizeProblemRank(departId, beginTime, endTime); + List jsdwlist = negativeMapper.selectTeamOrganizeProblemRank(departId, beginTime, endTime); - // region 中间 + + JSONObject res = new JSONObject() + .fluentPut("fxsjlist", fxsjlist) + .fluentPut("jsdwlist", jsdwlist); + return Result.success(res); + } /** - * 获取首页二级大屏总览 + * 业务类型占比 * - * @param departPId 2级单位的id * @param beginTime 开始时间 * @param endTime 结束时间 - * @return + * @return Result */ - @Operation(summary = "获取首页二级大屏总览") - @GetMapping("/getSubOneOverView") - public Result getSubOneOverView(@RequestParam Integer departPId, + @Operation(summary = "业务类型占比") + @GetMapping("/getSubOneBusinessRate") + public Result getSubOneBusinessRate(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + // 业务类型占比 + List ywzblist = negativeMapper.selectSubOneBusinessRate(departId, beginTime, endTime); + JSONObject res = new JSONObject().fluentPut("ywzblist", ywzblist); + return Result.success(res); + } + //endregion + + + //region 中间 + + /** + * 获取首页大屏中央数据 + * + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return Result + */ + @Operation(summary = "大屏中央数据") + @GetMapping("/getSubOneAllCount") + public Result getSubOneAllCount(@RequestParam Integer departId, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - // todo 更新 - SubOneOverViewVo subOneOverViewVo = negativeMapper.getSubOneOverView(departPId, beginTime, endTime); -// SubOneOverViewVo subOneOverViewVo = subOneService.getSubOneOverView(departPId, beginTime, endTime); - JSONObject jsonObject = new JSONObject(); - jsonObject.fluentPut("subOneOverViewVo", subOneOverViewVo); - return Result.success(jsonObject); + // 获取数据大屏中央总数概览 + GlobalOverViewVo overview = negativeMapper.getSuoOneAllGlobalCount(departId, beginTime, endTime); + JSONObject data = new JSONObject().fluentPut("overview", overview); + return Result.success(data); } + /** + * 地图数据 + * + * @param beginTime 开始时间 + * @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); +// } + /** - * 获取问题趋势 + * 数据大屏问题趋势统计 * - * @param departPId 2级单位的id - * @param year 年份 - * @return EchartsVo的list + * @param year 年份 + * @return Result */ - @Operation(summary = "获取首页二级大屏问题趋势") - @GetMapping("/getSubOneTrend") - public Result getSubOneTrend(@RequestParam Integer departPId, @RequestParam Integer year) { - List superviseProTrend = negativeMapper.getSubOneTrend(departPId, year.toString(), XCDC.getValue(), ZXDC.getValue(), SPDC.getValue()); // 督察问题趋势 - List caseVerifyTrend = negativeMapper.getSubOneTrend(departPId, year.toString(), A12389.getValue(), SLDJB.getValue(), ZDDJB.getValue(), SJJB.getValue()); - List policeCommentTrend = new ArrayList<>(); - List mailTrend = negativeMapper.getSubOneTrend(departPId, year.toString(), 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); + @Operation(summary = "数据大屏问题趋势统计") + @GetMapping("/getSubOneGlobalTrend") + public Result getSubOneGlobalTrend(@RequestParam Integer departId, @RequestParam Integer year) { + List GlobalRecentlyTrendList= negativeMapper.getSubOneTrend(departId.toString(), year.toString(), "2", "13", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "27", "28", "29", "30"); + JSONObject jsonObject = new JSONObject().fluentPut("globalRecentlyTrendList", GlobalRecentlyTrendList); return Result.success(jsonObject); } + //endregion + + //region 右边 /** - * 获取地图数据 + * 突出问题排名 * - * @param departPId 2级单位的id - * @return json格式的地图数据 + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return Result */ - @Operation(summary = "获取二级大屏地图JSON") - @GetMapping("/getSubOneStreetMap") - @Cacheable(cacheNames = "subOneStreetMap", key = "'p_'+ #departPId") - public Result getSubOneStreetMap(@RequestParam Integer departPId) { - JSONObject res = countyStreetDeptService.getSubOneStreetMap(departPId); + @Operation(summary = "突出问题排名") + @GetMapping("/getSubOneStrongProblemRate") + public Result getSubOneStrongProblemRate(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + // 突出问题排名 + List tcwtlist = negativeMapper.selectSubOneStrongProblemRank(departId, beginTime, endTime); + for (int i = 1; i <= tcwtlist.size(); i++) { + tcwtlist.get(i - 1).setSort(i); + } + JSONObject res = new JSONObject().fluentPut("tcwtlist", tcwtlist); return Result.success(res); } -// endregion - // region右边 /** - * 获取首页二级大屏案件核查排名 + * 问题类型占比 * - * @param departPId 2级单位的id * @param beginTime 开始时间 * @param endTime 结束时间 - * @return 总览和排名 + * @return Result */ - @Operation(summary = "获取首页二级大屏案件核查排名") - @GetMapping("/getSubOneCaseVerifyRank") - public Result getSubOneCaseVerifyRank(@RequestParam Integer departPId, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - SubOneOverViewVo caseVerifyPrecinctOverView = negativeMapper.getGlobalPoliceCaseVerifyOverView(departPId, beginTime, endTime); - SubOneOverViewVo caseVerifyTeamOverView = negativeMapper.getGlobalTeamCaseVerifyOverView(departPId, beginTime, endTime); - List caseVerifyPrecinctList = negativeMapper.getGlobalPoliceCaseVerifyRank(departPId, beginTime, endTime); // 案件核查派出所排名 - List caseVerifyTeamList = negativeMapper.getGlobalTeamCaseVerifyRank(departPId, beginTime, endTime); // 案件核查大队排名 - JSONObject jsonObject = new JSONObject(); - jsonObject.fluentPut("caseVerifyPrecinctOverView", caseVerifyPrecinctOverView) - .fluentPut("caseVerifyTeamOverView", caseVerifyTeamOverView) - .fluentPut("caseVerifyPrecinctList", caseVerifyPrecinctList) - .fluentPut("caseVerifyTeamList", caseVerifyTeamList); - return Result.success(jsonObject); + @Operation(summary = "问题类型占比") + @GetMapping("/getSubOneProblemBusinessRate") + public Result getSubOneProblemBusinessRate(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + // 问题类型占比 + List wtlxlist = negativeMapper.selectSubOneProblemRate(departId, beginTime, endTime); + JSONObject res = new JSONObject().fluentPut("wtlxlist", wtlxlist); + return Result.success(res); } - // endregion + //endregion } 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 0b64daf..49c0cc7 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneMailViewController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneMailViewController.java @@ -1,13 +1,27 @@ package com.biutag.supervision.controller.subdatav; +import com.alibaba.fastjson.JSONObject; +import com.biutag.supervision.constants.enums.RepeatEnum; +import com.biutag.supervision.mapper.DataPetition12337Mapper; import com.biutag.supervision.mapper.DataPetitionComplaintMapper; +import com.biutag.supervision.mapper.NegativeMapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.vo.*; import com.biutag.supervision.service.DataMailService; +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; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.util.Date; +import java.util.List; + /** * @Auther: sh * @Date: 2024/12/20 11:45 @@ -20,14 +34,152 @@ import org.springframework.web.bind.annotation.RestController; @Slf4j public class SubOneMailViewController { + private final DataMailService dataMailService; private final DataPetitionComplaintMapper dataPetitionComplaintMapper; + private final DataPetition12337Mapper dataPetition12337Mapper; + private final NegativeMapper negativeMapper; // region 左边 + /** + * 初访重访情况 + * + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return Result + */ + @Operation(summary = "初访重访情况") + @GetMapping("/getSubOneFirstAndRepeatMail") + public Result getFirstAndRepeatMail(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + // 初访重访情况总览 + MailFirstAndRepeatOverviewVo fxjsFirstAndRepeatOverview = dataPetitionComplaintMapper.getSubOnePoliceFirstAndRepeatOverview(beginTime, endTime, departId); + MailFirstAndRepeatOverviewVo bwzdFirstAndRepeatOverview = dataPetitionComplaintMapper.getTeamFirstAndRepeatOverview(beginTime, endTime, departId); + // 初访重访分类数据排行 + List fxsjFirstRankList = dataPetitionComplaintMapper.getPoliceMailRank(beginTime, endTime, departId, 1); // 1 + List fxsjRepeatRankList = dataPetitionComplaintMapper.getPoliceMailRank(beginTime, endTime, departId, RepeatEnum.REPEAT_MAIL.getId()); // 2 + List fxsjLeaderViewRankList = dataPetitionComplaintMapper.getPoliceMailLeaderRank(beginTime, endTime, departId); + List bwzdFirstRankList = dataPetitionComplaintMapper.getTeamMailRank(beginTime, endTime, departId, RepeatEnum.FIRST_MAIL.getId()); + List bwzdRepeatRankList = dataPetitionComplaintMapper.getTeamMailRank(beginTime, endTime, departId, RepeatEnum.REPEAT_MAIL.getId()); + List bwzdLeaderViewRankList = dataPetitionComplaintMapper.getTeamMailLeaderRank(beginTime, endTime, 4); + JSONObject data = new JSONObject() + .fluentPut("fxjsFirstAndRepeatOverview", fxjsFirstAndRepeatOverview) + .fluentPut("bwzdFirstAndRepeatOverview", bwzdFirstAndRepeatOverview) + .fluentPut("fxsjFirstRankList", fxsjFirstRankList) + .fluentPut("fxsjRepeatRankList", fxsjRepeatRankList) + .fluentPut("fxsjLeaderViewRankList", fxsjLeaderViewRankList) + .fluentPut("bwzdFirstRankList", bwzdFirstRankList) + .fluentPut("bwzdRepeatRankList", bwzdRepeatRankList) + .fluentPut("bwzdLeaderViewRankList", bwzdLeaderViewRankList); + return Result.success(data); + } // endregion + // region 中间 + + /** + * 信访数据中央总览统计 + * + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return Result + */ + @Operation(summary = "信访数据大屏中央数据统计") + @GetMapping("/getSubOneAllMailCount") + public Result getSubOneAllMailCount(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + // 信访数据总数概览 + MailOverviewVo overview = dataMailService.getSubOneAllMailCount(beginTime, endTime, departId); + System.out.println("信访总览================================"); + System.out.println(overview); + JSONObject data = new JSONObject().fluentPut("overview", overview); + return Result.success(data); + } + + + /** + * 信访数据中央地图小图标数据 + * + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @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) { + // 信访数据总数概览 + List mailMapIconList = dataMailService.getMailMapIcon(beginTime, endTime); + JSONObject data = new JSONObject().fluentPut("mailMapIconList", mailMapIconList); + return Result.success(data); + } + + + /** + * 信访数据大屏信访趋势统计 + * + * @param year 年份 + * @return Result + */ + @Operation(summary = "信访数据大屏信访趋势统计") + @GetMapping("/getSubOneMailTrend") + 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); + List numberList = dataPetition12337Mapper.getSubOneMailTrend12337(year, departId); + JSONObject data = new JSONObject() + .fluentPut("countryList", countryList) + .fluentPut("policeList", policeList) + .fluentPut("manageList", manageList) + .fluentPut("numberList", numberList); + return Result.success(data); + } +// endregion + // region 右边 + + /** + * 缠访集访情况 + * + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return Result + */ + @Operation(summary = "缠访集访情况") + @GetMapping("/getSubOneEntanglementAndMassMail") + public Result getSubOneEntanglementAndMassMail(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + // 缠访集访情况总览 + MailEntanglementMassOverviewVo fxsjMailEntanglementMassOverview = dataPetitionComplaintMapper.getPoliceEntanglementAndMassOverview(beginTime, endTime, departId); + MailEntanglementMassOverviewVo bwzdMailEntanglementMassOverview = dataPetitionComplaintMapper.getTeamEntanglementAndMassOverview(beginTime, endTime, departId); + + List fxsjLeaderReviewList = dataPetitionComplaintMapper.getPoliceMailLeaderRank(beginTime, endTime, departId); + List fxsjEntanglementList = dataPetitionComplaintMapper.getPoliceEntanglementMailRank(beginTime, endTime, departId); + List fxsjMassList = dataPetitionComplaintMapper.getPoliceMassMailRank(beginTime, endTime, departId); + + List bwzdLeaderReviewList = dataPetitionComplaintMapper.getTeamMailLeaderRank(beginTime, endTime, departId); + List bwzdEntanglementList = dataPetitionComplaintMapper.getTeamEntanglementMailRank(beginTime, endTime, departId); + List bwzdMassList = dataPetitionComplaintMapper.getTeamMassMailRank(beginTime, endTime, departId); + + JSONObject data = new JSONObject() + .fluentPut("fxsjMailEntanglementMassOverview", fxsjMailEntanglementMassOverview) + .fluentPut("bwzdMailEntanglementMassOverview", bwzdMailEntanglementMassOverview) + .fluentPut("fxsjLeaderReviewList", fxsjLeaderReviewList) + .fluentPut("fxsjEntanglementList", fxsjEntanglementList) + .fluentPut("fxsjMassList", fxsjMassList) + .fluentPut("bwzdLeaderReviewList", bwzdLeaderReviewList) + .fluentPut("bwzdEntanglementList", bwzdEntanglementList) + .fluentPut("bwzdMassList", bwzdMassList); + return Result.success(data); + } + + // endregion } diff --git a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java new file mode 100644 index 0000000..9ef0a30 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java @@ -0,0 +1,94 @@ +package com.biutag.supervision.controller.subdatav; + +import com.alibaba.fastjson.JSONObject; +import com.biutag.supervision.mapper.RpcApplyMapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.vo.ComfortCountVO; +import com.biutag.supervision.pojo.vo.EchartsVo; +import com.biutag.supervision.service.DataRightsComfortService; +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; +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; + +/** + * @Auther: sh + * @Date: 2024/12/24 17:50 + * @Description: 二级维权抚慰 + */ +@Tag(name = "二级大屏维权抚慰") +@RequestMapping("datav/sub1/rightsComfort") +@RequiredArgsConstructor +@RestController +@Slf4j +public class SubOneRightsController { + + + private final DataRightsComfortService dataRightsComfortService; + private final RpcApplyMapper rpcApplyMapper; + + // 大屏中央总览数据 + @GetMapping("/getSubOneALlComfortCount") + public Result getALlComfortCount(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + Integer comfortTotal = rpcApplyMapper.countSubOneComfortPersonNumber(beginTime, endTime, departId); +// Integer comfortTotal = dataRightsComfortService.countComfortPersonNumber(beginTime, endTime); // 抚慰人数 + Integer hitTotal = dataRightsComfortService.countSubOneHitPersonNumber(beginTime, endTime, departId); // 打击处理人数 + Double comfortMoney = rpcApplyMapper.countSubOneComfortMoney(beginTime, endTime, departId); +// Double comfortMoney = dataRightsComfortService.countComfortMoney(beginTime, endTime); // 抚慰金额 + ComfortCountVO comfortOverview = new ComfortCountVO(); + comfortOverview.setComfortTotal(comfortTotal); + comfortOverview.setHitTotal(hitTotal); + comfortOverview.setComfortMoney(comfortMoney); + comfortOverview.setComfortCaseTotal(0); + comfortOverview.setHurtTotal(0); + JSONObject data = new JSONObject().fluentPut("comfortOverview", comfortOverview); + return Result.success(data); + } + + + // region 右边 + // 民辅警受伤人数情况和受伤类别 + @GetMapping("/getSubOnePoliceHurtSituationAndHurtType") + public Result getSubOnePoliceHurtSituationAndHurtType(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + List policeHurtSituationList = rpcApplyMapper.getSubOnePoliceHurtSituation(beginTime, endTime,departId); // 人数情况 + List policeHurtTypeList = rpcApplyMapper.getSubOnePoliceHurtType(beginTime, endTime,departId); // 受伤类别 + JSONObject data = new JSONObject() + .fluentPut("policeHurtSituationList", policeHurtSituationList) + .fluentPut("policeHurtTypeList", policeHurtTypeList); + return Result.success(data); + } + + // 发案情况占比 + @GetMapping("/getSubOneCaseAriseSituationRate") + public Result getSubOneCaseAriseSituationRate(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + // 发案环节 + List incidentLinkList = rpcApplyMapper.getSubOneIncidentLink(beginTime, endTime,departId); + // 发案警种 + List incidentPoliceTypeList = new ArrayList<>(); + // 发案单位 + List incidentOrgList = rpcApplyMapper.getSubOneIncidentOrg(beginTime, endTime,departId); + + JSONObject data = new JSONObject() + .fluentPut("incidentLinkList", incidentLinkList) + .fluentPut("incidentPoliceTypeList", incidentPoliceTypeList) + .fluentPut("incidentOrgList", incidentOrgList); + return Result.success(data); + } + // endregion + +} + 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 ecba568..1de9a4d 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java @@ -107,7 +107,7 @@ public class SubOneSupervisionNotifyController { @GetMapping("/getSubOneSupervisionTrend") public Result getSubOneSupervisionTrend(@RequestParam Integer departId, @RequestParam String year) { - List supervisionTrend = negativeMapper.getSubOneTrend(departId, year, "13", "15"); + List supervisionTrend = negativeMapper.getSubOneTrend(departId.toString(), year, "13", "15"); JSONObject data = new JSONObject().fluentPut("supervisionTrend", supervisionTrend); return Result.success(data); } diff --git a/src/main/java/com/biutag/supervision/mapper/CountyStreetDeptMapper.java b/src/main/java/com/biutag/supervision/mapper/CountyStreetDeptMapper.java index f6b617d..e5a331d 100644 --- a/src/main/java/com/biutag/supervision/mapper/CountyStreetDeptMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/CountyStreetDeptMapper.java @@ -24,8 +24,8 @@ public interface CountyStreetDeptMapper extends BaseMapper { List props(Integer id); - @Select("select * from county_street_dept where dept_pid = #{departPId}") - List getSubOneStreetMap(Integer departPId); + @Select("select * from county_street_dept where dept_pid = #{departId}") + List getSubOneStreetMap(Integer departId); } diff --git a/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java b/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java index d959b3d..3d82998 100644 --- a/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java +++ b/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java @@ -31,6 +31,21 @@ public interface DataPetition12337Mapper extends BaseMapper { "where discover_time between #{beginTime} and #{endTime} " + "and second_depart_id=#{departId}") Integer select12337MailBySourceCode(Date beginTime, Date endTime, String departId); + + + @Select("SELECT " + + "m.month_name AS `name`, " + + "IFNULL(COUNT(sd.pid=#{departId}), 0) AS `value` " + + "FROM sup_month_monthname m " + + "LEFT JOIN data_petition_12337 dpc " + + "ON DATE_FORMAT(dpc.discover_time, '%m') = m.month " + + "AND YEAR(dpc.discover_time) = #{year} " + + "LEFT JOIN sup_depart sd " + + "ON dpc.third_depart_id = sd.id " + + "AND sd.pid = #{departId} " + + "GROUP BY m.month_name " + + "ORDER BY m.month ASC;") + List getSubOneMailTrend12337(Integer year, 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 a598456..ca61566 100644 --- a/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java @@ -36,51 +36,6 @@ public interface DataPetitionComplaintMapper extends BaseMapper selectDepartStatistic(Integer departId, Integer Repeat, Date beginTime, Date endTime); - /** - * 查询领导阅信接访 - * - * @param departId - * @param beginTime - * @param endTime - * @return - */ - @Select("SELECT sd.id, sd.short_name label,count(*) value " + - "FROM (SELECT * FROM data_petition_complaint dpc " + - "WHERE dpc.discovery_time BETWEEN #{beginTime} AND #{endTime}) as temp " + - "INNER JOIN sup_depart sd on sd.id=temp.second_depart_id " + - "WHERE sd.statistics_group_id=#{departId} and temp.receiving_leader_name is not null " + - "GROUP BY temp.second_depart_id " + - "ORDER BY value DESC") - List selectLeaderViewMail(Integer departId, Date beginTime, Date endTime); - - - /** - * 缠访闹访分县市局排行 - * - * @param id - * @param isEntanglement - * @param beginTime - * @param endTime - * @return - */ - @Select("SELECT sd.id, sd.short_name label,count(*) value " + - "FROM (SELECT * FROM data_petition_complaint dpc " + - "WHERE dpc.discovery_time BETWEEN #{beginTime} AND #{endTime}) as temp " + - "INNER JOIN sup_depart sd on sd.id=temp.second_depart_id " + - "WHERE sd.statistics_group_id=#{id} AND entanglement_visits =#{isEntanglement} " + - "GROUP BY temp.second_depart_id " + - "ORDER BY value DESC") - List selectEntanglementMail(Integer id, int isEntanglement, Date beginTime, Date endTime); - - - @Select("SELECT sd.id, sd.short_name label,count(*) value " + - "FROM (SELECT * FROM data_petition_complaint dpc " + - "WHERE dpc.discovery_time BETWEEN #{beginTime} AND #{endTime}) as temp " + - "INNER JOIN sup_depart sd on sd.id=temp.second_depart_id " + - "WHERE sd.statistics_group_id=#{id} AND mass_visits =#{isMass} " + - "GROUP BY temp.second_depart_id " + - "ORDER BY value DESC") - List selectMassMail(Integer id, int isMass, Date beginTime, Date endTime); @Select("SELECT DATE_FORMAT(dpc.discovery_time, '%Y/%m/%d') AS dayTime, COUNT(*) total " + "FROM data_petition_complaint dpc " + @@ -100,73 +55,290 @@ public interface DataPetitionComplaintMapper extends BaseMapper selectRecentlyMailTrendByMonth(Integer sourcesCode, String year); - @Select("SELECT COUNT( IF(initial_petition=1, 1, NULL) ) AS firstMail, " + - "count( IF( initial_petition=2, 2, NULL) ) AS repeatMail, " + - "count( IF(receiving_leader_name is NOT NULL, 1, NULL) ) AS leaderMail " + + @Select("SELECT " + + "SUM( IF(initial_petition=1, 1, 0) ) AS firstMail, " + + "SUM( IF( initial_petition=2, 1, 0) ) AS repeatMail, " + + "SUM( IF(receiving_leader_name is NOT NULL, 1, 0) ) AS leaderMail " + "FROM data_petition_complaint dpc " + - "WHERE discovery_time BETWEEN #{beginTime} AND #{endTime}; ") - MailFirstAndRepeatOverviewVo getFirstAndRepeatOverview(Date beginTime, Date endTime); + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "LEFT JOIN sup_depart sd1 ON sd.pid=sd1.id " + + "WHERE discovery_time BETWEEN #{beginTime} AND #{endTime} " + + "AND sd1.statistics_group_id=#{groupId}; ") + MailFirstAndRepeatOverviewVo getFirstAndRepeatOverview(Date beginTime, Date endTime, Integer groupId); - @Select("SELECT sd.short_name AS label, count(*) AS `value` FROM data_petition_complaint dpc " + - "INNER JOIN sup_depart sd ON dpc.second_depart_id=sd.id " + - "AND sd.statistics_group_id=#{groupId} " + - "AND dpc.second_depart_name is not NULL " + + @Select("SELECT " + + "sd1.short_name AS label, " + + "count(*) AS `value` FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "LEFT JOIN sup_depart sd1 ON sd.pid=sd1.id " + "WHERE dpc.initial_petition=#{isRepeat} " + + "AND sd1.statistics_group_id=#{groupId} " + "AND discovery_time BETWEEN #{beginTime} AND #{endTime} " + - "GROUP BY sd.short_name " + - "HAVING label is not NULL " + - "ORDER BY `value` DESC ") - List getMailRank(Date beginTime, Date endTime, int groupId, Integer isRepeat); - - @Select("SELECT sd.short_name AS label, count(*) AS `value` FROM data_petition_complaint dpc " + - "INNER JOIN sup_depart sd ON dpc.second_depart_id=sd.id " + - "AND sd.statistics_group_id=#{groupId} " + - "AND dpc.second_depart_name is not NULL " + + "GROUP BY sd1.short_name " + + "HAVING label is not NULL " + + "ORDER BY `value` DESC; ") + List getMailRank(Date beginTime, Date endTime, Integer groupId, Integer isRepeat); + + + @Select("SELECT " + + "SUM( IF(dpc.problem_sources_code=21,1,0)) AS countryMail, " + + "SUM( IF(dpc.problem_sources_code=22,1,0)) AS policeMail " + + "FROM data_petition_complaint dpc " + + "WHERE dpc.third_depart_id IS NOT NULL " + + "AND dpc.discovery_time BETWEEN #{beginTime} AND #{endTime}" ) + MailOverviewVo selectMailOverviewVo(Date beginTime, Date endTime); + + + + + @Select("SELECT " + + "sd1.short_name AS label, " + + "count(*) AS `value` FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "LEFT JOIN sup_depart sd1 ON sd.pid=sd1.id " + "WHERE dpc.receiving_leader_name is NOT NULL " + + "AND sd1.statistics_group_id=#{groupId} " + "AND discovery_time BETWEEN #{beginTime} AND #{endTime} " + - "GROUP BY sd.short_name " + - "HAVING label is not NULL " + - "ORDER BY `value` DESC") - List getMailLeaderRank(Date beginTime, Date endTime, int groupId); + "GROUP BY sd1.short_name " + + "HAVING label is not NULL " + + "ORDER BY `value` DESC; ") + List getMailLeaderRank(Date beginTime, Date endTime, Integer groupId); - @Select("SELECT COUNT( IF(mass_visits=1, 1, NULL) ) AS entanglement, " + - "count( IF( entanglement_visits=1, 1, NULL) ) AS mass, " + - "count( IF(receiving_leader_name is NOT NULL, 1, NULL) ) AS leaderReview " + - "FROM data_petition_complaint dpc " + - "WHERE discovery_time BETWEEN #{beginTime} AND #{endTime} ") - MailEntanglementMassOverviewVo getEntanglementAndMassOverview(Date beginTime, Date endTime); - - @Select("SELECT sd.short_name AS label, " + - "count(*) AS `value` FROM data_petition_complaint dpc " + - "INNER JOIN sup_depart sd ON dpc.second_depart_id=sd.id " + - "AND sd.statistics_group_id=#{groupId} " + - "AND dpc.second_depart_name is not NULL " + - "WHERE dpc.entanglement_visits=1 " + - "AND discovery_time BETWEEN #{beginTime} AND #{endTime} " + - "GROUP BY sd.short_name " + - "HAVING label is not NULL " + - "ORDER BY `value` DESC") - List getEntanglementMailRank(Date beginTime, Date endTime, int groupId); - - @Select("SELECT sd.short_name AS label, " + - "count(*) AS `value` FROM data_petition_complaint dpc " + - "INNER JOIN sup_depart sd ON dpc.second_depart_id=sd.id " + - "AND sd.statistics_group_id=#{groupId} " + - "AND dpc.second_depart_name is not NULL " + - "WHERE dpc.entanglement_visits=1 " + + + @Select("SELECT " + + "sum( IF(receiving_leader_name is NOT NULL, 1, 0) ) AS leaderReview , " + + "sum( IF(entanglement_visits=1, 1, 0) ) AS entanglement , " + + "sum( IF( mass_visits=1, 1, 0) ) AS mass " + + "FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "LEFT JOIN sup_depart sd1 on sd.pid=sd1.id " + + "WHERE discovery_time BETWEEN #{beginTime} AND #{endTime} " + + "AND sd1.statistics_group_id=#{groupId}; ") + MailEntanglementMassOverviewVo getEntanglementAndMassOverview(Date beginTime, Date endTime, Integer groupId); + + + @Select("SELECT " + + "sd1.short_name AS label, " + + "count(DISTINCT dpc.origin_id ) AS `value` " + + "FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "LEFT JOIN sup_depart sd1 ON sd.pid=sd1.id " + + "WHERE sd1.statistics_group_id=#{groupId} " + + "AND dpc.entanglement_visits =1 " + "AND discovery_time BETWEEN #{beginTime} AND #{endTime} " + - "GROUP BY sd.short_name " + - "HAVING label is not NULL " + - "ORDER BY `value` DESC ") - List getMassMailRank(Date beginTime, Date endTime, int groupId); + "GROUP BY sd1.short_name " + + "HAVING label is not NULL " + + "ORDER BY `value` DESC;") + List getEntanglementMailRank(Date beginTime, Date endTime, Integer groupId); + @Select("SELECT " + + "sd1.short_name AS label, " + + "count(DISTINCT dpc.origin_id ) AS `value` " + + "FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "LEFT JOIN sup_depart sd1 ON sd.pid=sd1.id " + + "WHERE sd1.statistics_group_id=#{groupId} " + + "AND dpc.mass_visits =1 " + + "AND discovery_time BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY sd1.short_name " + + "HAVING label is not NULL " + + "ORDER BY `value` DESC;") + List getMassMailRank(Date beginTime, Date endTime, Integer groupId); - @Select("select count(*) from data_petition_complaint dpc " + + + @Select("select count(*) " + + "from data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd ON dpc.third_depart_id=sd.id " + "where problem_sources_code=#{problemSourcesCode} " + - "and second_depart_id=#{departId} " + - "and discovery_time between #{beginTime} and #{endTime}") + "and sd.pid=#{departId} " + + "and discovery_time BETWEEN #{beginTime} AND #{endTime} ") Integer selectMailBySourceCode(Date beginTime, Date endTime, String problemSourcesCode, String departId); + // 二级大屏 + @Select("SELECT " + + "COALESCE(SUM(IF(initial_petition=1, 1, 0)), 0) AS firstMail, " + + "COALESCE(SUM(IF(initial_petition=2, 1, 0)), 0) AS repeatMail, " + + "COALESCE(SUM(IF(receiving_leader_name IS NOT NULL, 1, 0)), 0) AS leaderMail " + + "FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "WHERE discovery_time BETWEEN #{beginTime} AND #{endTime} " + + "AND sd.pid=#{departId} " + + "AND sd.statistics_group_id = 10;") + MailFirstAndRepeatOverviewVo getSubOnePoliceFirstAndRepeatOverview(Date beginTime, Date endTime, Integer departId); + + @Select("SELECT " + + "COALESCE(SUM(IF(initial_petition=1, 1, 0)), 0) AS firstMail, " + + "COALESCE(SUM(IF(initial_petition=2, 1, 0)), 0) AS repeatMail, " + + "COALESCE(SUM(IF(receiving_leader_name IS NOT NULL, 1, 0)), 0) AS leaderMail " + + "FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "WHERE discovery_time BETWEEN #{beginTime} AND #{endTime} " + + "AND sd.pid=#{departId} " + + "AND sd.statistics_group_id != 10;") + MailFirstAndRepeatOverviewVo getTeamFirstAndRepeatOverview(Date beginTime, Date endTime, Integer departId); + + @Select("SELECT " + + "sd.short_name AS label, " + + "count(*) AS `value` " + + "FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "WHERE dpc.initial_petition=#{typeId} " + + "AND sd.pid = #{departId} " + + "AND sd.statistics_group_id=10 " + + "AND dpc.second_depart_name is not NULL " + + "AND discovery_time BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY sd.short_name " + + "HAVING label is not NULL " + + "ORDER BY `value` DESC") + List getPoliceMailRank(Date beginTime, Date endTime, Integer departId, Integer typeId); + + @Select("SELECT " + + "sd.short_name AS label, " + + "count(*) AS `value` " + + "FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "WHERE dpc.initial_petition=#{typeId} " + + "AND sd.pid = #{departId} " + + "AND sd.statistics_group_id!=10 " + + "AND dpc.second_depart_name is not NULL " + + "AND discovery_time BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY sd.short_name " + + "HAVING label is not NULL " + + "ORDER BY `value` DESC") + List getTeamMailRank(Date beginTime, Date endTime, Integer departId, Integer typeId); + @Select("SELECT " + + "sd.short_name AS label, " + + "count(*) AS `value` FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "WHERE dpc.receiving_leader_name is NOT NULL " + + "AND sd.pid=#{departId} " + + "AND sd.statistics_group_id = 10 " + + "AND discovery_time BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY sd.short_name " + + "HAVING label is not NULL " + + "ORDER BY `value` DESC; ") + List getPoliceMailLeaderRank(Date beginTime, Date endTime, Integer departId); + + @Select("SELECT " + + "sd.short_name AS label, " + + "count(*) AS `value` FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "WHERE dpc.receiving_leader_name is NOT NULL " + + "AND sd.pid=#{departId} " + + "AND sd.statistics_group_id != 10 " + + "AND discovery_time BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY sd.short_name " + + "HAVING label is not NULL " + + "ORDER BY `value` DESC; ") + List getTeamMailLeaderRank(Date beginTime, Date endTime, Integer departId); + + + @Select("SELECT " + + "SUM( IF(dpc.problem_sources_code=21,1,0)) AS countryMail, " + + "SUM( IF(dpc.problem_sources_code=22,1,0)) AS policeMail " + + "FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd ON dpc.third_depart_id=sd.id " + + "WHERE sd.pid=#{departId} " + + "AND dpc.discovery_time BETWEEN #{beginTime} AND #{endTime} ") + MailOverviewVo selectSubOneMailOverviewVo(Date beginTime, Date endTime, Integer departId); + + + + @Select("SELECT " + + "m.month_name AS `name`, " + + "IFNULL(COUNT(sd.pid=#{departId}), 0) AS `value` " + + "FROM sup_month_monthname m " + + "LEFT JOIN data_petition_complaint dpc " + + "ON DATE_FORMAT(dpc.discovery_time, '%m') = m.month " + + "AND YEAR(dpc.discovery_time) = #{year} " + + "AND dpc.problem_sources_code = #{problemSourceCode} " + + "LEFT JOIN sup_depart sd " + + "ON dpc.third_depart_id = sd.id " + + "AND sd.pid = #{departId} " + + "GROUP BY m.month_name " + + "ORDER BY m.month ASC;") + List getSubOneMailTrend(Integer year, Integer problemSourceCode, Integer departId); + + + + @Select("SELECT " + + "COALESCE(SUM(IF(receiving_leader_name IS NOT NULL, 1, 0)), 0) AS leaderReview, " + + "COALESCE(SUM(IF(entanglement_visits=1, 1, 0)), 0) AS entanglement, " + + "COALESCE(SUM(IF(mass_visits=1, 1, 0)), 0) AS mass " + + "FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "WHERE discovery_time BETWEEN #{beginTime} AND #{endTime} " + + "AND sd.pid=#{departId} " + + "AND sd.statistics_group_id=10;") + MailEntanglementMassOverviewVo getPoliceEntanglementAndMassOverview(Date beginTime, Date endTime, Integer departId); + @Select("SELECT " + + "COALESCE(SUM(IF(receiving_leader_name IS NOT NULL, 1, 0)), 0) AS leaderReview, " + + "COALESCE(SUM(IF(entanglement_visits=1, 1, 0)), 0) AS entanglement, " + + "COALESCE(SUM(IF(mass_visits=1, 1, 0)), 0) AS mass " + + "FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "WHERE discovery_time BETWEEN #{beginTime} AND #{endTime} " + + "AND sd.pid=#{departId} " + + "AND sd.statistics_group_id!=10;") + MailEntanglementMassOverviewVo getTeamEntanglementAndMassOverview(Date beginTime, Date endTime, Integer departId); + + @Select("SELECT " + + "sd.short_name AS label, " + + "count(DISTINCT dpc.origin_id ) AS `value` " + + "FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "WHERE sd.statistics_group_id=10 " + + "AND sd.pid=#{departId} " + + "AND dpc.entanglement_visits =1 " + + "AND discovery_time BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY sd.short_name " + + "HAVING label is not NULL " + + "ORDER BY `value` DESC;") + List getPoliceEntanglementMailRank(Date beginTime, Date endTime, Integer departId); + + @Select("SELECT " + + "sd.short_name AS label, " + + "count(DISTINCT dpc.origin_id ) AS `value` " + + "FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "WHERE sd.statistics_group_id!=10 " + + "AND sd.pid=#{departId} " + + "AND dpc.entanglement_visits =1 " + + "AND discovery_time BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY sd.short_name " + + "HAVING label is not NULL " + + "ORDER BY `value` DESC;") + List getTeamEntanglementMailRank(Date beginTime, Date endTime, Integer departId); + + @Select("SELECT " + + "sd.short_name AS label, " + + "count(DISTINCT dpc.origin_id ) AS `value` " + + "FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "WHERE sd.statistics_group_id=10 " + + "AND dpc.mass_visits =1 " + + "AND sd.pid=#{departId} " + + "AND discovery_time BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY sd.short_name " + + "HAVING label is not NULL " + + "ORDER BY `value` DESC;") + List getPoliceMassMailRank(Date beginTime, Date endTime, Integer departId); + + + @Select("SELECT " + + "sd.short_name AS label, " + + "count(DISTINCT dpc.origin_id ) AS `value` " + + "FROM data_petition_complaint dpc " + + "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " + + "WHERE sd.statistics_group_id!=10 " + + "AND dpc.mass_visits =1 " + + "AND sd.pid=#{departId} " + + "AND discovery_time BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY sd.short_name " + + "HAVING label is not NULL " + + "ORDER BY `value` DESC;") + List getTeamMassMailRank(Date beginTime, Date endTime, Integer departId); + } diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index 50cf94f..a85f7ef 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -14,11 +14,12 @@ public interface NegativeMapper extends BaseMapper { /** * 查询问题趋势 - * @param year 年份 - * @param args 问题来源变参数组 + * + * @param year 年份 + * @param args 问题来源变参数组 * @return */ - List getTrend(Integer year, String ...args); + List getTrend(Integer year, String... args); // region 首页大屏 @@ -35,15 +36,17 @@ public interface NegativeMapper extends BaseMapper { "LEFT JOIN sup_depart sd ON ng.second_involve_depart_id=sd.id " + "WHERE ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + "AND sd.statistics_group_id=#{groupType} " + - "AND problemSourcesCode IN (2,13,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30)\n" + + "AND problemSourcesCode IN (2,13,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30) " + "GROUP BY sd.short_name " + - "ORDER BY `value` DESC; " ) + "ORDER BY `value` DESC; ") List selectOrganizeProblemRank(Integer groupType, Date beginTime, Date endTime); // 业务类型占比 - @Select("SELECT businessTypeName as name, count(*) value FROM negative " + - "WHERE " + - "discoveryTime BETWEEN #{beginTime} and #{endTime} and checkStatus=1 " + + @Select("SELECT " + + "businessTypeName as name, " + + "count(*) value FROM negative " + + "WHERE discoveryTime BETWEEN #{beginTime} and #{endTime} " + + "and checkStatus in (1, 2) " + "GROUP BY businessTypeName") List selectBusinessRate(Date beginTime, Date endTime); @@ -81,6 +84,26 @@ public interface NegativeMapper extends BaseMapper { List getGlobalRecentlyTrendByMonth(String year); + + /** + * 首页大屏突出问题排名 + * @param beginTime + * @param endTime + * @return + */ + @Select("SELECT " + + "npr.threeLevelContent as label, " + + "count(*) `value` " + + "FROM negative_problem_relation npr INNER JOIN negative ng ON npr.negativeId=ng.id " + + "WHERE npr.threeLevelContent is not NULL " + + "AND checkStatus IN (1, 2) " + + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY npr.threeLevelContent " + + "ORDER BY `value` desc " + + " LIMIT 10 OFFSET 1 ") + List selectStrongProblemRank(Date beginTime, Date endTime); + + // endregion // region 现场督察大屏 @@ -132,6 +155,7 @@ public interface NegativeMapper extends BaseMapper { " LEFT JOIN negative_blame d ON c.id = d.negativeId " + "WHERE discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND problemSourcesCode IN (13, 15)") RankVoSupTwo getTemp(Date beginTime, Date endTime); + @Select("SELECT " + "COUNT( DISTINCT ng.id ) AS problemNumber, " + "COUNT( DISTINCT IF(ng.isRectifyCode=0, ng.id, NULL) ) AS rectifingNumber, " + @@ -146,7 +170,6 @@ public interface NegativeMapper extends BaseMapper { SupervisionNotifyOverView getAllSupervisionNotifyCount(Date beginTime, Date endTime); - @Select("SELECT " + "sd.short_name AS `name`, " + "sd.id AS departId, " + @@ -254,8 +277,6 @@ public interface NegativeMapper extends BaseMapper { List getVideoSuperviseMapIconInfo(Date beginTime, Date endTime); - - // endregion // region 案件核查大屏 @@ -334,13 +355,87 @@ public interface NegativeMapper extends BaseMapper { List getMailTrend(Integer year, Integer type); - List getSubOneTrend(Integer departId, String year, String... args); + List getSubOneTrend(String departId, String year, String... args); // endregion // region 二级大屏首页大屏 + @Select("SELECT " + + "sd.short_name AS label, " + + "COUNT(DISTINCT ng.id ) AS `value` " + + "FROM negative ng " + + "LEFT JOIN sup_depart sd ON ng.three_involve_depart_id=sd.id " + + "WHERE ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "AND sd.statistics_group_id=10 " + + "AND sd.pid=#{departId} " + + "AND problemSourcesCode IN (2,13,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30) " + + "GROUP BY sd.short_name " + + "ORDER BY `value` DESC;") + List selectPoliceOrganizeProblemRank(Integer departId, Date beginTime, Date endTime); + + @Select("SELECT " + + "sd.short_name AS label, " + + "COUNT(DISTINCT ng.id ) AS `value` " + + "FROM negative ng " + + "LEFT JOIN sup_depart sd ON ng.three_involve_depart_id=sd.id " + + "WHERE ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "AND sd.statistics_group_id!=10 " + + "AND sd.pid=#{departId} " + + "AND problemSourcesCode IN (2,13,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30) " + + "GROUP BY sd.short_name " + + "ORDER BY `value` DESC;") + List selectTeamOrganizeProblemRank(Integer departId, Date beginTime, Date endTime); + + @Select("SELECT " + + "businessTypeName as name, " + + "count(*) value " + + "FROM negative " + + "WHERE checkStatus in (1, 2) " + + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "AND negative.second_involve_depart_id=#{departId} " + + "GROUP BY businessTypeName") + List selectSubOneBusinessRate(Integer departId, Date beginTime, Date endTime); + + @Select("SELECT " + + "SUM( IF(problemSourcesCode IN (2,13,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30), 1, 0) ) AS totalPro, " + + "SUM( IF(problemSourcesCode IN (13,15,16), 1, 0) ) AS supervisionPro, " + + "SUM( IF(problemSourcesCode IN (17,18,19,20), 1, 0) ) AS caseVerificationPro, " + + "SUM( IF(problemSourcesCode IN (21,22,23,24,25),1, 0) ) AS complaintPro, " + + "SUM( IF(problemSourcesCode IN (2),1, 0) ) AS talkPro, " + + "SUM( IF(problemSourcesCode IN (27,28,29,30),1, 0) ) AS auditPro " + + "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 " + + "npr.threeLevelContent as label, " + + "count(*) `value` " + + "FROM negative_problem_relation npr INNER JOIN negative ng ON npr.negativeId=ng.id " + + "WHERE npr.threeLevelContent is not NULL " + + "AND checkStatus IN (1, 2) " + + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime}" + + "AND ng.second_involve_depart_id=#{departId} " + + "GROUP BY npr.threeLevelContent " + + "ORDER BY `value` desc " + + " LIMIT 10 OFFSET 1") + List selectSubOneStrongProblemRank(Integer departId, Date beginTime, Date endTime); + + @Select("SELECT " + + "npr.oneLevelContent as name, " + + "count(*) `value` " + + "FROM negative_problem_relation npr " + + "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 " + + "AND ng.second_involve_depart_id=#{departId} " + + "GROUP BY npr.oneLevelContent " + + "ORDER BY `value` desc") + List selectSubOneProblemRate(Integer departId, Date beginTime, Date endTime); + @Select("SELECT " + "COUNT( DISTINCT ng.id ) AS one, " + "COUNT( DISTINCT IF(ng.isRectifyCode=0, ng.id, NULL ) ) AS two, " + @@ -447,7 +542,7 @@ public interface NegativeMapper extends BaseMapper { "AND ng.second_involve_depart_id = #{departPId} " + "AND sd.statistics_group_id=10 " + "GROUP BY ng.involveDepartName " + - "ORDER BY value DESC " ) + "ORDER BY value DESC ") List getGlobalPoliceCaseVerifyRank(Integer departPId, Date beginTime, Date endTime); @Select("SELECT " + @@ -462,7 +557,7 @@ public interface NegativeMapper extends BaseMapper { "AND ng.second_involve_depart_id = #{departPId} " + "AND sd.statistics_group_id!=10 " + "GROUP BY ng.involveDepartName " + - "ORDER BY value DESC " ) + "ORDER BY value DESC ") List getGlobalTeamCaseVerifyRank(Integer departPId, Date beginTime, Date endTime); // endregion @@ -749,13 +844,13 @@ public interface NegativeMapper extends BaseMapper { "ORDER BY `value` DESC; ") List getTeamCaseVerificationRank(Date beginTime, Date endTime, Integer departId); - @Select("SELECT npr.threeLevelContent AS label, " + + @Select("SELECT npr.threeLevelContent AS name, " + "COUNT(*) AS `value` FROM negative ng " + "INNER JOIN sup_depart sd ON ng.involveDepartId=sd.id " + "INNER JOIN negative_problem_relation npr ON ng.id=npr.negativeId " + "WHERE ng.checkStatus!=3 " + "AND sd.pid = #{departId} " + - "AND ng.problemSourcesCode IN (17,18,19,20)\n" + + "AND ng.problemSourcesCode IN (17,18,19,20) " + "AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + "AND ng.businessTypeCode = #{businessType} " + "GROUP BY npr.threeLevelContent " + @@ -800,13 +895,30 @@ public interface NegativeMapper extends BaseMapper { List getSubOneCaseVerificationTrend(String year, String departId, String... args); - @Select("SELECT problemSources AS name, count(ng.id) AS value " + "FROM negative ng " + "WHERE problemSourcesCode IN (17, 18, 19, 20) " + "GROUP BY problemSources") List getCaseSourceRate(Date beginTime, Date endTime); + /** + * 首页大屏问题类型占比 + * @param beginTime + * @param endTime + * @return + */ + @Select("SELECT " + + "npr.oneLevelContent as name, " + + "count(*) `value` FROM negative_problem_relation npr " + + "LEFT JOIN negative ng ON ng.id=npr.negativeId\n" + + "WHERE checkStatus in (1, 2) " + + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "AND npr.oneLevelContent is not NULL " + + "GROUP BY npr.oneLevelContent " + + "ORDER BY `value` desc") + List selectProblemRate(Date beginTime, Date endTime); + + // endregion } diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeProblemRelationMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeProblemRelationMapper.java index ff4434d..470cb6c 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeProblemRelationMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeProblemRelationMapper.java @@ -13,42 +13,9 @@ import java.util.List; public interface NegativeProblemRelationMapper extends BaseMapper { - /** - * 首页大屏问题类型占比 - * @param beginTime - * @param endTime - * @return - */ - @Select("SELECT npr.oneLevelContent as name, count(*) `value` FROM negative_problem_relation npr INNER JOIN " + - " ( " + - " SELECT id FROM negative ng " + - " WHERE checkStatus <>3 " + - " AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + - " ) as temp " + - "on npr.negativeId=temp.id " + - "AND npr.oneLevelContent is not NULL " + - "GROUP BY npr.oneLevelContent " + - "ORDER BY `value` desc") - List selectProblemRate(Date beginTime, Date endTime); - - /** - * 首页大屏突出问题排名 - * @param beginTime - * @param endTime - * @return - */ - @Select("SELECT npr.threeLevelContent as label, count(*) `value` FROM negative_problem_relation npr INNER JOIN " + - " ( " + - " SELECT id FROM negative ng " + - " WHERE checkStatus <>3 " + - " AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + - " ) as temp " + - "on npr.negativeId=temp.id " + - "AND npr.threeLevelContent is not NULL " + - "GROUP BY npr.threeLevelContent " + - "ORDER BY `value` desc" + - " LIMIT 10 OFFSET 1") - List selectStrongProblemRank(Date beginTime, Date endTime); + + + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java index 4788cda..66d6945 100644 --- a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java @@ -46,25 +46,129 @@ public interface RpcApplyMapper extends BaseMapper { "ORDER BY `value` DESC;") List getRightsRank(Date beginTime, Date endTime, Integer groupId); - @Select("SELECT sdd.dict_label AS `name`, count(DISTINCT rap.emp_no) AS `value` FROM rpc_apply_person rap " + - "INNER JOIN sup_police sp ON rap.emp_no = sp.emp_no " + - "INNER JOIN sup_dict_data sdd on sdd.dict_value = sp.person_type AND sdd.dict_type='personType' " + - "WHERE person_type is not NULL " + - "AND rap.creat_time BETWEEN #{beginTime} AND #{endTime} " + - "GROUP BY person_type ") + @Select("SELECT " + + "sdd.dict_label AS `name`, " + + "count(*) AS `value` " + + "FROM rpc_apply_person rap " + + "LEFT JOIN sup_police sp ON rap.emp_no=sp.emp_no " + + "LEFT JOIN sup_dict_data sdd on sdd.dict_value = sp.person_type AND sdd.dict_type='personType' " + + "WHERE rap.creat_time BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY sdd.dict_label " + + "HAVING `name` IS NOT NULL ") List getPoliceHurtSituation(Date beginTime, Date endTime); - @Select("SELECT Incident_link_name AS `name`, count(*) AS `value` FROM rpc_apply " + - "WHERE Incident_link_name is NOT NULL " + - "AND happen_time BETWEEN #{beginTime} AND #{endTime} " + - "GROUP BY Incident_link_name;") + @Select("SELECT " + + "injury_severity_name AS `name`, " + + "count(*) AS `value` " + + "FROM rpc_apply_person rap " + + "LEFT JOIN sup_police sp ON rap.emp_no=sp.emp_no " + + "WHERE rap.creat_time BETWEEN #{beginTime} AND #{endTime} " + + "AND sp.person_type IN (1,3,4) " + + "AND injury_severity_name is NOT NULL " + + "GROUP BY injury_severity_name ") + List getPoliceHurtType(Date beginTime, Date endTime); + + + @Select("SELECT " + + "Incident_link_name AS `name`, " + + "count(*) AS `value` " + + "FROM rpc_apply ra " + + "WHERE ra.happen_time BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY Incident_link_name ") List getIncidentLink(Date beginTime, Date endTime); - @Select("SELECT sd.short_name AS `name`, count(*) as `value` FROM sup_depart sd " + - "INNER JOIN sup_depart sd1 on sd.id = sd1.pid AND sd.level=2 " + - "INNER JOIN rpc_apply ra on sd1.id=ra.depart_id " + - "WHERE ra.happen_time BETWEEN #{beginTime} AND #{endTime} " + - "GROUP BY sd.short_name " + - "ORDER BY `value` DESC;") + @Select("SELECT " + + "sd1.short_name AS `name`, " + + "count(*) AS `value` " + + "FROM rpc_apply ra " + + "LEFT JOIN sup_depart sd ON ra.depart_id=sd.id " + + "AND sd.`level`=3 " + + "LEFT JOIN sup_depart sd1 ON sd.pid=sd1.id " + + "AND sd1.`level`=2 " + + "WHERE ra.happen_time BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY sd1.short_name " + + "HAVING `name` is NOT NULL") List getIncidentOrg(Date beginTime, Date endTime); + + // 二级大屏 + @Select("SELECT " + + "count(*) " + + "FROM rpc_apply_person rap " + + "LEFT JOIN rpc_apply ra ON rap.rpc_id=ra.rpc_id " + + "LEFT JOIN sup_depart sd ON sd.id=ra.depart_id " + + "WHERE ra.apply_date BETWEEN #{beginTime} AND #{endTime} " + + "AND sd.pid=#{departId} " + + "AND ra.type=2;") + Integer countSubOneComfortPersonNumber(Date beginTime, Date endTime, Integer departId); + + @Select("SELECT count(*) " + + "FROM rpc_infringer_result rir " + + "LEFT JOIN rpc_apply ra ON rir.rpc_id=ra.rpc_id " + + "LEFT JOIN sup_depart sd ON sd.id=ra.depart_id " + + "WHERE ra.apply_date BETWEEN #{beginTime} AND #{endTime} " + + "AND sd.pid=#{departId} " + + "AND ra.type=2;") + List getSubOneHitPeople(Date beginTime, Date endTime, Integer departId); + + @Select("SELECT " + + "COALESCE(SUM(rap.provide_relief),0) /10000 " + + "FROM rpc_apply_person rap " + + "LEFT JOIN rpc_apply ra ON rap.rpc_id=ra.rpc_id " + + "LEFT JOIN sup_depart sd ON sd.id=ra.depart_id " + + "WHERE ra.apply_date BETWEEN #{beginTime} AND #{endTime} " + + "AND sd.pid=#{departId} " + + "AND ra.type=2; ") + Double countSubOneComfortMoney(Date beginTime, Date endTime, Integer departId); + + @Select("SELECT " + + "sdd.dict_label AS `name`, " + + "count(*) AS `value` " + + "FROM rpc_apply_person rap " + + "LEFT JOIN sup_police sp ON rap.emp_no=sp.emp_no " + + "LEFT JOIN sup_dict_data sdd on sdd.dict_value = sp.person_type AND sdd.dict_type='personType' " + + "LEFT JOIN sup_depart sd ON sp.org_id=sd.id " + + "WHERE rap.creat_time BETWEEN #{beginTime} AND #{endTime} " + + "AND sd.pid = #{departId} " + + "GROUP BY sdd.dict_label " + + "HAVING `name` IS NOT NULL") + List getSubOnePoliceHurtSituation(Date beginTime, Date endTime, Integer departId); + + @Select("SELECT " + + "injury_severity_name AS `name`, " + + "count(*) AS `value` " + + "FROM rpc_apply_person rap " + + "LEFT JOIN sup_police sp ON rap.emp_no=sp.emp_no " + + "LEFT JOIN sup_depart sd ON sp.org_id=sd.id " + + "WHERE rap.creat_time BETWEEN #{beginTime} AND #{endTime} " + + "AND sp.person_type IN (1,3,4) " + + "AND injury_severity_name is NOT NULL " + + "AND sd.pid = #{departId} " + + "GROUP BY injury_severity_name ") + List getSubOnePoliceHurtType(Date beginTime, Date endTime, Integer departId); + + @Select("SELECT " + + "Incident_link_name AS `name`, " + + "count(*) AS `value` " + + "FROM rpc_apply ra " + + "LEFT JOIN sup_depart sd ON ra.depart_id=sd.id " + + "WHERE ra.happen_time BETWEEN #{beginTime} AND #{endTime} " + + "AND sd.pid=#{departId} " + + "GROUP BY Incident_link_name") + List getSubOneIncidentLink(Date beginTime, Date endTime, Integer departId); + + + @Select("SELECT " + + "sd.short_name AS `name`, " + + "count(*) AS `value` " + + "FROM rpc_apply ra " + + "LEFT JOIN sup_depart sd ON ra.depart_id=sd.id " + + "AND sd.`level`=3 " + + "LEFT JOIN sup_depart sd1 ON sd.pid=sd1.id " + + "AND sd1.`level`=2 " + + "WHERE ra.happen_time BETWEEN #{beginTime} AND #{endTime} " + + "AND sd1.id=#{departId} " + + "GROUP BY sd.short_name " + + "HAVING `name` is NOT NULL ") + List getSubOneIncidentOrg(Date beginTime, Date endTime, Integer departId); + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/vo/MailOverviewVo.java b/src/main/java/com/biutag/supervision/pojo/vo/MailOverviewVo.java index 9901d9b..b05a38e 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/MailOverviewVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/MailOverviewVo.java @@ -2,17 +2,19 @@ package com.biutag.supervision.pojo.vo; import lombok.Data; +import java.io.Serializable; + /** * @Auther: sh * @Date: 2024/12/4 09:30 * @Description: 信访投诉大屏中央数据总览 */ @Data -public class MailOverviewVo { - private Integer totalMail; - private Integer countryMail; - private Integer policeMail; - private Integer numberMail; - private Integer manageMail; +public class MailOverviewVo implements Serializable { + private Long totalMail; + private Long countryMail; + private Long policeMail; + private Long numberMail; + private Long manageMail; } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/RightsComfortMapVo.java b/src/main/java/com/biutag/supervision/pojo/vo/RightsComfortMapVo.java new file mode 100644 index 0000000..b8d0659 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/RightsComfortMapVo.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther: sh + * @Date: 2024/12/24 16:43 + * @Description: + */ +@Data +public class RightsComfortMapVo implements Serializable { + private String name; + private String departId; + private Integer totalCase; // 维权案件总数 + private Integer victimPer; // 受侵害人数 + private Integer comfortPer; // 抚慰人数 + private Integer hitPro; // 打击处理人数 + private Double comfortMon; // 抚慰金额 +} + diff --git a/src/main/java/com/biutag/supervision/service/CountyStreetDeptService.java b/src/main/java/com/biutag/supervision/service/CountyStreetDeptService.java index b8a24b4..7cd4587 100644 --- a/src/main/java/com/biutag/supervision/service/CountyStreetDeptService.java +++ b/src/main/java/com/biutag/supervision/service/CountyStreetDeptService.java @@ -30,8 +30,8 @@ public class CountyStreetDeptService { return res; } - public JSONObject getSubOneStreetMap(Integer departPId) { - List res = countyStreetDeptMapper.getSubOneStreetMap(departPId); + public JSONObject getSubOneStreetMap(Integer departId) { + List res = countyStreetDeptMapper.getSubOneStreetMap(departId); Map geoJson = new HashMap<>(); geoJson.put("type", "FeatureCollection"); geoJson.put("name", "临时名字"); diff --git a/src/main/java/com/biutag/supervision/service/DataGlobalService.java b/src/main/java/com/biutag/supervision/service/DataGlobalService.java index 18af87c..84c4b2f 100644 --- a/src/main/java/com/biutag/supervision/service/DataGlobalService.java +++ b/src/main/java/com/biutag/supervision/service/DataGlobalService.java @@ -131,20 +131,20 @@ public class DataGlobalService { //region 右边 // 获取突出问题排名 - public List getStrongProblemRank(Date beginTime, Date endTime) { - // 1.获取这段时间的negative id - List res = negativeProblemRelationMapper.selectStrongProblemRank(beginTime, endTime); - for (int i = 1; i <= res.size(); i++) { - res.get(i - 1).setSort(i); - } - return res; - } +// public List getStrongProblemRank(Date beginTime, Date endTime) { +// // 1.获取这段时间的negative id +// List res = negativeProblemRelationMapper.selectStrongProblemRank(beginTime, endTime); +// for (int i = 1; i <= res.size(); i++) { +// res.get(i - 1).setSort(i); +// } +// return res; +// } // 获取问题类型占比 - public List getProblemRate(Date beginTime, Date endTime) { - List res = negativeProblemRelationMapper.selectProblemRate(beginTime, endTime); - return res; - } +// public List getProblemRate(Date beginTime, Date endTime) { +// List res = negativeProblemRelationMapper.selectProblemRate(beginTime, endTime); +// return res; +// } //endregion diff --git a/src/main/java/com/biutag/supervision/service/DataMailService.java b/src/main/java/com/biutag/supervision/service/DataMailService.java index f7ff703..f8eedd6 100644 --- a/src/main/java/com/biutag/supervision/service/DataMailService.java +++ b/src/main/java/com/biutag/supervision/service/DataMailService.java @@ -46,7 +46,6 @@ public class DataMailService extends ServiceImpl page(DataPetitionComplaintQueryParam queryParam) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); @@ -141,79 +140,37 @@ 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); +// 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); // 12337信访 QueryWrapper queryWrapper12337 = new QueryWrapper<>(); Long numberMail = dataPetition12337Mapper.selectCount(queryWrapper12337); + temp.setNumberMail(numberMail); System.out.println("12337信访数量:" + numberMail); + Long manageMail = 5812L; // 总数 - long totalMail = countryMail + policeMail + numberMail; - - JSONObject overview = new JSONObject() - // 信访总数(起) - .fluentPut("totalMail", totalMail) - // 国家信访 - .fluentPut("countryMail", countryMail) - // 公安部信访 - .fluentPut("policeMail", policeMail) - // 局长信箱 - .fluentPut("manageMail", 5812) - // 12337信访 - .fluentPut("numberMail", numberMail); - return overview; + temp.setTotalMail(temp.getCountryMail() + temp.getPoliceMail() + numberMail ); + temp.setManageMail(manageMail); + return temp; } - public List getMailTrend(Integer year, Integer type) { - List res = negativeMapper.getMailTrend(year, type); - return res; - } - - - - - - - public List getMailLeaderRank(Date beginTime, Date endTime, int groupId) { - List res = dataPetitionComplaintMapper.getMailLeaderRank(beginTime, endTime, groupId); - return res; - } - - public MailEntanglementMassOverviewVo getEntanglementAndMassOverview(Date beginTime, Date endTime) { - MailEntanglementMassOverviewVo res = dataPetitionComplaintMapper.getEntanglementAndMassOverview(beginTime, endTime); - return res; - } - - - public List getEntanglementMailRank(Date beginTime, Date endTime, int groupId) { - List res = dataPetitionComplaintMapper.getEntanglementMailRank(beginTime, endTime, groupId); - return res; - } - - public List getMassMailRank(Date beginTime, Date endTime, int groupId) { - List res = dataPetitionComplaintMapper.getMassMailRank(beginTime, endTime, groupId); - return res; - } - - public List getMailTrend12337(Integer year) { - List res = dataPetition12337Mapper.getMailTrend12337(year); - return res; - } public List getMailMapIcon(Date beginTime, Date endTime) { List res = new ArrayList<>(); + // 查询所有区县局 List supDeparts = supDepartMapper.selectDepartsByGroupType(COUNTY_CITY_BUREAUS.getId()); for (SupDepart supDepart : supDeparts) { MailMapIconVo mapIconVo = new MailMapIconVo(); @@ -227,7 +184,7 @@ public class DataMailService extends ServiceImpl queryWrapper12337 = new QueryWrapper<>(); + queryWrapper12337.eq("second_depart_id", departId); + Long numberMail = dataPetition12337Mapper.selectCount(queryWrapper12337); + temp.setNumberMail(numberMail); + System.out.println("12337信访数量:" + numberMail); + Long manageMail = 0L; + // 总数 + temp.setTotalMail(temp.getCountryMail() + temp.getPoliceMail() + numberMail ); + temp.setManageMail(manageMail); + return temp; + } } diff --git a/src/main/java/com/biutag/supervision/service/DataRightsComfortService.java b/src/main/java/com/biutag/supervision/service/DataRightsComfortService.java index aaaf658..bfe91f5 100644 --- a/src/main/java/com/biutag/supervision/service/DataRightsComfortService.java +++ b/src/main/java/com/biutag/supervision/service/DataRightsComfortService.java @@ -1,28 +1,31 @@ package com.biutag.supervision.service; import com.biutag.supervision.mapper.RpcApplyMapper; +import com.biutag.supervision.mapper.SupDepartMapper; import com.biutag.supervision.pojo.dto.common.PieItem; import com.biutag.supervision.pojo.entity.RpcInfringerResult; -import com.biutag.supervision.pojo.vo.ComfortCountVO; +import com.biutag.supervision.pojo.entity.SupDepart; import com.biutag.supervision.pojo.vo.EchartsVo; +import com.biutag.supervision.pojo.vo.MailMapIconVo; import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo; +import com.biutag.supervision.pojo.vo.RightsComfortMapVo; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import java.util.*; import java.util.stream.Collectors; +import static com.biutag.supervision.constants.enums.DepartGroupEnum.COUNTY_CITY_BUREAUS; +import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.GABXF; +import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.GJXFPT; + @RequiredArgsConstructor @Service public class DataRightsComfortService { - private final RpcApplyService rpcApplyService; - - private final RpcApplyPersonService rpcApplyPersonService; - - private final RpcInfringerResultService rpcInfringerResultService; private final RpcApplyMapper rpcApplyMapper; + private final SupDepartMapper supDepartMapper; // 抚慰人数 public Integer countComfortPersonNumber(Date beginTime, Date endTime) { @@ -75,23 +78,50 @@ public class DataRightsComfortService { } - public List getRightsRank(Date beginTime, Date endTime, Integer groupId) { - List res = rpcApplyMapper.getRightsRank(beginTime, endTime, groupId); - return res; - } - public List getPoliceHurtSituation(Date beginTime, Date endTime) { - List res = rpcApplyMapper.getPoliceHurtSituation(beginTime, endTime); - return res; - } - public List getIncidentLink(Date beginTime, Date endTime) { - List res =rpcApplyMapper.getIncidentLink(beginTime, endTime); + // 维权抚慰地图图标数据 + public List getComfortMapIcon(Date beginTime, Date endTime) { + List res = new ArrayList<>(); + // 查询所有区县局 + List supDeparts = supDepartMapper.selectDepartsByGroupType(COUNTY_CITY_BUREAUS.getId()); + for (SupDepart supDepart : supDeparts) { + RightsComfortMapVo mapIconVo = new RightsComfortMapVo(); + mapIconVo.setName(supDepart.getShortName()); + mapIconVo.setDepartId(supDepart.getId()); + res.add(mapIconVo); + } + for (RightsComfortMapVo re : res) { + String departId = re.getDepartId(); + re.setTotalCase(0); + re.setHitPro(0); + re.setComfortPer(0); + re.setVictimPer(0); + re.setComfortMon(0.0); + } return res; } - public List getIncidentOrg(Date beginTime, Date endTime) { - List res =rpcApplyMapper.getIncidentOrg(beginTime, endTime); - return res; + + + // 打击处理人数 + public Integer countSubOneHitPersonNumber(Date beginTime, Date endTime, Integer departId) { + List hitPeople = rpcApplyMapper.getSubOneHitPeople(beginTime, endTime, departId); + int totalPeople = 0; + if (hitPeople == null || hitPeople.isEmpty()) { + return 0; + } + for (String hitPerson : hitPeople) { + if (hitPerson.isEmpty()) { + continue; + } + if (hitPerson.contains(",")) { + String[] people = hitPerson.split(","); + totalPeople += people.length; + } else { + totalPeople += 1; + } + } + return totalPeople; } } diff --git a/src/main/java/com/biutag/supervision/service/SubOneService.java b/src/main/java/com/biutag/supervision/service/SubOneService.java index 1d7dd82..d0dcf26 100644 --- a/src/main/java/com/biutag/supervision/service/SubOneService.java +++ b/src/main/java/com/biutag/supervision/service/SubOneService.java @@ -50,10 +50,10 @@ public class SubOneService { // return res; // } - public SubOneOverViewVo getSubOneOverView(Integer departPId, Date beginTime, Date endTime) { - SubOneOverViewVo res = negativeMapper.getSubOneOverView(departPId, beginTime, endTime); - return res; - } +// public SubOneOverViewVo getSubOneOverView(Integer departPId, Date beginTime, Date endTime) { +// SubOneOverViewVo res = negativeMapper.getSubOneOverView(departPId, beginTime, endTime); +// return res; +// } } diff --git a/src/main/resources/mapper/NegativeMapper.xml b/src/main/resources/mapper/NegativeMapper.xml index efec218..8b38525 100644 --- a/src/main/resources/mapper/NegativeMapper.xml +++ b/src/main/resources/mapper/NegativeMapper.xml @@ -23,42 +23,19 @@ LEFT JOIN negative ng ON DATE_FORMAT(ng.discoveryTime, '%m') = m.`month` AND YEAR(ng.discoveryTime) = #{year} AND ng.problemSourcesCode IN (2, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30) - LEFT JOIN sup_depart sd ON ng.involveDepartId = sd.id GROUP BY m.month_name ORDER BY m.`month` ASC @@ -89,6 +66,7 @@ GROUP BY m.month_name ORDER BY m.month ASC; +