|
@@ -17,6 +17,7 @@ import com.yunfeiyun.agmp.iot.common.enums.EnumSfElementType;
|
|
|
import com.yunfeiyun.agmp.iot.common.exception.IotBizException;
|
|
import com.yunfeiyun.agmp.iot.common.exception.IotBizException;
|
|
|
import com.yunfeiyun.agmp.iot.common.model.cmd.CmdGroupModel;
|
|
import com.yunfeiyun.agmp.iot.common.model.cmd.CmdGroupModel;
|
|
|
import com.yunfeiyun.agmp.iot.common.util.dev.RunHaoSfElementUtil;
|
|
import com.yunfeiyun.agmp.iot.common.util.dev.RunHaoSfElementUtil;
|
|
|
|
|
+import com.yunfeiyun.agmp.iotm.device.common.domin.DeviceRefreshDto;
|
|
|
import com.yunfeiyun.agmp.iotm.device.common.domin.IotDeviceDataListReqVo;
|
|
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.IotDeviceBaseService;
|
|
|
import com.yunfeiyun.agmp.iotm.device.common.service.impl.IotDeviceBaseServiceImpl;
|
|
import com.yunfeiyun.agmp.iotm.device.common.service.impl.IotDeviceBaseServiceImpl;
|
|
@@ -499,4 +500,31 @@ public class IIotSfCommService extends IotDeviceBaseServiceImpl implements IotDe
|
|
|
return MyPageUtil.getDataTable(recordList);
|
|
return MyPageUtil.getDataTable(recordList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public void refresh(DeviceRefreshDto reqVo) {
|
|
|
|
|
+ IotDevice findDevice = reqVo.getIotDevice();
|
|
|
|
|
+ String devBid = findDevice.getDevBid();
|
|
|
|
|
+ log.info("创建【“刷新”指令集任务】,设备类型:{}", findDevice.getDevtypeName());
|
|
|
|
|
+ JSONObject ext = new JSONObject();
|
|
|
|
|
+ ext.put("type", "data");
|
|
|
|
|
+ JSONObject payload = new JSONObject();
|
|
|
|
|
+ payload.put("cmd", "read");
|
|
|
|
|
+ payload.put("ext", ext);
|
|
|
|
|
+ IotDeviceconfig iotDeviceconfig = new IotDeviceconfig();
|
|
|
|
|
+ iotDeviceconfig.setTid(findDevice.getTid());
|
|
|
|
|
+ iotDeviceconfig.setDevBid(devBid);
|
|
|
|
|
+ iotDeviceconfig.setDevcfgContext(JSONUtils.toJSONString(payload));
|
|
|
|
|
+
|
|
|
|
|
+ CmdGroupModel cmdGroupModel = iIotDeviceconfigService.createRefreshCmd(iotDeviceconfig);
|
|
|
|
|
+
|
|
|
|
|
+ // 构建日志需要用的内容
|
|
|
|
|
+ cmdGroupModel.setRequestId(IdUtils.fastUUID());
|
|
|
|
|
+ cmdGroupModel.setDevCode(findDevice.getDevCode());
|
|
|
|
|
+ cmdGroupModel.setCtBiztype("3");
|
|
|
|
|
+ cmdGroupModel.setCtDevtype(findDevice.getDevtypeBid());
|
|
|
|
|
+ cmdGroupModel.setCtBiztitle(findDevice.getDevtypeName() + ":" + findDevice.getDevCode());
|
|
|
|
|
+ cmdGroupModel.setCtParam("设备id:"+devBid);
|
|
|
|
|
+ iIotCmdtaskService.handInternalCmd(cmdGroupModel);
|
|
|
|
|
+ String taskUuid = cmdGroupModel.getTaskUuid();
|
|
|
|
|
+ log.info("【“刷新”指令集任务】创建成功,taskUuid:{}", taskUuid);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|