|
|
@@ -1,12 +1,45 @@
|
|
|
package com.yunfeiyun.agmp.iotm.device.xycb.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
+import com.yunfeiyun.agmp.common.utils.StringUtils;
|
|
|
+import com.yunfeiyun.agmp.iot.common.constant.IotErrorCode;
|
|
|
import com.yunfeiyun.agmp.iot.common.constant.devicetype.ServiceNameConst;
|
|
|
+import com.yunfeiyun.agmp.iot.common.domain.IotDeviceconfig;
|
|
|
+import com.yunfeiyun.agmp.iot.common.exception.IotBizException;
|
|
|
+import com.yunfeiyun.agmp.iotm.device.common.domin.IotDeviceDataListReqVo;
|
|
|
import com.yunfeiyun.agmp.iotm.device.xycb.service.IIotXycbCommService;
|
|
|
+import com.yunfeiyun.agmp.iotm.web.service.IIotDeviceconfigService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
@Slf4j
|
|
|
@Service(value = ServiceNameConst.SERVICE_YF_XYCB_III)
|
|
|
public class IotXycbIIIServiceImpl extends IIotXycbCommService {
|
|
|
|
|
|
+ @Resource
|
|
|
+ private IIotDeviceconfigService iIotDeviceconfigService;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public JSONObject configInfo(IotDeviceDataListReqVo reqVo){
|
|
|
+ String devBid = reqVo.getDevBid();
|
|
|
+ if(StringUtils.isEmpty(devBid)){
|
|
|
+ throw new IotBizException(IotErrorCode.PARAM_INVALID.getCode(),"参数不能为空");
|
|
|
+ }
|
|
|
+ IotDeviceconfig iotDeviceconfig = iIotDeviceconfigService.selectIotDeviceConfigByDevBid(devBid);
|
|
|
+ if(iotDeviceconfig == null){
|
|
|
+ iotDeviceconfig = new IotDeviceconfig();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("ts","0");
|
|
|
+ jsonObject.put("st","20");
|
|
|
+ jsonObject.put("et","2");
|
|
|
+ jsonObject.put("ds","1");
|
|
|
+ jsonObject.put("clt_t","30");
|
|
|
+ jsonObject.put("dat_f","30");
|
|
|
+ iotDeviceconfig.setDevcfgContext(jsonObject.toJSONString());
|
|
|
+ }
|
|
|
+ return JSONObject.parseObject(iotDeviceconfig.getDevcfgContext());
|
|
|
+ }
|
|
|
+
|
|
|
}
|