forked from dyf/fys-Multi-tenant
Merge branch 'dyf-device' into 6170
This commit is contained in:
@ -79,7 +79,6 @@ public class DeviceTypeController {
|
||||
public R<DeviceType> getCommunicationMode(@Parameter(name = "设备类型ID", required = true) Long id) {
|
||||
DeviceType communicationMode = deviceTypeService.getCommunicationMode(id);
|
||||
return R.ok(communicationMode);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -224,22 +224,13 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
|
||||
throw new RuntimeException("设备类型不存在");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!deviceType.getTypeName().equals(resources.getTypeName())) {
|
||||
int count = deviceMapper.countByDeviceTypeId(deviceType.getId());
|
||||
if (count > 0) {
|
||||
throw new RuntimeException("该设备类型下已有绑定设备,无法修改设备类型名称!!!");
|
||||
throw new RuntimeException("该设备类型下已有设备,无法修改设备类型名称!!!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// List<Device> devices = deviceMapper.selectList(new QueryWrapper<Device>()
|
||||
// .eq("device_type", deviceTypeGrants.getDeviceTypeId()));
|
||||
// if (CollectionUtil.isNotEmpty(devices)) {
|
||||
// throw new RuntimeException("该设备类型已绑定设备,无法修改!!!");
|
||||
// }
|
||||
|
||||
// 校验设备类型名称
|
||||
DeviceType dt = deviceTypeMapper.selectOne(new QueryWrapper<DeviceType>().eq("type_name", resources.getTypeName()));
|
||||
if (dt != null && !dt.getId().equals(deviceType.getId())) {
|
||||
|
||||
Reference in New Issue
Block a user