diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataGlobalController.java b/src/main/java/com/biutag/supervision/controller/datav/DataGlobalController.java index cd3db20..919b074 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataGlobalController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataGlobalController.java @@ -10,7 +10,6 @@ import com.biutag.supervision.service.DataGlobalService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; -import org.apache.ibatis.annotations.Select; import org.springframework.cache.annotation.Cacheable; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.web.bind.annotation.GetMapping; diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index facc347..fa039d0 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -52,14 +52,15 @@ public interface NegativeMapper extends BaseMapper { // 中央总览 - @Select("SELECT " + - "SUM( IF(problemSourcesCode IN (2,13,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30), 1, 0) ) AS totalPro, " + - "SUM( IF(problemSourcesCode IN (13,15,16), 1, 0) ) AS supervisionPro, " + - "SUM( IF(problemSourcesCode IN (17,18,19,20), 1, 0) ) AS caseVerificationPro, " + - "SUM( IF(problemSourcesCode IN (21,22,23,24,25),1, 0) ) AS complaintPro, " + - "SUM( IF(problemSourcesCode IN (2),1, 0) ) AS talkPro, " + - "SUM( IF(problemSourcesCode IN (27,28,29,30),1, 0) ) AS auditPro " + - "FROM negative ng WHERE ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} ") + @Select("SELECT " + + "COALESCE(SUM(IF(problemSourcesCode IN (2,13,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30), 1, 0)), 0) AS totalPro, " + + "COALESCE(SUM(IF(problemSourcesCode IN (13,15,16), 1, 0)), 0) AS supervisionPro, " + + "COALESCE(SUM(IF(problemSourcesCode IN (17,18,19,20), 1, 0)), 0) AS caseVerificationPro, " + + "COALESCE(SUM(IF(problemSourcesCode IN (21,22,23,24,25), 1, 0)), 0) AS complaintPro, " + + "COALESCE(SUM(IF(problemSourcesCode IN (2), 1, 0)), 0) AS talkPro, " + + "COALESCE(SUM(IF(problemSourcesCode IN (27,28,29,30), 1, 0)), 0) AS auditPro " + + "FROM negative ng " + + "WHERE ng.discoveryTime BETWEEN #{beginTime} AND #{endTime}; ") GlobalOverViewVo getAllGlobalCount(Date beginTime, Date endTime); @@ -157,16 +158,16 @@ public interface NegativeMapper extends BaseMapper { "WHERE discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND problemSourcesCode IN (13, 15)") RankVoSupTwo getTemp(Date beginTime, Date endTime); - @Select("SELECT " + - "COUNT( DISTINCT ng.id ) AS problemNumber, " + - "COUNT( DISTINCT IF(ng.isRectifyCode=0, ng.id, NULL) ) AS rectifingNumber, " + - "COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) ) AS rectifedNumber, " + - "COUNT( DISTINCT ng.involveDepartId ) AS departNumber, " + - "COUNT( DISTINCT nb.blameIdCode ) AS personNumber, " + - "ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1) AS rectifyRate " + - "FROM negative ng " + - "LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + - "WHERE ng.problemSourcesCode IN (13, 15) " + + @Select("SELECT " + + "COALESCE(COUNT(DISTINCT ng.id), 0) AS problemNumber, " + + "COALESCE(COUNT(DISTINCT IF(ng.isRectifyCode=0, ng.id, NULL)), 0) AS rectifingNumber, " + + "COALESCE(COUNT(DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL)), 0) AS rectifedNumber, " + + "COALESCE(COUNT(DISTINCT ng.involveDepartId), 0) AS departNumber, " + + "COALESCE(COUNT(DISTINCT nb.blameIdCode), 0) AS personNumber, " + + "COALESCE(ROUND(COUNT(DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL)) / COUNT(DISTINCT ng.id) * 100, 1), 0) AS rectifyRate " + + "FROM negative ng " + + "LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " + + "WHERE ng.problemSourcesCode IN (13, 15) " + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime}; ") SupervisionNotifyOverView getAllSupervisionNotifyCount(Date beginTime, Date endTime); @@ -260,21 +261,22 @@ public interface NegativeMapper extends BaseMapper { "ORDER BY `value` DESC") List getVideoSuperviseProblemRank(Date beginTime, Date endTime, Integer groupId); - @Select("SELECT sd1.short_name AS `name`, " + - "sd1.id AS departId, " + - "COUNT( DISTINCT ng.id ) AS discoverProblem, " + - "COUNT(DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL)) AS changedProblem, " + - "COUNT(DISTINCT ng.involveDepartId) AS relativeOrg, " + + @Select("SELECT " + + "sd.short_name AS `name`, " + + "sd.id AS departId, " + + "COUNT( DISTINCT ng.id) AS discoverProblem, " + + "COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) ) AS changedProblem, " + + "COUNT( DISTINCT ng.involveDepartId) AS relativeOrg, " + "COUNT( DISTINCT nb.blameName ) AS relativePer, " + - "IFNULL( ROUND( ( COUNT(DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL)) / COUNT( DISTINCT ng.id ) ) * 100, 1 ), 0) AS changedRate " + - "FROM sup_depart sd " + - "INNER JOIN sup_depart sd1 on sd.pid=sd1.id AND sd1.statistics_group_id=3 " + - "LEFT JOIN negative ng on sd.id=ng.involveDepartId " + - "AND checkStatus <> 3 " + - "AND problemSourcesCode=16 " + + "IFNULL(ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) )/COUNT( DISTINCT ng.id)*100, 1 ),0) AS changedRate " + + "FROM sup_depart sd " + + "LEFT JOIN negative ng ON sd.id=ng.second_involve_depart_id " + + "AND checkStatus <>3 " + + "AND problemSourcesCode =16 " + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + - "LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " + - "GROUP BY `name`;") + "LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + + "WHERE sd.statistics_group_id=3 " + + "GROUP BY sd.short_name; ") List getVideoSuperviseMapIconInfo(Date beginTime, Date endTime); @@ -400,12 +402,12 @@ public interface NegativeMapper extends BaseMapper { List selectSubOneBusinessRate(Integer departId, Date beginTime, Date endTime); @Select("SELECT " + - "SUM( IF(problemSourcesCode IN (2,13,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30), 1, 0) ) AS totalPro, " + - "SUM( IF(problemSourcesCode IN (13,15,16), 1, 0) ) AS supervisionPro, " + - "SUM( IF(problemSourcesCode IN (17,18,19,20), 1, 0) ) AS caseVerificationPro, " + - "SUM( IF(problemSourcesCode IN (21,22,23,24,25),1, 0) ) AS complaintPro, " + - "SUM( IF(problemSourcesCode IN (2),1, 0) ) AS talkPro, " + - "SUM( IF(problemSourcesCode IN (27,28,29,30),1, 0) ) AS auditPro " + + "COALESCE(SUM(IF(problemSourcesCode IN (2, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30), 1, 0)), 0) AS totalPro, " + + "COALESCE(SUM(IF(problemSourcesCode IN (13, 15, 16), 1, 0)), 0) AS supervisionPro, " + + "COALESCE(SUM(IF(problemSourcesCode IN (17, 18, 19, 20), 1, 0)), 0) AS caseVerificationPro, " + + "COALESCE(SUM(IF(problemSourcesCode IN (21, 22, 23, 24, 25), 1, 0)), 0) AS complaintPro, " + + "COALESCE(SUM(IF(problemSourcesCode IN (2), 1, 0)), 0) AS talkPro, " + + "COALESCE(SUM(IF(problemSourcesCode IN (27, 28, 29, 30), 1, 0)), 0) AS auditPro " + "FROM negative ng WHERE ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + "AND ng.second_involve_depart_id=#{departId} ") GlobalOverViewVo getSuoOneAllGlobalCount(Integer departId, Date beginTime, Date endTime); @@ -960,25 +962,24 @@ public interface NegativeMapper extends BaseMapper { "ORDER BY `value` desc") List selectProblemRate(Date beginTime, Date endTime); - @Select("SELECT " + - "csd.`name` AS `name`, " + - "csd.dept_name AS policeName, " + - "csd.dept_pid, " + - "csd.dept_id AS departId, " + - "COUNT( DISTINCT ng.id ) AS discoverProblem, " + - "COUNT(DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL)) AS changedProblem, " + - "COUNT(DISTINCT ng.involveDepartId) AS relativeOrg, " + - "COUNT( DISTINCT nb.blameName ) AS relativePer, " + - "IFNULL( ROUND( ( COUNT(DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL)) / COUNT( DISTINCT ng.id ) ) * 100, 1 ), 0) AS changedRate " + - "FROM county_street_dept csd " + - "LEFT JOIN negative ng ON ng.three_involve_depart_id=csd.dept_id " + - "LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " + - "AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + - "AND ng.checkStatus IN (1,2) " + - "AND ng.problemSourcesCode=16 " + - "AND ng.second_involve_depart_id=#{departId} " + - "GROUP BY csd.dept_name " + - "HAVING csd.dept_pid=#{departId} ") + @Select("SELECT " + + "csd.`name` AS `name`, " + + "csd.dept_name AS policeName, " + + "csd.dept_pid, " + + "csd.dept_id AS departId, " + + "COUNT( DISTINCT ng.id) AS discoverProblem, " + + "COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) ) AS changedProblem, " + + "COUNT( DISTINCT ng.involveDepartId) AS relativeOrg, " + + "COUNT( DISTINCT nb.blameName ) AS relativePer, " + + "IFNULL(ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) )/COUNT( DISTINCT ng.id)*100, 1 ),0) AS changedRate " + + "FROM county_street_dept csd " + + "LEFT JOIN negative ng ON csd.dept_id=ng.three_involve_depart_id " + + "AND checkStatus <>3 " + + "AND problemSourcesCode =16 " + + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + + "LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + + "GROUP BY csd.dept_name " + + "HAVING csd.dept_pid=#{departId}; ") List getSubOneVideoSuperviseMapIconInfo(Date beginTime, Date endTime, Integer departId); diff --git a/src/main/java/com/biutag/supervision/mapper/StatisticsDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/StatisticsDepartMapper.java index a644031..c8c59a7 100644 --- a/src/main/java/com/biutag/supervision/mapper/StatisticsDepartMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/StatisticsDepartMapper.java @@ -15,4 +15,9 @@ public interface StatisticsDepartMapper extends BaseMapper { + "" + "") List> getGroupIdsByDepartIds(List departIds); + + + @Select("select departId, groupId FROM statistics_depart") + List> getGroupIds(); + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java index 0cb85f6..ed5734f 100644 --- a/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java @@ -1,6 +1,7 @@ package com.biutag.supervision.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.dto.LevelAndPid; import com.biutag.supervision.pojo.entity.SupDepart; import org.apache.ibatis.annotations.Select; @@ -51,4 +52,10 @@ public interface SupDepartMapper extends BaseMapper { "FROM county_street_dept WHERE dept_pid=#{departId}") List selectPoliceDeparts(Integer departId); + + @Select("SELECT id, `level`, pid " + + "FROM `sup_depart`" + + "WHERE `level`>3 ") + List selectLevelAndPid(); + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupExternalDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/SupExternalDepartMapper.java index aca738e..e74a80e 100644 --- a/src/main/java/com/biutag/supervision/mapper/SupExternalDepartMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/SupExternalDepartMapper.java @@ -2,6 +2,7 @@ package com.biutag.supervision.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.biutag.supervision.pojo.entity.SupExternalDepart; +import lombok.extern.slf4j.Slf4j; import org.apache.ibatis.annotations.Select; import java.util.List; @@ -19,4 +20,7 @@ public interface SupExternalDepartMapper extends BaseMapper { + "" + "") List> getIdsByDepartIds(List departIds); + + @Select("select level from sup_external_depart where internal_id = #{internalDepartId}") + SupExternalDepart selectLevelByDepartId(String internalDepartId); } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/dto/LevelAndPid.java b/src/main/java/com/biutag/supervision/pojo/dto/LevelAndPid.java new file mode 100644 index 0000000..4cb4f29 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/LevelAndPid.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther: sh + * @Date: 2024/12/31 11:17 + * @Description: + */ +@Data +public class LevelAndPid implements Serializable { + private String id; + private long level; + private String pid; +} + diff --git a/src/main/java/com/biutag/supervision/service/DataMailService.java b/src/main/java/com/biutag/supervision/service/DataMailService.java index 84140a0..3aa8a63 100644 --- a/src/main/java/com/biutag/supervision/service/DataMailService.java +++ b/src/main/java/com/biutag/supervision/service/DataMailService.java @@ -2,38 +2,38 @@ package com.biutag.supervision.service; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.StrUtil; -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.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.biutag.supervision.constants.enums.*; +import com.biutag.supervision.constants.enums.DataUpdateMethodEnum; +import com.biutag.supervision.constants.enums.DistributionStateEnum; +import com.biutag.supervision.constants.enums.HostLevelEnums; +import com.biutag.supervision.constants.enums.ProblemSourcesEnum; import com.biutag.supervision.mapper.DataPetition12337Mapper; import com.biutag.supervision.mapper.DataPetitionComplaintMapper; -import com.biutag.supervision.mapper.NegativeMapper; +import com.biutag.supervision.mapper.MailMapper; import com.biutag.supervision.mapper.SupDepartMapper; import com.biutag.supervision.pojo.dto.*; import com.biutag.supervision.pojo.entity.DataPetition12337; import com.biutag.supervision.pojo.entity.DataPetitionComplaint; import com.biutag.supervision.pojo.entity.SupDepart; import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam; -import com.biutag.supervision.pojo.vo.*; +import com.biutag.supervision.pojo.vo.MailMapIconVo; +import com.biutag.supervision.pojo.vo.MailOverviewVo; import lombok.RequiredArgsConstructor; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; -import java.time.LocalDate; import java.time.LocalDateTime; -import java.time.ZoneId; -import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Date; import java.util.List; import static com.biutag.supervision.constants.enums.DepartGroupEnum.COUNTY_CITY_BUREAUS; -import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*; +import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.GABXF; +import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.GJXFPT; @RequiredArgsConstructor @Service @@ -45,6 +45,7 @@ public class DataMailService extends ServiceImpl page(DataPetitionComplaintQueryParam queryParam) { @@ -160,7 +161,7 @@ public class DataMailService extends ServiceImpl