Commit d33f3d04 by huangjy

fix:设备修改信息

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