diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java index 5ce0987..5fc9708 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java @@ -31,8 +31,7 @@ import java.util.List; import java.util.concurrent.CompletableFuture; import static com.biutag.supervision.constants.WorkDynamicConstants.DCGZDT; -import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.XCDC; -import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.ZXDC; +import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*; /** * @Auther: sh @@ -104,8 +103,9 @@ public class DataVSupervisionNotifyController { public Result getSupervisionNotifyCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { endTime = DateUtil.endOfDay(endTime); + ////, ProblemSourcesEnum.SPDC.getValue() 去除视频督察 List negatives = negativeMapper.selectList(new LambdaQueryWrapper().between(Negative::getCrtTime, beginTime, endTime) - .in(Negative::getProblemSourcesCode, List.of(ProblemSourcesEnum.XCDC.getValue(), ProblemSourcesEnum.LMGZ.getValue(), ProblemSourcesEnum.ZXDC.getValue(), ProblemSourcesEnum.SPDC.getValue()))); + .in(Negative::getProblemSourcesCode, List.of(ProblemSourcesEnum.XCDC.getValue(), ProblemSourcesEnum.LMGZ.getValue(), ProblemSourcesEnum.ZXDC.getValue()))); SupervisionNotifyOverView overView = new SupervisionNotifyOverView(); List negativeIds = negatives.stream().filter(item -> InspectCaseEnum.isItTure(item.getCheckStatus())).map(Negative::getId).toList(); @@ -162,7 +162,7 @@ public class DataVSupervisionNotifyController { @Operation(summary = "问题趋势") @GetMapping("/getSupervisionTrend") public Result getSupervisionTrend(@RequestParam Integer year) { - List supervisionTrend = negativeMapper.getTrend(year, XCDC.getValue(), ZXDC.getValue()); + List supervisionTrend = negativeMapper.getTrend(year, XCDC.getValue(), ZXDC.getValue(),LMGZ.getValue()); JSONObject data = new JSONObject().fluentPut("supervisionTrend", supervisionTrend); return Result.success(data); } diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java index af33523..2837739 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java @@ -127,6 +127,7 @@ public class DataVVideoSuperviseController { // 地图数据 List videoSuperviseMapIconVoList = Optional.ofNullable(negativeMapper.getVideoSuperviseMapIconInfo(beginTime, endTime)). orElseGet(ArrayList::new); + List list =negativeMapper.selectRelativePer(beginTime,endTime); videoSuperviseMapIconVoList.forEach(s->{ List echartsVoList= list.stream().filter(b->b.getName().contains(s.getDepartId())).toList(); 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 84a39af..17f2492 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneCaseVerifController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneCaseVerifController.java @@ -1,9 +1,13 @@ package com.biutag.supervision.controller.subdatav; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.NumberUtil; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.biutag.supervision.mapper.DataCaseVerifMapper; import com.biutag.supervision.mapper.NegativeMapper; import com.biutag.supervision.pojo.Result; +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; @@ -37,7 +41,7 @@ import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.SJJB; @Tag(name = "案件核查二级大屏", description = "案件核查二级大屏") public class SubOneCaseVerifController { private final NegativeMapper negativeMapper; - + private final DataCaseVerifMapper dataCaseVerifMapper; /** * 案件核查大屏分县市局排名 @@ -99,7 +103,13 @@ public class SubOneCaseVerifController { public Result getSubOneAllCaseVerificationCount(@RequestParam Integer departId, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + + endTime= DateUtil.endOfDay(endTime); CaseVerificationCountVo overview = negativeMapper.getSuboOneAllCaseVerificationCount(beginTime, endTime, departId); + long total =dataCaseVerifMapper.selectCount(new LambdaQueryWrapper().between(DataCaseVerif::getCreateTime,beginTime,endTime)); + overview.setTotal((int) total); + int confirmed = overview.getConfirmed() != null?overview.getConfirmed():0; + overview.setRate(NumberUtil.div((Number) (confirmed * 100),total ).doubleValue()); JSONObject res = new JSONObject().fluentPut("overview", overview); return Result.success(res); } 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 5fb09ea..674f808 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneMailViewController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneMailViewController.java @@ -4,6 +4,7 @@ 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.NegativeBlameMapper; import com.biutag.supervision.mapper.NegativeMapper; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.vo.*; @@ -20,7 +21,9 @@ 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.List; +import java.util.Map; /** * @Auther: sh @@ -39,6 +42,7 @@ public class SubOneMailViewController { private final DataPetitionComplaintMapper dataPetitionComplaintMapper; private final DataPetition12337Mapper dataPetition12337Mapper; private final NegativeMapper negativeMapper; + private final NegativeBlameMapper negativeBlameMapper; // region 左边 /** @@ -188,5 +192,44 @@ public class SubOneMailViewController { } // endregion + + /** + * 追责问责情况 + * + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return Result + */ + @Operation(summary = "追责问责情况") + @GetMapping("/getSubOneResultCount") + public Result> getResultCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime,@RequestParam Integer departId){ + List list = negativeBlameMapper.selectSubOneBlameStatsCount(beginTime,endTime,departId); + Map blameMap = new HashMap<>(); + list.forEach(s->{ + if(s.getResultName().indexOf("、") > 0){ + for (String name:s.getResultName().split("、")){ + if(!name.contains("不") && !name.contains("追责")){ + if(blameMap.containsKey(name)){ + blameMap.put(name,blameMap.get(name) + s.getResultCount()); + }else{ + blameMap.put(name,s.getResultCount()); + } + } + } + }else{ + if(!s.getResultName().contains("不") && !s.getResultName().contains("追责")){ + if(blameMap.containsKey(s.getResultName())){ + blameMap.put(s.getResultName(),blameMap.get(s.getResultName()) + s.getResultCount()); + }else{ + blameMap.put(s.getResultName(),s.getResultCount()); + } + } + + } + }); + return Result.success(blameMap); + } + } diff --git a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java index 69f9573..b6ee1ca 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java @@ -1,11 +1,29 @@ package com.biutag.supervision.controller.subdatav; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.biutag.supervision.constants.enums.RpcApplyTypeEnum; +import com.biutag.supervision.mapper.CountyStreetDeptMapper; import com.biutag.supervision.mapper.RpcApplyMapper; +import com.biutag.supervision.mapper.RpcInfringerResultMapper; +import com.biutag.supervision.mapper.SupDepartMapper; import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.common.BarItem; +import com.biutag.supervision.pojo.dto.common.PieItem; +import com.biutag.supervision.pojo.entity.CountyStreetDept; +import com.biutag.supervision.pojo.entity.RpcApply; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.entity.SupDictData; import com.biutag.supervision.pojo.vo.ComfortCountVO; +import com.biutag.supervision.pojo.vo.ComfortMapIconVo; import com.biutag.supervision.pojo.vo.EchartsVo; import com.biutag.supervision.service.DataRightsComfortService; +import com.biutag.supervision.service.RpcApplyService; +import com.biutag.supervision.service.SupDepartService; +import com.biutag.supervision.service.SupDictDataService; +import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -15,9 +33,10 @@ 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.*; +import java.util.stream.Collectors; + +import static com.biutag.supervision.constants.enums.DepartGroupEnum.COUNTY_CITY_BUREAUS; /** * @Auther: sh @@ -34,24 +53,49 @@ public class SubOneRightsController { private final DataRightsComfortService dataRightsComfortService; private final RpcApplyMapper rpcApplyMapper; - + private final SupDictDataService supDictDataService; + private final CountyStreetDeptMapper countyStreetDeptMapper; + private final RpcApplyService rpcApplyService; + private final RpcInfringerResultMapper rpcInfringerResultMapper; // 大屏中央总览数据 @GetMapping("/getSubOneALlComfortCount") public Result getALlComfortCount(@RequestParam Integer departId, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + endTime = DateUtil.endOfDay(endTime); + + + + List list= rpcApplyMapper.selectList(new LambdaQueryWrapper() + .between(RpcApply::getCrtTime, beginTime, endTime) + .eq(RpcApply::getSecondDepartId,departId) + .eq(RpcApply::getType, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue())); Long 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); // 抚慰金额 + Integer hitTotal = dataRightsComfortService.countSubOneHitPersonNumber(beginTime, endTime, departId); // 打击处理人数 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); + //维权案件总数 + comfortOverview.setComfortCaseTotal(list.stream().map(RpcApply::getCaseNumber).collect(Collectors.toSet()).size()); + //受侵害人数 + comfortOverview.setHurtTotal( rpcApplyMapper.selectVictimNumberByOrg(beginTime,endTime, String.valueOf(departId))); + // 维权案件情况 - 派出所 + List pcsList = rpcApplyMapper.selectSubPcsProtectRightsBarList(beginTime, endTime, departId,10); + // 维权案件情况 - 大队 + List dbList = rpcApplyMapper.selectSubDdProtectRightsBarList(beginTime, endTime, departId,10); + + JSONObject data = new JSONObject() + .fluentPut("comfortOverview", comfortOverview) + .fluentPut("fxsjRightsRankList",pcsList) + .fluentPut("jsdwRightsRankList",dbList); + return Result.success(data); } @@ -62,6 +106,7 @@ public class SubOneRightsController { public Result getSubOnePoliceHurtSituationAndHurtType(@RequestParam Integer departId, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + endTime =DateUtil.endOfDay(endTime); List policeHurtSituationList = rpcApplyMapper.getSubOnePoliceHurtSituation(beginTime, endTime,departId); // 人数情况 List policeHurtTypeList = rpcApplyMapper.getSubOnePoliceHurtType(beginTime, endTime,departId); // 受伤类别 JSONObject data = new JSONObject() @@ -75,20 +120,141 @@ public class SubOneRightsController { public Result getSubOneCaseAriseSituationRate(@RequestParam Integer departId, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + endTime =DateUtil.endOfDay(endTime); // 发案环节 List incidentLinkList = rpcApplyMapper.getSubOneIncidentLink(beginTime, endTime,departId); // 发案警种 - List incidentPoliceTypeList = new ArrayList<>(); + + List incidentPoliceList = rpcApplyMapper.getIncidentPolice(beginTime, endTime,departId); + List supDictDataList = supDictDataService.list(new LambdaQueryWrapper().eq(SupDictData::getDictType,"personType")); + incidentPoliceList.forEach(s->{ + Optional supDictData = supDictDataList.stream().filter(v->v.getDictValue().equals(s.getName())).findFirst(); + supDictData.ifPresent(dictData -> s.setName(dictData.getDictLabel())); + }); + + // 发案单位 List incidentOrgList = rpcApplyMapper.getSubOneIncidentOrg(beginTime, endTime,departId); JSONObject data = new JSONObject() .fluentPut("incidentLinkList", incidentLinkList) - .fluentPut("incidentPoliceTypeList", incidentPoliceTypeList) + .fluentPut("incidentPoliceTypeList", incidentPoliceList) .fluentPut("incidentOrgList", incidentOrgList); return Result.success(data); } + // endregion + @GetMapping("getComfortMapIcon") + public Result getComfortMapIcon(@RequestParam Integer departId,@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + Date finalEndTime = DateUtil.endOfDay(endTime); + // 信访数据总数概览 + List res = new ArrayList<>(); + // 查询所有分县市局 + + List countyStreetDepts =countyStreetDeptMapper.getSubOneStreetMap(departId); + for (CountyStreetDept countyStreetDept : countyStreetDepts) { + ComfortMapIconVo iconVo = new ComfortMapIconVo(); + iconVo.setName(countyStreetDept.getName()); + iconVo.setDepartId(countyStreetDept.getDeptId()); + res.add(iconVo); + } + for (ComfortMapIconVo re : res) { + String deptId = re.getDepartId(); + + List list = rpcApplyService.list(new LambdaQueryWrapper() + .between(RpcApply::getCrtTime, beginTime, finalEndTime) + .eq(RpcApply::getSecondDepartId,departId) + .eq(RpcApply::getType, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue())); + + Set caseNumbers = list.stream().map(RpcApply::getCaseNumber).collect(Collectors.toSet()); + + // 维权案件总数 + re.setRightsNumber(caseNumbers.size()); + // 受侵害人数 + re.setVictimNumber(rpcApplyMapper.selectVictimNumberByOrg(beginTime,finalEndTime,deptId)); + // 打击处理人数 + List tortNames = rpcInfringerResultMapper.selectNamesByOrgTime(beginTime, finalEndTime,deptId); + long initialListSize = tortNames.size(); + long hitPersonNumber = tortNames.stream() + .filter(s -> s.contains(",")).toList().size(); + // 筛选出包含逗号的名称 + long nums = tortNames.stream() + .filter(s -> s.contains(",")) + .mapToLong(s -> s.split(",").length) + .sum();// 计算所有拆分后数组长度的总和 // 拆分每个名称并计算拆分后的数组长度 + if(tortNames.stream().noneMatch(s -> s.contains(","))){ + re.setHitPersonNumber(initialListSize ); + }else{ + re.setHitPersonNumber(initialListSize + nums - hitPersonNumber); + } + //抚慰金额 + CompletableFutureUtil.runSyncObject(() -> { + + re.setComfortMoney(rpcApplyMapper.selectComfortMoneyBarByOrg(beginTime, finalEndTime, deptId)); + }); + CompletableFutureUtil.runSyncObject(() -> { + // 抚慰人数 + re.setComfortPersonNumber(rpcApplyService.orgCount(beginTime, finalEndTime, RpcApplyTypeEnum.COMFORT.getValue(), deptId)); + }); + } + + + + JSONObject data = new JSONObject().fluentPut("comfortMapVoList", res); + return Result.success(data); + } + + // endregion + //打处情况 + @GetMapping("getPunishmentSituation") + public Result getPunishmentSituation(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){ + endTime =DateUtil.endOfDay(endTime); + //获取相关案件 + List list= rpcApplyMapper.selectList(new LambdaQueryWrapper() + .between(RpcApply::getCrtTime, beginTime, endTime) + .eq(RpcApply::getSecondDepartId,departId) + .eq(RpcApply::getType, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue())); + //案件分组 + Map> collect = list.stream() + .filter(s-> StrUtil.isNotEmpty(s.getInfringerHandle()) ) + .collect(Collectors.groupingBy(RpcApply::getInfringerHandle)); + List pieItems = collect.keySet().stream().map(name -> { + return new PieItem(name, collect.get(name).size()); + }).toList(); + JSONObject data = new JSONObject().fluentPut("PunishmentSituation",pieItems); + return Result.success(data); + } + + + + // 抚慰情况 + @GetMapping("/getComfortSituation") + public Result getComfortSituation(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + endTime = DateUtil.endOfDay(endTime); + List comfortSituationList = rpcApplyMapper.selectSubComfortSituation(beginTime, endTime,departId); + JSONObject data = new JSONObject().fluentPut("comfortSituationList", comfortSituationList); + return Result.success(data); + } + + //案件类别占比 + @GetMapping("getSubCaseType") + public Result getSubCaseType(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){ + endTime = DateUtil.endOfDay(endTime); + //案件类别 - 刑事 + List crownCaseBar =rpcApplyMapper.selectSubCaseData(beginTime, endTime,"1",departId); + //案件类别 - 行政 + List administrativeCase = rpcApplyMapper.selectSubCaseData( beginTime, endTime,"2",departId); + JSONObject data = new JSONObject().fluentPut("crownCaseBar",crownCaseBar).fluentPut("administrativeCase",administrativeCase); + return Result.success(data); + } + } 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 d7f7ed4..e79c4fa 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java @@ -1,12 +1,26 @@ package com.biutag.supervision.controller.subdatav; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ArrayUtil; +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.InspectCaseEnum; +import com.biutag.supervision.constants.enums.ProblemSourcesEnum; +import com.biutag.supervision.constants.enums.ProcessingStatusEnum; +import com.biutag.supervision.mapper.CountyStreetDeptMapper; import com.biutag.supervision.mapper.NegativeMapper; import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.CountyStreetDept; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeBlame; import com.biutag.supervision.pojo.entity.News; import com.biutag.supervision.pojo.vo.*; +import com.biutag.supervision.service.CountyStreetDeptService; +import com.biutag.supervision.service.NegativeBlameService; import com.biutag.supervision.service.NewsService; import com.biutag.supervision.service.SubOneSupervisionNotifyService; +import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; @@ -18,10 +32,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.ArrayList; import java.util.Date; import java.util.List; +import java.util.concurrent.CompletableFuture; import static com.biutag.supervision.constants.WorkDynamicConstants.DCGZDT; +import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*; /** @@ -40,6 +57,8 @@ public class SubOneSupervisionNotifyController { private final SubOneSupervisionNotifyService subOneSupervisionNotifyService; private final NegativeMapper negativeMapper; private final NewsService newsService; + private final NegativeBlameService negativeBlameService; + private final CountyStreetDeptMapper countyStreetDeptMapper; // region 左边 /** @@ -102,8 +121,45 @@ public class SubOneSupervisionNotifyController { public Result getAllSubOneSupervisionNotifyCount(@RequestParam Integer departId, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - SupervisionNotifyOverView overview = negativeMapper.getAllSubOneSupervisionNotifyCount(departId, beginTime, endTime); - JSONObject data = new JSONObject().fluentPut("overview", overview); + endTime = DateUtil.endOfDay(endTime); + + //, ProblemSourcesEnum.SPDC.getValue() 去除视频督察 + //获取时间范围内 属于对应二级单位的数据 + List negatives = negativeMapper.selectList(new LambdaQueryWrapper().between(Negative::getCrtTime, beginTime, endTime) + .eq(Negative::getSecondInvolveDepartId,departId) + .in(Negative::getProblemSourcesCode, List.of(ProblemSourcesEnum.XCDC.getValue(), ProblemSourcesEnum.LMGZ.getValue(), ProblemSourcesEnum.ZXDC.getValue()))); + SupervisionNotifyOverView overView = new SupervisionNotifyOverView(); + //属实的 + List negativeIds = negatives.stream().filter(item -> InspectCaseEnum.isItTure(item.getCheckStatus())).map(Negative::getId).toList(); + overView.setProblemNumber(negatives.size()); + //已办结的 + overView.setCompletedNumber(negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).count()); + //办理中 + overView.setProcessingNumber(negatives.size() - overView.getCompletedNumber()); + // 办结率 +// overView.setCompletedRate(overView.getProblemNumber() == 0 ? 0: NumberUtil.roundHalfEven(NumberUtil.mul(NumberUtil.div(overView.getCompletedNumber(), overView.getProblemNumber()), 100), 0).doubleValue()); + CompletableFuture.allOf( + CompletableFutureUtil.runSyncObject(() -> { + //问责人数 + long personNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper().in(NegativeBlame::getNegativeId, negativeIds) + .eq(NegativeBlame::getType, "personal") + .ne(NegativeBlame::getHandleResultName, "不予追责") + .isNotNull(NegativeBlame::getHandleResultName) + .ne(NegativeBlame::getHandleResultName, "")); + overView.setPersonNumber(personNumber); + }), + CompletableFutureUtil.runSyncObject(() -> { + //问责单位 + long departNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper().in(NegativeBlame::getNegativeId, negativeIds) + .eq(NegativeBlame::getType, "department") + .ne(NegativeBlame::getHandleResultName, "不予追责") + .isNotNull(NegativeBlame::getHandleResultName) + .ne(NegativeBlame::getHandleResultName, "")); + overView.setDepartNumber(departNumber); + }) + ).join(); + + JSONObject data = new JSONObject().fluentPut("overview", overView); return Result.success(data); } @@ -119,9 +175,53 @@ public class SubOneSupervisionNotifyController { public Result getSubOneSupervisionMap(@RequestParam Integer departId, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - //地图数据 - List superviseTempMapVoList = negativeMapper.getSubOneSupervisionMapIcon(beginTime, endTime, departId); - JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList); + + List streetDepts = countyStreetDeptMapper.selectList(new LambdaQueryWrapper().eq(CountyStreetDept::getDeptPid,departId)); + List overViews = new ArrayList<>(); + if(ArrayUtil.isNotEmpty(streetDepts)){ + streetDepts.forEach(s->{ + SuperviseMapIconVo superviseMapIconVo =new SuperviseMapIconVo(); + superviseMapIconVo.setName(s.getName()); + superviseMapIconVo.setDepartId(s.getDeptId()); + + List negatives = negativeMapper.selectList(new LambdaQueryWrapper().between(Negative::getCrtTime, beginTime, endTime) + .eq(Negative::getThreeInvolveDepartId,s.getDeptId()) + .in(Negative::getProblemSourcesCode, List.of(ProblemSourcesEnum.XCDC.getValue(), ProblemSourcesEnum.LMGZ.getValue(), ProblemSourcesEnum.ZXDC.getValue()))); + if(!negatives.isEmpty()){ + List negativeIds = negatives.stream().filter(item -> InspectCaseEnum.isItTure(item.getCheckStatus())).map(Negative::getId).toList(); + superviseMapIconVo.setTotalPro(String.valueOf(negatives.size())); + //已办结的 + superviseMapIconVo.setCompletedNumber(negatives.stream().filter(item ->"1".equals(item.getIsRectifyCode())).count()); + //办理中 + superviseMapIconVo.setProcessingNumber(negatives.stream().filter(item ->"0".equals(item.getIsRectifyCode())).count()); + // 办结率 +// superviseMapIconVo.setCompletedRate(superviseMapIconVo.getProblemNumber() == 0 ? 0: NumberUtil.roundHalfEven(NumberUtil.mul(NumberUtil.div(superviseMapIconVo.getCompletedNumber(), superviseMapIconVo.getProblemNumber()), 100), 0).doubleValue()); + //问责人数 、问责单位数 + CompletableFuture.allOf( + CompletableFutureUtil.runSyncObject(() -> { + //问责人数 + long personNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper().in(NegativeBlame::getNegativeId, negativeIds) + .eq(NegativeBlame::getType, "personal") + .ne(NegativeBlame::getHandleResultName, "不予追责") + .isNotNull(NegativeBlame::getHandleResultName) + .ne(NegativeBlame::getHandleResultName, "")); + superviseMapIconVo.setPersonNum(String.valueOf(personNumber)); + }), + CompletableFutureUtil.runSyncObject(() -> { + //问责单位 + long departNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper().in(NegativeBlame::getNegativeId, negativeIds) + .eq(NegativeBlame::getType, "department") + .ne(NegativeBlame::getHandleResultName, "不予追责") + .isNotNull(NegativeBlame::getHandleResultName) + .ne(NegativeBlame::getHandleResultName, "")); + superviseMapIconVo.setRelationOrg(String.valueOf(departNumber)); + }) + ).join(); + overViews.add(superviseMapIconVo); + } + }); + } + JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", overViews); return Result.success(data); } @@ -137,7 +237,7 @@ public class SubOneSupervisionNotifyController { @GetMapping("/getSubOneSupervisionTrend") public Result getSubOneSupervisionTrend(@RequestParam Integer departId, @RequestParam String year) { - List supervisionTrend = negativeMapper.getSubOneTrend(departId.toString(), year, "13", "15"); + List supervisionTrend = negativeMapper.getSubOneTrend(departId.toString(), year, XCDC.getValue(), ZXDC.getValue(),LMGZ.getValue()); JSONObject data = new JSONObject().fluentPut("supervisionTrend", supervisionTrend); return Result.success(data); } diff --git a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneVideoSuperviseController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneVideoSuperviseController.java index 1ee82ff..3d58883 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneVideoSuperviseController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneVideoSuperviseController.java @@ -79,6 +79,7 @@ public class SubOneVideoSuperviseController { public Result getSubOneAllVideoSuperviseCount(@RequestParam Integer departId, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + endTime =DateUtil.endOfDay(endTime); VideoSuperviseCountVo overview = subOneVideoSuperviseService.getSubOneAllVideoSuperviseCount(beginTime, DateUtil.endOfDay(endTime), departId); JSONObject data = new JSONObject().fluentPut("overview", overview); return Result.success(data); @@ -98,10 +99,18 @@ public class SubOneVideoSuperviseController { public Result getSubOneVideoSuperviseMap(@RequestParam Integer departId, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - + endTime =DateUtil.endOfDay(endTime); // 地图数据 List videoSuperviseMapIconVoList = Optional.ofNullable(negativeMapper.getSubOneVideoSuperviseMapIconInfo(beginTime, endTime, departId)). orElseGet(ArrayList::new); + List list =negativeMapper.selectSubOneRelativePer(beginTime,endTime,departId); + videoSuperviseMapIconVoList.forEach(s->{ + List echartsVoList= list.stream().filter(b->b.getName().contains(s.getDepartId())).toList(); + if(!echartsVoList.isEmpty()){ + int relativePer = echartsVoList.get(0).getValue(); + s.setRelativePer(relativePer); + } + }); JSONObject data = new JSONObject().fluentPut("videoSuperviseMapIconVoList", videoSuperviseMapIconVoList); return Result.success(data); } diff --git a/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java b/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java index 2f12858..8b1842e 100644 --- a/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java +++ b/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java @@ -44,8 +44,8 @@ public interface DataPetition12337Mapper extends BaseMapper { "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} " + + "ON DATE_FORMAT(dpc.create_time, '%m') = m.month " + + "AND YEAR(dpc.create_time) = #{year} " + "LEFT JOIN sup_depart sd " + "ON dpc.third_depart_id = sd.id " + "AND sd.pid = #{departId} " + @@ -54,7 +54,7 @@ public interface DataPetition12337Mapper extends BaseMapper { List getSubOneMailTrend12337(Integer year, Integer departId); @Select("select count(*) from data_petition_12337 " + - "where discover_time between #{beginTime} and #{endTime} " + + "where create_time between #{beginTime} and #{endTime} " + "and third_depart_id=#{departId}") Long select12337PoliceMailBySourceCode(Date beginTime, Date endTime, Integer departId); diff --git a/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java b/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java index b9714d3..29b3ec6 100644 --- a/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java @@ -281,8 +281,8 @@ public interface DataPetitionComplaintMapper extends BaseMapper queryBooks(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java index 1291149..f85735f 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java @@ -59,4 +59,11 @@ public interface NegativeBlameMapper extends BaseMapper { " and a.crtTime BETWEEN #{beginTime} AND #{endTime} GROUP BY resultName" ) List selectBlameStatsCount(Date beginTime, Date endTime); + /** + * 二级大屏 - 追责问责情况 + * */ + @Select("select a.handleResultName as resultName, count(*) as resultCount FROM `negative_blame` as a LEFT JOIN negative as b on a.negativeId = b.id where a.handleResultName is NOT NULL and a.handleResultCode is NOT NULL and b.problemSourcesCode in (21,22,23,24,25) " + + " and a.crtTime BETWEEN #{beginTime} AND #{endTime} and b.second_involve_depart_id = #{deptId} GROUP BY resultName" + ) + List selectSubOneBlameStatsCount(Date beginTime, Date endTime,Integer deptId); } diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index e852dcf..9997132 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -202,7 +202,7 @@ public interface NegativeMapper extends BaseMapper { "IFNULL( ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS completedRate " + "FROM sup_depart sd " + "LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id " + - "AND ng.problemSourcesCode IN (13, 15)" + + "AND ng.problemSourcesCode IN (13,14, 15)" + "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + "LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + "WHERE sd.statistics_group_id=3 " + @@ -308,10 +308,26 @@ public interface NegativeMapper extends BaseMapper { " WHERE " + " ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + " and sup.statistics_group_id = 3 " + + " and ng.problemSourcesCode = 16 "+ " GROUP BY sup.id " ) List selectRelativePer(Date beginTime, Date endTime); + + @Select("SELECT " + + "sup.id as `name`, " + + "COUNT(*) as value " + + "from negative_problem_relation npr " + + "LEFT JOIN negative ng on npr.negativeId = ng.id " + + "LEFT JOIN sup_depart sup on sup.id = ng.three_involve_depart_id " + + "WHERE " + + "ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + + "and sup.pid = #{deptId} " + + "and sup.statistics_group_id = 10 " + + "and ng.problemSourcesCode = 16 " + + "GROUP BY sup.id") + List selectSubOneRelativePer(Date beginTime,Date endTime,Integer deptId); + // endregion // region 案件核查大屏 @@ -327,7 +343,7 @@ public interface NegativeMapper extends BaseMapper { "ORDER BY `value` DESC;") List getCaseVerificationRank(Date beginTime, Date endTime, int groupId); - + // 案件核查大屏 -- 中央数据 @Select("SELECT " + "COUNT( ng.id ) AS confirmed, " + "COUNT( DISTINCT IF(ng.checkStatus IN (1, 2), ng.id, NULL) ) AS dealCasePro, " + @@ -579,7 +595,7 @@ public interface NegativeMapper extends BaseMapper { "AND sd.statistics_group_id=10 " + "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + "GROUP BY sd.short_name " + - "ORDER BY value DESC;") + "ORDER BY denominator DESC;") List getPoliceChangedRankList(Integer departId, Date beginTime, Date endTime); @Select("SELECT " + @@ -595,7 +611,7 @@ public interface NegativeMapper extends BaseMapper { "AND sd.statistics_group_id!=10 " + "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + "GROUP BY sd.short_name " + - "ORDER BY value DESC;") + "ORDER BY denominator DESC;") List getTeamChangedRankList(Integer departId, Date beginTime, Date endTime); @Select("SELECT sd.short_name as label, " + @@ -768,16 +784,14 @@ public interface NegativeMapper extends BaseMapper { List getCaseProblemProperty(Date beginTime, Date endTime, Integer departId, Integer businessType); @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 " + + "COUNT( DISTINCT IF(ng.checkStatus IN (1, 2), ng.id, NULL) ) AS dealCasePro, " + + "COUNT( DISTINCT IF(ng.checkStatus IN (1, 2) && nb.type = 'personal' and ng.checkStatus IN ('1','2') and nb.handleResultName != '不予追责' and nb.handleResultCode is not null and nb.handleResultCode != '', nb.blameId, NULL) ) AS punishPre, " + + "COUNT( DISTINCT IF(ng.checkStatus IN (1, 2) && nb.type = 'department' and ng.checkStatus IN ('1','2') and nb.handleResultName != '不予追责' and nb.handleResultCode is not null and nb.handleResultCode != '', nb.blameId, NULL) ) AS punishOrg " + "FROM negative ng " + "LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + "WHERE ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + "AND ng.second_involve_depart_id=#{departId} " + - "AND ng.problemSourcesCode in (17, 18, 19, 20); ") + "AND ng.problemSourcesCode in (17, 18, 19, 20)") CaseVerificationCountVo getSuboOneAllCaseVerificationCount(Date beginTime, Date endTime, Integer departId); @Select("SELECT " + @@ -857,10 +871,10 @@ public interface NegativeMapper extends BaseMapper { "csd.dept_pid, " + "csd.dept_id AS departId, " + "COUNT( DISTINCT ng.id) AS discoverProblem, " + - "COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) ) AS changedProblem, " + - "COUNT( DISTINCT ng.involveDepartId) AS relativeOrg, " + + "COUNT(DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS completionProblem, " + + "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 " + + "IFNULL(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id)*100, 1 ),0) AS completionRate " + "FROM county_street_dept csd " + "LEFT JOIN negative ng ON csd.dept_id=ng.three_involve_depart_id " + "AND checkStatus <>3 " + @@ -872,28 +886,30 @@ public interface NegativeMapper extends BaseMapper { List getSubOneVideoSuperviseMapIconInfo(Date beginTime, Date endTime, Integer departId); - @Select("SELECT " + - "csd.`name` AS `name`, " + - "csd.dept_name AS policeName, " + - "csd.dept_pid, " + - "csd.dept_id AS departId, " + - "COUNT( DISTINCT ng.id ) AS totalPro, " + - "COUNT( DISTINCT IF(ng.problemSourcesCode=13, ng.id, NULL) ) AS xc, " + - "COUNT( DISTINCT IF(ng.problemSourcesCode=15, ng.id, NULL) ) AS zx, " + - "COUNT( DISTINCT IF(ng.isRectifyCode=0, ng.id, NULL) ) AS changing, " + - "COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) ) AS changed , " + - "COUNT( DISTINCT ng.involveDepartId ) AS relationOrg, " + - "COUNT( DISTINCT nb.blameIdCode ) AS personNum, " + - "IFNULL( ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS changedRate " + - "FROM county_street_dept csd " + - "LEFT JOIN negative ng ON ng.three_involve_depart_id=csd.dept_id " + - "AND ng.problemSourcesCode IN (13, 15) " + - "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + - "AND ng.second_involve_depart_id=#{departId} " + - "LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + - "GROUP BY csd.dept_name " + - "HAVING csd.dept_pid=#{departId} ") - List getSubOneSupervisionMapIcon(Date beginTime, Date endTime, Integer departId); + + + + @Select("SELECT " + + "csd.`name` AS `name`, " + + "csd.dept_name AS policeName, " + + "csd.dept_pid, " + + "csd.dept_id AS departId, " + + "COUNT(DISTINCT IF(ng.isRectifyCode = 0,ng.id,null)) as processingNumber, " + + "COUNT(DISTINCT IF(ng.isRectifyCode = 1,ng.id,null)) as completeNumber, " + + "COUNT( DISTINCT ng.involveDepartId ) AS relationOrg, " + + "COUNT( DISTINCT ng.id ) AS problemNumber, " + + "IFNULL( ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS completeRate " + + "FROM county_street_dept csd " + + "LEFT JOIN negative ng ON ng.three_involve_depart_id=csd.dept_id " + + "WHERE ng.problemSourcesCode in (13,14,15) " + + "and ng.crtTime BETWEEN '2025-01-01 00:00:00.0' AND '2025-06-11 23:59:59.999' " + + "AND ng.second_involve_depart_id= #{departId} " + + "and ng.checkStatus in (1,2) " + + "GROUP BY csd.dept_name " + + "HAVING csd.dept_pid=#{departId} " + ) + List getSubOneSupervisionMapIcon(Date beginTime,Date endTime,Integer departId); + List selectListBySampleId(@Param("args") List sampleIdList); diff --git a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java index 4ef709c..778fb26 100644 --- a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java @@ -28,6 +28,15 @@ public interface RpcApplyMapper extends BaseMapper { "GROUP BY c.job") List selectComfortSituation(Date beginTime, Date endTime); + + @Select("SELECT c.job name, COUNT(c.job) value FROM sup_police c JOIN " + + "(SELECT a.emp_no FROM rpc_apply_person a LEFT JOIN rpc_apply b ON a.rpc_id = b.rpc_id " + + "WHERE b.crt_time BETWEEN #{beginTime} AND #{endTime} AND b.type = 2 and b.second_depart_id = #{departId} ) d on c.emp_no = d.emp_no " + + "GROUP BY c.job") + List selectSubComfortSituation(Date beginTime, Date endTime,Integer departId); + /** + * 一级 获取不同案件类型下的数据 + * */ @Select("SELECT " + " ra.case_category as name,COUNT(*) as value" + " from rpc_apply as ra LEFT JOIN sup_depart sdp on ra.second_depart_id = sdp.id " + @@ -36,7 +45,18 @@ public interface RpcApplyMapper extends BaseMapper { " and ra.case_category is NOT NULL GROUP BY ra.case_category " ) List selectCaseData(Date beginTime, Date endTime,String type); - + /** + * 二级 获取不同案件类型下的数据 + * */ + @Select(" SELECT " + + " ra.case_category as name,COUNT(*) as value" + + " from rpc_apply as ra LEFT JOIN sup_depart sdp on ra.second_depart_id = sdp.id " + + " WHERE ra.case_type = #{type} " + + " and ra.crt_time between #{beginTime} and #{endTime} " + + " and ra.second_depart_id = #{departId} "+ + " and ra.case_category is NOT NULL GROUP BY ra.case_category " + ) + List selectSubCaseData(Date beginTime, Date endTime,String type,Integer departId); /** * 获取受侵害人数 * */ @@ -96,6 +116,18 @@ public interface RpcApplyMapper extends BaseMapper { " GROUP BY person_type HAVING name is NOT NULL") List getIncidentPolice(Date beginTime, Date endTime); + + + @Select("SELECT person_type as name,COUNT(*) from rpc_apply a " + + "LEFT JOIN (SELECT emp_no,person_type from sup_police WHERE del = 0) as b " + + "ON a.input_emp_no = b.emp_no " + + "WHERE a.crt_time BETWEEN #{beginTime} and #{endTime} and a.second_depart_id = #{deptId} " + + " GROUP BY person_type HAVING name is NOT NULL") + List getIncidentPolice(Date beginTime, Date endTime,Integer deptId); + + + + @Select(" select sdp.short_name as name ,COUNT(*) as value from rpc_apply ra " + " LEFT JOIN sup_depart sdp on ra.second_depart_id = sdp.id " + " WHERE sdp.statistics_group_id = 3 " + @@ -211,6 +243,32 @@ public interface RpcApplyMapper extends BaseMapper { " and ra.crt_time BETWEEN #{beginTime} and #{endTime} " + " GROUP BY sdp.short_name order by value desc ") List selectProtectRightsBarList(Date beginTime, Date endTime, Integer departGroupId); + + + /** + * 按事发时间进行筛选 + * 维权案件情况派出所-二级大屏 + * */ + @Select(" SELECT sdp.short_name , COUNT(*) as value from rpc_apply ra " + + " left join sup_depart sdp on ra.depart_id = sdp.id " + + " where sdp.pid = #{departId} " + + " and ra.type =1 and sdp.statistics_group_id = #{departGroupId} " + + " and ra.crt_time BETWEEN #{beginTime} AND #{endTime} " + + " GROUP BY sdp.short_name order by value desc") + List selectSubPcsProtectRightsBarList(Date beginTime, Date endTime, Integer departId, Integer departGroupId); + /** + * 按事发时间进行筛选 + * 维权案件情况大队-二级大屏 + * */ + @Select(" SELECT sdp.short_name , COUNT(*) as value from rpc_apply ra " + + " left join sup_depart sdp on ra.depart_id = sdp.id " + + " where sdp.pid = #{departId} " + + " and ra.type =1 and sdp.statistics_group_id != #{departGroupId} " + + " and ra.crt_time BETWEEN #{beginTime} AND #{endTime} " + + " GROUP BY sdp.short_name order by value desc") + List selectSubDdProtectRightsBarList(Date beginTime, Date endTime, Integer departId, Integer departGroupId); + + //民辅警受伤表 @Select( "SELECT person_type as name, COUNT(*) as val FROM rpc_apply_person as a " + diff --git a/src/main/java/com/biutag/supervision/pojo/vo/DayTimeSuperviseVo.java b/src/main/java/com/biutag/supervision/pojo/vo/DayTimeSuperviseVo.java index 96fa05a..7333f63 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/DayTimeSuperviseVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/DayTimeSuperviseVo.java @@ -14,8 +14,15 @@ import lombok.NoArgsConstructor; @NoArgsConstructor public class DayTimeSuperviseVo { private Integer proTotal; + private Long processingNumber; private Long completedNumber; private Double completedRate; + + private Long changing; + + private Long changed; + + private Long correctionRate; } diff --git a/src/main/java/com/biutag/supervision/service/DataMailService.java b/src/main/java/com/biutag/supervision/service/DataMailService.java index 2d99016..dd8a8e1 100644 --- a/src/main/java/com/biutag/supervision/service/DataMailService.java +++ b/src/main/java/com/biutag/supervision/service/DataMailService.java @@ -179,35 +179,39 @@ public class DataMailService extends ServiceImpl countryQueryWrapper = new QueryWrapper<>(); - countryQueryWrapper.eq("problem_sources_code", 21); - countryQueryWrapper.eq("second_depart_id", departId); - countryQueryWrapper.between("discovery_time", beginTime, endTime); - Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper); // 公安信访 QueryWrapper policeQueryWrapper = new QueryWrapper<>(); policeQueryWrapper.eq("problem_sources_code", 22); policeQueryWrapper.eq("second_depart_id", departId); - policeQueryWrapper.between("discovery_time", beginTime, endTime); + policeQueryWrapper.between("create_time", beginTime, endTime); Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); System.out.println("公安部信访数量:" + policeMail); // 12337信访 QueryWrapper queryWrapper12337 = new QueryWrapper<>(); queryWrapper12337.eq("second_depart_id", departId); - queryWrapper12337.between("discover_time", beginTime, endTime); + queryWrapper12337.between("create_time", beginTime, endTime); Long numberMail = dataPetition12337Mapper.selectCount(queryWrapper12337); temp.setNumberMail(numberMail); // 局长信箱 QueryWrapper subOneMailQueryWrapper = new QueryWrapper<>(); - String exDepartId = supExternalDepartMapper.getExIdByInId(departId.toString(), "局长信箱"); + String exDepartId = supExternalDepartMapper.getExIdByInId(departId.toString(), "局长信箱"); subOneMailQueryWrapper.ne("mail_state", VALID_SIGN); subOneMailQueryWrapper.eq("second_dept_id", exDepartId); subOneMailQueryWrapper.between("create_time", beginTime, endTime); - Long manageMail = mailMapper.selectCount(subOneMailQueryWrapper); + Long manageMail = mailMapper.selectCount(subOneMailQueryWrapper); + + + + + // 国家信访 + QueryWrapper countryQueryWrapper = new QueryWrapper<>(); + countryQueryWrapper.eq("problem_sources_code", 21); + countryQueryWrapper.eq("second_depart_id", departId); + countryQueryWrapper.between("create_time", beginTime, endTime); + Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper); // 总数 Long totalMail = countryMail + policeMail + numberMail; diff --git a/src/main/resources/mapper/DataPetition12337Mapper.xml b/src/main/resources/mapper/DataPetition12337Mapper.xml index 1686857..c1b988f 100644 --- a/src/main/resources/mapper/DataPetition12337Mapper.xml +++ b/src/main/resources/mapper/DataPetition12337Mapper.xml @@ -144,7 +144,7 @@ diff --git a/src/main/resources/mapper/SupTaskProblemMapper.xml b/src/main/resources/mapper/SupTaskProblemMapper.xml index 44d3966..3baf2ee 100644 --- a/src/main/resources/mapper/SupTaskProblemMapper.xml +++ b/src/main/resources/mapper/SupTaskProblemMapper.xml @@ -29,11 +29,11 @@