From e701dff07b47b66262868663982b1b7952176e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E7=88=B1=E5=AD=A6=E4=B9=A0=E7=9A=84=E7=9F=B3?= =?UTF-8?q?=E5=90=8C=E5=AD=A6?= <2936013465@qq.com> Date: Tue, 17 Dec 2024 18:53:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=B0=E5=9C=BA=E7=9D=A3=E5=AF=9F=E4=BA=8C?= =?UTF-8?q?=E7=BA=A7=E5=A4=A7=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SubOneSupervisionNotifyController.java | 247 ++++++++++++++++++ .../SubOneVideoSuperviseController.java | 89 ------- .../supervision/mapper/NegativeMapper.java | 120 +++++++-- .../pojo/vo/SupervisionNotifyOverView.java | 19 ++ .../DataSupervisionNotifyServiceImpl.java | 2 + .../SubOneSupervisionNotifyService.java | 64 +++++ .../service/SubOneVideoSuperviseService.java | 3 +- src/main/resources/mapper/NegativeMapper.xml | 32 +-- 8 files changed, 456 insertions(+), 120 deletions(-) create mode 100644 src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java create mode 100644 src/main/java/com/biutag/supervision/pojo/vo/SupervisionNotifyOverView.java create mode 100644 src/main/java/com/biutag/supervision/service/SubOneSupervisionNotifyService.java diff --git a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java new file mode 100644 index 0000000..c68c528 --- /dev/null +++ b/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 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 policeChangedRankList = subOneSupervisionNotifyService.getSubOneChangedRateRank(10, departId, beginTime, endTime); + List 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 getSubOneProblemTypeRate(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + List 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 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 +// */ +// @GetMapping("/getMap") +// @Cacheable(cacheNames = "superviseMap", key = "'p_'+ #endTime") +// public Result getMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, +// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { +// //地图数据 +// List superviseTempMapVoList = dataSupervisionNotifyService.getSupervisionMapIconInfo(beginTime, endTime); +// JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList); +// return Result.success(data); +// } + + /** + * 获取现场督察问题趋势 + * + * @param year 年份 + * @return List + */ + @GetMapping("/getSubOneSupervisionTrend") + public Result getSubOneSupervisionTrend(@RequestParam Integer departId, + @RequestParam String year) { + List 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 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 fxsjYellowBetRankList = subOneSupervisionNotifyService.getSubOneYellowBetRankList(beginTime, endTime, departId, 1); +// List 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 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 fxsjGunControllerRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 3, 2); +// List 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 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 fxsjCompanyProblemRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 3, 3); +// List 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 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 fxsjHandleCaseRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 3, 4); +// List 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 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 fxsjCheckBeerRankList = dataSupervisionNotifyService.getYellowBetRankList(beginTime, endTime, 3, 5); +// List 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 + + +} + + diff --git a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneVideoSuperviseController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneVideoSuperviseController.java index deee919..8ec3354 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneVideoSuperviseController.java +++ b/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 getVideoSuperviseProblemRank(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, -// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { -// List fxsjVideoSuperviseProblemRankList = videoSuperviseService.getVideoSuperviseProblemRank(beginTime, endTime, 3); -// List 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 -// */ -// @Operation(summary = "视频督察大屏中央数据") -// @GetMapping("/getAllVideoSuperviseCount") -// public Result 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 getVideoSuperviseMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, -// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { -// -// // 地图数据 -// List 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 getVideoSuperviseTrend(@RequestParam Integer year) { -// List 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 getVideoSuperviseProblemTypeRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, -// @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { -// List videoSuperviseProblemTypeRate = videoSuperviseService.getVideoSuperviseProblemTypeRate(beginTime, endTime); -// JSONObject jsonObject = new JSONObject().fluentPut("videoSuperviseProblemTypeRate", videoSuperviseProblemTypeRate); -// return Result.success(jsonObject); -// } -// -// -// // endregion - @Operation(summary = "视频督察二级大屏问题数排名") @GetMapping("/getSubOneVideoSuperviseProblemRank") diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index b2d6469..4885a64 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -20,15 +20,17 @@ public interface NegativeMapper extends BaseMapper { * @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 selectOrganizeProblemRank(Integer groupType, Date beginTime, Date endTime); // 业务类型占比 @@ -166,7 +168,7 @@ public interface NegativeMapper extends BaseMapper { "GROUP BY `name`;") List getSupervisionMapIconInfo(Date beginTime, Date endTime); - List getSupervisionTrend(String time, String[] args); + List 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 { SubOneOverViewVo getSubOneSupervisionRankOverView(Integer departPId, Integer statisticsGroupId, Date beginTime, Date endTime, String[] args); + List 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 { "AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + "GROUP BY npr.threeLevelContent ") List 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 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 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 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 getSubOneSupervisionTrend(Integer departId, String year); } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/SupervisionNotifyOverView.java b/src/main/java/com/biutag/supervision/pojo/vo/SupervisionNotifyOverView.java new file mode 100644 index 0000000..a995f50 --- /dev/null +++ b/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; +} + diff --git a/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java b/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java index b35d01e..dd6bf80 100644 --- a/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java @@ -136,6 +136,8 @@ public class DataSupervisionNotifyServiceImpl extends ServiceImpl getSubOneChangedRateRank(Integer groupId, Integer departId, Date beginTime, Date endTime) { + List res; + if (groupId != null && groupId == 10) { + res = negativeMapper.getSubOnePoliceChangedRateRank(departId, beginTime, endTime); + } else { + res = negativeMapper.getSubOneTeamChangedRateRank(departId, beginTime, endTime); + } + return res; + } + + public List getSubOneProblemTypeRatio(Integer departId, Date beginTime, Date endTime) { + List 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 getSubOneSupervisionTrend(Integer departId, String year) { + List res = negativeMapper.getSubOneSupervisionTrend(departId, year); + return res; + } + + public DayTimeSuperviseVo getSubOneYellowBetOverview(Date beginTime, Date endTime, Integer departId, Integer groupId) { + return null; + } +} + diff --git a/src/main/java/com/biutag/supervision/service/SubOneVideoSuperviseService.java b/src/main/java/com/biutag/supervision/service/SubOneVideoSuperviseService.java index 23c00cb..a3d3478 100644 --- a/src/main/java/com/biutag/supervision/service/SubOneVideoSuperviseService.java +++ b/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 getSubOneVideoSuperviseProblemTypeRate(Integer departId, Date beginTime, Date endTime) { - List res = negativeMapper.getSubOneVideoSuperviseProblemTypeRate(departId, beginTime, endTime); + List res = negativeMapper.getSubOneVideoSuperviseProblemTypeRate(departId, beginTime, endTime); return res; } } diff --git a/src/main/resources/mapper/NegativeMapper.xml b/src/main/resources/mapper/NegativeMapper.xml index c7502ea..4acc30c 100644 --- a/src/main/resources/mapper/NegativeMapper.xml +++ b/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 #{item} @@ -161,26 +161,28 @@ +