Browse Source

现场督察大屏2024/11/16 22:51

main
parent
commit
a1b8d430cc
  1. 13
      src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java
  2. 21
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  3. 1
      src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java
  4. 51
      src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java

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

@ -21,6 +21,7 @@ import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Auther: sh * @Auther: sh
@ -53,8 +54,18 @@ public class SupervisionNotifyController {
//地图数据 //地图数据
List<SuperviseMapIconVo> superviseTempMapVoList = dataSupervisionNotifyService.getsupervisionMapIconInfo(beginTime, endTime); List<SuperviseMapIconVo> superviseTempMapVoList = dataSupervisionNotifyService.getsupervisionMapIconInfo(beginTime, endTime);
// 黄赌毒总览
List<Map<String, String>> hddzlList = new ArrayList<>();
// 黄毒赌列表
List<RankVo> hddList = dataSupervisionNotifyService.getYellowBet(beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("wtlxList", wtlxList) JSONObject data = new JSONObject().fluentPut("wtlxList", wtlxList)
.fluentPut("overview", overview); .fluentPut("overview", overview)
.fluentPut("superviseTempMapVoList", superviseTempMapVoList)
.fluentPut("hddList", hddList);
return Result.success(data); return Result.success(data);
} }

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

@ -3,10 +3,7 @@ package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.Negative; import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.vo.EchartsVo; import com.biutag.supervision.pojo.vo.*;
import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo;
import com.biutag.supervision.pojo.vo.RankVo;
import com.biutag.supervision.pojo.vo.RecentTrendByMonthVo;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.Date; import java.util.Date;
@ -240,6 +237,22 @@ public interface NegativeMapper extends BaseMapper<Negative> {
@Select("") @Select("")
Long getRelationOrgCountByDepartId(String departId); Long getRelationOrgCountByDepartId(String departId);
@Select("SELECT a.departId, a.name, COUNT(DISTINCT c.id) AS totalPro, COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, 0)) - 1 AS changing, COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1 AS changed, COUNT(DISTINCT c.involveDepartId) AS relationOrg, COUNT(DISTINCT d.blameIdCode) AS personNum, ROUND((COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, 0)) - 1) / COUNT(DISTINCT c.id) * 100, 1) AS changedRate\n" +
"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 IN (13, 15) " +
"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 " +
" 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")
List<RankVo> getYellowBet(Date beginTime, Date endTime);
// endregion // endregion

1
src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java

@ -15,6 +15,7 @@ public class SuperviseMapIconVo {
private String changed; private String changed;
private String relationOrg; private String relationOrg;
private String changedRate; private String changedRate;
private String personNum;
private String departId; private String departId;
} }

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

@ -62,6 +62,7 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
// 涉及单位数 // 涉及单位数
Long supervisionNotifyOrgTotal = negativeMapper.selectRelationOrgCount(beginTime, endTime, "1"); Long supervisionNotifyOrgTotal = negativeMapper.selectRelationOrgCount(beginTime, endTime, "1");
/** /**
* 涉及人数 * 涉及人数
* 1查出在 negative中的id集合 * 1查出在 negative中的id集合
@ -155,8 +156,7 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
} }
public List<EchartsVo> getProblemTypeRatio(Date beginTime, Date endTime) { public List<EchartsVo> getProblemTypeRatio(Date beginTime, Date endTime) {
List<EchartsVo> echartsVos = new ArrayList<>(); List<EchartsVo> echartsVos = negativeMapper.getProblemTypes(beginTime, endTime);
echartsVos = negativeMapper.getProblemTypes(beginTime, endTime);
return echartsVos; return echartsVos;
} }
@ -166,7 +166,6 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
return echartsVos; return echartsVos;
} }
/** /**
* 包括现场督察和专项 * 包括现场督察和专项
* *
@ -175,51 +174,17 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
* @return * @return
*/ */
public List<SuperviseMapIconVo> getsupervisionMapIconInfo(Date beginTime, Date endTime) { public List<SuperviseMapIconVo> getsupervisionMapIconInfo(Date beginTime, Date endTime) {
List<SuperviseMapIconVo> res = new ArrayList<>(); List<SuperviseMapIconVo> res = negativeMapper.getMap(beginTime, endTime);
List<SupDepart> supDeparts = supDepartMapper.selectDepartsByGroupType(3); return res;
for (SupDepart supDepart : supDeparts) {
SuperviseMapIconVo SuperviseMapIconVo = new SuperviseMapIconVo();
SuperviseMapIconVo.setName(supDepart.getShortName());
SuperviseMapIconVo.setDepartId(supDepart.getId());
res.add(SuperviseMapIconVo);
}
for (SuperviseMapIconVo re : res) {
String departId = re.getDepartId();
Long changed = negativeMapper.getNotifyChanged(beginTime, endTime, departId);
Long changing = negativeMapper.getNotifyChanging(beginTime, endTime, departId);
Long totalPro = changed + changing;
Long relationOrg = negativeMapper.getRelationOrgCountByDepartId(departId);
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);
supervisionNotifyPreTotal += negativeBlameMapper.selectCount(totalWrapper);
}
} }
return null;
public List<RankVo> getYellowBet(Date beginTime, Date endTime) {
List<RankVo> res = negativeMapper.getYellowBet(beginTime, endTime);
return res;
} }
/**
* 涉及人数
* 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);
supervisionNotifyPreTotal += negativeBlameMapper.selectCount(totalWrapper);
}*/
} }

Loading…
Cancel
Save