liyg 2 éve
szülő
commit
147c47e3f5

+ 4 - 2
src/main/java/com/steerinfo/dil/controller/OffSiteTransportationController.java

@@ -284,12 +284,14 @@ public class OffSiteTransportationController extends BaseRESTfulController {
         if (resTfulResult!=4){
             //关闭运输订单
             offSiteTransportationService.orderClose(orderNumber);
-            //保存路线
+            //查询订单路线实绩
             String redisJson = (String) redisTemplate.opsForValue().get(prefixOrder+":"+orderNumber);
             HashMap mapValue = JSON.parseObject(redisJson, HashMap.class);
             if(mapValue!=null){
-                mapValue.put("qryBtm",new Date());
+                //设置当前时间为结束时间
+                mapValue.put("qryEtm",new Date());
             }
+            //根据实绩重新查询路线
             String json = zhongJiaoXingLu.visualRoute(mapValue);
             ViewVisualization to=null;
             if (json!=null){

+ 1 - 0
src/main/java/com/steerinfo/route/service/impl/RouteServiceImpl.java

@@ -464,6 +464,7 @@ public class RouteServiceImpl implements RouteService {
 
         HashMap routeMap = JSON.parseObject(redisJson, HashMap.class);
         String json = "";
+        //redisTemplate.delete(prefixLine + ":" + mapValue.get("orderNumber"));//删除redis记录,保证进入查询分支,测试用
         //查询路线信息
         if (routeMap != null) {
             json = zhongJiaoXingLu.visualRoute(routeMap);

+ 3 - 3
src/main/java/com/steerinfo/route/threeRequest/ZhongJiaoXingLu.java

@@ -62,7 +62,6 @@ public class ZhongJiaoXingLu {
             map.put("qryBtm", routeMap.get("qryBtm").toString());
             //判断结束时间是否大于起始时间,且在72小时以内
             SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            SimpleDateFormat simpleDateFormat2=new SimpleDateFormat("yyyy-MM-dd 23:59:59");
             Date btm=simpleDateFormat.parse(routeMap.get("qryBtm").toString());//起始时间
             Date etm=new Date(btm.getTime()+1000*60*60*72);//最大结束时间
             if(etm.getTime() > new Date().getTime()){
@@ -74,7 +73,7 @@ public class ZhongJiaoXingLu {
             && simpleDateFormat.parse(routeMap.get("qryEtm").toString()).getTime()<etm.getTime()
             && simpleDateFormat.parse(routeMap.get("qryEtm").toString()).getTime() > btm.getTime()){
                 Date qryEtm = simpleDateFormat.parse(routeMap.get("qryEtm").toString());
-                map.put("qryEtm", simpleDateFormat2.format(qryEtm));
+                map.put("qryEtm", simpleDateFormat.format(qryEtm));
             }else {
                 map.put("qryEtm", simpleDateFormat.format(etm));
             }
@@ -85,7 +84,7 @@ public class ZhongJiaoXingLu {
 
             // 通过 https 方式调用,此方法内部会使用私钥生成签名参数 sign,私钥不会发送
             String res = des.postHttps(url, map);
-            System.out.println("visualRoute"+res);
+//            System.out.println("visualRoute"+res);
             JSONObject jsonObject = JSONObject.parseObject(res);
             if (jsonObject.get("status").toString().equals(1016+"")){
                 login();
@@ -112,6 +111,7 @@ public class ZhongJiaoXingLu {
             DataExchangeService des = new DataExchangeService(5000, 8000);
             // 通过 https 方式调用,此方法内部会使用私钥生成签名参数 sign,私钥不会发送
             String res = des.postHttps(url, map);
+            System.out.println("getCurrentLocation:"+res);
             JSONObject jsonObject = JSONObject.parseObject(res);
             try{
                 jsonObject.put("result",jsonObject.getJSONObject("result").get("firstVcl"));