Browse Source

现场督察大屏2024/11/17 10:24 现场督察大屏后端

main
parent
commit
5e06403f9e
  1. 36
      src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java
  2. 6
      src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java
  3. 48
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  4. 4
      src/main/java/com/biutag/supervision/pojo/vo/RankVo.java
  5. 14
      src/main/java/com/biutag/supervision/pojo/vo/RankVoSup.java
  6. 12
      src/main/java/com/biutag/supervision/pojo/vo/RankVoSupTwo.java
  7. 95
      src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java

36
src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java

@ -49,14 +49,14 @@ public class SupervisionNotifyController {
List<EchartsVo> wtlxList = dataSupervisionNotifyService.getProblemTypeRatio(beginTime, endTime);
//地图数据
List<SuperviseMapIconVo> superviseTempMapVoList = dataSupervisionNotifyService.getsupervisionMapIconInfo(beginTime, endTime);
List<SuperviseMapIconVo> superviseTempMapVoList = dataSupervisionNotifyService.getsupervisionMapIconInfo(beginTime, endTime);
// 黄赌毒总览
List<RankVo> hddzlList = dataSupervisionNotifyService.getYellowBet(beginTime, endTime);
// List<RankVo> hddzlList = dataSupervisionNotifyService.getYellowBet(beginTime, endTime);
// 黄毒赌列表
List<RankVo> hddList = dataSupervisionNotifyService.getYellowBet(beginTime, endTime);
// // 黄毒赌列表
List<RankVo> hddList = dataSupervisionNotifyService.getYellowBet(beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("wtlxList", wtlxList)
.fluentPut("overview", overview)
@ -77,23 +77,14 @@ public class SupervisionNotifyController {
public Result<JSONObject> getChangedRank(@RequestParam Integer groupType,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
RankVoSup temp = dataSupervisionNotifyService.getSuperversionRank( beginTime, endTime);
JSONObject rankOverview=new JSONObject();
if ( temp != null) {
rankOverview
.fluentPut("proTotal", temp.getProblem_number())
.fluentPut("changing", temp.getRectifing_number())
.fluentPut("changed", temp.getRectifed_number())
.fluentPut("correctionRate", temp.getRectify_rate());
}else {
rankOverview
.fluentPut("proTotal",0)
.fluentPut("changing", 0)
.fluentPut("changed", 0)
.fluentPut("correctionRate", 0);
}
List<RankVo> changedRankList = dataSupervisionNotifyService.getChangedRateRank(groupType, beginTime, endTime);
RankVoSup temp = dataSupervisionNotifyService.getSuperversionRank(beginTime, endTime);
JSONObject rankOverview = new JSONObject()
.fluentPut("proTotal", temp.getProblemNumber())
.fluentPut("changing", temp.getRectifingNumber())
.fluentPut("changed", temp.getRectifedNumber())
.fluentPut("correctionRate", temp.getRectifyRate());
List<RankVo> changedRankList = dataSupervisionNotifyService.getChangedRateRank(groupType, beginTime, endTime);
JSONObject data = new JSONObject()
.fluentPut("rankOverview", rankOverview)
.fluentPut("changedRankList", changedRankList);
@ -106,8 +97,7 @@ public class SupervisionNotifyController {
*/
@GetMapping("/getSupervisionTrend")
public Result<JSONObject> getSupervisionTrend(@RequestParam String year) {
String temp = year+"-12-30";
String temp = year + "-11-30";
List<EchartsVo> supervisionTrend = dataSupervisionNotifyService.getSupervisionTrend(temp);
JSONObject data = new JSONObject().fluentPut("supervisionTrend", supervisionTrend);
return Result.success(data);

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

@ -28,17 +28,17 @@ public interface NegativeBlameMapper extends BaseMapper<NegativeBlame> {
@Select(" SELECT blameIdCode, blameName, count(1) as number FROM `negative_blame` " +
" where blameIdCode is not null and LENGTH(blameIdCode) > 0 and ivPersonTypeCode = '1' and crt_time > '2024-01-01 00:00:00' " +
" where blameIdCode is not null and LENGTH(blameIdCode) > 0 and ivPersonTypeCode = '1' and crtTime > '2024-01-01 00:00:00' " +
" GROUP BY blameIdCode order by number desc limit 10")
List<BlamePerson> statisticsBlame();
@Select(" SELECT blameIdCode, blameName, count(1) as number FROM `negative_blame` " +
" where blameIdCode is not null and LENGTH(blameIdCode) > 0 and ivPersonTypeCode != '1' and crt_time > '2024-01-01 00:00:00' " +
" where blameIdCode is not null and LENGTH(blameIdCode) > 0 and ivPersonTypeCode != '1' and crtTime > '2024-01-01 00:00:00' " +
" GROUP BY blameIdCode order by number desc limit 10")
List<BlamePerson> statisticsBlame2();
@Select(" SELECT leadIdCode, leadName as blameName, count(distinct blameIdCode) as number FROM `negative_blame` " +
" where leadIdCode is not null and LENGTH(leadIdCode) > 0 and crt_time > '2024-01-01 00:00:00'" +
" where leadIdCode is not null and LENGTH(leadIdCode) > 0 and crtTime > '2024-01-01 00:00:00'" +
" GROUP BY leadIdCode order by number desc limit 10")
List<BlamePerson> statisticsBlame3();
}

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

@ -245,29 +245,53 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"GROUP BY a.name, a.departId")
List<SuperviseMapIconVo> getMap(Date beginTime, Date endTime);
@Select("SELECT a.name, COUNT(DISTINCT c.id) AS problem_number, COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS rectifing_number, COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS rectifed_number, COUNT(DISTINCT c.involveDepartId) AS depart_number, COUNT(DISTINCT d.blameIdCode) AS person_number, ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS rectify_rate\n" +
"FROM statistics_depart a INNER JOIN sup_depart b ON a.departId = b.pid " +
" INNER JOIN negative c ON b.id = c.involveDepartId " +
@Select("SELECT a.name , " +
"COUNT(DISTINCT c.id) AS problem_number, " +
"COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS rectifing_number, " +
"COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS rectifed_number, " +
"COUNT(DISTINCT c.involveDepartId) AS depart_number, " +
"COUNT(DISTINCT d.blameIdCode) AS person_number, " +
"ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS rectify_rate " +
"FROM statistics_depart a INNER JOIN sup_depart b ON a.departId = b.pid " +
" INNER JOIN negative c ON b.id = c.involveDepartId " +
" LEFT JOIN negative_blame d ON c.id = d.negativeId " +
"WHERE a.groupId = 3 AND discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND special_supervision = 1\n" +
"GROUP BY a.name")
"WHERE a.groupId = 3 AND discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND special_supervision = 1 " +
"GROUP BY a.name " +
"order by problem_number desc")
List<RankVoSupTwo> getYellowBet(Date beginTime, Date endTime);
@Select("SELECT COUNT(DISTINCT c.id) AS problem_number, COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS rectifing_number, COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS rectifed_number, COUNT(DISTINCT c.involveDepartId) AS depart_number, COUNT(DISTINCT d.blameIdCode) AS person_number, ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS rectify_rate\n" +
@Select("SELECT COUNT(DISTINCT c.id) AS problem_number, COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS rectifing_number, COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS rectifed_number, COUNT(DISTINCT c.involveDepartId) AS depart_number, COUNT(DISTINCT d.blameIdCode) AS person_number, ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS rectify_rate " +
"FROM sup_depart b INNER JOIN negative c ON b.id = c.involveDepartId " +
" LEFT JOIN negative_blame d ON c.id = d.negativeId " +
"WHERE discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND problemSourcesCode = 13 ")
RankVoSup getSuperversionRank(Date beginTime, Date endTime);
@Select("SELECT a.name, COUNT(DISTINCT c.id) AS problem_number, COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS rectifing_number, COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS rectifed_number, COUNT(DISTINCT c.involveDepartId) AS depart_number, COUNT(DISTINCT d.blameIdCode) AS person_number, ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS rectify_rate\n" +
"FROM statistics_depart a INNER JOIN sup_depart b ON a.departId = b.pid \n" +
" INNER JOIN negative c ON b.id = c.involveDepartId \n" +
" LEFT JOIN negative_blame d ON c.id = d.negativeId\n" +
"WHERE a.groupId = 3 AND discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND problemSourcesCode = 13\n" +
"GROUP BY a.name")
@Select("SELECT a.name, " +
"COUNT(DISTINCT c.id) AS problem_number, " +
"COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS rectifing_number, " +
"COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS rectifed_number, " +
"COUNT(DISTINCT c.involveDepartId) AS depart_number, " +
"COUNT(DISTINCT d.blameIdCode) AS person_number, " +
"ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS rectify_rate " +
"FROM statistics_depart a INNER JOIN sup_depart b ON a.departId = b.pid " +
" INNER JOIN negative c ON b.id = c.involveDepartId " +
" LEFT JOIN negative_blame d ON c.id = d.negativeId " +
"WHERE a.groupId = 3 AND discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND problemSourcesCode = 13 " +
"GROUP BY a.name " +
"order by rectify_rate desc")
List<RankVoSupTwo> getChangedRateRank(Date beginTime, Date endTime);
@Select("SELECT COUNT(DISTINCT c.id) AS problem_number, " +
"COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS rectifing_number, " +
"COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS rectifed_number, " +
"COUNT(DISTINCT c.involveDepartId) AS depart_number, COUNT(DISTINCT d.blameIdCode) AS person_number, " +
"ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS rectify_rate " +
"FROM sup_depart b INNER JOIN negative c ON b.id = c.involveDepartId " +
" LEFT JOIN negative_blame d ON c.id = d.negativeId " +
"WHERE discoveryTime BETWEEN #{beginTime} AND #{endTime} AND checkStatus IN ('1', '2') AND problemSourcesCode IN (13, 15)")
RankVoSupTwo getTemp(Date beginTime, Date endTime);
// endregion

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

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

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

@ -1,5 +1,6 @@
package com.biutag.supervision.pojo.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
@ -8,12 +9,13 @@ import lombok.Data;
* @Description:
*/
@Data
@AllArgsConstructor
public class RankVoSup {
private String problem_number; // 问题数
private String rectifing_number; // 整改中
private String rectifed_number; // 已整改
private String depart_number; // 部门数
private String person_number; // 人员数
private String rectify_rate; // 整改率
private String problemNumber; // 问题数
private String rectifingNumber; // 整改中
private String rectifedNumber; // 已整改
private String departNumber; // 部门数
private String personNumber; // 人员数
private String rectifyRate; // 整改率
}

12
src/main/java/com/biutag/supervision/pojo/vo/RankVoSupTwo.java

@ -10,12 +10,12 @@ import lombok.Data;
@Data
public class RankVoSupTwo {
private String name; // 名字
private String problem_number; // 问题数
private String rectifing_number; // 整改
private String rectifed_number; // 已整改
private String depart_number; //
private String person_number; // 人数
private String rectify_rate; // 整改率
private String rectifingNumber; // 整改中
private String rectifedNumber; // 整改
private String departNumber; //
private String personNumber; // 人数
private String rectifyRate; // 整改率
private String problemNumber; // 问题数
}

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

@ -18,11 +18,13 @@ import com.biutag.supervision.pojo.entity.NegativeBlame;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.vo.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.Intercept;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.IllegalFormatCodePointException;
import java.util.List;
import java.util.stream.Collectors;
@ -33,6 +35,8 @@ import java.util.stream.Collectors;
*/
@RequiredArgsConstructor
@Service
@Slf4j
public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisionNotifyMapper, DataSupervisionNotify> {
private final NegativeMapper negativeMapper;
@ -49,37 +53,29 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
*/
public JSONObject getAllSupervisionNotifyCount(Date beginTime, Date endTime) {
// 通报问题数
Long supervisionNotifyTotal = negativeMapper.selectSupervisionNotifyCount(beginTime, endTime, InspectCaseEnum.FALSE.getValue());
RankVoSupTwo res = negativeMapper.getTemp(beginTime, endTime);
if (res == null) {
return null;
}
// 通报问题数
String supervisionNotifyTotal = res.getProblemNumber();
log.info("通报问题数:{}", res.getProblemNumber());
// 整改中
Long supervisionNotifyChangingTotal = negativeMapper.selectChangSupervisionNotifyCount(beginTime, endTime, InspectCaseEnum.FALSE.getValue(), "0");
String supervisionNotifyChangingTotal = res.getRectifingNumber();
log.info("整改中:{}", res.getRectifingNumber());
// 已整改
Long supervisionNotifyChangedTotal = negativeMapper.selectChangSupervisionNotifyCount(beginTime, endTime, InspectCaseEnum.TRUE.getValue(), "1");
String supervisionNotifyChangedTotal = res.getRectifedNumber();
log.info("已整改:{}", res.getRectifedNumber());
// 涉及单位数
Long supervisionNotifyOrgTotal = negativeMapper.selectRelationOrgCount(beginTime, endTime, "1");
/**
* 涉及人数
* 1查出在 negative中的id集合
* 2查出集合在blame中的涉及人数
*/
QueryWrapper<Negative> preQueryWrapper = new QueryWrapper<>();
preQueryWrapper.in("problemSourcesCode", ProblemSourcesEnum.XCDC.getValue(), ProblemSourcesEnum.ZXDC.getValue());
List<Negative> negatives = negativeMapper.selectList(preQueryWrapper);
Long supervisionNotifyPreTotal = 0L;
for (Negative negative : negatives) {
String id = negative.getId();
QueryWrapper<NegativeBlame> totalWrapper = new QueryWrapper<>();
totalWrapper.eq("negativeId", id);
totalWrapper.eq("type", "personal");
supervisionNotifyPreTotal += negativeBlameMapper.selectCount(totalWrapper);
}
// 整改率
Integer correctionRate = supervisionNotifyTotal != 0 ? (int) ((supervisionNotifyChangedTotal * 1.0 / supervisionNotifyTotal) * 100) : 0;
String supervisionNotifyOrgTotal = res.getDepartNumber();
log.info("涉及单位数:{}", res.getDepartNumber());
// 涉及人数
String supervisionNotifyPreTotal = res.getPersonNumber();
log.info("涉及人数:{}", res.getPersonNumber());
String correctionRate = res.getRectifyRate();
log.info("整改率:{}", res.getRectifyRate());
JSONObject jsonObject = new JSONObject();
jsonObject.fluentPut("supervisionNotifyTotal", supervisionNotifyTotal)
.fluentPut("supervisionNotifyOrgTotal", supervisionNotifyOrgTotal)
@ -127,10 +123,10 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
for (RankVoSupTwo one : rankVoRes) {
RankVo rankVo = new RankVo();
rankVo.setLabel(one.getName());
rankVo.setValue(Double.parseDouble(one.getRectify_rate()));
rankVo.setRate(Double.parseDouble(one.getRectify_rate()));
rankVo.setNumerator(one.getRectifed_number());
rankVo.setDenominator(one.getRectifed_number());
rankVo.setValue(one.getRectifyRate());
rankVo.setRate(one.getRectifyRate());
rankVo.setNumerator(one.getRectifedNumber());
rankVo.setDenominator(one.getProblemNumber());
res.add(rankVo);
}
return res;
@ -161,11 +157,16 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
public List<RankVo> getYellowBet(Date beginTime, Date endTime) {
List<RankVoSupTwo> res = negativeMapper.getYellowBet(beginTime, endTime);
List<RankVo> resv = new ArrayList<>();
if (res == null) {
return resv;
}
for (RankVoSupTwo re : res) {
log.info("名字===========" + re.getName() + "驼峰===============" + re.getProblemNumber() + "非驼峰" + re.getProblemNumber());
RankVo rankVo = new RankVo();
rankVo.setLabel(re.getName());
rankVo.setValue(Double.parseDouble(re.getProblem_number()));
rankVo.setValue(re.getProblemNumber());
resv.add(rankVo);
}
return resv;
@ -175,36 +176,8 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
public RankVoSup getSuperversionRank(Date beginTime, Date endTime) {
RankVoSup res = negativeMapper.getSuperversionRank(beginTime, endTime);
if (res == null) {
res=new RankVoSup();
res.setRectify_rate("0");
res.setProblem_number("0");
res.setRectifing_number("0");
res.setDepart_number("0");
res.setPerson_number("0");
res.setRectifed_number("0");
}else {
if (res.getProblem_number() == null) {
res.setRectifed_number("0");
}
if (res.getRectifing_number() == null) {
res.setRectifing_number("0");
}
if (res.getDepart_number() == null) {
res.setDepart_number("0");
}
if (res.getRectify_rate() == null) {
res.setRectify_rate("0");
}
if (res.getRectifed_number() == null) {
res.setRectifed_number("0");
}
if (res.getProblem_number() == null) {
res.setProblem_number("0");
}
return new RankVoSup("0", "0", "0", "0", "0", "0");
}
return res;
}
}

Loading…
Cancel
Save