浏览代码

修改根据机场任务ID获取航线

pull/91/head
wanjing 10 个月前
父节点
当前提交
5060ba12c0
共有 1 个文件被更改,包括 10 次插入10 次删除
  1. +10
    -10
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airportline/query/inspection/QueryAirportLineByAirportService.java

+ 10
- 10
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airportline/query/inspection/QueryAirportLineByAirportService.java 查看文件

@@ -34,31 +34,31 @@ public class QueryAirportLineByAirportService {
* @return
*/
public JsonResult getAirportLineList(Inspection inspection) {
log.info("进入根据任务ID获取航线,从机场平台获取");
log.info("进入根据机场任务ID获取航线,从机场平台获取, inspectionId={}, airportTaskId={}", inspection.getId(), inspection.getAirportTaskId());
if(inspection.getInspectionType() == InspectionTypeEnum.MABNNEDFLIGHT.getCode()){
return JsonResult.success("飞行任务没有航线");
}
Integer inspectionLine = inspection.getInspectionLine();
JsonResult result = this.checkParam(inspectionLine);
Integer airportTaskId = inspection.getAirportTaskId();
JsonResult result = this.checkParam(airportTaskId);
if (0 != result.getCode()) {
log.info("根据任务ID获取航线:校验参数失败:{}", result.getMsg());
return result;
}
JsonResult jsonResult = this.getAirPortLocation(inspectionLine);
JsonResult jsonResult = this.getAirPortLocation(airportTaskId);
return JsonResult.success(jsonResult);
}

private JsonResult checkParam(Integer inspectionLine) {
if (ObjectUtil.isEmpty(inspectionLine)) {
log.info("进入根据任务ID获取航线,从机场平台获取业务,航线ID为空,inspectionLine={}", inspectionLine);
throw new ServiceException("航线ID为空");
private JsonResult checkParam(Integer airportTaskId) {
if (ObjectUtil.isEmpty(airportTaskId) || 0 == airportTaskId) {
log.info("进入根据任务ID获取航线,从机场平台获取业务,机场任务ID为空");
throw new ServiceException("机场任务ID为空");
}
return JsonResult.success();
}

private JsonResult getAirPortLocation(Integer inspectionLine) {
private JsonResult getAirPortLocation(Integer airportTaskId) {
String url = CommonConfig.airportURL + SystemConstant.API_AIRPORT_LOCATION;
String param = "id=" + inspectionLine;
String param = "id=" + airportTaskId;
String airPortLineLocationStr = HttpUtils.sendGet(url, param);
if (StringUtils.isEmpty(airPortLineLocationStr)) {
log.info("调用机场平台,查询航线:机场接口返回数据为空:airPortLineLocationStr={}",airPortLineLocationStr);

正在加载...
取消
保存