|
|
@@ -15,6 +15,7 @@ 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;
|
|
|
@@ -40,6 +41,7 @@ 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;
|
|
|
|
|
|
@@ -65,7 +67,8 @@ 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) {
|
|
|
if (request.getCheckSub()) {
|
|
|
@@ -219,7 +222,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
}
|
|
|
|
|
|
extendService.updateByDeviceId(deviceId, req);
|
|
|
-
|
|
|
+ eventPublisher.publishEvent(new DeviceSyncEvent(this,deviceId));
|
|
|
return effect;
|
|
|
}
|
|
|
|
|
|
@@ -309,6 +312,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
}
|
|
|
|
|
|
updateAddAlarmHostDevice(req);
|
|
|
+ eventPublisher.publishEvent(new DeviceSyncEvent(this,deviceId));
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
@@ -525,6 +529,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()));
|
|
|
return 1;
|
|
|
}
|
|
|
|