| | |
| | | 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; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | |
| | | |
| | | @Resource |
| | | private UPExgMsgRegisterDao upExgMsgRegisterDao; |
| | | |
| | | @Resource |
| | | private UPExgMsgRealLocationDao upExgMsgRealLocationDao; |
| | | |
| | | |
| | | /** |
| | |
| | | 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(); |
| | | String longitude = new BigDecimal(gnssData.getLon()).divide(new BigDecimal(1000000)).toString(); |
| | | String latitude = new BigDecimal(gnssData.getLat()).divide(new BigDecimal(1000000)).toString(); |
| | | vo.setLongitude(longitude); |
| | | vo.setLatitude(latitude); |
| | | } |
| | | voList.add(vo); |
| | | } |
| | | |
| | |
| | | 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(); |
| | | String longitude = new BigDecimal(gnssData.getLon()).divide(new BigDecimal(1000000)).toString(); |
| | | String latitude = new BigDecimal(gnssData.getLat()).divide(new BigDecimal(1000000)).toString(); |
| | | vo.setLongitude(longitude); |
| | | vo.setLatitude(latitude); |
| | | } |
| | | voList.add(vo); |
| | | } |
| | | } |