forked from dyf/fys-Multi-tenant
Merge branch 'dyf-device'
This commit is contained in:
@ -190,7 +190,8 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
device.setPubTopic("A/" + device.getDeviceImei());
|
||||
device.setSubTopic("B/" + device.getDeviceImei());
|
||||
}
|
||||
|
||||
// 0 未绑定
|
||||
device.setBindingStatus(0);
|
||||
deviceMapper.insert(device);
|
||||
|
||||
// 新增设备类型记录
|
||||
@ -303,7 +304,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
throw new BadRequestException(device.getDeviceName() + ":设备已分配,请先解绑设备!!!");
|
||||
}
|
||||
|
||||
if (device.getBindingStatus().equals(1)){
|
||||
if (device.getBindingStatus() != null && device.getBindingStatus().equals(1)) {
|
||||
throw new BadRequestException(device.getDeviceName() + ":设备已绑定,请先解绑设备!!!");
|
||||
}
|
||||
|
||||
@ -312,6 +313,11 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
invalidIds.add(deviceAssignment.getDeviceId());
|
||||
}
|
||||
|
||||
// 删除设备:分配记录
|
||||
deviceAssignmentsMapper.delete(new LambdaQueryWrapper<DeviceAssignments>()
|
||||
.eq(DeviceAssignments::getDeviceId, deviceAssignment.getDeviceId())
|
||||
.eq(DeviceAssignments::getAssigneeId, deviceAssignment.getAssigneeId()));
|
||||
|
||||
}
|
||||
|
||||
deviceAssignmentsMapper.deleteByIds(ids);
|
||||
|
Reference in New Issue
Block a user