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 026c02d..57cbed4 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java @@ -1,46 +1,23 @@ package com.biutag.supervision.controller.datav; import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.NumberUtil; -import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.biutag.supervision.common.UserContextHolder; -import com.biutag.supervision.constants.AppConstants; -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.constants.enums.RoleCodeEnum; import com.biutag.supervision.mapper.NegativeMapper; import com.biutag.supervision.pojo.Result; -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.entity.SuperviseReport; -import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.request.datav.DataVRequest; import com.biutag.supervision.pojo.vo.*; -import com.biutag.supervision.service.NegativeBlameService; import com.biutag.supervision.service.NewsService; -import com.biutag.supervision.service.SupDepartService; -import com.biutag.supervision.service.SuperviseReportService; -import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil; +import com.biutag.supervision.service.datav.DatavService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.format.annotation.DateTimeFormat; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; -import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.Objects; -import java.util.concurrent.CompletableFuture; import static com.biutag.supervision.constants.WorkDynamicConstants.DCGZDT; import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*; @@ -59,57 +36,17 @@ public class DataVSupervisionNotifyController { private final NegativeMapper negativeMapper; private final NewsService newsService; - private final NegativeBlameService negativeBlameService; - private final SuperviseReportService superviseReportService; - private final SupDepartService departService; + private final DatavService datavService; // region 左边 - /** - * 获取日常督察情况 - * - * @param beginTime 开始时间 - * @param endTime 结束时间 - * @return - */ - @Operation(summary = "日常督察情况") - @GetMapping("/getChangedRank") - public Result getChangedRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - - endTime= DateUtil.endOfDay(endTime); - DayTimeSuperviseVo fxsjRankOverview = negativeMapper.getSupervisionRank(beginTime, endTime, 3); - DayTimeSuperviseVo jsdwRankOverview = negativeMapper.getSupervisionRank(beginTime, endTime, 4); - - - - - DayTimeSuperviseVo overview = new DayTimeSuperviseVo().addVO(fxsjRankOverview,jsdwRankOverview); - DayTimeSuperviseVo total = negativeMapper.getProTotalFun(beginTime, endTime); - if(ObjectUtil.isNotEmpty(total.getProTotal())){ - overview.setProTotal(total.getProTotal()); - } - - - - List fxsjChangedRankList = negativeMapper.getChangedRateRank(beginTime, endTime, 3); - List jsdwChangedRankList = negativeMapper.getChangedRateRank(beginTime, endTime, 4); - JSONObject data = new JSONObject() - .fluentPut("fxsjRankOverview", fxsjRankOverview) - .fluentPut("jsdwRankOverview", jsdwRankOverview) - .fluentPut("fxsjChangedRankList", fxsjChangedRankList) - .fluentPut("jsdwChangedRankList", jsdwChangedRankList) - .fluentPut("overview",overview); - return Result.success(data); + @Operation(summary = "现场督察卡片") + @PostMapping("/getChangedRank") + public Result getChangedRank(@RequestBody DataVRequest request) { + return datavService.getChangedRank(request); } - /** - * 问题类型占比 - * - * @param beginTime 开始时间 - * @param endTime 结束时间 - * @return - */ + @Operation(summary = "问题类型占比") @GetMapping("/getProblemTypeRate") public Result getProblemTypeRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @@ -120,67 +57,14 @@ public class DataVSupervisionNotifyController { } - /** - * 获取现场督察大屏中央总览 - * - * @param beginTime 开始时间 - * @param endTime 结束时间 - * @return - */ - @Operation(summary = "中央总览数据") - @GetMapping("/getSupervisionNotifyCount") - 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()))); - 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()); - //问题期数 - Long problemQuarter = superviseReportService.count(new LambdaQueryWrapper().between(SuperviseReport::getCrtTime,beginTime,endTime)); - overView.setProblemQuarter(problemQuarter); - 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()); - QueryWrapper queryWrapper = new QueryWrapper<>(); - UserAuth user = UserContextHolder.getCurrentUser(); - // 权限 - if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode())) { - if (user.getAuthDepartIds().isEmpty() || user.getRoleCodes().isEmpty()) { - //特殊处理 - overView.setReportNumber(0L); - } - List orgIds = departService.getAllNodeIds(user.getAuthDepartIds()); - queryWrapper.in("t.crt_depart_id", orgIds); - } + @Operation(summary = "中央总览数据") + @PostMapping("/getSupervisionNotifyCount") + public Result getSupervisionNotifyCount(@RequestBody DataVRequest request) { + return datavService.getSupervisionNotifyCount(request); + } - overView.setReportNumber(superviseReportService.count(queryWrapper)); - 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(); - return Result.success(overView); - } /** * 地图小卡片 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 cb95b45..9c70b57 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVVideoSuperviseController.java @@ -14,20 +14,19 @@ import com.biutag.supervision.pojo.entity.Negative; import com.biutag.supervision.pojo.entity.NegativeBlame; import com.biutag.supervision.pojo.entity.SupPolice; import com.biutag.supervision.pojo.entity.WvpDeviceChannel; +import com.biutag.supervision.pojo.request.datav.DataVRequest; import com.biutag.supervision.pojo.vo.EchartsVo; import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo; import com.biutag.supervision.pojo.vo.VideoSuperviseCountVo; import com.biutag.supervision.pojo.vo.VideoSuperviseMapIconVo; import com.biutag.supervision.service.NegativeBlameService; import com.biutag.supervision.service.SupPoliceService; +import com.biutag.supervision.service.datav.DatavService; 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.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 org.springframework.web.bind.annotation.*; import java.util.*; import java.util.stream.Collectors; @@ -50,6 +49,7 @@ public class DataVVideoSuperviseController { private final WvpDeviceChannelMapper wvpDeviceChannelMapper; private final SupPoliceService policeService; + private final DatavService datavService; //region 左边 @@ -81,24 +81,10 @@ public class DataVVideoSuperviseController { return Result.success(data); } - /** - * 获取视频督察大屏问题数排名 - * - * @param beginTime 开始时间 - * @param endTime 结束时间 - * @return - */ @Operation(summary = "问题数排名") - @GetMapping("/getVideoSuperviseProblemRank") - public Result getVideoSuperviseProblemRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - endTime = DateUtil.endOfDay(endTime); - List fxsjVideoSuperviseProblemRankList = negativeMapper.getVideoSuperviseProblemRank(beginTime, endTime, 3); - List jsdwVideoSuperviseProblemRankList = negativeMapper.getVideoSuperviseProblemRank(beginTime, endTime, 4); - JSONObject data = new JSONObject(); - data.fluentPut("fxsjVideoSuperviseProblemRankList", fxsjVideoSuperviseProblemRankList); - data.fluentPut("jsdwVideoSuperviseProblemRankList", jsdwVideoSuperviseProblemRankList); - return Result.success(data); + @PostMapping("/getVideoSuperviseProblemRank") + public Result getVideoSuperviseProblemRank(@RequestBody DataVRequest request) { + return datavService.getVideoSuperviseProblemRank(request); } //endregion diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index 4607dc0..86f985d 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -361,19 +361,21 @@ public interface NegativeMapper extends BaseMapper { "GROUP BY npr.threeLevelContent ") List getVideoSuperviseProblemTypeRate(Date beginTime, Date endTime); - @Select("SELECT d.short_name AS label, " + - "count(ng.id) as `value`," + - " COUNT(DISTINCT IF(ng.crt_depart_level = 0, ng.id, null)) as cityNumber, "+ - " COUNT(DISTINCT IF(ng.crt_depart_level = 2, ng.id, null)) as countyNumber "+ - " FROM negative ng " + - "INNER JOIN sup_depart d ON ng.second_involve_depart_id = d.id " + - "WHERE ng.checkStatus in (1, 2) " + - "AND ng.problemSourcesCode = 16 " + - "AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + - "AND d.statistics_group_id = #{groupId} " + - "GROUP BY d.short_name " + - "ORDER BY `value` DESC") - List getVideoSuperviseProblemRank(Date beginTime, Date endTime, Integer groupId); + + + + @Select("select * from negative ng " + + "LEFT JOIN sup_depart sd on ng.involveDepartId = sd.id " + + "LEFT JOIN sup_depart sdd on sd.pid = sdd.id " + + "LEFT JOIN sup_depart sddd on sdd.pid = sddd.id " + + "where " + + "ng.check_status_code in (1, 2, 3) " + + "and ng.problemSourcesCode =16 " + + "and ng.crtTime >= #{beginTime} " + + "and ng.crtTime <= #{endTime} " + + "AND (sd.id =#{id} OR sdd.id=#{id} or sddd.id=#{id});" + ) + List getVideoSuperviseProblemRank(String id, Date beginTime, Date endTime); @Select("SELECT " + " d.short_name name, " + @@ -1068,5 +1070,18 @@ public interface NegativeMapper extends BaseMapper { List getOrganizationRank(NegativeOrganizationRankQueryParam param); + @Select("select * from negative ng " + + "LEFT JOIN sup_depart sd on ng.involveDepartId = sd.id " + + "LEFT JOIN sup_depart sdd on sd.pid = sdd.id " + + "LEFT JOIN sup_depart sddd on sdd.pid = sddd.id " + + "where " + + "ng.problemSourcesCode =13 " + + "and ng.crtTime >= #{beginTime} " + + "and ng.crtTime <= #{endTime} " + + "AND (sd.id =#{id} OR sdd.id=#{id} or sddd.id=#{id});" + ) + List getChangedRank(String id, Date beginTime, Date endTime); + + // endregion } 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 5ab2f02..9e8d24b 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/DayTimeSuperviseVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/DayTimeSuperviseVo.java @@ -1,6 +1,7 @@ package com.biutag.supervision.pojo.vo; import cn.hutool.core.util.NumberUtil; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -17,10 +18,17 @@ import java.math.RoundingMode; @AllArgsConstructor @NoArgsConstructor public class DayTimeSuperviseVo { + + @Schema(description = "问题数") private Integer proTotal; + @Schema(description = "办理中") private Long processingNumber; + + @Schema(description = "已办结") private Long completedNumber; + + @Schema(description = "办结率") private Double completedRate; private Long changing; diff --git a/src/main/java/com/biutag/supervision/pojo/vo/SupervisionNotifyOverView.java b/src/main/java/com/biutag/supervision/pojo/vo/SupervisionNotifyOverView.java index ca5e8c0..535f0b3 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/SupervisionNotifyOverView.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/SupervisionNotifyOverView.java @@ -1,5 +1,6 @@ package com.biutag.supervision.pojo.vo; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** @@ -9,21 +10,31 @@ import lombok.Data; */ @Data public class SupervisionNotifyOverView { - // 问题数 + + @Schema(description = "通报问题数") private Integer problemNumber; + + @Schema(description = "通报期数") + private Long reportNumber; + //问题期数 private Long problemQuarter; - // 办理中 + + @Schema(description = "办理中") private Long processingNumber; - // 已办结 + + @Schema(description = "已办结") private Long completedNumber; - // 问责单位数 + + @Schema(description = "问责单位数") private Long departNumber; - // 问责人数 + + @Schema(description = "问责人数") private Long personNumber; - // 办结率 + + @Schema(description = "办结率") private Double completedRate; - // 通报数 - private Long reportNumber; + + } diff --git a/src/main/java/com/biutag/supervision/service/BusinessDepartService.java b/src/main/java/com/biutag/supervision/service/BusinessDepartService.java index 5918da2..e5437c9 100644 --- a/src/main/java/com/biutag/supervision/service/BusinessDepartService.java +++ b/src/main/java/com/biutag/supervision/service/BusinessDepartService.java @@ -327,8 +327,9 @@ public class BusinessDepartService extends ServiceImpl selectJJDList(List happenTime) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.between("cjsj", happenTime.get(0), happenTime.get(1)); - queryWrapper.notLikeRight("jqxzdm", "11"); // 其他业务 - queryWrapper.notLikeRight("jqxzdm", "99"); // 无效、重复报警等 +// queryWrapper.notLikeRight("jqxzdm", "11"); // 其他业务 +// queryWrapper.notLikeRight("jqxzdm", "99"); // 无效、重复报警等 + queryWrapper.eq("jjlxdm", "01"); queryWrapper.groupBy("DATE(cjsj)", "gxdwdm", "gxdwmc"); return gBaseJJDMapper.selectJJDList(queryWrapper); } diff --git a/src/main/java/com/biutag/supervision/service/VideoSuperviseService.java b/src/main/java/com/biutag/supervision/service/VideoSuperviseService.java deleted file mode 100644 index ceefc2c..0000000 --- a/src/main/java/com/biutag/supervision/service/VideoSuperviseService.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.biutag.supervision.service; - -import com.biutag.supervision.mapper.NegativeMapper; -import com.biutag.supervision.pojo.vo.*; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.List; - -/** - * 视频督察服务层 - */ -@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, String... args) { -// List res = negativeMapper.getVideoSuperviseTrend(year, args); -// 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/java/com/biutag/supervision/service/datav/DatavService.java b/src/main/java/com/biutag/supervision/service/datav/DatavService.java index 725a945..c95ad56 100644 --- a/src/main/java/com/biutag/supervision/service/datav/DatavService.java +++ b/src/main/java/com/biutag/supervision/service/datav/DatavService.java @@ -5,6 +5,7 @@ import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.request.datav.DataVRequest; import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest; import com.biutag.supervision.pojo.vo.AuditOverview; +import com.biutag.supervision.pojo.vo.SupervisionNotifyOverView; /** * @ClassName DatavService @@ -206,4 +207,25 @@ public interface DatavService { * @return */ Result getSubOneMailMapIcon(SubDataVRequest request); + + /** + * 视频督察一级大屏问题排名 + * @param request + * @return + */ + Result getVideoSuperviseProblemRank(DataVRequest request); + + /** + * 现场专项一级大屏 现场督察卡片 + * @param request + * @return + */ + Result getChangedRank(DataVRequest request); + + /** + * 现场专项总览 + * @param request + * @return + */ + Result getSupervisionNotifyCount(DataVRequest request); } diff --git a/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java b/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java index 7390314..bf1a0b5 100644 --- a/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java @@ -6,6 +6,8 @@ import cn.hutool.core.util.NumberUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; import com.biutag.supervision.constants.enums.*; import com.biutag.supervision.constants.enums.invest.DeleteStatusEnum; import com.biutag.supervision.constants.enums.invest.ReportProjectNodeEnum; @@ -17,6 +19,7 @@ import com.biutag.supervision.pojo.dto.common.PieItem; import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.pojo.entity.mailbox.Mail; import com.biutag.supervision.pojo.entity.report.ReportProject; +import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.pojo.param.*; import com.biutag.supervision.pojo.param.dataAudit.DataAuditQueryParam; import com.biutag.supervision.pojo.request.datav.DataVRequest; @@ -31,18 +34,19 @@ import com.biutag.supervision.repository.reportproject.ReportProjectResourceServ import com.biutag.supervision.repository.supExternalDepart.SupExternalDepartResourceService; import com.biutag.supervision.repository.supdepart.SupDepartResourceService; import com.biutag.supervision.service.*; +import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; -import org.springframework.util.StringUtils; import java.math.BigDecimal; import java.math.RoundingMode; import java.time.ZoneId; import java.util.*; +import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; +import java.util.stream.Stream; -import static com.biutag.supervision.constants.enums.DepartGroupEnum.COUNTY_CITY_BUREAUS; import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*; /** @@ -112,7 +116,7 @@ public class DatavServiceImpl implements DatavService { private DataPetitionComplaintMapper dataPetitionComplaintMapper; @Resource - private DataMailService dataMailService; + private DataMailService dataMailService; @Resource private MailMapper mailMapper; @@ -120,10 +124,18 @@ public class DatavServiceImpl implements DatavService { private SupExternalDepartMapper supExternalDepartMapper; @Resource - private DataPetition12337Service dataPetition12337Service; + private DataPetition12337Service dataPetition12337Service; @Resource - private SupDepartMapper supDepartMapper; + private SupDepartMapper supDepartMapper; + + @Resource + private NegativeMapper negativeMapper; + + @Resource + private SuperviseReportService superviseReportService; + + private final String VALID_SIGN = "terminated"; private final String EX_SOURCE = "局长信箱"; @@ -588,7 +600,7 @@ public class DatavServiceImpl implements DatavService { List bwzdDw = supDepartResourceService.query(supDepartQueryParam); for (SupDepart supDepart : fxsjDw) { List rpcApplyList = rpcApplyMapper.selectRightsList(supDepart.getId(), request.getBeginTime(), request.getEndTime()); - if (CollectionUtil.isNotEmpty(rpcApplyList)){ + if (CollectionUtil.isNotEmpty(rpcApplyList)) { BarItem barItem = new BarItem(supDepart.getShortName(), new BigDecimal(rpcApplyList.size())); countyRightsBarList.add(barItem); } @@ -596,7 +608,7 @@ public class DatavServiceImpl implements DatavService { for (SupDepart supDepart : bwzdDw) { List rpcApplyList = rpcApplyMapper.selectRightsList(supDepart.getId(), request.getBeginTime(), request.getEndTime()); - if (CollectionUtil.isNotEmpty(rpcApplyList)){ + if (CollectionUtil.isNotEmpty(rpcApplyList)) { BarItem barItem = new BarItem(supDepart.getShortName(), new BigDecimal(rpcApplyList.size())); bureauRightsBarList.add(barItem); } @@ -624,7 +636,7 @@ public class DatavServiceImpl implements DatavService { Date beginTime = request.getBeginTime(); Date endTime = request.getEndTime(); // 发案环节 - List incidentLinkList =rpcApplyMapper.getIncidentLink(beginTime, endTime); + List incidentLinkList = rpcApplyMapper.getIncidentLink(beginTime, endTime); // 发案警种 List incidentPoliceList = rpcApplyMapper.getIncidentPolice(beginTime, endTime); // 发案单位 @@ -633,8 +645,8 @@ public class DatavServiceImpl implements DatavService { List fxsjDw = supDepartResourceService.query(supDepartQueryParam); List incidentOrgList = new ArrayList<>(); for (SupDepart supDepart : fxsjDw) { - List rpcApplyList = rpcApplyMapper.getIncidentOrg(beginTime, endTime, supDepart.getId()); - if (CollectionUtil.isNotEmpty(rpcApplyList)){ + List rpcApplyList = rpcApplyMapper.getIncidentOrg(beginTime, endTime, supDepart.getId()); + if (CollectionUtil.isNotEmpty(rpcApplyList)) { EchartsVo barItem = new EchartsVo(supDepart.getShortName(), rpcApplyList.size()); incidentOrgList.add(barItem); } @@ -656,46 +668,47 @@ public class DatavServiceImpl implements DatavService { /** * 维权抚慰 二级大屏 维权案件情况 + * * @param request * @return */ @Override public Result getSubRightsBarList(SubDataVRequest request) { // 维权案件情况 - 派出所 - List pcsList = rpcApplyMapper.selectSubPcsProtectRightsBarList(request.getBeginTime(), request.getEndTime(), Integer.valueOf(request.getDepartId()),10); + List pcsList = rpcApplyMapper.selectSubPcsProtectRightsBarList(request.getBeginTime(), request.getEndTime(), Integer.valueOf(request.getDepartId()), 10); // 维权案件情况 - 大队 - List dbList = rpcApplyMapper.selectSubDdProtectRightsBarList(request.getBeginTime(), request.getEndTime(), Integer.valueOf(request.getDepartId()),10); + List dbList = rpcApplyMapper.selectSubDdProtectRightsBarList(request.getBeginTime(), request.getEndTime(), Integer.valueOf(request.getDepartId()), 10); JSONObject data = new JSONObject() - .fluentPut("fxsjRightsRankList",pcsList) - .fluentPut("jsdwRightsRankList",dbList); + .fluentPut("fxsjRightsRankList", pcsList) + .fluentPut("jsdwRightsRankList", dbList); return Result.success(data); } @Override public Result getSubComfortMoneyBarList(SubDataVRequest request) { - List fxsjComfortMoneyRank = rpcApplyMapper.getSubPcComfortMoneyBarList(request.getBeginTime(), request.getEndTime(), request.getDepartId(), 10); - List jsdwComfortMoneyRank = rpcApplyMapper.getSubDdComfortMoneyBarList(request.getBeginTime(), request.getEndTime(), request.getDepartId(), 10); - JSONObject data = new JSONObject() - .fluentPut("fxsjComfortMoneyRank",fxsjComfortMoneyRank) - .fluentPut("jsdwComfortMoneyRank",jsdwComfortMoneyRank); + List fxsjComfortMoneyRank = rpcApplyMapper.getSubPcComfortMoneyBarList(request.getBeginTime(), request.getEndTime(), request.getDepartId(), 10); + List jsdwComfortMoneyRank = rpcApplyMapper.getSubDdComfortMoneyBarList(request.getBeginTime(), request.getEndTime(), request.getDepartId(), 10); + JSONObject data = new JSONObject() + .fluentPut("fxsjComfortMoneyRank", fxsjComfortMoneyRank) + .fluentPut("jsdwComfortMoneyRank", jsdwComfortMoneyRank); return Result.success(data); } @Override public Result getSubCaseType(SubDataVRequest request) { - List crownCaseBar =rpcApplyMapper.selectSubCaseData(request.getBeginTime(), request.getEndTime(),"1",Integer.valueOf(request.getDepartId())); + List crownCaseBar = rpcApplyMapper.selectSubCaseData(request.getBeginTime(), request.getEndTime(), "1", Integer.valueOf(request.getDepartId())); //案件类别 - 行政 - List administrativeCase = rpcApplyMapper.selectSubCaseData(request.getBeginTime(), request.getEndTime(),"2",Integer.valueOf(request.getDepartId())); - JSONObject data = new JSONObject().fluentPut("crownCaseBar",crownCaseBar).fluentPut("administrativeCase",administrativeCase); + List administrativeCase = rpcApplyMapper.selectSubCaseData(request.getBeginTime(), request.getEndTime(), "2", Integer.valueOf(request.getDepartId())); + JSONObject data = new JSONObject().fluentPut("crownCaseBar", crownCaseBar).fluentPut("administrativeCase", administrativeCase); return Result.success(data); } @Override public Result getSubComfortState(SubDataVRequest request) { - List comfortSituationList = rpcApplyMapper.getSubComfortState(request.getBeginTime(), request.getEndTime(), request.getDepartId()); + List comfortSituationList = rpcApplyMapper.getSubComfortState(request.getBeginTime(), request.getEndTime(), request.getDepartId()); JSONObject data = new JSONObject().fluentPut("comfortSituationList", comfortSituationList); return Result.success(data); } @@ -703,7 +716,7 @@ public class DatavServiceImpl implements DatavService { @Override public Result getSubHitState(SubDataVRequest request) { List pieItems = rpcApplyMapper.getSubHitState(request.getBeginTime(), request.getEndTime(), request.getDepartId()); - JSONObject data = new JSONObject().fluentPut("PunishmentSituation",pieItems); + JSONObject data = new JSONObject().fluentPut("PunishmentSituation", pieItems); return Result.success(data); } @@ -744,10 +757,10 @@ public class DatavServiceImpl implements DatavService { .filter(s -> s.contains(",")) .mapToLong(s -> s.split(",").length) // 拆分每个名称并计算拆分后的数组长度 .sum();// 计算所有拆分后数组长度的总和 - if(tortNames.stream().noneMatch(s -> s.contains(","))){ + if (tortNames.stream().noneMatch(s -> s.contains(","))) { comfortOverview.setHitTotal(initialListSize); - }else{ - comfortOverview.setHitTotal(initialListSize + nums - hitPersonNumber); + } else { + comfortOverview.setHitTotal(initialListSize + nums - hitPersonNumber); } comfortOverview.setComfortMoney(rpcApplyMapper.selectMapComfortMoney(beginTime, endTime, departId)); JSONObject data = new JSONObject().fluentPut("comfortOverview", comfortOverview); @@ -756,7 +769,6 @@ public class DatavServiceImpl implements DatavService { } - @Override public Result getFirstAndRepeatMail(DataVRequest request) { Date beginTime = request.getBeginTime(); @@ -849,14 +861,14 @@ public class DatavServiceImpl implements DatavService { // 公安信访 Long policeTotal = dataPetitionComplaintMapper.selectMailBySourceCode(beginTime, endTime, GABXF.getValue(), departId); // 12337 - Long numTotal = dataPetition12337Service.count(new LambdaQueryWrapper().between(DataPetition12337::getDiscoverTime, beginTime, endTime).eq(DataPetition12337::getSecondDepartId,departId)); + Long numTotal = dataPetition12337Service.count(new LambdaQueryWrapper().between(DataPetition12337::getDiscoverTime, beginTime, endTime).eq(DataPetition12337::getSecondDepartId, departId)); // 局长信箱 QueryWrapper subOneMailQueryWrapper = new QueryWrapper<>(); - String exDepartId = supExternalDepartMapper.getExIdByInId(departId.toString(), EX_SOURCE); + String exDepartId = supExternalDepartMapper.getExIdByInId(departId.toString(), EX_SOURCE); subOneMailQueryWrapper.ne("mail_state", VALID_SIGN); subOneMailQueryWrapper.eq("second_dept_id", exDepartId); subOneMailQueryWrapper.between("create_time", beginTime, endTime); - Long commissionerTotal = mailMapper.selectCount(subOneMailQueryWrapper); + Long commissionerTotal = mailMapper.selectCount(subOneMailQueryWrapper); // 总数 Long total = countryTotal + policeTotal + numTotal; //国家信访 @@ -881,7 +893,7 @@ public class DatavServiceImpl implements DatavService { List fxsjFirstRankList = dataPetitionComplaintMapper.getSubMailRank(beginTime, endTime, 10, RepeatEnum.FIRST_MAIL.getId(), request.getDepartId()); List fxsjRepeatRankList = dataPetitionComplaintMapper.getSubMailRank(beginTime, endTime, 10, RepeatEnum.REPEAT_MAIL.getId(), request.getDepartId()); // 大队 - List bwzdFirstRankList = dataPetitionComplaintMapper.getSubMailRank(beginTime, endTime, null, RepeatEnum.FIRST_MAIL.getId(),request.getDepartId()); + List bwzdFirstRankList = dataPetitionComplaintMapper.getSubMailRank(beginTime, endTime, null, RepeatEnum.FIRST_MAIL.getId(), request.getDepartId()); List bwzdRepeatRankList = dataPetitionComplaintMapper.getSubMailRank(beginTime, endTime, null, RepeatEnum.REPEAT_MAIL.getId(), request.getDepartId()); // 汇总(派出所) MailFirstAndRepeatOverviewVo fxsjOverview = new MailFirstAndRepeatOverviewVo(); @@ -915,14 +927,14 @@ public class DatavServiceImpl implements DatavService { // 公安信访 Long policeTotal = dataPetitionComplaintMapper.selectMailBySourceCode(beginTime, endTime, GABXF.getValue(), departId); // 12337 - Long numTotal = dataPetition12337Service.count(new LambdaQueryWrapper().between(DataPetition12337::getDiscoverTime, beginTime, endTime).eq(DataPetition12337::getSecondDepartId,departId)); + Long numTotal = dataPetition12337Service.count(new LambdaQueryWrapper().between(DataPetition12337::getDiscoverTime, beginTime, endTime).eq(DataPetition12337::getSecondDepartId, departId)); // 局长信箱 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 commissionerTotal = mailMapper.selectCount(subOneMailQueryWrapper); + Long commissionerTotal = mailMapper.selectCount(subOneMailQueryWrapper); // 总数 Long total = countryTotal + policeTotal + numTotal; //国家信访 @@ -1002,8 +1014,8 @@ public class DatavServiceImpl implements DatavService { dataPetition12337LambdaQueryWrapper.eq(DataPetition12337::getThirdDepartId, re.getDepartId()); Long numTotal = dataPetition12337Service.count(dataPetition12337LambdaQueryWrapper); // 局长信箱 - String exDepartId = supExternalDepartMapper.getExIdByInId(policeDepartId, EX_SOURCE); - Long manageMail = 0L; + String exDepartId = supExternalDepartMapper.getExIdByInId(policeDepartId, EX_SOURCE); + Long manageMail = 0L; if (exDepartId != null) { QueryWrapper qw = new QueryWrapper<>(); qw.ne("mail_state", VALID_SIGN); @@ -1012,10 +1024,10 @@ public class DatavServiceImpl implements DatavService { manageMail = mailMapper.selectCount(qw); } long country = countryTotal == null ? 0L : countryTotal; - long police = policeTotal == null ? 0L : policeTotal; - long num = numTotal == null ? 0L : numTotal; - long manage = manageMail == null ? 0L : manageMail; - Long total = country + police + num ; + long police = policeTotal == null ? 0L : policeTotal; + long num = numTotal == null ? 0L : numTotal; + long manage = manageMail == null ? 0L : manageMail; + Long total = country + police + num; re.setCountryTotal(String.valueOf(country)); re.setPoliceTotal(String.valueOf(police)); re.setCommissionerTotal(String.valueOf(manage)); @@ -1027,6 +1039,227 @@ public class DatavServiceImpl implements DatavService { return Result.success(data); } + @Override + public Result getVideoSuperviseProblemRank(DataVRequest request) { + List fxsjVideoSuperviseProblemRankList = new ArrayList<>(); + List jsdwVideoSuperviseProblemRankList = new ArrayList<>(); + SupDepartQueryParam supDepartQueryParam = new SupDepartQueryParam(); + supDepartQueryParam.setStatisticsGroupId(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId()); + List fxsjDw = supDepartResourceService.query(supDepartQueryParam); + SupDepartQueryParam jsdwQueryParam = new SupDepartQueryParam(); + jsdwQueryParam.setStatisticsGroupId(DepartGroupEnum.BUREAU_AFFILIATED.getId()); + List jsdwDw = supDepartResourceService.query(jsdwQueryParam); + for (SupDepart fxsj : fxsjDw) { + List fxsjList = negativeMapper.getVideoSuperviseProblemRank(fxsj.getId(), request.getBeginTime(), request.getEndTime()); + // 总数 + long total = fxsjList.size(); + if (total==0){ + continue; + } + // 市局下发 + long sjxf = fxsjList.stream().filter(one -> Integer.valueOf(0).equals(one.getCrtDepartLevel())).count(); + // 县局下发 + long xjxf = fxsjList.stream().filter(one -> Integer.valueOf(2).equals(one.getCrtDepartLevel())).count(); + OrganizeProblemRankVo organizeProblemRankVo = new OrganizeProblemRankVo(); + organizeProblemRankVo.setLabel(fxsj.getShortName()); + organizeProblemRankVo.setCityNumber(String.valueOf(sjxf)); + organizeProblemRankVo.setCountyNumber(String.valueOf(xjxf)); + organizeProblemRankVo.setValue(String.valueOf(total)); + fxsjVideoSuperviseProblemRankList.add(organizeProblemRankVo); + } + for (SupDepart jsdw : jsdwDw) { + List fxsjList = negativeMapper.getVideoSuperviseProblemRank(jsdw.getId(), request.getBeginTime(), request.getEndTime()); + // 总数 + long total = fxsjList.size(); + if (total==0){ + continue; + } + // 市局下发 + long sjxf = fxsjList.stream().filter(one -> Integer.valueOf(0).equals(one.getCrtDepartLevel())).count(); + // 县局下发 + long xjxf = fxsjList.stream().filter(one -> Integer.valueOf(2).equals(one.getCrtDepartLevel())).count(); + OrganizeProblemRankVo organizeProblemRankVo = new OrganizeProblemRankVo(); + organizeProblemRankVo.setLabel(jsdw.getShortName()); + organizeProblemRankVo.setCityNumber(String.valueOf(sjxf)); + organizeProblemRankVo.setCountyNumber(String.valueOf(xjxf)); + organizeProblemRankVo.setValue(String.valueOf(total)); + jsdwVideoSuperviseProblemRankList.add(organizeProblemRankVo); + } + // 排序 + fxsjVideoSuperviseProblemRankList.sort( + Comparator.comparingLong((OrganizeProblemRankVo vo) -> Long.parseLong(vo.getValue())) + .reversed() + ); + jsdwVideoSuperviseProblemRankList.sort( + Comparator.comparingLong((OrganizeProblemRankVo vo) -> Long.parseLong(vo.getValue())) + .reversed() + ); + + JSONObject data = new JSONObject(); + data.fluentPut("fxsjVideoSuperviseProblemRankList", fxsjVideoSuperviseProblemRankList); + data.fluentPut("jsdwVideoSuperviseProblemRankList", jsdwVideoSuperviseProblemRankList); + return Result.success(data); + } + + @Override + public Result getChangedRank(DataVRequest request) { + List fxsjChangedRankList = new ArrayList<>(); + List jsdwChangedRankList = new ArrayList<>(); + SupDepartQueryParam supDepartQueryParam = new SupDepartQueryParam(); + supDepartQueryParam.setStatisticsGroupId(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId()); + List fxsjDw = supDepartResourceService.query(supDepartQueryParam); + SupDepartQueryParam jsdwQueryParam = new SupDepartQueryParam(); + jsdwQueryParam.setStatisticsGroupId(DepartGroupEnum.BUREAU_AFFILIATED.getId()); + List jsdwDw = supDepartResourceService.query(jsdwQueryParam); + for (SupDepart fxsj : fxsjDw) { + List negativeList = negativeMapper.getChangedRank(fxsj.getId(), request.getBeginTime(), request.getEndTime()); + // 问题数 + int totalPro = negativeList.size(); + if (totalPro==0){ + continue; + } + // 办结数 + long completed = negativeList.stream().filter(Objects::nonNull).filter(one -> ProcessingStatusEnum.completed.name().equals(one.getProcessingStatus())).count(); + // 市局下发 + long sjxf = negativeList.stream().filter(Objects::nonNull).filter(one -> Integer.valueOf(0).equals(one.getCrtDepartLevel())).count(); + // 县局下发 + long xjxf = negativeList.stream().filter(Objects::nonNull).filter(one -> Integer.valueOf(2).equals(one.getCrtDepartLevel())).count(); + String rate = BigDecimal.valueOf(completed) + .multiply(BigDecimal.valueOf(100)) + .divide(BigDecimal.valueOf(totalPro), 1, RoundingMode.HALF_UP) + .toString(); + RankVo rankVo = new RankVo(); + rankVo.setLabel(fxsj.getShortName()); + rankVo.setDepartId(fxsj.getId()); + rankVo.setCityNumber(String.valueOf(sjxf)); + rankVo.setCountyNumber(String.valueOf(xjxf)); + rankVo.setNumerator(String.valueOf(completed)); + rankVo.setDenominator(String.valueOf(totalPro)); + rankVo.setValue(rate); + rankVo.setRate(rate); + fxsjChangedRankList.add(rankVo); + } + for (SupDepart jsdw : jsdwDw) { + List negativeList = negativeMapper.getChangedRank(jsdw.getId(), request.getBeginTime(), request.getEndTime()); + // 问题数 + int totalPro = negativeList.size(); + if (totalPro==0){ + continue; + } + // 办结数 + long completed = negativeList.stream().filter(Objects::nonNull).filter(one -> ProcessingStatusEnum.completed.name().equals(one.getProcessingStatus())).count(); + // 市局下发 + long sjxf = negativeList.stream().filter(Objects::nonNull).filter(one -> Integer.valueOf(0).equals(one.getCrtDepartLevel())).count(); + // 县局下发 + long xjxf = negativeList.stream().filter(Objects::nonNull).filter(one -> Integer.valueOf(2).equals(one.getCrtDepartLevel())).count(); + String rate = BigDecimal.valueOf(completed) + .multiply(BigDecimal.valueOf(100)) + .divide(BigDecimal.valueOf(totalPro), 1, RoundingMode.HALF_UP) + .toString(); + RankVo rankVo = new RankVo(); + rankVo.setLabel(jsdw.getShortName()); + rankVo.setDepartId(jsdw.getId()); + rankVo.setCityNumber(String.valueOf(sjxf)); + rankVo.setCountyNumber(String.valueOf(xjxf)); + rankVo.setNumerator(String.valueOf(completed)); + rankVo.setDenominator(String.valueOf(totalPro)); + rankVo.setValue(rate); + rankVo.setRate(rate); + jsdwChangedRankList.add(rankVo); + } + + fxsjChangedRankList.sort( + Comparator.comparingLong((RankVo vo) -> Long.parseLong(vo.getDenominator())) + .reversed() + ); + + jsdwChangedRankList.sort( + Comparator.comparingLong((RankVo vo) -> Long.parseLong(vo.getDenominator())) + .reversed() + ); + + long total = Stream.concat(fxsjChangedRankList.stream(), jsdwChangedRankList.stream()) + .mapToLong(vo -> Long.parseLong(vo.getDenominator())) + .sum(); + + long completed = Stream.concat(fxsjChangedRankList.stream(), jsdwChangedRankList.stream()) + .mapToLong(vo -> Long.parseLong(vo.getNumerator())) + .sum(); + + long processing = total - completed; + double rate = total == 0 ? 0.0 : BigDecimal.valueOf(completed) + .multiply(BigDecimal.valueOf(100)) + .divide(BigDecimal.valueOf(total), 1, RoundingMode.HALF_UP) + .doubleValue(); + DayTimeSuperviseVo overview = new DayTimeSuperviseVo(); + overview.setProTotal((int) total); + overview.setProcessingNumber(processing); + overview.setCompletedNumber(completed); + overview.setCompletedRate(rate); + JSONObject data = new JSONObject() + .fluentPut("fxsjChangedRankList", fxsjChangedRankList) + .fluentPut("jsdwChangedRankList", jsdwChangedRankList) + .fluentPut("overview", overview); + return Result.success(data); + } + + @Override + public Result getSupervisionNotifyCount(DataVRequest request) { + SupervisionNotifyOverView overView = new SupervisionNotifyOverView(); + List proCode = List.of(XCDC.getValue(), LMGZ.getValue(), ZXDC.getValue()); + LambdaQueryWrapper negativeLambdaQueryWrapper = new LambdaQueryWrapper<>(); + negativeLambdaQueryWrapper.between(Negative::getCrtTime, request.getBeginTime(), request.getEndTime()); + negativeLambdaQueryWrapper.in(Negative::getProblemSourcesCode, proCode); + List negatives = negativeMapper.selectList(negativeLambdaQueryWrapper); + + List completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList(); + List processingList = negatives.stream().filter(item -> ProcessingStatusEnum.processing.name().equals(item.getProcessingStatus())).toList(); + + LambdaQueryWrapper superviseReportLambdaQueryWrapper = new LambdaQueryWrapper<>(); + UserAuth user = UserContextHolder.getCurrentUser(); + // 权限 + if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode())) { + if (user.getAuthDepartIds().isEmpty() || user.getRoleCodes().isEmpty()) { + //特殊处理 + overView.setReportNumber(0L); + } + List orgIds = supDepartService.getAllNodeIds(user.getAuthDepartIds()); + superviseReportLambdaQueryWrapper.in(SuperviseReport::getCrtDepartId, orgIds); + } + superviseReportLambdaQueryWrapper.between(SuperviseReport::getCrtTime, request.getBeginTime(), request.getEndTime()); + superviseReportLambdaQueryWrapper.eq(SuperviseReport::getType, "1"); + List superviseReportList = superviseReportService.list(superviseReportLambdaQueryWrapper); + + List negativeIds = negatives.stream().filter(item -> InspectCaseEnum.isItTure(item.getCheckStatus())).map(Negative::getId).toList(); + 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(); + + // 通报问题数 + overView.setProblemNumber(negatives.size()); + // 通报期数 + overView.setReportNumber((long) superviseReportList.size()); + // 办理中 + overView.setProcessingNumber((long) processingList.size()); + // 已办结 + overView.setCompletedNumber((long) completedList.size()); + return Result.success(overView); + } public Result getSubOneMailMapIcon() { @@ -1197,33 +1430,87 @@ public class DatavServiceImpl implements DatavService { // ===== 分县市局 - 群体集访 ===== List fxsjMassMailList = new ArrayList<>(); - OrganizeProblemRankVo v1 = new OrganizeProblemRankVo(); v1.setLabel("浏阳市局"); v1.setValue("126"); fxsjMassMailList.add(v1); - OrganizeProblemRankVo v2 = new OrganizeProblemRankVo(); v2.setLabel("宁乡市局"); v2.setValue("98"); fxsjMassMailList.add(v2); - OrganizeProblemRankVo v3 = new OrganizeProblemRankVo(); v3.setLabel("长沙县局"); v3.setValue("86"); fxsjMassMailList.add(v3); - OrganizeProblemRankVo v4 = new OrganizeProblemRankVo(); v4.setLabel("望城区局"); v4.setValue("74"); fxsjMassMailList.add(v4); - OrganizeProblemRankVo v5 = new OrganizeProblemRankVo(); v5.setLabel("岳麓分局"); v5.setValue("63"); fxsjMassMailList.add(v5); + OrganizeProblemRankVo v1 = new OrganizeProblemRankVo(); + v1.setLabel("浏阳市局"); + v1.setValue("126"); + fxsjMassMailList.add(v1); + OrganizeProblemRankVo v2 = new OrganizeProblemRankVo(); + v2.setLabel("宁乡市局"); + v2.setValue("98"); + fxsjMassMailList.add(v2); + OrganizeProblemRankVo v3 = new OrganizeProblemRankVo(); + v3.setLabel("长沙县局"); + v3.setValue("86"); + fxsjMassMailList.add(v3); + OrganizeProblemRankVo v4 = new OrganizeProblemRankVo(); + v4.setLabel("望城区局"); + v4.setValue("74"); + fxsjMassMailList.add(v4); + OrganizeProblemRankVo v5 = new OrganizeProblemRankVo(); + v5.setLabel("岳麓分局"); + v5.setValue("63"); + fxsjMassMailList.add(v5); // ===== 分县市局 - 领导接访 ===== List fxsjLeaderReviewMailList = new ArrayList<>(); - OrganizeProblemRankVo v6 = new OrganizeProblemRankVo(); v6.setLabel("浏阳市局"); v6.setValue("34"); fxsjLeaderReviewMailList.add(v6); - OrganizeProblemRankVo v7 = new OrganizeProblemRankVo(); v7.setLabel("宁乡市局"); v7.setValue("28"); fxsjLeaderReviewMailList.add(v7); - OrganizeProblemRankVo v8 = new OrganizeProblemRankVo(); v8.setLabel("长沙县局"); v8.setValue("25"); fxsjLeaderReviewMailList.add(v8); - OrganizeProblemRankVo v9 = new OrganizeProblemRankVo(); v9.setLabel("望城区局"); v9.setValue("19"); fxsjLeaderReviewMailList.add(v9); - OrganizeProblemRankVo v10 = new OrganizeProblemRankVo(); v10.setLabel("岳麓分局"); v10.setValue("16"); fxsjLeaderReviewMailList.add(v10); + OrganizeProblemRankVo v6 = new OrganizeProblemRankVo(); + v6.setLabel("浏阳市局"); + v6.setValue("34"); + fxsjLeaderReviewMailList.add(v6); + OrganizeProblemRankVo v7 = new OrganizeProblemRankVo(); + v7.setLabel("宁乡市局"); + v7.setValue("28"); + fxsjLeaderReviewMailList.add(v7); + OrganizeProblemRankVo v8 = new OrganizeProblemRankVo(); + v8.setLabel("长沙县局"); + v8.setValue("25"); + fxsjLeaderReviewMailList.add(v8); + OrganizeProblemRankVo v9 = new OrganizeProblemRankVo(); + v9.setLabel("望城区局"); + v9.setValue("19"); + fxsjLeaderReviewMailList.add(v9); + OrganizeProblemRankVo v10 = new OrganizeProblemRankVo(); + v10.setLabel("岳麓分局"); + v10.setValue("16"); + fxsjLeaderReviewMailList.add(v10); // ===== 局属单位 - 群体集访 ===== List bwzdMassMailList = new ArrayList<>(); - OrganizeProblemRankVo b1 = new OrganizeProblemRankVo(); b1.setLabel("治安支队"); b1.setValue("47"); bwzdMassMailList.add(b1); - OrganizeProblemRankVo b2 = new OrganizeProblemRankVo(); b2.setLabel("刑侦支队"); b2.setValue("39"); bwzdMassMailList.add(b2); - OrganizeProblemRankVo b3 = new OrganizeProblemRankVo(); b3.setLabel("交警支队"); b3.setValue("33"); bwzdMassMailList.add(b3); - OrganizeProblemRankVo b4 = new OrganizeProblemRankVo(); b4.setLabel("网安支队"); b4.setValue("28"); bwzdMassMailList.add(b4); + OrganizeProblemRankVo b1 = new OrganizeProblemRankVo(); + b1.setLabel("治安支队"); + b1.setValue("47"); + bwzdMassMailList.add(b1); + OrganizeProblemRankVo b2 = new OrganizeProblemRankVo(); + b2.setLabel("刑侦支队"); + b2.setValue("39"); + bwzdMassMailList.add(b2); + OrganizeProblemRankVo b3 = new OrganizeProblemRankVo(); + b3.setLabel("交警支队"); + b3.setValue("33"); + bwzdMassMailList.add(b3); + OrganizeProblemRankVo b4 = new OrganizeProblemRankVo(); + b4.setLabel("网安支队"); + b4.setValue("28"); + bwzdMassMailList.add(b4); // ===== 局属单位 - 领导接访 ===== List bwzdLeaderReviewMailList = new ArrayList<>(); - OrganizeProblemRankVo b5 = new OrganizeProblemRankVo(); b5.setLabel("治安支队"); b5.setValue("14"); bwzdLeaderReviewMailList.add(b5); - OrganizeProblemRankVo b6 = new OrganizeProblemRankVo(); b6.setLabel("刑侦支队"); b6.setValue("11"); bwzdLeaderReviewMailList.add(b6); - OrganizeProblemRankVo b7 = new OrganizeProblemRankVo(); b7.setLabel("交警支队"); b7.setValue("9"); bwzdLeaderReviewMailList.add(b7); - OrganizeProblemRankVo b8 = new OrganizeProblemRankVo(); b8.setLabel("网安支队"); b8.setValue("6"); bwzdLeaderReviewMailList.add(b8); + OrganizeProblemRankVo b5 = new OrganizeProblemRankVo(); + b5.setLabel("治安支队"); + b5.setValue("14"); + bwzdLeaderReviewMailList.add(b5); + OrganizeProblemRankVo b6 = new OrganizeProblemRankVo(); + b6.setLabel("刑侦支队"); + b6.setValue("11"); + bwzdLeaderReviewMailList.add(b6); + OrganizeProblemRankVo b7 = new OrganizeProblemRankVo(); + b7.setLabel("交警支队"); + b7.setValue("9"); + bwzdLeaderReviewMailList.add(b7); + OrganizeProblemRankVo b8 = new OrganizeProblemRankVo(); + b8.setLabel("网安支队"); + b8.setValue("6"); + bwzdLeaderReviewMailList.add(b8); // ===== 汇总(分县市局)===== MailEntanglementMassOverviewVo fxsjOverview = new MailEntanglementMassOverviewVo();