|
|
@@ -1,6 +1,7 @@
|
|
|
package com.yunfeiyun.agmp.iotm.device.sf.service;
|
|
|
|
|
|
import cn.hutool.core.exceptions.ValidateException;
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.yunfeiyun.agmp.common.constant.ErrorCode;
|
|
|
import com.yunfeiyun.agmp.common.core.page.TableDataInfo;
|
|
|
import com.yunfeiyun.agmp.common.utils.DateUtils;
|
|
|
@@ -9,20 +10,24 @@ import com.yunfeiyun.agmp.common.utils.StringUtils;
|
|
|
import com.yunfeiyun.agmp.iot.common.constant.IotErrorCode;
|
|
|
import com.yunfeiyun.agmp.iot.common.constant.devicetype.IotDeviceDictConst;
|
|
|
import com.yunfeiyun.agmp.iot.common.domain.IotDevice;
|
|
|
+import com.yunfeiyun.agmp.iot.common.domain.IotDeviceconfig;
|
|
|
import com.yunfeiyun.agmp.iot.common.domain.IotRunHaoSfdata;
|
|
|
import com.yunfeiyun.agmp.iot.common.domain.IotSfElementfactor;
|
|
|
import com.yunfeiyun.agmp.iot.common.enums.EnumSfElementType;
|
|
|
import com.yunfeiyun.agmp.iot.common.exception.IotBizException;
|
|
|
+import com.yunfeiyun.agmp.iotm.device.common.domin.IotDeviceDataListReqVo;
|
|
|
import com.yunfeiyun.agmp.iotm.device.common.service.IotDeviceBaseService;
|
|
|
import com.yunfeiyun.agmp.iotm.device.common.service.impl.IotDeviceBaseServiceImpl;
|
|
|
import com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfElementfactorAddReqVo;
|
|
|
import com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfElementfactorAlreadyListResVo;
|
|
|
import com.yunfeiyun.agmp.iotm.device.sf.domain.IotSfElementfactorListReqVo;
|
|
|
import com.yunfeiyun.agmp.iotm.web.service.IIotDeviceService;
|
|
|
+import com.yunfeiyun.agmp.iotm.web.service.IIotDeviceconfigService;
|
|
|
import com.yunfeiyun.agmp.iotm.web.service.IIotSfElementfactorService;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
|
@@ -36,6 +41,9 @@ public class IIotSfCommService extends IotDeviceBaseServiceImpl implements IotDe
|
|
|
@Autowired
|
|
|
private IIotSfElementfactorService iotSfElementfactorService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private IIotDeviceconfigService iIotDeviceconfigService;
|
|
|
+
|
|
|
|
|
|
public Class getTableClass(String devtypeBid) {
|
|
|
Class tableClass = null;
|
|
|
@@ -284,4 +292,36 @@ public class IIotSfCommService extends IotDeviceBaseServiceImpl implements IotDe
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据设备请求获取配置信息
|
|
|
+ *
|
|
|
+ * @param reqVo 设备数据列表请求对象
|
|
|
+ * @return 配置信息对象
|
|
|
+ * @throws IotBizException 如果设备ID为空或设备不存在,则抛出异常
|
|
|
+ */
|
|
|
+ public JSONObject configInfo(IotDeviceDataListReqVo reqVo){
|
|
|
+ String devBid = reqVo.getDevBid();
|
|
|
+ if(StringUtils.isEmpty(devBid)){
|
|
|
+ throw new IotBizException(IotErrorCode.PARAM_INVALID.getCode(),"参数不能为空");
|
|
|
+ }
|
|
|
+ IotDevice iotDevice = iotDeviceService.selectIotDeviceByDevBid(devBid);
|
|
|
+ if(iotDevice == null){
|
|
|
+ throw new IotBizException(ErrorCode.INVALID_PARAMETER.getCode(),"设备不存在");
|
|
|
+ }
|
|
|
+ IotDeviceconfig iotDeviceconfig = iIotDeviceconfigService.selectIotDeviceConfigByDevBid(devBid);
|
|
|
+ return JSONObject.parseObject(iotDeviceconfig.getDevcfgContext());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取水肥机运行状态信息
|
|
|
+ *
|
|
|
+ * @param devBid 请求对象,包含设备标识等信息
|
|
|
+ * @return TableDataInfo 包含响应码、消息、数据和总数
|
|
|
+ * @throws IotBizException 抛出业务异常,包含错误码和错误信息
|
|
|
+ */
|
|
|
+ public JSONObject getRunStatus(String devBid) {
|
|
|
+ // 由具体子类实现
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
}
|