Commit 111b5aa5 by huangjy

fix:配网bug

parent 178103e2
...@@ -327,14 +327,6 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -327,14 +327,6 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
id = db.getId(); id = db.getId();
PlatDeviceOther other = platDeviceOtherService.getOne(new QueryWrapper<PlatDeviceOther>().lambda()
.eq(PlatDeviceOther::getOriDeviceId, dto.getOriDeviceId()));
if (other == null) {
other = new PlatDeviceOther();
}
String otherId = other.getId();
String tenantId = db.getTenantId(); String tenantId = db.getTenantId();
BeanUtils.copyProperties(dto, db); BeanUtils.copyProperties(dto, db);
db.setId(id); db.setId(id);
...@@ -342,17 +334,16 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -342,17 +334,16 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
db.setOrgId(dto.getOrgId()); db.setOrgId(dto.getOrgId());
saveOrUpdate(db); saveOrUpdate(db);
id = db.getId(); id = db.getId();
deviceCacheUtil.put(db); deviceCacheUtil.put(db);
BeanUtils.copyProperties(dto, other); List<PlatDeviceOther> platDeviceOtherList = platDeviceOtherService.list(new QueryWrapper<PlatDeviceOther>().lambda()
other.setId(otherId); .eq(PlatDeviceOther::getOriDeviceId, dto.getOriDeviceId()));
other.setDeviceId(id); for (PlatDeviceOther platDeviceOther : platDeviceOtherList) {
other.setOriDeviceId(db.getOriDeviceId()); BeanUtils.copyProperties(dto, platDeviceOther,"id");
platDeviceOther.setDeviceId(id);
platDeviceOtherService.saveOrUpdate(other); platDeviceOther.setOriDeviceId(db.getOriDeviceId());
platDeviceOtherService.saveOrUpdate(platDeviceOther);
}
} }
@Override @Override
......
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