648540858
2022-03-14 354a39961ad26949f597e4c434b0cd470b7f78ee
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java
@@ -2,6 +2,7 @@
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch;
import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder;
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
import com.genersoft.iot.vmp.gb28181.transmit.event.response.SIPResponseProcessorAbstract;
@@ -39,6 +40,9 @@
   @Autowired
   private SIPProcessorObserver sipProcessorObserver;
   @Autowired
   private SubscribeHolder subscribeHolder;
   @Override
   public void afterPropertiesSet() throws Exception {
@@ -83,19 +87,19 @@
         // 注册/注销成功
         logger.info(String.format("%s %s成功", platformGBId, action));
         redisCatchStorage.delPlatformRegisterInfo(callId);
         parentPlatform.setStatus("注册".equals(action));
         redisCatchStorage.delPlatformCatchInfo(platformGBId);
         // 取回Expires设置,避免注销过程中被置为0
         if (!parentPlatformCatch.getParentPlatform().getExpires().equals("0")) {
            ParentPlatform parentPlatformTmp = storager.queryParentPlatByServerGBId(platformGBId);
            String expires = parentPlatformTmp.getExpires();
            parentPlatform.setExpires(expires);
            parentPlatform.setId(parentPlatformTmp.getId());
            redisCatchStorage.updatePlatformRegister(parentPlatform);
            redisCatchStorage.updatePlatformKeepalive(parentPlatform);
            parentPlatformCatch.setParentPlatform(parentPlatform);
            redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
         }
         ParentPlatform parentPlatformTmp = storager.queryParentPlatByServerGBId(platformGBId);
         parentPlatformTmp.setStatus("注册".equals(action));
         redisCatchStorage.updatePlatformRegister(parentPlatformTmp);
         redisCatchStorage.updatePlatformKeepalive(parentPlatformTmp);
         parentPlatformCatch.setParentPlatform(parentPlatformTmp);
         redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
         storager.updateParentPlatformStatus(platformGBId, "注册".equals(action));
         if ("注销".equals(action)) {
            subscribeHolder.removeCatalogSubscribe(platformGBId);
            subscribeHolder.removeMobilePositionSubscribe(platformGBId);
         }
      }
   }