| | |
| | | package com.ycl.controller.cockpit.statisticsEvents; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.entity.cockpitManage.TeamConstruction; |
| | | import com.ycl.entity.cockpitManage.TeamIndex; |
| | | import com.ycl.service.cockpitManage.ITeamConstructionService; |
| | | import com.ycl.service.video.impl.IVideoPointService; |
| | | import com.ycl.util.CheckApiUtil; |
| | | import com.ycl.vo.cockpit.CockpitVO; |
| | | import com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO; |
| | | import com.ycl.vo.equipment.VideoPointVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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 javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public class StatisticsEventsController { |
| | | @Resource |
| | | private CheckApiUtil checkApiUtil; |
| | | |
| | | private IVideoPointService videoPointService; |
| | | |
| | | private ITeamConstructionService teamConstructionService; |
| | | |
| | | @Autowired |
| | | public void setTeamConstructionService(ITeamConstructionService teamConstructionService) { |
| | | this.teamConstructionService = teamConstructionService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setVideoPointService(IVideoPointService videoPointService) { |
| | | this.videoPointService = videoPointService; |
| | | } |
| | | |
| | | @ApiOperation(value = "执法事件") |
| | | @GetMapping("/law_enforcement_event") |
| | |
| | | public CommonResult<StatisticsEventsVO.CityPanelVo> cityPanel(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | |
| | | StatisticsEventsVO.CityPanelVo vo = new StatisticsEventsVO.CityPanelVo(92, 22, 12, 22, 34, 99, 9, 34, 6); |
| | | StatisticsEventsVO.CityPanelVo vo = new StatisticsEventsVO.CityPanelVo(92, true, 22, false, 12, true, |
| | | 22, false, 34, true, 99, false, 9, true, |
| | | 34, false, 6, true); |
| | | |
| | | return CommonResult.success(vo); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "点位") |
| | | @GetMapping("/video_point") |
| | | public CommonResult<List<VideoPointVo>> videoPoint(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | IPage<VideoPointVo> page = videoPointService.getList(null, null, 1, 500); |
| | | return CommonResult.success(page.getRecords()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "队伍建设") |
| | | @GetMapping("/team_construction") |
| | | public CommonResult<List<TeamConstruction>> teamConstruction(@Validated CockpitVO params) { |
| | | 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); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "中队指数体征") |
| | | @GetMapping("/team_index") |
| | | public CommonResult<List<TeamIndex>> teamIndex(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | LambdaQueryWrapper<TeamConstruction> queryWrapper = new LambdaQueryWrapper<TeamConstruction>().eq(TeamConstruction::getStatus, 1).eq(TeamConstruction::getIsDelete, 0); |
| | | List<TeamConstruction> list = teamConstructionService.list(queryWrapper); |
| | | List<TeamIndex> teamIndexList = BeanUtil.copyToList(list, TeamIndex.class); |
| | | teamIndexList.forEach(o -> { |
| | | o.setStepTimely(0.6); |
| | | o.setStepDelayed(0.3); |
| | | o.setStepOvertime(0.1); |
| | | o.setHandleTimely(0.6); |
| | | o.setHandleDelayed(0.2); |
| | | o.setHandleOvertime(0.1); |
| | | o.setNoHandle(0.1); |
| | | }); |
| | | return CommonResult.success(teamIndexList); |
| | | } |
| | | } |