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