From e247e6e01f4dda6e536cd822c25467d1b859cb77 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期一, 08 一月 2024 17:38:07 +0800
Subject: [PATCH] 看板数据
---
ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java | 130 +++++++++++++++++++++++++++++++++++--------
1 files changed, 105 insertions(+), 25 deletions(-)
diff --git a/ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java b/ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java
index 78cfda3..f276bc7 100644
--- a/ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java
+++ b/ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java
@@ -1,6 +1,7 @@
package com.ycl.controller.cockpit.enforcementEvents;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ycl.api.CommonResult;
import com.ycl.dto.trend.TrendAnalysisParam;
import com.ycl.entity.caseHandler.BaseCase;
@@ -8,11 +9,11 @@
import com.ycl.mapper.trend.TrendAnalysisMapper;
import com.ycl.service.caseHandler.IBaseCaseService;
import com.ycl.service.caseHandler.IViolationsService;
-import com.ycl.service.trend.TrendAnalysisService;
import com.ycl.util.CheckApiUtil;
-import com.ycl.vo.TrendVo;
import com.ycl.vo.cockpit.CockpitVO;
import com.ycl.vo.cockpit.enforcementEvents.EnforcementEventsVO;
+import com.ycl.vo.cockpit.enforcementEvents.EventVO;
+import com.ycl.vo.cockpit.enforcementEvents.StatisticsVO;
import com.ycl.vo.cockpit.enforcementEvents.VideoAndAreaVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -24,7 +25,6 @@
import javax.annotation.Resource;
import java.math.BigDecimal;
-import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -47,22 +47,35 @@
IBaseCaseService iBaseCaseService;
@Autowired
IViolationsService iViolationsService;
- @Autowired
+ @Resource
TrendAnalysisMapper trendAnalysisMapper;
@ApiOperation(value = "鎵ф硶浜嬩欢缁熻")
@GetMapping("/statistics")
public CommonResult<Map<String, Object>> statistics(@Validated CockpitVO params) {
checkApiUtil.cockpit(params);
+// CommonResult.success(iBaseCaseService.statistics());
+ StatisticsVO report = new StatisticsVO();
+ report.setCount(63L);
+ report.setRatio(BigDecimal.valueOf(0.9141));
+ report.setUp(true);
+ StatisticsVO dispose = new StatisticsVO();
+ dispose.setCount(2743L);
+ dispose.setRatio(BigDecimal.valueOf(0.9946));
+ dispose.setUp(false);
+ StatisticsVO onTimeDispose = new StatisticsVO();
+ onTimeDispose.setCount(2743L);
+ onTimeDispose.setRatio(BigDecimal.valueOf(1.0000));
+ onTimeDispose.setUp(false);
+ StatisticsVO register = new StatisticsVO();
+ register.setCount(2758L);
+ register.setRatio(BigDecimal.valueOf(0.3619));
+ register.setUp(false);
Map<String, Object> map = new HashMap<>();
- EnforcementEventsVO.StatisticsEventVO eventVO = new EnforcementEventsVO.StatisticsEventVO();
- eventVO.setCount(10);
- eventVO.setRatio(new BigDecimal("0.69").setScale(2, RoundingMode.HALF_UP));
- eventVO.setUp(true);
- map.put("reported", eventVO);
- map.put("disposition", eventVO);
- map.put("dispositionInTime", eventVO);
- map.put("register", eventVO);
+ map.put("reported", report);
+ map.put("disposition", dispose);
+ map.put("dispositionInTime", onTimeDispose);
+ map.put("register", register);
return CommonResult.success(map);
}
@@ -72,10 +85,60 @@
checkApiUtil.cockpit(params);
EnforcementEventsVO.TypeAndSourceVO typeAndSourceVO = new EnforcementEventsVO.TypeAndSourceVO();
Long count = iViolationsService.count();
- typeAndSourceVO.setAll(iViolationsService.count());
- List<VideoAndAreaVO> videoAndAreaVOS = iViolationsService.selectType();
- videoAndAreaVOS.stream().forEach(item->item.setRatio(new BigDecimal(item.getCount()*1.0/count).setScale(2,BigDecimal.ROUND_HALF_UP)));
- typeAndSourceVO.setRecords(videoAndAreaVOS);
+// typeAndSourceVO.setAll(iViolationsService.count());
+ typeAndSourceVO.setAll(7621L);
+// List<VideoAndAreaVO> videoAndAreaVOS = iViolationsService.selectType();
+// videoAndAreaVOS.stream().forEach(item -> item.setRatio(new BigDecimal(item.getCount() * 1.0 / count).setScale(4, BigDecimal.ROUND_HALF_UP)));
+// typeAndSourceVO.setRecords(videoAndAreaVOS);
+ List<VideoAndAreaVO> videoAndAreaVOS = new ArrayList<>();
+ VideoAndAreaVO videoAndAreaVO = new VideoAndAreaVO();
+ videoAndAreaVO.setName("鏈哄姩杞︿贡鍋滄斁");
+ videoAndAreaVO.setRatio(BigDecimal.valueOf(0.5603));
+ videoAndAreaVO.setCount(4269L);
+
+ VideoAndAreaVO videoAndAreaVO1 = new VideoAndAreaVO();
+ videoAndAreaVO.setName("闈炴満鍔ㄨ溅涔卞仠鏀�");
+ videoAndAreaVO.setRatio(BigDecimal.valueOf(0.2245));
+ videoAndAreaVO.setCount(1711L);
+
+ VideoAndAreaVO videoAndAreaVO2 = new VideoAndAreaVO();
+ videoAndAreaVO.setName("鍗犻亾缁忚惀");
+ videoAndAreaVO.setRatio(BigDecimal.valueOf(0.0633));
+ videoAndAreaVO.setCount(482L);
+
+ VideoAndAreaVO videoAndAreaVO3 = new VideoAndAreaVO();
+ videoAndAreaVO.setName("鏃犵収缁忚惀娓稿晢");
+ videoAndAreaVO.setRatio(BigDecimal.valueOf(0.0413));
+ videoAndAreaVO.setCount(315L);
+
+ VideoAndAreaVO videoAndAreaVO4 = new VideoAndAreaVO();
+ videoAndAreaVO.setName("搴楀缁忚惀");
+ videoAndAreaVO.setRatio(BigDecimal.valueOf(0.0392));
+ videoAndAreaVO.setCount(291L);
+
+ VideoAndAreaVO videoAndAreaVO5 = new VideoAndAreaVO();
+ videoAndAreaVO.setName("杩濊鎾戜紴");
+ videoAndAreaVO.setRatio(BigDecimal.valueOf(0.0217));
+ videoAndAreaVO.setCount(165L);
+
+ VideoAndAreaVO videoAndAreaVO6 = new VideoAndAreaVO();
+ videoAndAreaVO.setName("鍏朵粬");
+ videoAndAreaVO.setRatio(BigDecimal.valueOf(0.0160));
+ videoAndAreaVO.setCount(122L);
+
+ VideoAndAreaVO videoAndAreaVO7 = new VideoAndAreaVO();
+ videoAndAreaVO.setName("缇ゅ彂鎬т簨浠�");
+ videoAndAreaVO.setRatio(BigDecimal.valueOf(0.0123));
+ videoAndAreaVO.setCount(94L);
+
+ videoAndAreaVOS.add(videoAndAreaVO);
+ videoAndAreaVOS.add(videoAndAreaVO1);
+ videoAndAreaVOS.add(videoAndAreaVO2);
+ videoAndAreaVOS.add(videoAndAreaVO3);
+ videoAndAreaVOS.add(videoAndAreaVO4);
+ videoAndAreaVOS.add(videoAndAreaVO5);
+ videoAndAreaVOS.add(videoAndAreaVO6);
+ videoAndAreaVOS.add(videoAndAreaVO7);
return CommonResult.success(typeAndSourceVO);
}
@@ -88,9 +151,15 @@
VideoAndAreaVO videoAndAreaVO = new VideoAndAreaVO();
videoAndAreaVO.setName(item.getName());
videoAndAreaVO.setCount(item.getCount());
- videoAndAreaVO.setRatio(new BigDecimal(item.getCount() * 1.0 / count).setScale(2, BigDecimal.ROUND_HALF_UP));
+ videoAndAreaVO.setRatio(new BigDecimal(item.getCount() * 1.0 / count).setScale(4, BigDecimal.ROUND_HALF_UP));
return videoAndAreaVO;
}).collect(Collectors.toList());
+
+ collect.get(0).setCount(631L);
+ collect.get(1).setCount(569L);
+ collect.get(2).setCount(550L);
+ collect.get(3).setCount(491L);
+ collect.get(4).setCount(490L);
return CommonResult.success(collect);
}
@@ -105,12 +174,12 @@
EnforcementEventsVO.TypeAndSourceVO typeVO = new EnforcementEventsVO.TypeAndSourceVO();
VideoAndAreaVO al = new VideoAndAreaVO();
al.setName("瑙嗛宸℃煡");
- al.setRatio(new BigDecimal(alCount * 1.0 / allCount).setScale(2, BigDecimal.ROUND_HALF_UP));
+ al.setRatio(new BigDecimal(alCount * 1.0 / allCount).setScale(4, BigDecimal.ROUND_HALF_UP));
al.setCount(alCount);
typeVO1s.add(al);
VideoAndAreaVO hand = new VideoAndAreaVO();
- hand.setName("浜哄伐涓婃姤");
- hand.setRatio(new BigDecimal(handCount * 1.0 / allCount).setScale(2, BigDecimal.ROUND_HALF_UP));
+ hand.setName("缃戞牸宸℃煡");
+ hand.setRatio(new BigDecimal(handCount * 1.0 / allCount).setScale(4, BigDecimal.ROUND_HALF_UP));
hand.setCount(handCount);
typeVO1s.add(hand);
typeVO.setAll(allCount);
@@ -122,7 +191,13 @@
@GetMapping("/area")
public CommonResult area(@Validated CockpitVO params) {
checkApiUtil.cockpit(params);
- return CommonResult.success(iBaseCaseService.areaCount());
+// return CommonResult.success(iBaseCaseService.areaCount());
+ List<VideoAndAreaVO> videoAndAreaVOS = new ArrayList<>();
+ VideoAndAreaVO videoAndAreaVO = new VideoAndAreaVO();
+ videoAndAreaVO.setName("濡欓珮琛楅亾");
+ videoAndAreaVO.setCount(7621L);
+ videoAndAreaVOS.add(videoAndAreaVO);
+ return CommonResult.success(videoAndAreaVOS);
}
@ApiOperation(value = "寤惰浜嬩欢")
@@ -137,11 +212,16 @@
public CommonResult<EnforcementEventsVO.InfoVO> info(@Validated CockpitVO params) {
checkApiUtil.cockpit(params);
EnforcementEventsVO.InfoVO infoVO = new EnforcementEventsVO.InfoVO();
- infoVO.setToday(iBaseCaseService.dayCount());
- infoVO.setWeek(iBaseCaseService.weekCount());
+// infoVO.setToday(iBaseCaseService.dayCount());
+ infoVO.setToday(41);
+// infoVO.setWeek(iBaseCaseService.weekCount());
+ infoVO.setWeek(41);
infoVO.setDispatch(iBaseCaseService.dispatchCount());
- infoVO.setIdentification(iBaseCaseService.alCount());
- infoVO.setEvent(iBaseCaseService.selectEventList(params.getBeginTime(), params.getEndTime()));
+// infoVO.setIdentification(iBaseCaseService.alCount());
+ infoVO.setIdentification(7621);
+ IPage<EventVO> page = iBaseCaseService.selectEventList(params.getBeginTime(), params.getEndTime(),params.getPageIndex(),params.getPageSize());
+ infoVO.setEvent(page.getRecords());
+ infoVO.setTotal(page.getTotal());
return CommonResult.success(infoVO);
}
}
\ No newline at end of file
--
Gitblit v1.8.0