| | |
| | | import com.ruoyi.dataInterchange.netty.client.ChannelMap; |
| | | import com.ruoyi.dataInterchange.util.jtt809.common.Jtt809Util; |
| | | import com.ruoyi.dataInterchange.util.jtt809.packet.common.OuterPacket; |
| | | import com.ruoyi.dataInterchange.wapper.UPConnect; |
| | | import io.netty.buffer.ByteBuf; |
| | | import io.netty.buffer.Unpooled; |
| | | import io.netty.channel.Channel; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneOffset; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public void up_warn_msg_urge_todo_ack(ChannelHandlerContext ctx, int inferiorPlatformId, WarnMsg warnMsg) { |
| | | UPWarnMsgUrgeTodoAck upWarnMsgUrgeTodoAck = new UPWarnMsgUrgeTodoAck().decode(warnMsg); |
| | | upWarnMsgUrgeTodoAck.setInferiorPlatformId(inferiorPlatformId); |
| | | upWarnMsgUrgeTodoAck.setCreateTime(LocalDateTime.now()); |
| | | upWarnMsgUrgeTodoAck.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upWarnMsgUrgeTodoAckDao.save(upWarnMsgUrgeTodoAck); |
| | | } |
| | | |
| | |
| | | UPWarnMsgAdptInfo upWarnMsgAdptInfo = new UPWarnMsgAdptInfo().decode(warnMsg); |
| | | upWarnMsgAdptInfo.setResult(0x00); |
| | | upWarnMsgAdptInfo.setInferiorPlatformId(inferiorPlatformId); |
| | | upWarnMsgAdptInfo.setCreateTime(LocalDateTime.now()); |
| | | upWarnMsgAdptInfo.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upWarnMsgAdptInfoDao.save(upWarnMsgAdptInfo); |
| | | } |
| | | |
| | |
| | | Channel channel = ChannelMap.getClientChannel(inferiorPlatformId); |
| | | if (null != channel && channel.isActive()) { |
| | | channel.writeAndFlush(out); |
| | | channel.flush(); |
| | | } else { |
| | | //重新连接从链路 |
| | | UPConnect ipAndPort = ChannelMap.getIpAndPort(inferiorPlatformId); |
| | | connectReqService.downConnect(inferiorPlatformId, ipAndPort.getDownLinkIp(), ipAndPort.getDownLinkPort(), ipAndPort.getVerifyCode()); |
| | | channel = ChannelMap.getServerChannel(inferiorPlatformId); |
| | | channel.writeAndFlush(out); |
| | | } |
| | | |
| | | } |