@@ -72,8 +72,8 @@ public class InspectionController { | |||
@GetMapping("/line/track/{missionId}") | |||
@ApiOperation(value = "获取飞行轨迹", notes = "获取飞行轨迹") | |||
@ApiImplicitParam(name="id",value = "任务的Id,missionId") | |||
public JsonResult<List<InspectionVO>> lineTrack(@PathVariable("missionId") Integer id) { | |||
return JsonResult.success(inspectionService.lineTrack(id)); | |||
public JsonResult lineTrack(@PathVariable("missionId") Integer missionId) { | |||
return JsonResult.success(inspectionService.lineTrack(missionId)); | |||
} | |||
@@ -21,12 +21,12 @@ public class MissionStatusRequest { | |||
@ApiModelProperty(value = "巡检任务ID不能为空") | |||
private Integer id; | |||
@NotNull(message = "视频推流地址不能为空!") | |||
@ApiModelProperty(value = "视频推流地址不能为空") | |||
//@NotNull(message = "视频推流地址不能为空!") | |||
@ApiModelProperty(value = "视频推流地址") | |||
private String pushUrl; | |||
@NotNull(message = "视频拉流地址不能为空!") | |||
@ApiModelProperty(value = "视频拉流地址不能为空") | |||
//@NotNull(message = "视频拉流地址不能为空!") | |||
@ApiModelProperty(value = "视频拉流地址") | |||
private String pullUrl; | |||
@ApiModelProperty(value = "任务状态1待执行 2执行中") |
@@ -30,5 +30,5 @@ public interface IThInspectionService extends IBaseService<ThInspection> { | |||
AirWeatherVO getWeather(Integer airportId); | |||
List<InspectionVO> lineTrack(Integer id); | |||
JsonResult lineTrack(Integer missionId); | |||
} |
@@ -152,14 +152,22 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper, | |||
} | |||
@Override | |||
public List<InspectionVO> lineTrack(Integer id) { | |||
//解析标准srt文件里面的坐标,调用硬件接口,返回数据 | |||
public JsonResult lineTrack(Integer missionId) { | |||
ThMission thMission = missionMapper.selectById(missionId); | |||
Assert.notNull(thMission,"任务不能为空!"); | |||
Integer taskId=Integer.valueOf(thMission.getInspectionLine()); | |||
//解析标准srt文件里面的坐标,调用硬件接口,返回数据 | |||
String url = CommonConfig.airportUrl + "/api/airportInterface/getLocationById"; | |||
String param="id="+taskId; | |||
String airportLine = HttpUtils.sendGet(url, param); | |||
JsonResult jsonResult = JacksonUtil.json2pojo(airportLine, JsonResult.class); | |||
if(ObjectUtil.isEmpty(jsonResult) || Objects.requireNonNull(jsonResult).getCode() != 0) { | |||
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取标准航线信息失败,请重试"); | |||
} | |||
return null; | |||
System.out.println(jsonResult.getData().toString()); | |||
return jsonResult; | |||
} | |||