| | |
| | | import com.genersoft.iot.vmp.common.StreamInfo; |
| | | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| | | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| | | import com.genersoft.iot.vmp.gb28181.bean.MobilePosition; |
| | | import com.genersoft.iot.vmp.gb28181.utils.Coordtransform; |
| | | import com.genersoft.iot.vmp.service.IDeviceChannelService; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; |
| | | import com.genersoft.iot.vmp.storager.dao.DeviceChannelMapper; |
| | | import com.genersoft.iot.vmp.storager.dao.DeviceMapper; |
| | | import com.genersoft.iot.vmp.utils.DateUtil; |
| | |
| | | |
| | | @Autowired |
| | | private DeviceMapper deviceMapper; |
| | | |
| | | |
| | | @Autowired |
| | | private IVideoManagerStorage storager; |
| | | |
| | | @Override |
| | | public DeviceChannel updateGps(DeviceChannel deviceChannel, Device device) { |
| | |
| | | channelMapper.update(channel); |
| | | } |
| | | channelMapper.updateChannelSubCount(deviceId,channel.getParentId()); |
| | | // 更新移动位置信息 |
| | | updateMobilePosition(channel); |
| | | //更新坐标绑定关系 |
| | | handleBindPosition(deviceChannel,channel); |
| | | } |
| | | |
| | | /** |
| | | * 添加移动位置信息 |
| | | * @param channel |
| | | */ |
| | | private void updateMobilePosition(DeviceChannel channel) { |
| | | MobilePosition mobilePosition = new MobilePosition(); |
| | | mobilePosition.setDeviceId(channel.getDeviceId()); |
| | | mobilePosition.setChannelId(channel.getChannelId()); |
| | | mobilePosition.setLongitude(channel.getLongitude()); |
| | | mobilePosition.setLatitude(channel.getLatitude()); |
| | | mobilePosition.setTime(channel.getGpsTime()); |
| | | mobilePosition.setCreateTime(channel.getGpsTime()); |
| | | |
| | | mobilePosition.setLongitudeWgs84(channel.getLongitudeWgs84()); |
| | | mobilePosition.setLatitudeWgs84(channel.getLatitudeWgs84()); |
| | | mobilePosition.setLongitudeGcj02(channel.getLongitudeGcj02()); |
| | | mobilePosition.setLatitudeGcj02(channel.getLatitudeGcj02()); |
| | | storager.insertMobilePosition(mobilePosition); |
| | | } |
| | | |
| | | /** |
| | | * 更新坐标绑定关系 |
| | | * @param deviceChannel |
| | | * @param channel |