From 445cc98889cdb8c52716bf8f9f3550b4587f90d4 Mon Sep 17 00:00:00 2001 From: pengwei Date: Fri, 24 Oct 2025 11:49:22 +0800 Subject: [PATCH] =?UTF-8?q?fit:=E7=8E=B0=E5=9C=BA=E4=B8=93=E9=A1=B9?= =?UTF-8?q?=E5=9C=B0=E5=9B=BEsql=E6=8B=86=E5=88=86=E3=80=81=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataVSupervisionNotifyController.java | 13 ++++- .../java/com/biutag/supervision/job/Job.java | 27 +++++++---- .../supervision/mapper/NegativeMapper.java | 48 +++++++++++++++++++ 3 files changed, 78 insertions(+), 10 deletions(-) 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 2081004..9ecda36 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java @@ -198,8 +198,17 @@ public class DataVSupervisionNotifyController { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { endTime = DateUtil.endOfDay(endTime); //地图数据 - List superviseTempMapVoList = negativeMapper.getSupervisionMapIconInfo(beginTime, endTime); - + List superviseTempMapVoList = negativeMapper.getSupervisionMapIconData(beginTime, endTime); + //数据补充 + Date finalEndTime = endTime; + superviseTempMapVoList.forEach(s->{ + String relationOrg =negativeMapper.getSupervisionMapStringData(beginTime, finalEndTime,"department",s.getDepartId()) ; + String personNum =negativeMapper.getSupervisionMapStringData(beginTime, finalEndTime,"personal",s.getDepartId()) ;; + String completedRate = negativeMapper.getSupervisionMapCompletedRate(beginTime, finalEndTime,s.getDepartId()); + s.setCompletedRate(completedRate); + s.setPersonNum(personNum); + s.setRelationOrg(relationOrg); + }); JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList); return Result.success(data); } diff --git a/src/main/java/com/biutag/supervision/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java index 80c6b2c..2c0d9e8 100644 --- a/src/main/java/com/biutag/supervision/job/Job.java +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -155,7 +155,12 @@ public class Job { DwdRyZfbaBaryxx dwdRyZfbaBaryxx = dwdRyZfbaBaryxxService.selectDataById(ajjbxx.getBar1id()); if(ObjectUtil.isNotEmpty(dwdRyZfbaBaryxx)){ SupPolice policeData = policeService.getByIdCode(dwdRyZfbaBaryxx.getZjhm()); - rpcApply.setInputEmpNo(policeData.getEmpNo()); + if(ObjectUtil.isNotEmpty(policeData)){ + rpcApply.setInputEmpNo(policeData.getEmpNo()); + }else{ + log.info("身份证:"+dwdRyZfbaBaryxx.getZjhm()+"未找到"); + } + } } @@ -179,9 +184,16 @@ public class Job { //判断是否为非长沙市公安局 if(!unitName.contains("长沙市公安局")){ //非长沙市公安局 - String[] depts = ajjbxx.getBadwidmc().split("局")[0].split("省"); - if(depts.length > 0){ - StatisticsGroupName="湖南省长沙市公安局" + depts[1]+"局"; + String[] deptsData = ajjbxx.getBadwidmc().split("局"); + if(deptsData.length > 0){ + String[] depts =deptsData[0].split("省"); + if(depts.length > 0){ + StatisticsGroupName="湖南省长沙市公安局" + depts[1]+"局"; + }else{ + log.info("无法分割‘省’"); + } + }else{ + log.info("无法分割‘局’"); } }else{ @@ -189,9 +201,6 @@ public class Job { StatisticsGroupName ="长沙市公安局"; } - - - SupDepart groupDept= supDepartMapper.selectOne(new LambdaQueryWrapper().eq(SupDepart::getName,StatisticsGroupName)); if(ObjectUtil.isNotEmpty(groupDept)){ rpcApply.setSecondDepartId(groupDept.getId()); @@ -222,7 +231,9 @@ public class Job { RpcApplyPerson rpcApplyPerson= new RpcApplyPerson(); rpcApplyPerson.setType(RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue()); //受伤程度屏蔽 -// rpcApplyPerson.setInjurySeverity(item.getShcdmc()); + if(StrUtil.isNotBlank(item.getShcdmc())){ + rpcApplyPerson.setInjurySeverity(item.getShcdmc()); + } rpcApplyPerson.setCreatTime(LocalDateTime.now()); rpcApplyPerson.setUdpTime(LocalDateTime.now()); rpcApplyPerson.setId(IdUtil.fastSimpleUUID()); diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index 64d4c84..c872e5e 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -234,6 +234,54 @@ public interface NegativeMapper extends BaseMapper { List getSupervisionMapIconInfo(Date beginTime, Date endTime); + + @Select("select " + + "sd.short_name AS `name`," + + "sd.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.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS processingNumber, " + + "COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS completedNumber " + + "from sup_depart sd " + + "LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id AND ng.problemSourcesCode IN (13,14, 15) " + + "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + + "WHERE sd.statistics_group_id=3 " + + "GROUP BY sd.short_name " + + "ORDER BY totalPro DESC;" + ) + List getSupervisionMapIconData(Date beginTime, Date endTime); + + + + //获取personNum、relationOrg + @Select( + "select count(*) FROM sup_depart sd " + + "LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id AND ng.problemSourcesCode IN (13,14, 15) " + + "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + + "LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + + "WHERE nb.handleResultName != '' and nb.handleResultName IS NOT NULL and nb.handleResultName != '不予追责' " + + "and nb.type = #{code} and sd.id =#{departId}" + ) + String getSupervisionMapStringData(Date beginTime, Date endTime,String code,String departId); + + //获取completedRate + @Select( + "select " + + "IFNULL( ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) " + + "FROM sup_depart sd" + + "LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id 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.id =#{departId}" + ) + String getSupervisionMapCompletedRate(Date beginTime, Date endTime,String departId); + + + + + + @Select("SELECT " + "COUNT(DISTINCT ng.id) AS proTotal, " + "COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS processingNumber, " +