Commit 82b40f9f by huangjy

fix:设备编辑问题

parent dc5d5120
......@@ -250,16 +250,11 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
if (StringUtils.isNotEmpty(dto.getAttribute())) {
PlatDeviceOther other = platDeviceOtherService.getOne(new QueryWrapper<PlatDeviceOther>().lambda()
.eq(PlatDeviceOther::getDeviceId, db.getId()));
if (other != null) {
other.setAttribute(dto.getAttribute());
platDeviceOtherService.updateById(other);
} else {
other = new PlatDeviceOther();
other.setDeviceId(db.getId());
other.setOriDeviceId(db.getOriDeviceId());
other.setAttribute(dto.getAttribute());
platDeviceOtherService.save(other);
if (dto.getAttribute().equals(other.getAttribute())) {
return;
}
other.setAttribute(dto.getAttribute());
platDeviceOtherService.updateById(other);
// 写入设备
PlatDeviceAttrWechatDTO platDeviceAttrWechatDTO = JSON.parseObject(dto.getAttribute(), PlatDeviceAttrWechatDTO.class);
......@@ -397,6 +392,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
platDeviceOtherService.saveOrUpdate(other);
if (StringUtils.isNotEmpty(dto.getAttribute())) {
if (dto.getAttribute().equals(other.getAttribute())) {
return;
}
// 写入设备
PlatDeviceAttrWechatDTO platDeviceAttrWechatDTO = JSON.parseObject(dto.getAttribute(), PlatDeviceAttrWechatDTO.class);
platDeviceAttrWechatDTO.setDeviceId(db.getOriDeviceId());
......
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