소스 검색

修改立即执行判断机场是否空闲的逻辑

tags/V1.0.0^2
douzhenjun 1 년 전
부모
커밋
678c8c6447
2개의 변경된 파일18개의 추가작업 그리고 7개의 파일을 삭제
  1. +16
    -6
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/InspectionServiceImpl.java
  2. +2
    -1
      tuoheng-service/tuoheng-admin/src/main/resources/application-dev.yml

+ 16
- 6
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/InspectionServiceImpl.java 파일 보기

@@ -30,6 +30,7 @@ import com.tuoheng.admin.third.dsp.IDspService;
import com.tuoheng.admin.utils.*;
import com.tuoheng.admin.vo.AirWeatherVO;
import com.tuoheng.admin.vo.DspCallbackVo;
import com.tuoheng.admin.vo.DspInspection.AirPortVO;
import com.tuoheng.admin.vo.LiveChannelVo;
import com.tuoheng.common.core.common.BaseEntity;
import com.tuoheng.common.core.enums.MarkEnum;
@@ -169,13 +170,22 @@ public class InspectionServiceImpl extends ServiceImpl<InspectionMapper, Inspect
* 判断机场是否空闲,如果不空闲,直接返回
*/
JsonResult result = airportService.airport();
JSONObject jsonObject = (JSONObject) result.getData();
Integer status = jsonObject.getIntValue("status");
//2表示不可用
if(status == 2){
return JsonResult.success(status, "该机场正在执行任务");
if(ObjectUtils.isNull(result.getData())){
return JsonResult.success("没有可用的机场!");
}
System.out.println(result.getData().getClass());
boolean isFree = false;//机场是否空闲的标记
List<AirPortVO> airpotVoList = (List<AirPortVO>) result.getData();
for (AirPortVO airPortVO : airpotVoList) {
if(airPortVO.getStatus().equals(1)){//status=1:空闲,
isFree = true;
break;
}
}
if(!isFree){
return JsonResult.success("所有机场正在执行任务");
}
/*
新增一条巡检任务数据, 默认状态为待飞行, 同时更新对应的入侵事件, 绑定这个任务的id
*/

+ 2
- 1
tuoheng-service/tuoheng-admin/src/main/resources/application-dev.yml 파일 보기

@@ -112,7 +112,8 @@ tuoheng:
#平台地址
alert-url: http://192.168.11.11:7011/alert/admin
#airport配置地址
airport-url: http://192.168.11.22:9060
# airport-url: http://192.168.11.22:9060
airport-url: https://airport-test.t-aaron.com
# dsp巡检云配置地址
dsp-inspection-url: http://192.168.11.11:7011
# 文件配置

Loading…
취소
저장