Browse Source

现场督察二级大屏

main
不爱学习的石同学 12 months ago
parent
commit
e701dff07b
  1. 247
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java
  2. 89
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneVideoSuperviseController.java
  3. 120
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  4. 19
      src/main/java/com/biutag/supervision/pojo/vo/SupervisionNotifyOverView.java
  5. 2
      src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java
  6. 64
      src/main/java/com/biutag/supervision/service/SubOneSupervisionNotifyService.java
  7. 3
      src/main/java/com/biutag/supervision/service/SubOneVideoSuperviseService.java
  8. 32
      src/main/resources/mapper/NegativeMapper.xml

247
src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java

@ -0,0 +1,247 @@
package com.biutag.supervision.controller.subdatav;
import com.alibaba.fastjson.JSONObject;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.vo.*;
import com.biutag.supervision.service.DataSupervisionNotifyServiceImpl;
import com.biutag.supervision.service.SubOneSupervisionNotifyService;
import com.biutag.supervision.service.SubOneVideoSuperviseService;
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.cache.annotation.Cacheable;
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 java.util.Date;
import java.util.List;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.XCDC;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.ZXDC;
/**
* @Auther: sh
* @Date: 2024/12/17 10:58
* @Description: 二级现场督察大屏相关
*/
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("datav/sub1/supervisonNotify")
@Tag(name = "现场督察相关")
public class SubOneSupervisionNotifyController {
private final SubOneSupervisionNotifyService subOneSupervisionNotifyService;
// region 左边
/**
* 获取日常督察情况
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@Operation(summary = "获取日常督察数量概览和整改率排名")
@GetMapping("/getSubOneChangedRank")
public Result<JSONObject> getSubOneChangedRank(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
DayTimeSuperviseVo policeRankOverview = subOneSupervisionNotifyService.getChangedRankOverView(10, departId, beginTime, endTime);
DayTimeSuperviseVo teamRankOverview = subOneSupervisionNotifyService.getChangedRankOverView(-1, departId, beginTime, endTime);
List<RankVo> policeChangedRankList = subOneSupervisionNotifyService.getSubOneChangedRateRank(10, departId, beginTime, endTime);
List<RankVo> teamChangedRankList = subOneSupervisionNotifyService.getSubOneChangedRateRank(-1, departId, beginTime, endTime);
JSONObject data = new JSONObject()
.fluentPut("fxsjRankOverview", policeRankOverview)
.fluentPut("jsdwRankOverview", teamRankOverview)
.fluentPut("fxsjChangedRankList", policeChangedRankList)
.fluentPut("jsdwChangedRankList", teamChangedRankList);
return Result.success(data);
}
/**
* 问题类型占比
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@GetMapping("/getSubOneProblemTypeRate")
public Result<JSONObject> getSubOneProblemTypeRate(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
List<EchartsVo> wtlxList = subOneSupervisionNotifyService.getSubOneProblemTypeRatio(departId, beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("wtlxList", wtlxList);
return Result.success(data);
}
// endregion
// region 中间
/**
* 大屏中央数据
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
@Operation(summary = "大屏中央数据")
@GetMapping("/getAllSubOneSupervisionNotifyCount")
public Result<JSONObject> getAllSubOneSupervisionNotifyCount(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
SupervisionNotifyOverView overview = subOneSupervisionNotifyService.getAllSubOneSupervisionNotifyCount(departId, beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("overview", overview);
return Result.success(data);
}
// /**
// * 地图数据
// *
// * @param beginTime 开始时间
// * @param endTime 结束时间
// * @return List<SuperviseMapIconVo>
// */
// @GetMapping("/getMap")
// @Cacheable(cacheNames = "superviseMap", key = "'p_'+ #endTime")
// public Result<JSONObject> getMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// //地图数据
// List<SuperviseMapIconVo> superviseTempMapVoList = dataSupervisionNotifyService.getSupervisionMapIconInfo(beginTime, endTime);
// JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList);
// return Result.success(data);
// }
/**
* 获取现场督察问题趋势
*
* @param year 年份
* @return List<EchartsVo>
*/
@GetMapping("/getSubOneSupervisionTrend")
public Result<JSONObject> getSubOneSupervisionTrend(@RequestParam Integer departId,
@RequestParam String year) {
List<EchartsVo> supervisionTrend = subOneSupervisionNotifyService.getSubOneSupervisionTrend(departId, year);
JSONObject data = new JSONObject().fluentPut("supervisionTrend", supervisionTrend);
return Result.success(data);
}
// endregion
// region 右边
/**
* 黄赌毒数据
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return JSONObject
*/
@GetMapping("/getYellowBetDrug")
public Result<JSONObject> getYellowBetDrug(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// // 黄赌毒总览
// DayTimeSuperviseVo fxsjYellowBetOverview = subOneSupervisionNotifyService.getSubOneYellowBetOverview(beginTime, endTime, departId, 1);
// DayTimeSuperviseVo jsdwYellowBetOverview = subOneSupervisionNotifyService.getSubOneYellowBetOverview(beginTime, endTime, departId, 1);
// // 黄毒赌列表
// List<OrganizeProblemRankVo> fxsjYellowBetRankList = subOneSupervisionNotifyService.getSubOneYellowBetRankList(beginTime, endTime, departId, 1);
// List<OrganizeProblemRankVo> jsdwYellowBetRankList = subOneSupervisionNotifyService.getSubOneYellowBetRankList(beginTime, endTime, departId, 1);
//
// JSONObject data = new JSONObject()
// .fluentPut("fxsjYellowBetOverview", fxsjYellowBetOverview)
// .fluentPut("jsdwYellowBetOverview", jsdwYellowBetOverview)
// .fluentPut("fxsjYellowBetRankList", fxsjYellowBetRankList)
// .fluentPut("jsdwYellowBetRankList", jsdwYellowBetRankList);
return Result.success(null);
}
//
//
// // 枪支管理数据
// @GetMapping("/getGunController")
// public Result<JSONObject> getGunController(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// // 枪支管理总览
// DayTimeSuperviseVo fxsjGunControllerOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 3, 2);
// DayTimeSuperviseVo jsdwGunControllerOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 4, 2);
// // 枪支管理列表
// List<OrganizeProblemRankVo> fxsjGunControllerRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 3, 2);
// List<OrganizeProblemRankVo> jsdwGunControllerRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 4, 2);
//
// JSONObject data = new JSONObject()
// .fluentPut("fxsjGunControllerOverview", fxsjGunControllerOverview)
// .fluentPut("jsdwGunControllerOverview", jsdwGunControllerOverview)
// .fluentPut("fxsjGunControllerRankList", fxsjGunControllerRankList)
// .fluentPut("jsdwGunControllerRankList", jsdwGunControllerRankList);
// return Result.success(data);
// }
//
// // 涉企问题数据
// @GetMapping("/getCompanyProblem")
// public Result<JSONObject> getCompanyProblem(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// // 涉企问题总览
// DayTimeSuperviseVo fxsjCompanyProblemOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 3, 3);
// DayTimeSuperviseVo jsdwCompanyProblemOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 4, 3);
// // 涉企问题列表
// List<OrganizeProblemRankVo> fxsjCompanyProblemRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 3, 3);
// List<OrganizeProblemRankVo> jsdwCompanyProblemRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 4, 3);
//
// JSONObject data = new JSONObject()
// .fluentPut("fxsjCompanyProblemOverview", fxsjCompanyProblemOverview)
// .fluentPut("jsdwCompanyProblemOverview", jsdwCompanyProblemOverview)
// .fluentPut("fxsjCompanyProblemRankList", fxsjCompanyProblemRankList)
// .fluentPut("jsdwCompanyProblemRankList", jsdwCompanyProblemRankList);
// return Result.success(data);
// }
//
// // 执法办案数据
// @GetMapping("/getHandleCase")
// public Result<JSONObject> getHandleCase(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// // 执法办案总览
// DayTimeSuperviseVo fxsjHandleCaseOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 3, 4);
// DayTimeSuperviseVo jsdwHandleCaseOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 4, 4);
// // 执法办案列表
// List<OrganizeProblemRankVo> fxsjHandleCaseRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 3, 4);
// List<OrganizeProblemRankVo> jsdwHandleCaseRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 4, 4);
//
// JSONObject data = new JSONObject()
// .fluentPut("fxsjHandleCaseOverview", fxsjHandleCaseOverview)
// .fluentPut("jsdwHandleCaseOverview", jsdwHandleCaseOverview)
// .fluentPut("fxsjHandleCaseRankList", fxsjHandleCaseRankList)
// .fluentPut("jsdwHandleCaseRankList", jsdwHandleCaseRankList);
// return Result.success(data);
// }
//
//
// // 工作日测酒数据
// @GetMapping("/getCheckBeer")
// public Result<JSONObject> getCheckBeer(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// // 工作日测酒总览
// DayTimeSuperviseVo fxsjCheckBeerOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 3, 5);
// DayTimeSuperviseVo jsdwCheckBeerOverview = dataSupervisionNotifyService.getYellowBetOverview(beginTime, endTime, 4, 5);
// // 工作日测酒列表
// List<OrganizeProblemRankVo> fxsjCheckBeerRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 3, 5);
// List<OrganizeProblemRankVo> jsdwCheckBeerRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 4, 5);
//
// JSONObject data = new JSONObject()
// .fluentPut("fxsjCheckBeerOverview", fxsjCheckBeerOverview)
// .fluentPut("jsdwCheckBeerOverview", jsdwCheckBeerOverview)
// .fluentPut("fxsjCheckBeerRankList", fxsjCheckBeerRankList)
// .fluentPut("jsdwCheckBeerRankList", jsdwCheckBeerRankList);
// return Result.success(data);
// }
// endregion
}

89
src/main/java/com/biutag/supervision/controller/subdatav/SubOneVideoSuperviseController.java

@ -5,23 +5,18 @@ import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo;
import com.biutag.supervision.pojo.vo.VideoSuperviseCountVo;
import com.biutag.supervision.pojo.vo.VideoSuperviseMapIconVo;
import com.biutag.supervision.service.SubOneVideoSuperviseService;
import com.biutag.supervision.service.VideoSuperviseService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.Cacheable;
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 java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.SPDC;
@ -39,90 +34,6 @@ public class SubOneVideoSuperviseController {
private final SubOneVideoSuperviseService subOneVideoSuperviseService;
// //region 左边
//
// /**
// * 获取视频督察大屏问题数排名
// * @param beginTime 开始时间
// * @param endTime 结束时间
// * @return
// */
// @Operation(summary = "视频督察大屏问题数排名")
// @GetMapping("/getVideoSuperviseProblemRank")
// public Result<JSONObject> getVideoSuperviseProblemRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// List<OrganizeProblemRankVo> fxsjVideoSuperviseProblemRankList = videoSuperviseService.getVideoSuperviseProblemRank(beginTime, endTime, 3);
// List<OrganizeProblemRankVo> jsdwVideoSuperviseProblemRankList = videoSuperviseService.getVideoSuperviseProblemRank(beginTime, endTime, 4);
// JSONObject data = new JSONObject();
// data.fluentPut("fxsjVideoSuperviseProblemRankList", fxsjVideoSuperviseProblemRankList);
// data.fluentPut("jsdwVideoSuperviseProblemRankList", jsdwVideoSuperviseProblemRankList);
// return Result.success(data);
// }
// //endregion
//
// //region 中间
//
// /**
// * 获取视频督察中央数据
// * @param beginTime 开始时间
// * @param endTime 结束时间
// * @return Result<JSONObject>
// */
// @Operation(summary = "视频督察大屏中央数据")
// @GetMapping("/getAllVideoSuperviseCount")
// public Result<JSONObject> getAllVideoSuperviseCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// // 获取视频督察中央数据
// VideoSuperviseCountVo overview = videoSuperviseService.getAllVideoSuperviseCount(beginTime, endTime);
// JSONObject data = new JSONObject().fluentPut("overview", overview);
// return Result.success(data);
// }
//
// /**
// * 获取视频督察地图数据
// * @param beginTime 开始时间
// * @param endTime 结束时间
// * @return
// */
// @Operation(summary = "视频督察大屏地图数据")
// @GetMapping("/getVideoSuperviseMap")
// @Cacheable(cacheNames = "videoSuperviseMap", key = "'p_'+ #endTime")
// public Result<JSONObject> getVideoSuperviseMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
//
// // 地图数据
// List<VideoSuperviseMapIconVo> videoSuperviseMapIconVoList = Optional.ofNullable(videoSuperviseService.getVideoSuperviseMapIconInfo(beginTime, endTime)).
// orElseGet(ArrayList::new);
// JSONObject data = new JSONObject().fluentPut("videoSuperviseMapIconVoList", videoSuperviseMapIconVoList);
// return Result.success(data);
// }
//
// // 获取视频督察大屏中央问题趋势统计
// @Operation(summary = "数据大屏问题趋势统计")
// @GetMapping("/getVideoSuperviseTrend")
// public Result<JSONObject> getVideoSuperviseTrend(@RequestParam Integer year) {
// List<EchartsVo> videoSuperviseTrendList = videoSuperviseService.getVideoSuperviseTrend(String.valueOf(year), SPDC.getValue());
// JSONObject jsonObject = new JSONObject().fluentPut("videoSuperviseTrendList", videoSuperviseTrendList);
// return Result.success(jsonObject);
// }
// //endregion
//
//
// // region 右边
//
// // 问题类型占比
// @Operation(summary = "数据大屏问题类型占比")
// @GetMapping("/getVideoSuperviseProblemTypeRate")
// public Result<JSONObject> getVideoSuperviseProblemTypeRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// List<EchartsVo> videoSuperviseProblemTypeRate = videoSuperviseService.getVideoSuperviseProblemTypeRate(beginTime, endTime);
// JSONObject jsonObject = new JSONObject().fluentPut("videoSuperviseProblemTypeRate", videoSuperviseProblemTypeRate);
// return Result.success(jsonObject);
// }
//
//
// // endregion
@Operation(summary = "视频督察二级大屏问题数排名")
@GetMapping("/getSubOneVideoSuperviseProblemRank")

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

@ -20,15 +20,17 @@ public interface NegativeMapper extends BaseMapper<Negative> {
* @param beginTime
* @param endTime
*/
@Select("SELECT sd1.short_name as label, count(*) value " +
@Select("SELECT sd1.short_name AS label, " +
"count(DISTINCT ng.id ) AS `value` " +
"FROM negative ng " +
"INNER JOIN sup_depart sd " +
"on ng.involveDepartId=sd.id AND sd.`level`=3 AND checkStatus=1 " +
"AND ng.discoveryTime BETWEEN #{beginTime} and #{endTime}" +
"INNER JOIN sup_depart sd1 " +
"on sd.pid=sd1.id and sd1.statistics_group_id=#{groupType} " +
"GROUP BY sd1.id " +
"ORDER BY `value` DESC ")
"LEFT JOIN sup_depart sd ON ng.involveDepartId = sd.id " +
"LEFT JOIN sup_depart sd1 ON sd.pid= sd1.id " +
"WHERE ng.checkStatus<>3 " +
"AND ng.problemSourcesCode IN (2, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25) " +
"AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime} " +
"AND sd1.statistics_group_id = #{groupType} " +
"GROUP BY sd1.short_name " +
"ORDER BY `value` DESC " )
List<OrganizeProblemRankVo> selectOrganizeProblemRank(Integer groupType, Date beginTime, Date endTime);
// 业务类型占比
@ -166,7 +168,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"GROUP BY `name`;")
List<SuperviseMapIconVo> getSupervisionMapIconInfo(Date beginTime, Date endTime);
List<EchartsVo> getSupervisionTrend(String time, String[] args);
List<EchartsVo> getSupervisionTrend(String year, String[] args);
@Select("SELECT count(DISTINCT(ng.id)) as proTotal, " +
"count(DISTINCT IF(ng.isRectifyCode = 1, ng.id, null) ) as changed," +
@ -348,17 +350,20 @@ public interface NegativeMapper extends BaseMapper<Negative> {
SubOneOverViewVo getSubOneSupervisionRankOverView(Integer departPId, Integer statisticsGroupId, Date beginTime, Date endTime, String[] args);
List<RankVo> getSubOneSupervisionRank(Integer departPId, Integer statisticsGroupId, Date beginTime, Date endTime, String[] args);
@Select("SELECT count(DISTINCT ng.id) AS one, " +
"COUNT(processing_status='processing' ) AS two, " +
"COUNT( DISTINCT( if(processing_status='processing', ng.id, NULL) ) ) AS two, " +
"count(DISTINCT involveDepartId) AS three, " +
"count(DISTINCT nb.blameIdCode) AS four, " +
"COALESCE( ROUND( COUNT(processing_status='completed' ) / NULLIF(COUNT(DISTINCT ng.id), 0) * 100, 1), 0) AS five " +
"FROM negative ng " +
"INNER JOIN (SELECT id, short_name FROM sup_depart sd WHERE sd.pid = #{departPId} ) AS temp ON ng.involveDepartId=temp.id " +
"LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " +
" WHERE discoveryTime BETWEEN #{beginTime} and #{endTime}")
"ROUND( COUNT( DISTINCT( if(processing_status='completed', ng.id, NULL) ) ) / count(DISTINCT ng.id)*100, 1) AS five " +
"FROM negative ng " +
"INNER JOIN sup_depart sd ON ng.involveDepartId = sd.id " +
"LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " +
"WHERE sd.pid= #{departPId} " +
"AND ng.discoveryTime BETWEEN #{beginTime} and #{endTime} " +
"AND ng.checkStatus <>3 ")
SubOneOverViewVo getSubOneOverView(Integer departPId, Date beginTime, Date endTime);
// endregion
@ -413,4 +418,89 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY npr.threeLevelContent ")
List<EchartsVo> getSubOneVideoSuperviseProblemTypeRate(Integer departId, Date beginTime, Date endTime);
@Select("SELECT count(DISTINCT(ng.id)) as proTotal, " +
"count(DISTINCT IF(ng.isRectifyCode = 1, ng.id, null) ) as changed, " +
"count(DISTINCT IF(ng.isRectifyCode = 0, ng.id, null) ) as changing, " +
"COALESCE( ROUND( COUNT(DISTINCT IF(ng.isRectifyCode = 1, ng.id, NULL)) / NULLIF(COUNT(DISTINCT ng.id), 0) * 100, 1 ), 0 ) AS correctionRate FROM sup_depart sd " +
"INNER JOIN negative ng on ng.involveDepartId=sd.id AND sd.statistics_group_id=10 AND sd.pid=#{departId} " +
"WHERE ng.problemSourcesCode=13 AND ng.checkStatus<>3 " +
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime} ")
DayTimeSuperviseVo getPoliceChangedRankOverView(Integer departId, Date beginTime, Date endTime);
@Select("SELECT count(DISTINCT(ng.id)) as proTotal, " +
"count(DISTINCT IF(ng.isRectifyCode = 1, ng.id, null) ) as changed, " +
"count(DISTINCT IF(ng.isRectifyCode = 0, ng.id, null) ) as changing, " +
"COALESCE( ROUND( COUNT(DISTINCT IF(ng.isRectifyCode = 1, ng.id, NULL)) / NULLIF(COUNT(DISTINCT ng.id), 0) * 100, 1 ), 0 ) AS correctionRate FROM sup_depart sd " +
"INNER JOIN negative ng on ng.involveDepartId=sd.id AND sd.statistics_group_id!=10 AND sd.pid=#{departId} " +
"WHERE ng.problemSourcesCode=13 AND ng.checkStatus<>3 " +
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime} ")
DayTimeSuperviseVo getTeamChangedRankOverView(Integer departId, Date beginTime, Date endTime);
@Select("SELECT sd.short_name as label, " +
"sd.id AS departId, " +
"count( DISTINCT ng.id) AS denominator, " +
"count( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL )) AS numerator, " +
"ROUND( COUNT(DISTINCT if(ng.isRectifyCode=1, ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS rate, " +
"ROUND( COUNT(DISTINCT if(ng.isRectifyCode=1, ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS value " +
"FROM sup_depart sd " +
"INNER JOIN negative ng on ng.involveDepartId=sd.id AND sd.statistics_group_id=10 AND sd.pid=#{departId} " +
"LEFT JOIN negative_blame nb on ng.id=nb.negativeId " +
"WHERE ng.problemSourcesCode=13 " +
"AND ng.checkStatus<>3 " +
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY label " +
"order by rate desc;")
List<RankVo> getSubOnePoliceChangedRateRank(Integer departId, Date beginTime, Date endTime);
@Select("SELECT sd.short_name as label, " +
"sd.id AS departId, " +
"count( DISTINCT ng.id) AS denominator, " +
"count( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL )) AS numerator, " +
"ROUND( COUNT(DISTINCT if(ng.isRectifyCode=1, ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS rate, " +
"ROUND( COUNT(DISTINCT if(ng.isRectifyCode=1, ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS value " +
"FROM sup_depart sd " +
"INNER JOIN negative ng on ng.involveDepartId=sd.id AND sd.statistics_group_id!=10 AND sd.pid=#{departId} " +
"LEFT JOIN negative_blame nb on ng.id=nb.negativeId " +
"WHERE ng.problemSourcesCode=13 " +
"AND ng.checkStatus<>3 " +
"AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " +
"GROUP BY label " +
"order by rate desc;")
List<RankVo> getSubOneTeamChangedRateRank(Integer departId, Date beginTime, Date endTime);
@Select("SELECT npr.oneLevelContent as name, " +
"count(*) value " +
"FROM negative ng " +
"INNER JOIN negative_problem_relation npr ON ng.id = npr.negativeId " +
"INNER JOIN sup_depart sd ON ng.involveDepartId=sd.id AND sd.pid=#{departId} " +
"WHERE 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> getSubOneProblemTypeRatio(Integer departId, Date beginTime, Date endTime);
@Select("SELECT COUNT(DISTINCT c.id) AS problemNumber, " +
"COUNT(DISTINCT IF(c.isRectifyCode = 0, c.id, null)) AS rectifingNumber, " +
"COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, null)) AS rectifedNumber, " +
"COUNT(DISTINCT c.involveDepartId) AS departNumber, " +
"COUNT(DISTINCT d.blameIdCode) AS personNumber, " +
"ROUND( COUNT(DISTINCT IF(c.isRectifyCode = 1, c.id, NULL)) / COUNT(DISTINCT c.id) * 100, 1) AS rectifyRate " +
"FROM sup_depart b INNER JOIN negative c ON b.id = c.involveDepartId AND b.pid=#{departId} " +
"LEFT JOIN negative_blame d ON c.id = d.negativeId " +
"WHERE discoveryTime BETWEEN #{beginTime} AND #{endTime} " +
"AND checkStatus <>3 " +
"AND problemSourcesCode IN (13, 15)")
SupervisionNotifyOverView getAllSubOneSupervisionNotifyCount(Integer departId, Date beginTime, Date endTime);
@Select("SELECT m.month_name AS `name`, IFNULL(COUNT(temp.id), 0) AS `value` FROM sup_month_monthname m " +
"LEFT JOIN " +
"( " +
"SELECT ng.* FROM negative ng INNER JOIN sup_depart sd ON ng.involveDepartId=sd.id WHERE sd.pid=#{departId} AND ng.checkStatus != 3 AND ng.problemSourcesCode IN (13, 15) " +
") AS temp ON DATE_FORMAT(temp.discoveryTime, '%m') = m.month " +
"AND YEAR(temp.discoveryTime) = #{year} " +
"GROUP by m.month_name " +
"ORDER BY m.month ASC;")
List<EchartsVo> getSubOneSupervisionTrend(Integer departId, String year);
}

19
src/main/java/com/biutag/supervision/pojo/vo/SupervisionNotifyOverView.java

@ -0,0 +1,19 @@
package com.biutag.supervision.pojo.vo;
import lombok.Data;
/**
* @Auther: sh
* @Date: 2024/12/17 16:44
* @Description:
*/
@Data
public class SupervisionNotifyOverView {
private String problemNumber;
private String rectifingNumber;
private String rectifedNumber;
private String departNumber;
private String personNumber;
private String rectifyRate;
}

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

@ -136,6 +136,8 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl<DataSupervisio
return res;
}
// endregion

64
src/main/java/com/biutag/supervision/service/SubOneSupervisionNotifyService.java

@ -0,0 +1,64 @@
package com.biutag.supervision.service;
import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.pojo.vo.DayTimeSuperviseVo;
import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.RankVo;
import com.biutag.supervision.pojo.vo.SupervisionNotifyOverView;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* @Auther: sh
* @Date: 2024/12/17 16:27
* @Description: 现场督察二级大屏服务
*/
@RequiredArgsConstructor
@Service
public class SubOneSupervisionNotifyService {
private final NegativeMapper negativeMapper;
public DayTimeSuperviseVo getChangedRankOverView(Integer groupId, Integer departId, Date beginTime, Date endTime) {
DayTimeSuperviseVo res;
if (groupId != null && groupId == 10) {
res = negativeMapper.getPoliceChangedRankOverView(departId, beginTime, endTime);
} else {
res = negativeMapper.getTeamChangedRankOverView(departId, beginTime, endTime);
}
return res;
}
public List<RankVo> getSubOneChangedRateRank(Integer groupId, Integer departId, Date beginTime, Date endTime) {
List<RankVo> res;
if (groupId != null && groupId == 10) {
res = negativeMapper.getSubOnePoliceChangedRateRank(departId, beginTime, endTime);
} else {
res = negativeMapper.getSubOneTeamChangedRateRank(departId, beginTime, endTime);
}
return res;
}
public List<EchartsVo> getSubOneProblemTypeRatio(Integer departId, Date beginTime, Date endTime) {
List<EchartsVo> res = negativeMapper.getSubOneProblemTypeRatio(departId, beginTime, endTime);
return res;
}
public SupervisionNotifyOverView getAllSubOneSupervisionNotifyCount(Integer departId, Date beginTime, Date endTime) {
SupervisionNotifyOverView res = negativeMapper.getAllSubOneSupervisionNotifyCount(departId, beginTime, endTime);
return res;
}
public List<EchartsVo> getSubOneSupervisionTrend(Integer departId, String year) {
List<EchartsVo> res = negativeMapper.getSubOneSupervisionTrend(departId, year);
return res;
}
public DayTimeSuperviseVo getSubOneYellowBetOverview(Date beginTime, Date endTime, Integer departId, Integer groupId) {
return null;
}
}

3
src/main/java/com/biutag/supervision/service/SubOneVideoSuperviseService.java

@ -22,6 +22,7 @@ import java.util.List;
public class SubOneVideoSuperviseService {
private final NegativeMapper negativeMapper;
public VideoSuperviseCountVo getSubOneAllVideoSuperviseCount(Date beginTime, Date endTime, Integer departId) {
VideoSuperviseCountVo res = negativeMapper.getSubOneAllVideoSuperviseCount(beginTime, endTime, departId);
return res;
@ -43,7 +44,7 @@ public class SubOneVideoSuperviseService {
}
public List<EchartsVo> getSubOneVideoSuperviseProblemTypeRate(Integer departId, Date beginTime, Date endTime) {
List<EchartsVo> res = negativeMapper.getSubOneVideoSuperviseProblemTypeRate(departId, beginTime, endTime);
List<EchartsVo> res = negativeMapper.getSubOneVideoSuperviseProblemTypeRate(departId, beginTime, endTime);
return res;
}
}

32
src/main/resources/mapper/NegativeMapper.xml

@ -31,7 +31,7 @@
SELECT m.month_name AS `name`, IFNULL(COUNT(ng.id), 0) AS `value`
FROM sup_month_monthname m
LEFT JOIN negative ng ON DATE_FORMAT(ng.discoveryTime, '%m') = m.month
AND YEAR(ng.discoveryTime) = #{time}
AND YEAR(ng.discoveryTime) = #{year}
AND ng.checkStatus != 3
AND ng.problemSourcesCode IN
<foreach item="item" index="index" collection="args" open="(" separator="," close=")">#{item}</foreach>
@ -161,26 +161,28 @@
</select>
<!-- 首页二级大屏督察问题排行 -->
<select id="getSubOneSupervisionRank" resultType="com.biutag.supervision.pojo.vo.RankVo">
SELECT temp.short_name as label,
temp.id AS departId,
count(DISTINCT ng.id) AS denominator,
count(DISTINCT IF(ng.isRectifyCode = 1, ng.id, NULL)) AS numerator,
ROUND(COUNT(DISTINCT if(ng.isRectifyCode = 1, ng.id, NULL)) / count(DISTINCT ng.id) * 100, 1) AS rate,
ROUND(COUNT(DISTINCT if(ng.isRectifyCode = 1, ng.id, NULL)) / count(DISTINCT ng.id) * 100, 1) AS `value`
SELECT
sd.short_name AS label,
sd.id AS departId,
COUNT(DISTINCT ng.id) AS denominator,
count( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL )) AS numerator,
ROUND( COUNT(DISTINCT if(ng.isRectifyCode=1, ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS rate,
ROUND( COUNT(DISTINCT if(ng.isRectifyCode=1, ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS `value`
FROM negative ng
INNER JOIN
(SELECT id, short_name FROM sup_depart sd WHERE sd.pid = #{departPId}
INNER JOIN sup_depart sd ON ng.involveDepartId=sd.id
WHERE ng.problemSourcesCode IN
<foreach collection="args" item="arg" open="(" separator="," close=")">#{arg}</foreach>
AND ng.checkStatus!=3
AND sd.pid = #{departPId}
<if test="statisticsGroupId != 0">AND statistics_group_id = #{statisticsGroupId}</if>
<if test="statisticsGroupId == 0">AND statistics_group_id != 10</if>
) AS temp
ON ng.involveDepartId = temp.id
WHERE ng.problemSourcesCode IN
<foreach collection="args" item="arg" open="(" separator="," close=")">#{arg}</foreach>
AND discoveryTime BETWEEN #{beginTime} AND #{endTime}
AND ng.discoveryTime BETWEEN #{beginTime} AND #{endTime}
GROUP BY label
order by rate desc;
ORDER BY rate DESC;
</select>
<!-- 视频督察二级大屏的问题趋势-->
<select id="getSubOneVideoSuperviseTrend" resultType="com.biutag.supervision.pojo.vo.EchartsVo">
SELECT m.month_name AS `name`, IFNULL(COUNT(temp.id), 0) AS `value`

Loading…
Cancel
Save