| | |
| | | import com.genersoft.iot.vmp.gb28181.event.EventPublisher; |
| | | import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; |
| | | import com.genersoft.iot.vmp.service.IGbStreamService; |
| | | import com.genersoft.iot.vmp.service.bean.GPSMsgInfo; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; |
| | |
| | | |
| | | @Autowired |
| | | private PlatformGbStreamMapper platformGbStreamMapper; |
| | | |
| | | @Autowired |
| | | private IGbStreamService gbStreamService; |
| | | |
| | | @Autowired |
| | | private ParentPlatformMapper parentPlatformMapper; |
| | | |
| | | /** |
| | | * 根据设备ID判断设备是否存在 |
| | |
| | | if (i + limitCount > channels.size()) { |
| | | toIndex = channels.size(); |
| | | } |
| | | result = result || deviceChannelMapper.batchAdd(channels.subList(i, toIndex)) < 0; |
| | | result = result || deviceChannelMapper.batchAddOrUpdate(channels.subList(i, toIndex)) < 0; |
| | | } |
| | | }else { |
| | | result = result || deviceChannelMapper.batchAdd(channels) < 0; |
| | | result = result || deviceChannelMapper.batchAddOrUpdate(channels) < 0; |
| | | } |
| | | } |
| | | if (result) { |
| | |
| | | dataSourceTransactionManager.commit(transactionStatus); //手动提交 |
| | | return true; |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | logger.error("未处理的异常 ", e); |
| | | dataSourceTransactionManager.rollback(transactionStatus); |
| | | return false; |
| | | } |
| | |
| | | if (i + limitCount > addChannels.size()) { |
| | | toIndex = addChannels.size(); |
| | | } |
| | | result = result || deviceChannelMapper.batchAdd(addChannels.subList(i, toIndex)) < 0; |
| | | result = result || deviceChannelMapper.batchAddOrUpdate(addChannels.subList(i, toIndex)) < 0; |
| | | } |
| | | }else { |
| | | result = result || deviceChannelMapper.batchAdd(addChannels) < 0; |
| | | result = result || deviceChannelMapper.batchAddOrUpdate(addChannels) < 0; |
| | | } |
| | | } |
| | | if (updateChannels.size() > 0) { |
| | |
| | | } |
| | | return true; |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | logger.error("未处理的异常 ", e); |
| | | dataSourceTransactionManager.rollback(transactionStatus); |
| | | return false; |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public synchronized boolean insertMobilePosition(MobilePosition mobilePosition) { |
| | | if (mobilePosition.getDeviceId().equals(mobilePosition.getChannelId())) { |
| | | mobilePosition.setChannelId(null); |
| | | } |
| | | return deviceMobilePositionMapper.insertNewPosition(mobilePosition) > 0; |
| | | } |
| | | |