Browse Source

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

main
parent
commit
49aad08eb5
  1. 29
      src/main/java/com/biutag/supervision/constants/enums/TrendEnum.java
  2. 24
      src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java
  3. 56
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  4. 20
      src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java
  5. 73
      src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java

29
src/main/java/com/biutag/supervision/constants/enums/TrendEnum.java

@ -0,0 +1,29 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
/**
* @Auther: sh
* @Date: 2024/11/16 19:34
* @Description:
*/
@Getter
@AllArgsConstructor
public enum TrendEnum {
DAY("日趋势", "1"),
WEEK("周趋势", "2"),
Month("月趋势", "3");
private String label;
private String value;
}

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

@ -2,9 +2,10 @@ package com.biutag.supervision.controller.datav;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.CaseVerifDepart;
import com.biutag.supervision.pojo.vo.EchartsVo; import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.GobalMapIconVo;
import com.biutag.supervision.pojo.vo.RankVo; import com.biutag.supervision.pojo.vo.RankVo;
import com.biutag.supervision.pojo.vo.SuperviseMapIconVo;
import com.biutag.supervision.service.DataSupervisionNotifyServiceImpl; import com.biutag.supervision.service.DataSupervisionNotifyServiceImpl;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@ -16,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -43,18 +46,22 @@ public class SupervisionNotifyController {
public Result<JSONObject> getAllSupervisionNotifyCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, public Result<JSONObject> getAllSupervisionNotifyCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
JSONObject overview = dataSupervisionNotifyService.getAllSupervisionNotifyCount(beginTime, endTime); JSONObject overview = dataSupervisionNotifyService.getAllSupervisionNotifyCount(beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("overview", overview);
//问题类型占比 //问题类型占比
List<EchartsVo> wtlxList = dataSupervisionNotifyService.getProblemTypeRatio(beginTime, endTime); List<EchartsVo> wtlxList = dataSupervisionNotifyService.getProblemTypeRatio(beginTime, endTime);
// //地图数据
List<SuperviseMapIconVo> superviseTempMapVoList = dataSupervisionNotifyService.getsupervisionMapIconInfo(beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("wtlxList", wtlxList)
.fluentPut("overview", overview);
return Result.success(data); return Result.success(data);
} }
/** /**
* 获取日常督察排行 * 获取日常督察排行
*
* @param groupType 分组类型 1: 分县市局 2: 局属单位 * @param groupType 分组类型 1: 分县市局 2: 局属单位
* @return * @return
*/ */
@ -72,8 +79,17 @@ public class SupervisionNotifyController {
} }
/**
* 获取督察问题趋势
*/
@GetMapping("/getSupervisionTrend")
public Result<JSONObject> getSupervisionTrend(@RequestParam String year) {
String temp = year+"-12-30";
List<EchartsVo> supervisionTrend = dataSupervisionNotifyService.getSupervisionTrend(temp);
JSONObject data = new JSONObject().fluentPut("supervisionTrend", supervisionTrend);
return Result.success(data);
}
} }

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

@ -114,7 +114,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
* @param endTime * @param endTime
* @return * @return
*/ */
@Select("SELECT count(*) FROM negative WHERE checkStatus = #{checkStatus} " + @Select("SELECT count(*) FROM negative WHERE checkStatus <> #{checkStatus} " +
"AND problemSourcesCode IN (13, 15) " + "AND problemSourcesCode IN (13, 15) " +
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime}") "AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Long selectSupervisionNotifyCount(Date beginTime, Date endTime, String checkStatus); Long selectSupervisionNotifyCount(Date beginTime, Date endTime, String checkStatus);
@ -126,7 +126,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
* @param endTime * @param endTime
* @return * @return
*/ */
@Select("SELECT count(*) FROM negative WHERE checkStatus = #{checkStatus} " + @Select("SELECT count(*) FROM negative WHERE checkStatus <> #{checkStatus} " +
"AND problemSourcesCode IN (13, 15) " + "AND problemSourcesCode IN (13, 15) " +
"AND isRectifyCode=#{isRectify}" + "AND isRectifyCode=#{isRectify}" +
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime}") "AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
@ -142,8 +142,8 @@ public interface NegativeMapper extends BaseMapper<Negative> {
*/ */
@Select("SELECT count(*) FROM " + @Select("SELECT count(*) FROM " +
" ( SELECT DISTINCT involveDepartName FROM negative " + " ( SELECT DISTINCT involveDepartName FROM negative " +
" WHERE checkStatus=1 AND problemSourcesCode in (13, 15) AND discoveryTime " + " WHERE checkStatus<>3 AND problemSourcesCode in (13, 15) AND discoveryTime " +
" BETWEEN '2024-01-01' AND '2024-11-17'" + " BETWEEN #{beginTime} AND #{endTime}" +
" )" + " )" +
"AS distinct_departments;") "AS distinct_departments;")
Long selectRelationOrgCount(Date beginTime, Date endTime, String checkStatus); Long selectRelationOrgCount(Date beginTime, Date endTime, String checkStatus);
@ -186,7 +186,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
@Select("SELECT count(*) FROM negative ng INNER JOIN " + @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 " + "(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 sd.pid = sd1.id AND sd1.`level`=2 AND sd1.statistics_group_id=3) as temp " +
"ON ng.involveDepartId=temp.id " + "ON ng.involveDepartId=temp.id " +
"AND pid=#{departId} " + "AND pid=#{departId} " +
"AND problemSourcesCode= 13 " + "AND problemSourcesCode= 13 " +
@ -194,6 +194,52 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime}") "AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Long getCountByGroupType(Date beginTime, Date endTime, String departId); Long getCountByGroupType(Date beginTime, Date endTime, String departId);
@Select("SELECT npr.oneLevelContent as name, count(*) value FROM negative ng, negative_problem_relation npr " +
"WHERE ng.id = npr.negativeId " +
"AND ng.problemSourcesCode in (13, 15) " +
"and ng.checkStatus<>3 " +
"AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " +
"AND oneLevelContent is NOT NULL " +
"GROUP BY oneLevelContent ")
List<EchartsVo> getProblemTypes(Date beginTime, Date endTime);
@Select("SELECT DATE_FORMAT(discoveryTime, '%m') AS `name`, COUNT(*) AS `value` FROM negative " +
"WHERE discoveryTime BETWEEN DATE_SUB(#{time}, INTERVAL 12 MONTH) AND #{time} " +
"AND checkStatus <> 3 " +
"AND problemSourcesCode in (13, 15) " +
"GROUP BY DATE_FORMAT(discoveryTime, '%Y-%m') " +
"ORDER BY DATE_FORMAT(discoveryTime, '%Y-%m');")
List<EchartsVo> getSupervisionTrend(String time);
@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 pid=#{departId} " +
"AND problemSourcesCode in (13, 15) " +
"AND checkStatus <> 3 " +
"AND isRectifyCode =1 " +
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Long getNotifyChanged(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 pid=#{departId} " +
"AND problemSourcesCode in (13, 15) " +
"AND checkStatus <> 3 " +
"AND isRectifyCode =0 " +
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime}")
Long getNotifyChanging(Date beginTime, Date endTime, String departId);
@Select("")
Long getRelationOrgCountByDepartId(String departId);
// endregion // endregion

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

@ -0,0 +1,20 @@
package com.biutag.supervision.pojo.vo;
import lombok.Data;
/**
* @Auther: sh
* @Date: 2024/11/16 21:06
* @Description:
*/
@Data
public class SuperviseMapIconVo {
private String name; // 分县市局名
private String totalPro;
private String changing;
private String changed;
private String relationOrg;
private String changedRate;
private String departId;
}

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

@ -17,7 +17,9 @@ import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeBlame; import com.biutag.supervision.pojo.entity.NegativeBlame;
import com.biutag.supervision.pojo.entity.SupDepart; import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.vo.EchartsVo; import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.GobalMapIconVo;
import com.biutag.supervision.pojo.vo.RankVo; import com.biutag.supervision.pojo.vo.RankVo;
import com.biutag.supervision.pojo.vo.SuperviseMapIconVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -35,13 +37,8 @@ import java.util.stream.Collectors;
@Service @Service
public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisionNotifyMapper, DataSupervisionNotify> { public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisionNotifyMapper, DataSupervisionNotify> {
private final DataSupervisionNotifyMapper dataSupervisionNotifyMapper;
private final NegativeMapper negativeMapper; private final NegativeMapper negativeMapper;
private final NegativeBlameMapper negativeBlameMapper; private final NegativeBlameMapper negativeBlameMapper;
private final NegativeBlameService blameService;
private final SupDepartMapper supDepartMapper; private final SupDepartMapper supDepartMapper;
/** /**
@ -55,10 +52,10 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
public JSONObject getAllSupervisionNotifyCount(Date beginTime, Date endTime) { public JSONObject getAllSupervisionNotifyCount(Date beginTime, Date endTime) {
// 通报问题数 // 通报问题数
Long supervisionNotifyTotal = negativeMapper.selectSupervisionNotifyCount(beginTime, endTime, InspectCaseEnum.TRUE.getValue()); Long supervisionNotifyTotal = negativeMapper.selectSupervisionNotifyCount(beginTime, endTime, InspectCaseEnum.FALSE.getValue());
// 整改中 // 整改中
Long supervisionNotifyChangingTotal = negativeMapper.selectChangSupervisionNotifyCount(beginTime, endTime, InspectCaseEnum.TRUE.getValue(), "0"); Long supervisionNotifyChangingTotal = negativeMapper.selectChangSupervisionNotifyCount(beginTime, endTime, InspectCaseEnum.FALSE.getValue(), "0");
// 已整改 // 已整改
Long supervisionNotifyChangedTotal = negativeMapper.selectChangSupervisionNotifyCount(beginTime, endTime, InspectCaseEnum.TRUE.getValue(), "1"); Long supervisionNotifyChangedTotal = negativeMapper.selectChangSupervisionNotifyCount(beginTime, endTime, InspectCaseEnum.TRUE.getValue(), "1");
@ -79,6 +76,7 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
String id = negative.getId(); String id = negative.getId();
QueryWrapper<NegativeBlame> totalWrapper = new QueryWrapper<>(); QueryWrapper<NegativeBlame> totalWrapper = new QueryWrapper<>();
totalWrapper.eq("negativeId", id); totalWrapper.eq("negativeId", id);
totalWrapper.eq("type", "personal");
supervisionNotifyPreTotal += negativeBlameMapper.selectCount(totalWrapper); supervisionNotifyPreTotal += negativeBlameMapper.selectCount(totalWrapper);
} }
// 整改率 // 整改率
@ -158,9 +156,70 @@ 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 = new ArrayList<>();
echartsVos = negativeMapper.getProblemTypes(beginTime, endTime);
return echartsVos;
}
public List<EchartsVo> getSupervisionTrend(String year) {
List<EchartsVo> echartsVos = negativeMapper.getSupervisionTrend(year);
return echartsVos;
}
/**
* 包括现场督察和专项
*
* @param beginTime
* @param endTime
* @return
*/
public List<SuperviseMapIconVo> getsupervisionMapIconInfo(Date beginTime, Date endTime) {
List<SuperviseMapIconVo> res = new ArrayList<>();
List<SupDepart> supDeparts = supDepartMapper.selectDepartsByGroupType(3);
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; return null;
} }
/**
* 涉及人数
* 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