From a1b8d430cc9fe71116bb589842961051e58cbbc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E7=88=B1=E5=AD=A6=E4=B9=A0=E7=9A=84=E7=9F=B3?= =?UTF-8?q?=E5=90=8C=E5=AD=A6?= <2936013465@qq.com> Date: Sun, 17 Nov 2024 01:13:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=B0=E5=9C=BA=E7=9D=A3=E5=AF=9F=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F2024/11/16=20=2022:51?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datav/SupervisionNotifyController.java | 13 ++++- .../supervision/mapper/NegativeMapper.java | 21 ++++++-- .../pojo/vo/SuperviseMapIconVo.java | 1 + .../DataSupervisionNotifyServiceImpl.java | 53 ++++--------------- 4 files changed, 39 insertions(+), 49 deletions(-) diff --git a/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java b/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java index 1eeb90f..08eed14 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java @@ -21,6 +21,7 @@ import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Map; /** * @Auther: sh @@ -53,8 +54,18 @@ public class SupervisionNotifyController { //地图数据 List superviseTempMapVoList = dataSupervisionNotifyService.getsupervisionMapIconInfo(beginTime, endTime); + + // 黄赌毒总览 + List> hddzlList = new ArrayList<>(); + + + // 黄毒赌列表 + List hddList = dataSupervisionNotifyService.getYellowBet(beginTime, endTime); + JSONObject data = new JSONObject().fluentPut("wtlxList", wtlxList) - .fluentPut("overview", overview); + .fluentPut("overview", overview) + .fluentPut("superviseTempMapVoList", superviseTempMapVoList) + .fluentPut("hddList", hddList); return Result.success(data); } diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index 74d2adb..673d284 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -3,10 +3,7 @@ package com.biutag.supervision.mapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.biutag.supervision.pojo.entity.Negative; -import com.biutag.supervision.pojo.vo.EchartsVo; -import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo; -import com.biutag.supervision.pojo.vo.RankVo; -import com.biutag.supervision.pojo.vo.RecentTrendByMonthVo; +import com.biutag.supervision.pojo.vo.*; import org.apache.ibatis.annotations.Select; import java.util.Date; @@ -240,6 +237,22 @@ public interface NegativeMapper extends BaseMapper { @Select("") Long getRelationOrgCountByDepartId(String departId); + @Select("SELECT a.departId, a.name, COUNT(DISTINCT c.id) AS totalPro, COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS changing, COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS changed, COUNT(DISTINCT c.involveDepartId) AS relationOrg, COUNT(DISTINCT d.blameIdCode) AS personNum, ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS changedRate\n" + + "FROM statistics_depart a INNER JOIN sup_depart b ON a.departId = b.pid " + + " INNER JOIN negative c ON b.id = c.involveDepartId " + + " LEFT JOIN negative_blame d ON c.id = d.negativeId " + + "WHERE a.groupId = 3 AND discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND problemSourcesCode IN (13, 15) " + + "GROUP BY a.name, a.departId") + List getMap(Date beginTime, Date endTime); + + @Select("SELECT a.name, COUNT(DISTINCT c.id) AS problem_number, COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS rectifing_number, COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS rectifed_number, COUNT(DISTINCT c.involveDepartId) AS depart_number, COUNT(DISTINCT d.blameIdCode) AS person_number, ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS rectify_rate\n" + + "FROM statistics_depart a INNER JOIN sup_depart b ON a.departId = b.pid " + + " INNER JOIN negative c ON b.id = c.involveDepartId " + + " LEFT JOIN negative_blame d ON c.id = d.negativeId " + + "WHERE a.groupId = 3 AND discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND special_supervision = 1\n" + + "GROUP BY a.name") + List getYellowBet(Date beginTime, Date endTime); + // endregion diff --git a/src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java b/src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java index 979cc00..0333343 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java @@ -15,6 +15,7 @@ public class SuperviseMapIconVo { private String changed; private String relationOrg; private String changedRate; + private String personNum; private String departId; } diff --git a/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java b/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java index 0fa804c..3af75d1 100644 --- a/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java @@ -62,6 +62,7 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl getProblemTypeRatio(Date beginTime, Date endTime) { - List echartsVos = new ArrayList<>(); - echartsVos = negativeMapper.getProblemTypes(beginTime, endTime); + List echartsVos = negativeMapper.getProblemTypes(beginTime, endTime); return echartsVos; } @@ -166,7 +166,6 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl getsupervisionMapIconInfo(Date beginTime, Date endTime) { - List res = new ArrayList<>(); - List supDeparts = supDepartMapper.selectDepartsByGroupType(3); - for (SupDepart supDepart : supDeparts) { - SuperviseMapIconVo SuperviseMapIconVo = new SuperviseMapIconVo(); - SuperviseMapIconVo.setName(supDepart.getShortName()); - SuperviseMapIconVo.setDepartId(supDepart.getId()); - res.add(SuperviseMapIconVo); - } - for (SuperviseMapIconVo re : res) { - String departId = re.getDepartId(); - Long changed = negativeMapper.getNotifyChanged(beginTime, endTime, departId); - Long changing = negativeMapper.getNotifyChanging(beginTime, endTime, departId); - Long totalPro = changed + changing; - Long relationOrg = negativeMapper.getRelationOrgCountByDepartId(departId); - QueryWrapper preQueryWrapper = new QueryWrapper<>(); - preQueryWrapper.in("problemSourcesCode", ProblemSourcesEnum.XCDC.getValue(), ProblemSourcesEnum.ZXDC.getValue()); - List negatives = negativeMapper.selectList(preQueryWrapper); - Long supervisionNotifyPreTotal = 0L; - for (Negative negative : negatives) { - String id = negative.getId(); - QueryWrapper totalWrapper = new QueryWrapper<>(); - totalWrapper.eq("negativeId", id); - supervisionNotifyPreTotal += negativeBlameMapper.selectCount(totalWrapper); - } - } - return null; + List res = negativeMapper.getMap(beginTime, endTime); + return res; + } + + public List getYellowBet(Date beginTime, Date endTime) { + List res = negativeMapper.getYellowBet(beginTime, endTime); + return res; } - /** - * 涉及人数 - * 1、查出在 negative中的id集合 - * 2、查出集合在blame中的涉及人数 - */ - /*QueryWrapper preQueryWrapper = new QueryWrapper<>(); - preQueryWrapper.in("problemSourcesCode", ProblemSourcesEnum.XCDC.getValue(), ProblemSourcesEnum.ZXDC.getValue()); - List negatives = negativeMapper.selectList(preQueryWrapper); - Long supervisionNotifyPreTotal = 0L; - for (Negative negative : negatives) { - String id = negative.getId(); - QueryWrapper totalWrapper = new QueryWrapper<>(); - totalWrapper.eq("negativeId", id); - supervisionNotifyPreTotal += negativeBlameMapper.selectCount(totalWrapper); - }*/ }