| | |
| | | @ApiOperation(value = "显示无人机飞行轨迹", notes = "显示无人机飞行轨迹")
|
| | | @ApiImplicitParams(value = {
|
| | | @ApiImplicitParam(name = "mac", value = "设备mac(格式:p5dnd7a0392068)", required = true, paramType = "query", dataType = "String"),
|
| | | @ApiImplicitParam(name = "startTime", value = "开始时间(格式:2019-07-17 17:07:00)", required = true, paramType = "query", dataType = "String"),
|
| | | @ApiImplicitParam(name = "endTime", value = "结束时间(格式:2019-07-17 17:07:00)", required = true, paramType = "query", dataType = "String")
|
| | | @ApiImplicitParam(name = "startTime", value = "开始时间(格式:2019-07-17-17)", required = true, paramType = "query", dataType = "String"),
|
| | | @ApiImplicitParam(name = "endTime", value = "结束时间(格式:2019-07-17-18)", required = true, paramType = "query", dataType = "String")
|
| | | })
|
| | | public ModelAndView uavTrajectory(ModelAndView model, HttpServletRequest request) throws Exception {
|
| | | Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null);
|
| | | String st = parameters.get("startTime").toString();
|
| | | String startYearAndDay = st.substring(0, st.lastIndexOf("-"));
|
| | | String startHour = st.substring(st.lastIndexOf("-") + 1);
|
| | | String startTime = startYearAndDay + " " + startHour + ":00:00";
|
| | | String et = parameters.get("endTime").toString();
|
| | | String endYearAndDay = et.substring(0, et.lastIndexOf("-"));
|
| | | String endHour = et.substring(et.lastIndexOf("-") + 1);
|
| | | String endTime = endYearAndDay + " " + endHour + ":00:00";
|
| | | parameters.put("startTime", startTime);
|
| | | parameters.put("endTime", endTime);
|
| | | String mac = parameters.get("mac").toString();
|
| | | if (mac != null && mac.length() != 0) {
|
| | | List<Map<String, Object>> sensorList = historyMinutelyService.getSensorData(parameters);
|
| | | List<Map<String, Object>> sensorListMin = historyMinutelyService.getSensorDataMin(parameters);
|
| | | List<Map<String, Object>> sensorListMax = historyMinutelyService.getSensorDataMax(parameters);
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("sensorInfo", sensorList);
|
| | | params.put("sensorInfoMin", sensorListMin);
|
| | | params.put("sensorInfoMax", sensorListMax);
|
| | | String paramsJson = params.toJSONString();
|
| | | model.addObject("uavTrajectoryParams", paramsJson);
|
| | | model.setViewName("uavTrajectory");
|
| | | return model;
|
| | | }else {
|
| | | } else {
|
| | | StringBuilder msg = new StringBuilder();
|
| | | msg.append(" param[0] mac:");
|
| | | msg.append(mac);
|