baizonghao
2023-03-30 e986bd63309fba70f7f3cfaf70aadec46220917b
ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java
@@ -6,10 +6,13 @@
import com.ycl.api.CommonResult;
import com.ycl.entity.cockpitManage.TeamConstruction;
import com.ycl.entity.cockpitManage.TeamIndex;
import com.ycl.service.apidata.IApiDataService;
import com.ycl.service.cockpitManage.ITeamConstructionService;
import com.ycl.service.equipment.IOrgGridService;
import com.ycl.service.video.impl.IVideoPointService;
import com.ycl.util.CheckApiUtil;
import com.ycl.vo.cockpit.CockpitVO;
import com.ycl.vo.cockpit.statisticsEvents.GridMapVO;
import com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO;
import com.ycl.vo.equipment.VideoPointVo;
import io.swagger.annotations.Api;
@@ -42,6 +45,16 @@
    private ITeamConstructionService teamConstructionService;
    private IOrgGridService orgGridService;
    private IApiDataService iApiDataService;
    @Autowired
    public void setIApiDataService(IApiDataService apiDataService) {
        this.iApiDataService = apiDataService;
    }
    @Autowired
    public void setTeamConstructionService(ITeamConstructionService teamConstructionService) {
        this.teamConstructionService = teamConstructionService;
@@ -50,6 +63,11 @@
    @Autowired
    public void setVideoPointService(IVideoPointService videoPointService) {
        this.videoPointService = videoPointService;
    }
    @Autowired
    public void setOrgGridService(IOrgGridService orgGridService) {
        this.orgGridService = orgGridService;
    }
    @ApiOperation(value = "执法事件")
@@ -73,16 +91,8 @@
    @GetMapping("/lot")
    public CommonResult<List<StatisticsEventsVO.LotVO>> lot(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        List<StatisticsEventsVO.LotVO> lotVOS = new ArrayList<>();
        StatisticsEventsVO.LotVO a = null;
        for (int i = 0; i < 4; i++) {
            a = new StatisticsEventsVO.LotVO();
            a.setName("团结屯");
            a.setType("摄像头");
            a.setCount(10);
            a.setRatio(new BigDecimal("-0.3").setScale(2, RoundingMode.HALF_UP));
            lotVOS.add(a);
        }
        List<StatisticsEventsVO.LotVO> lotVOS = iApiDataService.listLot(params.getStreetId(), params.getBeginTime(), params.getEndTime());
        return CommonResult.success(lotVOS);
    }
@@ -138,13 +148,17 @@
    @ApiOperation(value = "top10")
    @GetMapping("/top10")
    public CommonResult<List<StatisticsEventsVO.Top10VO>> top10(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        List<StatisticsEventsVO.Top10VO> ls = new ArrayList<>();
        ls.add(new StatisticsEventsVO.Top10VO("xx中队", 100.0));
        ls.add(new StatisticsEventsVO.Top10VO("xx中队", 90.0));
        ls.add(new StatisticsEventsVO.Top10VO("xx中队", 80.0));
        ls.add(new StatisticsEventsVO.Top10VO("xx中队", 70.0));
        return CommonResult.success(ls);
//        checkApiUtil.cockpit(params);
//        List<StatisticsEventsVO.Top10VO> ls = new ArrayList<>();
//        ls.add(new StatisticsEventsVO.Top10VO("xx中队", 100.0));
//        ls.add(new StatisticsEventsVO.Top10VO("xx中队", 90.0));
//        ls.add(new StatisticsEventsVO.Top10VO("xx中队", 80.0));
//        ls.add(new StatisticsEventsVO.Top10VO("xx中队", 70.0));
//        return CommonResult.success(ls);
        String beginTime = params.getBeginTime();
        String endTime = params.getEndTime();
        List<StatisticsEventsVO.Top10VO> res = iApiDataService.listTop10(beginTime, endTime);
        return CommonResult.success(res);
    }
@@ -152,11 +166,8 @@
    @GetMapping("/arithmetic_event")
    public CommonResult<List<StatisticsEventsVO.ArithmeticVO>> arithmeticEvent(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        List<StatisticsEventsVO.ArithmeticVO> ls = new ArrayList<>();
        ls.add(new StatisticsEventsVO.ArithmeticVO("xx中队", 10, 0.1));
        ls.add(new StatisticsEventsVO.ArithmeticVO("xx中队", 20, 0.2));
        ls.add(new StatisticsEventsVO.ArithmeticVO("xx中队", 30, 0.3));
        ls.add(new StatisticsEventsVO.ArithmeticVO("xx中队", 40, 0.4));
        List<StatisticsEventsVO.ArithmeticVO> ls = iApiDataService.arithmeticEvent(params.getStreetId(), params.getBeginTime(), params.getEndTime());
        return CommonResult.success(ls);
    }
@@ -182,6 +193,14 @@
        return CommonResult.success(page.getRecords());
    }
    @ApiOperation(value = "网格地图")
    @GetMapping("/grid_map")
    public CommonResult<List<GridMapVO>> gridMap(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        List<GridMapVO> list = orgGridService.statisticsGridMap(params.getBeginTime(), params.getEndTime());
        return CommonResult.success(list);
    }
    @ApiOperation(value = "队伍建设")
    @GetMapping("/team_construction")
@@ -189,7 +208,6 @@
        checkApiUtil.cockpit(params);
        LambdaQueryWrapper<TeamConstruction> queryWrapper = new LambdaQueryWrapper<TeamConstruction>().eq(TeamConstruction::getStatus, 1).eq(TeamConstruction::getIsDelete, 0);
        List<TeamConstruction> list = teamConstructionService.list(queryWrapper);
        return CommonResult.success(list);
    }