Commit 186c6ad5 by gdj

bindDevice补充orgId

parent cbe4bc55
......@@ -512,6 +512,14 @@ public class DeviceServiceImpl extends ServiceImpl<IDeviceMapper, DeviceEntity>
public Boolean bindDevice(DeviceDTO device) {
device.setBoundStatus(true);
device.setBoundTime(LocalDateTime.now());
// 绑定设备补充orgId
Optional<DeviceDTO> dbDeviceBySn = this.getDeviceBySn(device.getDeviceSn());
if (dbDeviceBySn.isPresent()) {
DeviceDTO dbDeviceDTO = dbDeviceBySn.get();
if (!StringUtils.hasText(dbDeviceDTO.getOrgId())) {
device.setOrgId(getOrgId());
}
}
boolean isUpd = this.updateDevice(device);
if (!isUpd) {
......
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 to comment