|
|
@@ -69,6 +69,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
private IotDeviceInfoExtendService extendService;
|
|
|
@Resource
|
|
|
private ApplicationEventPublisher eventPublisher;
|
|
|
+
|
|
|
@Override
|
|
|
public TableDataInfo<IotDeviceInfoPageVo> deviceInfoPage(IotDeviceInfoPageDto request) {
|
|
|
if (request.getCheckSub()) {
|
|
|
@@ -222,7 +223,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
}
|
|
|
|
|
|
extendService.updateByDeviceId(deviceId, req);
|
|
|
- eventPublisher.publishEvent(new DeviceSyncEvent(this,deviceId));
|
|
|
+ eventPublisher.publishEvent(new DeviceSyncEvent(this, deviceId));
|
|
|
return effect;
|
|
|
}
|
|
|
|
|
|
@@ -312,7 +313,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
}
|
|
|
|
|
|
updateAddAlarmHostDevice(req);
|
|
|
- eventPublisher.publishEvent(new DeviceSyncEvent(this,deviceId));
|
|
|
+ eventPublisher.publishEvent(new DeviceSyncEvent(this, deviceId));
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
@@ -498,7 +499,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
deviceInfo = new IotDeviceInfo();
|
|
|
deviceInfo.setCreateTime(new Date());
|
|
|
deviceInfo.setCreateBy(sysUser.getId().toString());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
deviceInfo = getById(req.getId());
|
|
|
}
|
|
|
BeanUtil.copyProperties(req, deviceInfo);
|
|
|
@@ -529,7 +530,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
deviceInfo.setDeleted(0);
|
|
|
saveOrUpdate(deviceInfo);
|
|
|
extendService.updateNetHostExtendByDeviceId(deviceInfo.getId(), req);
|
|
|
- eventPublisher.publishEvent(new DeviceSyncEvent(this,deviceInfo.getId()));
|
|
|
+ eventPublisher.publishEvent(new DeviceSyncEvent(this, deviceInfo.getId()));
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
@@ -540,7 +541,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
if (deviceInfo == null) {
|
|
|
throw new RuntimeException("设备不存在");
|
|
|
}
|
|
|
- NetHostDeviceInfoVo resp=new NetHostDeviceInfoVo();
|
|
|
+ NetHostDeviceInfoVo resp = new NetHostDeviceInfoVo();
|
|
|
final IotDeviceInfoExtend extend = extendService.findByDeviceId(id);
|
|
|
BeanUtil.copyProperties(deviceInfo, resp);
|
|
|
resp.setIotCode(deviceInfo.getIotToken());
|
|
|
@@ -548,4 +549,11 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
resp.setServerIp(extend.getNetAddress());
|
|
|
return resp;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public Integer reSyncDevice(Long id) {
|
|
|
+ eventPublisher.publishEvent(new DeviceSyncEvent(this, id));
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
}
|