Browse Source

编辑设备监视点名称

master
review512jwy@163.com 3 weeks ago
parent
commit
7ce34339b3
  1. 3
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/OptDeviceFieldParams.java
  2. 7
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceServiceImpl.java

3
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/device/OptDeviceFieldParams.java

@ -14,4 +14,7 @@ public class OptDeviceFieldParams {
@Schema(description = "dashboard自动恢复告警时是否保留告警:0-不保留,1-保留", example = "1") @Schema(description = "dashboard自动恢复告警时是否保留告警:0-不保留,1-保留", example = "1")
private Integer retainAlert; private Integer retainAlert;
@Schema(description = "dashboard自动恢复告警时是否保留告警:0-不保留,1-保留", example = "1")
private String monitoringPointName;
} }

7
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/DeviceServiceImpl.java

@ -59,13 +59,18 @@ public class DeviceServiceImpl implements DeviceService {
@Transactional @Transactional
public SimpleDataResponse editField(OptDeviceFieldParams optDeviceFieldParams, Long companyId, Long userId, Integer languageType) { public SimpleDataResponse editField(OptDeviceFieldParams optDeviceFieldParams, Long companyId, Long userId, Integer languageType) {
try { try {
if (1 != optDeviceFieldParams.getRetainAlert() && 0 != optDeviceFieldParams.getRetainAlert()){ if (null != optDeviceFieldParams.getRetainAlert() && 1 != optDeviceFieldParams.getRetainAlert() && 0 != optDeviceFieldParams.getRetainAlert()){
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [retainAlert] error"); return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [retainAlert] error");
} }
DeviceInfo deviceInfo = new DeviceInfo(); DeviceInfo deviceInfo = new DeviceInfo();
deviceInfo.setId(optDeviceFieldParams.getId()); deviceInfo.setId(optDeviceFieldParams.getId());
if (null != optDeviceFieldParams.getRetainAlert()){
deviceInfo.setRetainAlert(optDeviceFieldParams.getRetainAlert()); deviceInfo.setRetainAlert(optDeviceFieldParams.getRetainAlert());
}
if (StringUtils.isNotBlank(optDeviceFieldParams.getMonitoringPointName())){
deviceInfo.setMonitoringPointName(optDeviceFieldParams.getMonitoringPointName());
}
deviceInfoMapperExt.updateByPrimaryKeySelective(deviceInfo); deviceInfoMapperExt.updateByPrimaryKeySelective(deviceInfo);

Loading…
Cancel
Save