| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- package com.xunmei.iot.controller;
- import com.xunmei.common.core.web.domain.AjaxResult;
- import com.xunmei.common.core.web.page.TableDataInfo;
- import com.xunmei.iot.dto.dvrDisk.DvrDiskAlarmHistoryPageDto;
- import com.xunmei.iot.dto.dvrDisk.DvrDiskPageDto;
- import com.xunmei.iot.dto.dvrDisk.DvrDiskAppPageDto;
- import com.xunmei.iot.service.IotDvsDiskService;
- import com.xunmei.iot.vo.dvrDisk.DvrDiskAppPageVo;
- import com.xunmei.iot.vo.dvrDisk.DvrDiskPageVo;
- import com.xunmei.iot.vo.dvrDisk.DvrDiskAlarmHistoryPageVo;
- import com.xunmei.iot.vo.dvrDisk.DvrDiskDetectionPageVo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import javax.annotation.Resource;
- @Slf4j
- @Api(description = "中台", tags = {"录像机硬盘检测"})
- @RestController
- @RequestMapping({"/dvrdisk"})
- class DvrDiskController {
- @Autowired
- IotDvsDiskService dvrDiskService;
- // @Resource
- // VideoRecorderHardDiskDetectionService videoRecorderHardDiskDetectionService;
- @ApiOperation("分页")
- @PostMapping({"/web/find"})
- TableDataInfo<DvrDiskPageVo> webPage(@RequestBody final DvrDiskPageDto request) {
- // if (request.getAlarmTime() != null) {
- // request.setRange(null);
- // }
- // if (request.getRange() != null && request.getRange().length == 2) {
- // Date startTime = new DateTime(request.getRange()[0]).setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
- // request.setAlarmStartTime(DateUtil.beginOfDay(startTime));
- // Date endTime = new DateTime(request.getRange()[1]).setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
- // request.setAlarmEndTime(DateUtil.endOfDay(endTime));
- // }
- TableDataInfo<DvrDiskPageVo> page = this.dvrDiskService.selectHostPage(request);
- return page;
- }
- @ApiOperation("dvr硬盘统计,只按机构过滤")
- @GetMapping({"/web/diskstatistic"})
- AjaxResult diskStatistic(DvrDiskPageDto request) {
- return AjaxResult.success(this.dvrDiskService.diskStatistic(request));
- }
- @ApiOperation("历史")
- @PostMapping({"/web/history"})
- TableDataInfo<DvrDiskAlarmHistoryPageVo> history(@RequestBody final DvrDiskAlarmHistoryPageDto request) {
- TableDataInfo<DvrDiskAlarmHistoryPageVo> page = dvrDiskService.getRecordAlarmHistoryList(request);
- return page;
- }
- @ApiOperation("分页")
- @PostMapping({"/app/find"})
- TableDataInfo<DvrDiskAppPageVo> appPage(@RequestBody final DvrDiskAppPageDto request) {
- TableDataInfo<DvrDiskAppPageVo> page = this.dvrDiskService.appPage(request);
- return page;
- }
- @ApiOperation("有异常的硬盘数量")
- @GetMapping({"/app/badge/{orgId}"})
- AjaxResult badge(@PathVariable("orgId") Long orgId) {
- Integer count = this.dvrDiskService.badge(orgId,false);
- return AjaxResult.success(count);
- }
- }
|