REM:
1. 对更新设备时增加某些字段不能修改的功能
This commit is contained in:
HuangXin 2020-09-24 15:52:51 +08:00
parent bd8e763594
commit a48af6b9d9
1 changed files with 9 additions and 3 deletions

View File

@ -108,8 +108,8 @@ public class DisposeDeviceManagerImpl implements DisposeDeviceManager {
Field fdDest = destDev.getClass().getDeclaredField(fdSrc.getName());
fdDest.setAccessible(true);
if (!obj.equals(fdDest.get(destDev))) {
log.debug("Upgrade field [{}] value form [{}] to [{}]",
fdSrc.getName(), fdDest.get(destDev), obj);
log.debug("Upgrade field [{}] value form [{}] to [{}]", fdSrc.getName(), fdDest.get(destDev),
obj);
fdDest.set(destDev, obj);
}
fdDest.setAccessible(false);
@ -151,6 +151,12 @@ public class DisposeDeviceManagerImpl implements DisposeDeviceManager {
return new MulReturnType<>(ErrorCode.ERR_NOSUCHDEVICE, -1L);
}
// 过滤不允许修改的值
dev.setUrlPath(null);
dev.setUserName(null);
dev.setUrlType(null);
dev.setPassword(null);
// 更新值
upgradeDisposeDeviceProperties(tDev, dev);
@ -237,7 +243,7 @@ public class DisposeDeviceManagerImpl implements DisposeDeviceManager {
// 获取分页信息
PageInfo<DisposeDevice> pageInfo = new PageInfo<>(devList);
if(devList.size() > 0) {
if (devList.size() > 0) {
// 返回实际数据
List<Long> idArray = devList.stream().map(DisposeDevice::getId).collect(Collectors.toList());
rspList.addAll(disposeDeviceMapper.selectByIdSet(idArray));