zhanghua
2023-10-02 b146d1a002c4e3b323810f95bea28a1e47e0d680
ycl-platform/src/main/java/com/ycl/controller/smoke/SmokeController.java
@@ -1,22 +1,74 @@
package com.ycl.controller.smoke;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.annotation.LogSave;
import com.ycl.api.CommonPage;
import com.ycl.api.CommonResult;
import com.ycl.controller.BaseController;
import com.ycl.dto.smoker.InTimeCountDto;
import com.ycl.entity.smoke.OdsCustomer;
import com.ycl.entity.smoke.OdsInTime;
import com.ycl.service.smoke.IOdsCustomerService;
import com.ycl.service.smoke.IOdsInTimeService;
import com.ycl.vo.store.StoreInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/smoker")
@Api(tags = "视频资源管理")
@Api(tags = "油烟管理管理")
public class SmokeController extends BaseController {
    IOdsInTimeService inTimeService;
    IOdsCustomerService customerService;
    @Autowired
    public void setInTimeService(IOdsInTimeService inTimeService) {
        this.inTimeService = inTimeService;
    }
    @Autowired
    public void setCustomerService(IOdsCustomerService customerService) {
        this.customerService = customerService;
    }
    @ApiOperation("获取所属单位")
    @RequestMapping(value = "/customer/list", method = RequestMethod.GET)
    @ResponseBody
    @LogSave(operationType = "油烟模块", contain = "获取所属单位")
    public CommonResult<CommonPage<OdsCustomer>> findCustomerList(@RequestParam(value = "keyword", required = false) String keyword,
                                                                  @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                                                  @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
        Page<OdsCustomer> customerPage = customerService.findList(keyword, pageSize, pageNum);
        return CommonResult.success(CommonPage.restPage(customerPage));
    }
    @ApiOperation("查询实时数据")
    @RequestMapping(value = "/inTime/list", method = RequestMethod.GET)
    @ResponseBody
    @LogSave(operationType = "油烟模块", contain = "查询实时数据")
    public CommonResult<CommonPage<OdsInTime>> findInTimeList(@RequestParam(value = "owner", required = false) String owner,
                                                              @RequestParam(value = "onlineStatus", required = false) String onlineStatus,
                                                              @RequestParam(value = "status", required = false) String status,
                                                              @RequestParam(value = "startTime", required = false) String startTime,
                                                              @RequestParam(value = "endTime", required = false) String endTime,
                                                              @RequestParam(value = "type", required = false) String type,
                                                              @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                                              @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
        Page<OdsInTime> inTimePage = inTimeService.findList(owner, onlineStatus, startTime, endTime, type, status, pageSize, pageNum);
        return CommonResult.success(CommonPage.restPage(inTimePage));
    }
    @ApiOperation("获取设备在线情况")
    @RequestMapping(value = "/inTime/count", method = RequestMethod.GET)
    @ResponseBody
    @LogSave(operationType = "油烟模块", contain = "获取设备在线情况")
    public CommonResult<InTimeCountDto> getInTimeCount() {
        InTimeCountDto dto = inTimeService.getInTimeCount();
        return CommonResult.success(dto);
    }
}