From 8f5ca1371b53e05f85e7a20a097a5926c7562793 Mon Sep 17 00:00:00 2001 From: "review512jwy@163.com" <“review512jwy@163.com”> Date: Thu, 29 Jan 2026 16:29:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF=EF=BC=8C?= =?UTF-8?q?=E7=9B=91=E8=A7=86=E7=82=B9=E5=90=8D=E7=A7=B0=E6=98=AF=E7=A9=BA?= =?UTF-8?q?=E5=B0=B1=E7=94=A8=E8=AE=BE=E5=A4=87=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DeviceServiceImpl.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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()); // }