Pu Zhibing
11 小时以前 a91f50ce8ce976743c11de98f9e3ed574bb3f78e
ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/server/AuthorizeMsgService.java
@@ -1,6 +1,7 @@
package com.ruoyi.dataInterchange.server;
import com.alibaba.fastjson.JSON;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.dataInterchange.dao.UPAuthorizeMsgStartupDao;
import com.ruoyi.dataInterchange.model.UPAuthorizeMsgStartup;
import com.ruoyi.dataInterchange.util.jtt809.packet.common.OuterPacket;
@@ -33,16 +34,18 @@
   
   public void up_authorize_msg(ChannelHandlerContext ctx, OuterPacket out) {
      if (!redisTemplate.hasKey("login:" + out.getGnsscenterId())) {
         log.error("链路还未登录校验,拒绝连接");
         log.error("链路还未登录校验,拒绝连接:{}", out.getGnsscenterId());
         ctx.close();
         return;
      }
      byte[] body = out.getBody();
      ByteBuf byteBuf = Unpooled.wrappedBuffer(body);
      UPAuthorizeMsgStartup startup = new UPAuthorizeMsgStartup().decode(byteBuf);
      log.info("主链路视频时效口令上报:" + JSON.toJSONString(startup));
      log.info("视频时效口令上报:" + JSON.toJSONString(startup));
      startup.setInferiorPlatformId(out.getGnsscenterId());
      startup.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8)));
      upAuthorizeMsgStartupDao.save(startup);
      if(StringUtils.isNotEmpty(startup.getAuthorizeCode1())){
         upAuthorizeMsgStartupDao.save(startup);
      }
   }
}