Browse Source

fix--信访投诉核对 step2

master
buaixuexideshitongxue 3 weeks ago
parent
commit
c9616146d1
  1. 30
      src/main/java/com/biutag/supervision/controller/datav/DataVMailViewController.java
  2. 140
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneMailViewController.java
  3. 186
      src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java
  4. 9
      src/main/java/com/biutag/supervision/pojo/vo/MailMapIconVo.java
  5. 14
      src/main/java/com/biutag/supervision/pojo/vo/MailOverviewVo.java
  6. 35
      src/main/java/com/biutag/supervision/service/datav/DatavService.java
  7. 503
      src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java
  8. 73
      src/main/resources/mapper/DataPetitionComplaintMapper.xml

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

@ -1,6 +1,5 @@
package com.biutag.supervision.controller.datav;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.biutag.supervision.mapper.DataPetition12337Mapper;
import com.biutag.supervision.mapper.NegativeBlameMapper;
@ -9,7 +8,6 @@ import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.request.datav.DataVRequest;
import com.biutag.supervision.pojo.vo.BlameStats;
import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.MailMapIconVo;
import com.biutag.supervision.service.DataMailService;
import com.biutag.supervision.service.datav.DatavService;
import io.swagger.v3.oas.annotations.Operation;
@ -57,39 +55,18 @@ public class DataVMailViewController {
// endregion
// region 中间
@Operation(summary = "中央数据统计")
@PostMapping("/getAllMailCount")
public Result<JSONObject> getAllMailCount(@RequestBody DataVRequest request) {
return datavService.getAllMailCount(request);
}
/**
* 信访数据中央地图小图标数据
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "信访数据中央地图小图标数据")
@GetMapping("/getMailMapIcon")
// @Cacheable(cacheNames = "Supervision:Screen:MailMap", key = "#beginTime.getTime()+'_'+#endTime.getTime()")
public Result<JSONObject> getMailMapIcon(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
endTime = DateUtil.endOfDay(endTime);
// 信访数据总数概览
List<MailMapIconVo> mailMapIconList = dataMailService.getMailMapIcon(beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("mailMapIconList", mailMapIconList);
return Result.success(data);
@PostMapping("/getMailMapIcon")
public Result<JSONObject> getMailMapIcon(@RequestBody DataVRequest request) {
return datavService.getMailMapIcon(request);
}
/**
* 信访数据大屏信访趋势统计
*
* @param year 年份
* @return Result<JSONObject>
*/
@Operation(summary = "信访数据大屏信访趋势统计")
@GetMapping("/getMailTrend")
public Result<JSONObject> getMailTrend(@RequestParam Integer year) {
@ -149,5 +126,6 @@ public class DataVMailViewController {
});
return Result.success(blameMap);
}
// endregion
}

140
src/main/java/com/biutag/supervision/controller/subdatav/SubOneMailViewController.java

@ -1,23 +1,22 @@
package com.biutag.supervision.controller.subdatav;
import com.alibaba.fastjson.JSONObject;
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.*;
import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest;
import com.biutag.supervision.pojo.vo.BlameStats;
import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.MailMapIconVo;
import com.biutag.supervision.service.DataMailService;
import com.biutag.supervision.service.datav.DatavService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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 org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.HashMap;
@ -40,83 +39,36 @@ public class SubOneMailViewController {
private final DataMailService dataMailService;
private final DataPetitionComplaintMapper dataPetitionComplaintMapper;
private final DataPetition12337Mapper dataPetition12337Mapper;
private final NegativeMapper negativeMapper;
private final NegativeBlameMapper negativeBlameMapper;
// region 左边
private final DatavService datavService;
/**
* 初访重访情况
*
* @param departId 部门id (分县市局ID)
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
// region 左边
@Operation(summary = "初访重访情况")
@GetMapping("/getSubOneFirstAndRepeatMail")
public Result<JSONObject> getFirstAndRepeatMail(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 初访重访情况总览
MailFirstAndRepeatOverviewVo fxjsFirstAndRepeatOverview = dataPetitionComplaintMapper.getSubOnePoliceFirstAndRepeatOverview(beginTime, endTime, departId);
MailFirstAndRepeatOverviewVo bwzdFirstAndRepeatOverview = dataPetitionComplaintMapper.getTeamFirstAndRepeatOverview(beginTime, endTime, departId);
// 初访重访分类数据排行
List<OrganizeProblemRankVo> fxsjFirstRankList = dataPetitionComplaintMapper.getPoliceMailRank(beginTime, endTime, departId, 1); // 1
List<OrganizeProblemRankVo> fxsjRepeatRankList = dataPetitionComplaintMapper.getPoliceMailRank(beginTime, endTime, departId, RepeatEnum.REPEAT_MAIL.getId()); // 2
List<OrganizeProblemRankVo> fxsjLeaderViewRankList = dataPetitionComplaintMapper.getPoliceMailLeaderRank(beginTime, endTime, departId);
List<OrganizeProblemRankVo> bwzdFirstRankList = dataPetitionComplaintMapper.getTeamMailRank(beginTime, endTime, departId, RepeatEnum.FIRST_MAIL.getId());
List<OrganizeProblemRankVo> bwzdRepeatRankList = dataPetitionComplaintMapper.getTeamMailRank(beginTime, endTime, departId, RepeatEnum.REPEAT_MAIL.getId());
List<OrganizeProblemRankVo> bwzdLeaderViewRankList = dataPetitionComplaintMapper.getTeamMailLeaderRank(beginTime, endTime, 4);
JSONObject data = new JSONObject()
.fluentPut("fxjsFirstAndRepeatOverview", fxjsFirstAndRepeatOverview)
.fluentPut("bwzdFirstAndRepeatOverview", bwzdFirstAndRepeatOverview)
.fluentPut("fxsjFirstRankList", fxsjFirstRankList)
.fluentPut("fxsjRepeatRankList", fxsjRepeatRankList)
.fluentPut("fxsjLeaderViewRankList", fxsjLeaderViewRankList)
.fluentPut("bwzdFirstRankList", bwzdFirstRankList)
.fluentPut("bwzdRepeatRankList", bwzdRepeatRankList)
.fluentPut("bwzdLeaderViewRankList", bwzdLeaderViewRankList);
return Result.success(data);
@PostMapping("/getSubOneFirstAndRepeatMail")
public Result<JSONObject> getSubOneFirstAndRepeatMail(@RequestBody SubDataVRequest request) {
return datavService.getSubOneFirstAndRepeatMail(request);
}
// endregion
// region 中间
/**
* 信访数据中央总览统计
*
* @param departId 部门id (分县市局ID)
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "信访数据大屏中央数据统计")
@GetMapping("/getSubOneAllMailCount")
public Result<JSONObject> getSubOneAllMailCount(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 信访数据总数概览
MailOverviewVo overview = dataMailService.getSubOneAllMailCount(beginTime, endTime, departId);
System.out.println("信访总览================================");
System.out.println(overview);
JSONObject data = new JSONObject().fluentPut("overview", overview);
return Result.success(data);
@Operation(summary = "信访数据大屏中央数据统计 && 信访投诉占比")
@PostMapping("/getSubOneAllMailCount")
public Result<JSONObject> getSubOneAllMailCount(@RequestBody SubDataVRequest request) {
return datavService.getSubOneAllMailCount(request);
}
/**
* 信访数据中央地图小图标数据
*
* @param departId 部门id (分县市局ID)
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "信访数据中央地图小图标数据")
@PostMapping("/getSubOneMailMapIcon")
public Result<JSONObject> getSubOneMailMapIcon(@RequestBody SubDataVRequest request) {
return datavService.getSubOneMailMapIcon(request);
}
@Operation(summary = "信访数据中央地图小图标数据")
@GetMapping("/getSubOneMailMapIcon")
// @Cacheable(cacheNames = "Supervision:Screen:SubOneMailMap", key = "#departId+'_'+#beginTime.getTime() + '_' +#endTime.getTime()")
public Result<JSONObject> getSubOneMailMapIcon(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
@ -127,13 +79,7 @@ public class SubOneMailViewController {
}
/**
* 信访数据大屏信访趋势统计
*
* @param departId 部门id (分县市局ID)
* @param year 年份
* @return Result<JSONObject>
*/
@Operation(summary = "信访数据大屏信访趋势统计")
@GetMapping("/getSubOneMailTrend")
public Result<JSONObject> getSubOneMailTrend(@RequestParam Integer departId,
@ -152,42 +98,10 @@ public class SubOneMailViewController {
// endregion
// region 右边
/**
* 缠访集访情况
*
* @param departId 部门id (分县市局ID)
* @param beginTime 开始时间
* @param endTime 结束时间
* @return Result<JSONObject>
*/
@Operation(summary = "缠访集访情况")
@GetMapping("/getSubOneEntanglementAndMassMail")
public Result<JSONObject> getSubOneEntanglementAndMassMail(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 缠访集访情况总览
MailEntanglementMassOverviewVo fxsjMailEntanglementMassOverview = dataPetitionComplaintMapper.getPoliceEntanglementAndMassOverview(beginTime, endTime, departId);
MailEntanglementMassOverviewVo bwzdMailEntanglementMassOverview = dataPetitionComplaintMapper.getTeamEntanglementAndMassOverview(beginTime, endTime, departId);
List<OrganizeProblemRankVo> fxsjLeaderReviewList = dataPetitionComplaintMapper.getPoliceMailLeaderRank(beginTime, endTime, departId);
List<OrganizeProblemRankVo> fxsjEntanglementList = dataPetitionComplaintMapper.getPoliceEntanglementMailRank(beginTime, endTime, departId);
List<OrganizeProblemRankVo> fxsjMassList = dataPetitionComplaintMapper.getPoliceMassMailRank(beginTime, endTime, departId);
List<OrganizeProblemRankVo> bwzdLeaderReviewList = dataPetitionComplaintMapper.getTeamMailLeaderRank(beginTime, endTime, departId);
List<OrganizeProblemRankVo> bwzdEntanglementList = dataPetitionComplaintMapper.getTeamEntanglementMailRank(beginTime, endTime, departId);
List<OrganizeProblemRankVo> bwzdMassList = dataPetitionComplaintMapper.getTeamMassMailRank(beginTime, endTime, departId);
JSONObject data = new JSONObject()
.fluentPut("fxsjMailEntanglementMassOverview", fxsjMailEntanglementMassOverview)
.fluentPut("bwzdMailEntanglementMassOverview", bwzdMailEntanglementMassOverview)
.fluentPut("fxsjLeaderReviewList", fxsjLeaderReviewList)
.fluentPut("fxsjEntanglementList", fxsjEntanglementList)
.fluentPut("fxsjMassList", fxsjMassList)
.fluentPut("bwzdLeaderReviewList", bwzdLeaderReviewList)
.fluentPut("bwzdEntanglementList", bwzdEntanglementList)
.fluentPut("bwzdMassList", bwzdMassList);
return Result.success(data);
@Operation(summary = "群众集访情况")
@PostMapping("/getSubOneEntanglementAndMassMail")
public Result<JSONObject> getSubOneEntanglementAndMassMail(@RequestBody SubDataVRequest request) {
return datavService.getSubOneEntanglementAndMassMail(request);
}
// endregion

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

@ -84,24 +84,24 @@ public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComp
"</script>")
int getNullObjectData(Date beginTime, Date endTime,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 "+
"</script>")
List<OrganizeProblemRankVo> getMailRank(Date beginTime, Date endTime, Integer groupId, Integer isRepeat,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 "+
// "</script>")
// List<OrganizeProblemRankVo> getMailRank(Date beginTime, Date endTime, Integer groupId, Integer isRepeat,List<String> codes);
@Select("SELECT " +
"sd.short_name as label, " +
@ -112,8 +112,8 @@ public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComp
"AND initial_petition=#{repeat} " +
"AND sd.statistics_group_id=#{groupId} " +
"AND dpc.problem_sources_code IN (21, 22) " +
"GROUP BY name " +
"HAVING `name` is not NULL " +
"GROUP BY label " +
"HAVING `label` is not NULL " +
"ORDER BY `value` DESC")
List<OrganizeProblemRankVo> getMailRank(Date beginTime, Date endTime, Integer groupId, Integer repeat);
@ -136,24 +136,24 @@ public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComp
// "ORDER BY `value` DESC"+
// "</script>"
// )
@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.receiving_leader_name is NOT NULL " +
"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"+
"</script>"
)
List<OrganizeProblemRankVo> getMailLeaderRank(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.receiving_leader_name is NOT NULL " +
// "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"+
// "</script>"
// )
// List<OrganizeProblemRankVo> getMailLeaderRank(Date beginTime, Date endTime, Integer groupId,List<String> codes);
@Select("SELECT " +
@ -165,8 +165,8 @@ public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComp
"AND dpc.receiving_leader_name is not NULL " +
"AND sd.statistics_group_id=#{groupId} " +
"AND dpc.problem_sources_code IN (21, 22) " +
"GROUP BY name " +
"HAVING `name` is not NULL " +
"GROUP BY label " +
"HAVING `label` is not NULL " +
"ORDER BY `value` DESC")
List<OrganizeProblemRankVo> getMailLeaderRank(Date beginTime, Date endTime, Integer groupId);
@ -189,46 +189,46 @@ public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComp
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 " +
"LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " +
"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"+
"</script>"
)
List<OrganizeProblemRankVo> getEntanglementMailRank(Date beginTime, Date endTime, Integer groupId,List<String> codes);
@Select("<script>" +
"SELECT " +
"sd.short_name AS label, " +
"count(DISTINCT dpc.origin_id ) AS `value` " +
"FROM data_petition_complaint dpc " +
"LEFT JOIN sup_depart sd on dpc.second_depart_id=sd.id " +
"WHERE sd.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 dpc.create_time BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY sd.short_name " +
"HAVING label is not NULL " +
"ORDER BY `value` DESC"+
"</script>"
)
List<OrganizeProblemRankVo> getMassMailRank(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 " +
// "LEFT JOIN sup_depart sd on dpc.third_depart_id=sd.id " +
// "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"+
// "</script>"
// )
// List<OrganizeProblemRankVo> getEntanglementMailRank(Date beginTime, Date endTime, Integer groupId,List<String> codes);
//
// @Select("<script>" +
// "SELECT " +
// "sd.short_name AS label, " +
// "count(DISTINCT dpc.origin_id ) AS `value` " +
// "FROM data_petition_complaint dpc " +
// "LEFT JOIN sup_depart sd on dpc.second_depart_id=sd.id " +
// "WHERE sd.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 dpc.create_time BETWEEN #{beginTime} AND #{endTime} " +
// "GROUP BY sd.short_name " +
// "HAVING label is not NULL " +
// "ORDER BY `value` DESC"+
// "</script>"
// )
// List<OrganizeProblemRankVo> getMassMailRank(Date beginTime, Date endTime, Integer groupId,List<String> codes);
@Select("SELECT " +
"sd.short_name as label, " +
"count(*) as `value` " +
@ -238,8 +238,8 @@ public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComp
"AND dpc.mass_visits='1' " +
"AND sd.statistics_group_id=#{groupId} " +
"AND dpc.problem_sources_code IN (21, 22) " +
"GROUP BY name " +
"HAVING `name` is not NULL " +
"GROUP BY label " +
"HAVING `label` is not NULL " +
"ORDER BY `value` DESC ")
List<OrganizeProblemRankVo> getMassMailRank(Date beginTime, Date endTime, Integer groupId);
@ -433,4 +433,26 @@ public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComp
Page<DataPetitionComplaintNegativeVo> queryBooks(@Param("page") Page<DataPetitionComplaint> page, @Param(Constants.WRAPPER) QueryWrapper<DataPetitionComplaint> queryWrapper);
List<OrganizeProblemRankVo> getSubMailRank(
@Param("beginTime") Date beginTime,
@Param("endTime") Date endTime,
@Param("groupId") Integer groupId,
@Param("repeat") Integer repeat,
@Param("departId") String departId);
List<OrganizeProblemRankVo> getSubOneMassMailRank(
@Param("beginTime") Date beginTime,
@Param("endTime") Date endTime,
@Param("groupId") Integer groupId,
@Param("departId") String departId
);
List<OrganizeProblemRankVo> getSubOneMailLeaderRank(
@Param("beginTime") Date beginTime,
@Param("endTime") Date endTime,
@Param("groupId") Integer groupId,
@Param("departId") String departId);
}

9
src/main/java/com/biutag/supervision/pojo/vo/MailMapIconVo.java

@ -1,5 +1,6 @@
package com.biutag.supervision.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
@ -14,10 +15,18 @@ public class MailMapIconVo implements Serializable {
private String name; // 名字
private String departId; // id
@Schema(description = "总数")
private String total;
@Schema(description = "国家")
private String countryTotal;
@Schema(description = "公安")
private String policeTotal;
@Schema(description = "局长信箱")
private String commissionerTotal;
@Schema(description = "12337")
private String numTotal; // 12337
// private String departPName; // 部门的父级名字

14
src/main/java/com/biutag/supervision/pojo/vo/MailOverviewVo.java

@ -1,5 +1,6 @@
package com.biutag.supervision.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
@ -11,11 +12,20 @@ import java.io.Serializable;
*/
@Data
public class MailOverviewVo implements Serializable {
// 信访总问题数
@Schema(description = "局长信箱")
private Long manageMail;
@Schema(description = "信访总问题数")
private Long totalMail;
@Schema(description = "国家信访")
private Long countryMail;
@Schema(description = "公安信访")
private Long policeMail;
@Schema(description = "12337")
private Long numberMail;
private Long manageMail;
}

35
src/main/java/com/biutag/supervision/service/datav/DatavService.java

@ -171,4 +171,39 @@ public interface DatavService {
*/
Result<JSONObject> getEntanglementAndMassMail(DataVRequest request);
/**
* 信访一级 地图数据
* @param request
* @return
*/
Result<JSONObject> getMailMapIcon(DataVRequest request);
/**
* 信访二级 初重情况
* @param request
* @return
*/
Result<JSONObject> getSubOneFirstAndRepeatMail(SubDataVRequest request);
/**
* 二级信访 总览数据
* @param request
* @return
*/
Result<JSONObject> getSubOneAllMailCount(SubDataVRequest request);
/**
* 信访二级 集访情况
* @param request
* @return
*/
Result<JSONObject> getSubOneEntanglementAndMassMail(SubDataVRequest request);
/**
* 信访二级 地图数据
* @param request
* @return
*/
Result<JSONObject> getSubOneMailMapIcon(SubDataVRequest request);
}

503
src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java

@ -5,17 +5,17 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.biutag.supervision.constants.enums.*;
import com.biutag.supervision.constants.enums.invest.DeleteStatusEnum;
import com.biutag.supervision.constants.enums.invest.ReportProjectNodeEnum;
import com.biutag.supervision.mapper.DataPetitionComplaintMapper;
import com.biutag.supervision.mapper.RpcApplyMapper;
import com.biutag.supervision.mapper.RpcComfortPacksMapper;
import com.biutag.supervision.mapper.*;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.DepartAndSubDepartDto;
import com.biutag.supervision.pojo.dto.common.BarItem;
import com.biutag.supervision.pojo.dto.common.PieItem;
import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.pojo.entity.mailbox.Mail;
import com.biutag.supervision.pojo.entity.report.ReportProject;
import com.biutag.supervision.pojo.param.*;
import com.biutag.supervision.pojo.param.dataAudit.DataAuditQueryParam;
@ -42,6 +42,7 @@ import java.time.ZoneId;
import java.util.*;
import java.util.stream.Collectors;
import static com.biutag.supervision.constants.enums.DepartGroupEnum.COUNTY_CITY_BUREAUS;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*;
/**
@ -112,6 +113,21 @@ public class DatavServiceImpl implements DatavService {
@Resource
private DataMailService dataMailService;
@Resource
private MailMapper mailMapper;
@Resource
private SupExternalDepartMapper supExternalDepartMapper;
@Resource
private DataPetition12337Service dataPetition12337Service;
@Resource
private SupDepartMapper supDepartMapper;
private final String VALID_SIGN = "terminated";
private final String EX_SOURCE = "局长信箱";
@Override
public Result<JSONObject> getAuditMap(DataVRequest request) {
List<AuditSuperviseMapIconVo> auditSuperviseMapIconVoList = new ArrayList<>();
@ -810,4 +826,485 @@ public class DatavServiceImpl implements DatavService {
.fluentPut("bwzdLeaderReviewMailList", bwzdLeaderReviewMailList);
return Result.success(data);
}
@Override
public Result<JSONObject> getMailMapIcon(DataVRequest request) {
List<MailMapIconVo> res = new ArrayList<>();
Date beginTime = request.getBeginTime();
Date endTime = request.getEndTime();
// 查询所有分县市局
SupDepartQueryParam supDepartQueryParam = new SupDepartQueryParam();
supDepartQueryParam.setStatisticsGroupId(3);
List<SupDepart> fxsjDw = supDepartResourceService.query(supDepartQueryParam);
for (SupDepart supDepart : fxsjDw) {
MailMapIconVo mapIconVo = new MailMapIconVo();
mapIconVo.setName(supDepart.getShortName());
mapIconVo.setDepartId(supDepart.getId());
res.add(mapIconVo);
}
for (MailMapIconVo re : res) {
String departId = re.getDepartId();
// 国家信访
Long countryTotal = dataPetitionComplaintMapper.selectMailBySourceCode(beginTime, endTime, GJXFPT.getValue(), departId);
// 公安信访
Long policeTotal = dataPetitionComplaintMapper.selectMailBySourceCode(beginTime, endTime, GABXF.getValue(), departId);
// 12337
Long numTotal = dataPetition12337Service.count(new LambdaQueryWrapper<DataPetition12337>().between(DataPetition12337::getDiscoverTime, beginTime, endTime).eq(DataPetition12337::getSecondDepartId,departId));
// 局长信箱
QueryWrapper<Mail> subOneMailQueryWrapper = new QueryWrapper<>();
String exDepartId = supExternalDepartMapper.getExIdByInId(departId.toString(), EX_SOURCE);
subOneMailQueryWrapper.ne("mail_state", VALID_SIGN);
subOneMailQueryWrapper.eq("second_dept_id", exDepartId);
subOneMailQueryWrapper.between("create_time", beginTime, endTime);
Long commissionerTotal = mailMapper.selectCount(subOneMailQueryWrapper);
// 总数
Long total = countryTotal + policeTotal + numTotal;
//国家信访
re.setCountryTotal(countryTotal.toString());
//公安部信访
re.setPoliceTotal(policeTotal.toString());
//局长信箱
re.setCommissionerTotal(commissionerTotal.toString());
//12337信访
re.setNumTotal(numTotal.toString());
re.setTotal(total.toString());
}
JSONObject data = new JSONObject().fluentPut("mailMapIconList", res);
return Result.success(data);
}
@Override
public Result<JSONObject> getSubOneFirstAndRepeatMail(SubDataVRequest request) {
Date beginTime = request.getBeginTime();
Date endTime = request.getEndTime();
// 派出所
List<OrganizeProblemRankVo> fxsjFirstRankList = dataPetitionComplaintMapper.getSubMailRank(beginTime, endTime, 10, RepeatEnum.FIRST_MAIL.getId(), request.getDepartId());
List<OrganizeProblemRankVo> fxsjRepeatRankList = dataPetitionComplaintMapper.getSubMailRank(beginTime, endTime, 10, RepeatEnum.REPEAT_MAIL.getId(), request.getDepartId());
// 大队
List<OrganizeProblemRankVo> bwzdFirstRankList = dataPetitionComplaintMapper.getSubMailRank(beginTime, endTime, null, RepeatEnum.FIRST_MAIL.getId(),request.getDepartId());
List<OrganizeProblemRankVo> bwzdRepeatRankList = dataPetitionComplaintMapper.getSubMailRank(beginTime, endTime, null, RepeatEnum.REPEAT_MAIL.getId(), request.getDepartId());
// 汇总(派出所)
MailFirstAndRepeatOverviewVo fxsjOverview = new MailFirstAndRepeatOverviewVo();
fxsjOverview.setFirstMail(fxsjFirstRankList.stream().mapToInt(OrganizeProblemRankVo::getValueAsInt).sum());
fxsjOverview.setRepeatMail(fxsjRepeatRankList.stream().mapToInt(OrganizeProblemRankVo::getValueAsInt).sum());
fxsjOverview.setLeaderMail(0);
// 汇总(大队)
MailFirstAndRepeatOverviewVo bwzdOverview = new MailFirstAndRepeatOverviewVo();
bwzdOverview.setFirstMail(bwzdFirstRankList.stream().mapToInt(OrganizeProblemRankVo::getValueAsInt).sum());
bwzdOverview.setRepeatMail(bwzdRepeatRankList.stream().mapToInt(OrganizeProblemRankVo::getValueAsInt).sum());
bwzdOverview.setLeaderMail(0);
JSONObject data = new JSONObject()
.fluentPut("fxsjOverview", fxsjOverview)
.fluentPut("bwzdOverview", bwzdOverview)
.fluentPut("fxsjFirstRankList", fxsjFirstRankList)
.fluentPut("fxsjRepeatRankList", fxsjRepeatRankList)
.fluentPut("bwzdFirstRankList", bwzdFirstRankList)
.fluentPut("bwzdRepeatRankList", bwzdRepeatRankList);
// return getSubOneFirstAndRepeatMail();
return Result.success(data);
}
@Override
public Result<JSONObject> getSubOneAllMailCount(SubDataVRequest request) {
MailOverviewVo overview = new MailOverviewVo();
Date beginTime = request.getBeginTime();
Date endTime = request.getEndTime();
String departId = request.getDepartId();
// 国家信访
Long countryTotal = dataPetitionComplaintMapper.selectMailBySourceCode(beginTime, endTime, GJXFPT.getValue(), departId);
// 公安信访
Long policeTotal = dataPetitionComplaintMapper.selectMailBySourceCode(beginTime, endTime, GABXF.getValue(), departId);
// 12337
Long numTotal = dataPetition12337Service.count(new LambdaQueryWrapper<DataPetition12337>().between(DataPetition12337::getDiscoverTime, beginTime, endTime).eq(DataPetition12337::getSecondDepartId,departId));
// 局长信箱
QueryWrapper<Mail> subOneMailQueryWrapper = new QueryWrapper<>();
String exDepartId = supExternalDepartMapper.getExIdByInId(departId.toString(), "局长信箱");
subOneMailQueryWrapper.ne("mail_state", VALID_SIGN);
subOneMailQueryWrapper.eq("second_dept_id", exDepartId);
subOneMailQueryWrapper.between("create_time", beginTime, endTime);
Long commissionerTotal = mailMapper.selectCount(subOneMailQueryWrapper);
// 总数
Long total = countryTotal + policeTotal + numTotal;
//国家信访
overview.setCountryMail(countryTotal);
//公安部信访
overview.setPoliceMail(policeTotal);
//局长信箱
overview.setManageMail(commissionerTotal);
//12337信访
overview.setNumberMail(numTotal);
overview.setTotalMail(total);
// overview.setCountryMail(120L); // 国家信访
// overview.setPoliceMail(45L); // 公安部信访
// overview.setNumberMail(30L); // 12337
// overview.setManageMail(20L); // 局长信箱
// overview.setTotalMail(120L + 45L + 30L);
JSONObject data = new JSONObject().fluentPut("overview", overview);
return Result.success(data);
}
@Override
public Result<JSONObject> getSubOneEntanglementAndMassMail(SubDataVRequest request) {
Date beginTime = request.getBeginTime();
Date endTime = request.getEndTime();
String departId = request.getDepartId();
// 分县市局
List<OrganizeProblemRankVo> fxsjMassMailList = dataPetitionComplaintMapper.getSubOneMassMailRank(beginTime, endTime, 10, departId);
List<OrganizeProblemRankVo> fxsjLeaderReviewMailList = dataPetitionComplaintMapper.getSubOneMailLeaderRank(beginTime, endTime, 10, departId);
// 局属单位
List<OrganizeProblemRankVo> bwzdMassMailList = dataPetitionComplaintMapper.getSubOneMassMailRank(beginTime, endTime, null, departId);
List<OrganizeProblemRankVo> bwzdLeaderReviewMailList = dataPetitionComplaintMapper.getMailLeaderRank(beginTime, endTime, 4);
// 汇总(分县市局)
MailEntanglementMassOverviewVo fxsjOverview = new MailEntanglementMassOverviewVo();
fxsjOverview.setEntanglement(0);
fxsjOverview.setMass(fxsjMassMailList.stream().mapToInt(OrganizeProblemRankVo::getValueAsInt).sum());
fxsjOverview.setLeaderReview(fxsjLeaderReviewMailList.stream().mapToInt(OrganizeProblemRankVo::getValueAsInt).sum());
// 汇总(局属单位)
MailEntanglementMassOverviewVo bwzdOverview = new MailEntanglementMassOverviewVo();
bwzdOverview.setEntanglement(0);
bwzdOverview.setMass(bwzdMassMailList.stream().mapToInt(OrganizeProblemRankVo::getValueAsInt).sum());
bwzdOverview.setLeaderReview(bwzdLeaderReviewMailList.stream().mapToInt(OrganizeProblemRankVo::getValueAsInt).sum());
JSONObject data = new JSONObject()
.fluentPut("fxsjOverview", fxsjOverview)
.fluentPut("bwzdOverview", bwzdOverview)
.fluentPut("fxsjMassMailList", fxsjMassMailList)
.fluentPut("bwzdMassMailList", bwzdMassMailList)
.fluentPut("fxsjLeaderReviewMailList", fxsjLeaderReviewMailList)
.fluentPut("bwzdLeaderReviewMailList", bwzdLeaderReviewMailList);
// return mockSubOneEntanglementAndMassMail();
return Result.success(data);
}
@Override
public Result<JSONObject> getSubOneMailMapIcon(SubDataVRequest request) {
List<MailMapIconVo> res = new ArrayList<>();
String departId = request.getDepartId();
Date beginTime = request.getBeginTime();
Date endTime = request.getEndTime();
// 查该区县局下属所有派出所
List<SupDepart> policeDeparts = supDepartMapper.selectPoliceDeparts(Integer.valueOf(departId));
for (SupDepart supDepart : policeDeparts) {
MailMapIconVo mapIconVo = new MailMapIconVo();
mapIconVo.setName(supDepart.getShortName());
mapIconVo.setDepartId(supDepart.getId());
res.add(mapIconVo);
}
// 查询国家信访和公安部信访数据
for (MailMapIconVo re : res) {
String policeDepartId = re.getDepartId();
// 国家
Long countryTotal = dataPetitionComplaintMapper.selectPoliceMailBySourceCode(beginTime, endTime, GJXFPT.getValue(), policeDepartId);
// 公安
Long policeTotal = dataPetitionComplaintMapper.selectPoliceMailBySourceCode(beginTime, endTime, GABXF.getValue(), policeDepartId);
// 12337 数据
LambdaQueryWrapper<DataPetition12337> dataPetition12337LambdaQueryWrapper = new LambdaQueryWrapper<>();
dataPetition12337LambdaQueryWrapper.between(DataPetition12337::getDiscoverTime, beginTime, endTime);
dataPetition12337LambdaQueryWrapper.eq(DataPetition12337::getThirdDepartId, re.getDepartId());
Long numTotal = dataPetition12337Service.count(dataPetition12337LambdaQueryWrapper);
// 局长信箱
String exDepartId = supExternalDepartMapper.getExIdByInId(policeDepartId, EX_SOURCE);
Long manageMail = 0L;
if (exDepartId != null) {
QueryWrapper<Mail> qw = new QueryWrapper<>();
qw.ne("mail_state", VALID_SIGN);
qw.eq("three_dept_id", exDepartId);
qw.between("create_time", beginTime, endTime);
manageMail = mailMapper.selectCount(qw);
}
long country = countryTotal == null ? 0L : countryTotal;
long police = policeTotal == null ? 0L : policeTotal;
long num = numTotal == null ? 0L : numTotal;
long manage = manageMail == null ? 0L : manageMail;
Long total = country + police + num ;
re.setCountryTotal(String.valueOf(country));
re.setPoliceTotal(String.valueOf(police));
re.setCommissionerTotal(String.valueOf(manage));
re.setNumTotal(String.valueOf(num));
re.setTotal(total.toString());
}
JSONObject data = new JSONObject().fluentPut("mailMapIconList", res);
// return getSubOneMailMapIcon();
return Result.success(data);
}
public Result<JSONObject> getSubOneMailMapIcon() {
// ✅ 注意:这里的 name 必须和地图 geojson 区域名一致(一般是“xx街道/园区”)
// departId 仍然放派出所 dept_id,用于你点击打开弹窗时传参
List<MailMapIconVo> list = new ArrayList<>();
// 东屯渡街道 -> 东屯渡派出所(2990)
MailMapIconVo a = new MailMapIconVo();
a.setName("东屯渡街道");
a.setDepartId("2990");
a.setCountryTotal("32");
a.setPoliceTotal("18");
a.setCommissionerTotal("6");
a.setNumTotal("9");
a.setTotal(String.valueOf(32 + 18 + 9)); // total 不含 commissionerTotal
list.add(a);
// 定王台街道 -> 定王台派出所(1245)
MailMapIconVo b = new MailMapIconVo();
b.setName("定王台街道");
b.setDepartId("1245");
b.setCountryTotal("21");
b.setPoliceTotal("10");
b.setCommissionerTotal("4");
b.setNumTotal("7");
b.setTotal(String.valueOf(21 + 10 + 7));
list.add(b);
// 火星街道 -> 火星派出所(2985)
MailMapIconVo c = new MailMapIconVo();
c.setName("火星街道");
c.setDepartId("2985");
c.setCountryTotal("45");
c.setPoliceTotal("24");
c.setCommissionerTotal("9");
c.setNumTotal("14");
c.setTotal(String.valueOf(45 + 24 + 14));
list.add(c);
// 五里牌街道 -> 五里牌派出所(2971)
MailMapIconVo d = new MailMapIconVo();
d.setName("五里牌街道");
d.setDepartId("2971");
d.setCountryTotal("16");
d.setPoliceTotal("9");
d.setCommissionerTotal("3");
d.setNumTotal("5");
d.setTotal(String.valueOf(16 + 9 + 5));
list.add(d);
// 荷花园街道 -> 荷花园派出所(1247)
MailMapIconVo e = new MailMapIconVo();
e.setName("荷花园街道");
e.setDepartId("1247");
e.setCountryTotal("38");
e.setPoliceTotal("20");
e.setCommissionerTotal("7");
e.setNumTotal("11");
e.setTotal(String.valueOf(38 + 20 + 11));
list.add(e);
// 文艺路街道 -> 文艺路派出所(2946)
MailMapIconVo f = new MailMapIconVo();
f.setName("文艺路街道");
f.setDepartId("2946");
f.setCountryTotal("12");
f.setPoliceTotal("6");
f.setCommissionerTotal("2");
f.setNumTotal("3");
f.setTotal(String.valueOf(12 + 6 + 3));
list.add(f);
// 朝阳街街道 -> 朝阳街派出所(2960) (你表里就是“朝阳街街道”)
MailMapIconVo g = new MailMapIconVo();
g.setName("朝阳街街道");
g.setDepartId("2960");
g.setCountryTotal("27");
g.setPoliceTotal("13");
g.setCommissionerTotal("5");
g.setNumTotal("8");
g.setTotal(String.valueOf(27 + 13 + 8));
list.add(g);
// 韭菜园街道 -> 韭菜园派出所(2940)
MailMapIconVo h = new MailMapIconVo();
h.setName("韭菜园街道");
h.setDepartId("2940");
h.setCountryTotal("19");
h.setPoliceTotal("7");
h.setCommissionerTotal("3");
h.setNumTotal("6");
h.setTotal(String.valueOf(19 + 7 + 6));
list.add(h);
// 隆平高科技园 -> (dept_id=2898)
MailMapIconVo i = new MailMapIconVo();
i.setName("隆平高科技园");
i.setDepartId("2898");
i.setCountryTotal("8");
i.setPoliceTotal("4");
i.setCommissionerTotal("1");
i.setNumTotal("2");
i.setTotal(String.valueOf(8 + 4 + 2));
list.add(i);
// 马王堆街道 -> 马王堆派出所(3003)
MailMapIconVo j = new MailMapIconVo();
j.setName("马王堆街道");
j.setDepartId("3003");
j.setCountryTotal("33");
j.setPoliceTotal("15");
j.setCommissionerTotal("6");
j.setNumTotal("10");
j.setTotal(String.valueOf(33 + 15 + 10));
list.add(j);
// 马坡岭街道 -> 马坡岭派出所(3019)
MailMapIconVo k = new MailMapIconVo();
k.setName("马坡岭街道");
k.setDepartId("3019");
k.setCountryTotal("14");
k.setPoliceTotal("5");
k.setCommissionerTotal("2");
k.setNumTotal("4");
k.setTotal(String.valueOf(14 + 5 + 4));
list.add(k);
// 湘湖街道 -> 湘湖派出所(1246)
MailMapIconVo l = new MailMapIconVo();
l.setName("湘湖街道");
l.setDepartId("1246");
l.setCountryTotal("26");
l.setPoliceTotal("12");
l.setCommissionerTotal("4");
l.setNumTotal("7");
l.setTotal(String.valueOf(26 + 12 + 7));
list.add(l);
// 东岸街道 -> 东岸派出所(1248)
MailMapIconVo m = new MailMapIconVo();
m.setName("东岸街道");
m.setDepartId("1248");
m.setCountryTotal("11");
m.setPoliceTotal("4");
m.setCommissionerTotal("1");
m.setNumTotal("3");
m.setTotal(String.valueOf(11 + 4 + 3));
list.add(m);
// 东湖街道 -> 东湖派出所(3038)
MailMapIconVo n = new MailMapIconVo();
n.setName("东湖街道");
n.setDepartId("3038");
n.setCountryTotal("29");
n.setPoliceTotal("16");
n.setCommissionerTotal("5");
n.setNumTotal("9");
n.setTotal(String.valueOf(29 + 16 + 9));
list.add(n);
JSONObject data = new JSONObject().fluentPut("mailMapIconList", list);
return Result.success(data);
}
public Result<JSONObject> mockSubOneEntanglementAndMassMail() {
// ===== 分县市局 - 群体集访 =====
List<OrganizeProblemRankVo> fxsjMassMailList = new ArrayList<>();
OrganizeProblemRankVo v1 = new OrganizeProblemRankVo(); v1.setLabel("浏阳市局"); v1.setValue("126"); fxsjMassMailList.add(v1);
OrganizeProblemRankVo v2 = new OrganizeProblemRankVo(); v2.setLabel("宁乡市局"); v2.setValue("98"); fxsjMassMailList.add(v2);
OrganizeProblemRankVo v3 = new OrganizeProblemRankVo(); v3.setLabel("长沙县局"); v3.setValue("86"); fxsjMassMailList.add(v3);
OrganizeProblemRankVo v4 = new OrganizeProblemRankVo(); v4.setLabel("望城区局"); v4.setValue("74"); fxsjMassMailList.add(v4);
OrganizeProblemRankVo v5 = new OrganizeProblemRankVo(); v5.setLabel("岳麓分局"); v5.setValue("63"); fxsjMassMailList.add(v5);
// ===== 分县市局 - 领导接访 =====
List<OrganizeProblemRankVo> fxsjLeaderReviewMailList = new ArrayList<>();
OrganizeProblemRankVo v6 = new OrganizeProblemRankVo(); v6.setLabel("浏阳市局"); v6.setValue("34"); fxsjLeaderReviewMailList.add(v6);
OrganizeProblemRankVo v7 = new OrganizeProblemRankVo(); v7.setLabel("宁乡市局"); v7.setValue("28"); fxsjLeaderReviewMailList.add(v7);
OrganizeProblemRankVo v8 = new OrganizeProblemRankVo(); v8.setLabel("长沙县局"); v8.setValue("25"); fxsjLeaderReviewMailList.add(v8);
OrganizeProblemRankVo v9 = new OrganizeProblemRankVo(); v9.setLabel("望城区局"); v9.setValue("19"); fxsjLeaderReviewMailList.add(v9);
OrganizeProblemRankVo v10 = new OrganizeProblemRankVo(); v10.setLabel("岳麓分局"); v10.setValue("16"); fxsjLeaderReviewMailList.add(v10);
// ===== 局属单位 - 群体集访 =====
List<OrganizeProblemRankVo> bwzdMassMailList = new ArrayList<>();
OrganizeProblemRankVo b1 = new OrganizeProblemRankVo(); b1.setLabel("治安支队"); b1.setValue("47"); bwzdMassMailList.add(b1);
OrganizeProblemRankVo b2 = new OrganizeProblemRankVo(); b2.setLabel("刑侦支队"); b2.setValue("39"); bwzdMassMailList.add(b2);
OrganizeProblemRankVo b3 = new OrganizeProblemRankVo(); b3.setLabel("交警支队"); b3.setValue("33"); bwzdMassMailList.add(b3);
OrganizeProblemRankVo b4 = new OrganizeProblemRankVo(); b4.setLabel("网安支队"); b4.setValue("28"); bwzdMassMailList.add(b4);
// ===== 局属单位 - 领导接访 =====
List<OrganizeProblemRankVo> bwzdLeaderReviewMailList = new ArrayList<>();
OrganizeProblemRankVo b5 = new OrganizeProblemRankVo(); b5.setLabel("治安支队"); b5.setValue("14"); bwzdLeaderReviewMailList.add(b5);
OrganizeProblemRankVo b6 = new OrganizeProblemRankVo(); b6.setLabel("刑侦支队"); b6.setValue("11"); bwzdLeaderReviewMailList.add(b6);
OrganizeProblemRankVo b7 = new OrganizeProblemRankVo(); b7.setLabel("交警支队"); b7.setValue("9"); bwzdLeaderReviewMailList.add(b7);
OrganizeProblemRankVo b8 = new OrganizeProblemRankVo(); b8.setLabel("网安支队"); b8.setValue("6"); bwzdLeaderReviewMailList.add(b8);
// ===== 汇总(分县市局)=====
MailEntanglementMassOverviewVo fxsjOverview = new MailEntanglementMassOverviewVo();
fxsjOverview.setEntanglement(0);
fxsjOverview.setMass(fxsjMassMailList.stream().mapToInt(OrganizeProblemRankVo::getValueAsInt).sum());
fxsjOverview.setLeaderReview(fxsjLeaderReviewMailList.stream().mapToInt(OrganizeProblemRankVo::getValueAsInt).sum());
// ===== 汇总(局属单位)=====
MailEntanglementMassOverviewVo bwzdOverview = new MailEntanglementMassOverviewVo();
bwzdOverview.setEntanglement(0);
bwzdOverview.setMass(bwzdMassMailList.stream().mapToInt(OrganizeProblemRankVo::getValueAsInt).sum());
bwzdOverview.setLeaderReview(bwzdLeaderReviewMailList.stream().mapToInt(OrganizeProblemRankVo::getValueAsInt).sum());
JSONObject data = new JSONObject()
.fluentPut("fxsjOverview", fxsjOverview)
.fluentPut("bwzdOverview", bwzdOverview)
.fluentPut("fxsjMassMailList", fxsjMassMailList)
.fluentPut("bwzdMassMailList", bwzdMassMailList)
.fluentPut("fxsjLeaderReviewMailList", fxsjLeaderReviewMailList)
.fluentPut("bwzdLeaderReviewMailList", bwzdLeaderReviewMailList);
return Result.success(data);
}
public Result<JSONObject> getSubOneFirstAndRepeatMail() {
// 派出所 mock
List<OrganizeProblemRankVo> fxsjFirstRankList = new ArrayList<>();
List<OrganizeProblemRankVo> fxsjRepeatRankList = new ArrayList<>();
fxsjFirstRankList.add(new OrganizeProblemRankVo("芙蓉派出所", "15"));
fxsjFirstRankList.add(new OrganizeProblemRankVo("天心派出所", "12"));
fxsjFirstRankList.add(new OrganizeProblemRankVo("雨花派出所", "9"));
fxsjFirstRankList.add(new OrganizeProblemRankVo("开福派出所", "7"));
fxsjRepeatRankList.add(new OrganizeProblemRankVo("芙蓉派出所", "6"));
fxsjRepeatRankList.add(new OrganizeProblemRankVo("天心派出所", "5"));
fxsjRepeatRankList.add(new OrganizeProblemRankVo("雨花派出所", "3"));
fxsjRepeatRankList.add(new OrganizeProblemRankVo("开福派出所", "2"));
// 大队 mock
List<OrganizeProblemRankVo> bwzdFirstRankList = new ArrayList<>();
List<OrganizeProblemRankVo> bwzdRepeatRankList = new ArrayList<>();
bwzdFirstRankList.add(new OrganizeProblemRankVo("刑侦大队", "22"));
bwzdFirstRankList.add(new OrganizeProblemRankVo("治安大队", "18"));
bwzdFirstRankList.add(new OrganizeProblemRankVo("交警大队", "13"));
bwzdRepeatRankList.add(new OrganizeProblemRankVo("刑侦大队", "8"));
bwzdRepeatRankList.add(new OrganizeProblemRankVo("治安大队", "6"));
bwzdRepeatRankList.add(new OrganizeProblemRankVo("交警大队", "4"));
// 汇总(派出所)
MailFirstAndRepeatOverviewVo fxsjOverview = new MailFirstAndRepeatOverviewVo();
fxsjOverview.setFirstMail(
fxsjFirstRankList.stream().mapToInt(OrganizeProblemRankVo::getValueAsInt).sum()
);
fxsjOverview.setRepeatMail(
fxsjRepeatRankList.stream().mapToInt(OrganizeProblemRankVo::getValueAsInt).sum()
);
fxsjOverview.setLeaderMail(0);
// 汇总(大队)
MailFirstAndRepeatOverviewVo bwzdOverview = new MailFirstAndRepeatOverviewVo();
bwzdOverview.setFirstMail(
bwzdFirstRankList.stream().mapToInt(OrganizeProblemRankVo::getValueAsInt).sum()
);
bwzdOverview.setRepeatMail(
bwzdRepeatRankList.stream().mapToInt(OrganizeProblemRankVo::getValueAsInt).sum()
);
bwzdOverview.setLeaderMail(0);
JSONObject data = new JSONObject()
.fluentPut("fxsjOverview", fxsjOverview)
.fluentPut("bwzdOverview", bwzdOverview)
.fluentPut("fxsjFirstRankList", fxsjFirstRankList)
.fluentPut("fxsjRepeatRankList", fxsjRepeatRankList)
.fluentPut("bwzdFirstRankList", bwzdFirstRankList)
.fluentPut("bwzdRepeatRankList", bwzdRepeatRankList);
return Result.success(data);
}
}

73
src/main/resources/mapper/DataPetitionComplaintMapper.xml

@ -22,4 +22,77 @@
${ew.getCustomSqlSegment}
</select>
<select id="getSubMailRank" resultType="com.biutag.supervision.pojo.vo.OrganizeProblemRankVo">
SELECT
sd.short_name AS label,
COUNT(*) AS value
FROM data_petition_complaint dpc
LEFT JOIN sup_depart sd ON dpc.third_depart_id = sd.id
WHERE dpc.create_time <![CDATA[>=]]> #{beginTime}
AND dpc.create_time <![CDATA[<=]]> #{endTime}
AND dpc.initial_petition = #{repeat}
<choose>
<when test="groupId != null">
AND sd.statistics_group_id = #{groupId}
</when>
<otherwise>
AND sd.statistics_group_id != 10
</otherwise>
</choose>
AND dpc.problem_sources_code IN (21,22)
AND sd.pid = #{departId}
AND sd.short_name IS NOT NULL
GROUP BY sd.short_name
ORDER BY value DESC
</select>
<select id="getSubOneMassMailRank" resultType="com.biutag.supervision.pojo.vo.OrganizeProblemRankVo">
SELECT
sd.short_name AS label,
COUNT(*) AS `value`
FROM data_petition_complaint dpc
LEFT JOIN sup_depart sd ON dpc.third_depart_id = sd.id
WHERE dpc.create_time <![CDATA[>=]]> #{beginTime}
AND dpc.create_time <![CDATA[<=]]> #{endTime}
AND dpc.mass_visits = '1'
<choose>
<when test="groupId != null">
AND sd.statistics_group_id = #{groupId}
</when>
<otherwise>
AND sd.statistics_group_id != 10
</otherwise>
</choose>
AND dpc.problem_sources_code IN (21, 22)
AND sd.pid = #{departId}
GROUP BY sd.short_name
HAVING sd.short_name IS NOT NULL
ORDER BY `value` DESC
</select>
<select id="getSubOneMailLeaderRank" resultType="com.biutag.supervision.pojo.vo.OrganizeProblemRankVo">
SELECT
sd.short_name AS label,
COUNT(*) AS `value`
FROM data_petition_complaint dpc
LEFT JOIN sup_depart sd ON dpc.third_depart_id = sd.id
WHERE dpc.create_time <![CDATA[>=]]> #{beginTime}
AND dpc.create_time <![CDATA[<=]]> #{endTime}
AND dpc.receiving_leader_name IS NOT NULL
<choose>
<when test="groupId != null">
AND sd.statistics_group_id = #{groupId}
</when>
<otherwise>
AND sd.statistics_group_id != 10
</otherwise>
</choose>
AND dpc.problem_sources_code IN (21, 22)
AND sd.pid = #{departId}
AND sd.short_name IS NOT NULL
GROUP BY sd.short_name
ORDER BY `value` DESC
</select>
</mapper>

Loading…
Cancel
Save