| | |
| | | /*String carName = MapUtil.getStrVal(gpsMap, "carName","");//获取车牌号 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | System.out.println(sdf.format(new Date()));*/ |
| | | log.debug(String.format(" ---->收到定位数据:%s",JSON.toJSONString(gpsMap))); |
| | | log.debug(String.format(" ---->----收到定位数据如下:%s",JSON.toJSONString(gpsMap))); |
| | | String carId = (String)gpsMap.get("carId"); |
| | | ((ArdSyCarDayServiceImpl)SpringUtils.getBean("ardSyCarDayServiceImpl")).insertArdSyCarDay(carId);//新增车辆上报时间 |
| | | Map<String,Object> result = ((ArdSyCarServiceImpl)SpringUtils.getBean("ardSyCarServiceImpl")).getArdSyCarAndDeptByCarId(carId);//查询车辆及部门 |
| | | if(result != null){ |
| | | // if("30".equals(carId)){ |
| | | //清淤开始---------- |
| | | //清淤开始---------- |
| | | try{ |
| | | String lng = (String) gpsMap.get("lng").toString();//获取经度 |
| | | String lat = (String) gpsMap.get("lat").toString();//获取纬度 |
| | | String carName = (String) gpsMap.get("carName");//获取车牌号 |
| | |
| | | //无锁 |
| | | rtuType = false; |
| | | } |
| | | // log.debug("定位数据:车辆carId:"+carId+"经度lng:"+lng+"纬度lat:"+lat); |
| | | // log.debug("定位数据:车辆carId:"+carId+"经度lng:"+lng+"纬度lat:"+lat); |
| | | //定义2维空间 |
| | | Point2D.Double point = new Point2D.Double(Double.parseDouble(lng), Double.parseDouble(lat)); |
| | | List<Point2D.Double> pts = new ArrayList<Point2D.Double>(); |
| | |
| | | } |
| | | } |
| | | } |
| | | // } |
| | | } |
| | | //清淤结束------------ |
| | | }catch(Exception e){ |
| | | |
| | | } |
| | | //清淤结束------------ |
| | | |
| | | gpsMap.putAll(result); |
| | | String ancestors = (String) gpsMap.get("ancestors");//获取父级部门 |
| | |
| | | } |
| | | } |
| | | } |
| | | //存入实时位置容器 |
| | | PositionContainer.getCarPositionMap().put(carId,gpsMap); |
| | | //存入用户容器 |
| | | if(PositionContainer.getUserPositionMap().size() != 0){ |
| | | for(String userId : PositionContainer.getUserPositionMap().keySet()){ |