Browse Source

信访大屏问题趋势重构

main
parent
commit
950eaddb98
  1. 7
      src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java
  2. 2
      src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java
  3. 3
      src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java
  4. 8
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  5. 90
      src/main/java/com/biutag/supervision/service/DataMailService.java
  6. 66
      src/main/resources/mapper/NegativeMapper.xml

7
src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java

@ -77,7 +77,10 @@ public class DataMailViewController {
public Result<JSONObject> getAllMailCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getAllMailCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 信访数据总数概览 // 信访数据总数概览
MailOverviewVo overview = dataMailService.getAllMailCount(beginTime, endTime); JSONObject overview = dataMailService.allMailCount(beginTime, endTime);
System.out.println("信访总览================================");
System.out.println(overview);
// MailOverviewVo overview = dataMailService.getAllMailCount(beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("overview", overview); JSONObject data = new JSONObject().fluentPut("overview", overview);
return Result.success(data); return Result.success(data);
} }
@ -89,7 +92,7 @@ public class DataMailViewController {
List<EchartsVo> countryList = dataMailService.getMailTrend(year, 21); // 国家 List<EchartsVo> countryList = dataMailService.getMailTrend(year, 21); // 国家
List<EchartsVo> policeList = dataMailService.getMailTrend(year, 22); // 公安部信访 List<EchartsVo> policeList = dataMailService.getMailTrend(year, 22); // 公安部信访
List<EchartsVo> manageList = dataMailService.getMailTrend(year, 23); // 局长信箱 List<EchartsVo> manageList = dataMailService.getMailTrend(year, 23); // 局长信箱
List<EchartsVo> numberList = dataMailService.getMailTrend(year, 24); // 12337信访 List<EchartsVo> numberList = dataMailService.getMailTrend12337(year); // 12337信访
JSONObject data = new JSONObject().fluentPut("countryList", countryList) JSONObject data = new JSONObject().fluentPut("countryList", countryList)
.fluentPut("policeList", policeList) .fluentPut("policeList", policeList)
.fluentPut("manageList", manageList) .fluentPut("manageList", manageList)

2
src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java

@ -2,6 +2,7 @@ package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.DataPetition12337; import com.biutag.supervision.pojo.entity.DataPetition12337;
import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.RecentMailTrendByMonthVo; import com.biutag.supervision.pojo.vo.RecentMailTrendByMonthVo;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
@ -23,6 +24,7 @@ public interface DataPetition12337Mapper extends BaseMapper<DataPetition12337> {
" ORDER BY monthTime asc;") " ORDER BY monthTime asc;")
List<RecentMailTrendByMonthVo> selectRecentlyMailTrendByMonth12337(String year); List<RecentMailTrendByMonthVo> selectRecentlyMailTrendByMonth12337(String year);
List<EchartsVo> getMailTrend12337(Integer year);
} }

3
src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java

@ -152,4 +152,7 @@ public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComp
"HAVING label is not NULL " + "HAVING label is not NULL " +
"ORDER BY `value` DESC ") "ORDER BY `value` DESC ")
List<OrganizeProblemRankVo> getMassMailRank(Date beginTime, Date endTime, int groupId); List<OrganizeProblemRankVo> getMassMailRank(Date beginTime, Date endTime, int groupId);
} }

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

@ -322,10 +322,10 @@ public interface NegativeMapper extends BaseMapper<Negative> {
List<EchartsVo> getConfinementAndPause(Date beginTime, Date endTime, Integer type); List<EchartsVo> getConfinementAndPause(Date beginTime, Date endTime, Integer type);
@Select("SELECT count(DISTINCT ng.id) AS totalMail, " + @Select("SELECT count(DISTINCT ng.id) AS totalMail, " +
"COUNT(DISTINCT ng.problemSourcesCode=21 ) AS countryMail, " + "COUNT( ng.problemSourcesCode=21 ) AS countryMail, " +
"COUNT(DISTINCT ng.problemSourcesCode=22 ) AS policeMail, " + "COUNT( ng.problemSourcesCode=22 ) AS policeMail, " +
"COUNT(DISTINCT ng.problemSourcesCode=24 ) AS numberMail, " + "COUNT( ng.problemSourcesCode=24 ) AS numberMail, " +
"COUNT(DISTINCT ng.problemSourcesCode=23 ) AS manageMail " + "COUNT( ng.problemSourcesCode=23 ) AS manageMail " +
"FROM negative ng WHERE ng.checkStatus <> 3 " + "FROM negative ng WHERE ng.checkStatus <> 3 " +
"AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " + "AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " +
"AND ng.problemSourcesCode in(21, 22, 23, 24)") "AND ng.problemSourcesCode in(21, 22, 23, 24)")

90
src/main/java/com/biutag/supervision/service/DataMailService.java

@ -137,70 +137,61 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da
countryQueryWrapper.eq("problem_sources_code", 21); countryQueryWrapper.eq("problem_sources_code", 21);
countryQueryWrapper.between("discovery_time", beginTime, endTime); countryQueryWrapper.between("discovery_time", beginTime, endTime);
Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper); Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper);
System.out.println("国家信访数量:" + countryMail);
// 公安部信访 // 公安部信访
QueryWrapper<DataPetitionComplaint> policeQueryWrapper = new QueryWrapper<>(); QueryWrapper<DataPetitionComplaint> policeQueryWrapper = new QueryWrapper<>();
policeQueryWrapper.eq("problem_sources_code", 22); policeQueryWrapper.eq("problem_sources_code", 22);
policeQueryWrapper.between("discovery_time", beginTime, endTime); policeQueryWrapper.between("discovery_time", beginTime, endTime);
Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper);
System.out.println("公安部信访数量:" + policeMail);
// 12337信访 // 12337信访
QueryWrapper<DataPetition12337> queryWrapper12337 = new QueryWrapper<>(); QueryWrapper<DataPetition12337> queryWrapper12337 = new QueryWrapper<>();
Long total12337 = dataPetition12337Mapper.selectCount(queryWrapper12337); Long numberMail = dataPetition12337Mapper.selectCount(queryWrapper12337);
// 初访 System.out.println("12337信访数量:" + numberMail);
QueryWrapper<DataPetitionComplaint> firstQueryWrapper = new QueryWrapper<>(); // // 初访
firstQueryWrapper.eq("initial_petition", 1); // QueryWrapper<DataPetitionComplaint> firstQueryWrapper = new QueryWrapper<>();
firstQueryWrapper.between("discovery_time", beginTime, endTime); // firstQueryWrapper.eq("initial_petition", 1);
Long firstMail = dataPetitionComplaintMapper.selectCount(firstQueryWrapper); // firstQueryWrapper.between("discovery_time", beginTime, endTime);
// 重访 // Long firstMail = dataPetitionComplaintMapper.selectCount(firstQueryWrapper);
QueryWrapper<DataPetitionComplaint> secondQueryWrapper = new QueryWrapper<>(); // // 重访
secondQueryWrapper.eq("initial_petition", 2); // QueryWrapper<DataPetitionComplaint> secondQueryWrapper = new QueryWrapper<>();
secondQueryWrapper.between("discovery_time", beginTime, endTime); // secondQueryWrapper.eq("initial_petition", 2);
Long secondMail = dataPetitionComplaintMapper.selectCount(secondQueryWrapper); // secondQueryWrapper.between("discovery_time", beginTime, endTime);
// 领导接访 // Long secondMail = dataPetitionComplaintMapper.selectCount(secondQueryWrapper);
QueryWrapper<DataPetitionComplaint> leaderQueryWrapper = new QueryWrapper<>(); // // 领导接访
leaderQueryWrapper.isNotNull("receiving_leader_name"); // QueryWrapper<DataPetitionComplaint> leaderQueryWrapper = new QueryWrapper<>();
leaderQueryWrapper.between("discovery_time", beginTime, endTime); // leaderQueryWrapper.isNotNull("receiving_leader_name");
Long leaderReceiveMail = dataPetitionComplaintMapper.selectCount(leaderQueryWrapper); // leaderQueryWrapper.between("discovery_time", beginTime, endTime);
// 领导督办 // Long leaderReceiveMail = dataPetitionComplaintMapper.selectCount(leaderQueryWrapper);
QueryWrapper<DataPetitionComplaint> leaderViewQueryWrapper = new QueryWrapper<>(); // // 领导督办
leaderViewQueryWrapper.isNotNull("receiving_leader_name"); // QueryWrapper<DataPetitionComplaint> leaderViewQueryWrapper = new QueryWrapper<>();
leaderViewQueryWrapper.between("discovery_time", beginTime, endTime); // leaderViewQueryWrapper.isNotNull("receiving_leader_name");
Long leaderViewMail = dataPetitionComplaintMapper.selectCount(leaderViewQueryWrapper); // leaderViewQueryWrapper.between("discovery_time", beginTime, endTime);
// 闹访 1:闹 0:不闹 // Long leaderViewMail = dataPetitionComplaintMapper.selectCount(leaderViewQueryWrapper);
QueryWrapper<DataPetitionComplaint> tangleQueryWrapper = new QueryWrapper<>(); // // 闹访 1:闹 0:不闹
tangleQueryWrapper.eq("entanglement_visits", 1); // QueryWrapper<DataPetitionComplaint> tangleQueryWrapper = new QueryWrapper<>();
tangleQueryWrapper.between("discovery_time", beginTime, endTime); // tangleQueryWrapper.eq("entanglement_visits", 1);
Long tangleMail = dataPetitionComplaintMapper.selectCount(tangleQueryWrapper); // tangleQueryWrapper.between("discovery_time", beginTime, endTime);
// 集访 1:集 0:不集 // Long tangleMail = dataPetitionComplaintMapper.selectCount(tangleQueryWrapper);
QueryWrapper<DataPetitionComplaint> massQueryWrapper = new QueryWrapper<>(); // // 集访 1:集 0:不集
massQueryWrapper.eq("mass_visits", 1); // QueryWrapper<DataPetitionComplaint> massQueryWrapper = new QueryWrapper<>();
massQueryWrapper.between("discovery_time", beginTime, endTime); // massQueryWrapper.eq("mass_visits", 1);
Long massMail = dataPetitionComplaintMapper.selectCount(massQueryWrapper); // massQueryWrapper.between("discovery_time", beginTime, endTime);
// Long massMail = dataPetitionComplaintMapper.selectCount(massQueryWrapper);
// 总数 // 总数
long totalMail = countryMail+policeMail+total12337; long totalMail = countryMail+policeMail+numberMail;
JSONObject overview = new JSONObject() JSONObject overview = new JSONObject()
// 信访总数(起) // 信访总数(起)
.fluentPut("total", totalMail) .fluentPut("totalMail", totalMail)
// 国家信访 // 国家信访
.fluentPut("countryMail", countryMail) .fluentPut("countryMail", countryMail)
// 公安部信访 // 公安部信访
.fluentPut("policeMail", policeMail) .fluentPut("policeMail", policeMail)
// 局长信箱 // 局长信箱
.fluentPut("commissionerMail", 5534) .fluentPut("manageMail", 5812)
// 12337信访 // 12337信访
.fluentPut("numMail", total12337) .fluentPut("numberMail", numberMail);
// 初访;
.fluentPut("firstMail", firstMail)
// 重访
.fluentPut("secondMail", secondMail)
// 领导接访
.fluentPut("leaderReceiveMail", leaderReceiveMail)
// 领导督办
.fluentPut("leaderViewMail", leaderViewMail)
// 闹访问
.fluentPut("tangleMail", tangleMail)
// 集访
.fluentPut("massMail", massMail);
return overview; return overview;
} }
@ -282,4 +273,9 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da
List<OrganizeProblemRankVo> res = dataPetitionComplaintMapper.getMassMailRank(beginTime, endTime, groupId); List<OrganizeProblemRankVo> res = dataPetitionComplaintMapper.getMassMailRank(beginTime, endTime, groupId);
return res; return res;
} }
public List<EchartsVo> getMailTrend12337(Integer year) {
List<EchartsVo> res = dataPetition12337Mapper.getMailTrend12337(year);
return res;
}
} }

66
src/main/resources/mapper/NegativeMapper.xml

@ -18,10 +18,10 @@
SELECT '10', '10月' UNION ALL SELECT '10', '10月' UNION ALL
SELECT '11', '11月' UNION ALL SELECT '11', '11月' UNION ALL
SELECT '12', '12月' ) m LEFT JOIN negative ng SELECT '12', '12月' ) m LEFT JOIN negative ng
ON DATE_FORMAT(ng.discoveryTime, '%m') = m.month ON DATE_FORMAT(ng.discoveryTime, '%m') = m.month
AND YEAR(ng.discoveryTime) = #{time} AND YEAR(ng.discoveryTime) = #{time}
AND ng.checkStatus != 3 AND ng.checkStatus != 3
AND ng.problemSourcesCode IN (13, 15) AND ng.problemSourcesCode IN (13, 15)
GROUP BY m.monthName GROUP BY m.monthName
ORDER BY m.month ASC; ORDER BY m.month ASC;
</select> </select>
@ -109,38 +109,32 @@
m.month ASC; m.month ASC;
</select> </select>
<select id="getMailTrend" resultType="com.biutag.supervision.pojo.vo.EchartsVo"> <select id="getMailTrend" resultType="com.biutag.supervision.pojo.vo.EchartsVo">
SELECT m.monthName AS `name`, SELECT
IFNULL(COUNT(ng.discoveryTime), 0) AS `value` m.monthName AS `name`,
FROM (SELECT '01' AS month, '1月' AS monthName IFNULL(COUNT(dpc.discovery_time), 0) AS `value`
UNION ALL FROM (
SELECT '02', '2月' SELECT '01' AS month, '1月' AS monthName UNION ALL
UNION ALL SELECT '02', '2月' UNION ALL
SELECT '03', '3月' SELECT '03', '3月' UNION ALL
UNION ALL SELECT '04', '4月' UNION ALL
SELECT '04', '4月' SELECT '05', '5月' UNION ALL
UNION ALL SELECT '06', '6月' UNION ALL
SELECT '05', '5月' SELECT '07', '7月' UNION ALL
UNION ALL SELECT '08', '8月' UNION ALL
SELECT '06', '6月' SELECT '09', '9月' UNION ALL
UNION ALL SELECT '10', '10月' UNION ALL
SELECT '07', '7月' SELECT '11', '11月' UNION ALL
UNION ALL SELECT '12', '12月'
SELECT '08', '8月' ) m LEFT JOIN
UNION ALL data_petition_complaint dpc on DATE_FORMAT(dpc.discovery_time, '%m')=m.month
SELECT '09', '9月' AND YEAR(dpc.discovery_time)=#{year}
UNION ALL AND dpc.problem_sources_code = #{type}
SELECT '10', '10月' GROUP BY
UNION ALL m.monthName
SELECT '11', '11月' ORDER BY
UNION ALL m.month ASC;
SELECT '12', '12月') m
LEFT JOIN
negative ng on DATE_FORMAT(ng.discoveryTime, '%m') = m.month
AND YEAR(ng.discoveryTime) = #{year}
AND checkStatus != 3
AND ng.problemSourcesCode = #{type}
GROUP BY m.monthName
ORDER BY m.month ASC;
</select> </select>

Loading…
Cancel
Save