| 
					
				 | 
			
			
				@@ -0,0 +1,849 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+package com.steerinfo.route.service.impl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.alibaba.fastjson.JSON; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.alibaba.fastjson.JSONObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.dil.service.OffSiteTransportationService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.dil.service.impl.OffSiteTransportationServiceImpl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.dil.util.PageListAdd; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.framework.controller.RESTfulResult; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.framework.service.pagehelper.PageHelper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.route.service.RouteService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.route.threeRequest.ZhongJiaoXingLu; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.route.util.DataConversionTool; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.route.util.HTTPRequestUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.route.util.LngLonUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.route.vo.FullPathVisualizationTo.ViewVisualization; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.route.vo.Map.Point; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.route.vo.Map.RouteVo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.route.vo.Map.RunRoutePoint; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.route.vo.Map.StartAndEndRoute; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.steerinfo.route.vo.resultJson.SearchPoint; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import io.swagger.annotations.ApiImplicitParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import io.swagger.annotations.ApiImplicitParams; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import io.swagger.annotations.ApiOperation; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.beans.factory.annotation.Value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.data.redis.core.RedisTemplate; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.stereotype.Service; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.util.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.web.bind.annotation.PostMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.web.bind.annotation.RequestBody; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.math.BigDecimal; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.net.URLEncoder; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.text.SimpleDateFormat; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.concurrent.CompletableFuture; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.concurrent.TimeUnit; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.stream.Collectors; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@Service(value = "xmsService") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+public class RouteServiceImpl implements RouteService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private RedisTemplate redisTemplate; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private ZhongJiaoXingLu zhongJiaoXingLu; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private ITmstruckLeaveFactoryResultService tmstruckLeaveFactoryResultService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private OffSiteTransportationServiceImpl offSiteTransportationService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Value("${str.tengxun.key}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private String key; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Value("${redis.prefix.order}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private String prefixOrder; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Value("${redis.prefix.line}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private String prefixLine; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Value("${redis.prefix.suffix}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private String suffix; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public CompletableFuture<String> createTotalResult(Map mapValue) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (mapValue.containsKey("capacityNumber")&&mapValue.containsKey("receiveAddress")&&mapValue.containsKey("shipperName")&&mapValue.containsKey("orderNumber")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SimpleDateFormat dateFormat =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (true) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                HashMap materieldesMap=new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String searchPointJson = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+URLEncoder.encode(mapValue.get("shipperName")==null?"安钢集团信阳钢铁有限责任公司":mapValue.get("shipperName").toString(),"utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                SearchPoint searchPoint= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson, SearchPoint.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (searchPoint.getStatus()==0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    materieldesMap.put("addressLongitude",searchPoint.getResult().getLocation().getLng()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    materieldesMap.put("addressLatitude",searchPoint.getResult().getLocation().getLat()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    materieldesMap.put("addressLongitude",new BigDecimal(114.036293)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    materieldesMap.put("addressLatitude",new BigDecimal(32.483276)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String searchPointJson2 = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+URLEncoder.encode(mapValue.get("receiveAddress").toString()==null?"长沙市":mapValue.get("receiveAddress").toString(),"utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                SearchPoint searchPoint2= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (searchPoint2.getStatus()==0&&searchPoint2.getResult()!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (searchPoint2.getResult().getAddress_components()!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        materieldesMap.put("addressProvince",searchPoint2.getResult().getAddress_components().getProvince()==null?"湖南省":searchPoint2.getResult().getAddress_components().getProvince()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        materieldesMap.put("addressDistrict",searchPoint2.getResult().getAddress_components().getDistrict()==null?"开福区":searchPoint2.getResult().getAddress_components().getDistrict()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        materieldesMap.put("addressTown",searchPoint2.getResult().getAddress_components().getCity()==null?"长沙市":searchPoint2.getResult().getAddress_components().getCity()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        materieldesMap.put("addressProvince","湖南省"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        materieldesMap.put("addressDistrict","开福区"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        materieldesMap.put("addressTown","长沙市"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    materieldesMap.put("addressDeliveryAddress",mapValue.get("receiveAddress").toString()==null?"长沙市":mapValue.get("receiveAddress").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (searchPoint2.getResult().getLocation()!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        materieldesMap.put("addressLongitude",searchPoint2.getResult().getLocation().getLng()==null?new BigDecimal(112.98626):searchPoint2.getResult().getLocation().getLng()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        materieldesMap.put("addressLatitude",searchPoint2.getResult().getLocation().getLat()==null?new BigDecimal(28.25591):searchPoint2.getResult().getLocation().getLat()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        materieldesMap.put("addressLongitude",new BigDecimal(112.98626)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        materieldesMap.put("addressLatitude",new BigDecimal(28.25591)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (searchPoint2.getResult().getAd_info()!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        materieldesMap.put("destCode",searchPoint2.getResult().getAd_info().getAdcode()==null?"无信息":searchPoint2.getResult().getAd_info().getAdcode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        materieldesMap.put("destCode","无信息"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    materieldesMap.put("addressProvince","湖南省"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    materieldesMap.put("addressDistrict","开福区"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    materieldesMap.put("addressTown","长沙市"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    materieldesMap.put("destCode","430105"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    materieldesMap.put("addressDeliveryAddress","长沙市"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    materieldesMap.put("addressLongitude",new BigDecimal(112.98626)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    materieldesMap.put("addressLatitude",new BigDecimal(28.25591)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String netValidationResult = zhongJiaoXingLu.netValidation(mapValue.get("capacityNumber").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Map netValidationMap = (Map) JSONObject.parse(netValidationResult); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (Integer.parseInt(netValidationMap.get("status").toString())==1001&&netValidationMap.get("result").toString().equals("yes")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        HashMap<String,String> redisMap=new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        String startLon=searchPoint.getResult().getLocation().getLng().toString().length()>9?searchPoint.getResult().getLocation().getLng().toString().substring(0,9):searchPoint.getResult().getLocation().getLng().toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        String startLat=searchPoint.getResult().getLocation().getLat().toString().length()>9?searchPoint.getResult().getLocation().getLat().toString().substring(0,8):searchPoint.getResult().getLocation().getLat().toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        redisMap.put("startLonlat", startLon+","+startLat); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        String endLon= materieldesMap.get("addressLongitude").toString().length()>9?materieldesMap.get("addressLongitude").toString().substring(0,9):materieldesMap.get("addressLongitude").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        String endLat= materieldesMap.get("addressLatitude").toString().length()>9?materieldesMap.get("addressLatitude").toString().substring(0,8):materieldesMap.get("addressLatitude").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        redisMap.put("endLonlat",endLon+","+endLat); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        redisMap.put("vclN", mapValue.get("capacityNumber").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        redisMap.put("vco","2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:ss:mm"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        String qryBtm=mapValue.get("resultOutGateTime").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Date parse = simpleDateFormat.parse(qryBtm); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Calendar calendar = Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        calendar.setTime(parse); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        calendar.add(Calendar.HOUR_OF_DAY, 23); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        calendar.add(Calendar.SECOND, 45); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        long agetime = parse.getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        long lateTime = calendar.getTimeInMillis(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        long reductionTime1=lateTime-agetime; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        long currentTime = new Date().getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        long reductionTime2=currentTime-agetime; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        long saveTime=(reductionTime1-reductionTime2)/1000; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        redisMap.put("qryBtm", simpleDateFormat.format(simpleDateFormat.parse(qryBtm))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        String qryEtm= simpleDateFormat.format(calendar.getTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        redisMap.put("qryEtm",qryEtm ); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        String orderUrl=prefixOrder+":"+mapValue.get("orderNumber").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        String redisJson=JSON.toJSONString(redisMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (saveTime>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            redisTemplate.opsForValue().set(orderUrl, redisJson, saveTime, TimeUnit.SECONDS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            redisTemplate.opsForValue().set(orderUrl, redisJson, 36000, TimeUnit.SECONDS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        redisTemplate.opsForValue().set(orderUrl+suffix, redisJson); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Map<String,Object> resTfulResultValues = offSiteTransportationService.selectWarnSwitch(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if(!resTfulResultValues.get("switch").toString().equals("0")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            redisMap.put("startCode",searchPoint.getResult().getAd_info().getAdcode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            redisMap.put("destCode",materieldesMap.get("destCode").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            redisMap.put("qryBtm",parse.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            redisMap.put("qryEtm",calendar.getTime().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            redisMap.put("type",resTfulResultValues.get("type").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            String subAbnormalLineWarnV2Json = zhongJiaoXingLu.subAbnormalLineWarnV2(redisMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            JSONObject jsonObject = JSONObject.parseObject(subAbnormalLineWarnV2Json); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (jsonObject!=null&&jsonObject.get("status").toString().equals(1001+"")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                HashMap<String,Object> tripMap=new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                tripMap.put("orderNumber",mapValue.get("orderNumber").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                tripMap.put("rid",jsonObject.get("result").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                int i=offSiteTransportationService.insertOrderTripId(tripMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    return  CompletableFuture.completedFuture("successful"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return CompletableFuture.completedFuture("fail"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param matrial 物质名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param selectStr 0,没有选1"带钢",2"微粉",3("螺纹钢","盘螺","盘圆"),4"钢坯",5"其他" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public  boolean checkTurnOff(String matrial,String selectStr) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        int index=0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String[]  matrialList=new String[]{"带钢","微粉","螺纹钢","盘螺","盘圆","钢坯","其他"}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        lable:for (int i=0;i<matrialList.length;i++){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (matrial.contains(matrialList[i])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if(4>=i&&i>=2){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    index=3; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }else if (i==5){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    index=4; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }else if (i==6) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    index=5; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    index=i+1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                break lable; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (index!=0&&selectStr.contains(String.valueOf(index))){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 必须参数 运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param mapValue 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public CompletableFuture<String> saveRoute(Map mapValue) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           SimpleDateFormat dateFormat =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           Date gateTime = dateFormat.parse(mapValue.get("resultOutGateTime").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           String searchPointJson = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+ URLEncoder.encode(mapValue.get("shipperName").toString()==null?"四川省达州钢铁集团有限责任公司":mapValue.get("shipperName").toString(),"utf-8")+"&key="+key); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           SearchPoint searchPoint= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson, SearchPoint.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           String searchPointJson2 = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+ URLEncoder.encode(mapValue.get("receiveAddress").toString()==null?"长沙市":mapValue.get("receiveAddress").toString(),"utf-8")+"&key="+key); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           SearchPoint searchPoint2= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           String netValidationResult = zhongJiaoXingLu.netValidation(mapValue.get("capacityNumber").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           Map netValidationMap = (Map) JSONObject.parse(netValidationResult); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           if (Integer.parseInt(netValidationMap.get("status").toString())==1001&&netValidationMap.get("result").toString().equals("yes")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               HashMap<String, String> redisMap=new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               redisMap.put("startLonlat", searchPoint.getResult().getLocation().getLng().toString().substring(0,9)+","+searchPoint.getResult().getLocation().getLat().toString().substring(0,8)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               redisMap.put("endLonlat", searchPoint2.getResult().getLocation().getLng().toString().substring(0,9)+","+searchPoint2.getResult().getLocation().getLat().toString().substring(0,8)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               redisMap.put("vclN", mapValue.get("capacityNumber").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               redisMap.put("vco","2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:ss:mm"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               String qryBtm=mapValue.get("resultOutGateTime").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               Date parse = simpleDateFormat.parse(qryBtm); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               Calendar calendar = Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               calendar.setTime(parse); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               calendar.add(Calendar.DAY_OF_MONTH, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               calendar.add(Calendar.HOUR_OF_DAY, 23); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               calendar.add(Calendar.SECOND, 45); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               long agetime = parse.getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               long lateTime = calendar.getTimeInMillis(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               long reductionTime1=lateTime-agetime; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               long currentTime = new Date().getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               long reductionTime2=currentTime-agetime; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               long saveTime=(reductionTime1-reductionTime2)/1000; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               redisMap.put("qryBtm", simpleDateFormat.format(simpleDateFormat.parse(qryBtm))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               String qryEtm= simpleDateFormat.format(calendar.getTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               redisMap.put("qryEtm",qryEtm ); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               String orderUrl=prefixOrder+":"+mapValue.get("orderNumber").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               String redisJson= JSON.toJSONString(redisMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               redisTemplate.opsForValue().set(orderUrl, redisJson, saveTime, TimeUnit.SECONDS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               redisTemplate.opsForValue().set(orderUrl+suffix, redisJson); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               if(mapValue.get("turnOf").toString().equals("0")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                   redisMap.put("startCode",searchPoint.getResult().getAd_info().getAdcode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                   redisMap.put("destCode",searchPoint2.getResult().getAd_info().getAdcode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                   redisMap.put("qryBtm",parse.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                   redisMap.put("qryEtm",calendar.getTime().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                   String subAbnormalLineWarnV2Json = zhongJiaoXingLu.subAbnormalLineWarnV2(redisMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                   JSONObject jsonObject = JSONObject.parseObject(subAbnormalLineWarnV2Json); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                   if (jsonObject!=null&&jsonObject.get("status").toString().equals(1001+"")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                       HashMap<String, Object> tripMap = new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                       tripMap.put("orderNumber", mapValue.get("orderNumber").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                       tripMap.put("rid", jsonObject.get("result").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                   } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           return  CompletableFuture.completedFuture("successful"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return CompletableFuture.completedFuture("fail"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 必须参数 运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param mapValue 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public CompletableFuture<String> saveRequstionDate(Map mapValue) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SimpleDateFormat dateFormat =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Date gateTime = dateFormat.parse(mapValue.get("resultOutGateTime").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String searchPointJson = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+ URLEncoder.encode(mapValue.get("shipperName").toString()==null?"四川省达州钢铁集团有限责任公司":mapValue.get("shipperName").toString(),"utf-8")+"&key="+key); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SearchPoint searchPoint= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson, SearchPoint.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String searchPointJson2 = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+ URLEncoder.encode(mapValue.get("receiveAddress").toString()==null?"长沙市":mapValue.get("receiveAddress").toString(),"utf-8")+"&key="+key); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SearchPoint searchPoint2= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String netValidationResult = zhongJiaoXingLu.netValidation(mapValue.get("capacityNumber").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Map netValidationMap = (Map) JSONObject.parse(netValidationResult); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (Integer.parseInt(netValidationMap.get("status").toString())==1001&&netValidationMap.get("result").toString().equals("yes")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            HashMap<String, String> redisMap=new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            redisMap.put("startLonlat", searchPoint.getResult().getLocation().getLng().toString().substring(0,9)+","+searchPoint.getResult().getLocation().getLat().toString().substring(0,8)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            redisMap.put("endLonlat", searchPoint2.getResult().getLocation().getLng().toString().substring(0,9)+","+searchPoint2.getResult().getLocation().getLat().toString().substring(0,8)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            redisMap.put("vclN", mapValue.get("capacityNumber").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            redisMap.put("vco","2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:ss:mm"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String qryBtm=mapValue.get("resultOutGateTime").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Date parse = simpleDateFormat.parse(qryBtm); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Calendar calendar = Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            calendar.setTime(parse); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            calendar.add(Calendar.DAY_OF_MONTH, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            calendar.add(Calendar.HOUR_OF_DAY, 23); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            calendar.add(Calendar.SECOND, 45); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            long agetime = parse.getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            long lateTime = calendar.getTimeInMillis(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            long reductionTime1=lateTime-agetime; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            long currentTime = new Date().getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            long reductionTime2=currentTime-agetime; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            long saveTime=(reductionTime1-reductionTime2)/1000; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            redisMap.put("qryBtm", simpleDateFormat.format(simpleDateFormat.parse(qryBtm))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String qryEtm= simpleDateFormat.format(calendar.getTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            redisMap.put("qryEtm",qryEtm ); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String orderUrl=prefixOrder+":"+mapValue.get("orderNumber").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String redisJson= JSON.toJSONString(redisMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            redisTemplate.opsForValue().set(orderUrl, redisJson, saveTime, TimeUnit.SECONDS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            redisTemplate.opsForValue().set(orderUrl+suffix, redisJson); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(mapValue.get("turnOf").toString().equals("0")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                redisMap.put("startCode",searchPoint.getResult().getAd_info().getAdcode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                redisMap.put("destCode",searchPoint2.getResult().getAd_info().getAdcode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                redisMap.put("qryBtm",parse.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                redisMap.put("qryEtm",calendar.getTime().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String subAbnormalLineWarnV2Json = zhongJiaoXingLu.subAbnormalLineWarnV2(redisMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                JSONObject jsonObject = JSONObject.parseObject(subAbnormalLineWarnV2Json); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (jsonObject!=null&&jsonObject.get("status").toString().equals(1001+"")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    HashMap<String, Object> tripMap = new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    tripMap.put("orderNumber", mapValue.get("orderNumber").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    tripMap.put("rid", jsonObject.get("result").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return  CompletableFuture.completedFuture("successful"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return CompletableFuture.completedFuture("fail"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public CompletableFuture<RouteVo> fullPathVisualization(HashMap mapValue) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String redisJson =null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (redisTemplate.hasKey(prefixOrder + ":" + mapValue.get("orderNumber"))){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            redisJson=(String) redisTemplate.opsForValue().get(prefixOrder + ":" + mapValue.get("orderNumber")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        HashMap routeMap = JSON.parseObject(redisJson, HashMap.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String json=""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (routeMap!=null) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            json =zhongJiaoXingLu.visualRoute(routeMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String j=prefixLine + ":" + mapValue.get("orderNumber"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (redisTemplate.hasKey(prefixLine + ":" + mapValue.get("orderNumber"))){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                json  = (String) redisTemplate.opsForValue().get(prefixLine + ":" + mapValue.get("orderNumber")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (json==null||json.equals("")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                HashMap<String,Object> hashMap=new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                hashMap.put("orderNumber",mapValue.get("orderNumber")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Map<String, Object> resultMap=tmstruckLeaveFactoryResultService.getTruckFactoryResult(mapValue.get("orderNumber").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String netValidationResult = zhongJiaoXingLu.netValidation(resultMap.get("capacityNumber").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Map netValidationMap = (Map) JSONObject.parse(netValidationResult); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (Integer.parseInt(netValidationMap.get("status").toString())==1001&&netValidationMap.get("result").toString().equals("yes")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String searchPointJson = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+URLEncoder.encode("四川省达州钢铁集团有限责任公司","utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    SearchPoint searchPoint= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson, SearchPoint.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String searchPointJson2 = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+URLEncoder.encode(resultMap.get("receiveAddress")==null||"".equals(String.valueOf(resultMap.get("receiveAddress")))?"长沙市":resultMap.get("receiveAddress").toString(),"utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    SearchPoint searchPoint2= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    HashMap<String,String> redisMap=new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String startLon=searchPoint.getResult().getLocation().getLng().toString().length()>9?searchPoint.getResult().getLocation().getLng().toString().substring(0,9):searchPoint.getResult().getLocation().getLng().toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String startLat=searchPoint.getResult().getLocation().getLat().toString().length()>9?searchPoint.getResult().getLocation().getLat().toString().substring(0,8):searchPoint.getResult().getLocation().getLat().toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    redisMap.put("startLonlat", startLon+","+startLat); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String endLon= searchPoint2.getResult().getLocation().getLng().toString().length()>9?searchPoint2.getResult().getLocation().getLng().toString().substring(0,9):searchPoint2.getResult().getLocation().getLng().toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String endLat= searchPoint2.getResult().getLocation().getLat().toString().length()>9?searchPoint2.getResult().getLocation().getLat().toString().substring(0,8):searchPoint2.getResult().getLocation().getLat().toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    redisMap.put("endLonlat",endLon+","+endLat); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    redisMap.put("vclN", resultMap.get("capacityNumber").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    redisMap.put("vco","2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:ss:mm"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String qryBtm=resultMap.get("resultOutGateTime").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Date parse = simpleDateFormat.parse(qryBtm); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Calendar calendar = Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    calendar.setTime(parse); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    calendar.add(Calendar.HOUR_OF_DAY, 23); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    calendar.add(Calendar.SECOND, 45); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    long agetime = parse.getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    long lateTime = calendar.getTimeInMillis(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    long reductionTime1=lateTime-agetime; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    long currentTime = new Date().getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    long reductionTime2=currentTime-agetime; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    long saveTime=(reductionTime1-reductionTime2)/1000; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    redisMap.put("qryBtm", simpleDateFormat.format(simpleDateFormat.parse(qryBtm))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String qryEtm= simpleDateFormat.format(calendar.getTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    redisMap.put("qryEtm", qryEtm); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (saveTime>1800){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        String orderUrl=prefixOrder+":"+mapValue.get("orderNumber").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        String redisStr=JSON.toJSONString(redisMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        json = zhongJiaoXingLu.visualRoute(redisMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        redisTemplate.opsForValue().set(orderUrl, redisStr, saveTime<0?1000:saveTime, TimeUnit.SECONDS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        redisTemplate.opsForValue().set(orderUrl+suffix, redisStr); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Calendar calendar2=Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        long agoTime= calendar2.getTime().getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        calendar2.add(Calendar.MONTH,2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        long late= calendar2.getTime().getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        long save=(lateTime-agoTime)/1000; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        json = zhongJiaoXingLu.visualRoute(redisMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (json!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            redisTemplate.opsForValue().set(prefixLine+":"+mapValue.get("orderNumber").toString(), json, save>0?save:3184000, TimeUnit.SECONDS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        JSONObject jsonObject = JSONObject.parseObject(json); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (json!=null&&jsonObject!=null&&jsonObject.get("status").toString().equals(1001+"")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            List<StartAndEndRoute> startAndEndRouteList=new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            StartAndEndRoute startAndEndRoute=new StartAndEndRoute(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ViewVisualization to= (ViewVisualization) DataConversionTool.jsonToBean(json,ViewVisualization.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            RouteVo vo=new RouteVo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if ((!StringUtils.isEmpty(to.getResult().getLat()))&& (!StringUtils.isEmpty(to.getResult().getLon()))){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Double[] centerpoint = LngLonUtil.gps84_To_Gcj02((Double.valueOf(to.getResult().getLat()) / 600000), (Double.valueOf(to.getResult().getLon()) / 600000)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Point currentPoint=new Point(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                currentPoint.setLat(centerpoint[0]+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                currentPoint.setLon(centerpoint[1]+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setCurrentPoint(currentPoint); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            startAndEndRoute.setCurrentPointName(to.getResult().getAdr()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (to.getResult().getRunRoute()!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<RunRoutePoint> routes =new ArrayList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<Double[]> routesPath =new ArrayList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                for(RunRoutePoint item : to.getResult().getRunRoute()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    RunRoutePoint runRoutePoint=item; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Double[] points = LngLonUtil.gps84_To_Gcj02((Double.valueOf(item.getLat()) / 600000), (Double.valueOf(item.getLon()) / 600000)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    routesPath.add(new Double[]{points[1],points[0]}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    runRoutePoint.setLat(points[0]+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    runRoutePoint.setLon(points[1]+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    routes.add(runRoutePoint); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Point startPoint=new Point(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startPoint.setLat(routes.get(0).getLat()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startPoint.setLon(routes.get(0).getLon()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setStartPoint(startPoint); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setRunPath(routesPath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setRunRoute(routes); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (to.getResult().getEstimateRoute()!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<Point> estimateRoute= new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<Double[]> estimatePath =new ArrayList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                for(Point item :to.getResult().getEstimateRoute()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Point er=new Point(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Double[] points = LngLonUtil.gps84_To_Gcj02((Double.valueOf(item.getLat()) / 600000), (Double.valueOf(item.getLon()) / 600000)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    estimatePath.add(new Double[]{points[1],points[0]}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    er.setLat(points[0]+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    er.setLon(points[1]+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    estimateRoute.add(er); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setEstimatePath(estimatePath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setEndPoint(estimateRoute.get(estimateRoute.size()-1)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setEstimateRoute(estimateRoute); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String mil=to.getResult().getRunDistance()+"km"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            startAndEndRoute.setMiled(mil); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            startAndEndRouteList.add(startAndEndRoute); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            vo.setStartAndEndRoutes(startAndEndRouteList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return CompletableFuture.completedFuture(vo) ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return  CompletableFuture.completedFuture(new RouteVo()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 必须参数 orderNumber 运输订单号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 获得运输全路径 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param mapValue 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public CompletableFuture<RouteVo> fullPaht(HashMap mapValue) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String redisJson = (String) redisTemplate.opsForValue().get(prefixOrder + ":" + mapValue.get("orderNumber")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        HashMap routeMap = JSON.parseObject(redisJson, HashMap.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String json=""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (routeMap!=null) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            json =zhongJiaoXingLu.visualRoute(routeMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            json  = (String) redisTemplate.opsForValue().get(prefixLine + ":" + mapValue.get("orderNumber")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (json==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                HashMap<String, Object> hashMap=new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                hashMap.put("orderNumber",mapValue.get("orderNumber")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                RESTfulResult startAndEndCapacityNumber =null;  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                HashMap<String, Object> resultMap= (HashMap<String, Object>) startAndEndCapacityNumber.getData(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String netValidationResult = zhongJiaoXingLu.netValidation(resultMap.get("capacityNumber").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Map netValidationMap = (Map) JSONObject.parse(netValidationResult); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (Integer.parseInt(netValidationMap.get("status").toString())==1001&&netValidationMap.get("result").toString().equals("yes")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String searchPointJson = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+ URLEncoder.encode(resultMap.get("shipperName").toString(),"utf-8")+"&key="+key); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    SearchPoint searchPoint= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson, SearchPoint.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String searchPointJson2 = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+ URLEncoder.encode(resultMap.get("addressDeliveryAddress").toString(),"utf-8")+"&key="+key); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    SearchPoint searchPoint2= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    HashMap<String, String> redisMap=new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    redisMap.put("startLonlat", searchPoint.getResult().getLocation().getLng().toString().substring(0,9)+","+searchPoint.getResult().getLocation().getLat().toString().substring(0,8)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    redisMap.put("endLonlat", searchPoint2.getResult().getLocation().getLng().toString().substring(0,9)+","+searchPoint2.getResult().getLocation().getLat().toString().substring(0,8)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    redisMap.put("vclN", resultMap.get("capacityNumber").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    redisMap.put("vco","2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:ss:mm"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String qryBtm=resultMap.get("resultOutGateTime").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Date parse = simpleDateFormat.parse(qryBtm); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Calendar calendar = Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    calendar.setTime(parse); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    calendar.add(Calendar.DAY_OF_MONTH, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    calendar.add(Calendar.HOUR_OF_DAY, 23); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    calendar.add(Calendar.SECOND, 45); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    long agetime = parse.getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    long lateTime = calendar.getTimeInMillis(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    long reductionTime1=lateTime-agetime; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    long currentTime = new Date().getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    long reductionTime2=currentTime-agetime; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    long saveTime=(reductionTime1-reductionTime2)/1000; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    redisMap.put("qryBtm", simpleDateFormat.format(simpleDateFormat.parse(qryBtm))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String qryEtm= simpleDateFormat.format(calendar.getTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    redisMap.put("qryEtm",qryEtm ); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (saveTime>1800){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        String orderUrl=prefixOrder+":"+mapValue.get("orderNumber").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        String redisStr= JSON.toJSONString(redisMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        redisTemplate.opsForValue().set(orderUrl, redisStr, saveTime, TimeUnit.SECONDS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Calendar calendar2= Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        long agoTime= calendar2.getTime().getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        calendar2.add(Calendar.MONTH,2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        long late= calendar2.getTime().getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        long save=(lateTime-agoTime)/1000; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        json = zhongJiaoXingLu.visualRoute(redisMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        redisTemplate.opsForValue().set(prefixLine+":"+mapValue.get("orderNumber").toString(), json, save, TimeUnit.SECONDS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        JSONObject jsonObject = JSONObject.parseObject(json); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (json!=null&&jsonObject.get("status").toString().equals(1001+"")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            List<StartAndEndRoute> startAndEndRouteList=new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            StartAndEndRoute startAndEndRoute=new StartAndEndRoute(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ViewVisualization to= (ViewVisualization) DataConversionTool.jsonToBean(json,ViewVisualization.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            RouteVo vo=new RouteVo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if ((!StringUtils.isEmpty(to.getResult().getLat()))&& (!StringUtils.isEmpty(to.getResult().getLon()))){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Double[] centerpoint = LngLonUtil.gps84_To_Gcj02((Double.valueOf(to.getResult().getLat()) / 600000), (Double.valueOf(to.getResult().getLon()) / 600000)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Point currentPoint=new Point(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                currentPoint.setLat(centerpoint[0]+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                currentPoint.setLon(centerpoint[1]+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setCurrentPoint(currentPoint); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            startAndEndRoute.setCurrentPointName(to.getResult().getAdr()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (to.getResult().getRunRoute()!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<RunRoutePoint> routes =new ArrayList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<Double[]> routesPath =new ArrayList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 for(RunRoutePoint item : to.getResult().getRunRoute()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    RunRoutePoint runRoutePoint=item; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Double[] points = LngLonUtil.gps84_To_Gcj02((Double.valueOf(item.getLat()) / 600000), (Double.valueOf(item.getLon()) / 600000)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    routesPath.add(new Double[]{points[1],points[0]}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    runRoutePoint.setLat(points[0]+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    runRoutePoint.setLon(points[1]+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     routes.add(runRoutePoint); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Point startPoint=new Point(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startPoint.setLat(routes.get(0).getLat()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startPoint.setLon(routes.get(0).getLon()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setStartPoint(startPoint); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setRunPath(routesPath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setRunRoute(routes); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (to.getResult().getEstimateRoute()!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<Point> estimateRoute= new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<Double[]> estimatePath =new ArrayList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                for(Point item :to.getResult().getEstimateRoute()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Point er=new Point(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Double[] points = LngLonUtil.gps84_To_Gcj02((Double.valueOf(item.getLat()) / 600000), (Double.valueOf(item.getLon()) / 600000)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    estimatePath.add(new Double[]{points[1],points[0]}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    er.setLat(points[0]+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    er.setLon(points[1]+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    estimateRoute.add(er); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setEstimatePath(estimatePath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setEndPoint(estimateRoute.get(estimateRoute.size()-1)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setEstimateRoute(estimateRoute); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String mil=to.getResult().getRunDistance()+"km"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            startAndEndRoute.setMiled(mil); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            startAndEndRouteList.add(startAndEndRoute); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            vo.setStartAndEndRoutes(startAndEndRouteList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return CompletableFuture.completedFuture(vo) ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return  CompletableFuture.completedFuture(new RouteVo()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public CompletableFuture<RouteVo> fullPathVisualizationByCarNumber(HashMap mapValue) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String searchPointJson = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+URLEncoder.encode("四川省达州钢铁集团有限责任公司","utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SearchPoint searchPoint= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson, SearchPoint.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String searchPointJson2 = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+URLEncoder.encode("四川省达川区","utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SearchPoint searchPoint2= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        HashMap<String,String> redisMap=new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String startLon=searchPoint.getResult().getLocation().getLng().toString().length()>9?searchPoint.getResult().getLocation().getLng().toString().substring(0,9):searchPoint.getResult().getLocation().getLng().toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String startLat=searchPoint.getResult().getLocation().getLat().toString().length()>9?searchPoint.getResult().getLocation().getLat().toString().substring(0,8):searchPoint.getResult().getLocation().getLat().toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        redisMap.put("startLonlat", startLon+","+startLat); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String endLon= searchPoint2.getResult().getLocation().getLng().toString().length()>9?searchPoint2.getResult().getLocation().getLng().toString().substring(0,9):searchPoint2.getResult().getLocation().getLng().toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String endLat= searchPoint2.getResult().getLocation().getLat().toString().length()>9?searchPoint2.getResult().getLocation().getLat().toString().substring(0,8):searchPoint2.getResult().getLocation().getLat().toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        redisMap.put("endLonlat",endLon+","+endLat); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        redisMap.put("vclN", mapValue.get("capacityNumber").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        redisMap.put("vco","2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        redisMap.put("qryBtm", mapValue.get("startTime").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        redisMap.put("qryEtm",mapValue.get("endTime").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String json = zhongJiaoXingLu.visualRoute2(redisMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        JSONObject jsonObject = JSONObject.parseObject(json); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (json!=null&&jsonObject.get("status").toString().equals(1001+"")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            List<StartAndEndRoute> startAndEndRouteList=new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            StartAndEndRoute startAndEndRoute=new StartAndEndRoute(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ViewVisualization to= (ViewVisualization) DataConversionTool.jsonToBean(json,ViewVisualization.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            RouteVo vo=new RouteVo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if ((!StringUtils.isEmpty(to.getResult().getLat()))&& (!StringUtils.isEmpty(to.getResult().getLon()))){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Double[] centerpoint = LngLonUtil.gps84_To_Gcj02((Double.valueOf(to.getResult().getLat()) / 600000), (Double.valueOf(to.getResult().getLon()) / 600000)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Point currentPoint=new Point(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                currentPoint.setLat(centerpoint[0]+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                currentPoint.setLon(centerpoint[1]+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setCurrentPoint(currentPoint); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            startAndEndRoute.setCurrentPointName(to.getResult().getAdr()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (to.getResult().getRunRoute()!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<RunRoutePoint> routes =new ArrayList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<Double[]> routesPath =new ArrayList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                for(RunRoutePoint item : to.getResult().getRunRoute()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    RunRoutePoint runRoutePoint=item; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Double[] points = LngLonUtil.gps84_To_Gcj02((Double.valueOf(item.getLat()) / 600000), (Double.valueOf(item.getLon()) / 600000)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    routesPath.add(new Double[]{points[1],points[0]}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    runRoutePoint.setLat(points[0]+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    runRoutePoint.setLon(points[1]+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    routes.add(runRoutePoint); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Point startPoint=new Point(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startPoint.setLat(routes.get(0).getLat()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startPoint.setLon(routes.get(0).getLon()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setStartPoint(startPoint); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setRunPath(routesPath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                startAndEndRoute.setRunRoute(routes); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String mil=to.getResult().getRunDistance()+"km"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            startAndEndRoute.setMiled(mil); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            startAndEndRouteList.add(startAndEndRoute); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            vo.setStartAndEndRoutes(startAndEndRouteList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return CompletableFuture.completedFuture(vo) ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return  CompletableFuture.completedFuture(new RouteVo()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 |