diff --git a/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DeviceServiceImpl.java b/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DeviceServiceImpl.java index 7bbf007..0c25ce1 100644 --- a/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DeviceServiceImpl.java +++ b/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DeviceServiceImpl.java @@ -260,6 +260,10 @@ public class DeviceServiceImpl implements IDeviceService { deviceInfo.setCreatedTimestamp(new Date()); deviceInfo.setUpdatedBy(userId); deviceInfo.setWsclientId(deviceAddParams.getWsclientId()); + // 20260129需求:监视点名称是空就用设备名 + if (StringUtils.isBlank(deviceInfo.getMonitoringPointName())) { + deviceInfo.setMonitoringPointName(deviceInfo.getDeviceName()); + } if (Objects.nonNull(deviceAddParams.getTypeId())) { deviceInfo.setTypeId(deviceAddParams.getTypeId().intValue()); @@ -353,6 +357,12 @@ public class DeviceServiceImpl implements IDeviceService { if (StringUtils.isBlank(deviceUpdateParams.getDataMapping())) { deviceInfo.setDataMapping("{}"); } + + // 20260129需求:监视点名称是空就用设备名 + if (StringUtils.isBlank(deviceInfo.getMonitoringPointName())) { + deviceInfo.setMonitoringPointName(deviceInfo.getDeviceName()); + } + this.deviceInfoMapperExt.updateByPrimaryKeySelective(deviceInfo); DeviceGroupRelationExample example = new DeviceGroupRelationExample(); @@ -968,6 +978,10 @@ public class DeviceServiceImpl implements IDeviceService { } else { deviceInfo.setDataMapping(deviceInfoExcel.getDataMapping()); } + // 20260129需求:监视点名称是空就用设备名 + if (StringUtils.isBlank(deviceInfo.getMonitoringPointName())) { + deviceInfo.setMonitoringPointName(deviceInfo.getDeviceName()); + } // if (StringUtils.isNotBlank(deviceInfoExcel.getMonitoringPointCategory())) { // deviceInfo.setMonitoringPointCategoryId(monitoringPointCategoryMapping.get(deviceInfoExcel.getMonitoringPointCategory()).getId()); // } @@ -1002,6 +1016,10 @@ public class DeviceServiceImpl implements IDeviceService { if (StringUtils.isNotBlank(deviceInfoExcel.getDataProvider())) { deviceInfo.setDataProviderId(dataProviderMapping.get(deviceInfoExcel.getDataProvider()).getId()); } + // 20260129需求:监视点名称是空就用设备名 + if (StringUtils.isBlank(deviceInfo.getMonitoringPointName())) { + deviceInfo.setMonitoringPointName(deviceInfo.getDeviceName()); + } // if (StringUtils.isNotBlank(deviceInfoExcel.getMonitoringPointCategory())) { // deviceInfo.setMonitoringPointCategoryId(monitoringPointCategoryMapping.get(deviceInfoExcel.getMonitoringPointCategory()).getId()); // }