diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataPetitionComplaintViewController.java b/src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java similarity index 87% rename from src/main/java/com/biutag/supervision/controller/datav/DataPetitionComplaintViewController.java rename to src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java index b143481..77a73ee 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataPetitionComplaintViewController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java @@ -9,7 +9,7 @@ import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.dto.CaseVerifDepart; import com.biutag.supervision.pojo.vo.RecentMailTrendByDayVo; import com.biutag.supervision.pojo.vo.RecentMailTrendByMonthVo; -import com.biutag.supervision.service.DataPetitionComplaintService; +import com.biutag.supervision.service.DataMailService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; @@ -38,9 +38,9 @@ import java.util.stream.Collectors; @RequestMapping("datav/mailVisits") @RequiredArgsConstructor @RestController -public class DataPetitionComplaintViewController { +public class DataMailViewController { - private final DataPetitionComplaintService dataPetitionComplaintService; + private final DataMailService dataMailService; private final DataPetitionComplaintMapper dataPetitionComplaintMapper; /** @@ -53,14 +53,14 @@ public class DataPetitionComplaintViewController { @GetMapping public Result mailVisits(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { // 信访数据总数概览 - JSONObject overview = dataPetitionComplaintService.allMailCount(beginTime, endTime); + JSONObject overview = dataMailService.allMailCount(beginTime, endTime); // 分县市局信初重访领导访排名 - List fxsjFirstMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), RepeatEnum.FIRST_MAIL.getId(), beginTime, endTime); - List fxsjRepeatMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), RepeatEnum.REPEAT_MAIL.getId(), beginTime, endTime); + List fxsjFirstMailList = dataMailService.mailRank(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), RepeatEnum.FIRST_MAIL.getId(), beginTime, endTime); + List fxsjRepeatMailList = dataMailService.mailRank(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), RepeatEnum.REPEAT_MAIL.getId(), beginTime, endTime); List fxsjLeaderViewMailList = dataPetitionComplaintMapper.selectLeaderViewMail(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), beginTime, endTime); // 部委支队初重领导访排名 - List bwzdFirstMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.BUREAU_AFFILIATED.getId(), RepeatEnum.FIRST_MAIL.getId(), beginTime, endTime); - List bwzdRepeatMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.BUREAU_AFFILIATED.getId(), RepeatEnum.REPEAT_MAIL.getId(), beginTime, endTime); + List bwzdFirstMailList = dataMailService.mailRank(DepartGroupEnum.BUREAU_AFFILIATED.getId(), RepeatEnum.FIRST_MAIL.getId(), beginTime, endTime); + List bwzdRepeatMailList = dataMailService.mailRank(DepartGroupEnum.BUREAU_AFFILIATED.getId(), RepeatEnum.REPEAT_MAIL.getId(), beginTime, endTime); List bwzdLeaderViewMailList = dataPetitionComplaintMapper.selectLeaderViewMail(DepartGroupEnum.BUREAU_AFFILIATED.getId(), beginTime, endTime); // 分县市局领导督办、缠访、集访排名 List fxsjEntanglementMailList = dataPetitionComplaintMapper.selectEntanglementMail(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), 1, beginTime, endTime); @@ -90,7 +90,7 @@ public class DataPetitionComplaintViewController { public Result getRecentlyMailTrendByDay(@RequestParam Integer sourcesCode, @RequestParam Integer days, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { JSONObject jsonObject = new JSONObject(); // 库中的数据 2024/10/24 22 - List recentMailTrendVoList = dataPetitionComplaintService.getRecentlyMailTrendByDay(sourcesCode, days, endTime); + List recentMailTrendVoList = dataMailService.getRecentlyMailTrendByDay(sourcesCode, days, endTime); ArrayList dayList = new ArrayList<>(); ArrayList totalList = new ArrayList<>(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd"); @@ -128,7 +128,7 @@ public class DataPetitionComplaintViewController { @GetMapping("/getRecentlyMailTrendMonth") public Result getRecentlyMailTrendByMonth(@RequestParam Integer sourcesCode, @RequestParam Integer year) { JSONObject jsonObject = new JSONObject(); - List recentMailTrendVoList = dataPetitionComplaintService.getRecentlyMailTrendByMonth(sourcesCode, String.valueOf(year)); + List recentMailTrendVoList = dataMailService.getRecentlyMailTrendByMonth(sourcesCode, String.valueOf(year)); ArrayList monthList = new ArrayList<>(); ArrayList totalList = new ArrayList<>(); for (RecentMailTrendByMonthVo recentMailTrendByMonthVo : recentMailTrendVoList) { @@ -151,7 +151,7 @@ public class DataPetitionComplaintViewController { @GetMapping("/getRecentlyMailTrendByMonth12337") public Result getRecentlyMailTrendByMonth12337(@RequestParam Integer year) { JSONObject jsonObject = new JSONObject(); - List recentMailTrendVoList = dataPetitionComplaintService.getRecentlyMailTrendByMonth12337(String.valueOf(year)); + List recentMailTrendVoList = dataMailService.getRecentlyMailTrendByMonth12337(String.valueOf(year)); ArrayList monthList = new ArrayList<>(); ArrayList totalList = new ArrayList<>(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM"); 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 787d555..10d384f 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java @@ -1,17 +1,13 @@ package com.biutag.supervision.controller.datav; -import cn.hutool.core.util.NumberUtil; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.biutag.supervision.constants.enums.CaseVerifProblemNatureEnum; -import com.biutag.supervision.constants.enums.DepartGroupEnum; import com.biutag.supervision.mapper.DataCaseVerifMapper; import com.biutag.supervision.pojo.Result; -import com.biutag.supervision.pojo.dto.CaseVerifDepart; -import com.biutag.supervision.pojo.dto.common.PieItem; -import com.biutag.supervision.pojo.entity.DataCaseVerif; +import com.biutag.supervision.pojo.vo.CaseVerificationCountVo; +import com.biutag.supervision.pojo.vo.CaseVerificationMapVo; import com.biutag.supervision.pojo.vo.EchartsVo; -import com.biutag.supervision.service.DataCaseVerifService; +import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo; +import com.biutag.supervision.service.CaseVerificationService; import lombok.RequiredArgsConstructor; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.web.bind.annotation.GetMapping; @@ -19,7 +15,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -32,84 +27,96 @@ import java.util.List; @RestController public class DataVCaseVerifController { - private final DataCaseVerifService dataCaseVerifService; - private final DataCaseVerifMapper dataCaseVerifMapper; + private final CaseVerificationService caseVerificationService; + + // region 左边 + // 案件核查大屏分县市局排名 + @GetMapping("/getCaseVerificationRank") + public Result getCaseVerificationRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + List fxsjRankList = caseVerificationService.getCaseVerificationRank(beginTime, endTime, 3); + List jsdwRankList = caseVerificationService.getCaseVerificationRank(beginTime, endTime, 4); + JSONObject data = new JSONObject() + .fluentPut("fxsjRankList", fxsjRankList) + .fluentPut("jsdwRankList", jsdwRankList); + return Result.success(data); + } - @GetMapping - public Result caseVerif(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - long total = dataCaseVerifService.count(new LambdaQueryWrapper().between(DataCaseVerif::getDiscoveryTime, beginTime, endTime)); - long confirmed = 0; - JSONObject overview = new JSONObject() - // 案件总数(起) - .fluentPut("total", total) - // 查实案件数 - .fluentPut("confirmed", 0) - // 查处问题(个) - .fluentPut("investigateAndPunish", 0) - // 问责人次 - .fluentPut("accountablePeopleNumber", 0) - // 问责单位数 - .fluentPut("accountableDepartNumber", 0) - // 查实率 - .fluentPut("confirmedRate", total == 0 ? 0 : BigDecimal.valueOf(NumberUtil.div(confirmed, total) * 100).intValue()); - // 分县市局排名 - List fxsjBarList = dataCaseVerifMapper.selectDepartStatistic(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), beginTime, endTime); - // 局属单位排名 - List jsdwBarList = dataCaseVerifMapper.selectDepartStatistic(DepartGroupEnum.BUREAU_AFFILIATED.getId(), beginTime, endTime); - // 执法办案 - List zfbaPieList = dataCaseVerifMapper.selectInvolveProblemGroupByBusinessTypeName(CaseVerifProblemNatureEnum.ZFBA.getLaebl(), beginTime, endTime); - // 服务管理 - List fwglPieList = dataCaseVerifMapper.selectInvolveProblemGroupByBusinessTypeName(CaseVerifProblemNatureEnum.FWGL.getLaebl(), beginTime, endTime); - // 警察纪警规 - List jjjgPieList = dataCaseVerifMapper.selectInvolveProblemGroupByBusinessTypeName(CaseVerifProblemNatureEnum.JJJG.getLaebl(), beginTime, endTime); - // 案件来源占比 - List ajlyPieList = dataCaseVerifMapper.selectGroupByProblemSources(beginTime, endTime); - - JSONObject data = new JSONObject().fluentPut("overview", overview) - .fluentPut("fxsjBarList", fxsjBarList) - .fluentPut("jsdwBarList", jsdwBarList) - .fluentPut("zfbaPieList", zfbaPieList) - .fluentPut("fwglPieList", fwglPieList) - .fluentPut("jjjgPieList", jjjgPieList) - .fluentPut("ajlyPieList", ajlyPieList); + // 案件问题性质 + @GetMapping("/getCaseProblemProperty") + public Result getCaseProblemProperty(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + List zfbaPieList = dataCaseVerifMapper.getCaseProblemProperty(beginTime, endTime, 6); // 执法办案 + List fwglPieList = dataCaseVerifMapper.getCaseProblemProperty(beginTime, endTime, 11); // 服务管理 +// List jgjjPieList = dataCaseVerifMapper.getCaseProblemProperty(beginTime, endTime, 6); // 执法 + JSONObject data = new JSONObject().fluentPut("zfbaPieList", zfbaPieList) + .fluentPut("fwglPieList", fwglPieList); return Result.success(data); } + // endregion - @GetMapping("/getAllCaseVerifCount") - public Result getAllCaseVerifCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - // 案件总数(起) - long total = dataCaseVerifService.count(new LambdaQueryWrapper().between(DataCaseVerif::getDiscoveryTime, beginTime, endTime)); - Integer confirmed = dataCaseVerifService.getConfirmed(beginTime, endTime); // 查实案件数 - Integer investigateAndPunish = dataCaseVerifService.getInvestigateAndPunish(beginTime, endTime); // 查处问题(个) - Integer accountablePeopleNumber = dataCaseVerifService.getAccountablePeopleNumber(beginTime, endTime); // 问责人次 - Integer accountableDepartNumber = dataCaseVerifService.getAccountableDepartNumber(beginTime, endTime); // 问责单位数、 - Double confirmedRate = confirmed.doubleValue() / total * 100; // 查实率 - JSONObject overview = new JSONObject().fluentPut("confirmed", confirmed) - .fluentPut("investigateAndPunish", investigateAndPunish) - .fluentPut("accountablePeopleNumber", accountablePeopleNumber) - .fluentPut("accountableDepartNumber", accountableDepartNumber) - .fluentPut("confirmedRate", confirmedRate) - .fluentPut("total", total); - JSONObject res = new JSONObject().fluentPut("overview", overview); + // region 中间 + // 案件核查大屏中央数据总览 + @GetMapping("/getAllCaseVerificationCount") + public Result getAllCaseVerificationCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + CaseVerificationCountVo overview = caseVerificationService.getAllCaseVerificationCount(beginTime, endTime); + JSONObject res = new JSONObject().fluentPut("overview", overview); return Result.success(res); + } + // 案件核查大屏地图 + @GetMapping("/getCaseVerificationMap") + public Result getCaseVerificationMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + List caseVerificationMapList = caseVerificationService.getCaseVerificationMap(beginTime, endTime); + JSONObject res = new JSONObject().fluentPut("caseVerificationMapList", caseVerificationMapList); + return Result.success(res); } - @GetMapping("/trend") - public Result caseVerifTrend( - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime, - @RequestParam Integer month) { - List ajhcqsList = dataCaseVerifMapper.selectTrend(beginTime, endTime, 12); - JSONObject data = new JSONObject().fluentPut("ajhcqsList", ajhcqsList); + // 查处问题趋势 + @GetMapping("/getCaseVerificationTrend") + public Result getCaseVerificationTrend(@RequestParam Integer year) { + List proTrendList = caseVerificationService.getCaseVerificationTrend(String.valueOf(year)); + JSONObject data = new JSONObject().fluentPut("proTrendList", proTrendList); return Result.success(data); + } +// endregion + + + // region 右边 + // 案件来源占比 和 问责处理情况 + @GetMapping("/getCaseSourceRateAndDealSituation") + public Result getCaseSourceRateAndDealSituation(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + List caseSourceRateList = caseVerificationService.getCaseSourceRate(beginTime, endTime); + List dealSituationPieList = caseVerificationService.getDealSituation(beginTime, endTime); + JSONObject data = new JSONObject() + .fluentPut("caseSourceRateList", caseSourceRateList) + .fluentPut("dealSituationPieList", dealSituationPieList); + return Result.success(data); + } + + // 禁闭处理情况 和 停职处理情况 + @GetMapping("/getConfinementAndPause") + public Result getConfinement(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + List jbclList = caseVerificationService.getConfinementAndPause(beginTime, endTime, 1); // 禁闭 + List tzclList = caseVerificationService.getConfinementAndPause(beginTime, endTime, 2); // 停职 + JSONObject data = new JSONObject() + .fluentPut("jbclList", jbclList) + .fluentPut("tzclList", tzclList); + 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 edeee4c..8ae93f5 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java @@ -1,10 +1,18 @@ package com.biutag.supervision.controller.datav; +import com.alibaba.fastjson.JSONObject; import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.common.PieItem; +import com.biutag.supervision.pojo.entity.CountyStreetDept; 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.service.CountyStreetDeptService; import com.biutag.supervision.service.DataRightsComfortService; import com.biutag.supervision.service.RpcApplyService; import com.biutag.supervision.service.RpcInfringerResultService; + import lombok.RequiredArgsConstructor; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.web.bind.annotation.GetMapping; @@ -12,8 +20,13 @@ 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.*; +/** + * 维权抚慰大屏相关 + * + * @author: sh + */ @RequestMapping("datav/rightsComfort") @RequiredArgsConstructor @RestController @@ -23,32 +36,156 @@ public class DatavRightsComfortController { private final DataRightsComfortService dataRightsComfortService; private final RpcInfringerResultService rpcInfringerResultService; + private final CountyStreetDeptService countyStreetDeptService; @GetMapping public Result rightsComfort(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - DataRightsComfortModel result = new DataRightsComfortModel(); +// DataRightsComfortModel result = new DataRightsComfortModel(); // 维权案件总数 // 受侵害人数 // 抚慰人数 - result.setComfortPersonNumber(dataRightsComfortService.countComfortPersonNumber(beginTime, endTime)); +// result.setComfortPersonNumber(dataRightsComfortService.countComfortPersonNumber(beginTime, endTime)); // 打击处理人数 - result.setHitPersonNumber(dataRightsComfortService.countHitPersonNumber(beginTime, endTime)); +// result.setHitPersonNumber(dataRightsComfortService.countHitPersonNumber(beginTime, endTime)); // 抚慰金额(万元) - result.setComfortMoney(dataRightsComfortService.countComfortMoney(beginTime, endTime)); +// result.setComfortMoney(dataRightsComfortService.countComfortMoney(beginTime, endTime)); // 维权案件情况 // 案件类别占比 // 打处情况 - result.setPunishmentSituation(dataRightsComfortService.selectPunishmentSituation(beginTime, endTime)); +// result.setPunishmentSituation(dataRightsComfortService.selectPunishmentSituation(beginTime, endTime)); // 抚慰情况 - result.setComfortSituation(dataRightsComfortService.selectComfortSituation(beginTime, endTime)); +// result.setComfortSituation(dataRightsComfortService.selectComfortSituation(beginTime, endTime)); // 民辅警受伤情况 // 发案情况占比 - return Result.success(result); +// return Result.success(result); + return null; + } + + + // region 左边 + // 维权案件和抚慰金情况 + @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); // 分县市局维权排名 + JSONObject data = new JSONObject() + .fluentPut("fxsjRightsRankList", fxsjRightsRankList) + .fluentPut("jsdwRightsRankList", jsdwRightsRankList); + return Result.success(data); + } + + // 案件类别占比 + @GetMapping("/getCaseTypeRate") + public Result getCaseTypeRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + return null; + } + +// endregion + +// region 中间 + + // 抚慰大屏中央总览数据 + @GetMapping("/getALlComfortCount") + public Result getALlComfortCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + Integer comfortTotal = dataRightsComfortService.countComfortPersonNumber(beginTime, endTime); // 抚慰人数 + Integer hitTotal = dataRightsComfortService.countHitPersonNumber(beginTime, endTime); // 打击处理人数 + Double comfortMoney = dataRightsComfortService.countComfortMoney(beginTime, endTime); // 抚慰金额 + ComfortCountVO comfortOverview = new ComfortCountVO(); + comfortOverview.setComfortTotal(comfortTotal); + comfortOverview.setHitTotal(hitTotal); + comfortOverview.setComfortMoney(comfortMoney); + JSONObject data = new JSONObject().fluentPut("comfortOverview", comfortOverview); + return Result.success(data); + } + + // 打处情况 + @GetMapping("/getPunishmentSituation") + public Result getPunishmentSituation(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + List punishmentSituationList = dataRightsComfortService.selectPunishmentSituation(beginTime, endTime); + JSONObject data = new JSONObject().fluentPut("punishmentSituationList", punishmentSituationList); + return Result.success(data); + } + + // 抚慰情况 + @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); + JSONObject data = new JSONObject().fluentPut("comfortSituationList", comfortSituationList); + return Result.success(data); + } + +// 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); + return Result.success(data); + } + + // 发案情况占比 + @GetMapping("/getCaseAriseSituationRate") + 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 incidentPoliceTypeList = new ArrayList<>(); + // 发案单位 + List incidentOrgList = dataRightsComfortService.getIncidentOrg(beginTime, endTime); + + JSONObject data = new JSONObject() + .fluentPut("incidentLinkList", incidentLinkList) + .fluentPut("incidentPoliceTypeList", incidentPoliceTypeList) + .fluentPut("incidentOrgList", incidentOrgList); + return Result.success(data); } + + + @GetMapping("/test") + public Result test() { + Integer departId = 3490; + + List depts = countyStreetDeptService.getTest(departId); + Map geoJson = new HashMap<>(); + geoJson.put("type", "FeatureCollection"); + List> features = new ArrayList<>(); + for (CountyStreetDept dept : depts) { + Map feature = new HashMap<>(); + feature.put("type", "Feature"); + + Map properties = new HashMap<>(); + properties.put("name", dept.getName()); + feature.put("properties", properties); + + Map geometry = new HashMap<>(); + geometry.put("type", "MultiPolygon"); +// geometry.put("coordinates", new Gson().fromJson(dept.getGeometry(), Object.class)); + feature.put("geometry", geometry); + features.add(feature); + } + geoJson.put("features", features); + + JSONObject jsonObject = new JSONObject(); + jsonObject.put("geoJson", geoJson); + return Result.success(jsonObject); + } + + +// endregion + } diff --git a/src/main/java/com/biutag/supervision/controller/datav/PoliceComment.java b/src/main/java/com/biutag/supervision/controller/datav/PoliceComment.java deleted file mode 100644 index 8ef3c4a..0000000 --- a/src/main/java/com/biutag/supervision/controller/datav/PoliceComment.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.biutag.supervision.controller.datav; - -import com.alibaba.fastjson.JSONObject; -import com.biutag.supervision.pojo.Result; -import com.biutag.supervision.util.HttpClientUtil; -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.Date; -import java.util.HashMap; -import java.util.Map; - -/** - * @Auther: sh - * @Date: 2024/11/17 11:04 - * @Description: - */ - - -@Slf4j -@RestController -@RequiredArgsConstructor -@RequestMapping("datav/DSJ") -public class PoliceComment { - private final String BASE_URL = ""; - - - @GetMapping("/GetDCQK") - public Result getDCQK() { - Map params = new HashMap<>(); - params.put("PeriodId", "6"); - params.put("PeriodSonID", "-1"); - params.put("OrgNo", "4304"); - Map header = new HashMap<>(); - header.put("Content-Type", "application/json"); - String s = HttpClientUtil.doPost(BASE_URL, params, header); - JSONObject jsonObject = JSONObject.parseObject(s); - log.info("返回数据字符串=============" + s); - log.info("返回数据JSON对象=============" + jsonObject.toJSONString()); - System.out.println(jsonObject.get("data").toString()); - return Result.success(jsonObject); - } - - - @GetMapping("/GetBMYYBQS") - public Result getBMYYBQS(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - Map params = new HashMap<>(); - params.put("PeriodId", "6"); - params.put("OrgNo", "4304"); - String res = HttpClientUtil.doPost(BASE_URL, params, null); - log.info("返回GetBMYYBQS数据字符串=============" + res); - return Result.success(); - } - - - @GetMapping("/GetZHMYLPM") - public Result getGetZHMYLPM(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - Map params = new HashMap<>(); - params.put("PeriodId", "6"); - String res = HttpClientUtil.doPost(BASE_URL, params, null); - log.info("返回GetZHMYLPM数据字符串=============" + res); - return Result.success(); - } - - @GetMapping("/GetRCSQQK") - public Result getRCSQQK(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){ - Map params = new HashMap<>(); - params.put("PeriodId", "6"); - params.put("PeriodSonID", "-1"); - params.put("OrgNo", "4304"); - String res = HttpClientUtil.doPost(BASE_URL, params, null); - log.info("返回GetRCSQQK数据字符串=============" + res); - return Result.success(); - } - - -} - 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 f5615fa..444398f 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java @@ -82,7 +82,7 @@ public class SupervisionNotifyController { public Result getMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { //地图数据 - List superviseTempMapVoList = dataSupervisionNotifyService.getsupervisionMapIconInfo(beginTime, endTime); + List superviseTempMapVoList = dataSupervisionNotifyService.getSupervisionMapIconInfo(beginTime, endTime); JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList); return Result.success(data); } diff --git a/src/main/java/com/biutag/supervision/controller/datav/VideoSuperviseController.java b/src/main/java/com/biutag/supervision/controller/datav/VideoSuperviseController.java new file mode 100644 index 0000000..d97fa0f --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/datav/VideoSuperviseController.java @@ -0,0 +1,105 @@ +package com.biutag.supervision.controller.datav; + +import com.alibaba.fastjson.JSONObject; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.vo.*; +import com.biutag.supervision.service.VideoSuperviseService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.stereotype.Controller; +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; + +/** + * @Auther: sh + * @Date: 2024/11/29 09:32 + * @Description: 视频督察大屏 + */ +@Tag(name = "视频督察大屏", description = "视频督察大屏") +@RestController +@RequiredArgsConstructor +@RequestMapping("datav/videoSupervise") +public class VideoSuperviseController { + + private final VideoSuperviseService videoSuperviseService; + + + //region 左边 + + // 获取视频督察大屏问题数排名 + @Operation(summary = "视频督察大屏问题数排名") + @GetMapping("/getVideoSuperviseProblemRank") + public Result getVideoSuperviseProblemRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + List fxsjVideoSuperviseProblemRankList = videoSuperviseService.getVideoSuperviseProblemRank(beginTime, endTime, 3); + List jsdwVideoSuperviseProblemRankList = videoSuperviseService.getVideoSuperviseProblemRank(beginTime, endTime, 4); + JSONObject data = new JSONObject(); + data.fluentPut("fxsjVideoSuperviseProblemRankList", fxsjVideoSuperviseProblemRankList); + data.fluentPut("jsdwVideoSuperviseProblemRankList", jsdwVideoSuperviseProblemRankList); + return Result.success(data); + } + //endregion + + //region 中间 + + // 获取视频督察中央数据 + @Operation(summary = "视频督察大屏中央数据") + @GetMapping("/getAllVideoSuperviseCount") + public Result getAllVideoSuperviseCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + // 获取视频督察中央数据 + VideoSuperviseCountVo overview = videoSuperviseService.getAllVideoSuperviseCount(beginTime, endTime); + JSONObject data = new JSONObject().fluentPut("overview", overview); + return Result.success(data); + } + + // 获取视频督察地图数据 + @Operation(summary = "视频督察大屏地图数据") + @GetMapping("/getVideoSuperviseMap") + public Result getVideoSuperviseMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + + // 地图数据 + List videoSuperviseMapIconVoList = Optional.ofNullable(videoSuperviseService.getVideoSuperviseMapIconInfo(beginTime, endTime)). + orElseGet(ArrayList::new); + JSONObject data = new JSONObject().fluentPut("videoSuperviseMapIconVoList", videoSuperviseMapIconVoList); + return Result.success(data); + } + + // 获取视频督察大屏中央问题趋势统计 + @Operation(summary = "数据大屏问题趋势统计") + @GetMapping("/getVideoSuperviseTrend") + public Result getVideoSuperviseTrend(@RequestParam Integer year) { + List videoSuperviseTrendList = videoSuperviseService.getVideoSuperviseTrend(String.valueOf(year)); + JSONObject jsonObject = new JSONObject().fluentPut("videoSuperviseTrendList", videoSuperviseTrendList); + return Result.success(jsonObject); + } + //endregion + + + // region 右边 + + // 问题类型占比 + @Operation(summary = "数据大屏问题类型占比") + @GetMapping("/getVideoSuperviseProblemTypeRate") + public Result getVideoSuperviseProblemTypeRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + List videoSuperviseProblemTypeRate = videoSuperviseService.getVideoSuperviseProblemTypeRate(beginTime, endTime); + JSONObject jsonObject = new JSONObject().fluentPut("videoSuperviseProblemTypeRate", videoSuperviseProblemTypeRate); + return Result.success(jsonObject); + } + + + // endregion + +} + diff --git a/src/main/java/com/biutag/supervision/mapper/CountyStreetDeptMapper.java b/src/main/java/com/biutag/supervision/mapper/CountyStreetDeptMapper.java new file mode 100644 index 0000000..bda91d8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/CountyStreetDeptMapper.java @@ -0,0 +1,25 @@ +package com.biutag.supervision.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.CountyStreetDept; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** +* @author 舒云 +* @description 针对表【county_street_dept(区县管理机构表)】的数据库操作Mapper +* @createDate 2024-12-03 17:20:39 + +*/ +public interface CountyStreetDeptMapper extends BaseMapper { + + @Select("select * from county_street_dept where pid = #{id}") + List props(Integer id); + +} + + + + diff --git a/src/main/java/com/biutag/supervision/mapper/DataCaseVerifMapper.java b/src/main/java/com/biutag/supervision/mapper/DataCaseVerifMapper.java index e1358c8..186a6c6 100644 --- a/src/main/java/com/biutag/supervision/mapper/DataCaseVerifMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/DataCaseVerifMapper.java @@ -19,46 +19,22 @@ public interface DataCaseVerifMapper extends BaseMapper { @Select("select involve_problem name, count(originId) value from data_case_verif where business_type_name = #{businessTypeName} and discovery_time between #{beginTime} and #{endTime} group by involve_problem") List selectInvolveProblemGroupByBusinessTypeName(String businessTypeName, Date beginTime, Date endTime); - @Select("select problem_sources name, count(originId) value from data_case_verif where discovery_time between #{beginTime} and #{endTime} group by problem_sources") - List selectGroupByProblemSources(Date beginTime, Date endTime); + @Select("select problem_sources name, " + + "count(originId) value from data_case_verif " + + "where discovery_time between #{beginTime} and #{endTime} " + + "group by problem_sources") + List getCaseSourceRate(Date beginTime, Date endTime); - @Select("SELECT DATE_FORMAT(discoveryTime, '%m') AS name, COUNT(*) AS value FROM negative " + - "WHERE discoveryTime " + - "BETWEEN IF(DATE_SUB(#{endTime}, INTERVAL #{months} MONTH) < DATE_FORMAT(#{endTime}, '%Y-01-01'), " + - " DATE_FORMAT(#{endTime}, '%Y-01-01'), DATE_SUB(#{endTime}, " + - " INTERVAL #{months} MONTH)) " + - " AND #{endTime} " + - " AND checkStatus IN (1, 2) " + - "GROUP BY name " + - "ORDER BY value asc;") - List selectTrend(Date beginTime, Date endTime, Integer months); - /** - * 查实案件数 - * @param beginTime - * @param endTime - * @return - */ - @Select("SELECT count(*) total FROM negative ng " + - "WHERE ng.checkStatus<>3 " + - "AND ng.problemSourcesCode IN (17, 18, 19, 20) " + - "AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime}") - Integer getConfirmed(Date beginTime, Date endTime); - - @Select("") - Integer getInvestigateAndPunish(Date beginTime, Date endTime); - @Select("SELECT count(DISTINCT( nb.blameName)) as total FROM negative ng " + - "LEFT JOIN negative_blame nb on ng.id = nb.negativeId " + - "WHERE ng.problemSourcesCode in(17, 18, 19, 20)" + - "and ng.checkStatus<>3 " + - "AND discoveryTime BETWEEN #{beginTime} AND #{endTime}") - Integer getAccountablePeopleNumber(Date beginTime, Date endTime); - - @Select("SELECT count(DISTINCT(involveDepartName)) as total FROM negative ng " + - "WHERE problemSourcesCode in(17, 18, 19, 20) " + - "and ng.checkStatus<>3 " + - "AND discoveryTime BETWEEN #{beginTime} AND #{endTime}") - Integer getAccountableDepartNumber(Date beginTime, Date endTime); + @Select("SELECT npr.threeLevelContent AS `name`, count(*) AS `value` " + + "FROM negative ng " + + "INNER JOIN negative_problem_relation npr ON ng.id=npr.negativeId " + + "WHERE ng.checkStatus <>3 " + + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "AND ng.problemSourcesCode IN (17, 18, 19, 20) " + + "AND businessTypeCode = #{businessId} " + + "GROUP BY threeLevelContent ") + List getCaseProblemProperty(Date beginTime, Date endTime, Integer businessId); } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index 1a43b44..751e039 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -97,7 +97,6 @@ public interface NegativeMapper extends BaseMapper { // endregion - // region 现场督察大屏 @Select("SELECT count(DISTINCT(ng.id)) as proTotal, " + @@ -147,13 +146,23 @@ public interface NegativeMapper extends BaseMapper { "WHERE discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND problemSourcesCode IN (13, 15)") RankVoSupTwo getTemp(Date beginTime, Date endTime); - @Select("SELECT a.departId, a.name, COUNT(DISTINCT c.id) AS totalPro, COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS changing, COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS changed, COUNT(DISTINCT c.involveDepartId) AS relationOrg, COUNT(DISTINCT d.blameIdCode) AS personNum, ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS changedRate\n" + - "FROM statistics_depart a INNER JOIN sup_depart b ON a.departId = b.pid " + - " INNER JOIN negative c ON b.id = c.involveDepartId " + - " LEFT JOIN negative_blame d ON c.id = d.negativeId " + - "WHERE a.groupId = 3 AND discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND problemSourcesCode IN (13, 15) " + - "GROUP BY a.name, a.departId") - List getMap(Date beginTime, Date endTime); + @Select("SELECT sd1.short_name AS `name`, " + + "sd1.id as departId, " + + "COUNT(DISTINCT ng.id ) AS totalPro, " + + "COUNT( DISTINCT if(ng.isRectifyCode=0, ng.id, NULL)) AS changing, " + + "COUNT( DISTINCT if(ng.isRectifyCode=1, ng.id, NULL)) AS changed, " + + "COUNT(DISTINCT nb.blameName ) AS personNum," + + "COUNT(DISTINCT ng.involveDepartId) AS relationOrg, " + + "IFNULL( ROUND( ( COUNT(DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL)) / COUNT( DISTINCT ng.id ) ) * 100, 1 ), 0) AS changedRate " + + "FROM sup_depart sd " + + "INNER JOIN sup_depart sd1 ON sd.pid = sd1.id AND sd1.statistics_group_id = 3 " + + "LEFT JOIN negative ng ON sd.id = ng.involveDepartId " + + "AND ng.checkStatus <> 3 " + + "AND ng.problemSourcesCode IN (13, 15) " + + "AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " + + "GROUP BY `name`;") + List getSupervisionMapIconInfo(Date beginTime, Date endTime); List getSupervisionTrend(String time); @@ -183,6 +192,133 @@ public interface NegativeMapper extends BaseMapper { "order by value desc") List getYellowBetRankList(Date beginTime, Date endTime, Integer groupId, Integer queryType); + // endregion + + // region 视频督察大屏 + @Select("SELECT " + + "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 sup_depart sd " + + "INNER JOIN negative ng ON sd.id = ng.involveDepartId " + + "LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " + + "WHERE ng.checkStatus IN ('1','2') " + + "AND problemSourcesCode = 16 " + + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime};") + VideoSuperviseCountVo getAllVideoSuperviseCount(Date beginTime, Date endTime); + + @Select("SELECT npr.threeLevelContent AS `name`, " + + "COUNT(*) AS `value` " + + "FROM negative ng " + + "INNER JOIN negative_problem_relation npr " + + "on ng.id=npr.negativeId " + + "WHERE ng.problemSourcesCode=16 " + + "AND checkStatus <> 3 " + + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY npr.threeLevelContent") + List getVideoSuperviseProblemTypeRate(Date beginTime, Date endTime); + + @Select("SELECT sd1.short_name AS label, " + + "count(*) as `value`" + + " FROM negative ng " + + "INNER JOIN sup_depart sd ON ng.involveDepartId=sd.id " + + "INNER JOIN sup_depart sd1 ON sd.pid=sd1.id AND sd1.statistics_group_id=#{groupId} " + + "WHERE checkStatus <> 3 " + + "AND problemSourcesCode=16 " + + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY sd1.short_name ") + List getVideoSuperviseProblemRank(Date beginTime, Date endTime, Integer groupId); + + @Select("SELECT sd1.short_name AS `name`, " + + "sd1.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 sup_depart sd " + + "INNER JOIN sup_depart sd1 on sd.pid=sd1.id AND sd1.statistics_group_id=3 " + + "LEFT JOIN negative ng on sd.id=ng.involveDepartId " + + "AND checkStatus <> 3 " + + "AND problemSourcesCode=16 " + + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " + + "GROUP BY `name`;") + List getVideoSuperviseMapIconInfo(Date beginTime, Date endTime); + + + List getVideoSuperviseTrend(String year); + + +// endregion + +// region 案件核查大屏 + @Select("SELECT sd1.short_name AS label, " + + "count(DISTINCT ng.id) AS `value` " + + "FROM negative ng " + + "INNER JOIN sup_depart sd ON ng.involveDepartId=sd.id " + + "INNER JOIN sup_depart sd1 ON sd.pid=sd1.id AND sd1.statistics_group_id=#{groupId} " + + "WHERE checkStatus <> 3 " + + "AND problemSourcesCode in (17, 18, 19, 20) " + + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY sd1.short_name") + List getCaseVerificationRank(Date beginTime, Date endTime, int groupId); + + List getCaseVerificationTrend(String year); + + @Select("SELECT 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.blameName ) AS punishPre, " + + "COUNT( DISTINCT ng.involveDepartId ) AS punishOrg, " + + "IFNULL( ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) ) / count(DISTINCT ng.id)*100, 1 ), 0 ) AS rate " + + "FROM negative ng " + + "INNER JOIN negative_blame nb ON ng.id=nb.negativeId " + + "WHERE discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "AND problemSourcesCode in (17, 18, 19, 20) ") + CaseVerificationCountVo getAllCaseVerificationCount(Date beginTime, Date endTime); + + + @Select("SELECT sd.short_name AS `name`, " + + "sd.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.blameName) AS punishPre, " + + "COUNT(DISTINCT ng.involveDepartId) AS punishOrg, " + + "IFNULL(ROUND(COUNT(DISTINCT IF(ng.isRectifyCode = 1, ng.id, NULL)) / NULLIF(COUNT(DISTINCT ng.id), 0) * 100, 1), 0) AS rate " + + "FROM sup_depart sd " + + "INNER JOIN sup_depart sd1 ON sd.id = sd1.pid AND sd.statistics_group_id = 3 " + + "LEFT JOIN negative ng ON sd1.id = ng.involveDepartId " + + "AND ng.problemSourcesCode IN (17, 18, 19, 20) " + + "AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " + + "GROUP BY sd.short_name;") + List getCaseVerificationMap(Date beginTime, Date endTime); + + @Select("SELECT nb.handleResultName as `name`, count(*) as `value` " + + "FROM negative ng " + + "INNER JOIN negative_blame nb ON nb.negativeId=ng.id " + + "WHERE handleResultName is NOT NULL " + + "AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "AND ng.problemSourcesCode in (17, 18, 19, 20) " + + "AND ng.checkStatus <>3 " + + "GROUP BY nb.handleResultName") + List getDealSituation(Date beginTime, Date endTime); + + @Select("SELECT npr.threeLevelContent AS `name`, " + + "count(DISTINCT(ng.id)) as `value` FROM negative ng " + + "INNER JOIN negative_blame nb ON nb.negativeId=ng.id AND nb.superviseMeasuresCode=#{type} " + + "INNER JOIN negative_problem_relation npr ON ng.id=npr.negativeId " + + "WHERE ng.checkStatus<>3 " + + "AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "GROUP BY npr.threeLevelContent") + List getConfinementAndPause(Date beginTime, Date endTime, Integer type); + + +// endregion } diff --git a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java index 88445f0..cca0ecd 100644 --- a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.biutag.supervision.pojo.dto.common.PieItem; import com.biutag.supervision.pojo.entity.RpcApply; import com.biutag.supervision.pojo.entity.RpcInfringerResult; +import com.biutag.supervision.pojo.vo.EchartsVo; +import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo; import org.apache.ibatis.annotations.Select; import java.util.Date; @@ -33,5 +35,36 @@ public interface RpcApplyMapper extends BaseMapper { "GROUP BY c.job") List selectComfortSituation(Date beginTime, Date endTime); + @Select("SELECT sd1.short_name AS label, " + + "count(*) AS VALUE " + + "FROM sup_depart sd1 inner JOIN " + + "(SELECT ra.depart_name, sd.short_name, sd.pid, ra.apply_date, ra.type FROM rpc_apply ra INNER JOIN sup_depart sd on ra.depart_id=sd.id) temp " + + "on sd1.id = temp.pid AND sd1.statistics_group_id=#{groupId} " + + "WHERE temp.apply_date BETWEEN #{beginTime} AND #{endTime} " + + "AND temp.type=1 " + + "GROUP BY sd1.short_name " + + "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 ") + 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;") + 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;") + List getIncidentOrg(Date beginTime, Date endTime); } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/CountyStreetDept.java b/src/main/java/com/biutag/supervision/pojo/entity/CountyStreetDept.java new file mode 100644 index 0000000..af54cd1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/CountyStreetDept.java @@ -0,0 +1,92 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 区县管理机构表 + * @TableName county_street_dept + */ +@TableName(value ="county_street_dept") +@Data +public class CountyStreetDept implements Serializable { + /** + * + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 父级部门名称 + */ + @TableField(value = "dept_pid_name") + private String deptPidName; + + /** + * 父级部门id + */ + @TableField(value = "dept_pid") + private String deptPid; + + /** + * + */ + @TableField(value = "pid") + private String pid; + + /** + * + */ + @TableField(value = "coordinates") + private String coordinates; + + /** + * + */ + @TableField(value = "level") + private String level; + + /** + * + */ + @TableField(value = "name") + private String name; + + /** + * + */ + @TableField(value = "sort") + private Integer sort; + + /** + * + */ + @TableField(value = "geometry") + private String geometry; + + /** + * 所属区域 + */ + @TableField(value = "area_name") + private String areaName; + + /** + * 部门id + */ + @TableField(value = "dept_id") + private String deptId; + + /** + * + */ + @TableField(value = "dept_name") + private String deptName; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/vo/CaseVerificationCountVo.java b/src/main/java/com/biutag/supervision/pojo/vo/CaseVerificationCountVo.java new file mode 100644 index 0000000..247e9a6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/CaseVerificationCountVo.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Data; + +/** + * @Auther: sh + * @Date: 2024/11/29 18:19 + * @Description: 案件核查总览统计 + */ +@Data +public class CaseVerificationCountVo { + + private Integer total; // 总案件数 + private Integer confirmed; // 已查实案件数 + private Integer dealCasePro; // 查处理案件数 + private Integer punishPre; // 问责人数 + private Integer punishOrg; // 问责单位数 + private Double rate; // 查实率 + + +} + diff --git a/src/main/java/com/biutag/supervision/pojo/vo/CaseVerificationMapVo.java b/src/main/java/com/biutag/supervision/pojo/vo/CaseVerificationMapVo.java new file mode 100644 index 0000000..fb59c9e --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/CaseVerificationMapVo.java @@ -0,0 +1,21 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Data; + +/** + * @Auther: sh + * @Date: 2024/11/29 19:29 + * @Description: + */ +@Data +public class CaseVerificationMapVo { + private String name; + private String departId; + private Integer total; // 总案件数 + private Integer confirmed; // 已查实案件数 + private Integer dealCasePro; // 查处理案件数 + private Integer punishPre; // 问责人数 + private Integer punishOrg; // 问责单位数 + private Double rate; // 查实率 +} + diff --git a/src/main/java/com/biutag/supervision/pojo/vo/ComfortCountVO.java b/src/main/java/com/biutag/supervision/pojo/vo/ComfortCountVO.java new file mode 100644 index 0000000..e6b743a --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/ComfortCountVO.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Data; + +/** + * @Auther: sh + * @Date: 2024/12/2 15:21 + * @Description: 维权抚慰大屏中央的数据 + */ +@Data +public class ComfortCountVO { + private Integer comfortCaseTotal; // 维权案件总数 + private Integer hurtTotal; // 受侵害人数 + private Integer comfortTotal; // 抚慰人数 + private Integer hitTotal; // 打击处理人数 + private Double comfortMoney; // 抚慰金额 +} + diff --git a/src/main/java/com/biutag/supervision/pojo/vo/MapAreaVo.java b/src/main/java/com/biutag/supervision/pojo/vo/MapAreaVo.java new file mode 100644 index 0000000..b002996 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/MapAreaVo.java @@ -0,0 +1,21 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Data; + +import java.util.Map; + +/** + * @Auther: sh + * @Date: 2024/12/3 17:11 + * @Description: 地图区域json + */ +@Data +public class MapAreaVo { + + private String type = "FeatureCollection"; + private String name; + private Map features; + + +} + diff --git a/src/main/java/com/biutag/supervision/pojo/vo/RankVoSup.java b/src/main/java/com/biutag/supervision/pojo/vo/RankVoSup.java deleted file mode 100644 index f776669..0000000 --- a/src/main/java/com/biutag/supervision/pojo/vo/RankVoSup.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.biutag.supervision.pojo.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @Auther: sh - * @Date: 2024/11/17 01:35 - * @Description: - */ -@Data -@AllArgsConstructor -public class RankVoSup { - private String problemNumber; // 问题数 - private String rectifingNumber; // 整改中 - private String rectifedNumber; // 已整改 - private String departNumber; // 部门数 - private String personNumber; // 人员数 - private String rectifyRate; // 整改率 -} - diff --git a/src/main/java/com/biutag/supervision/pojo/vo/VideoSuperviseCountVo.java b/src/main/java/com/biutag/supervision/pojo/vo/VideoSuperviseCountVo.java new file mode 100644 index 0000000..33bbb61 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/VideoSuperviseCountVo.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Auther: sh + * @Date: 2024/11/29 10:15 + * @Description: 视频督察中央总览vo + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class VideoSuperviseCountVo { + private Integer discoverProblem; + private Integer changedProblem; + private Integer relativeOrg; + private Integer relativePer; + private Double changedRate; +} + diff --git a/src/main/java/com/biutag/supervision/pojo/vo/VideoSuperviseMapIconVo.java b/src/main/java/com/biutag/supervision/pojo/vo/VideoSuperviseMapIconVo.java new file mode 100644 index 0000000..9b24bf3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/VideoSuperviseMapIconVo.java @@ -0,0 +1,27 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Auther: sh + * @Date: 2024/11/29 09:50 + * @Description: + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class VideoSuperviseMapIconVo { + + private String name; + private String departId; + private Integer discoverProblem; + private Integer changedProblem; + private Integer relativeOrg; + private Integer relativePer; + private Integer changedRate; +} + diff --git a/src/main/java/com/biutag/supervision/service/CaseVerificationService.java b/src/main/java/com/biutag/supervision/service/CaseVerificationService.java new file mode 100644 index 0000000..77eeb2b --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/CaseVerificationService.java @@ -0,0 +1,68 @@ +package com.biutag.supervision.service; + +import com.biutag.supervision.mapper.DataCaseVerifMapper; +import com.biutag.supervision.mapper.NegativeMapper; +import com.biutag.supervision.pojo.dto.common.PieItem; +import com.biutag.supervision.pojo.vo.CaseVerificationCountVo; +import com.biutag.supervision.pojo.vo.CaseVerificationMapVo; +import com.biutag.supervision.pojo.vo.EchartsVo; +import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * @Auther: sh + * @Date: 2024/11/29 15:55 + * @Description: + */ +@RequiredArgsConstructor +@Service +public class CaseVerificationService { + + private final NegativeMapper negativeMapper; + private final DataCaseVerifMapper dataCaseVerifMapper; + + + + + public List getCaseVerificationRank(Date beginTime, Date endTime, int groupId) { + List res = negativeMapper.getCaseVerificationRank(beginTime, endTime, groupId); + return res; + } + + + + public List getCaseVerificationTrend(String year) { + List res = negativeMapper.getCaseVerificationTrend(year); + return res; + } + + public List getCaseSourceRate(Date beginTime, Date endTime) { + List res = dataCaseVerifMapper.getCaseSourceRate(beginTime, endTime); + return res; + } + + public CaseVerificationCountVo getAllCaseVerificationCount(Date beginTime, Date endTime) { + CaseVerificationCountVo res = negativeMapper.getAllCaseVerificationCount(beginTime, endTime); + return res; + } + + public List getCaseVerificationMap(Date beginTime, Date endTime) { + List res = negativeMapper.getCaseVerificationMap(beginTime, endTime); + return res; + } + + public List getDealSituation(Date beginTime, Date endTime) { + List res = negativeMapper.getDealSituation(beginTime, endTime); + return res; + } + + public List getConfinementAndPause(Date beginTime, Date endTime, Integer type) { + List res = negativeMapper.getConfinementAndPause(beginTime,endTime, type); + return res; + } +} + diff --git a/src/main/java/com/biutag/supervision/service/CountyStreetDeptService.java b/src/main/java/com/biutag/supervision/service/CountyStreetDeptService.java new file mode 100644 index 0000000..f960f25 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/CountyStreetDeptService.java @@ -0,0 +1,30 @@ +package com.biutag.supervision.service; + + +import com.biutag.supervision.mapper.CountyStreetDeptMapper; +import com.biutag.supervision.pojo.entity.CountyStreetDept; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author 舒云 + * @description 针对表【county_street_dept(区县管理机构表)】的数据库操作Service实现 + * @createDate 2024-12-03 17:20:39 + */ +@Service +@RequiredArgsConstructor +public class CountyStreetDeptService { + + private final CountyStreetDeptMapper countyStreetDeptMapper; + + public List getTest(Integer id) { + List res = countyStreetDeptMapper.props(id); + return res; + } +} + + + + diff --git a/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java b/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java index cd0567c..21a15fa 100644 --- a/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java +++ b/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java @@ -104,25 +104,11 @@ public class DataCaseVerifService extends ServiceImpl { + + private final NegativeService negativeService; + + private final DataPetitionComplaintMapper dataPetitionComplaintMapper; + + private final DataPetition12337Mapper dataPetition12337Mapper; + + public Page page(DataPetitionComplaintQueryParam queryParam) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(DataPetitionComplaint::getProblemSourcesCode, queryParam.getProblemSourcesCode()) + .like(StrUtil.isNotBlank(queryParam.getOriginId()), DataPetitionComplaint::getOriginId, queryParam.getOriginId()) + .like(StrUtil.isNotBlank(queryParam.getThingDesc()), DataPetitionComplaint::getThingDesc, queryParam.getThingDesc()) + .orderByDesc(DataPetitionComplaint::getCreateTime); + if (queryParam.getDiscoveryTime().size() == 2) { + queryWrapper.between(DataPetitionComplaint::getDiscoveryTime, queryParam.getDiscoveryTime().get(0), queryParam.getDiscoveryTime().get(1)); + } + if (StrUtil.isNotBlank(queryParam.getResponderKey()) && StrUtil.isNotBlank(queryParam.getResponderValue())) { + switch (queryParam.getResponderKey()) { + case "name": + queryWrapper.like(DataPetitionComplaint::getResponderName, queryParam.getResponderValue()); + break; + case "phone": + queryWrapper.like(DataPetitionComplaint::getResponderPhone, queryParam.getResponderValue()); + break; + } + } + return page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); + } + + public boolean save(DataPetitionComplaintDto dto) { + DataPetitionComplaint dataPetitionComplaint = new DataPetitionComplaint(); + BeanUtil.copyProperties(dto, dataPetitionComplaint); + dataPetitionComplaint.setCreateTime(LocalDateTime.now()); + dataPetitionComplaint.setUpdateTime(LocalDateTime.now()); + return save(dataPetitionComplaint); + } + + public boolean save(DataPetitionComplaintAddDto body) { + LocalDateTime now = LocalDateTime.now(); + int index = 0; + for (DataPetitionComplaintImportDto dto : body.getData()) { + index++; + boolean exists = exists(new LambdaQueryWrapper().eq(DataPetitionComplaint::getOriginId, dto.getOriginId())); + // 增量更新 + if (DataUpdateMethodEnum.incremental.name().equals(body.getDataUpdateMethod()) && exists) { + throw new RuntimeException(String.format("第%s条数据的信件编号已存在,请核实", index)); + } + DataPetitionComplaint data = new DataPetitionComplaint(); + BeanUtils.copyProperties(dto, data); + + data.setCreateTime(now); + data.setUpdateTime(now); + data.setProblemSourcesCode(body.getProblemSourcesCode()); + data.setDistributionState(DistributionStateEnum.UNDISTRIBUTED.getValue()); + saveOrUpdate(data); + } + return true; + } + + public boolean distribution(DataDataPetitionComplainDistribute dataDistribute) { + dataDistribute.getData().forEach(item -> { + NegativeDto negativeDto = new NegativeDto(); + negativeDto.setOriginId(item.getOriginId()); + negativeDto.setDiscoveryTime(item.getDiscoveryTime()); + negativeDto.setProblemSourcesCode(item.getProblemSourcesCode()); + negativeDto.setProblemSources(ProblemSourcesEnum.get(item.getProblemSourcesCode()).getLabel()); +// negativeDto.setBusinessTypeCode(BusinessTypeEnum.ABWW); +// negativeDto.setBusinessTypeName(); + negativeDto.setResponderName(item.getResponderName()); + negativeDto.setContactPhone(item.getResponderPhone()); + negativeDto.setThingDesc(item.getThingDesc()); + String departId; + String departName; + if (StrUtil.isBlank(item.getThirdDepartId())) { + departId = item.getSecondDepartId(); + departName = item.getSecondDepartName(); + } else { + departId = item.getThirdDepartId(); + departName = item.getThirdDepartName(); + } + negativeDto.setInvolveDepartId(departId); + negativeDto.setInvolveDepartName(departName); + negativeDto.setHostLevel(HostLevelEnums.SECOND.getValue()); + + negativeDto.setApprovalFlow(dataDistribute.getApprovalFlow()); + negativeDto.setDepartId(departId); + negativeDto.setDepartName(departName); + negativeDto.setTimeLimit(dataDistribute.getTimeLimit()); + negativeDto.setMaxSignDuration(dataDistribute.getMaxSignDuration()); + negativeDto.setMaxHandleDuration(dataDistribute.getMaxHandleDuration()); + negativeDto.setMaxExtensionDuration(dataDistribute.getMaxExtensionDuration()); + negativeDto.setCaseNumber(item.getOriginId()); + negativeService.save(negativeDto); + update(new LambdaUpdateWrapper().eq(DataPetitionComplaint::getOriginId, item.getOriginId()) + .set(DataPetitionComplaint::getDistributionState, DistributionStateEnum.DISTRIBUTED.getValue())); + }); + return true; + } + + //所有分类数据总数 + public JSONObject allMailCount(Date beginTime, Date endTime) { + // 国家信访 + QueryWrapper countryQueryWrapper = new QueryWrapper<>(); + countryQueryWrapper.eq("problem_sources_code", 21); + countryQueryWrapper.between("discovery_time", beginTime, endTime); + Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper); + // 公安部信访 + QueryWrapper policeQueryWrapper = new QueryWrapper<>(); + policeQueryWrapper.eq("problem_sources_code", 22); + policeQueryWrapper.between("discovery_time", beginTime, endTime); + Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); + // 12337信访 + QueryWrapper queryWrapper12337 = new QueryWrapper<>(); + Long total12337 = dataPetition12337Mapper.selectCount(queryWrapper12337); + // 初访 + QueryWrapper firstQueryWrapper = new QueryWrapper<>(); + firstQueryWrapper.eq("initial_petition", 1); + firstQueryWrapper.between("discovery_time", beginTime, endTime); + Long firstMail = dataPetitionComplaintMapper.selectCount(firstQueryWrapper); + // 重访 + QueryWrapper secondQueryWrapper = new QueryWrapper<>(); + secondQueryWrapper.eq("initial_petition", 2); + secondQueryWrapper.between("discovery_time", beginTime, endTime); + Long secondMail = dataPetitionComplaintMapper.selectCount(secondQueryWrapper); + // 领导接访 + QueryWrapper leaderQueryWrapper = new QueryWrapper<>(); + leaderQueryWrapper.isNotNull("receiving_leader_name"); + leaderQueryWrapper.between("discovery_time", beginTime, endTime); + Long leaderReceiveMail = dataPetitionComplaintMapper.selectCount(leaderQueryWrapper); + // 领导督办 + QueryWrapper leaderViewQueryWrapper = new QueryWrapper<>(); + leaderViewQueryWrapper.isNotNull("receiving_leader_name"); + leaderViewQueryWrapper.between("discovery_time", beginTime, endTime); + Long leaderViewMail = dataPetitionComplaintMapper.selectCount(leaderViewQueryWrapper); + // 闹访 1:闹 0:不闹 + QueryWrapper tangleQueryWrapper = new QueryWrapper<>(); + tangleQueryWrapper.eq("entanglement_visits", 1); + tangleQueryWrapper.between("discovery_time", beginTime, endTime); + Long tangleMail = dataPetitionComplaintMapper.selectCount(tangleQueryWrapper); + // 集访 1:集 0:不集 + QueryWrapper massQueryWrapper = new QueryWrapper<>(); + massQueryWrapper.eq("mass_visits", 1); + massQueryWrapper.between("discovery_time", beginTime, endTime); + Long massMail = dataPetitionComplaintMapper.selectCount(massQueryWrapper); + // 总数 + long totalMail = countryMail+policeMail+total12337; + + JSONObject overview = new JSONObject() + // 信访总数(起) + .fluentPut("total", totalMail) + // 国家信访 + .fluentPut("countryMail", countryMail) + // 公安部信访 + .fluentPut("policeMail", policeMail) + // 局长信箱 + .fluentPut("commissionerMail", 5534) + // 12337信访 + .fluentPut("numMail", total12337) + // 初访; + .fluentPut("firstMail", firstMail) + // 重访 + .fluentPut("secondMail", secondMail) + // 领导接访 + .fluentPut("leaderReceiveMail", leaderReceiveMail) + // 领导督办 + .fluentPut("leaderViewMail", leaderViewMail) + // 闹访问 + .fluentPut("tangleMail", tangleMail) + // 集访 + .fluentPut("massMail", massMail); + return overview; + } + + + // 初访重访分类数据排行 + public List mailRank(Integer departId, Integer Repeat, Date beginTime, Date endTime) { + List list = dataPetitionComplaintMapper. + selectDepartStatistic(departId, Repeat, beginTime, endTime); + return list; + } + + + public List getRecentlyMailTrendByDay(Integer sourcesCode, Integer days, Date endTime) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd"); + // 将 endTime 转换为 LocalDate + LocalDate endLocalDate = endTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + String currentDay = endLocalDate.format(formatter); // 前端页面的最后查询日期 + LocalDate frontDateDay = endLocalDate.minusDays(days); // days天前 + String frontDay = frontDateDay.format(formatter); + List recentMailTrendVos = + dataPetitionComplaintMapper.selectRecentlyMailTrendByDay(MailTrendSourcesEnum.getMappedCodeByCode(sourcesCode), frontDay, currentDay); + return recentMailTrendVos; + } + + // 按月统计信访趋势 + public List getRecentlyMailTrendByMonth(Integer sourcesCode, String year) { + List recentMailTrendVos = + dataPetitionComplaintMapper.selectRecentlyMailTrendByMonth(MailTrendSourcesEnum.getMappedCodeByCode(sourcesCode), year); + return recentMailTrendVos; + } + + + public List getRecentlyMailTrendByMonth12337(String year) { + List recentMailTrendVos = + dataPetition12337Mapper.selectRecentlyMailTrendByMonth12337(year); + return recentMailTrendVos; + } +} diff --git a/src/main/java/com/biutag/supervision/service/DataRightsComfortService.java b/src/main/java/com/biutag/supervision/service/DataRightsComfortService.java index 214c53c..aaaf658 100644 --- a/src/main/java/com/biutag/supervision/service/DataRightsComfortService.java +++ b/src/main/java/com/biutag/supervision/service/DataRightsComfortService.java @@ -3,6 +3,9 @@ package com.biutag.supervision.service; import com.biutag.supervision.mapper.RpcApplyMapper; 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.vo.EchartsVo; +import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -70,4 +73,25 @@ public class DataRightsComfortService { public List selectComfortSituation(Date beginTime, Date endTime) { return rpcApplyMapper.selectComfortSituation(beginTime, endTime); } + + + 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); + return res; + } + + public List getIncidentOrg(Date beginTime, Date endTime) { + List res =rpcApplyMapper.getIncidentOrg(beginTime, endTime); + 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 9e00ea2..6bb3a4b 100644 --- a/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java @@ -113,8 +113,8 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl getsupervisionMapIconInfo(Date beginTime, Date endTime) { - List res = negativeMapper.getMap(beginTime, endTime); + public List getSupervisionMapIconInfo(Date beginTime, Date endTime) { + List res = negativeMapper.getSupervisionMapIconInfo(beginTime, endTime); return res; } diff --git a/src/main/java/com/biutag/supervision/service/VideoSuperviseService.java b/src/main/java/com/biutag/supervision/service/VideoSuperviseService.java new file mode 100644 index 0000000..50de971 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/VideoSuperviseService.java @@ -0,0 +1,69 @@ +package com.biutag.supervision.service; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.biutag.supervision.constants.enums.InspectCaseEnum; +import com.biutag.supervision.mapper.NegativeMapper; +import com.biutag.supervision.mapper.NegativeProblemRelationMapper; +import com.biutag.supervision.mapper.SupDepartMapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.vo.*; +import io.swagger.v3.oas.annotations.Operation; +import lombok.RequiredArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Optional; + +/** + * 视频督察服务层 + */ +@RequiredArgsConstructor +@Service +public class VideoSuperviseService { + + private final NegativeMapper negativeMapper; + + //region 左边 + public List getVideoSuperviseProblemRank(Date beginTime, Date endTime, Integer groupId) { + List res = negativeMapper.getVideoSuperviseProblemRank(beginTime, endTime, groupId); + return res; + } + + //endregion + + //region 中间 + public VideoSuperviseCountVo getAllVideoSuperviseCount(Date beginTime, Date endTime) { + VideoSuperviseCountVo res = negativeMapper.getAllVideoSuperviseCount(beginTime, endTime); + return res; + } + + public List getVideoSuperviseMapIconInfo(Date beginTime, Date endTime) { + List res = negativeMapper.getVideoSuperviseMapIconInfo(beginTime, endTime); + return res; + } + + public List getVideoSuperviseTrend(String year) { + List res = negativeMapper.getVideoSuperviseTrend(year); + return res; + } + + //endregion + + //region + + public List getVideoSuperviseProblemTypeRate(Date beginTime, Date endTime) { + List res = negativeMapper.getVideoSuperviseProblemTypeRate(beginTime, endTime); + return res; + } + + //endregion + +} diff --git a/src/main/resources/mapper/NegativeMapper.xml b/src/main/resources/mapper/NegativeMapper.xml index 7f36080..40b3485 100644 --- a/src/main/resources/mapper/NegativeMapper.xml +++ b/src/main/resources/mapper/NegativeMapper.xml @@ -4,7 +4,6 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + + +