Sfoglia il codice sorgente

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

tags/V1.0.0^2
douzhenjun 1 anno fa
parent
commit
678c8c6447
2 ha cambiato i file con 18 aggiunte e 7 eliminazioni
  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 Vedi File

import com.tuoheng.admin.utils.*; import com.tuoheng.admin.utils.*;
import com.tuoheng.admin.vo.AirWeatherVO; import com.tuoheng.admin.vo.AirWeatherVO;
import com.tuoheng.admin.vo.DspCallbackVo; import com.tuoheng.admin.vo.DspCallbackVo;
import com.tuoheng.admin.vo.DspInspection.AirPortVO;
import com.tuoheng.admin.vo.LiveChannelVo; import com.tuoheng.admin.vo.LiveChannelVo;
import com.tuoheng.common.core.common.BaseEntity; import com.tuoheng.common.core.common.BaseEntity;
import com.tuoheng.common.core.enums.MarkEnum; import com.tuoheng.common.core.enums.MarkEnum;
* 判断机场是否空闲,如果不空闲,直接返回 * 判断机场是否空闲,如果不空闲,直接返回
*/ */
JsonResult result = airportService.airport(); 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 新增一条巡检任务数据, 默认状态为待飞行, 同时更新对应的入侵事件, 绑定这个任务的id
*/ */

+ 2
- 1
tuoheng-service/tuoheng-admin/src/main/resources/application-dev.yml Vedi File

#平台地址 #平台地址
alert-url: http://192.168.11.11:7011/alert/admin alert-url: http://192.168.11.11:7011/alert/admin
#airport配置地址 #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巡检云配置地址
dsp-inspection-url: http://192.168.11.11:7011 dsp-inspection-url: http://192.168.11.11:7011
# 文件配置 # 文件配置

Loading…
Annulla
Salva