| | |
| | | package com.ruoyi.dataInterchange.server; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.ruoyi.dataInterchange.api.vo.GnssDataVo; |
| | | import com.ruoyi.dataInterchange.dao.*; |
| | | import com.ruoyi.dataInterchange.model.*; |
| | | import com.ruoyi.dataInterchange.model.enu.DataType; |
| | |
| | | import io.netty.channel.Channel; |
| | | import io.netty.channel.ChannelHandlerContext; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneOffset; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | upExgMsgRealLocation.setInferiorPlatformId(inferiorPlatformId); |
| | | upExgMsgRealLocation.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upExgMsgRealLocationDao.save(upExgMsgRealLocation); |
| | | //修改车辆实时定位 |
| | | GnssDataVo vo = new GnssDataVo(); |
| | | BeanUtils.copyProperties(upExgMsgRealLocation.getGnssData(), vo); |
| | | redisTemplate.opsForValue().set("location:" + upExgMsgRealLocation.getVehicleNo(), vo); |
| | | } |
| | | |
| | | |
| | |
| | | upExgMsgHistoryLocation.setInferiorPlatformId(inferiorPlatformId); |
| | | upExgMsgHistoryLocation.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upExgMsgHistoryLocationDao.save(upExgMsgHistoryLocation); |
| | | |
| | | //将数据存储实时定位数据表中 |
| | | List<GnssData> gnssData = upExgMsgHistoryLocation.getGnssData(); |
| | | for (GnssData gnssDatum : gnssData) { |
| | | UPExgMsgRealLocation upExgMsgRealLocation = new UPExgMsgRealLocation(); |
| | | upExgMsgRealLocation.setVehicleNo(upExgMsgHistoryLocation.getVehicleNo()); |
| | | upExgMsgRealLocation.setVehicleColor(upExgMsgHistoryLocation.getVehicleColor()); |
| | | upExgMsgRealLocation.setInferiorPlatformId(inferiorPlatformId); |
| | | upExgMsgRealLocation.setDataType(DataType.UP_EXG_MSG_REAL_LOCATION.getCode()); |
| | | upExgMsgRealLocation.setGnssData(gnssDatum); |
| | | upExgMsgRealLocation.setCreateTime(LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8))); |
| | | upExgMsgRealLocationDao.save(upExgMsgRealLocation); |
| | | } |
| | | } |
| | | |
| | | |