Browse Source

信访大屏1.0

main
parent
commit
856cfb3913
  1. 18
      src/main/java/com/biutag/supervision/constants/enums/RepeatEnum.java
  2. 71
      src/main/java/com/biutag/supervision/controller/datav/DataPetitionComplaintViewController.java
  3. 22
      src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java
  4. 96
      src/main/java/com/biutag/supervision/service/DataPetitionComplaintService.java

18
src/main/java/com/biutag/supervision/constants/enums/RepeatEnum.java

@ -0,0 +1,18 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public enum RepeatEnum {
FIRST_MAIL(1, "初访信件"),
REPEAT_MAIL(2, "重访信件");
private Integer id;
private String label;
}

71
src/main/java/com/biutag/supervision/controller/datav/DataPetitionComplaintViewController.java

@ -0,0 +1,71 @@
package com.biutag.supervision.controller.datav;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.biutag.supervision.constants.enums.DepartGroupEnum;
import com.biutag.supervision.constants.enums.RepeatEnum;
import com.biutag.supervision.mapper.DataCaseVerifMapper;
import com.biutag.supervision.mapper.DataPetitionComplaintMapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.CaseVerifDepart;
import com.biutag.supervision.pojo.entity.DataPetitionComplaint;
import com.biutag.supervision.service.DataPetitionComplaintService;
import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @author: sh
* @date: 2024/10/31
*/
@RequestMapping("datav/mailVisits")
@RequiredArgsConstructor
@RestController
public class DataPetitionComplaintViewController {
private final DataPetitionComplaintService dataPetitionComplaintService;
private final DataPetitionComplaintMapper dataPetitionComplaintMapper;
/**
* 信访数据大屏统计
*
* @param beginTime
* @param endTime
* @return
*/
@GetMapping
public Result<JSONObject> mailVisits(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 信访数据总数概览
JSONObject overview = dataPetitionComplaintService.allMailCount(beginTime, endTime);
// 分县市局信初重访领导访排名
List<CaseVerifDepart> fxsjFirstMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), RepeatEnum.FIRST_MAIL.getId(), beginTime, endTime);
List<CaseVerifDepart> fxsjRepeatMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), RepeatEnum.REPEAT_MAIL.getId(), beginTime, endTime);
List<CaseVerifDepart> fxsjLeaderViewMailList = dataPetitionComplaintMapper.selectLeaderViewMail(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), beginTime, endTime);
// 部委支队初重领导访排名
List<CaseVerifDepart> bwzdFirstMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.BUREAU_AFFILIATED.getId(), RepeatEnum.FIRST_MAIL.getId(), beginTime, endTime);
List<CaseVerifDepart> bwzdRepeatMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.BUREAU_AFFILIATED.getId(), RepeatEnum.REPEAT_MAIL.getId(), beginTime, endTime);
List<CaseVerifDepart> bwzdLeaderViewMailList = dataPetitionComplaintMapper.selectLeaderViewMail(DepartGroupEnum.BUREAU_AFFILIATED.getId(), beginTime, endTime);
//
JSONObject data = new JSONObject().fluentPut("overview", overview)
.fluentPut("fxsjFirstMailList", fxsjFirstMailList)
.fluentPut("fxsjRepeatMailList", fxsjRepeatMailList)
.fluentPut("fxsjLeaderViewMailList", fxsjLeaderViewMailList)
.fluentPut("bwzdFirstMailList", bwzdFirstMailList)
.fluentPut("bwzdRepeatMailList", bwzdRepeatMailList)
.fluentPut("bwzdLeaderViewMailList", bwzdLeaderViewMailList);
return Result.success(data);
}
}

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

@ -1,8 +1,30 @@
package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.dto.CaseVerifDepart;
import com.biutag.supervision.pojo.entity.DataPetitionComplaint;
import org.apache.ibatis.annotations.Select;
import java.util.Date;
import java.util.List;
public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComplaint> {
@Select("SELECT sd.id, sd.short_name label,count(*) value " +
"FROM (SELECT * FROM data_petition_complaint dpc " +
"WHERE dpc.create_time BETWEEN #{beginTime} AND #{endTime}) as temp " +
"INNER JOIN sup_depart sd on sd.id=temp.second_depart_id " +
"WHERE sd.statistics_group_id=#{departId} and temp.initial_petition=#{Repeat} " +
"GROUP BY temp.second_depart_id")
List<CaseVerifDepart> selectDepartStatistic(Integer departId, Integer Repeat, Date beginTime, Date endTime);
@Select("SELECT sd.id, sd.short_name label,count(*) value " +
"FROM (SELECT * FROM data_petition_complaint dpc " +
"WHERE dpc.create_time BETWEEN #{beginTime} AND #{endTime}) as temp " +
"INNER JOIN sup_depart sd on sd.id=temp.second_depart_id " +
"WHERE sd.statistics_group_id=#{departId} and temp.receiving_leader_name is not null " +
"GROUP BY temp.second_depart_id")
List<CaseVerifDepart> selectLeaderViewMail(Integer departId, Date beginTime, Date endTime);
}

96
src/main/java/com/biutag/supervision/service/DataPetitionComplaintService.java

@ -2,30 +2,34 @@ 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.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.constants.enums.*;
import com.biutag.supervision.mapper.DataPetitionComplaintMapper;
import com.biutag.supervision.pojo.dto.*;
import com.biutag.supervision.pojo.entity.DataPetitionComplaint;
import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam;
import lombok.RequiredArgsConstructor;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
@RequiredArgsConstructor
@Service
public class DataPetitionComplaintService extends ServiceImpl<DataPetitionComplaintMapper, DataPetitionComplaint> {
private final NegativeService negativeService;
private final DataPetitionComplaintMapper dataPetitionComplaintMapper;
public Page<DataPetitionComplaint> page(DataPetitionComplaintQueryParam queryParam) {
LambdaQueryWrapper<DataPetitionComplaint> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DataPetitionComplaint::getProblemSourcesCode, queryParam.getProblemSourcesCode())
@ -47,6 +51,7 @@ public class DataPetitionComplaintService extends ServiceImpl<DataPetitionCompla
}
return page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper);
}
public boolean save(DataPetitionComplaintDto dto) {
DataPetitionComplaint dataPetitionComplaint = new DataPetitionComplaint();
BeanUtil.copyProperties(dto, dataPetitionComplaint);
@ -116,5 +121,84 @@ public class DataPetitionComplaintService extends ServiceImpl<DataPetitionCompla
});
return true;
}
//所有分类数据总数
public JSONObject allMailCount(Date beginTime, Date endTime) {
long totalMail = this.count();
// 国家信访
QueryWrapper<DataPetitionComplaint> countryQueryWrapper = new QueryWrapper<>();
countryQueryWrapper.eq("problem_sources_code", 21);
countryQueryWrapper.between("create_time", beginTime, endTime);
Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper);
// 公安部信访
QueryWrapper<DataPetitionComplaint> policeQueryWrapper = new QueryWrapper<>();
policeQueryWrapper.eq("problem_sources_code", 22);
policeQueryWrapper.between("create_time", beginTime, endTime);
Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper);
// 初访
QueryWrapper<DataPetitionComplaint> firstQueryWrapper = new QueryWrapper<>();
firstQueryWrapper.eq("initial_petition", 1);
firstQueryWrapper.between("create_time", beginTime, endTime);
Long firstMail = dataPetitionComplaintMapper.selectCount(firstQueryWrapper);
// 重访
QueryWrapper<DataPetitionComplaint> secondQueryWrapper = new QueryWrapper<>();
secondQueryWrapper.eq("initial_petition", 2);
secondQueryWrapper.between("create_time", beginTime, endTime);
Long secondMail = dataPetitionComplaintMapper.selectCount(secondQueryWrapper);
// 领导接访
QueryWrapper<DataPetitionComplaint> leaderQueryWrapper = new QueryWrapper<>();
leaderQueryWrapper.isNotNull("receiving_leader_name");
leaderQueryWrapper.between("create_time", beginTime, endTime);
Long leaderReceiveMail = dataPetitionComplaintMapper.selectCount(leaderQueryWrapper);
// 领导督办
QueryWrapper<DataPetitionComplaint> leaderViewQueryWrapper = new QueryWrapper<>();
leaderViewQueryWrapper.isNotNull("receiving_leader_name");
leaderViewQueryWrapper.between("create_time", beginTime, endTime);
Long leaderViewMail = dataPetitionComplaintMapper.selectCount(leaderViewQueryWrapper);
// 闹访
QueryWrapper<DataPetitionComplaint> tangleQueryWrapper = new QueryWrapper<>();
tangleQueryWrapper.eq("entanglement_visits", 1);
tangleQueryWrapper.between("create_time", beginTime, endTime);
Long tangleMail = dataPetitionComplaintMapper.selectCount(tangleQueryWrapper);
// 集访
QueryWrapper<DataPetitionComplaint> massQueryWrapper = new QueryWrapper<>();
massQueryWrapper.eq("mass_visits", 1);
massQueryWrapper.between("create_time", beginTime, endTime);
Long massMail = dataPetitionComplaintMapper.selectCount(massQueryWrapper);
JSONObject overview = new JSONObject()
// 信访总数(起)
.fluentPut("total", totalMail)
// 国家信访
.fluentPut("countryMail", countryMail)
// 公安部信访
.fluentPut("policeMail", policeMail)
// 局长信箱
.fluentPut("commissionerMail", 10)
// 12337信访
.fluentPut("numMail", 10)
// 初访;
.fluentPut("firstMail", firstMail)
// 重访
.fluentPut("secondMail", secondMail)
// 领导接访
.fluentPut("leaderReceiveMail", leaderReceiveMail)
// 领导督办
.fluentPut("leaderViewMail", leaderViewMail)
// 闹访问
.fluentPut("tangleMail", tangleMail)
// 集访
.fluentPut("massMail", massMail);
return overview;
}
// 分类数据排行
public List<CaseVerifDepart> mailRank(Integer departId, Integer Repeat, Date beginTime, Date endTime) {
List<CaseVerifDepart> list = dataPetitionComplaintMapper.
selectDepartStatistic(departId, Repeat, beginTime, endTime);
return list;
}
}

Loading…
Cancel
Save