|
|
|
@ -59,13 +59,18 @@ public class DeviceServiceImpl implements DeviceService { |
|
|
|
@Transactional |
|
|
|
public SimpleDataResponse editField(OptDeviceFieldParams optDeviceFieldParams, Long companyId, Long userId, Integer languageType) { |
|
|
|
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"); |
|
|
|
} |
|
|
|
|
|
|
|
DeviceInfo deviceInfo = new DeviceInfo(); |
|
|
|
deviceInfo.setId(optDeviceFieldParams.getId()); |
|
|
|
deviceInfo.setRetainAlert(optDeviceFieldParams.getRetainAlert()); |
|
|
|
if (null != optDeviceFieldParams.getRetainAlert()){ |
|
|
|
deviceInfo.setRetainAlert(optDeviceFieldParams.getRetainAlert()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(optDeviceFieldParams.getMonitoringPointName())){ |
|
|
|
deviceInfo.setMonitoringPointName(optDeviceFieldParams.getMonitoringPointName()); |
|
|
|
} |
|
|
|
|
|
|
|
deviceInfoMapperExt.updateByPrimaryKeySelective(deviceInfo); |
|
|
|
|
|
|
|
|