|
@@ -13,6 +13,7 @@ import com.zswl.dataservice.model.mqtt.DeviceInfoModel;
|
|
|
import com.zswl.dataservice.model.mqtt.DeviceInfoSearchParam;
|
|
import com.zswl.dataservice.model.mqtt.DeviceInfoSearchParam;
|
|
|
import com.zswl.dataservice.model.mqtt.DeviceInfoUpdateRemark;
|
|
import com.zswl.dataservice.model.mqtt.DeviceInfoUpdateRemark;
|
|
|
import com.zswl.dataservice.service.iot.IotServiceImpl;
|
|
import com.zswl.dataservice.service.iot.IotServiceImpl;
|
|
|
|
|
+import com.zswl.dataservice.type.FunctionType;
|
|
|
import com.zswl.dataservice.utils.bean.BeanUtils;
|
|
import com.zswl.dataservice.utils.bean.BeanUtils;
|
|
|
import com.zswl.dataservice.utils.mqtt.type.LogsLevel;
|
|
import com.zswl.dataservice.utils.mqtt.type.LogsLevel;
|
|
|
import com.zswl.dataservice.utils.page.PageEntityUtil;
|
|
import com.zswl.dataservice.utils.page.PageEntityUtil;
|
|
@@ -192,23 +193,24 @@ public class DeviceInfoService {
|
|
|
/**
|
|
/**
|
|
|
* 得到设备关联的物模型定义
|
|
* 得到设备关联的物模型定义
|
|
|
*
|
|
*
|
|
|
- * @param id
|
|
|
|
|
|
|
+ * @param deviceId
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public ResultContent<List<IotMainModel>> getDeviceIotMain(String id) {
|
|
|
|
|
- DeviceInfo deviceInfo = deviceInfoDao.findTopById(id);
|
|
|
|
|
|
|
+ public ResultContent<List<IotMainModel>> getDeviceIotMain(String deviceId, FunctionType functionType) {
|
|
|
|
|
+ DeviceInfo deviceInfo = deviceInfoDao.findTopByDeviceId(deviceId);
|
|
|
if (ObjectUtils.isEmpty(deviceInfo)) {
|
|
if (ObjectUtils.isEmpty(deviceInfo)) {
|
|
|
- return ResultContent.buildFail(String.format(ResultMessage.DATA_NOT_EXIST, id));
|
|
|
|
|
|
|
+ return ResultContent.buildFail(String.format(ResultMessage.DATA_NOT_EXIST, deviceId));
|
|
|
}
|
|
}
|
|
|
List<IotMainModel> models = new ArrayList<>();
|
|
List<IotMainModel> models = new ArrayList<>();
|
|
|
if (deviceInfo.getIotTemplate() != null) {
|
|
if (deviceInfo.getIotTemplate() != null) {
|
|
|
- ResultContent<List<IotMainModel>> resultContent = iotService.getTemplateIotMainList(deviceInfo.getIotTemplate().getId());
|
|
|
|
|
|
|
+ ResultContent<List<IotMainModel>> resultContent = iotService.getTemplateIotMainList(deviceInfo.getIotTemplate().getId(), functionType);
|
|
|
models = resultContent.getContent();
|
|
models = resultContent.getContent();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
return ResultContent.buildSuccess(models);
|
|
return ResultContent.buildSuccess(models);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 删除设备
|
|
* 删除设备
|
|
|
*
|
|
*
|
|
@@ -225,9 +227,9 @@ public class DeviceInfoService {
|
|
|
return ResultContent.buildSuccess();
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public ResultContent<DeviceInfoModel> getDeviceById(String id) {
|
|
|
|
|
|
|
+ public ResultContent<DeviceInfoModel> getDeviceById(String deviceId) {
|
|
|
DeviceInfoModel model = null;
|
|
DeviceInfoModel model = null;
|
|
|
- DeviceInfo deviceInfo = deviceInfoDao.findTopById(id);
|
|
|
|
|
|
|
+ DeviceInfo deviceInfo = deviceInfoDao.findTopByDeviceId(deviceId);
|
|
|
if (ObjectUtils.isNotEmpty(deviceInfo)) {
|
|
if (ObjectUtils.isNotEmpty(deviceInfo)) {
|
|
|
model = toModel(deviceInfo);
|
|
model = toModel(deviceInfo);
|
|
|
}
|
|
}
|