Browse Source

局长信息 视频督察

main
不爱学习的石同学 11 months ago
parent
commit
27480fd955
  1. 1
      src/main/java/com/biutag/supervision/controller/datav/DataGlobalController.java
  2. 113
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  3. 5
      src/main/java/com/biutag/supervision/mapper/StatisticsDepartMapper.java
  4. 7
      src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java
  5. 4
      src/main/java/com/biutag/supervision/mapper/SupExternalDepartMapper.java
  6. 18
      src/main/java/com/biutag/supervision/pojo/dto/LevelAndPid.java
  7. 21
      src/main/java/com/biutag/supervision/service/DataMailService.java
  8. 6
      src/main/resources/application-dev.yml

1
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;

113
src/main/java/com/biutag/supervision/mapper/NegativeMapper.java

@ -52,14 +52,15 @@ public interface NegativeMapper extends BaseMapper<Negative> {
// 中央总览
@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<Negative> {
"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<Negative> {
"ORDER BY `value` DESC")
List<OrganizeProblemRankVo> 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<VideoSuperviseMapIconVo> getVideoSuperviseMapIconInfo(Date beginTime, Date endTime);
@ -400,12 +402,12 @@ public interface NegativeMapper extends BaseMapper<Negative> {
List<EchartsVo> 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<Negative> {
"ORDER BY `value` desc")
List<EchartsVo> 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<VideoSuperviseMapIconVo> getSubOneVideoSuperviseMapIconInfo(Date beginTime, Date endTime, Integer departId);

5
src/main/java/com/biutag/supervision/mapper/StatisticsDepartMapper.java

@ -15,4 +15,9 @@ public interface StatisticsDepartMapper extends BaseMapper<StatisticsDepart> {
+ "</foreach>"
+ "</script>")
List<Map<String, Object>> getGroupIdsByDepartIds(List<String> departIds);
@Select("select departId, groupId FROM statistics_depart")
List<Map<String, Object>> getGroupIds();
}

7
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<SupDepart> {
"FROM county_street_dept WHERE dept_pid=#{departId}")
List<SupDepart> selectPoliceDeparts(Integer departId);
@Select("SELECT id, `level`, pid " +
"FROM `sup_depart`" +
"WHERE `level`>3 ")
List<LevelAndPid> selectLevelAndPid();
}

4
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<SupExternalDepart> {
+ "</foreach>"
+ "</script>")
List<Map<String, Object>> getIdsByDepartIds(List<String> departIds);
@Select("select level from sup_external_depart where internal_id = #{internalDepartId}")
SupExternalDepart selectLevelByDepartId(String internalDepartId);
}

18
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;
}

21
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<DataPetitionComplaintMapper, Da
private final DataPetition12337Mapper dataPetition12337Mapper;
private final SupDepartMapper supDepartMapper;
private final MailMapper mailMapper;
public Page<DataPetitionComplaint> page(DataPetitionComplaintQueryParam queryParam) {
@ -160,7 +161,7 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da
Long numberMail = dataPetition12337Mapper.selectCount(queryWrapper12337);
temp.setNumberMail(numberMail);
System.out.println("12337信访数量:" + numberMail);
Long manageMail = 5812L; // 12337信访
Long manageMail = mailMapper.selectCount(null);
// 总数
Long totalMail = countryMail + policeMail + numberMail;
temp.setCountryMail(countryMail);

6
src/main/resources/application-dev.yml

@ -26,6 +26,12 @@ spring:
url: jdbc:mysql://172.31.217.20:31868/negative?serverTimezone=GMT%2B8
username: root
password: ip12341234
mailbox:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://58.51.152.18:10642/mailbox?currentSchema=mailbox
username: alphay
password: alphay@123
druid:
min-evictable-idle-time-millis: 300000
test-on-borrow: false

Loading…
Cancel
Save