| | |
| | | package com.ruoyi.dataInterchange.server; |
| | | |
| | | import com.ruoyi.dataInterchange.model.UPExgMsg; |
| | | import com.ruoyi.dataInterchange.model.UPPlatformMsg; |
| | | import com.ruoyi.dataInterchange.model.UPPlatformMsgInfoAck; |
| | | import com.ruoyi.dataInterchange.model.enu.DataType; |
| | | import com.ruoyi.dataInterchange.util.jtt809.common.Jtt809Util; |
| | | import com.ruoyi.dataInterchange.util.jtt809.packet.common.OuterPacket; |
| | | import io.netty.buffer.ByteBuf; |
| | | import io.netty.buffer.Unpooled; |
| | | import io.netty.channel.ChannelHandlerContext; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | @Component |
| | | public class PlatformMsgService { |
| | | |
| | | public void up_platform_msg(ChannelHandlerContext ctx, OuterPacket out){ |
| | | @Resource |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | |
| | | public void up_platform_msg(ChannelHandlerContext ctx, OuterPacket out) { |
| | | if (!redisTemplate.hasKey("login:" + out.getGnsscenterId())) { |
| | | log.error("链路还未登录校验,拒绝连接"); |
| | | ctx.close(); |
| | | return; |
| | | } |
| | | UPPlatformMsg platformMsg = getPlatformMsg(out); |
| | | DataType dataType = DataType.getDataType(platformMsg.getDataType()); |
| | | switch (dataType){ |
| | | switch (dataType) { |
| | | case UP_PLATFORM_MSG_POST_QUERY_ACK: |
| | | log.info("平台查岗应答消息({}):{}", DataType.UP_PLATFORM_MSG_POST_QUERY_ACK.getCode(), platformMsg); |
| | | break; |
| | | case UP_PLATFORM_MSG_INFO_ACK: |
| | | log.info("下发平台间报文应答消息({}):{}", DataType.UP_PLATFORM_MSG_INFO_ACK.getCode(), platformMsg); |
| | | break; |
| | | case UP_PLATFORM_MSG_RETRAN_REQ: |
| | | log.info("上传平台间消息补传请求({}):{}", DataType.UP_PLATFORM_MSG_RETRAN_REQ.getCode(), platformMsg); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 解析子业务数据 |
| | | * |
| | | * @param out |
| | | * @return |
| | | */ |