Commit d33f3d04 by huangjy

fix:设备修改信息

parent 5bed686e
...@@ -466,12 +466,11 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -466,12 +466,11 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
if (StringUtils.isNotEmpty(result)) { if (StringUtils.isNotEmpty(result)) {
throw new RuntimeException("设备写入失败:" + result); throw new RuntimeException("设备写入失败:" + result);
} }
PlatDeviceOther other = platDeviceOtherService.getOne(new QueryWrapper<PlatDeviceOther>().lambda() List<PlatDeviceOther> platDeviceOtherList = platDeviceOtherService.list(new QueryWrapper<PlatDeviceOther>().lambda()
.eq(PlatDeviceOther::getOriDeviceId, deviceId) .eq(PlatDeviceOther::getOriDeviceId, deviceId));
.last("limit 1")); for (PlatDeviceOther platDeviceOther : platDeviceOtherList) {
if (other != null) { platDeviceOther.setAttribute(JSON.toJSONString(map));
other.setAttribute(JSON.toJSONString(map)); platDeviceOtherService.updateById(platDeviceOther);
platDeviceOtherService.updateById(other);
} }
if (dto.getRadarMount() != null) { if (dto.getRadarMount() != null) {
List<PlatDevice> platDeviceList = list(new QueryWrapper<PlatDevice>().lambda().eq(PlatDevice::getOriDeviceId, deviceId)); List<PlatDevice> platDeviceList = list(new QueryWrapper<PlatDevice>().lambda().eq(PlatDevice::getOriDeviceId, deviceId));
...@@ -493,17 +492,16 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -493,17 +492,16 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
if (StringUtils.isNotEmpty(result)) { if (StringUtils.isNotEmpty(result)) {
throw new RuntimeException("设备写入失败:" + result); throw new RuntimeException("设备写入失败:" + result);
} }
PlatDeviceOther other = platDeviceOtherService.getOne(new QueryWrapper<PlatDeviceOther>().lambda() List<PlatDeviceOther> platDeviceOtherList = platDeviceOtherService.list(new QueryWrapper<PlatDeviceOther>().lambda()
.eq(PlatDeviceOther::getOriDeviceId, deviceId) .eq(PlatDeviceOther::getOriDeviceId, deviceId));
.last("limit 1")); for (PlatDeviceOther platDeviceOther : platDeviceOtherList) {
if (other != null) { platDeviceOther.setProtocolAccount(usrServerInfo.getUsername());
other.setProtocolAccount(usrServerInfo.getUsername()); platDeviceOther.setProtocolPassword(usrServerInfo.getPassword());
other.setProtocolPassword(usrServerInfo.getPassword()); platDeviceOther.setProtocolAddress(usrServerInfo.getAddr());
other.setProtocolAddress(usrServerInfo.getAddr()); platDeviceOther.setProtocolPort(usrServerInfo.getPort() == null ? "" : usrServerInfo.getPort().toString());
other.setProtocolPort(usrServerInfo.getPort() == null ? "" : usrServerInfo.getPort().toString()); platDeviceOther.setSecureId(usrServerInfo.getSecureId());
other.setSecureId(usrServerInfo.getSecureId()); platDeviceOther.setSecureKey(usrServerInfo.getSecureKey());
other.setSecureKey(usrServerInfo.getSecureKey()); platDeviceOtherService.updateById(platDeviceOther);
platDeviceOtherService.updateById(other);
} }
} }
......
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