| | |
| | | package com.ruoyi.dataInterchange.server; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.ruoyi.dataInterchange.dao.UPExgMsgRealLocationDao; |
| | | import com.ruoyi.dataInterchange.dao.UPWarnMsgAdptInfoDao; |
| | | import com.ruoyi.dataInterchange.dao.UPWarnMsgUrgeTodoAckDao; |
| | | import com.ruoyi.dataInterchange.model.DOWNWarnMsgUrgeTodoReq; |
| | | import com.ruoyi.dataInterchange.model.UPWarnMsgAdptInfo; |
| | | import com.ruoyi.dataInterchange.model.UPWarnMsgUrgeTodoAck; |
| | | import com.ruoyi.dataInterchange.model.WarnMsg; |
| | | import com.ruoyi.dataInterchange.model.*; |
| | | import com.ruoyi.dataInterchange.model.enu.DataType; |
| | | import com.ruoyi.dataInterchange.netty.client.ChannelMap; |
| | | import com.ruoyi.dataInterchange.util.jtt809.common.Jtt809Util; |
| | |
| | | |
| | | @Resource |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | @Resource |
| | | private UPExgMsgRealLocationDao upExgMsgRealLocationDao; |
| | | |
| | | |
| | | public void up_warn_msg(ChannelHandlerContext ctx, OuterPacket out) { |
| | |
| | | upWarnMsgAdptInfo.setResult(0x00); |
| | | upWarnMsgAdptInfo.setInferiorPlatformId(inferiorPlatformId); |
| | | upWarnMsgAdptInfo.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | UPExgMsgRealLocation upExgMsgRealLocation = upExgMsgRealLocationDao.findByVehicleNoOrderByCreateTimeDesc(upWarnMsgAdptInfo.getVehicleNo()); |
| | | if (null != upExgMsgRealLocation) { |
| | | GnssData gnssData = upExgMsgRealLocation.getGnssData(); |
| | | upWarnMsgAdptInfo.setSpeed(gnssData.getVec1()); |
| | | upWarnMsgAdptInfo.setLongitude(gnssData.getLon()); |
| | | upWarnMsgAdptInfo.setLatitude(gnssData.getLat()); |
| | | } |
| | | upWarnMsgAdptInfoDao.save(upWarnMsgAdptInfo); |
| | | } |
| | | |
| | |
| | | downWarnMsgUrgeTodoReq.setDataType(DataType.DOWN_WARN_MSG_URGE_TODO_REQ.getCode()); |
| | | downWarnMsgUrgeTodoReq.setDataLength(92); |
| | | byte[] body = downWarnMsgUrgeTodoReq.encode(); |
| | | OuterPacket out = new OuterPacket(DataType.DOWN_WARN_MSG_URGE_TODO_REQ.getCode(), body); |
| | | OuterPacket out = new OuterPacket(DataType.DOWN_WARN_MSG.getCode(), body); |
| | | //获取从链路通道 |
| | | Channel channel = ChannelMap.getClientChannel(inferiorPlatformId); |
| | | if (null != channel && channel.isActive()) { |