该设备类型下已有设备,无法修改设备类型名称!!!

This commit is contained in:
2026-02-04 17:28:08 +08:00
parent 0f0dd4c6b1
commit 04cb699081
6 changed files with 90 additions and 5 deletions

View File

@ -10,32 +10,36 @@ import lombok.EqualsAndHashCode;
/**
* 设备维修图片对象 device_repair_images
*
*
* @date 2025-09-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("device_repair_images")
public class DeviceRepairImages extends TenantEntity {
/**
* 维修图片ID
*/
@TableId(value = "image_id", type = IdType.AUTO)
@TableField(insertStrategy = FieldStrategy.NEVER)
private Long imageId;
/**
* 维修记录ID
*/
@Schema(title = "维修记录ID")
private Long recordId;
/**
* 图片类型(维修前/维修后)
*/
@Schema(title = "图片类型(维修前/维修后)")
private RepairImageType imageType;
/**
* 图片存储路径
*/
@Schema(title = "图片存储路径")
private String imageUrl;
}

View File

@ -244,10 +244,10 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
throw new RuntimeException("设备类型不存在");
}
if (!deviceType.getTypeName().equals(resources.getTypeName())) {
if (!deviceType.getTypeName().equals(resources.getTypeName()) || !deviceType.getAppModelDictionary().equals(resources.getAppModelDictionary())) {
int count = deviceMapper.countByDeviceTypeId(deviceType.getId());
if (count > 0) {
throw new RuntimeException("该设备类型下已有设备,无法修改设备类型名称!!!");
throw new RuntimeException("该设备类型下已有设备,无法修改设备类型名称和路由跳转!!!");
}
}