Browse Source

日常督察情况

main
parent
commit
cbe2a61dd8
  1. 2
      src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java
  2. 145
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  3. 4
      src/main/java/com/biutag/supervision/mapper/NegativeProblemRelationMapper.java
  4. 2
      src/main/java/com/biutag/supervision/pojo/vo/RankVo.java
  5. 33
      src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java

2
src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java

@ -63,7 +63,7 @@ public class DataGobalController {
// 问题类型占比
List<EchartsVo> wtlxlist = dataGobalService.getProblemRate(beginTime, endTime);
// 查所有的市局
// 地图数据
List<GobalMapIconVo> gobalTempMapVoList = dataGobalService.getMapIconInfo(beginTime, endTime);
if ( gobalTempMapVoList==null || gobalTempMapVoList.size() == 0) {
gobalTempMapVoList = new ArrayList<>();

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

@ -45,6 +45,63 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"GROUP BY monthTime " +
"order BY monthTime asc")
List<RecentTrendByMonthVo> selectRecentTrendByMonth(String year);
@Select("SELECT count(*) FROM negative ng INNER JOIN " +
" (" +
" SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " +
" INNER join sup_depart sd1 on sd.pid=sd1.id " +
" and sd1.LEVEL=2 AND sd1.statistics_group_id=3" +
" ) " +
"as temp on ng.involveDepartId=temp.id " +
"AND ng.checkStatus<>3 AND problemSourcesCode in (13, 15, 16) " +
"AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer seleGobalMapIconInfoDc(Date beginTime, Date endTime, Integer departId);
@Select("SELECT count(*) FROM negative ng INNER JOIN " +
" (" +
" SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " +
" INNER join sup_depart sd1 on sd.pid=sd1.id " +
" and sd1.LEVEL=2 AND sd1.statistics_group_id=3" +
" ) " +
"as temp on ng.involveDepartId=temp.id " +
"AND ng.checkStatus<>3 AND problemSourcesCode=11 " +
"AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer seleGobalMapIconInfoAjhc(Date beginTime, Date endTime, Integer departId);
@Select("SELECT count(*) FROM negative ng INNER JOIN " +
" (" +
" SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " +
" INNER join sup_depart sd1 on sd.pid=sd1.id " +
" and sd1.LEVEL=2 AND sd1.statistics_group_id =3 " +
" ) " +
"as temp on ng.involveDepartId=temp.id " +
"AND ng.checkStatus<>3 AND problemSourcesCode in (21, 22, 23, 24, 25) " +
"AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer seleGobalMapIconInfoXf(Date beginTime, Date endTime, Integer departId);
@Select("SELECT count(*) FROM negative ng INNER JOIN " +
" (" +
" SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " +
" INNER join sup_depart sd1 on sd.pid=sd1.id " +
" and sd1.LEVEL=2 AND sd1.statistics_group_id =3 " +
" ) " +
"as temp on ng.involveDepartId=temp.id " +
"AND ng.checkStatus<>3 AND problemSourcesCode=2 " +
"AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer seleGobalMapIconInfoJwpy(Date beginTime, Date endTime, Integer departId);
@Select("SELECT count(*) FROM negative ng INNER JOIN " +
" (" +
" SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " +
" INNER join sup_depart sd1 on sd.pid=sd1.id " +
" and sd1.LEVEL=2 AND sd1.statistics_group_id =3 " +
" ) " +
"as temp on ng.involveDepartId=temp.id " +
"AND ng.checkStatus<>3 AND problemSourcesCode=26 " +
"AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer seleGobalMapIconInfoSjdc(Date beginTime, Date endTime, Integer departId);
// endregion
@ -92,20 +149,6 @@ public interface NegativeMapper extends BaseMapper<Negative> {
Long selectRelationOrgCount(Date beginTime, Date endTime, String checkStatus);
/**
* 获取现场督察按二级机构分组划分的问题数
*/
@Select("SELECT COUNT(*) FROM negative n " +
"INNER JOIN ( " +
" SELECT DISTINCT sd.id " +
" FROM sup_depart sd " +
" INNER JOIN sup_depart sd1 ON sd.pid = sd1.id " +
" WHERE sd1.statistics_group_id = #{groupType}" +
") AS filtered_sd ON n.involveDepartId = filtered_sd.id " +
"WHERE n.checkStatus = 1 " +
"AND n.problemSourcesCode = 15 " +
"AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Long getCountByGroupType(Integer groupType, Date beginTime, Date endTime);
@ -120,68 +163,38 @@ public interface NegativeMapper extends BaseMapper<Negative> {
" WHERE sd1.statistics_group_id = #{groupType}" +
") AS filtered_sd ON n.involveDepartId = filtered_sd.id " +
"WHERE n.checkStatus = 1 " +
"AND n.problemSourcesCode = 15 " +
"AND n.problemSourcesCode = 13 " +
"AND n.isRectifyCode=#{isRectify} " +
"AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Long getChangCountByGroupType(Integer groupType, Date beginTime, Date endTime, Integer isRectify);
@Select("SELECT count(*) FROM negative ng INNER JOIN " +
" (" +
" SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " +
" INNER join sup_depart sd1 on sd.pid=sd1.id " +
" and sd1.LEVEL=2 AND sd1.statistics_group_id=3" +
" ) " +
"as temp on ng.involveDepartId=temp.id " +
"AND ng.checkStatus<>3 AND problemSourcesCode in (13, 15, 16) " +
"AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer seleGobalMapIconInfoDc(Date beginTime, Date endTime, Integer departId);
@Select("SELECT count(*) FROM negative ng INNER JOIN " +
" (" +
" SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " +
" INNER join sup_depart sd1 on sd.pid=sd1.id " +
" and sd1.LEVEL=2 AND sd1.statistics_group_id=3" +
" ) " +
"as temp on ng.involveDepartId=temp.id " +
"AND ng.checkStatus<>3 AND problemSourcesCode=11 " +
"AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer seleGobalMapIconInfoAjhc(Date beginTime, Date endTime, Integer departId);
@Select("SELECT count(*) FROM negative ng INNER JOIN " +
" (" +
" SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " +
" INNER join sup_depart sd1 on sd.pid=sd1.id " +
" and sd1.LEVEL=2 AND sd1.statistics_group_id =3 " +
" ) " +
"as temp on ng.involveDepartId=temp.id " +
"AND ng.checkStatus<>3 AND problemSourcesCode in (21, 22, 23, 24, 25) " +
"AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer seleGobalMapIconInfoXf(Date beginTime, Date endTime, Integer departId);
@Select("SELECT count(*) FROM negative ng INNER JOIN " +
" (" +
" SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " +
" INNER join sup_depart sd1 on sd.pid=sd1.id " +
" and sd1.LEVEL=2 AND sd1.statistics_group_id =3 " +
" ) " +
"as temp on ng.involveDepartId=temp.id " +
"AND ng.checkStatus<>3 AND problemSourcesCode=2 " +
"AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer seleGobalMapIconInfoJwpy(Date beginTime, Date endTime, Integer departId);
"(SELECT sd.id, sd.pid, sd.`name`, sd1.short_name FROM sup_depart sd INNER JOIN sup_depart sd1 " +
"ON sd.pid = sd1.id AND sd1.`level`=2 AND sd1.statistics_group_id=3) as temp " +
"ON ng.involveDepartId=temp.id " +
"AND pid=#{departId} " +
"AND problemSourcesCode= 13 " +
"AND checkStatus <> 3 " +
"AND isRectifyCode =1 " +
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Long getChangedCountByGroupType(Date beginTime, Date endTime, String departId);
@Select("SELECT count(*) FROM negative ng INNER JOIN " +
"(SELECT sd.id, sd.pid, sd.`name`, sd1.short_name FROM sup_depart sd INNER JOIN sup_depart sd1 " +
"ON sd.pid = sd1.id AND sd1.`level`=2 AND sd1.statistics_group_id=3) as temp\n" +
"ON ng.involveDepartId=temp.id " +
"AND pid=#{departId} " +
"AND problemSourcesCode= 13 " +
"AND isRectifyCode =1 " +
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Long getCountByGroupType(Date beginTime, Date endTime, String departId);
@Select("SELECT count(*) FROM negative ng INNER JOIN " +
" (" +
" SELECT sd.id, sd.pid, sd.name, sd1.short_name FROM sup_depart sd " +
" INNER join sup_depart sd1 on sd.pid=sd1.id " +
" and sd1.LEVEL=2 AND sd1.statistics_group_id =3 " +
" ) " +
"as temp on ng.involveDepartId=temp.id " +
"AND ng.checkStatus<>3 AND problemSourcesCode=26 " +
"AND temp.pid=#{departId} AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Integer seleGobalMapIconInfoSjdc(Date beginTime, Date endTime, Integer departId);
@Select("select id from negative where discovury_time between #{beginTime} and #{endTime}")
List<Long> selectNegativeIdsByTime(Date beginTime, Date endTime);
// endregion
}

4
src/main/java/com/biutag/supervision/mapper/NegativeProblemRelationMapper.java

@ -19,7 +19,7 @@ public interface NegativeProblemRelationMapper extends BaseMapper<NegativeProble
* @param endTime
* @return
*/
@Select("SELECT npr.oneLevelContent, count(*) `value` FROM negative_problem_relation npr INNER JOIN " +
@Select("SELECT npr.oneLevelContent as name, count(*) `value` FROM negative_problem_relation npr INNER JOIN " +
" ( " +
" SELECT id FROM negative ng " +
" WHERE checkStatus <>3 " +
@ -37,7 +37,7 @@ public interface NegativeProblemRelationMapper extends BaseMapper<NegativeProble
* @param endTime
* @return
*/
@Select("SELECT npr.threeLevelContent as labe, count(*) `value` FROM negative_problem_relation npr INNER JOIN " +
@Select("SELECT npr.threeLevelContent as label, count(*) `value` FROM negative_problem_relation npr INNER JOIN " +
" ( " +
" SELECT id FROM negative ng " +
" WHERE checkStatus <>3 " +

2
src/main/java/com/biutag/supervision/pojo/vo/RankVo.java

@ -12,7 +12,7 @@ public class RankVo {
private String label; // 部门名称
private String departId; // 部门id
private Integer value; // 数量
private Double value; // 整改率
private Double rate; // 整改率
private String numerator; // 分子 已整改
private String denominator; // 分母 问题数

33
src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java

@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author 舒云
@ -101,10 +102,9 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
* @return
*/
public JSONObject getDailySupervisionCount(Integer groupType, Date beginTime, Date endTime) {
Long proTotal = negativeMapper.getCountByGroupType(groupType, beginTime, endTime);
Long changing = negativeMapper.getChangCountByGroupType(groupType, beginTime, endTime, 0);
Long changed = negativeMapper.getChangCountByGroupType(groupType, beginTime, endTime, 1);
Long proTotal = changed + changing;
// 整改率
double correctionRate = proTotal != 0 ? (changed * 1.0 / proTotal) * 100 : 0;
JSONObject res = new JSONObject()
@ -117,25 +117,40 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
/**
* 获取日常督察整改率排名
*
* @param groupType
* @param beginTime
* @param endTime
* @return
*/
public List<RankVo> getChangedRateRank(Integer groupType, Date beginTime, Date endTime) {
List<RankVo> rankVos = new ArrayList<>();
// 所有部门
List<RankVo> rankVoRes = new ArrayList<>();
// 所有分局部门
List<SupDepart> departs = supDepartMapper.selectDepartsByGroupType(groupType);
for (SupDepart depart : departs) {
RankVo rankVo = new RankVo();
rankVo.setLabel(depart.getShortName());
rankVo.setDepartId(depart.getId());
rankVoRes.add(rankVo);
}
return null;
for (RankVo rankVoRe : rankVoRes) {
String departId = rankVoRe.getDepartId();
Long changed = negativeMapper.getChangedCountByGroupType(beginTime, endTime, departId);
Long totalPro = negativeMapper.getCountByGroupType(beginTime, endTime, departId);
totalPro = totalPro == null ? 0L : totalPro;
changed = changed == null ? 0L : changed;
rankVoRe.setDenominator(totalPro.toString());
rankVoRe.setNumerator(changed.toString());
Double rate = totalPro != 0 ? (changed * 1.0 / totalPro) * 100 : 0;
rankVoRe.setDenominator(totalPro.toString());
rankVoRe.setNumerator(changed.toString());
rankVoRe.setRate(rate);
rankVoRe.setValue(rate);
}
// 使用 Stream API 进行排序
rankVoRes = rankVoRes.stream().sorted((o1, o2) -> o2.getRate().compareTo(o1.getRate())).collect(Collectors.toList());
// 排序
return rankVoRes;
}
}

Loading…
Cancel
Save