| | |
| | | package com.ycl.controller.cockpit.statisticsEvents; |
| | | |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.util.CheckApiUtil; |
| | | import com.ycl.vo.cockpit.CockpitVO; |
| | | import com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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; |
| | |
| | | @RestController |
| | | @RequestMapping("/api/data") |
| | | public class StatisticsEventsController { |
| | | @Resource |
| | | private CheckApiUtil checkApiUtil; |
| | | |
| | | @ApiOperation(value = "执法事件") |
| | | @GetMapping("/law_enforcement_event") |
| | | public CommonResult<List<StatisticsEventsVO.LawEnforcementEventVO>> detection(@Validated CockpitVO.Params2VO params) { |
| | | @ApiImplicitParam(name = "regionId",value = "地区Id",required = true,dataType = "String") |
| | | public CommonResult<List<StatisticsEventsVO.LawEnforcementEventVO>> detection(@Validated CockpitVO.Params2VO params, @RequestParam(required = true)String regionId) { |
| | | checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime(),regionId); |
| | | List<StatisticsEventsVO.LawEnforcementEventVO> lawEnforcementEventVOS = new ArrayList<>(); |
| | | StatisticsEventsVO.LawEnforcementEventVO a = null; |
| | | for (int i = 0; i < 4; i++) { |
| | |
| | | |
| | | @ApiOperation(value = "物联感知") |
| | | @GetMapping("/lot") |
| | | public CommonResult<List<StatisticsEventsVO.LotVO>> lot(@Validated CockpitVO.Params1VO params) { |
| | | @ApiImplicitParam(name = "regionId",value = "地区Id",required = true,dataType = "String") |
| | | public CommonResult<List<StatisticsEventsVO.LotVO>> lot(@Validated CockpitVO.Params1VO params,@RequestParam(required = true)String regionId) { |
| | | checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null,regionId); |
| | | List<StatisticsEventsVO.LotVO> lotVOS = new ArrayList<>(); |
| | | StatisticsEventsVO.LotVO a = null; |
| | | for (int i = 0; i < 4; i++) { |
| | |
| | | a.setName("团结屯"); |
| | | a.setType("摄像头"); |
| | | a.setCount(10); |
| | | a.setRatio(new BigDecimal("-0.3").setScale(2, RoundingMode.HALF_UP)); |
| | | lotVOS.add(a); |
| | | } |
| | | return CommonResult.success(lotVOS); |
| | |
| | | @ApiOperation(value = "执法队伍") |
| | | @GetMapping("/team") |
| | | public CommonResult<StatisticsEventsVO.TeamVO> team(@Validated CockpitVO.Params1VO params) { |
| | | checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null,null); |
| | | StatisticsEventsVO.TeamVO teamVO = new StatisticsEventsVO.TeamVO(); |
| | | teamVO.setAll(30); |
| | | teamVO.setAssistant(10); |
| | |
| | | @ApiOperation(value = "网格员") |
| | | @GetMapping("/grid_member") |
| | | public CommonResult<List<StatisticsEventsVO.GridMemberVO>> gridMember(@Validated CockpitVO.Params1VO params) { |
| | | checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null,null); |
| | | List<StatisticsEventsVO.GridMemberVO> gridMemberVOS = new ArrayList<>(); |
| | | StatisticsEventsVO.GridMemberVO a = null; |
| | | for (int i = 0; i < 4; i++) { |
| | |
| | | @ApiOperation(value = "指数体征") |
| | | @GetMapping("/index_signs") |
| | | public CommonResult<StatisticsEventsVO.IndexSignsVO> indexSigns(@Validated CockpitVO.Params1VO params) { |
| | | checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null,null); |
| | | StatisticsEventsVO.IndexSignsVO indexSignsVO = new StatisticsEventsVO.IndexSignsVO(); |
| | | indexSignsVO.setEvent(1); |
| | | indexSignsVO.setGridMember(20); |