14 changed files with 540 additions and 64 deletions
@ -0,0 +1,170 @@
|
||||
package com.biutag.supervision.controller.subdatav; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
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; |
||||
|
||||
/** |
||||
* @Auther: sh |
||||
* @Date: 2024/12/16 17:12 |
||||
* @Description: |
||||
*/ |
||||
@Tag(name = "视频督察子屏", description = "视频督察子屏") |
||||
@RestController |
||||
@RequiredArgsConstructor |
||||
@RequestMapping("datav/sub1/videoSupervise") |
||||
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") |
||||
public Result<JSONObject> getSubOneVideoSuperviseProblemRank(@RequestParam Integer departId, |
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, |
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { |
||||
List<OrganizeProblemRankVo> policeVideoSuperviseProblemRankList = subOneVideoSuperviseService.getSuboOneVideoSuperviseProblemRank(beginTime, endTime, 10, departId); |
||||
List<OrganizeProblemRankVo> teamVideoSuperviseProblemRankList = subOneVideoSuperviseService.getSuboOneVideoSuperviseProblemRank(beginTime, endTime, -1, departId); |
||||
JSONObject data = new JSONObject(); |
||||
data.fluentPut("policeVideoSuperviseProblemRankList", policeVideoSuperviseProblemRankList); |
||||
data.fluentPut("teamVideoSuperviseProblemRankList", teamVideoSuperviseProblemRankList); |
||||
return Result.success(data); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 视频督察二级大屏中央数据 |
||||
* |
||||
* @param beginTime 开始时间 |
||||
* @param endTime 结束时间 |
||||
* @return Result<JSONObject> |
||||
*/ |
||||
@Operation(summary = "视频督察二级大屏中央数据") |
||||
@GetMapping("/getSubOneAllVideoSuperviseCount") |
||||
public Result<JSONObject> getSubOneAllVideoSuperviseCount(@RequestParam Integer departId, |
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, |
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { |
||||
VideoSuperviseCountVo overview = subOneVideoSuperviseService.getSubOneAllVideoSuperviseCount(beginTime, endTime, departId); |
||||
JSONObject data = new JSONObject().fluentPut("overview", overview); |
||||
return Result.success(data); |
||||
} |
||||
|
||||
|
||||
// 获取视频督察大屏中央问题趋势统计
|
||||
@Operation(summary = "数据大屏问题趋势统计") |
||||
@GetMapping("/getSubOneVideoSuperviseTrend") |
||||
public Result<JSONObject> getSubOneVideoSuperviseTrend(@RequestParam Integer departId, @RequestParam Integer year) { |
||||
List<EchartsVo> videoSuperviseTrendList = subOneVideoSuperviseService.getSubOneVideoSuperviseTrend(String.valueOf(year), SPDC.getValue(), departId.toString()); |
||||
JSONObject jsonObject = new JSONObject().fluentPut("videoSuperviseTrendList", videoSuperviseTrendList); |
||||
return Result.success(jsonObject); |
||||
} |
||||
|
||||
|
||||
} |
||||
|
||||
@ -0,0 +1,23 @@
|
||||
package com.biutag.supervision.pojo.vo; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* @Auther: sh |
||||
* @Date: 2024/12/16 09:26 |
||||
* @Description: 信访大屏地图vo |
||||
*/ |
||||
@Data |
||||
public class MailMapIconVo implements Serializable { |
||||
private String name; // 分县市局名字
|
||||
private String departId; // 分县市局id
|
||||
|
||||
private String total; |
||||
private String countryTotal; |
||||
private String policeTotal; |
||||
private String commissionerTotal; |
||||
private String numTotal; // 12337
|
||||
} |
||||
|
||||
@ -0,0 +1,45 @@
|
||||
package com.biutag.supervision.service; |
||||
|
||||
import com.biutag.supervision.mapper.NegativeMapper; |
||||
import com.biutag.supervision.pojo.vo.EchartsVo; |
||||
import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo; |
||||
import com.biutag.supervision.pojo.vo.VideoSuperviseCountVo; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Auther: sh |
||||
* @Date: 2024/12/16 17:18 |
||||
* @Description: |
||||
*/ |
||||
|
||||
@RequiredArgsConstructor |
||||
@Service |
||||
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; |
||||
} |
||||
|
||||
public List<OrganizeProblemRankVo> getSuboOneVideoSuperviseProblemRank(Date beginTime, Date endTime, Integer groupId, Integer departId) { |
||||
List<OrganizeProblemRankVo> res ; |
||||
if (groupId == 10) { |
||||
res = negativeMapper.getSuboOneVideoSupervisePoliceProblemRank(beginTime, endTime, groupId, departId); |
||||
} else { |
||||
res = negativeMapper.getSuboOneVideoSuperviseTeamProblemRank(beginTime, endTime, groupId, departId); |
||||
} |
||||
return res; |
||||
} |
||||
|
||||
public List<EchartsVo> getSubOneVideoSuperviseTrend(String year, String problemCode, String departId) { |
||||
List<EchartsVo> res = negativeMapper.getSubOneVideoSuperviseTrend(year, problemCode, departId); |
||||
return res; |
||||
} |
||||
} |
||||
|
||||
@ -0,0 +1,33 @@
|
||||
package com.biutag.supervision.service; |
||||
|
||||
import com.biutag.supervision.pojo.vo.MailMapIconVo; |
||||
import jakarta.annotation.Resource; |
||||
import org.junit.jupiter.api.Test; |
||||
import org.springframework.boot.test.context.SpringBootTest; |
||||
|
||||
import javax.xml.crypto.Data; |
||||
|
||||
import java.text.ParseException; |
||||
import java.text.SimpleDateFormat; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
import static org.junit.jupiter.api.Assertions.*; |
||||
|
||||
@SpringBootTest |
||||
class DataMailServiceTest { |
||||
|
||||
@Resource |
||||
private DataMailService dataMailService; |
||||
@Test |
||||
void getMailMapIcon() throws ParseException { |
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); |
||||
Date begin = formatter.parse("2024-01-01"); |
||||
Date end = formatter.parse("2024-12-29"); |
||||
List<MailMapIconVo> mailMapIcon = dataMailService.getMailMapIcon(begin, end); |
||||
for (MailMapIconVo mailMapIconVo : mailMapIcon) { |
||||
System.out.println(mailMapIconVo.toString()); |
||||
} |
||||
|
||||
} |
||||
} |
||||
Loading…
Reference in new issue