whycrzg
2021-02-23 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4
src/main/java/com/fgkj/controller/Ld9/LD9_stateController.java
@@ -1,38 +1,45 @@
package com.fgkj.controller.Ld9;
import com.fgkj.util.*;
import com.fgkj.dto.LD9_state;
import com.fgkj.dto.PageBean;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_inf;
import com.fgkj.services.Ld9.LD9_stateService;
import com.fgkj.util.ActionUtil;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RequestMapping("ld9State")
@RestController
@Api
@Api(tags = "ld9State接口")
public class LD9_stateController{
   @Autowired
   @Resource
   private LD9_stateService service;
   //查询ld9实时数据
   @GetMapping("all")
   @ApiOperation(notes = "",value="查询ld9实时数据")
   public ServiceModel searchAll() {
      ServiceModel model=service.searchAll();
      return model;
   }
   
   //11.1LD9设备通信状态查询
   @GetMapping("byCondition")
   public ServiceModel serchByCondition(@RequestBody LD9_state ld9){
      // LD9_state ld9= getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, LD9_state.class);
   @PostMapping("byCondition")
   @ApiOperation(notes = "TODO 待测试",value="设备通信状态查询")
   public ServiceModel serchByCondition(@RequestParam Integer dev_errcommcount, @RequestParam Integer pageSize, @RequestParam Integer pageNum){
      LD9_state ld9 = new LD9_state();
      ld9.setDev_errcommcount(dev_errcommcount);
      User_inf uinf=(User_inf) ActionUtil.getUser();
      ld9.setNum(uinf.getUId());//将用户id存放在LD9_state的num中用于处理用户管理的机房问题
      ld9.setNum(uinf.getuId());//将用户id存放在LD9_state的num中用于处理用户管理的机房问题
      PageBean<Object> pageBean = new PageBean<>();
      pageBean.setPageNum(pageNum);
      pageBean.setPageSize(pageSize);
      ld9.setPageBean(pageBean);
      ServiceModel model = service.serchByCondition(ld9);
      return model;
   }