|
@@ -287,33 +287,27 @@ public class OffSiteTransportationController extends BaseRESTfulController {
|
|
|
//保存路线
|
|
|
String redisJson = (String) redisTemplate.opsForValue().get(prefixOrder+":"+orderNumber);
|
|
|
HashMap mapValue = JSON.parseObject(redisJson, HashMap.class);
|
|
|
+ if(mapValue!=null){
|
|
|
+ mapValue.put("qryBtm",new Date());
|
|
|
+ }
|
|
|
String json = zhongJiaoXingLu.visualRoute(mapValue);
|
|
|
ViewVisualization to=null;
|
|
|
if (json!=null){
|
|
|
//设置60天后过期
|
|
|
- Calendar calendar=Calendar.getInstance();
|
|
|
- long agoTime= calendar.getTime().getTime();
|
|
|
- calendar.add(Calendar.MONTH,2);
|
|
|
- long lateTime= calendar.getTime().getTime();
|
|
|
- long saveTime=(lateTime-agoTime)/1000;
|
|
|
- redisTemplate.opsForValue().set(prefixLine+":"+orderNumber, json, saveTime, TimeUnit.SECONDS);
|
|
|
- //删除订单
|
|
|
+ redisTemplate.opsForValue().set(prefixLine+":"+orderNumber, json, 60*60*24*60, TimeUnit.SECONDS);
|
|
|
+ //删除redis订单前缀:prefixOrder
|
|
|
redisTemplate.delete(prefixOrder+":"+orderNumber);
|
|
|
redisTemplate.delete(prefixOrder+":"+orderNumber+suffix);
|
|
|
//添加运输距离
|
|
|
- to= (ViewVisualization) JSON.parseObject(json,ViewVisualization.class);
|
|
|
-
|
|
|
+ to= JSON.parseObject(json,ViewVisualization.class);
|
|
|
}else {
|
|
|
HashMap<String,Object> hashMap=new HashMap();
|
|
|
hashMap.put("orderNumber",orderNumber);
|
|
|
Map<String,Object> resultMap= offSiteTransportationService.getStartAndEndCapacityNumber(hashMap);
|
|
|
-
|
|
|
if (resultMap!=null){
|
|
|
json= getPathJSON(resultMap.get("capacityNumber").toString(),resultMap.get("resultOutGateTime").toString());
|
|
|
-
|
|
|
-
|
|
|
if (json!=null&&!json.equals("")){
|
|
|
- to= (ViewVisualization) JSON.parseObject(json,ViewVisualization.class);
|
|
|
+ to=JSON.parseObject(json,ViewVisualization.class);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -378,17 +372,11 @@ public class OffSiteTransportationController extends BaseRESTfulController {
|
|
|
redisMap.put("endLonlat", Lng2.substring(0, 9) + "," + Lat2.substring(0, 8));
|
|
|
redisMap.put("vclN", capacityNumber);
|
|
|
redisMap.put("vco","2");
|
|
|
- SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:ss:mm");
|
|
|
String qryBtm=resultOutGateTime;
|
|
|
- //获得23小时、45分钟之后的时间
|
|
|
- Date parse = simpleDateFormat.parse(qryBtm);
|
|
|
- //时间添加
|
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
- calendar.setTime(parse);
|
|
|
- calendar.add(Calendar.HOUR_OF_DAY, 23);
|
|
|
- calendar.add(Calendar.SECOND, 45);
|
|
|
redisMap.put("qryBtm", qryBtm);
|
|
|
- redisMap.put("qryEtm",simpleDateFormat.format(calendar.getTime()));
|
|
|
+ SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ //时间添加
|
|
|
+ redisMap.put("qryEtm",simpleDateFormat.format(new Date()));
|
|
|
System.out.println(redisMap);
|
|
|
String json = zhongJiaoXingLu.visualRoute(redisMap);
|
|
|
System.out.println(json.length()>100?json.substring(0,100):json);
|