DvrDiskController.java 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package com.xunmei.iot.controller;
  2. import com.xunmei.common.core.web.domain.AjaxResult;
  3. import com.xunmei.common.core.web.page.TableDataInfo;
  4. import com.xunmei.iot.dto.dvrDisk.DvrDiskAlarmHistoryPageDto;
  5. import com.xunmei.iot.dto.dvrDisk.DvrDiskPageDto;
  6. import com.xunmei.iot.dto.dvrDisk.DvrDiskAppPageDto;
  7. import com.xunmei.iot.service.IotDvsDiskService;
  8. import com.xunmei.iot.vo.dvrDisk.DvrDiskAppPageVo;
  9. import com.xunmei.iot.vo.dvrDisk.DvrDiskPageVo;
  10. import com.xunmei.iot.vo.dvrDisk.DvrDiskAlarmHistoryPageVo;
  11. import com.xunmei.iot.vo.dvrDisk.DvrDiskDetectionPageVo;
  12. import io.swagger.annotations.Api;
  13. import io.swagger.annotations.ApiOperation;
  14. import lombok.extern.slf4j.Slf4j;
  15. import org.springframework.beans.factory.annotation.Autowired;
  16. import org.springframework.web.bind.annotation.*;
  17. import javax.annotation.Resource;
  18. @Slf4j
  19. @Api(description = "中台", tags = {"录像机硬盘检测"})
  20. @RestController
  21. @RequestMapping({"/dvrdisk"})
  22. class DvrDiskController {
  23. @Autowired
  24. IotDvsDiskService dvrDiskService;
  25. // @Resource
  26. // VideoRecorderHardDiskDetectionService videoRecorderHardDiskDetectionService;
  27. @ApiOperation("分页")
  28. @PostMapping({"/web/find"})
  29. TableDataInfo<DvrDiskPageVo> webPage(@RequestBody final DvrDiskPageDto request) {
  30. // if (request.getAlarmTime() != null) {
  31. // request.setRange(null);
  32. // }
  33. // if (request.getRange() != null && request.getRange().length == 2) {
  34. // Date startTime = new DateTime(request.getRange()[0]).setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
  35. // request.setAlarmStartTime(DateUtil.beginOfDay(startTime));
  36. // Date endTime = new DateTime(request.getRange()[1]).setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
  37. // request.setAlarmEndTime(DateUtil.endOfDay(endTime));
  38. // }
  39. TableDataInfo<DvrDiskPageVo> page = this.dvrDiskService.selectHostPage(request);
  40. return page;
  41. }
  42. @ApiOperation("dvr硬盘统计,只按机构过滤")
  43. @GetMapping({"/web/diskstatistic"})
  44. AjaxResult diskStatistic(DvrDiskPageDto request) {
  45. return AjaxResult.success(this.dvrDiskService.diskStatistic(request));
  46. }
  47. @ApiOperation("历史")
  48. @PostMapping({"/web/history"})
  49. TableDataInfo<DvrDiskAlarmHistoryPageVo> history(@RequestBody final DvrDiskAlarmHistoryPageDto request) {
  50. TableDataInfo<DvrDiskAlarmHistoryPageVo> page = dvrDiskService.getRecordAlarmHistoryList(request);
  51. return page;
  52. }
  53. @ApiOperation("分页")
  54. @PostMapping({"/app/find"})
  55. TableDataInfo<DvrDiskAppPageVo> appPage(@RequestBody final DvrDiskAppPageDto request) {
  56. TableDataInfo<DvrDiskAppPageVo> page = this.dvrDiskService.appPage(request);
  57. return page;
  58. }
  59. @ApiOperation("有异常的硬盘数量")
  60. @GetMapping({"/app/badge/{orgId}"})
  61. AjaxResult badge(@PathVariable("orgId") Long orgId) {
  62. Integer count = this.dvrDiskService.badge(orgId,false);
  63. return AjaxResult.success(count);
  64. }
  65. }