|
|
@@ -1,131 +0,0 @@
|
|
|
-package com.yunfeiyun.agmp.iotm.device.sqz.controller;
|
|
|
-
|
|
|
-import com.yunfeiyun.agmp.common.constant.ErrorCode;
|
|
|
-import com.yunfeiyun.agmp.common.core.domain.AjaxResult;
|
|
|
-import com.yunfeiyun.agmp.common.core.page.TableDataInfo;
|
|
|
-import com.yunfeiyun.agmp.iot.common.constant.devicetype.IotDeviceDictConst;
|
|
|
-import com.yunfeiyun.agmp.iotm.common.controller.BaseController;
|
|
|
-import com.yunfeiyun.agmp.iotm.device.common.domin.IotDeviceBaseFunReqVo;
|
|
|
-import com.yunfeiyun.agmp.iotm.device.common.service.IotDeviceCommonService;
|
|
|
-import com.yunfeiyun.agmp.iotm.device.qxz.domain.IotDeviceQxzDataListReqVo;
|
|
|
-import com.yunfeiyun.agmp.iotm.web.domain.reqvo.IotDeviceListReqVo;
|
|
|
-import com.yunfeiyun.agmp.iotm.web.domain.resvo.IotDeviceListResVo;
|
|
|
-import com.yunfeiyun.agmp.iotm.web.service.IIotDeviceService;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
-import javax.annotation.Resource;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-/**
|
|
|
- * 墒情站设备控制器
|
|
|
- * 云飞墒情站和云飞气象站共用一个impl
|
|
|
- */
|
|
|
-@RestController
|
|
|
-@RequestMapping("/iot/device/sqz")
|
|
|
-@Slf4j
|
|
|
-public class IotDeviceSqzController extends BaseController {
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IIotDeviceService iIotDeviceService;
|
|
|
-
|
|
|
- @Resource
|
|
|
- private IotDeviceCommonService iotDeviceCommonService;
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 数据列表
|
|
|
- * @param reqVo
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping("/list")
|
|
|
- public TableDataInfo list(IotDeviceListReqVo reqVo) {
|
|
|
- startPage();
|
|
|
- String[] devTypeList = new String[]{IotDeviceDictConst.TYPE_YF_SQZ};
|
|
|
- reqVo.setDevtypeBidList(Arrays.asList(devTypeList));
|
|
|
-
|
|
|
- List<IotDeviceListResVo> list = iIotDeviceService.selectIotDeviceListByType(reqVo);
|
|
|
- return getDataTable(list);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 气象数据列表
|
|
|
- * @param reqVo
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping("/data/list")
|
|
|
- public TableDataInfo dataList(IotDeviceQxzDataListReqVo reqVo) {
|
|
|
- IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
- iotDeviceBaseFunReqVo.setDevBid(reqVo.getDevBid());
|
|
|
- iotDeviceBaseFunReqVo.setMethodName("dataList");
|
|
|
- iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
- return iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 气象数据折线图列表
|
|
|
- * @param reqVo
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping("/chart/list")
|
|
|
- public AjaxResult chartList(IotDeviceQxzDataListReqVo reqVo) {
|
|
|
- IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
- iotDeviceBaseFunReqVo.setDevBid(reqVo.getDevBid());
|
|
|
- iotDeviceBaseFunReqVo.setMethodName("chartList");
|
|
|
- iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
- List<IotDeviceListResVo> list = iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
- return AjaxResult.success(list);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 气象数据24小时列表
|
|
|
- * @param
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping("/data/last24h/{devBid}")
|
|
|
- public AjaxResult dataList24h(@PathVariable("devBid") String devBid) {
|
|
|
- IotDeviceQxzDataListReqVo reqVo = new IotDeviceQxzDataListReqVo();
|
|
|
- reqVo.setDevBid(devBid);
|
|
|
-
|
|
|
- IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
- iotDeviceBaseFunReqVo.setDevBid(reqVo.getDevBid());
|
|
|
- iotDeviceBaseFunReqVo.setMethodName("dataList24h");
|
|
|
- iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
- return AjaxResult.success(iotDeviceCommonService.func(iotDeviceBaseFunReqVo));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取最近数据列表接口
|
|
|
- * @param
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping("/data/dataLatest/{devBid}")
|
|
|
- public AjaxResult dataLatest(@PathVariable("devBid") String devBid) {
|
|
|
- IotDeviceQxzDataListReqVo reqVo = new IotDeviceQxzDataListReqVo();
|
|
|
- reqVo.setDevBid(devBid);
|
|
|
-
|
|
|
- IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
- iotDeviceBaseFunReqVo.setDevBid(reqVo.getDevBid());
|
|
|
- iotDeviceBaseFunReqVo.setMethodName("dataLatest");
|
|
|
- iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
- return AjaxResult.success(iotDeviceCommonService.func(iotDeviceBaseFunReqVo));
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/refresh/{devBid}")
|
|
|
- public AjaxResult refresh(@PathVariable("devBid") String devBid) {
|
|
|
- IotDeviceQxzDataListReqVo reqVo = new IotDeviceQxzDataListReqVo();
|
|
|
- reqVo.setDevBid(devBid);
|
|
|
-
|
|
|
- IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
- iotDeviceBaseFunReqVo.setDevBid(reqVo.getDevBid());
|
|
|
- iotDeviceBaseFunReqVo.setMethodName("refresh");
|
|
|
- iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
- iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
- return new AjaxResult(ErrorCode.SUCCESS.getCode(), "下发成功,等待设备响应结果", null);
|
|
|
- }
|
|
|
-}
|