RealTimeMonitorController.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package com.zoniot.ccrc.controller;
  2. import com.alibaba.fastjson.JSON;
  3. import com.zoniot.ccrc.commom.model.AjaxMessage;
  4. import com.zoniot.ccrc.commom.model.ResultStatus;
  5. import com.zoniot.ccrc.dto.MapStatisticalDto;
  6. import com.zoniot.ccrc.service.StatAndAnalysisService;
  7. import io.swagger.annotations.Api;
  8. import io.swagger.annotations.ApiOperation;
  9. import io.swagger.annotations.ApiParam;
  10. import org.apache.commons.logging.Log;
  11. import org.apache.commons.logging.LogFactory;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.*;
  14. import java.text.ParseException;
  15. import java.util.ArrayList;
  16. import java.util.List;
  17. /**
  18. * @author wilian.peng
  19. */
  20. @Api(tags = "物联云实时监测")
  21. @RestController
  22. @RequestMapping("/monitor/")
  23. public class RealTimeMonitorController {
  24. @Autowired
  25. StatAndAnalysisService statAndAnalysisService;
  26. /**
  27. * 地图统计查询
  28. *
  29. * @throws ParseException
  30. */
  31. @GetMapping("/mapStatistical/")
  32. @ApiOperation(value = "实时监控地图统计查询")
  33. public AjaxMessage<List<MapStatisticalDto>> mapStatistical(
  34. @ApiParam(value = "系统id", required = false) @RequestParam(required = false) Integer sysId,
  35. @ApiParam(value = "类型 1:省 2:市 3:区 4:小区 ", required = false, defaultValue = "0") @RequestParam(required = false, defaultValue = "0") Integer type,
  36. @ApiParam(value = "northEast坐标", required = false) @RequestParam(required = false) String northEast,
  37. @ApiParam(value = "southWest坐标", required = false) @RequestParam(required = false) String southWest,
  38. @ApiParam(value = "省", required = false) @RequestParam(required = false) Integer province,
  39. @ApiParam(value = "市", required = false) @RequestParam(required = false) Integer city,
  40. @ApiParam(value = "区", required = false) @RequestParam(required = false) Integer region,
  41. @ApiParam(value = "小区", required = false) @RequestParam(required = false) Integer community
  42. ) {
  43. AjaxMessage<List<MapStatisticalDto>> returnMsg = new AjaxMessage<List<MapStatisticalDto>>();
  44. List<MapStatisticalDto> list = statAndAnalysisService.realTimeMapStatistical(sysId, type, northEast, southWest, province, city, region, community);
  45. returnMsg.setMsg(ResultStatus.OK, list);
  46. return returnMsg;
  47. }
  48. }