Commit 3478af19 authored by tangwei's avatar tangwei

增加acm 信息查询接口

parent 0f0285dd
package com.yeejoin.amos.boot.module.jcs.biz.controller; package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto; import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil; import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftListTreeDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftListTreeDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft; import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AircraftServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AircraftServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -28,10 +34,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -28,10 +34,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
...@@ -51,6 +54,9 @@ public class AircraftController extends BaseController { ...@@ -51,6 +54,9 @@ public class AircraftController extends BaseController {
DataSourcesImpl dataSourcesImpl; DataSourcesImpl dataSourcesImpl;
@Autowired @Autowired
IotFeignClient iotFeignClient; IotFeignClient iotFeignClient;
@Autowired
private AlertFormValueServiceImpl iAlertFormValueService;
/** /**
* 新增航空器信息 * 新增航空器信息
* *
...@@ -195,7 +201,37 @@ public class AircraftController extends BaseController { ...@@ -195,7 +201,37 @@ public class AircraftController extends BaseController {
} }
} }
return ResponseHelper.buildResponse(map1); return ResponseHelper.buildResponse(map1);
} }
/**
*
* 通过航班号,查询最新的航班信息
*
* **/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getAircraftDetailsByAlertId/{id}")
@ApiOperation(httpMethod = "GET", value = "根据灾情id 查询最新的航班信息", notes = "根据灾情id 查询最新的航班信息")
public ResponseModel<Map<String, Object>> getAircraftDetailsByAlertId(@PathVariable Long id) {
QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", id);
// 警情动态表单数据
List<KeyValueLabel> listdate =new ArrayList<>();
List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper);
String num=null;
if(list!=null&&list.size()>0) {
for (AlertFormValue alertFormValue : list) {
if("flightNumber".equals(alertFormValue.getFieldCode())){
num=alertFormValue.getFieldValue();
}
}
}
Map<String, Object> map=new HashedMap();
ResponseModel<Map<String, Object>> dataModel= iotFeignClient.getDynamicFlightInfo(num);
if(dataModel!=null) {
map= dataModel.getResult();
}
return ResponseHelper.buildResponse(map);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment