Browse Source

fix:1、初访重访情况&群众集访情况查询条件国家&公安部

main
pengwei 9 months ago
parent
commit
ab1cb60c82
  1. 82
      src/main/java/com/biutag/supervision/controller/datav/DataVMailViewController.java
  2. 84
      src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java
  3. 6
      src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java
  4. 24
      src/main/java/com/biutag/supervision/pojo/vo/BlameStats.java
  5. 6
      src/main/java/com/biutag/supervision/service/DataMailService.java
  6. 5
      src/main/java/com/biutag/supervision/service/NegativeService.java

82
src/main/java/com/biutag/supervision/controller/datav/DataVMailViewController.java

@ -2,9 +2,11 @@ package com.biutag.supervision.controller.datav;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.biutag.supervision.constants.enums.ProblemSourcesEnum;
import com.biutag.supervision.constants.enums.RepeatEnum;
import com.biutag.supervision.mapper.DataPetition12337Mapper;
import com.biutag.supervision.mapper.DataPetitionComplaintMapper;
import com.biutag.supervision.mapper.NegativeBlameMapper;
import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.vo.*;
@ -19,8 +21,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.List;
import java.util.*;
/**
@ -38,6 +39,7 @@ public class DataVMailViewController {
private final DataPetitionComplaintMapper dataPetitionComplaintMapper;
private final DataPetition12337Mapper dataPetition12337Mapper;
private final NegativeMapper negativeMapper;
private final NegativeBlameMapper negativeBlameMapper;
// region 左边
/**
@ -52,17 +54,20 @@ public class DataVMailViewController {
public Result<JSONObject> getFirstAndRepeatMail(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
endTime = DateUtil.endOfDay(endTime);
//查询国家信访和公安部信访
List<String> codes = List.of(ProblemSourcesEnum.GJXFPT.getValue(),ProblemSourcesEnum.GABXF.getValue());
// 初访重访情况总览
MailFirstAndRepeatOverviewVo fxjsFirstAndRepeatOverview = dataPetitionComplaintMapper.getFirstAndRepeatOverview(beginTime, endTime, 3);
MailFirstAndRepeatOverviewVo bwzdFirstAndRepeatOverview = dataPetitionComplaintMapper.getFirstAndRepeatOverview(beginTime, endTime, 4);
MailFirstAndRepeatOverviewVo fxjsFirstAndRepeatOverview = dataPetitionComplaintMapper.getFirstAndRepeatOverview(beginTime, endTime, 3,codes);
MailFirstAndRepeatOverviewVo bwzdFirstAndRepeatOverview = dataPetitionComplaintMapper.getFirstAndRepeatOverview(beginTime, endTime, 4,codes);
// 初访重访分类数据排行
List<OrganizeProblemRankVo> fxsjFirstRankList = dataPetitionComplaintMapper.getMailRank(beginTime, endTime, 3, RepeatEnum.FIRST_MAIL.getId()); // 1
List<OrganizeProblemRankVo> fxsjRepeatRankList = dataPetitionComplaintMapper.getMailRank(beginTime, endTime, 3, RepeatEnum.REPEAT_MAIL.getId()); // 2
List<OrganizeProblemRankVo> fxsjLeaderViewRankList = dataPetitionComplaintMapper.getMailLeaderRank(beginTime, endTime, 3);
List<OrganizeProblemRankVo> fxsjFirstRankList = dataPetitionComplaintMapper.getMailRank(beginTime, endTime, 3, RepeatEnum.FIRST_MAIL.getId(),codes); // 1
List<OrganizeProblemRankVo> fxsjRepeatRankList = dataPetitionComplaintMapper.getMailRank(beginTime, endTime, 3, RepeatEnum.REPEAT_MAIL.getId(),codes); // 2
List<OrganizeProblemRankVo> fxsjLeaderViewRankList = dataPetitionComplaintMapper.getMailLeaderRank(beginTime, endTime, 3,codes);
List<OrganizeProblemRankVo> bwzdFirstRankList = dataPetitionComplaintMapper.getMailRank(beginTime, endTime, 4, RepeatEnum.FIRST_MAIL.getId());
List<OrganizeProblemRankVo> bwzdRepeatRankList = dataPetitionComplaintMapper.getMailRank(beginTime, endTime, 4, RepeatEnum.REPEAT_MAIL.getId());
List<OrganizeProblemRankVo> bwzdLeaderViewRankList = dataPetitionComplaintMapper.getMailLeaderRank(beginTime, endTime, 4);
List<OrganizeProblemRankVo> bwzdFirstRankList = dataPetitionComplaintMapper.getMailRank(beginTime, endTime, 4, RepeatEnum.FIRST_MAIL.getId(),codes);
List<OrganizeProblemRankVo> bwzdRepeatRankList = dataPetitionComplaintMapper.getMailRank(beginTime, endTime, 4, RepeatEnum.REPEAT_MAIL.getId(),codes);
List<OrganizeProblemRankVo> bwzdLeaderViewRankList = dataPetitionComplaintMapper.getMailLeaderRank(beginTime, endTime, 4,codes);
JSONObject data = new JSONObject()
.fluentPut("fxjsFirstAndRepeatOverview", fxjsFirstAndRepeatOverview)
.fluentPut("bwzdFirstAndRepeatOverview", bwzdFirstAndRepeatOverview)
@ -152,17 +157,19 @@ public class DataVMailViewController {
@GetMapping("/getEntanglementAndMassMail")
public Result<JSONObject> getEntanglementAndMassMail(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
//查询国家信访和公安部信访
List<String> codes = List.of(ProblemSourcesEnum.GJXFPT.getValue(),ProblemSourcesEnum.GABXF.getValue());
// 缠访集访情况总览
MailEntanglementMassOverviewVo fxsjMailEntanglementMassOverview = dataPetitionComplaintMapper.getEntanglementAndMassOverview(beginTime, endTime, 3);
MailEntanglementMassOverviewVo bwzdMailEntanglementMassOverview = dataPetitionComplaintMapper.getEntanglementAndMassOverview(beginTime, endTime, 4);
MailEntanglementMassOverviewVo fxsjMailEntanglementMassOverview = dataPetitionComplaintMapper.getEntanglementAndMassOverview(beginTime, endTime, 3,codes);
MailEntanglementMassOverviewVo bwzdMailEntanglementMassOverview = dataPetitionComplaintMapper.getEntanglementAndMassOverview(beginTime, endTime, 4,codes);
List<OrganizeProblemRankVo> fxsjLeaderReviewList = dataPetitionComplaintMapper.getMailLeaderRank(beginTime, endTime, 3);
List<OrganizeProblemRankVo> fxsjEntanglementList = dataPetitionComplaintMapper.getEntanglementMailRank(beginTime, endTime, 3);
List<OrganizeProblemRankVo> fxsjMassList = dataPetitionComplaintMapper.getMassMailRank(beginTime, endTime, 3);
List<OrganizeProblemRankVo> fxsjLeaderReviewList = dataPetitionComplaintMapper.getMailLeaderRank(beginTime, endTime, 3,codes);
List<OrganizeProblemRankVo> fxsjEntanglementList = dataPetitionComplaintMapper.getEntanglementMailRank(beginTime, endTime, 3,codes);
List<OrganizeProblemRankVo> fxsjMassList = dataPetitionComplaintMapper.getMassMailRank(beginTime, endTime, 3,codes);
List<OrganizeProblemRankVo> bwzdLeaderReviewList = dataPetitionComplaintMapper.getMailLeaderRank(beginTime, endTime, 4);
List<OrganizeProblemRankVo> bwzdEntanglementList = dataPetitionComplaintMapper.getEntanglementMailRank(beginTime, endTime, 4);
List<OrganizeProblemRankVo> bwzdMassList = dataPetitionComplaintMapper.getMassMailRank(beginTime, endTime, 4);
List<OrganizeProblemRankVo> bwzdLeaderReviewList = dataPetitionComplaintMapper.getMailLeaderRank(beginTime, endTime, 4,codes);
List<OrganizeProblemRankVo> bwzdEntanglementList = dataPetitionComplaintMapper.getEntanglementMailRank(beginTime, endTime, 4,codes);
List<OrganizeProblemRankVo> bwzdMassList = dataPetitionComplaintMapper.getMassMailRank(beginTime, endTime, 4,codes);
JSONObject data = new JSONObject()
.fluentPut("fxsjMailEntanglementMassOverview", fxsjMailEntanglementMassOverview)
@ -175,6 +182,43 @@ public class DataVMailViewController {
.fluentPut("bwzdMassList", bwzdMassList);
return Result.success(data);
}
// endregion
/**
* 追责问责情况
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "追责问责情况")
@GetMapping("/getResultCount")
public Result<Map<String,Integer>> getResultCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){
List<BlameStats> list = negativeBlameMapper.selectBlameStatsCount(beginTime,endTime);
Map<String,Integer> blameMap = new HashMap<>();
list.forEach(s->{
if(s.getResultName().indexOf("、") > 0){
for (String name:s.getResultName().split("、")){
if(!name.contains("不") && !name.contains("追责")){
if(blameMap.containsKey(name)){
blameMap.put(name,blameMap.get(name) + s.getResultCount());
}else{
blameMap.put(name,s.getResultCount());
}
}
}
}else{
if(!s.getResultName().contains("不") && !s.getResultName().contains("追责")){
if(blameMap.containsKey(s.getResultName())){
blameMap.put(s.getResultName(),blameMap.get(s.getResultName()) + s.getResultCount());
}else{
blameMap.put(s.getResultName(),s.getResultCount());
}
}
}
});
return Result.success(blameMap);
}
}

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

@ -55,44 +55,66 @@ public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComp
List<RecentMailTrendByMonthVo> selectRecentlyMailTrendByMonth(Integer sourcesCode, String year);
@Select("SELECT " +
@Select( "<script>"+
"SELECT " +
"IFNULL(SUM( IF(initial_petition=1, 1, 0) ), 0) AS firstMail, " +
"IFNULL(SUM( IF( initial_petition=2, 1, 0) ), 0) AS repeatMail, " +
"IFNULL(SUM( IF(receiving_leader_name is NOT NULL, 1, 0) ), 0) AS leaderMail " +
"FROM data_petition_complaint dpc " +
"LEFT JOIN sup_depart sd on dpc.second_depart_id=sd.id " +
"WHERE dpc.create_time BETWEEN #{beginTime} AND #{endTime} " +
"AND sd.statistics_group_id=#{groupId}")
MailFirstAndRepeatOverviewVo getFirstAndRepeatOverview(Date beginTime, Date endTime, Integer groupId);
@Select("SELECT " +
"AND dpc.problem_sources_code in "+
"<foreach collection='codes' item='item' open='(' separator=',' close=')'>"+
"#{item}"+
"</foreach>"+
"AND sd.statistics_group_id=#{groupId}"+
"</script>")
MailFirstAndRepeatOverviewVo getFirstAndRepeatOverview(Date beginTime, Date endTime, Integer groupId,List<String> codes);
@Select(
"<script>"+
"SELECT " +
"sd.short_name AS label, " +
"count(*) AS `value` FROM data_petition_complaint dpc " +
"LEFT JOIN sup_depart sd on dpc.second_depart_id=sd.id " +
"WHERE dpc.initial_petition=#{isRepeat} " +
"AND sd.statistics_group_id=#{groupId} " +
"AND dpc.problem_sources_code in "+
"<foreach collection='codes' item='item' open='(' separator=',' close=')'>"+
"#{item}"+
"</foreach>"+
"AND dpc.create_time BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY sd.short_name " +
"HAVING label is not NULL " +
"ORDER BY `value` DESC; ")
List<OrganizeProblemRankVo> getMailRank(Date beginTime, Date endTime, Integer groupId, Integer isRepeat);
"ORDER BY `value` DESC "+
"</script>")
List<OrganizeProblemRankVo> getMailRank(Date beginTime, Date endTime, Integer groupId, Integer isRepeat,List<String> codes);
@Select("SELECT " +
@Select( "<script>"+
"SELECT " +
"sd1.short_name AS label, " +
"count(*) AS `value` FROM data_petition_complaint dpc " +
"LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " +
"LEFT JOIN sup_depart sd1 ON sd.pid=sd1.id " +
"WHERE dpc.receiving_leader_name is NOT NULL " +
"AND sd1.statistics_group_id=#{groupId} " +
"AND dpc.problem_sources_code in "+
"<foreach collection='codes' item='item' open='(' separator=',' close=')'>"+
"#{item}"+
"</foreach>"+
"AND dpc.create_time BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY sd1.short_name " +
"HAVING label is not NULL " +
"ORDER BY `value` DESC; ")
List<OrganizeProblemRankVo> getMailLeaderRank(Date beginTime, Date endTime, Integer groupId);
"ORDER BY `value` DESC"+
"</script>"
)
List<OrganizeProblemRankVo> getMailLeaderRank(Date beginTime, Date endTime, Integer groupId,List<String> codes);
@Select("SELECT " +
@Select("<script>" +
"SELECT " +
"IFNULL(sum(IF(receiving_leader_name IS NOT NULL, 1, 0)), 0) AS leaderReview, " +
"IFNULL(sum(IF(entanglement_visits = 1, 1, 0)), 0) AS entanglement, " +
"IFNULL(sum(IF(mass_visits = 1, 1, 0)), 0) AS mass " +
@ -100,11 +122,18 @@ public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComp
"LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " +
"LEFT JOIN sup_depart sd1 on sd.pid=sd1.id " +
"WHERE create_time BETWEEN #{beginTime} AND #{endTime} " +
"AND sd1.statistics_group_id=#{groupId}; ")
MailEntanglementMassOverviewVo getEntanglementAndMassOverview(Date beginTime, Date endTime, Integer groupId);
@Select("SELECT " +
"AND sd1.statistics_group_id=#{groupId} "+
"AND dpc.problem_sources_code in "+
"<foreach collection='codes' item='item' open='(' separator=',' close=')'>"+
"#{item}"+
"</foreach>"+
"</script>"
)
MailEntanglementMassOverviewVo getEntanglementAndMassOverview(Date beginTime, Date endTime, Integer groupId,List<String> codes);
@Select("<script>" +
"SELECT " +
"sd1.short_name AS label, " +
"count(DISTINCT dpc.origin_id ) AS `value` " +
"FROM data_petition_complaint dpc " +
@ -112,13 +141,20 @@ public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComp
"LEFT JOIN sup_depart sd1 ON sd.pid=sd1.id " +
"WHERE sd1.statistics_group_id=#{groupId} " +
"AND dpc.entanglement_visits =1 " +
"AND dpc.problem_sources_code in "+
"<foreach collection='codes' item='item' open='(' separator=',' close=')'>"+
"#{item}"+
"</foreach>"+
"AND create_time BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY sd1.short_name " +
"HAVING label is not NULL " +
"ORDER BY `value` DESC;")
List<OrganizeProblemRankVo> getEntanglementMailRank(Date beginTime, Date endTime, Integer groupId);
"ORDER BY `value` DESC"+
"</script>"
)
List<OrganizeProblemRankVo> getEntanglementMailRank(Date beginTime, Date endTime, Integer groupId,List<String> codes);
@Select("SELECT " +
@Select("<script>" +
"SELECT " +
"sd1.short_name AS label, " +
"count(DISTINCT dpc.origin_id ) AS `value` " +
"FROM data_petition_complaint dpc " +
@ -126,11 +162,17 @@ public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComp
"LEFT JOIN sup_depart sd1 ON sd.pid=sd1.id " +
"WHERE sd1.statistics_group_id=#{groupId} " +
"AND dpc.mass_visits =1 " +
"AND dpc.problem_sources_code in "+
"<foreach collection='codes' item='item' open='(' separator=',' close=')'>"+
"#{item}"+
"</foreach>"+
"AND create_time BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY sd1.short_name " +
"HAVING label is not NULL " +
"ORDER BY `value` DESC;")
List<OrganizeProblemRankVo> getMassMailRank(Date beginTime, Date endTime, Integer groupId);
"ORDER BY `value` DESC"+
"</script>"
)
List<OrganizeProblemRankVo> getMassMailRank(Date beginTime, Date endTime, Integer groupId,List<String> codes);
@Select("select count(*) " +

6
src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java

@ -3,6 +3,7 @@ package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.NegativeBlame;
import com.biutag.supervision.pojo.vo.BlamePerson;
import com.biutag.supervision.pojo.vo.BlameStats;
import org.apache.ibatis.annotations.Select;
import java.time.LocalDateTime;
@ -53,4 +54,9 @@ public interface NegativeBlameMapper extends BaseMapper<NegativeBlame> {
@Select(" select blameName, blameIdCode, blameDepartId from `negative_blame` where crtTime > '2024-01-01 00:00:00' " +
" and blameIdCode is not null and blameDepartId is not null and length(blameIdCode) > 0 and length(blameDepartId) > 0 and length(blameName) > 0 and ivPersonTypeCode != '1'")
List<NegativeBlame> selectBlameListNotIvPerson();
@Select("select handleResultName as resultName, count(*) as resultCount FROM `negative_blame` "+
"WHERE handleResultName is NOT NULL and handleResultCode is NOT NULL AND crtTime BETWEEN #{beginTime} AND #{endTime} GROUP BY resultName"
)
List<BlameStats> selectBlameStatsCount(Date beginTime, Date endTime);
}

24
src/main/java/com/biutag/supervision/pojo/vo/BlameStats.java

@ -0,0 +1,24 @@
package com.biutag.supervision.pojo.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.io.Serializable;
@Data
@Builder
@Slf4j
@AllArgsConstructor
@NoArgsConstructor(force = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class BlameStats implements Serializable {
//问责
private String resultName;
//问责统计数
private Integer resultCount;
}

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

@ -47,6 +47,7 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da
}
public MailOverviewVo mailCount(Date beginTime, Date endTime) {
//todo 信访投诉大屏中央统计
MailOverviewVo temp = new MailOverviewVo();
// 国家信访
QueryWrapper<DataPetitionComplaint> countryQueryWrapper = new QueryWrapper<>();
@ -54,6 +55,11 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da
countryQueryWrapper.between("create_time", beginTime, endTime);
Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper);
// 公安部信访
QueryWrapper<DataPetitionComplaint> policeQueryWrapper = new QueryWrapper<>();
policeQueryWrapper.eq("problem_sources_code", 22);

5
src/main/java/com/biutag/supervision/service/NegativeService.java

@ -83,11 +83,13 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
Negative negative = getById(id);
List<NegativeHistory> flows = negativeHistoryService.listByNegativeId(id);
AtomicReference<String> flowKey = new AtomicReference<>(negative.getFlowKey());
//附件
List<NegativeFileVo> files = fileService.list(id);
List<NegativeThingFile> thingFiles = thingFileService.list(id);
if (Objects.nonNull(workId)) {
Optional.ofNullable(workService.getById(workId)).map(NegativeWork::getFlowKey).filter(StrUtil::isNotBlank).ifPresent(flowKey::set);
}
//审批
FlowNode flowNode = flowNodeService.getById(flowKey.get());
List<FlowAction> flowActions = flowActionService.list(flowKey.get());
@ -99,6 +101,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
if (StrUtil.isNotBlank(negative.getProblems())) {
vo.setProblems(JSON.parseArray(negative.getProblems(), VerifyData.Problem.class));
}
//处理结果
List<Blame> blameList = blameService.list(id);
vo.setBlames(blameList);
if (!blameList.isEmpty()) {
@ -411,4 +414,4 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
return true;
}
}
}

Loading…
Cancel
Save