|
|
@@ -15,7 +15,6 @@ import com.xunmei.common.core.domain.iot.domain.IotAlarmDefenceArea;
|
|
|
import com.xunmei.common.core.domain.iot.domain.IotAlarmSubsystem;
|
|
|
import com.xunmei.common.core.domain.iot.domain.IotServerProduct;
|
|
|
import com.xunmei.common.core.enums.iot.BaseDeviceTypeEnum;
|
|
|
-import com.xunmei.common.core.event.DeviceSyncEvent;
|
|
|
import com.xunmei.common.core.utils.DateUtils;
|
|
|
import com.xunmei.common.core.utils.StringUtils;
|
|
|
import com.xunmei.common.core.web.page.TableDataInfo;
|
|
|
@@ -41,7 +40,6 @@ import com.xunmei.system.api.domain.iot.IotDeviceInfoExtend;
|
|
|
import org.redisson.api.RLock;
|
|
|
import org.redisson.api.RedissonClient;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
-import org.springframework.context.ApplicationEventPublisher;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -67,8 +65,6 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
private IotServerProductMapper productMapper;
|
|
|
@Resource
|
|
|
private IotDeviceInfoExtendService extendService;
|
|
|
- @Resource
|
|
|
- private ApplicationEventPublisher eventPublisher;
|
|
|
|
|
|
@Override
|
|
|
public TableDataInfo<IotDeviceInfoPageVo> deviceInfoPage(IotDeviceInfoPageDto request) {
|
|
|
@@ -223,7 +219,6 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
}
|
|
|
|
|
|
extendService.updateByDeviceId(deviceId, req);
|
|
|
- eventPublisher.publishEvent(new DeviceSyncEvent(this, deviceId));
|
|
|
return effect;
|
|
|
}
|
|
|
|
|
|
@@ -313,7 +308,6 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
}
|
|
|
|
|
|
updateAddAlarmHostDevice(req);
|
|
|
- eventPublisher.publishEvent(new DeviceSyncEvent(this, deviceId));
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
@@ -530,7 +524,6 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
deviceInfo.setDeleted(0);
|
|
|
saveOrUpdate(deviceInfo);
|
|
|
extendService.updateNetHostExtendByDeviceId(deviceInfo.getId(), req);
|
|
|
- eventPublisher.publishEvent(new DeviceSyncEvent(this, deviceInfo.getId()));
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
@@ -552,8 +545,8 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Integer reSyncDevice(Long id) {
|
|
|
- eventPublisher.publishEvent(new DeviceSyncEvent(this, id));
|
|
|
+ public Integer syncDevice(Long id) {
|
|
|
+ remoteHostService.syncDeviceToHost(id);
|
|
|
return 1;
|
|
|
}
|
|
|
}
|