Commit 2c1aa1f7 by huangjy

fix:修复bug

parent 359893b0
......@@ -407,12 +407,14 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
@Override
@Transactional(rollbackFor = Exception.class)
public void modifyWifiInfo(PlatDeviceSetupDTO dto) {
PlatDeviceOther other = platDeviceOtherService.getOne(new QueryWrapper<PlatDeviceOther>().lambda()
List<PlatDeviceOther> platDeviceOtherList = platDeviceOtherService.list(new QueryWrapper<PlatDeviceOther>().lambda()
.eq(PlatDeviceOther::getDeviceId, dto.getId()));
other.setWifiName(dto.getWifiName());
other.setWifiPassword(dto.getWifiPassword());
platDeviceOtherService.updateById(other);
for (PlatDeviceOther other : platDeviceOtherList) {
other.setWifiName(dto.getWifiName());
other.setWifiPassword(dto.getWifiPassword());
platDeviceOtherService.updateById(other);
}
}
/**
......@@ -524,13 +526,14 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
if (StringUtils.isNotEmpty(result)) {
resultList.add(result);
}
PlatDeviceOther other = platDeviceOtherService.getOne(new QueryWrapper<PlatDeviceOther>().lambda()
List<PlatDeviceOther> otherList = platDeviceOtherService.list(new QueryWrapper<PlatDeviceOther>().lambda()
.eq(PlatDeviceOther::getOriDeviceId, deviceId)
.last("limit 1"));
if (other != null) {
other.setAttribute(JSON.toJSONString(map));
platDeviceOtherService.updateById(other);
for (PlatDeviceOther platDeviceOther : otherList) {
platDeviceOther.setAttribute(JSON.toJSONString(map));
platDeviceOtherService.updateById(platDeviceOther);
}
}
if (CollectionUtils.isNotEmpty(resultList)) {
throw new RuntimeException("修改设备属性失败:" + resultList.get(0));
......
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