| | |
| | | import com.genersoft.iot.vmp.conf.SipConfig;
|
| | | import com.genersoft.iot.vmp.conf.UserSetup;
|
| | | import com.genersoft.iot.vmp.gb28181.bean.Device;
|
| | | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
| | | import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
| | | import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
| | | import com.genersoft.iot.vmp.service.IDeviceService;
|
| | | import com.genersoft.iot.vmp.storager.dao.dto.User;
|
| | | import org.slf4j.Logger;
|
| | | import org.slf4j.LoggerFactory;
|
| | |
| | | import com.genersoft.iot.vmp.utils.redis.RedisUtil;
|
| | |
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * @description: 在线事件监听器,监听到离线后,修改设备离在线状态。 设备在线有两个来源:
|
| | |
| | |
|
| | | @Autowired
|
| | | private UserSetup userSetup;
|
| | |
|
| | | @Autowired
|
| | | private EventPublisher eventPublisher;
|
| | |
|
| | | private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
| | |
|
| | |
| | | }
|
| | |
|
| | | device.setOnline(1);
|
| | | Device deviceInstore = storager.queryVideoDevice(device.getDeviceId());
|
| | | if (deviceInstore.getOnline() == 0) {
|
| | | List<DeviceChannel> deviceChannelList = storager.queryOnlineChannelsByDeviceId(device.getDeviceId());
|
| | | eventPublisher.catalogEventPublish(null, deviceChannelList, CatalogEvent.ON);
|
| | | }
|
| | | // 处理上线监听
|
| | | storager.updateDevice(device);
|
| | |
|