Commit 38601e7f by huangjy

fix:修复bug

parent 068952e5
......@@ -417,6 +417,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
}
@Override
@Transactional(rollbackFor = Exception.class)
public void editDeviceProperties(PlatDeviceAttrWechatDTO dto) {
log.info("写入设备属性请求参数:{}",JSON.toJSONString(dto));
String deviceId = dto.getDeviceId();
......@@ -424,6 +425,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
PlatDeviceOther other = platDeviceOtherService.getOne(new QueryWrapper<PlatDeviceOther>().lambda()
.eq(PlatDeviceOther::getOriDeviceId, deviceId)
.last("limit 1"));
Map<String, Object> map = getAttrMap(dto);
if (other != null && usrServerInfo != null) {
other.setProtocolAccount(usrServerInfo.getUsername());
other.setProtocolPassword(usrServerInfo.getPassword());
......@@ -431,10 +433,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
other.setProtocolPort(usrServerInfo.getPort() == null ? "" : usrServerInfo.getPort().toString());
other.setSecureId(usrServerInfo.getSecureId());
other.setSecureKey(usrServerInfo.getSecureKey());
other.setAttribute(JSON.toJSONString(map));
platDeviceOtherService.updateById(other);
}
Map<String, Object> map = getAttrMap(dto);
if (usrServerInfo != null) {
map.put("usrServerInfo",JSON.toJSONString(usrServerInfo));
}
......
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