diff --git a/src/main/java/com/dispose/manager/impl/DisposeDeviceManagerImpl.java b/src/main/java/com/dispose/manager/impl/DisposeDeviceManagerImpl.java index be427d36..b86b40b8 100644 --- a/src/main/java/com/dispose/manager/impl/DisposeDeviceManagerImpl.java +++ b/src/main/java/com/dispose/manager/impl/DisposeDeviceManagerImpl.java @@ -77,6 +77,7 @@ public class DisposeDeviceManagerImpl implements DisposeDeviceManager { // 添加设备能力信息 if (err == ErrorCode.ERR_OK) { + dev.getDevCapacity().forEach(v-> v.setDeviceId(dev.getId())); disposeCapacityMapper.addNewDisposeCapacity(dev.getDevCapacity()); } @@ -160,7 +161,10 @@ public class DisposeDeviceManagerImpl implements DisposeDeviceManager { disposeCapacityMapper.delDeviceDisposeCapacity(tDev.getId()); // 新增能力信息完成更新 + Long devId = tDev.getId(); + if (tDev.getDevCapacity().size() != 0) { + tDev.getDevCapacity().forEach(v-> v.setDeviceId(devId)); disposeCapacityMapper.addNewDisposeCapacity(tDev.getDevCapacity()); }