|
|
@@ -57,14 +57,14 @@ public class IotPropertyService extends SuperService {
|
|
|
List<DevicePropertyParam> list = param.getList();
|
|
|
if (ObjectUtils.isNotEmpty(list)) {
|
|
|
for (DevicePropertyParam devicePropertyParam : list) {
|
|
|
- saveProperties(devicePropertyParam, result);
|
|
|
+ saveProperties(devicePropertyParam, result, param);
|
|
|
}
|
|
|
}
|
|
|
result.setSuccess("成功");
|
|
|
return ResultContent.buildSuccess(result);
|
|
|
}
|
|
|
|
|
|
- private void saveProperties(DevicePropertyParam param, PropertyResult result) {
|
|
|
+ private void saveProperties(DevicePropertyParam param, PropertyResult result, Object mqttParam) {
|
|
|
String deviceId = param.getDeviceId();
|
|
|
PropertyResult.DeviceAttrs deviceAttrs = result.create(deviceId);
|
|
|
DeviceInfo deviceInfo = deviceInfoDao.findTopByDeviceId(deviceId);
|
|
|
@@ -77,13 +77,16 @@ public class IotPropertyService extends SuperService {
|
|
|
if (ObjectUtils.isNotEmpty(params)) {
|
|
|
for (String key : params.keySet()) {
|
|
|
Object value = params.get(key);
|
|
|
- saveProperty(deviceId, key, value, deviceAttrs);
|
|
|
+ saveProperty(deviceId, key, value, deviceAttrs, mqttParam);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void saveProperty(String deviceId, String property, Object value, PropertyResult.DeviceAttrs deviceAttrs) {
|
|
|
- ResultContent resultContent = iotDeviceDataService.saveProperty(deviceId, property, value);
|
|
|
+ private void saveProperty(String deviceId, String property,
|
|
|
+ Object value, PropertyResult.DeviceAttrs deviceAttrs,
|
|
|
+ Object mqttParam
|
|
|
+ ) {
|
|
|
+ ResultContent resultContent = iotDeviceDataService.saveProperty(deviceId, property, value, mqttParam);
|
|
|
if (resultContent.isSuccess()) {
|
|
|
deviceAttrs.setSuccess();
|
|
|
} else {
|