|
|
@@ -0,0 +1,485 @@
|
|
|
+package com.yunfeiyun.agmp.iotm.device.sf.controller;
|
|
|
+
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
+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.common.log.LogCore;
|
|
|
+import com.yunfeiyun.agmp.iot.common.constant.IotErrorCode;
|
|
|
+import com.yunfeiyun.agmp.iot.common.constant.devicetype.IotDeviceDictConst;
|
|
|
+import com.yunfeiyun.agmp.iot.common.exception.IotBizException;
|
|
|
+import com.yunfeiyun.agmp.iotm.common.controller.BaseController;
|
|
|
+import com.yunfeiyun.agmp.iotm.device.common.domin.IotDeviceBaseFunReqVo;
|
|
|
+import com.yunfeiyun.agmp.iotm.device.common.domin.IotDeviceDataListReqVo;
|
|
|
+import com.yunfeiyun.agmp.iotm.device.common.service.IotDeviceCommonService;
|
|
|
+import com.yunfeiyun.agmp.iotm.device.common.service.IotDeviceRefreshService;
|
|
|
+import com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfConfigCmdReqVo;
|
|
|
+import com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfGroupParamResVo;
|
|
|
+import com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfIrrigationOprecordListReqVo;
|
|
|
+import com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfIrrigationRecordListReqVo;
|
|
|
+import com.yunfeiyun.agmp.iotm.util.ValidateUtil;
|
|
|
+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 com.yunfeiyun.agmp.iotm.web.service.IIotSfElementfactorService;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 水肥机设备
|
|
|
+ */
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("/iot/device/app/sf")
|
|
|
+@Slf4j
|
|
|
+public class IotDeviceAppSfController extends BaseController {
|
|
|
+ @Autowired
|
|
|
+ private IIotDeviceService iIotDeviceService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IotDeviceCommonService iotDeviceCommonService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IIotSfElementfactorService iotSfElementfactorService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IotDeviceRefreshService iotDeviceRefreshService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 水肥设备列表
|
|
|
+ * /list 所有设备
|
|
|
+ * /rh/list 润浩设备
|
|
|
+ * @param reqVo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping({"/list", "/rh/list"})
|
|
|
+ public TableDataInfo list(HttpServletRequest request, IotDeviceListReqVo reqVo) {
|
|
|
+ startPage();
|
|
|
+ String reqUri = request.getRequestURI();
|
|
|
+ String[] devTypeList = null;
|
|
|
+
|
|
|
+ if(reqUri.endsWith("/rh/list")){
|
|
|
+ devTypeList = new String[]{IotDeviceDictConst.TYPE_RUNHAO_SF};
|
|
|
+ }
|
|
|
+
|
|
|
+ List<IotDeviceListResVo> list = null;
|
|
|
+ if (devTypeList != null) {
|
|
|
+ reqVo.setDevtypeBidList(Arrays.asList(devTypeList));
|
|
|
+ list = iIotDeviceService.selectIotDeviceListByType(reqVo);
|
|
|
+ }
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设备详情信息
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/rh/info/{devBid}")
|
|
|
+ public AjaxResult info(@PathVariable("devBid") String devBid) {
|
|
|
+ ValidateUtil.validateDevBid(devBid);
|
|
|
+
|
|
|
+ IotDeviceListReqVo reqVo = new IotDeviceListReqVo();
|
|
|
+ reqVo.setDevBid(devBid);
|
|
|
+ List<IotDeviceListResVo> resVoList = iIotDeviceService.selectIotDeviceListByType(reqVo);
|
|
|
+ if(resVoList == null || resVoList.isEmpty()){
|
|
|
+ throw new IotBizException(IotErrorCode.PARAM_INVALID.getCode(), "设备不存在");
|
|
|
+ }
|
|
|
+ IotDeviceListResVo resVo = resVoList.get(0);
|
|
|
+ return AjaxResult.success(resVo);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/config/info/{devBid}")
|
|
|
+ public AjaxResult configInfo(@PathVariable("devBid") String devBid){
|
|
|
+ IotDeviceDataListReqVo reqVo = new IotDeviceDataListReqVo();
|
|
|
+ reqVo.setDevBid(devBid);
|
|
|
+
|
|
|
+ IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+ iotDeviceBaseFunReqVo.setDevBid(reqVo.getDevBid());
|
|
|
+ iotDeviceBaseFunReqVo.setMethodName("configInfo");
|
|
|
+ iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
+ JSONObject jsonObject = iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+ return AjaxResult.success(jsonObject);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取水肥机状态信息
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/status/{devBid}")
|
|
|
+ public TableDataInfo getStatus(@PathVariable String devBid){
|
|
|
+ ValidateUtil.validateDevBid(devBid);
|
|
|
+ IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+ iotDeviceBaseFunReqVo.setDevBid(devBid);
|
|
|
+ iotDeviceBaseFunReqVo.setMethodName("getStatus");
|
|
|
+ iotDeviceBaseFunReqVo.setParam(devBid);
|
|
|
+ return iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取水肥机状态信息
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/rh/run/status/{devBid}")
|
|
|
+ public AjaxResult getRunStatus(@PathVariable String devBid){
|
|
|
+ ValidateUtil.validateDevBid(devBid);
|
|
|
+ IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+ iotDeviceBaseFunReqVo.setDevBid(devBid);
|
|
|
+ iotDeviceBaseFunReqVo.setMethodName("getRunStatus");
|
|
|
+ iotDeviceBaseFunReqVo.setParam(devBid);
|
|
|
+ JSONObject jsonObject = iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+ return AjaxResult.success(jsonObject);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取润浩全局灌区参数
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/rh/group/param/global/{devBid}")
|
|
|
+ public AjaxResult getGroupParamByGlobal(@PathVariable String devBid){
|
|
|
+ ValidateUtil.validateDevBid(devBid);
|
|
|
+ IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+ iotDeviceBaseFunReqVo.setDevBid(devBid);
|
|
|
+ iotDeviceBaseFunReqVo.setMethodName("getGroupParamByGlobal");
|
|
|
+ iotDeviceBaseFunReqVo.setParam(devBid);
|
|
|
+ List<IotSfGroupParamResVo> groupParamResVoList = iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+ return AjaxResult.success(groupParamResVoList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 开始自动灌溉
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @PostMapping("/auto/start")
|
|
|
+ public AjaxResult autoStart(@RequestBody IotSfConfigCmdReqVo reqVo){
|
|
|
+ String devBid = reqVo.getDevBid();
|
|
|
+ ValidateUtil.validateDevBid(devBid);
|
|
|
+ IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+ iotDeviceBaseFunReqVo.setDevBid(devBid);
|
|
|
+ iotDeviceBaseFunReqVo.setMethodName("autoStart");
|
|
|
+ iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
+ String taskId = iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+ return new AjaxResult(ErrorCode.SUCCESS.getCode(), "下发成功,等待设备响应结果", taskId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 开始自动灌溉
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @PostMapping("/auto/stop")
|
|
|
+ public AjaxResult autoStop(@RequestBody IotSfConfigCmdReqVo reqVo){
|
|
|
+ String devBid = reqVo.getDevBid();
|
|
|
+ ValidateUtil.validateDevBid(devBid);
|
|
|
+ IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+ iotDeviceBaseFunReqVo.setDevBid(devBid);
|
|
|
+ iotDeviceBaseFunReqVo.setMethodName("autoStop");
|
|
|
+ iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
+ String taskId = iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+ return new AjaxResult(ErrorCode.SUCCESS.getCode(), "下发成功,等待设备响应结果", taskId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 下发水肥机指令
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @PostMapping("/devctl")
|
|
|
+ public AjaxResult devControl(@RequestBody IotSfConfigCmdReqVo reqVo) {
|
|
|
+ log.info("【{}】【水肥机】【下发水肥机设备控制指令】客户id {}", LogCore.getSeq(), getCustomerId());
|
|
|
+ String devBid = reqVo.getDevBid();
|
|
|
+ ValidateUtil.validateDevBid(devBid);
|
|
|
+
|
|
|
+ IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+ iotDeviceBaseFunReqVo.setDevBid(reqVo.getDevBid());
|
|
|
+ iotDeviceBaseFunReqVo.setMethodName("devControl");
|
|
|
+ iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
+ String taskId = iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+
|
|
|
+ return new AjaxResult(ErrorCode.SUCCESS.getCode(), "下发成功,等待设备响应结果", taskId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取水肥机灌溉记录
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/record/list")
|
|
|
+ public TableDataInfo getRecordList(IotSfIrrigationRecordListReqVo reqVo){
|
|
|
+ String devBid = reqVo.getDevBid();
|
|
|
+ ValidateUtil.validateDevBid(devBid);
|
|
|
+ IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+ iotDeviceBaseFunReqVo.setDevBid(devBid);
|
|
|
+ iotDeviceBaseFunReqVo.setMethodName("getRecordList");
|
|
|
+ iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
+ return iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取水肥机灌溉操作记录
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/op/record/list")
|
|
|
+ public TableDataInfo getOpRecordList(IotSfIrrigationOprecordListReqVo reqVo){
|
|
|
+ String devBid = reqVo.getDevBid();
|
|
|
+ ValidateUtil.validateDevBid(devBid);
|
|
|
+ IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+ iotDeviceBaseFunReqVo.setDevBid(devBid);
|
|
|
+ iotDeviceBaseFunReqVo.setMethodName("getOpRecordList");
|
|
|
+ iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
+ return iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 刷新设备
|
|
|
+ * @param devBid
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/refresh/{devBid}")
|
|
|
+ public AjaxResult refresh(@PathVariable("devBid") String devBid) {
|
|
|
+ String result = iotDeviceRefreshService.refresh(devBid);
|
|
|
+ return new AjaxResult(ErrorCode.SUCCESS.getCode(), result, null);
|
|
|
+ }
|
|
|
+
|
|
|
+// /**
|
|
|
+// * 获取泵类设备已存在的元素列表
|
|
|
+// * 该接口用于根据请求参数获取已存在的元素列表,并返回相关数据。
|
|
|
+// *
|
|
|
+// * @param reqVo 请求参数,包含设备标识devBid等信息
|
|
|
+// * @return 返回TableDataInfo对象,包含元素列表数据
|
|
|
+// * @throws IllegalArgumentException 如果reqVo中的devBid为空,则抛出异常
|
|
|
+// */
|
|
|
+// @GetMapping("/pump/already/list")
|
|
|
+// public TableDataInfo getPumpAlreadyElementList(IotSfElementfactorListReqVo reqVo){
|
|
|
+// ValidateUtil.validateDevBid(reqVo.getDevBid());
|
|
|
+// IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+// iotDeviceBaseFunReqVo.setDevBid(reqVo.getDevBid());
|
|
|
+// iotDeviceBaseFunReqVo.setMethodName("getPumpAlreadyElementList");
|
|
|
+// iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
+// return iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 获取泵类未处理的元素列表
|
|
|
+// * 该接口用于根据请求参数获取未处理的元素列表,并返回相关数据。
|
|
|
+// *
|
|
|
+// * @param reqVo 请求参数,包含设备标识(devBid)等信息
|
|
|
+// * @return TableDataInfo 包含未处理的元素列表的数据封装对象
|
|
|
+// * @throws IllegalArgumentException 如果devBid为空,则抛出非法参数异常
|
|
|
+// */
|
|
|
+// @GetMapping("/pump/unalready/list")
|
|
|
+// public TableDataInfo getPumpUnAlreadyElementList(IotSfElementfactorListReqVo reqVo){
|
|
|
+// ValidateUtil.validateDevBid(reqVo.getDevBid());
|
|
|
+// IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+// iotDeviceBaseFunReqVo.setDevBid(reqVo.getDevBid());
|
|
|
+// iotDeviceBaseFunReqVo.setMethodName("getPumpUnAlreadyElementList");
|
|
|
+// iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
+// return iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 新增要素
|
|
|
+// * 该接口用于添加新的泵类要素,接收相关参数并调用通用设备功能服务进行处理。
|
|
|
+// *
|
|
|
+// * @param reqVo 包含设备添加请求的参数,包括设备标识(devBid)等
|
|
|
+// * @return 返回操作结果的表格数据信息
|
|
|
+// * @throws ValidateException 如果设备标识(devBid)无效,则抛出ValidateException异常
|
|
|
+// */
|
|
|
+// @Transactional(rollbackFor = Exception.class)
|
|
|
+// @PostMapping("/ele/add")
|
|
|
+// public AjaxResult elementAdd(@RequestBody IotSfElementfactorAddReqVo reqVo){
|
|
|
+// ValidateUtil.validateDevBid(reqVo.getDevBid());
|
|
|
+// IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+// iotDeviceBaseFunReqVo.setDevBid(reqVo.getDevBid());
|
|
|
+// iotDeviceBaseFunReqVo.setMethodName("elementAdd");
|
|
|
+// iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
+// int status = iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+// return toAjax(status);
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 删除要素接口
|
|
|
+// * 根据传入的要素标识删除对应的要素信息
|
|
|
+// *
|
|
|
+// * @param sfBid 要素标识,用于唯一确定要删除的要素
|
|
|
+// * @return AjaxResult 操作结果,包含状态码和消息
|
|
|
+// * @throws IotBizException 如果要素标识为空,则抛出IotBizException异常
|
|
|
+// */
|
|
|
+// @Transactional(rollbackFor = Exception.class)
|
|
|
+// @DeleteMapping("/ele/delete/{sfBid}")
|
|
|
+// public AjaxResult elementDelete(@PathVariable String sfBid){
|
|
|
+// if(StringUtils.isEmpty(sfBid)){
|
|
|
+// throw new IotBizException(IotErrorCode.PARAM_INVALID.getCode(), "要素标识不能为空");
|
|
|
+// }
|
|
|
+// IotSfElementfactor iotSfElementfactor = iotSfElementfactorService.selectIotSfElementfactorBySfBid(sfBid);
|
|
|
+// if(iotSfElementfactor == null){
|
|
|
+// throw new IotBizException(IotErrorCode.PARAM_INVALID.getCode(), "要素不存在");
|
|
|
+// }
|
|
|
+//
|
|
|
+// IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+// iotDeviceBaseFunReqVo.setDevBid(iotSfElementfactor.getDevBid());
|
|
|
+// iotDeviceBaseFunReqVo.setMethodName("elementDelete");
|
|
|
+// iotDeviceBaseFunReqVo.setParam(iotSfElementfactor);
|
|
|
+// int status = iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+// return toAjax(status);
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 获取未配置的灌区元素列表
|
|
|
+// *
|
|
|
+// * @param reqVo 请求参数,包含设备标识(devBid)等筛选条件
|
|
|
+// * @return 返回TableDataInfo对象,包含未分组的元素列表及相关信息
|
|
|
+// * @throws ValidateException 如果devBid为空或不符合要求,则抛出ValidateException异常
|
|
|
+// */
|
|
|
+// @GetMapping("/group/unalready/list")
|
|
|
+// public TableDataInfo getGroupUnAlreadyElementList(IotSfElementfactorListReqVo reqVo){
|
|
|
+// ValidateUtil.validateDevBid(reqVo.getDevBid());
|
|
|
+// IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+// iotDeviceBaseFunReqVo.setDevBid(reqVo.getDevBid());
|
|
|
+// iotDeviceBaseFunReqVo.setMethodName("getGroupUnAlreadyElementList");
|
|
|
+// iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
+// return iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 获取灌区设备已存在的元素列表
|
|
|
+// * 该接口用于根据请求参数获取已存在的元素列表,并返回相关数据。
|
|
|
+// *
|
|
|
+// * @param reqVo 请求参数,包含设备标识devBid等信息
|
|
|
+// * @return 返回TableDataInfo对象,包含元素列表数据
|
|
|
+// * @throws IllegalArgumentException 如果reqVo中的devBid为空,则抛出异常
|
|
|
+// */
|
|
|
+// @GetMapping("/group/already/list")
|
|
|
+// public TableDataInfo getGroupAlreadyElementList(IotSfElementfactorListReqVo reqVo){
|
|
|
+// ValidateUtil.validateDevBid(reqVo.getDevBid());
|
|
|
+// IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+// iotDeviceBaseFunReqVo.setDevBid(reqVo.getDevBid());
|
|
|
+// iotDeviceBaseFunReqVo.setMethodName("getGroupAlreadyElementList");
|
|
|
+// iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
+// return iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 批量新增要素
|
|
|
+// * 该接口用于添加新的泵类要素,接收相关参数并调用通用设备功能服务进行处理。
|
|
|
+// *
|
|
|
+// * @param reqVo 包含设备添加请求的参数,包括设备标识(devBid)等
|
|
|
+// * @return 返回操作结果的表格数据信息
|
|
|
+// * @throws ValidateException 如果设备标识(devBid)无效,则抛出ValidateException异常
|
|
|
+// */
|
|
|
+// @Transactional(rollbackFor = Exception.class)
|
|
|
+// @PostMapping("/ele/batch/add")
|
|
|
+// public AjaxResult elementBatchAdd(@RequestBody IotSfElementfactorBatchAddReqVo reqVo){
|
|
|
+// ValidateUtil.validateDevBid(reqVo.getDevBid());
|
|
|
+// IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+// iotDeviceBaseFunReqVo.setDevBid(reqVo.getDevBid());
|
|
|
+// iotDeviceBaseFunReqVo.setMethodName("elementBatchAdd");
|
|
|
+// iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
+// int status = iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+// return toAjax(status);
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 获取未配置的电磁阀元素列表
|
|
|
+// *
|
|
|
+// * @param reqVo 请求参数,包含设备标识(devBid)等筛选条件
|
|
|
+// * @return 返回TableDataInfo对象,包含未分组的元素列表及相关信息
|
|
|
+// * @throws ValidateException 如果devBid为空或不符合要求,则抛出ValidateException异常
|
|
|
+// */
|
|
|
+// @GetMapping("/valve/unalready/list")
|
|
|
+// public TableDataInfo getValveUnAlreadyElementList(IotSfElementfactorListReqVo reqVo){
|
|
|
+// ValidateUtil.validateDevBid(reqVo.getDevBid());
|
|
|
+// IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+// iotDeviceBaseFunReqVo.setDevBid(reqVo.getDevBid());
|
|
|
+// iotDeviceBaseFunReqVo.setMethodName("getValveUnAlreadyElementList");
|
|
|
+// iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
+// return iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 下发水肥机设备设置指令
|
|
|
+// *
|
|
|
+// * @return
|
|
|
+// * @throws Exception
|
|
|
+// */
|
|
|
+// @Transactional(rollbackFor = Exception.class)
|
|
|
+// @PostMapping("/config/edit")
|
|
|
+// public AjaxResult editConfig(@RequestBody IotSfConfigCmdReqVo reqVo) {
|
|
|
+// log.info("【{}】【水肥机】【发水肥机设备设置指令】客户id {}", LogCore.getSeq(), getCustomerId());
|
|
|
+// String devBid = reqVo.getDevBid();
|
|
|
+// ValidateUtil.validateDevBid(devBid);
|
|
|
+//
|
|
|
+// IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+// iotDeviceBaseFunReqVo.setDevBid(reqVo.getDevBid());
|
|
|
+// iotDeviceBaseFunReqVo.setMethodName("editConfig");
|
|
|
+// iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
+// String taskId = iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+//
|
|
|
+// return new AjaxResult(ErrorCode.SUCCESS.getCode(), "下发成功,等待设备响应结果", taskId);
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 新增要素
|
|
|
+// * 该接口用于添加新的泵类要素,接收相关参数并调用通用设备功能服务进行处理。
|
|
|
+// *
|
|
|
+// * @param reqVo 包含设备添加请求的参数,包括设备标识(devBid)等
|
|
|
+// * @return 返回操作结果的表格数据信息
|
|
|
+// * @throws ValidateException 如果设备标识(devBid)无效,则抛出ValidateException异常
|
|
|
+// */
|
|
|
+// @Transactional(rollbackFor = Exception.class)
|
|
|
+// @PostMapping("/ele/edit")
|
|
|
+// public AjaxResult elementEdit(@RequestBody IotSfElementfactorEditReqVo reqVo){
|
|
|
+// ValidateUtil.validateDevBid(reqVo.getDevBid());
|
|
|
+// IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+// iotDeviceBaseFunReqVo.setDevBid(reqVo.getDevBid());
|
|
|
+// iotDeviceBaseFunReqVo.setMethodName("elementEdit");
|
|
|
+// iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
+// int status = iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+// return toAjax(status);
|
|
|
+// }
|
|
|
+//
|
|
|
+
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 编辑润浩全局灌区参数
|
|
|
+// * @param
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// @Transactional(rollbackFor = Exception.class)
|
|
|
+// @PostMapping("/rh/group/param/global/edit")
|
|
|
+// public AjaxResult getGroupParamByGlobal(@RequestBody IotSfGroupParamEditReqVo reqVo){
|
|
|
+// String devBid = reqVo.getDevBid();
|
|
|
+// ValidateUtil.validateDevBid(devBid);
|
|
|
+// IotDeviceBaseFunReqVo iotDeviceBaseFunReqVo = new IotDeviceBaseFunReqVo();
|
|
|
+// iotDeviceBaseFunReqVo.setDevBid(devBid);
|
|
|
+// iotDeviceBaseFunReqVo.setMethodName("editGroupParamByGlobal");
|
|
|
+// iotDeviceBaseFunReqVo.setParam(reqVo);
|
|
|
+// String taskId = iotDeviceCommonService.func(iotDeviceBaseFunReqVo);
|
|
|
+//
|
|
|
+// return new AjaxResult(ErrorCode.SUCCESS.getCode(), "下发成功,等待设备响应结果", taskId);
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+
|
|
|
+
|
|
|
+}
|