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,
@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);
return Result.success(data);
}
@ -89,7 +92,7 @@ public class DataMailViewController {
List<EchartsVo> countryList = dataMailService.getMailTrend(year, 21); // 国家
List<EchartsVo> policeList = dataMailService.getMailTrend(year, 22); // 公安部信访
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)
.fluentPut("policeList", policeList)
.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.biutag.supervision.pojo.entity.DataPetition12337;
import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.RecentMailTrendByMonthVo;
import org.apache.ibatis.annotations.Select;
@ -23,6 +24,7 @@ public interface DataPetition12337Mapper extends BaseMapper<DataPetition12337> {
" ORDER BY monthTime asc;")
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 " +
"ORDER BY `value` DESC ")
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);
@Select("SELECT count(DISTINCT ng.id) AS totalMail, " +
"COUNT(DISTINCT ng.problemSourcesCode=21 ) AS countryMail, " +
"COUNT(DISTINCT ng.problemSourcesCode=22 ) AS policeMail, " +
"COUNT(DISTINCT ng.problemSourcesCode=24 ) AS numberMail, " +
"COUNT(DISTINCT ng.problemSourcesCode=23 ) AS manageMail " +
"COUNT( ng.problemSourcesCode=21 ) AS countryMail, " +
"COUNT( ng.problemSourcesCode=22 ) AS policeMail, " +
"COUNT( ng.problemSourcesCode=24 ) AS numberMail, " +
"COUNT( ng.problemSourcesCode=23 ) AS manageMail " +
"FROM negative ng WHERE ng.checkStatus <> 3 " +
"AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " +
"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.between("discovery_time", beginTime, endTime);
Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper);
System.out.println("国家信访数量:" + countryMail);
// 公安部信访
QueryWrapper<DataPetitionComplaint> policeQueryWrapper = new QueryWrapper<>();
policeQueryWrapper.eq("problem_sources_code", 22);
policeQueryWrapper.between("discovery_time", beginTime, endTime);
Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper);
System.out.println("公安部信访数量:" + policeMail);
// 12337信访
QueryWrapper<DataPetition12337> queryWrapper12337 = new QueryWrapper<>();
Long total12337 = dataPetition12337Mapper.selectCount(queryWrapper12337);
// 初访
QueryWrapper<DataPetitionComplaint> firstQueryWrapper = new QueryWrapper<>();
firstQueryWrapper.eq("initial_petition", 1);
firstQueryWrapper.between("discovery_time", beginTime, endTime);
Long firstMail = dataPetitionComplaintMapper.selectCount(firstQueryWrapper);
// 重访
QueryWrapper<DataPetitionComplaint> secondQueryWrapper = new QueryWrapper<>();
secondQueryWrapper.eq("initial_petition", 2);
secondQueryWrapper.between("discovery_time", beginTime, endTime);
Long secondMail = dataPetitionComplaintMapper.selectCount(secondQueryWrapper);
// 领导接访
QueryWrapper<DataPetitionComplaint> leaderQueryWrapper = new QueryWrapper<>();
leaderQueryWrapper.isNotNull("receiving_leader_name");
leaderQueryWrapper.between("discovery_time", beginTime, endTime);
Long leaderReceiveMail = dataPetitionComplaintMapper.selectCount(leaderQueryWrapper);
// 领导督办
QueryWrapper<DataPetitionComplaint> leaderViewQueryWrapper = new QueryWrapper<>();
leaderViewQueryWrapper.isNotNull("receiving_leader_name");
leaderViewQueryWrapper.between("discovery_time", beginTime, endTime);
Long leaderViewMail = dataPetitionComplaintMapper.selectCount(leaderViewQueryWrapper);
// 闹访 1:闹 0:不闹
QueryWrapper<DataPetitionComplaint> tangleQueryWrapper = new QueryWrapper<>();
tangleQueryWrapper.eq("entanglement_visits", 1);
tangleQueryWrapper.between("discovery_time", beginTime, endTime);
Long tangleMail = dataPetitionComplaintMapper.selectCount(tangleQueryWrapper);
// 集访 1:集 0:不集
QueryWrapper<DataPetitionComplaint> massQueryWrapper = new QueryWrapper<>();
massQueryWrapper.eq("mass_visits", 1);
massQueryWrapper.between("discovery_time", beginTime, endTime);
Long massMail = dataPetitionComplaintMapper.selectCount(massQueryWrapper);
Long numberMail = dataPetition12337Mapper.selectCount(queryWrapper12337);
System.out.println("12337信访数量:" + numberMail);
// // 初访
// QueryWrapper<DataPetitionComplaint> firstQueryWrapper = new QueryWrapper<>();
// firstQueryWrapper.eq("initial_petition", 1);
// firstQueryWrapper.between("discovery_time", beginTime, endTime);
// Long firstMail = dataPetitionComplaintMapper.selectCount(firstQueryWrapper);
// // 重访
// QueryWrapper<DataPetitionComplaint> secondQueryWrapper = new QueryWrapper<>();
// secondQueryWrapper.eq("initial_petition", 2);
// secondQueryWrapper.between("discovery_time", beginTime, endTime);
// Long secondMail = dataPetitionComplaintMapper.selectCount(secondQueryWrapper);
// // 领导接访
// QueryWrapper<DataPetitionComplaint> leaderQueryWrapper = new QueryWrapper<>();
// leaderQueryWrapper.isNotNull("receiving_leader_name");
// leaderQueryWrapper.between("discovery_time", beginTime, endTime);
// Long leaderReceiveMail = dataPetitionComplaintMapper.selectCount(leaderQueryWrapper);
// // 领导督办
// QueryWrapper<DataPetitionComplaint> leaderViewQueryWrapper = new QueryWrapper<>();
// leaderViewQueryWrapper.isNotNull("receiving_leader_name");
// leaderViewQueryWrapper.between("discovery_time", beginTime, endTime);
// Long leaderViewMail = dataPetitionComplaintMapper.selectCount(leaderViewQueryWrapper);
// // 闹访 1:闹 0:不闹
// QueryWrapper<DataPetitionComplaint> tangleQueryWrapper = new QueryWrapper<>();
// tangleQueryWrapper.eq("entanglement_visits", 1);
// tangleQueryWrapper.between("discovery_time", beginTime, endTime);
// Long tangleMail = dataPetitionComplaintMapper.selectCount(tangleQueryWrapper);
// // 集访 1:集 0:不集
// QueryWrapper<DataPetitionComplaint> massQueryWrapper = new QueryWrapper<>();
// massQueryWrapper.eq("mass_visits", 1);
// 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()
// 信访总数(起)
.fluentPut("total", totalMail)
.fluentPut("totalMail", totalMail)
// 国家信访
.fluentPut("countryMail", countryMail)
// 公安部信访
.fluentPut("policeMail", policeMail)
// 局长信箱
.fluentPut("commissionerMail", 5534)
.fluentPut("manageMail", 5812)
// 12337信访
.fluentPut("numMail", total12337)
// 初访;
.fluentPut("firstMail", firstMail)
// 重访
.fluentPut("secondMail", secondMail)
// 领导接访
.fluentPut("leaderReceiveMail", leaderReceiveMail)
// 领导督办
.fluentPut("leaderViewMail", leaderViewMail)
// 闹访问
.fluentPut("tangleMail", tangleMail)
// 集访
.fluentPut("massMail", massMail);
.fluentPut("numberMail", numberMail);
return overview;
}
@ -282,4 +273,9 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da
List<OrganizeProblemRankVo> res = dataPetitionComplaintMapper.getMassMailRank(beginTime, endTime, groupId);
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 '11', '11月' UNION ALL
SELECT '12', '12月' ) m LEFT JOIN negative ng
ON DATE_FORMAT(ng.discoveryTime, '%m') = m.month
AND YEAR(ng.discoveryTime) = #{time}
AND ng.checkStatus != 3
AND ng.problemSourcesCode IN (13, 15)
ON DATE_FORMAT(ng.discoveryTime, '%m') = m.month
AND YEAR(ng.discoveryTime) = #{time}
AND ng.checkStatus != 3
AND ng.problemSourcesCode IN (13, 15)
GROUP BY m.monthName
ORDER BY m.month ASC;
</select>
@ -109,38 +109,32 @@
m.month ASC;
</select>
<select id="getMailTrend" resultType="com.biutag.supervision.pojo.vo.EchartsVo">
SELECT m.monthName AS `name`,
IFNULL(COUNT(ng.discoveryTime), 0) AS `value`
FROM (SELECT '01' AS month, '1月' AS monthName
UNION ALL
SELECT '02', '2月'
UNION ALL
SELECT '03', '3月'
UNION ALL
SELECT '04', '4月'
UNION ALL
SELECT '05', '5月'
UNION ALL
SELECT '06', '6月'
UNION ALL
SELECT '07', '7月'
UNION ALL
SELECT '08', '8月'
UNION ALL
SELECT '09', '9月'
UNION ALL
SELECT '10', '10月'
UNION ALL
SELECT '11', '11月'
UNION ALL
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
m.monthName AS `name`,
IFNULL(COUNT(dpc.discovery_time), 0) AS `value`
FROM (
SELECT '01' AS month, '1月' AS monthName UNION ALL
SELECT '02', '2月' UNION ALL
SELECT '03', '3月' UNION ALL
SELECT '04', '4月' UNION ALL
SELECT '05', '5月' UNION ALL
SELECT '06', '6月' UNION ALL
SELECT '07', '7月' UNION ALL
SELECT '08', '8月' UNION ALL
SELECT '09', '9月' UNION ALL
SELECT '10', '10月' UNION ALL
SELECT '11', '11月' UNION ALL
SELECT '12', '12月'
) m LEFT JOIN
data_petition_complaint dpc on DATE_FORMAT(dpc.discovery_time, '%m')=m.month
AND YEAR(dpc.discovery_time)=#{year}
AND dpc.problem_sources_code = #{type}
GROUP BY
m.monthName
ORDER BY
m.month ASC;
</select>

Loading…
Cancel
Save