|  |  | 
 |  |  | package com.genersoft.iot.vmp.gb28181.task.impl; | 
 |  |  |  | 
 |  |  | import com.genersoft.iot.vmp.conf.DynamicTask; | 
 |  |  | import com.genersoft.iot.vmp.gb28181.bean.*; | 
 |  |  | import com.genersoft.iot.vmp.gb28181.task.ISubscribeTask; | 
 |  |  | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; | 
 |  |  | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * 向已经订阅(移动位置)的上级发送MobilePosition消息 | 
 |  |  |  * @author lin | 
 |  |  |  */ | 
 |  |  | public class MobilePositionSubscribeHandlerTask implements ISubscribeTask { | 
 |  |  |  | 
 |  |  | 
 |  |  |     private ISIPCommanderForPlatform sipCommanderForPlatform; | 
 |  |  |     private SubscribeHolder subscribeHolder; | 
 |  |  |     private ParentPlatform platform; | 
 |  |  |  | 
 |  |  |     private String sn; | 
 |  |  |     private String key; | 
 |  |  |  | 
 |  |  |     public MobilePositionSubscribeHandlerTask(IRedisCatchStorage redisCatchStorage, ISIPCommanderForPlatform sipCommanderForPlatform, IVideoManagerStorage storager, String platformId, String sn, String key, SubscribeHolder subscribeInfo) { | 
 |  |  |     public MobilePositionSubscribeHandlerTask(IRedisCatchStorage redisCatchStorage, | 
 |  |  |                                               ISIPCommanderForPlatform sipCommanderForPlatform, | 
 |  |  |                                               IVideoManagerStorage storager, | 
 |  |  |                                               String platformId, | 
 |  |  |                                               String sn, | 
 |  |  |                                               String key, | 
 |  |  |                                               SubscribeHolder subscribeInfo, | 
 |  |  |                                               DynamicTask dynamicTask) { | 
 |  |  |         this.redisCatchStorage = redisCatchStorage; | 
 |  |  |         this.storager = storager; | 
 |  |  |         this.platform = storager.queryParentPlatByServerGBId(platformId); | 
 |  |  | 
 |  |  |     @Override | 
 |  |  |     public void run() { | 
 |  |  |  | 
 |  |  |         if (platform == null) return; | 
 |  |  |         if (platform == null) { | 
 |  |  |             return; | 
 |  |  |         } | 
 |  |  |         SubscribeInfo subscribe = subscribeHolder.getMobilePositionSubscribe(platform.getServerGBId()); | 
 |  |  |         if (subscribe != null) { | 
 |  |  |  | 
 |  |  | 
 |  |  |                 String gbId = gbStream.getGbId(); | 
 |  |  |                 GPSMsgInfo gpsMsgInfo = redisCatchStorage.getGpsMsgInfo(gbId); | 
 |  |  |                 if (gpsMsgInfo != null) { // 无最新位置不发送 | 
 |  |  |                     logger.info("无最新位置不发送"); | 
 |  |  |                    if (logger.isDebugEnabled()) { | 
 |  |  |                        logger.debug("无最新位置不发送"); | 
 |  |  |                    } | 
 |  |  |                     // 经纬度都为0不发送 | 
 |  |  |                     if (gpsMsgInfo.getLng() == 0 && gpsMsgInfo.getLat() == 0) { | 
 |  |  |                         continue; |