Commit a13e9404 by 罗志长

fix: 设备编辑优化

parent da65198c
......@@ -618,6 +618,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
PlatDeviceBaseAttrDTO platDeviceBaseAttrDTO = getPlatDeviceBaseAttrDTO(deviceId);
String reqJson = JSON.toJSONString(dto);
Map<String, Object> map = getReqMap(dto, platDeviceBaseAttrDTO);
if (map.isEmpty()) {
return;
}
log.info("写入设备属性请求参数:{}", reqJson);
String result = devicePropertiesOperateService.deviceWriteAttr(deviceId, map);
if (StringUtils.isNotEmpty(result)) {
......@@ -748,6 +751,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
for (String deviceId : deviceIdList) {
PlatDeviceBaseAttrDTO platDeviceBaseAttrDTO = getPlatDeviceBaseAttrDTO(deviceId);
Map<String, Object> map = getReqMap(dto,platDeviceBaseAttrDTO);
if (map.isEmpty()) {
continue;
}
String result = devicePropertiesOperateService.deviceWriteAttr(deviceId, map);
if (StringUtils.isNotEmpty(result)) {
throw new RuntimeException("修改设备属性失败:" + result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment