| | |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.utils.GoogleMap.GeocodeVo; |
| | | import com.stylefeng.guns.modular.system.utils.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.utils.RedisUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | } |
| | | return goodsInfoVos; |
| | | } |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | @Autowired |
| | | private ITExamSiteService examSiteService; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private TYardService yardService; |
| | | private HashMap<String, String> getLat(String a){ |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | try { |
| | | GeocodeVo geocode = googleMapUtil.getGeocode(a); |
| | | map.put("lon",String.valueOf(geocode.getLng())); |
| | | map.put("lat",String.valueOf(geocode.getLat())); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | map.put("lon",null); |
| | | map.put("lat",null); |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | @Override |
| | | public OrderInfo getOrderInfo(Long orderId) { |
| | | public HashMap<String, Object> getOrderInfo(Long orderId) { |
| | | OrderInfo orderInfo = new OrderInfo(); |
| | | ArrayList<LonLat> lonLats = new ArrayList<>(); |
| | | |
| | | TOrder tOrder = this.baseMapper.selectById(orderId); |
| | | |
| | | |
| | | String value = redisUtil.getValue(String.valueOf(orderId)); |
| | | orderInfo.setDriverLat(value); |
| | | ArrayList<Map<String,String>> maps = new ArrayList<>(); |
| | | TTransportation tTransportations = tTransportationService.selectOne(new EntityWrapper<TTransportation>().eq("order_id", orderId).eq("type",1)); |
| | | if(tTransportations!=null) { |
| | | TPort tPort1 = portMapper.selectById(tOrder.getPort()); |
| | | maps.add(getLat(tPort1.getAddress())); |
| | | } |
| | | |
| | | if(tOrder.getExamSite()!=null){ |
| | | Integer examSite = tOrder.getExamSite(); |
| | | TExamSite tExamSite = examSiteService.selectById(examSite); |
| | | // 第二个检查站 |
| | | maps.add(getLat(tExamSite.getAddress())); |
| | | } |
| | | |
| | | TTransportation tTransportations1 = tTransportationService.selectOne(new EntityWrapper<TTransportation>().eq("order_id", orderId).eq("type",2)); |
| | | if(tTransportations1!=null){ |
| | | Integer yardId = tTransportations1.getYardId(); |
| | | if(yardId!=null){ |
| | | TYard tYard = yardService.selectById(yardId); |
| | | maps.add(getLat(tYard.getStreetAddress())); |
| | | } |
| | | } |
| | | |
| | | |
| | | if(tOrder.geteAddress()!=null){ |
| | | maps.add(getLat(tOrder.geteAddress())); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | orderInfo.setSlat(tOrder.getStartLat()); |
| | | orderInfo.setSlon(tOrder.getStartLon()); |
| | | |
| | |
| | | // 获取码头id 获取码头地址 pickup信息 |
| | | Integer portId = tOrder.getPort(); |
| | | TPort tPort = portMapper.selectById(portId); |
| | | orderInfo.setAddress(tOrder.geteAddress()); |
| | | orderInfo.setAddress(tPort.getAddress()); |
| | | orderInfo.setContactName(tOrder.getsName()); |
| | | orderInfo.setContactPhone(tOrder.getsPhone()); |
| | | orderInfo.setContactEmail(tOrder.getsEmail()); |
| | |
| | | orderInfo.setNote(driverNoteVos); |
| | | orderInfo.setTrouble(driverNoteVos1); |
| | | orderInfo.setState(tOrder.getState()); |
| | | return orderInfo; |
| | | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("lonlat",maps); |
| | | map.put("data",orderInfo); |
| | | |
| | | return map; |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getLonLat(Long orderId) { |
| | | return this.baseMapper.getLonLat(orderId); |
| | | } |
| | | |
| | | |
| | | } |