From aa7a50d37d89e997b5342102f64464ea7b47ea82 Mon Sep 17 00:00:00 2001 From: sjh Date: Fri, 15 Nov 2024 21:28:02 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9104=E5=8F=B7=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/biutag/supervision/service/ModelClueService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java index db20327..677400d 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -1048,7 +1048,7 @@ public class ModelClueService extends ServiceImpl { private void getModelCluesForModel104(String param, List modelClues) { System.out.println("模型104开始查询数据库"); List params = parseSqlForModel2(param); - String sql = "SELECT gxdwdm, gxdwmc, COUNT(*) AS zjjs from dwd_asj_zhtx_jjd where bjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' AND jqjb != '04' AND (ysjqxzdm LIKE '01%' OR ysjqxzdm LIKE'02%' OR ysjqxzdm LIKE'06%') AND (bjxldm NOT LIKE '01%' AND bjxldm NOT LIKE '02%' AND bjxldm NOT LIKE '06%') GROUP BY gxdwdm, gxdwmc;"; + String sql = "SELECT gxdwdm, gxdwmc, COUNT(*) AS zjjs from dwd_asj_zhtx_jjd where bjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' AND jqjb != '04' AND (ysjqxzdm LIKE '01%' OR ysjqxzdm LIKE'02%' OR ysjqxzdm LIKE'06%') AND (bjxldm NOT LIKE '01%' AND bjxldm NOT LIKE '02%' AND bjxldm NOT LIKE '06%') and bjfsdm = '0101' GROUP BY gxdwdm, gxdwmc;"; List> jjdmaps = modelClueDataMapper.selectByUniqueKeys(sql); System.out.println("模型104查询数据库完毕"); if (jjdmaps.isEmpty()) { @@ -1085,7 +1085,7 @@ public class ModelClueService extends ServiceImpl { BigDecimal sumOfPercentages = departPercentageMap.values().stream() .reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal avgPercentage = sumOfPercentages.divide(BigDecimal.valueOf(departPercentageMap.size()), 3, RoundingMode.HALF_UP); - BigDecimal multiply = avgPercentage.multiply(new BigDecimal("0.5")); + BigDecimal multiply = avgPercentage.multiply(new BigDecimal("1.5")); List highPercentageDepartments = departPercentageMap.entrySet().stream() .filter(entry -> entry.getValue().compareTo(multiply) > 0) .map(Map.Entry::getKey) From 097012e83df9d0e78d9a97dfb610debae2504e50 Mon Sep 17 00:00:00 2001 From: sjh Date: Fri, 15 Nov 2024 22:19:46 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9104=E5=8F=B7=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supervision/pojo/entity/ModelClue.java | 4 +++ .../supervision/service/ModelClueService.java | 32 ++++++++++--------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/biutag/supervision/pojo/entity/ModelClue.java b/src/main/java/com/biutag/supervision/pojo/entity/ModelClue.java index f84c10f..01ad479 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/ModelClue.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/ModelClue.java @@ -76,6 +76,10 @@ public class ModelClue { @TableField(exist = false) private Long zjjs; + // 104号模型用 + @TableField(exist = false) + private Long allZjjs; + // 执法场所登记数 @TableField(exist = false) private Long zfcsdjs; diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java index 677400d..87b6e91 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -1048,7 +1048,7 @@ public class ModelClueService extends ServiceImpl { private void getModelCluesForModel104(String param, List modelClues) { System.out.println("模型104开始查询数据库"); List params = parseSqlForModel2(param); - String sql = "SELECT gxdwdm, gxdwmc, COUNT(*) AS zjjs from dwd_asj_zhtx_jjd where bjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' AND jqjb != '04' AND (ysjqxzdm LIKE '01%' OR ysjqxzdm LIKE'02%' OR ysjqxzdm LIKE'06%') AND (bjxldm NOT LIKE '01%' AND bjxldm NOT LIKE '02%' AND bjxldm NOT LIKE '06%') and bjfsdm = '0101' GROUP BY gxdwdm, gxdwmc;"; + String sql = "select a.gxdwdm, a.gxdwmc, a.num anum, b.num bnum from ((SELECT gxdwdm, gxdwmc, COUNT(*) AS zjjs from dwd_asj_zhtx_jjd where bjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' AND (ysjqxzdm LIKE '01%' OR ysjqxzdm LIKE'02%' OR ysjqxzdm LIKE'06%') AND (bjxldm NOT LIKE '01%' AND bjxldm NOT LIKE '02%' AND bjxldm NOT LIKE '06%') and bjfsdm = '0101' GROUP BY gxdwdm, gxdwmc) a join (SELECT gxdwdm, gxdwmc, COUNT(*) AS zjjs from dwd_asj_zhtx_jjd where bjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' AND (ysjqxzdm LIKE '01%' OR ysjqxzdm LIKE'02%' OR ysjqxzdm LIKE'06%') and bjfsdm = '0101' GROUP BY gxdwdm, gxdwmc) b on a.gxdwdm = b.gxdwdm);"; List> jjdmaps = modelClueDataMapper.selectByUniqueKeys(sql); System.out.println("模型104查询数据库完毕"); if (jjdmaps.isEmpty()) { @@ -1062,7 +1062,8 @@ public class ModelClueService extends ServiceImpl { modelClue.setData(JSONObject.toJSONString(data)); modelClue.setInvolveDepartId(supExternalDepart.getExternalId()); modelClue.setInvolveDepartName(supExternalDepart.getExternalName()); - modelClue.setZjjs((Long) data.get("zjjs")); + modelClue.setZjjs((Long) data.get("anum")); + modelClue.setAllZjjs((Long)data.get("bnum")); modelClue.setDepartLevel(supExternalDepart.getLevel()); modelClue.setParentId(supExternalDepart.getPid()); modelClue.setThisId(supExternalDepart.getInternalId()); @@ -1072,22 +1073,19 @@ public class ModelClueService extends ServiceImpl { List jjdModelClues3 = new ArrayList<>(jjdModelClues.stream().filter(clue -> clue.getDepartLevel() == 3).toList()); List jjdModelClues4 = new ArrayList<>(jjdModelClues.stream().filter(clue -> clue.getDepartLevel() == 4).toList()); List jjdModelClues5 = new ArrayList<>(jjdModelClues.stream().filter(clue -> clue.getDepartLevel() == 5).toList()); - mergeModelClues(jjdModelClues5, jjdModelClues4, 1); - mergeModelClues(jjdModelClues4, jjdModelClues3, 1); - BigDecimal zjjsTotal = BigDecimal.valueOf(jjdModelClues3.stream().mapToLong(ModelClue::getZjjs).sum()); + mergeModelClues(jjdModelClues5, jjdModelClues4, 3); + mergeModelClues(jjdModelClues4, jjdModelClues3, 3); Map departPercentageMap = new HashMap<>(); Map departNumMap = new HashMap<>(); + Map departAllNumMap = new HashMap<>(); for (ModelClue jjdModelClue : jjdModelClues3) { - BigDecimal percentage = BigDecimal.valueOf(jjdModelClue.getZjjs()).divide(zjjsTotal, 3, RoundingMode.HALF_UP); + BigDecimal percentage = BigDecimal.valueOf(jjdModelClue.getZjjs()).divide(BigDecimal.valueOf(jjdModelClue.getAllZjjs()), 3, RoundingMode.HALF_UP); departPercentageMap.put(jjdModelClue.getInvolveDepartId(), percentage); departNumMap.put(jjdModelClue.getInvolveDepartId(), jjdModelClue.getZjjs()); + departAllNumMap.put(jjdModelClue.getInvolveDepartId(), jjdModelClue.getAllZjjs()); } - BigDecimal sumOfPercentages = departPercentageMap.values().stream() - .reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal avgPercentage = sumOfPercentages.divide(BigDecimal.valueOf(departPercentageMap.size()), 3, RoundingMode.HALF_UP); - BigDecimal multiply = avgPercentage.multiply(new BigDecimal("1.5")); List highPercentageDepartments = departPercentageMap.entrySet().stream() - .filter(entry -> entry.getValue().compareTo(multiply) > 0) + .filter(entry -> entry.getValue().compareTo(BigDecimal.valueOf(0.7)) > 0) .map(Map.Entry::getKey) .toList(); for (String department : highPercentageDepartments) { @@ -1106,10 +1104,8 @@ public class ModelClueService extends ServiceImpl { newModelClue.setDistributionState("0"); newModelClue.setThingDesc("发现" + newModelClue.getInvolveDepartName() + "在" + getDateString(params.get(0)) + "到" + getDateString(params.get(1)) - + "之间变更了" + departNumMap.get(department) + "个警情的结警性质,占全市的" - + convertToPercentString(departPercentageMap.get(department)) + ",超过了全市单位平均值(" - + convertToPercentString(avgPercentage) + ")的50%(即" - + convertToPercentString(multiply) + ")以上,存在大量变更接警性质的异常情况。"); + + "之间共有" + departAllNumMap.get(department) + "个警情,变更了" + departNumMap.get(department) + + "个警情的结警性质,超过了该单位总警情的70%,存在大量变更接警性质的异常情况。"); newModelClue.setData(newModelClue.getThingDesc()); modelClues.add(newModelClue); } @@ -1126,6 +1122,9 @@ public class ModelClueService extends ServiceImpl { modelClue1.setZjjs(modelClue2.getZjjs() + modelClue1.getZjjs()); } else if (no == 2) { modelClue1.setZfcsdjs(modelClue2.getZfcsdjs() + modelClue1.getZfcsdjs()); + } else if (no == 3) { + modelClue1.setZjjs(modelClue2.getZjjs() + modelClue1.getZjjs()); + modelClue1.setAllZjjs(modelClue2.getAllZjjs() + modelClue1.getAllZjjs()); } modelClue1.setData(modelClue1.getData() + modelClue2.getData()); found = true; @@ -1146,6 +1145,9 @@ public class ModelClueService extends ServiceImpl { newModelClue.setZjjs(modelClue2.getZjjs()); } else if (no == 2) { newModelClue.setZfcsdjs(modelClue2.getZfcsdjs()); + } else if (no == 3) { + newModelClue.setZjjs(modelClue2.getZjjs()); + newModelClue.setAllZjjs(modelClue2.getAllZjjs()); } modelClues1.add(newModelClue); } else { From 0da65a5a38fd0d61d450d2e55d4db83d98f9bc03 Mon Sep 17 00:00:00 2001 From: sjh Date: Sat, 16 Nov 2024 10:42:19 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9104=E5=8F=B7=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biutag/supervision/service/ModelClueService.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java index 87b6e91..7771f7b 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -57,6 +57,8 @@ public class ModelClueService extends ServiceImpl { public final SupExternalDepartMapper supExternalDepartMapper; + private final StatisticsDepartMapper statisticsDepartMapper; + public Page page(ModelClueQueryParam param) { if (Objects.nonNull(param.getModelIds()) && param.getModelIds().isEmpty()) { return new Page().setTotal(0).setRecords(new ArrayList<>()); @@ -1048,7 +1050,7 @@ public class ModelClueService extends ServiceImpl { private void getModelCluesForModel104(String param, List modelClues) { System.out.println("模型104开始查询数据库"); List params = parseSqlForModel2(param); - String sql = "select a.gxdwdm, a.gxdwmc, a.num anum, b.num bnum from ((SELECT gxdwdm, gxdwmc, COUNT(*) AS zjjs from dwd_asj_zhtx_jjd where bjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' AND (ysjqxzdm LIKE '01%' OR ysjqxzdm LIKE'02%' OR ysjqxzdm LIKE'06%') AND (bjxldm NOT LIKE '01%' AND bjxldm NOT LIKE '02%' AND bjxldm NOT LIKE '06%') and bjfsdm = '0101' GROUP BY gxdwdm, gxdwmc) a join (SELECT gxdwdm, gxdwmc, COUNT(*) AS zjjs from dwd_asj_zhtx_jjd where bjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' AND (ysjqxzdm LIKE '01%' OR ysjqxzdm LIKE'02%' OR ysjqxzdm LIKE'06%') and bjfsdm = '0101' GROUP BY gxdwdm, gxdwmc) b on a.gxdwdm = b.gxdwdm);"; + String sql = "select a.gxdwdm, a.gxdwmc, a.num anum, b.num bnum from ((SELECT gxdwdm, gxdwmc, COUNT(*) AS num from dwd_asj_zhtx_jjd where bjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' AND (ysjqxzdm LIKE '01%' OR ysjqxzdm LIKE'02%' OR ysjqxzdm LIKE'06%') AND (bjxldm NOT LIKE '01%' AND bjxldm NOT LIKE '02%' AND bjxldm NOT LIKE '06%') and bjfsdm = '0101' GROUP BY gxdwdm, gxdwmc) a join (SELECT gxdwdm, gxdwmc, COUNT(*) num from dwd_asj_zhtx_jjd where bjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' AND (ysjqxzdm LIKE '01%' OR ysjqxzdm LIKE'02%' OR ysjqxzdm LIKE'06%') and bjfsdm = '0101' GROUP BY gxdwdm, gxdwmc) b on a.gxdwdm = b.gxdwdm);"; List> jjdmaps = modelClueDataMapper.selectByUniqueKeys(sql); System.out.println("模型104查询数据库完毕"); if (jjdmaps.isEmpty()) { @@ -1089,6 +1091,9 @@ public class ModelClueService extends ServiceImpl { .map(Map.Entry::getKey) .toList(); for (String department : highPercentageDepartments) { + if (departNumMap.get(department) < 10) { + continue; + } ModelClue newModelClue = new ModelClue(); newModelClue.setUniqueKey(department); newModelClue.setNegativeIdEx(department); @@ -1096,6 +1101,10 @@ public class ModelClueService extends ServiceImpl { if (supExternalDepart != null) { if (supExternalDepart.getInternalId() != null) { newModelClue.setInvolveDepartId(supExternalDepart.getInternalId()); + StatisticsDepart statisticsDepart = statisticsDepartMapper.selectOne(new QueryWrapper().eq("departId", supExternalDepart.getInternalId()).last("LIMIT 1")); + if (statisticsDepart == null || statisticsDepart.getLevel() == null || statisticsDepart.getLevel() != 10L) { + continue; + } } if (supExternalDepart.getInternalShortName() != null) { newModelClue.setInvolveDepartName(supExternalDepart.getInternalShortName()); From adfedb1cb6a66c227cbf13d7838620375592b148 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: Sat, 16 Nov 2024 12:50:32 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E6=95=B0=E6=8D=AE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/datav/DataGobalController.java | 47 ++++--------- .../datav/SupervisionNotifyController.java | 1 - .../supervision/mapper/NegativeMapper.java | 65 ++++++++++++++++- .../supervision/mapper/SupDepartMapper.java | 5 ++ .../supervision/pojo/vo/GobalMapIconVo.java | 3 + .../supervision/service/DataGobalService.java | 70 +++++++++++++------ .../DataSupervisionNotifyServiceImpl.java | 13 ++-- 7 files changed, 142 insertions(+), 62 deletions(-) diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java b/src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java index 4000a52..d81eb29 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.vo.*; import com.biutag.supervision.service.DataGobalService; +import com.biutag.supervision.service.DataSupervisionNotifyServiceImpl; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.activation.DataHandler; @@ -35,6 +36,7 @@ public class DataGobalController { private final DataGobalService dataGobalService; + /** * 获取数据大屏概览 * @param beginTime @@ -61,39 +63,13 @@ public class DataGobalController { // 突出问题排名 List tcwtlist = dataGobalService.getStrongProblemRank(beginTime, endTime); - // 地图显示结果 - List gobalMapVoList = new ArrayList<>(); - fxsjlist.forEach(item -> { - // 添加总数 - GobalMapIconVo gobalMapVo = new GobalMapIconVo(); - gobalMapVo.setName(item.getLabel()); - gobalMapVo.setTotalPro(Integer.parseInt(item.getValue())); - gobalMapVoList.add(gobalMapVo); - }); - // 市县分局的督察问题 - List superviseProList = dataGobalService.getSuperviseProTotal(beginTime, endTime); - List caseVerifyProList = dataGobalService.getCaseVerifyProTotal(beginTime, endTime); - List mailProList = dataGobalService.getMailProTotal(beginTime, endTime); - List policeProList = dataGobalService.getPoliceProTotal(beginTime, endTime); - List reviewProList = dataGobalService.getReviewProTotal(beginTime, endTime); - List gobalTempMapVoList = new ArrayList<>(); - if (!gobalMapVoList.isEmpty()) { - updateProList(superviseProList, gobalMapVoList, GobalMapIconVo::setSupervisePro); - updateProList(caseVerifyProList, gobalMapVoList, GobalMapIconVo::setCaseVerifyPro); - updateProList(mailProList, gobalMapVoList, GobalMapIconVo::setMailPro); - updateProList(policeProList, gobalMapVoList, GobalMapIconVo::setPolicePro); - updateProList(reviewProList, gobalMapVoList, GobalMapIconVo::setReviewPro); - }else { -// gobalTempMapVoList.add(new GobalMapIconVo("芙蓉分局", 1,11,11,11,11,11)); -// gobalTempMapVoList.add(new GobalMapIconVo("天心分局", 2,22,22,22,22,22)); -// gobalTempMapVoList.add(new GobalMapIconVo("岳麓分局", 3,33,33,33,33,33)); -// gobalTempMapVoList.add(new GobalMapIconVo("开福分局", 4,44,44,44,44,44)); -// gobalTempMapVoList.add(new GobalMapIconVo("雨花分局", 5,55,55,55,55,55)); -// gobalTempMapVoList.add(new GobalMapIconVo("长沙县局", 6,66,66,66,66,66)); -// gobalTempMapVoList.add(new GobalMapIconVo("望城分局", 7,77,77,77,77,77)); -// gobalTempMapVoList.add(new GobalMapIconVo("宁乡市局", 8,88,88,88,88,88)); -// gobalTempMapVoList.add(new GobalMapIconVo("浏阳市局", 9,99,99,99,99,99)); - } + + // 查所有的市局 + List gobalTempMapVoList = dataGobalService.getMapIconInfo(beginTime, endTime); + if ( gobalTempMapVoList==null || gobalTempMapVoList.size() == 0) { + gobalTempMapVoList = new ArrayList<>(); + } + JSONObject data = new JSONObject().fluentPut("overview", overview) .fluentPut("fxsjlist", fxsjlist) @@ -101,8 +77,8 @@ public class DataGobalController { .fluentPut("ywzblist", ywzblist) .fluentPut("wtlxlist", wtlxlist) .fluentPut("tcwtlist", tcwtlist) - .fluentPut("gobalMapVoList", gobalMapVoList) .fluentPut("gobalTempMapVoList", gobalTempMapVoList); + return Result.success(data); } @@ -165,4 +141,7 @@ public class DataGobalController { return Result.success(jsonObject); } + + + } 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 7bb8b05..fad806a 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java @@ -49,7 +49,6 @@ public class SupervisionNotifyController { /** * 获取日常督察排行 - * * @param groupType 分组类型 1: 分县市局 2: 局属单位 * @return */ diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index c1e822a..6e067e7 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -92,6 +92,9 @@ public interface NegativeMapper extends BaseMapper { Long selectRelationOrgCount(Date beginTime, Date endTime, String checkStatus); + /** + * 获取现场督察按二级机构分组划分的问题数 + */ @Select("SELECT COUNT(*) FROM negative n " + "INNER JOIN ( " + " SELECT DISTINCT sd.id " + @@ -100,10 +103,15 @@ public interface NegativeMapper extends BaseMapper { " WHERE sd1.statistics_group_id = #{groupType}" + ") AS filtered_sd ON n.involveDepartId = filtered_sd.id " + "WHERE n.checkStatus = 1 " + - "AND n.problemSourcesCode = 15;") + "AND n.problemSourcesCode = 15 " + + "AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime}") Long getCountByGroupType(Integer groupType, Date beginTime, Date endTime); + + /** + * 获取现场督察按二级机构分组和整改状态划分的的问题数 + */ @Select("SELECT COUNT(*) FROM negative n " + "INNER JOIN ( " + " SELECT DISTINCT sd.id " + @@ -117,7 +125,60 @@ public interface NegativeMapper extends BaseMapper { "AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime}") Long getChangCountByGroupType(Integer groupType, Date beginTime, Date endTime, Integer isRectify); - + @Select("SELECT count(*) FROM negative ng INNER JOIN " + + " (" + + " SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " + + " INNER join sup_depart sd1 on sd.pid=sd1.id " + + " and sd1.LEVEL=2 AND sd1.statistics_group_id=3" + + " ) " + + "as temp on ng.involveDepartId=temp.id " + + "AND ng.checkStatus<>3 AND problemSourcesCode in (13, 15, 16) " + + "AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}") + Integer seleGobalMapIconInfoDc(Date beginTime, Date endTime, Integer departId); + + @Select("SELECT count(*) FROM negative ng INNER JOIN " + + " (" + + " SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " + + " INNER join sup_depart sd1 on sd.pid=sd1.id " + + " and sd1.LEVEL=2 AND sd1.statistics_group_id=3" + + " ) " + + "as temp on ng.involveDepartId=temp.id " + + "AND ng.checkStatus<>3 AND problemSourcesCode=11 " + + "AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}") + Integer seleGobalMapIconInfoAjhc(Date beginTime, Date endTime, Integer departId); + + @Select("SELECT count(*) FROM negative ng INNER JOIN " + + " (" + + " SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " + + " INNER join sup_depart sd1 on sd.pid=sd1.id " + + " and sd1.LEVEL=2 AND sd1.statistics_group_id =3 " + + " ) " + + "as temp on ng.involveDepartId=temp.id " + + "AND ng.checkStatus<>3 AND problemSourcesCode in (21, 22, 23, 24, 25) " + + "AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}") + Integer seleGobalMapIconInfoXf(Date beginTime, Date endTime, Integer departId); + + @Select("SELECT count(*) FROM negative ng INNER JOIN " + + " (" + + " SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " + + " INNER join sup_depart sd1 on sd.pid=sd1.id " + + " and sd1.LEVEL=2 AND sd1.statistics_group_id =3 " + + " ) " + + "as temp on ng.involveDepartId=temp.id " + + "AND ng.checkStatus<>3 AND problemSourcesCode=2 " + + "AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}") + Integer seleGobalMapIconInfoJwpy(Date beginTime, Date endTime, Integer departId); + + @Select("SELECT count(*) FROM negative ng INNER JOIN " + + " (" + + " SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " + + " INNER join sup_depart sd1 on sd.pid=sd1.id " + + " and sd1.LEVEL=2 AND sd1.statistics_group_id =3 " + + " ) " + + "as temp on ng.involveDepartId=temp.id " + + "AND ng.checkStatus<>3 AND problemSourcesCode=26 " + + "AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}") + Integer seleGobalMapIconInfoSjdc(Date beginTime, Date endTime, Integer departId); // endregion } diff --git a/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java index 3ba57be..258aa1c 100644 --- a/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java @@ -32,6 +32,11 @@ public interface SupDepartMapper extends BaseMapper { List> getIdsByCode(List departIds); + /** + * 按分组查询单位 + * @param groupType + * @return + */ @Select("select * from sup_depart where statistics_group_id = #{groupType} ") List selectDepartsByGroupType(Integer groupType); } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/vo/GobalMapIconVo.java b/src/main/java/com/biutag/supervision/pojo/vo/GobalMapIconVo.java index bf86ee3..ce79513 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/GobalMapIconVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/GobalMapIconVo.java @@ -1,6 +1,7 @@ package com.biutag.supervision.pojo.vo; import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; @@ -12,6 +13,7 @@ import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor +@Builder public class GobalMapIconVo { private String name; // 分县市局名称 @@ -21,6 +23,7 @@ public class GobalMapIconVo { private Integer mailPro; // 信访投诉问题 private Integer policePro; // 警务评议问题 private Integer reviewPro; // 审计监督问题 + private Integer departId; // 分县市局ID } diff --git a/src/main/java/com/biutag/supervision/service/DataGobalService.java b/src/main/java/com/biutag/supervision/service/DataGobalService.java index 6f02de2..5eb3f62 100644 --- a/src/main/java/com/biutag/supervision/service/DataGobalService.java +++ b/src/main/java/com/biutag/supervision/service/DataGobalService.java @@ -3,18 +3,17 @@ package com.biutag.supervision.service; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.biutag.supervision.constants.enums.InspectCaseEnum; -import com.biutag.supervision.mapper.DataCaseVerifMapper; -import com.biutag.supervision.mapper.DataSupervisionNotifyMapper; -import com.biutag.supervision.mapper.NegativeMapper; -import com.biutag.supervision.mapper.NegativeProblemRelationMapper; +import com.biutag.supervision.mapper.*; import com.biutag.supervision.pojo.dto.CaseVerifDepart; import com.biutag.supervision.pojo.entity.DataCaseVerif; import com.biutag.supervision.pojo.entity.DataSupervisionNotify; import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.SupDepart; import com.biutag.supervision.pojo.vo.*; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -31,6 +30,7 @@ public class DataGobalService { private final NegativeMapper negativeMapper; private final NegativeProblemRelationMapper negativeProblemRelationMapper; + private final SupDepartMapper supDepartMapper; /** * 获取所有大屏统计数据 @@ -43,27 +43,27 @@ public class DataGobalService { // 督察问题数量(查实版本) Long supervisionPro = getCountByConditions( - Integer.parseInt(InspectCaseEnum.TRUE.getValue()), + Integer.parseInt(InspectCaseEnum.FALSE.getValue()), beginTime, endTime, 13, 15, 16); // 获取案件核查问题数量(查实版本) Long caseVerificationPro = getCountByConditions( - Integer.parseInt(InspectCaseEnum.TRUE.getValue()), + Integer.parseInt(InspectCaseEnum.FALSE.getValue()), beginTime, endTime, 17, 18, 19, 20); // 信访投诉问题数量(查实版本) Long complaintPro = getCountByConditions( - Integer.parseInt(InspectCaseEnum.TRUE.getValue()), + Integer.parseInt(InspectCaseEnum.FALSE.getValue()), beginTime, endTime, 21, 22, 23, 24, 25); // 警务评议问题数量(查实版本) Long reviewPro = getCountByConditions( - Integer.parseInt(InspectCaseEnum.TRUE.getValue()), + Integer.parseInt(InspectCaseEnum.FALSE.getValue()), beginTime, endTime, 2); // 审计监督问题数量(查实版本) Long auditPro = getCountByConditions( - Integer.parseInt(InspectCaseEnum.TRUE.getValue()), + Integer.parseInt(InspectCaseEnum.FALSE.getValue()), beginTime, endTime, 26); Long totalPro = caseVerificationPro + supervisionPro + complaintPro + reviewPro + auditPro; @@ -80,6 +80,7 @@ public class DataGobalService { /** * 查询核查属实的公共方法 + * * @param checkStatus 检查状态 * @param startTime 开始时间 * @param endTime 结束时间 @@ -88,7 +89,7 @@ public class DataGobalService { */ public Long getCountByConditions(Integer checkStatus, Date startTime, Date endTime, Integer... problemSourcesCodes) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("checkStatus", checkStatus) + queryWrapper.ne("checkStatus", checkStatus) .between("discoveryTime", startTime, endTime) .and(wrapper -> { for (int i = 0; i < problemSourcesCodes.length; i++) { @@ -107,34 +108,36 @@ public class DataGobalService { return res; } - public List getBusinessRate(Date beginTime,Date endTime) { - List res= negativeMapper.selectBusinessRate(beginTime, endTime); + public List getBusinessRate(Date beginTime, Date endTime) { + List res = negativeMapper.selectBusinessRate(beginTime, endTime); return res; } public List getGobalRecentlyTrendByMonth(String year) { - List res = negativeMapper.selectRecentTrendByMonth(year); + List res = negativeMapper.selectRecentTrendByMonth(year); return res; } /** * 获取问题类型占比 + * * @param beginTime * @param endTime * @return */ public List getProblemRate(Date beginTime, Date endTime) { - List res = negativeProblemRelationMapper.selectProblemRate(beginTime, endTime); + List res = negativeProblemRelationMapper.selectProblemRate(beginTime, endTime); return res; } /** * 获取突出问题排名 + * * @return */ public List getStrongProblemRank(Date beginTime, Date endTime) { // 1.获取这段时间的negative id - List res= negativeProblemRelationMapper.selectStrongProblemRank(beginTime, endTime); + List res = negativeProblemRelationMapper.selectStrongProblemRank(beginTime, endTime); for (int i = 1; i <= res.size(); i++) { res.get(i - 1).setSort(i); } @@ -142,28 +145,55 @@ public class DataGobalService { } public List getSuperviseProTotal(Date beginTime, Date endTime) { - List res= negativeProblemRelationMapper.selectSuperviseProTotal(beginTime, endTime); + List res = negativeProblemRelationMapper.selectSuperviseProTotal(beginTime, endTime); return res; } public List getCaseVerifyProTotal(Date beginTime, Date endTime) { - List res= negativeProblemRelationMapper.selectCaseVerifyProTotal(beginTime, endTime); + List res = negativeProblemRelationMapper.selectCaseVerifyProTotal(beginTime, endTime); return res; } public List getMailProTotal(Date beginTime, Date endTime) { - List res= negativeProblemRelationMapper.selectMailProTotal(beginTime, endTime); + List res = negativeProblemRelationMapper.selectMailProTotal(beginTime, endTime); return res; } public List getPoliceProTotal(Date beginTime, Date endTime) { - List res= negativeProblemRelationMapper.selectPoliceProTotal(beginTime, endTime); + List res = negativeProblemRelationMapper.selectPoliceProTotal(beginTime, endTime); return res; } public List getReviewProTotal(Date beginTime, Date endTime) { - List res= negativeProblemRelationMapper.selectReviewProTotal(beginTime, endTime); + List res = negativeProblemRelationMapper.selectReviewProTotal(beginTime, endTime); + return res; + } + + public List getMapIconInfo(Date beginTime, Date endTime) { + List res = new ArrayList<>(); + List supDeparts = supDepartMapper.selectDepartsByGroupType(3); + for (SupDepart supDepart : supDeparts) { + GobalMapIconVo mapIconVo = new GobalMapIconVo(); + mapIconVo.setName(supDepart.getShortName()); + mapIconVo.setDepartId(Integer.parseInt(supDepart.getId())); + res.add(mapIconVo); + } + for (GobalMapIconVo re : res) { + Integer departId = re.getDepartId(); + Integer supervisePro = negativeMapper.seleGobalMapIconInfoDc(beginTime, endTime, departId); + Integer caseVerifyPro = negativeMapper.seleGobalMapIconInfoAjhc(beginTime, endTime, departId); + Integer mailPro = negativeMapper.seleGobalMapIconInfoXf(beginTime, endTime, departId); + Integer policePro = negativeMapper.seleGobalMapIconInfoJwpy(beginTime, endTime, departId); + Integer reviewPro = negativeMapper.seleGobalMapIconInfoSjdc(beginTime, endTime, departId); + Integer totalPro = supervisePro + caseVerifyPro + mailPro + policePro + reviewPro; + re.setTotalPro(totalPro != null ? totalPro : 0); + re.setSupervisePro(supervisePro != null ? supervisePro : 0); + re.setCaseVerifyPro(caseVerifyPro != null ? caseVerifyPro : 0); + re.setMailPro(mailPro != null ? mailPro : 0); + re.setPolicePro(policePro != null ? policePro : 0); + re.setReviewPro(reviewPro != null ? reviewPro : 0); + } return res; } } diff --git a/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java b/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java index d7440c8..627213b 100644 --- a/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java @@ -69,7 +69,7 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl preQueryWrapper = new QueryWrapper<>(); - preQueryWrapper.eq("problemSourcesCode", ProblemSourcesEnum.XCDC.getValue()); + preQueryWrapper.in("problemSourcesCode", ProblemSourcesEnum.XCDC.getValue(), ProblemSourcesEnum.ZXDC.getValue()); List negatives = negativeMapper.selectList(preQueryWrapper); Long supervisionNotifyPreTotal = 0L; @@ -81,8 +81,6 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl getChangedRateRank(Integer groupType, Date beginTime, Date endTime) { List rankVos = new ArrayList<>(); + // 所有部门 List departs = supDepartMapper.selectDepartsByGroupType(groupType); -// negativeMapper.select + for (SupDepart depart : departs) { + RankVo rankVo = new RankVo(); + rankVo.setLabel(depart.getShortName()); + rankVo.setDepartId(depart.getId()); + } + return null;