Pu Zhibing
2025-04-04 3d4eeb82dd61f8951616dece2425e870116bc23d
ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/controller/UPExgMsgRegisterController.java
@@ -3,7 +3,10 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.bean.BeanUtils;
import com.ruoyi.dataInterchange.api.vo.UPExgMsgRegisterVo;
import com.ruoyi.dataInterchange.dao.UPExgMsgRealLocationDao;
import com.ruoyi.dataInterchange.dao.UPExgMsgRegisterDao;
import com.ruoyi.dataInterchange.model.GnssData;
import com.ruoyi.dataInterchange.model.UPExgMsgRealLocation;
import com.ruoyi.dataInterchange.model.UPExgMsgRegister;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -26,6 +29,9 @@
   @Resource
   private UPExgMsgRegisterDao upExgMsgRegisterDao;
   
   @Resource
   private UPExgMsgRealLocationDao upExgMsgRealLocationDao;
   
   /**
    * 查询添加时间大于等于给定时间的车辆基础数据
@@ -42,6 +48,12 @@
            UPExgMsgRegister register = iterator.next();
            UPExgMsgRegisterVo vo = new UPExgMsgRegisterVo();
            BeanUtils.copyProperties(register, vo);
            UPExgMsgRealLocation realLocation = upExgMsgRealLocationDao.findByVehicleNoOrderByCreateTimeDesc(register.getVehicleNo());
            if (null != realLocation) {
               GnssData gnssData = realLocation.getGnssData();
               vo.setLongitude(Double.valueOf(gnssData.getLon() / 1000000).toString());
               vo.setLatitude(Double.valueOf(gnssData.getLat() / 1000000).toString());
            }
            voList.add(vo);
         }
         
@@ -50,6 +62,12 @@
         for (UPExgMsgRegister register : list) {
            UPExgMsgRegisterVo vo = new UPExgMsgRegisterVo();
            BeanUtils.copyProperties(register, vo);
            UPExgMsgRealLocation realLocation = upExgMsgRealLocationDao.findByVehicleNoOrderByCreateTimeDesc(register.getVehicleNo());
            if (null != realLocation) {
               GnssData gnssData = realLocation.getGnssData();
               vo.setLongitude(Double.valueOf(gnssData.getLon() / 1000000).toString());
               vo.setLatitude(Double.valueOf(gnssData.getLat() / 1000000).toString());
            }
            voList.add(vo);
         }
      }